1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-09-30 23:26:42 +02:00

type definitions v0.8

This commit is contained in:
Thomas Wilkerling
2025-03-16 22:00:08 +01:00
parent be80bb0513
commit 44153a67ad
96 changed files with 7121 additions and 5089 deletions

View File

@@ -2321,10 +2321,10 @@ for(let i = 0; i < files.length; i++){
- Using the `async` variants like `.searchAsync` is now deprecated (but still works), asynchronous responses will always return from Worker-Index and from Persistent-Index, everything else will return a non-promised result. Having both types of methods looks like the developers can choose between them, but they can't. - Using the `async` variants like `.searchAsync` is now deprecated (but still works), asynchronous responses will always return from Worker-Index and from Persistent-Index, everything else will return a non-promised result. Having both types of methods looks like the developers can choose between them, but they can't.
- Any of your exports from versions below v0.8 are not compatible to import into v0.8 - Any of your exports from versions below v0.8 are not compatible to import into v0.8
## Not finished yet ## What's next?
Unfortunately, not everything could be finished and needs to be done in the upcoming version. Unfortunately, not everything could be finished and needs to be done in the upcoming version.
- The `Resolver` does not support Document-Indexes, there is still some work to do. - The `Resolver` currently does not support Document-Indexes, there is still some work to do.
- Config serialization for persistent indexes (store configuration, check migrations, import and restore field configurations) - Config serialization for persistent indexes (store configuration, check migrations, import and restore field configurations)
- Tooling for persistent indexes (list all tables, remove tables) - Tooling for persistent indexes (list all tables, remove tables)

View File

@@ -76,8 +76,8 @@
<div id="suggestions"></div> <div id="suggestions"></div>
<script type="module"> <script type="module">
import { Document, Charset } from "../dist/flexsearch.bundle.module.min.js"; import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.module.min.js";
import data from "./data/movies.js"; import data from "https://rawcdn.githack.com/nextapps-de/flexsearch/master/demo/data/movies.js";
(function(){ (function(){

View File

@@ -957,11 +957,11 @@ async function handler(data) {
case "init": case "init":
/** @type IndexOptions */ /** @type {IndexOptions} */
let options = data["options"] || {}; let options = data["options"] || {};
let filepath = options.config; let filepath = options.config;
if(filepath){ if(filepath){
options = filepath; options = options;
// will be replaced after build with the line below because // will be replaced after build with the line below because
// there is an issue with closure compiler dynamic import // there is an issue with closure compiler dynamic import
options = (await import(filepath))["default"]; options = (await import(filepath))["default"];
@@ -1007,7 +1007,7 @@ let pid = 0;
* @constructor * @constructor
*/ */
function WorkerIndex(options = {}){ function WorkerIndex(options = /** @type IndexOptions */ ({})){
if(!this || this.constructor !== WorkerIndex) { if(!this || this.constructor !== WorkerIndex) {
return new WorkerIndex(options); return new WorkerIndex(options);
@@ -2939,7 +2939,7 @@ function intersect_union(mandatory, arrays) {
* @param {number|DocumentSearchOptions=} limit * @param {number|DocumentSearchOptions=} limit
* @param {DocumentSearchOptions=} options * @param {DocumentSearchOptions=} options
* @param {Array<Array>=} _promises For internal use only. * @param {Array<Array>=} _promises For internal use only.
* @returns {Promise|Array} * @returns {DocumentSearchResults|EnrichedDocumentSearchResults|MergedDocumentSearchResults|Promise<DocumentSearchResults|EnrichedDocumentSearchResults|MergedDocumentSearchResults>}
*/ */
Document.prototype.search = function(query, limit, options, _promises){ Document.prototype.search = function(query, limit, options, _promises){
@@ -2955,16 +2955,17 @@ Document.prototype.search = function(query, limit, options, _promises){
} }
} }
let result = [], result_field = []; let result = [];
let result_field = [];
let pluck, enrich, merge, suggest; let pluck, enrich, merge, suggest;
let field, tag, offset, count = 0, highlight; let field, tag, offset, count = 0, highlight;
if(options){ if(options){
if(is_array(options)){ if(is_array(options)){
options = { options = /** @type DocumentSearchOptions */ ({
index: options index: options
}; });
} }
query = options.query || query; query = options.query || query;
@@ -3496,8 +3497,9 @@ function Document(options){
return new Document(options); return new Document(options);
} }
/** @type DocumentDescriptor */ const document = /** @type DocumentDescriptor */ (
const document = options.document || options.doc || options; options.document || options.doc || options
);
let tmp, keystore; let tmp, keystore;
this.tree = []; this.tree = [];
@@ -3514,7 +3516,7 @@ function Document(options){
{ {
// todo support custom filter function // todo support custom filter function
this.storetree = (tmp = document.store || null) && tmp !== true && []; this.storetree = (tmp = document.store || null) && tmp && tmp !== true && [];
this.store = tmp && ( this.store = tmp && (
keystore && SUPPORT_KEYSTORE keystore && SUPPORT_KEYSTORE
? new KeystoreMap(keystore) ? new KeystoreMap(keystore)
@@ -3620,7 +3622,7 @@ function Document(options){
let index;// = this.index.get(field); let index;// = this.index.get(field);
//if(!index){ //if(!index){
// create raw index when not exists // create raw index when not exists
this.index.set(field, index = new Index({}, this.reg)); this.index.set(field, index = new Index(/** @type IndexOptions */ ({}), this.reg));
// copy and push to the field selection // copy and push to the field selection
if(fields === this.field){ if(fields === this.field){
fields = fields.slice(0); fields = fields.slice(0);
@@ -3712,7 +3714,7 @@ function parse_descriptor(options, document){
key = key.field; key = key.field;
} }
opt = /** @type DocumentIndexOptions */ ( opt = /** @type IndexOptions */ (
is_object(opt) is_object(opt)
? Object.assign({}, options, opt) ? Object.assign({}, options, opt)
: options : options
@@ -3732,7 +3734,7 @@ function parse_descriptor(options, document){
} }
if(!this.worker){ if(!this.worker){
index.set(key, new Index(opt, this.reg)); index.set(key, new Index(/** @type IndexOptions */ (opt), this.reg));
} }
if(opt.custom){ if(opt.custom){
@@ -3942,9 +3944,9 @@ Document.prototype.cleanup = function(){
} }
/** /**
* @param {string|Object} query * @param {string|SearchOptions|DocumentSearchOptions} query
* @param {number|Object=} limit * @param {number|SearchOptions|DocumentSearchOptions=} limit
* @param {Object=} options * @param {SearchOptions|DocumentSearchOptions=} options
* @this {Index|Document} * @this {Index|Document}
* @returns {Array<number|string>|Promise} * @returns {Array<number|string>|Promise}
*/ */
@@ -4125,7 +4127,7 @@ const options$4 = {
matcher: matcher matcher: matcher
}; };
/** @type EncoderOptions */ /** @type {EncoderOptions} */
const options$3 = { const options$3 = {
normalize: true, normalize: true,
dedupe: false, dedupe: false,
@@ -4259,7 +4261,7 @@ var Charset = {
// COMPILER BLOCK --> // COMPILER BLOCK -->
/** /**
* @enum {Object} * @type {Object<string, IndexOptions>}
* @const * @const
*/ */
@@ -4293,24 +4295,28 @@ const presets = {
/** /**
* *
* @param {!IndexOptions|string} options * @param {IndexOptions|string} options
* @return {IndexOptions} * @return {IndexOptions}
*/ */
function apply_preset(options){ function apply_preset(options){
const preset = is_string(options) const preset = /** @type string */ (
? options is_string(options)
: options["preset"]; ? options
: options.preset
);
if(preset){ if(preset){
if(!presets[preset]){ if(!presets[preset]){
console.warn("Preset not found: " + preset); console.warn("Preset not found: " + preset);
} }
options = Object.assign({}, presets[preset], /** @type {Object} */ (options)); options = /** @type IndexOptions */ (
Object.assign({}, presets[preset], /** @type {Object} */ (options))
);
} }
return options; return /** @type IndexOptions */ (options);
} }
const data = create_object(); const data = create_object();
@@ -4788,8 +4794,8 @@ function resolve_default(result, limit, offset, enrich){
function enrich_result(ids){ function enrich_result(ids){
for(let i = 0; i < ids.length; i++){ for(let i = 0; i < ids.length; i++){
ids[i] = { ids[i] = {
score: i, "score": i,
id: ids[i] "id": ids[i]
}; };
} }
return ids; return ids;
@@ -5571,7 +5577,7 @@ function set_resolve(resolve){
* @param {string|SearchOptions} query * @param {string|SearchOptions} query
* @param {number|SearchOptions=} limit * @param {number|SearchOptions=} limit
* @param {SearchOptions=} options * @param {SearchOptions=} options
* @returns {Array|Resolver|Promise<Array|Resolver>} * @returns {SearchResults|EnrichedSearchResults|Resolver|Promise<SearchResults|EnrichedSearchResults|Resolver>}
*/ */
Index.prototype.search = function(query, limit, options){ Index.prototype.search = function(query, limit, options){
@@ -5589,7 +5595,7 @@ Index.prototype.search = function(query, limit, options){
let result = []; let result = [];
let length; let length;
let context, suggest, offset = 0, resolve, enrich, tag, boost; let context, suggest, offset = 0, resolve, enrich, tag, boost, resolution;
if(options){ if(options){
query = options.query || query; query = options.query || query;
@@ -5601,6 +5607,7 @@ Index.prototype.search = function(query, limit, options){
resolve || (global_resolve = 0); resolve || (global_resolve = 0);
enrich = resolve && options.enrich; enrich = resolve && options.enrich;
boost = options.boost; boost = options.boost;
resolution = options.resolution;
tag = this.db && options.tag; tag = this.db && options.tag;
} }
else { else {
@@ -5611,15 +5618,16 @@ Index.prototype.search = function(query, limit, options){
// do not force a string as input // do not force a string as input
// https://github.com/nextapps-de/flexsearch/issues/432 // https://github.com/nextapps-de/flexsearch/issues/432
query = /** @type {Array<string>} */ (this.encoder.encode(query)); /** @type {Array<string>} */
length = query.length; let query_terms = this.encoder.encode(query);
length = query_terms.length;
limit || !resolve || (limit = 100); limit || !resolve || (limit = 100);
// fast path single term // fast path single term
if(length === 1){ if(length === 1){
return single_term_query.call( return single_term_query.call(
this, this,
query[0], // term query_terms[0], // term
"", // ctx "", // ctx
limit, limit,
offset, offset,
@@ -5638,8 +5646,8 @@ Index.prototype.search = function(query, limit, options){
if(length === 2 && context && !suggest){ if(length === 2 && context && !suggest){
return single_term_query.call( return single_term_query.call(
this, this,
query[0], // term query_terms[0], // term
query[1], // ctx query_terms[1], // ctx
limit, limit,
offset, offset,
resolve, resolve,
@@ -5659,7 +5667,7 @@ Index.prototype.search = function(query, limit, options){
const query_new = []; const query_new = [];
// if(context){ // if(context){
// keyword = query[0]; // keyword = query_terms[0];
// dupes[keyword] = 1; // dupes[keyword] = 1;
// query_new.push(keyword); // query_new.push(keyword);
// maxlength = minlength = keyword.length; // maxlength = minlength = keyword.length;
@@ -5668,7 +5676,7 @@ Index.prototype.search = function(query, limit, options){
for(let i = 0, term; i < length; i++){ for(let i = 0, term; i < length; i++){
term = query[i]; term = query_terms[i];
if(term && !dupes[term]){ if(term && !dupes[term]){
@@ -5696,7 +5704,7 @@ Index.prototype.search = function(query, limit, options){
// } // }
} }
query = query_new; query_terms = query_new;
length = query.length; length = query.length;
} }
@@ -5714,7 +5722,7 @@ Index.prototype.search = function(query, limit, options){
if(length === 1){ if(length === 1){
return single_term_query.call( return single_term_query.call(
this, this,
query[0], // term query_terms[0], // term
"", // ctx "", // ctx
limit, limit,
offset, offset,
@@ -5728,8 +5736,8 @@ Index.prototype.search = function(query, limit, options){
if(length === 2 && context && !suggest){ if(length === 2 && context && !suggest){
return single_term_query.call( return single_term_query.call(
this, this,
query[0], // term query_terms[0], // term
query[1], // ctx query_terms[1], // ctx
limit, limit,
offset, offset,
resolve, resolve,
@@ -5741,7 +5749,7 @@ Index.prototype.search = function(query, limit, options){
if(length > 1){ if(length > 1){
if(context){ if(context){
// start with context right away // start with context right away
keyword = query[0]; keyword = query_terms[0];
index = 1; index = 1;
} }
// todo // todo
@@ -5750,17 +5758,21 @@ Index.prototype.search = function(query, limit, options){
// bigger terms has less occurrence // bigger terms has less occurrence
// this might also reduce the intersection task // this might also reduce the intersection task
// todo check intersection order // todo check intersection order
query.sort(sort_by_length_down); query_terms.sort(sort_by_length_down);
} }
} }
if(!resolution && resolution !== 0){
resolution = this.resolution;
}
// from this point there are just multi-term queries // from this point there are just multi-term queries
if(this.db){ if(this.db){
if(this.db.search){ if(this.db.search){
// when the configuration is not supported it returns false // when the configuration is not supported it returns false
const result = this.db.search(this, query, limit, offset, suggest, resolve, enrich, tag); const result = this.db.search(this, query_terms, limit, offset, suggest, resolve, enrich, tag);
if(result !== false) return result; if(result !== false) return result;
} }
@@ -5769,7 +5781,7 @@ Index.prototype.search = function(query, limit, options){
for(let arr, term; index < length; index++){ for(let arr, term; index < length; index++){
term = query[index]; term = query_terms[index];
if(keyword){ if(keyword){
@@ -5799,7 +5811,7 @@ Index.prototype.search = function(query, limit, options){
arr, arr,
result, result,
suggest, suggest,
self.resolution, resolution,
// 0, // /** @type {!number} */ (limit), // 0, // /** @type {!number} */ (limit),
// 0, // offset, // 0, // offset,
// length === 1 // length === 1
@@ -5833,14 +5845,14 @@ Index.prototype.search = function(query, limit, options){
} }
return resolve return resolve
? intersect$1(result, self.resolution, /** @type {number} */ (limit), offset, suggest, boost, resolve) ? intersect$1(result, resolution, /** @type {number} */ (limit), offset, suggest, boost, resolve)
: new Resolver(result[0]) : new Resolver(result[0])
}()); }());
} }
for(let arr, term; index < length; index++){ for(let arr, term; index < length; index++){
term = query[index]; term = query_terms[index];
if(keyword){ if(keyword){
@@ -5869,7 +5881,7 @@ Index.prototype.search = function(query, limit, options){
arr, arr,
result, result,
suggest, suggest,
this.resolution, resolution,
// 0, // /** @type {!number} */ (limit), // 0, // /** @type {!number} */ (limit),
// 0, // offset, // 0, // offset,
// length === 1 // length === 1
@@ -5896,13 +5908,13 @@ Index.prototype.search = function(query, limit, options){
} }
else if(length === 1){ else if(length === 1){
return resolve return resolve
? resolve_default(result[0], limit, offset) ? resolve_default(result[0], /** @type {number} */ (limit), offset)
: new Resolver(result[0]); : new Resolver(result[0]);
} }
} }
} }
result = intersect$1(result, this.resolution, limit, offset, suggest, boost, resolve); result = intersect$1(result, resolution, limit, offset, suggest, boost, resolve);
return resolve return resolve
? result ? result
@@ -5947,8 +5959,8 @@ function single_term_query(term, keyword, limit, offset, resolve, enrich, tag){
* @private * @private
* @param {Array} arr * @param {Array} arr
* @param {Array} result * @param {Array} result
* @param {Array} suggest * @param {boolean|null=} suggest
* @param {number} resolution * @param {number=} resolution
* @return {Array|boolean|undefined} * @return {Array|boolean|undefined}
*/ */
@@ -6238,12 +6250,16 @@ function Index(options, _register){
tick("Index.create"); tick("Index.create");
options = options options = /** @type IndexOptions */ (
? apply_preset(options) options
: {}; ? apply_preset(options)
: {}
);
let tmp = options.context;
/** @type ContextOptions */ /** @type ContextOptions */
const context = options.context || {}; const context = tmp === true
? { depth: 1 } : tmp || {};
const encoder = is_string(options.encoder) const encoder = is_string(options.encoder)
? Charset[options.encoder] ? Charset[options.encoder]
: options.encode || options.encoder || ( : options.encode || options.encoder || (
@@ -6253,7 +6269,7 @@ function Index(options, _register){
this.encoder = encoder.encode this.encoder = encoder.encode
? encoder ? encoder
: typeof encoder === "object" : typeof encoder === "object"
? (new Encoder(encoder) ? (new Encoder(/** @type {EncoderOptions} */ (encoder))
) )
: { encode: encoder }; : { encode: encoder };
@@ -6262,7 +6278,6 @@ function Index(options, _register){
this.compress = options.compress || options.compression || false; this.compress = options.compress || options.compression || false;
} }
let tmp;
this.resolution = options.resolution || 9; this.resolution = options.resolution || 9;
this.tokenize = tmp = options.tokenize || "strict"; this.tokenize = tmp = options.tokenize || "strict";
this.depth = (tmp === "strict" && context.depth) || 0; this.depth = (tmp === "strict" && context.depth) || 0;
@@ -6280,7 +6295,7 @@ function Index(options, _register){
? (tmp && SUPPORT_KEYSTORE ? new KeystoreMap(tmp) : new Map()) ? (tmp && SUPPORT_KEYSTORE ? new KeystoreMap(tmp) : new Map())
: (tmp && SUPPORT_KEYSTORE ? new KeystoreSet(tmp) : new Set()) : (tmp && SUPPORT_KEYSTORE ? new KeystoreSet(tmp) : new Set())
); );
this.resolution_ctx = context.resolution || 1; this.resolution_ctx = context.resolution || 3;
this.rtl = (encoder.rtl) || options.rtl || false; this.rtl = (encoder.rtl) || options.rtl || false;
{ {
@@ -6469,7 +6484,7 @@ function IdxDB(name, config = {}){
} }
if(typeof name === "object"){ if(typeof name === "object"){
name = name.name; name = name.name;
config = name; config = /** @type PersistentOptions */ (name);
} }
if(!name){ if(!name){
console.info("Default storage space was used, because a name was not passed."); console.info("Default storage space was used, because a name was not passed.");

File diff suppressed because it is too large Load Diff

View File

@@ -5,98 +5,101 @@
* Hosted by Nextapps GmbH * Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;var v;function z(a,b,c){const d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var f=new Map(c);for(var g of a)f.set(g[0],g[1]);return f}if(b===Set){g=new Set(c);for(f of a.values())g.add(f);return g}}}return a}return c}return"undefined"===e?b:a}function B(){return Object.create(null)}function aa(a,b){return b.length-a.length} (function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;var u;function z(a,b,c){const d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(k){return a(c(k))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var f=new Map(c);for(var g of a)f.set(g[0],g[1]);return f}if(b===Set){g=new Set(c);for(f of a.values())g.add(f);return g}}}return a}return c}return"undefined"===e?b:a}function C(){return Object.create(null)}function aa(a,b){return b.length-a.length}
function F(a){return"string"===typeof a}function G(a){return"object"===typeof a}function ba(a){const b=[];for(const c of a.keys())b.push(c);return b}function J(a,b){if(F(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}function ca(a){let b=0;for(let c=0,d;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var da=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb", function F(a){return"string"===typeof a}function G(a){return"object"===typeof a}function ba(a){const b=[];for(const c of a.keys())b.push(c);return b}function J(a,b){if(F(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}function ca(a){let b=0;for(let c=0,d;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var da=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb",
"u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"], "u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"],
["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0", ["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0",
"i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215", "i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215",
"u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af", "u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af",
"\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"], "\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"],
["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const ea=/[^\p{L}\p{N}]+/u,fa=/(\d{3})/g,ha=/(\D)(\d{3})/g,ia=/(\d{3})(\D)/g,ja="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])} ["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const ea=/[^\p{L}\p{N}]+/u,fa=/(\d{3})/g,ha=/(\D)(\d{3})/g,ia=/(\d{3})(\D)/g,ja="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])}u=K.prototype;
K.prototype.assign=function(a){this.normalize=z(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(f){this.split=/\s+/}this.numeric=d}else{try{this.split=z(c,ea,this.split)}catch(d){this.split= u.assign=function(a){this.normalize=z(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(f){this.split=/\s+/}this.numeric=d}else{try{this.split=z(c,ea,this.split)}catch(d){this.split=
/\s+/}this.numeric=z(this.numeric,!0)}this.prepare=z(a.prepare,null,this.prepare);this.finalize=z(a.finalize,null,this.finalize);ja||(this.mapper=new Map(da));this.rtl=a.rtl||!1;this.dedupe=z(a.dedupe,!0,this.dedupe);this.filter=z((c=a.filter)&&new Set(c),null,this.filter);this.matcher=z((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=z((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=z((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=z(a.replacer,null,this.replacer);this.minlength= /\s+/}this.numeric=z(this.numeric,!0)}this.prepare=z(a.prepare,null,this.prepare);this.finalize=z(a.finalize,null,this.finalize);ja||(this.mapper=new Map(da));this.rtl=a.rtl||!1;this.dedupe=z(a.dedupe,!0,this.dedupe);this.filter=z((c=a.filter)&&new Set(c),null,this.filter);this.matcher=z((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=z((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=z((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=z(a.replacer,null,this.replacer);this.minlength=
z(a.minlength,1,this.minlength);this.maxlength=z(a.maxlength,0,this.maxlength);if(this.cache=c=z(a.cache,!0,this.cache))this.L=null,this.S="number"===typeof c?c:2E5,this.H=new Map,this.J=new Map,this.A=this.h=128;this.B="";this.O=null;this.M="";this.P=null;if(this.matcher)for(const d of this.matcher.keys())this.B+=(this.B?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.M+=(this.M?"|":"")+d;return this}; z(a.minlength,1,this.minlength);this.maxlength=z(a.maxlength,0,this.maxlength);if(this.cache=c=z(a.cache,!0,this.cache))this.L=null,this.S="number"===typeof c?c:2E5,this.H=new Map,this.I=new Map,this.M=this.B=128;this.h="";this.N=null;this.A="";this.O=null;if(this.matcher)for(const d of this.matcher.keys())this.h+=(this.h?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.A+=(this.A?"|":"")+d;return this};
K.prototype.encode=function(a){if(this.cache&&a.length<=this.h)if(this.L){if(this.H.has(a))return this.H.get(a)}else this.L=setTimeout(ka,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ja?a.normalize("NFKD").replace(ja,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(ha,"$1 $2").replace(ia,"$1 $2").replace(fa,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer); u.addMatcher=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(2>a.length)return this.addMapper(a,b);this.matcher||(this.matcher=new Map);this.matcher.set(a,b);this.h+=(this.h?"|":"")+a;this.N=null;this.cache&&L(this);return this};u.addStemmer=function(a,b){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,b);this.A+=(this.A?"|":"")+a;this.O=null;this.cache&&L(this);return this};
let c=[],d=this.split||""===this.split?a.split(this.split):a;for(let f=0,g,h;f<d.length;f++){if(!(g=h=d[f]))continue;if(g.length<this.minlength)continue;if(b){c.push(g);continue}if(this.filter&&this.filter.has(g))continue;if(this.cache&&g.length<=this.A)if(this.L){var e=this.J.get(g);if(e||""===e){e&&c.push(e);continue}}else this.L=setTimeout(ka,50,this);let k;this.stemmer&&2<g.length&&(this.P||(this.P=new RegExp("(?!^)("+this.M+")$")),g=g.replace(this.P,l=>this.stemmer.get(l)),k=1);g&&k&&(g.length< u.addFilter=function(a){this.filter||(this.filter=new Set);this.filter.add(a);this.cache&&L(this);return this};u.addMapper=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(1<a.length)return this.addMatcher(a,b);this.mapper||(this.mapper=new Map);this.mapper.set(a,b);this.cache&&L(this);return this};u.addReplacer=function(a,b){"string"===typeof a&&(a=new RegExp(a,"g"));this.replacer||(this.replacer=[]);this.replacer.push(a,b||"");this.cache&&L(this);return this};
this.minlength||this.filter&&this.filter.has(g))&&(g="");if(g&&(this.mapper||this.dedupe&&1<g.length)){e="";for(let l=0,m="",p,n;l<g.length;l++)p=g.charAt(l),p===m&&this.dedupe||((n=this.mapper&&this.mapper.get(p))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=p);g=e}this.matcher&&1<g.length&&(this.O||(this.O=new RegExp("("+this.B+")","g")),g=g.replace(this.O,l=>this.matcher.get(l)));if(g&&this.replacer)for(e=0;g&&e<this.replacer.length;e+=2)g=g.replace(this.replacer[e],this.replacer[e+1]);this.cache&& function L(a){a.H.clear();a.I.clear()}
h.length<=this.A&&(this.J.set(h,g),this.J.size>this.S&&(this.J.clear(),this.A=this.A/1.1|0));g&&c.push(g)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.h&&(this.H.set(a,c),this.H.size>this.S&&(this.H.clear(),this.h=this.h/1.1|0));return c};function ka(a){a.L=null;a.H.clear();a.J.clear()};async function la(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(b=d.config)&&(d=(await import(b))["default"]);(b=a.factory)?(Function("return "+b)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);postMessage({id:a.id});break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let M=0; u.encode=function(a){if(this.cache&&a.length<=this.B)if(this.L){if(this.H.has(a))return this.H.get(a)}else this.L=setTimeout(ka,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ja?a.normalize("NFKD").replace(ja,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(ha,"$1 $2").replace(ia,"$1 $2").replace(fa,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let c=[],
function N(a={}){function b(g){function h(k){k=k.data||k;const l=k.id,m=l&&e.h[l];m&&(m(k.msg),delete e.h[l])}this.worker=g;this.h=B();if(this.worker){d?this.worker.on("message",h):this.worker.onmessage=h;if(a.config)return new Promise(function(k){e.h[++M]=function(){k(e)};e.worker.postMessage({id:M,task:"init",factory:c,options:a})});this.worker.postMessage({task:"init",factory:c,options:a});return this}}if(!this||this.constructor!==N)return new N(a);let c="undefined"!==typeof self?self._factory:"undefined"!== d=this.split||""===this.split?a.split(this.split):a;for(let f=0,g,k;f<d.length;f++){if(!(g=k=d[f]))continue;if(g.length<this.minlength)continue;if(b){c.push(g);continue}if(this.filter&&this.filter.has(g))continue;if(this.cache&&g.length<=this.M)if(this.L){var e=this.I.get(g);if(e||""===e){e&&c.push(e);continue}}else this.L=setTimeout(ka,50,this);let h;this.stemmer&&2<g.length&&(this.O||(this.O=new RegExp("(?!^)("+this.A+")$")),g=g.replace(this.O,l=>this.stemmer.get(l)),h=1);g&&h&&(g.length<this.minlength||
typeof window?window._factory:null;c&&(c=c.toString());const d="undefined"===typeof window,e=this,f=ma(c,d,a.worker);return f.then?f.then(function(g){return b.call(e,g)}):b.call(this,f)}O("add");O("append");O("search");O("update");O("remove"); this.filter&&this.filter.has(g))&&(g="");if(g&&(this.mapper||this.dedupe&&1<g.length)){e="";for(let l=0,m="",q,n;l<g.length;l++)q=g.charAt(l),q===m&&this.dedupe||((n=this.mapper&&this.mapper.get(q))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=q);g=e}this.matcher&&1<g.length&&(this.N||(this.N=new RegExp("("+this.h+")","g")),g=g.replace(this.N,l=>this.matcher.get(l)));if(g&&this.replacer)for(e=0;g&&e<this.replacer.length;e+=2)g=g.replace(this.replacer[e],this.replacer[e+1]);this.cache&&k.length<=
function O(a){N.prototype[a]=N.prototype[a+"Async"]=async function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;"function"===typeof d&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){b.h[++M]=f;b.worker.postMessage({task:a,id:M,args:c})});return e?(d.then(e),this):d}} this.M&&(this.I.set(k,g),this.I.size>this.S&&(this.I.clear(),this.M=this.M/1.1|0));g&&c.push(g)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.B&&(this.H.set(a,c),this.H.size>this.S&&(this.H.clear(),this.B=this.B/1.1|0));return c};function ka(a){a.L=null;a.H.clear();a.I.clear()};async function la(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(b=a.factory)?(Function("return "+b)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new M(d);postMessage({id:a.id});break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let ma=0;
function ma(a,b,c){return b?"undefined"!==typeof module?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); }):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+la.toString()],{type:"text/javascript"}))):new window.Worker(F(c)?c:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js", function N(a={}){function b(g){function k(h){h=h.data||h;const l=h.id,m=l&&e.h[l];m&&(m(h.msg),delete e.h[l])}this.worker=g;this.h=C();if(this.worker){d?this.worker.on("message",k):this.worker.onmessage=k;if(a.config)return new Promise(function(h){e.h[++ma]=function(){h(e)};e.worker.postMessage({id:ma,task:"init",factory:c,options:a})});this.worker.postMessage({task:"init",factory:c,options:a});return this}}if(!this||this.constructor!==N)return new N(a);let c="undefined"!==typeof self?self._factory:"undefined"!==
"module/worker/worker.js"),{type:"module"})};function na(a){P.call(a,"add");P.call(a,"append");P.call(a,"search");P.call(a,"update");P.call(a,"remove")}function P(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let d;"function"===typeof c&&(d=c,delete b[b.length-1]);b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function oa(a,b=0){let c=[],d=[];b&&(b=25E4/b*5E3|0);for(const e of a.entries())d.push(e),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}function pa(a,b){b||(b=new Map);for(let c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b}function qa(a,b=0){let c=[],d=[];b&&(b=25E4/b*1E3|0);for(const e of a.entries())d.push([e[0],oa(e[1])[0]]),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c} typeof window?window._factory:null;c&&(c=c.toString());const d="undefined"===typeof window,e=this,f=na(c,d,a.worker);return f.then?f.then(function(g){return b.call(e,g)}):b.call(this,f)}O("add");O("append");O("search");O("update");O("remove");
function ra(a,b){b||(b=new Map);for(let c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],pa(d[1],e));return b}function sa(a){let b=[],c=[];for(const d of a.keys())c.push(d),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}function ta(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b} function O(a){N.prototype[a]=N.prototype[a+"Async"]=async function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;"function"===typeof d&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){b.h[++ma]=f;b.worker.postMessage({task:a,id:ma,args:c})});return e?(d.then(e),this):d}}
function ua(a,b,c,d,e,f,g=0){const h=d&&d.constructor===Array;var k=h?d.shift():d;if(!k)return this.export(a,b,e,f+1);if((k=a((b?b+".":"")+(g+1)+"."+c,JSON.stringify(k)))&&k.then){const l=this;return k.then(function(){return ua.call(l,a,b,c,h?d:null,e,f,g+1)})}return ua.call(this,a,b,c,h?d:null,e,f,g+1)};function va(a,b,c,d){let e=[];for(let f=0,g;f<a.index.length;f++)if(g=a.index[f],b>=g.length)b-=g.length;else{b=g[d?"splice":"slice"](b,c);const h=b.length;if(h&&(e=e.length?e.concat(b):b,c-=h,d&&(a.length-=h),!c))break;b=0}return e} function na(a,b,c){return b?"undefined"!==typeof module?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); }):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+la.toString()],{type:"text/javascript"}))):new window.Worker(F(c)?c:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js",
function Q(a){if(!this)return new Q(a);this.index=a?[a]:[];this.length=a?a.length:0;const b=this;return new Proxy([],{get(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){let f=0;for(let g=0,h,k;g<b.index.length;g++){h=b.index[g];k=h.indexOf(e);if(0<=k)return f+k;f+=h.length}return-1};if("includes"===d)return function(e){for(let f= "module/worker/worker.js"),{type:"module"})};function oa(a){P.call(a,"add");P.call(a,"append");P.call(a,"search");P.call(a,"update");P.call(a,"remove")}function P(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let d;"function"===typeof c&&(d=c,delete b[b.length-1]);b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function pa(a,b=0){let c=[],d=[];b&&(b=25E4/b*5E3|0);for(const e of a.entries())d.push(e),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}function qa(a,b){b||(b=new Map);for(let c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b}function ra(a,b=0){let c=[],d=[];b&&(b=25E4/b*1E3|0);for(const e of a.entries())d.push([e[0],pa(e[1])[0]]),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}
0;f<b.index.length;f++)if(b.index[f].includes(e))return!0;return!1};if("slice"===d)return function(e,f){return va(b,e||0,f||b.length,!1)};if("splice"===d)return function(e,f){return va(b,e||0,f||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/2**31|0])&&c[d]},set(c,d,e){c=d/2**31|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}Q.prototype.clear=function(){this.index.length=0};Q.prototype.destroy=function(){this.proxy=this.index=null}; function sa(a,b){b||(b=new Map);for(let c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],qa(d[1],e));return b}function ta(a){let b=[],c=[];for(const d of a.keys())c.push(d),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}function ua(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b}
Q.prototype.push=function(){};function R(a=8){if(!this)return new R(a);this.index=B();this.B=[];this.size=0;32<a?(this.h=wa,this.A=BigInt(a)):(this.h=xa,this.A=a)}R.prototype.get=function(a){const b=this.index[this.h(a)];return b&&b.get(a)};R.prototype.set=function(a,b){var c=this.h(a);let d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.B.push(d))}; function va(a,b,c,d,e,f,g=0){const k=d&&d.constructor===Array;var h=k?d.shift():d;if(!h)return this.export(a,b,e,f+1);if((h=a((b?b+".":"")+(g+1)+"."+c,JSON.stringify(h)))&&h.then){const l=this;return h.then(function(){return va.call(l,a,b,c,k?d:null,e,f,g+1)})}return va.call(this,a,b,c,k?d:null,e,f,g+1)};function wa(a,b,c,d){let e=[];for(let f=0,g;f<a.index.length;f++)if(g=a.index[f],b>=g.length)b-=g.length;else{b=g[d?"splice":"slice"](b,c);const k=b.length;if(k&&(e=e.length?e.concat(b):b,c-=k,d&&(a.length-=k),!c))break;b=0}return e}
function S(a=8){if(!this)return new S(a);this.index=B();this.h=[];32<a?(this.B=wa,this.A=BigInt(a)):(this.B=xa,this.A=a)}S.prototype.add=function(a){var b=this.B(a);let c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};v=R.prototype;v.has=S.prototype.has=function(a){const b=this.index[this.B(a)];return b&&b.has(a)};v.delete=S.prototype.delete=function(a){const b=this.index[this.B(a)];b&&b.delete(a)&&this.size--}; function Q(a){if(!this)return new Q(a);this.index=a?[a]:[];this.length=a?a.length:0;const b=this;return new Proxy([],{get(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){let f=0;for(let g=0,k,h;g<b.index.length;g++){k=b.index[g];h=k.indexOf(e);if(0<=h)return f+h;f+=k.length}return-1};if("includes"===d)return function(e){for(let f=
v.clear=S.prototype.clear=function(){this.index=B();this.h=[];this.size=0};v.values=S.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].values())yield b};v.keys=S.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].keys())yield b};v.entries=S.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].entries())yield b}; 0;f<b.index.length;f++)if(b.index[f].includes(e))return!0;return!1};if("slice"===d)return function(e,f){return wa(b,e||0,f||b.length,!1)};if("splice"===d)return function(e,f){return wa(b,e||0,f||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/2**31|0])&&c[d]},set(c,d,e){c=d/2**31|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}Q.prototype.clear=function(){this.index.length=0};Q.prototype.destroy=function(){this.proxy=this.index=null};
function xa(a){let b=2**this.A-1;if("number"==typeof a)return a&b;let c=0,d=this.A+1;for(let e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.A?c+2**31:c}function wa(a){let b=BigInt(2)**this.A-BigInt(1);var c=typeof a;if("bigint"===c)return a&b;if("number"===c)return BigInt(a)&b;c=BigInt(0);let d=this.A+BigInt(1);for(let e=0;e<a.length;e++)c=(c*d^BigInt(a.charCodeAt(e)))&b;return c};T.prototype.add=function(a,b,c){G(a)&&(b=a,a=J(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(let h=0,k;h<this.field.length;h++){k=this.D[h];var d=this.index.get(this.field[h]);if("function"===typeof k){var e=k(b);e&&d.add(a,e,!1,!0)}else if(e=k.I,!e||e(b))k.constructor===String?k=[""+k]:F(k)&&(k=[k]),ya(b,k,this.K,0,d,a,k[0],c)}if(this.tag)for(d=0;d<this.G.length;d++){var f=this.G[d];e=this.tag.get(this.N[d]);let h=B();if("function"===typeof f){if(f=f(b),!f)continue}else{var g= Q.prototype.push=function(){};function R(a=8){if(!this)return new R(a);this.index=C();this.B=[];this.size=0;32<a?(this.h=xa,this.A=BigInt(a)):(this.h=ya,this.A=a)}R.prototype.get=function(a){const b=this.index[this.h(a)];return b&&b.get(a)};R.prototype.set=function(a,b){var c=this.h(a);let d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.B.push(d))};
f.I;if(g&&!g(b))continue;f.constructor===String&&(f=""+f);f=J(b,f)}if(e&&f){F(f)&&(f=[f]);for(let k=0,l,m;k<f.length;k++)if(l=f[k],!h[l]&&(h[l]=1,(g=e.get(l))?m=g:e.set(l,m=[]),!c||!m.includes(a))){if(m.length===2**31-1){g=new Q(m);if(this.fastupdate)for(let p of this.reg.values())p.includes(m)&&(p[p.indexOf(m)]=g);e.set(l,m=g)}m.push(a);this.fastupdate&&((g=this.reg.get(a))?g.push(m):this.reg.set(a,[m]))}}}if(this.store&&(!c||!this.store.has(a))){let h;if(this.C){h=B();for(let k=0,l;k<this.C.length;k++){l= function S(a=8){if(!this)return new S(a);this.index=C();this.h=[];32<a?(this.B=xa,this.A=BigInt(a)):(this.B=ya,this.A=a)}S.prototype.add=function(a){var b=this.B(a);let c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};u=R.prototype;u.has=S.prototype.has=function(a){const b=this.index[this.B(a)];return b&&b.has(a)};u.delete=S.prototype.delete=function(a){const b=this.index[this.B(a)];b&&b.delete(a)&&this.size--};
this.C[k];if((c=l.I)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.U]}else if(F(l)||l.constructor===String){h[l]=b[l];continue}za(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function za(a,b,c,d,e,f){a=a[e];if(d===c.length-1)b[e]=f||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)za(a,b,c,d,e);else b=b[e]||(b[e]=B()),e=c[++d],za(a,b,c,d,e)} u.clear=S.prototype.clear=function(){this.index=C();this.h=[];this.size=0};u.values=S.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].values())yield b};u.keys=S.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].keys())yield b};u.entries=S.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].entries())yield b};
function ya(a,b,c,d,e,f,g,h){if(a=a[g])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)ya(a,b,c,d,e,f,g,h);else g=b[++d],ya(a,b,c,d,e,f,g,h);else e.db&&e.remove(f)};function Aa(a,b,c,d,e,f,g){const h=a.length;let k=[],l;var m;l=B();for(let p=0,n,q,r,t;p<b;p++)for(let u=0;u<h;u++)if(r=a[u],p<r.length&&(n=r[p]))for(let x=0;x<n.length;x++)q=n[x],(m=l[q])?l[q]++:(m=0,l[q]=1),t=k[m]||(k[m]=[]),g||(m=p+(u?0:f||0),t=t[m]||(t[m]=[])),t.push(q);if(a=k.length)if(e)k=1<k.length?Ba(k,d,c,g,0):(k=k[0]).length>c||d?k.slice(d,c+d):k;else{if(a<h)return[];k=k[a-1];if(c||d)if(g){if(k.length>c||d)k=k.slice(d,c+d)}else{e=[];for(let p=0,n;p<k.length;p++)if(n=k[p],n.length>d)d-=n.length; function ya(a){let b=2**this.A-1;if("number"==typeof a)return a&b;let c=0,d=this.A+1;for(let e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.A?c+2**31:c}function xa(a){let b=BigInt(2)**this.A-BigInt(1);var c=typeof a;if("bigint"===c)return a&b;if("number"===c)return BigInt(a)&b;c=BigInt(0);let d=this.A+BigInt(1);for(let e=0;e<a.length;e++)c=(c*d^BigInt(a.charCodeAt(e)))&b;return c};T.prototype.add=function(a,b,c){G(a)&&(b=a,a=J(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(let k=0,h;k<this.field.length;k++){h=this.D[k];var d=this.index.get(this.field[k]);if("function"===typeof h){var e=h(b);e&&d.add(a,e,!1,!0)}else if(e=h.J,!e||e(b))h.constructor===String?h=[""+h]:F(h)&&(h=[h]),za(b,h,this.K,0,d,a,h[0],c)}if(this.tag)for(d=0;d<this.G.length;d++){var f=this.G[d];e=this.tag.get(this.P[d]);let k=C();if("function"===typeof f){if(f=f(b),!f)continue}else{var g=
else{if(n.length>c||d)n=n.slice(d,c+d),c-=n.length,d&&(d-=n.length);e.push(n);if(!c)break}k=1<e.length?[].concat.apply([],e):e[0]}}return k} f.J;if(g&&!g(b))continue;f.constructor===String&&(f=""+f);f=J(b,f)}if(e&&f){F(f)&&(f=[f]);for(let h=0,l,m;h<f.length;h++)if(l=f[h],!k[l]&&(k[l]=1,(g=e.get(l))?m=g:e.set(l,m=[]),!c||!m.includes(a))){if(m.length===2**31-1){g=new Q(m);if(this.fastupdate)for(let q of this.reg.values())q.includes(m)&&(q[q.indexOf(m)]=g);e.set(l,m=g)}m.push(a);this.fastupdate&&((g=this.reg.get(a))?g.push(m):this.reg.set(a,[m]))}}}if(this.store&&(!c||!this.store.has(a))){let k;if(this.C){k=C();for(let h=0,l;h<this.C.length;h++){l=
function Ba(a,b,c,d,e){const f=[],g=B();let h;var k=a.length;let l,m=0;if(d)for(e=k-1;0<=e;e--)for(d=a[e],l=d.length,k=0;k<l;k++){if(h=d[k],!g[h])if(g[h]=1,b)b--;else if(f.push(h),f.length===c)return f}else{let p=ca(a);for(let n=0;n<p;n++)for(let q=k-1;0<=q;q--)if(l=(d=a[q][n])&&d.length)for(let r=0;r<l;r++)if(h=d[r],!g[h])if(g[h]=1,b)b--;else{let t=n+(q<k-1?e||0:0);(f[t]||(f[t]=[])).push(h);if(++m===c)return f}}return f} this.C[h];if((c=l.J)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.U]}else if(F(l)||l.constructor===String){k[l]=b[l];continue}Aa(b,k,l,0,l[0],m)}}this.store.set(a,k||b)}}return this};function Aa(a,b,c,d,e,f){a=a[e];if(d===c.length-1)b[e]=f||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)Aa(a,b,c,d,e);else b=b[e]||(b[e]=C()),e=c[++d],Aa(a,b,c,d,e)}
function Ca(a,b){const c=B(),d=[];for(let e=0,f;e<b.length;e++){f=b[e];for(let g=0;g<f.length;g++)c[f[g]]=1}for(let e=0,f;e<a.length;e++)f=a[e],1===c[f]&&(d.push(f),c[f]=2);return d};T.prototype.search=function(a,b,c,d){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let e=[],f=[],g;let h;let k;let l,m=0,p;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;g=c.pluck;h=c.merge;k=g||c.field||c.index;var n=this.tag&&c.tag;var q=this.store&&c.enrich;var r=c.suggest;p=c.highlight;b=c.limit||b;l=c.offset||0;b||(b=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var t=[];for(let y=0,w;y<n.length;y++)if(w=n[y],w.field&&w.tag){var u=w.tag;if(u.constructor===Array)for(var x=0;x< function za(a,b,c,d,e,f,g,k){if(a=a[g])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,k,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)za(a,b,c,d,e,f,g,k);else g=b[++d],za(a,b,c,d,e,f,g,k);else e.db&&e.remove(f)};function Ba(a,b,c,d,e,f,g){const k=a.length;let h=[],l;var m;l=C();for(let q=0,n,p,r,t;q<b;q++)for(let w=0;w<k;w++)if(r=a[w],q<r.length&&(n=r[q]))for(let x=0;x<n.length;x++)p=n[x],(m=l[p])?l[p]++:(m=0,l[p]=1),t=h[m]||(h[m]=[]),g||(m=q+(w?0:f||0),t=t[m]||(t[m]=[])),t.push(p);if(a=h.length)if(e)h=1<h.length?Ca(h,d,c,g,0):(h=h[0]).length>c||d?h.slice(d,c+d):h;else{if(a<k)return[];h=h[a-1];if(c||d)if(g){if(h.length>c||d)h=h.slice(d,c+d)}else{e=[];for(let q=0,n;q<h.length;q++)if(n=h[q],n.length>d)d-=n.length;
u.length;x++)t.push(w.field,u[x]);else t.push(w.field,u)}else{u=Object.keys(w);for(let A=0,H,C;A<u.length;A++)if(H=u[A],C=w[H],C.constructor===Array)for(x=0;x<C.length;x++)t.push(H,C[x]);else t.push(H,C)}n=t;if(!a){r=[];if(t.length)for(n=0;n<t.length;n+=2){if(this.db){d=this.index.get(t[n]);if(!d)continue;r.push(d=d.db.tag(t[n+1],b,l,q))}else d=Da.call(this,t[n],t[n+1],b,l,q);e.push({field:t[n],tag:t[n+1],result:d})}return r.length?Promise.all(r).then(function(y){for(let w=0;w<y.length;w++)e[w].result= else{if(n.length>c||d)n=n.slice(d,c+d),c-=n.length,d&&(d-=n.length);e.push(n);if(!c)break}h=1<e.length?[].concat.apply([],e):e[0]}}return h}
y[w];return e}):e}}F(k)&&(k=[k])}k||(k=this.field);t=!d&&(this.worker||this.db)&&[];let D;for(let y=0,w,A,H;y<k.length;y++){A=k[y];if(this.db&&this.tag&&!this.D[y])continue;let C;F(A)||(C=A,A=C.field,a=C.query||a,b=C.limit||b,l=C.offset||l,r=C.suggest||r,q=this.store&&(C.enrich||q));if(d)w=d[y];else if(u=C||c,x=this.index.get(A),n&&(this.db&&(u.tag=n,D=x.db.support_tag_search,u.field=k),D||(u.enrich=!1)),t){t[y]=x.search(a,b,u);u&&q&&(u.enrich=q);continue}else w=x.search(a,b,u),u&&q&&(u.enrich=q); function Ca(a,b,c,d,e){const f=[],g=C();let k;var h=a.length;let l,m=0;if(d)for(e=h-1;0<=e;e--)for(d=a[e],l=d.length,h=0;h<l;h++){if(k=d[h],!g[k])if(g[k]=1,b)b--;else if(f.push(k),f.length===c)return f}else{let q=ca(a);for(let n=0;n<q;n++)for(let p=h-1;0<=p;p--)if(l=(d=a[p][n])&&d.length)for(let r=0;r<l;r++)if(k=d[r],!g[k])if(g[k]=1,b)b--;else{let t=n+(p<h-1?e||0:0);(f[t]||(f[t]=[])).push(k);if(++m===c)return f}}return f}
H=w&&w.length;if(n&&H){u=[];x=0;if(this.db&&d){if(!D)for(let I=k.length;I<d.length;I++){let E=d[I];if(E&&E.length)x++,u.push(E);else if(!r)return e}}else for(let I=0,E,hb;I<n.length;I+=2){E=this.tag.get(n[I]);if(!E)if(r)continue;else return e;if(hb=(E=E&&E.get(n[I+1]))&&E.length)x++,u.push(E);else if(!r)return e}if(x){w=Ca(w,u);H=w.length;if(!H&&!r)return e;x--}}if(H)f[m]=A,e.push(w),m++;else if(1===k.length)return e}if(t){if(this.db&&n&&n.length&&!D)for(q=0;q<n.length;q+=2){d=this.index.get(n[q]); function Da(a,b){const c=C(),d=[];for(let e=0,f;e<b.length;e++){f=b[e];for(let g=0;g<f.length;g++)c[f[g]]=1}for(let e=0,f;e<a.length;e++)f=a[e],1===c[f]&&(d.push(f),c[f]=2);return d};T.prototype.search=function(a,b,c,d){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let e=[],f=[],g;let k;let h;let l,m=0,q;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;g=c.pluck;k=c.merge;h=g||c.field||c.index;var n=this.tag&&c.tag;var p=this.store&&c.enrich;var r=c.suggest;q=c.highlight;b=c.limit||b;l=c.offset||0;b||(b=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var t=[];for(let y=0,v;y<n.length;y++)if(v=n[y],v.field&&v.tag){var w=v.tag;if(w.constructor===Array)for(var x=0;x<
if(!d)if(r)continue;else return e;t.push(d.db.tag(n[q+1],b,l,!1))}const y=this;return Promise.all(t).then(function(w){return w.length?y.search(a,b,c,w):w})}if(!m)return e;if(g&&(!q||!this.store))return e[0];t=[];for(let y=0,w;y<f.length;y++){w=e[y];q&&w.length&&!w[0].doc&&(this.db?t.push(w=this.index.get(this.field[0]).db.enrich(w)):w.length&&(w=Ea.call(this,w)));if(g)return w;e[y]={field:f[y],result:w}}if(q&&this.db&&t.length){const y=this;return Promise.all(t).then(function(w){for(let A=0;A<w.length;A++)e[A].result= w.length;x++)t.push(v.field,w[x]);else t.push(v.field,w)}else{w=Object.keys(v);for(let A=0,H,D;A<w.length;A++)if(H=w[A],D=v[H],D.constructor===Array)for(x=0;x<D.length;x++)t.push(H,D[x]);else t.push(H,D)}n=t;if(!a){r=[];if(t.length)for(n=0;n<t.length;n+=2){if(this.db){d=this.index.get(t[n]);if(!d)continue;r.push(d=d.db.tag(t[n+1],b,l,p))}else d=Ea.call(this,t[n],t[n+1],b,l,p);e.push({field:t[n],tag:t[n+1],result:d})}return r.length?Promise.all(r).then(function(y){for(let v=0;v<y.length;v++)e[v].result=
w[A];return h?Fa(e,b):p?Ga(e,a,y.index,y.field,y.D,p):e})}return h?Fa(e,b):p?Ga(e,a,this.index,this.field,this.D,p):e}; y[v];return e}):e}}F(h)&&(h=[h])}h||(h=this.field);t=!d&&(this.worker||this.db)&&[];let B;for(let y=0,v,A,H;y<h.length;y++){A=h[y];if(this.db&&this.tag&&!this.D[y])continue;let D;F(A)||(D=A,A=D.field,a=D.query||a,b=D.limit||b,l=D.offset||l,r=D.suggest||r,p=this.store&&(D.enrich||p));if(d)v=d[y];else if(w=D||c,x=this.index.get(A),n&&(this.db&&(w.tag=n,B=x.db.support_tag_search,w.field=h),B||(w.enrich=!1)),t){t[y]=x.search(a,b,w);w&&p&&(w.enrich=p);continue}else v=x.search(a,b,w),w&&p&&(w.enrich=p);
function Ga(a,b,c,d,e,f){let g,h,k;for(let m=0,p,n,q,r,t;m<a.length;m++){p=a[m].result;n=a[m].field;r=c.get(n);q=r.encoder;k=r.tokenize;t=e[d.indexOf(n)];q!==g&&(g=q,h=g.encode(b));for(let u=0;u<p.length;u++){let x="";var l=J(p[u].doc,t);let D=g.encode(l);l=l.split(g.split);for(let y=0,w,A;y<D.length;y++){w=D[y];A=l[y];let H;for(let C=0,I;C<h.length;C++)if(I=h[C],"strict"===k){if(w===I){x+=(x?" ":"")+f.replace("$1",A);H=!0;break}}else{const E=w.indexOf(I);if(-1<E){x+=(x?" ":"")+A.substring(0,E)+f.replace("$1", H=v&&v.length;if(n&&H){w=[];x=0;if(this.db&&d){if(!B)for(let I=h.length;I<d.length;I++){let E=d[I];if(E&&E.length)x++,w.push(E);else if(!r)return e}}else for(let I=0,E,ib;I<n.length;I+=2){E=this.tag.get(n[I]);if(!E)if(r)continue;else return e;if(ib=(E=E&&E.get(n[I+1]))&&E.length)x++,w.push(E);else if(!r)return e}if(x){v=Da(v,w);H=v.length;if(!H&&!r)return e;x--}}if(H)f[m]=A,e.push(v),m++;else if(1===h.length)return e}if(t){if(this.db&&n&&n.length&&!B)for(p=0;p<n.length;p+=2){d=this.index.get(n[p]);
A.substring(E,I.length))+A.substring(E+I.length);H=!0;break}}H||(x+=(x?" ":"")+l[y])}p[u].highlight=x}}return a}function Fa(a,b){const c=[],d=B();for(let e=0,f,g;e<a.length;e++){f=a[e];g=f.result;for(let h=0,k,l,m;h<g.length;h++)if(l=g[h],k=l.id,m=d[k])m.push(f.field);else{if(c.length===b)return c;l.field=d[k]=[f.field];c.push(l)}}return c}function Da(a,b,c,d,e){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-d)&&0<b){if(b>c||d)a=a.slice(d,d+c);e&&(a=Ea.call(this,a));return a}} if(!d)if(r)continue;else return e;t.push(d.db.tag(n[p+1],b,l,!1))}const y=this;return Promise.all(t).then(function(v){return v.length?y.search(a,b,c,v):v})}if(!m)return e;if(g&&(!p||!this.store))return e[0];t=[];for(let y=0,v;y<f.length;y++){v=e[y];p&&v.length&&!v[0].doc&&(this.db?t.push(v=this.index.get(this.field[0]).db.enrich(v)):v.length&&(v=Fa.call(this,v)));if(g)return v;e[y]={field:f[y],result:v}}if(p&&this.db&&t.length){const y=this;return Promise.all(t).then(function(v){for(let A=0;A<v.length;A++)e[A].result=
function Ea(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function T(a){if(!this||this.constructor!==T)return new T(a);const b=a.document||a.doc||a;let c,d;this.D=[];this.field=[];this.K=[];this.key=(c=b.key||b.id)&&Ha(c,this.K)||"id";(d=a.keystore||0)&&(this.keystore=d);this.reg=(this.fastupdate=!!a.fastupdate)?d?new R(d):new Map:d?new S(d):new Set;this.C=(c=b.store||null)&&!0!==c&&[];this.store=c&&(d?new R(d):new Map);this.cache=(c=a.cache||null)&&new U(c);a.cache=!1;this.worker=a.worker;this.index=Ia.call(this,a,b);this.tag=null;if(c=b.tag)if("string"=== v[A];return k?Ga(e,b):q?Ha(e,a,y.index,y.field,y.D,q):e})}return k?Ga(e,b):q?Ha(e,a,this.index,this.field,this.D,q):e};
typeof c&&(c=[c]),c.length){this.tag=new Map;this.G=[];this.N=[];for(let e=0,f,g;e<c.length;e++){f=c[e];g=f.field||f;if(!g)throw Error("The tag field from the document descriptor is undefined.");f.custom?this.G[e]=f.custom:(this.G[e]=Ha(g,this.K),f.filter&&("string"===typeof this.G[e]&&(this.G[e]=new String(this.G[e])),this.G[e].I=f.filter));this.N[e]=g;this.tag.set(g,new Map)}}if(this.worker){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(f){let g= function Ha(a,b,c,d,e,f){let g,k,h;for(let m=0,q,n,p,r,t;m<a.length;m++){q=a[m].result;n=a[m].field;r=c.get(n);p=r.encoder;h=r.tokenize;t=e[d.indexOf(n)];p!==g&&(g=p,k=g.encode(b));for(let w=0;w<q.length;w++){let x="";var l=J(q[w].doc,t);let B=g.encode(l);l=l.split(g.split);for(let y=0,v,A;y<B.length;y++){v=B[y];A=l[y];let H;for(let D=0,I;D<k.length;D++)if(I=k[D],"strict"===h){if(v===I){x+=(x?" ":"")+f.replace("$1",A);H=!0;break}}else{const E=v.indexOf(I);if(-1<E){x+=(x?" ":"")+A.substring(0,E)+f.replace("$1",
0;for(const h of e.index.entries()){const k=h[0];h[1].then&&e.index.set(k,f[g++])}return e})}}else a.db&&this.mount(a.db)}v=T.prototype; A.substring(E,I.length))+A.substring(E+I.length);H=!0;break}}H||(x+=(x?" ":"")+l[y])}q[w].highlight=x}}return a}function Ga(a,b){const c=[],d=C();for(let e=0,f,g;e<a.length;e++){f=a[e];g=f.result;for(let k=0,h,l,m;k<g.length;k++)if(l=g[k],h=l.id,m=d[h])m.push(f.field);else{if(c.length===b)return c;l.field=d[h]=[f.field];c.push(l)}}return c}function Ea(a,b,c,d,e){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-d)&&0<b){if(b>c||d)a=a.slice(d,d+c);e&&(a=Fa.call(this,a));return a}}
v.mount=function(a){let b=this.field;if(this.tag)for(let e=0,f;e<this.N.length;e++){f=this.N[e];var c=void 0;this.index.set(f,c=new L({},this.reg));b===this.field&&(b=b.slice(0));b.push(f);c.tag=this.tag.get(f)}c=[];const d={db:a.db,type:a.type,fastupdate:a.fastupdate};for(let e=0,f,g;e<b.length;e++){d.field=g=b[e];f=this.index.get(g);const h=new a.constructor(a.id,d);h.id=a.id;c[e]=h.mount(f);f.document=!0;e?f.bypass=!0:f.store=this.store}this.db=!0;return Promise.all(c)}; function Fa(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function T(a){if(!this||this.constructor!==T)return new T(a);const b=a.document||a.doc||a;let c,d;this.D=[];this.field=[];this.K=[];this.key=(c=b.key||b.id)&&Ia(c,this.K)||"id";(d=a.keystore||0)&&(this.keystore=d);this.reg=(this.fastupdate=!!a.fastupdate)?d?new R(d):new Map:d?new S(d):new Set;this.C=(c=b.store||null)&&c&&!0!==c&&[];this.store=c&&(d?new R(d):new Map);this.cache=(c=a.cache||null)&&new U(c);a.cache=!1;this.worker=a.worker;this.index=Ja.call(this,a,b);this.tag=null;if(c=b.tag)if("string"===
v.commit=async function(a,b){const c=[];for(const d of this.index.values())c.push(d.db.commit(d,a,b));await Promise.all(c);this.reg.clear()};v.destroy=function(){const a=[];for(const b of this.index.values())a.push(b.destroy());return Promise.all(a)}; typeof c&&(c=[c]),c.length){this.tag=new Map;this.G=[];this.P=[];for(let e=0,f,g;e<c.length;e++){f=c[e];g=f.field||f;if(!g)throw Error("The tag field from the document descriptor is undefined.");f.custom?this.G[e]=f.custom:(this.G[e]=Ia(g,this.K),f.filter&&("string"===typeof this.G[e]&&(this.G[e]=new String(this.G[e])),this.G[e].J=f.filter));this.P[e]=g;this.tag.set(g,new Map)}}if(this.worker){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(f){let g=
function Ia(a,b){const c=new Map;let d=b.index||b.field||b;F(d)&&(d=[d]);for(let e=0,f,g;e<d.length;e++){f=d[e];F(f)||(g=f,f=f.field);g=G(g)?Object.assign({},a,g):a;if(this.worker){const h=new N(g);c.set(f,h)}this.worker||c.set(f,new L(g,this.reg));g.custom?this.D[e]=g.custom:(this.D[e]=Ha(f,this.K),g.filter&&("string"===typeof this.D[e]&&(this.D[e]=new String(this.D[e])),this.D[e].I=g.filter));this.field[e]=f}if(this.C){a=b.store;F(a)&&(a=[a]);for(let e=0,f,g;e<a.length;e++)f=a[e],g=f.field||f,f.custom? 0;for(const k of e.index.entries()){const h=k[0];k[1].then&&e.index.set(h,f[g++])}return e})}}else a.db&&this.mount(a.db)}u=T.prototype;
(this.C[e]=f.custom,f.custom.U=g):(this.C[e]=Ha(g,this.K),f.filter&&("string"===typeof this.C[e]&&(this.C[e]=new String(this.C[e])),this.C[e].I=f.filter))}return c}function Ha(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}v.append=function(a,b){return this.add(a,b,!0)};v.update=function(a,b){return this.remove(a).add(a,b)}; u.mount=function(a){let b=this.field;if(this.tag)for(let e=0,f;e<this.P.length;e++){f=this.P[e];var c=void 0;this.index.set(f,c=new M({},this.reg));b===this.field&&(b=b.slice(0));b.push(f);c.tag=this.tag.get(f)}c=[];const d={db:a.db,type:a.type,fastupdate:a.fastupdate};for(let e=0,f,g;e<b.length;e++){d.field=g=b[e];f=this.index.get(g);const k=new a.constructor(a.id,d);k.id=a.id;c[e]=k.mount(f);f.document=!0;e?f.bypass=!0:f.store=this.store}this.db=!0;return Promise.all(c)};
v.remove=function(a){G(a)&&(a=J(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let c of this.tag.values())for(let d of c){b=d[0];const e=d[1],f=e.indexOf(a);-1<f&&(1<e.length?e.splice(f,1):c.delete(b))}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; u.commit=async function(a,b){const c=[];for(const d of this.index.values())c.push(d.db.commit(d,a,b));await Promise.all(c);this.reg.clear()};u.destroy=function(){const a=[];for(const b of this.index.values())a.push(b.destroy());return Promise.all(a)};
v.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};v.contain=function(a){return this.db?this.index.get(this.field[0]).db.has(a):this.reg.has(a)};v.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};v.get=function(a){return this.db?this.index.get(this.field[0]).db.enrich(a).then(function(b){return b[0]&&b[0].doc}):this.store.get(a)}; function Ja(a,b){const c=new Map;let d=b.index||b.field||b;F(d)&&(d=[d]);for(let e=0,f,g;e<d.length;e++){f=d[e];F(f)||(g=f,f=f.field);g=G(g)?Object.assign({},a,g):a;if(this.worker){const k=new N(g);c.set(f,k)}this.worker||c.set(f,new M(g,this.reg));g.custom?this.D[e]=g.custom:(this.D[e]=Ia(f,this.K),g.filter&&("string"===typeof this.D[e]&&(this.D[e]=new String(this.D[e])),this.D[e].J=g.filter));this.field[e]=f}if(this.C){a=b.store;F(a)&&(a=[a]);for(let e=0,f,g;e<a.length;e++)f=a[e],g=f.field||f,f.custom?
v.set=function(a,b){this.store.set(a,b);return this};v.searchCache=Ja; (this.C[e]=f.custom,f.custom.U=g):(this.C[e]=Ia(g,this.K),f.filter&&("string"===typeof this.C[e]&&(this.C[e]=new String(this.C[e])),this.C[e].J=f.filter))}return c}function Ia(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}u.append=function(a,b){return this.add(a,b,!0)};u.update=function(a,b){return this.remove(a).add(a,b)};
v.export=function(a,b,c=0,d=0){if(c<this.field.length){const g=this.field[c];if((b=this.index.get(g).export(a,g,c,d=1))&&b.then){const h=this;return b.then(function(){return h.export(a,g,c+1)})}return this.export(a,g,c+1)}let e,f;switch(d){case 0:e="reg";f=sa(this.reg);b=null;break;case 1:e="tag";f=qa(this.tag,this.reg.size);b=null;break;case 2:e="doc";f=oa(this.store);b=null;break;case 3:e="cfg";f={};b=null;break;default:return}return ua.call(this,a,b,e,f,c,d)}; u.remove=function(a){G(a)&&(a=J(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let c of this.tag.values())for(let d of c){b=d[0];const e=d[1],f=e.indexOf(a);-1<f&&(1<e.length?e.splice(f,1):c.delete(b))}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
v.import=function(a,b){if(b){F(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=ta(b,this.reg);for(let d=0,e;d<this.field.length;d++)e=this.index.get(this.field[d]),e.fastupdate=!1,e.reg=this.reg;break;case "tag":this.tag=ra(b,this.tag);break;case "doc":this.store=pa(b,this.store)}}};na(T.prototype);function Ja(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();let d=this.cache.get(a);if(!d){d=this.search(a,b,c);if(d.then){const e=this;d.then(function(f){e.cache.set(a,f);return f})}this.cache.set(a,d)}return d}function U(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}U.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)}; u.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};u.contain=function(a){return this.db?this.index.get(this.field[0]).db.has(a):this.reg.has(a)};u.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};u.get=function(a){return this.db?this.index.get(this.field[0]).db.enrich(a).then(function(b){return b[0]&&b[0].doc}):this.store.get(a)};
U.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};U.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};U.prototype.clear=function(){this.cache.clear();this.h=""};const Ka={normalize:function(a){return a.toLowerCase()},dedupe:!1};const La=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Ma=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Na=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Oa={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Pa=/[\x00-\x7F]+/g;const Qa=/[\x00-\x7F]+/g;const Ra=/[\x00-\x7F]+/g;var Sa={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:Ka,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:La},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:La,matcher:Ma,replacer:Na},LatinExtra:{normalize:!0,dedupe:!0,mapper:La,replacer:Na.concat([/(?!^)[aeo]/g,""]),matcher:Ma},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let d=b.charAt(0),e=Oa[d];for(let f=1,g;f<b.length&&(g=b.charAt(f),"h"=== u.set=function(a,b){this.store.set(a,b);return this};u.searchCache=Ka;
g||"w"===g||!(g=Oa[g])||g===e||(d+=g,e=g,4!==d.length));f++);a[c]=d}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Pa," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(Qa,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ra," ")}}};const Ta={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};B();L.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(d=b.length){const l=B(),m=B(),p=this.depth,n=this.resolution;for(let q=0;q<d;q++){let r=b[this.rtl?d-1-q:q];var e=r.length;if(e&&(p||!m[r])){var f=this.score?this.score(b,r,q,null,0):Ua(n,d,q),g="";switch(this.tokenize){case "full":if(2<e){for(f=0;f<e;f++)for(var h=e;h>f;h--){g=r.substring(f,h);var k=this.score?this.score(b,r,q,g,f):Ua(n,d,q,e,f);V(this,m,g,k,a,c)}break}case "reverse":if(1< u.export=function(a,b,c=0,d=0){if(c<this.field.length){const g=this.field[c];if((b=this.index.get(g).export(a,g,c,d=1))&&b.then){const k=this;return b.then(function(){return k.export(a,g,c+1)})}return this.export(a,g,c+1)}let e,f;switch(d){case 0:e="reg";f=ta(this.reg);b=null;break;case 1:e="tag";f=ra(this.tag,this.reg.size);b=null;break;case 2:e="doc";f=pa(this.store);b=null;break;case 3:e="cfg";f={};b=null;break;default:return}return va.call(this,a,b,e,f,c,d)};
e){for(h=e-1;0<h;h--)g=r[h]+g,k=this.score?this.score(b,r,q,g,h):Ua(n,d,q,e,h),V(this,m,g,k,a,c);g=""}case "forward":if(1<e){for(h=0;h<e;h++)g+=r[h],V(this,m,g,f,a,c);break}default:if(V(this,m,r,f,a,c),p&&1<d&&q<d-1)for(e=B(),g=this.R,f=r,h=Math.min(p+1,d-q),e[f]=1,k=1;k<h;k++)if((r=b[this.rtl?d-1-q-k:q+k])&&!e[r]){e[r]=1;const t=this.score?this.score(b,f,q,r,k):Ua(g+(d/2>g?0:1),d,q,h-1,k-1),u=this.bidirectional&&r>f;V(this,l,u?f:r,t,a,c,u?r:f)}}}}this.fastupdate||this.reg.add(a)}else b=""}this.db&& u.import=function(a,b){if(b){F(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=ua(b,this.reg);for(let d=0,e;d<this.field.length;d++)e=this.index.get(this.field[d]),e.fastupdate=!1,e.reg=this.reg;break;case "tag":this.tag=sa(b,this.tag);break;case "doc":this.store=qa(b,this.store)}}};oa(T.prototype);function Ka(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();let d=this.cache.get(a);if(!d){d=this.search(a,b,c);if(d.then){const e=this;d.then(function(f){e.cache.set(a,f);return f})}this.cache.set(a,d)}return d}function U(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}U.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};
(b||this.commit_task.push({del:a}),this.T&&Va(this));return this};function V(a,b,c,d,e,f,g){let h=g?a.ctx:a.map,k;if(!b[c]||g&&!(k=b[c])[g])if(g?(b=k||(b[c]=B()),b[g]=1,(k=h.get(g))?h=k:h.set(g,h=new Map)):b[c]=1,(k=h.get(c))?h=k:h.set(c,h=k=[]),h=h[d]||(h[d]=[]),!f||!h.includes(e)){if(h.length===2**31-1){b=new Q(h);if(a.fastupdate)for(let l of a.reg.values())l.includes(h)&&(l[l.indexOf(h)]=b);k[d]=h=b}h.push(e);a.fastupdate&&((d=a.reg.get(e))?d.push(h):a.reg.set(e,[h]))}} U.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};U.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};U.prototype.clear=function(){this.cache.clear();this.h=""};const La={normalize:function(a){return a.toLowerCase()},dedupe:!1};const Ma=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Na=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Oa=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Pa={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Qa=/[\x00-\x7F]+/g;const Ra=/[\x00-\x7F]+/g;const Sa=/[\x00-\x7F]+/g;var Ta={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:La,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:Ma},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:Ma,matcher:Na,replacer:Oa},LatinExtra:{normalize:!0,dedupe:!0,mapper:Ma,replacer:Oa.concat([/(?!^)[aeo]/g,""]),matcher:Na},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let d=b.charAt(0),e=Pa[d];for(let f=1,g;f<b.length&&(g=b.charAt(f),"h"===
function Ua(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function W(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Wa(a):a;let e=[];for(let f=0,g,h;f<a.length;f++)if((g=a[f])&&(h=g.length)){if(c){if(c>=h){c-=h;continue}c<h&&(g=b?g.slice(c,c+b):g.slice(c),h=g.length,c=0)}if(e.length)h>b&&(g=g.slice(0,b),h=g.length),e.push(g);else{if(h>=b)return h>b&&(g=g.slice(0,b)),d?Wa(g):g;e=[g]}b-=h;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Wa(e):e} g||"w"===g||!(g=Pa[g])||g===e||(d+=g,e=g,4!==d.length));f++);a[c]=d}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Qa," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(Ra,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Sa," ")}}};const Ua={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};C();M.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(d=b.length){const l=C(),m=C(),q=this.depth,n=this.resolution;for(let p=0;p<d;p++){let r=b[this.rtl?d-1-p:p];var e=r.length;if(e&&(q||!m[r])){var f=this.score?this.score(b,r,p,null,0):Va(n,d,p),g="";switch(this.tokenize){case "full":if(2<e){for(f=0;f<e;f++)for(var k=e;k>f;k--){g=r.substring(f,k);var h=this.score?this.score(b,r,p,g,f):Va(n,d,p,e,f);V(this,m,g,h,a,c)}break}case "reverse":if(1<
function Wa(a){for(let b=0;b<a.length;b++)a[b]={score:b,id:a[b]};return a};X.prototype.or=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.limit||0;f=l.offset||0;g=l.enrich;h=l.resolve;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.not)m= e){for(k=e-1;0<k;k--)g=r[k]+g,h=this.score?this.score(b,r,p,g,k):Va(n,d,p,e,k),V(this,m,g,h,a,c);g=""}case "forward":if(1<e){for(k=0;k<e;k++)g+=r[k],V(this,m,g,f,a,c);break}default:if(V(this,m,r,f,a,c),q&&1<d&&p<d-1)for(e=C(),g=this.R,f=r,k=Math.min(q+1,d-p),e[f]=1,h=1;h<k;h++)if((r=b[this.rtl?d-1-p-h:p+h])&&!e[r]){e[r]=1;const t=this.score?this.score(b,f,p,r,h):Va(g+(d/2>g?0:1),d,p,k-1,h-1),w=this.bidirectional&&r>f;V(this,l,w?f:r,t,a,c,w?r:f)}}}}this.fastupdate||this.reg.add(a)}else b=""}this.db&&
this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Xa(d,e,f,g,h,a.F);return h?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Xa(d,e,f,g,h,this.F));return h?this.result:this};function Xa(a,b,c,d,e,f){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.enrich||!1,b=b.limit||0);return 2>a.length?e?W(a[0],b,c,d):a[0]:Ba(a,c,b,e,f)};X.prototype.and=function(){if(this.result.length){const b=this;let c=arguments;var a=c[0];if(a.then)return a.then(function(){return b.and.apply(b,c)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,f=0,g,h;for(let k=0,l;k<c.length;k++)if(l=c[k]){e=l.limit||0;f=l.offset||0;g=l.resolve;h=l.suggest;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor); (b||this.commit_task.push({del:a}),this.T&&Wa(this));return this};function V(a,b,c,d,e,f,g){let k=g?a.ctx:a.map,h;if(!b[c]||g&&!(h=b[c])[g])if(g?(b=h||(b[c]=C()),b[g]=1,(h=k.get(g))?k=h:k.set(g,k=new Map)):b[c]=1,(h=k.get(c))?k=h:k.set(c,k=h=[]),k=k[d]||(k[d]=[]),!f||!k.includes(e)){if(k.length===2**31-1){b=new Q(k);if(a.fastupdate)for(let l of a.reg.values())l.includes(k)&&(l[l.indexOf(k)]=b);h[d]=k=b}k.push(e);a.fastupdate&&((d=a.reg.get(e))?d.push(k):a.reg.set(e,[k]))}}
else if(l.not)m=this.not(l.not);else continue;d[k]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,g?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[b.result].concat(d);b.result=Ya(d,e,f,g,b.F,h);return g?b.result:b});d=[this.result].concat(d);this.result=Ya(d,e,f,g,this.F,h);return g?this.result:this}return this};function Ya(a,b,c,d,e,f){if(2>a.length)return[];let g=[];B();let h=ca(a);return h?Aa(a,h,b,c,f,e,d):g};X.prototype.xor=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.limit||0;f=l.offset||0;g=l.enrich;h=l.resolve;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.not)m= function Va(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function W(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Xa(a):a;let e=[];for(let f=0,g,k;f<a.length;f++)if((g=a[f])&&(k=g.length)){if(c){if(c>=k){c-=k;continue}c<k&&(g=b?g.slice(c,c+b):g.slice(c),k=g.length,c=0)}if(e.length)k>b&&(g=g.slice(0,b),k=g.length),e.push(g);else{if(k>=b)return k>b&&(g=g.slice(0,b)),d?Xa(g):g;e=[g]}b-=k;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Xa(e):e}
this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Za(d,e,f,g,!h,a.F);return h?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Za(d,e,f,g,!h,a.F));return h?this.result:this}; function Xa(a){for(let b=0;b<a.length;b++)a[b]={score:b,id:a[b]};return a};X.prototype.or=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);let d=[];c=[];let e=0,f=0,g,k;for(let h=0,l;h<b.length;h++)if(l=b[h]){e=l.limit||0;f=l.offset||0;g=l.enrich;k=l.resolve;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.not)m=
function Za(a,b,c,d,e,f){if(!a.length)return a;if(2>a.length)return e?W(a[0],b,c,d):a[0];d=[];const g=B();let h=0;for(let k=0,l;k<a.length;k++)if(l=a[k])for(let m=0,p;m<l.length;m++)if(p=l[m]){h<p.length&&(h=p.length);for(let n=0,q;n<p.length;n++)q=p[n],g[q]?g[q]++:g[q]=1}for(let k=0,l,m=0;k<h;k++)for(let p=0,n;p<a.length;p++)if(n=a[p])if(l=n[k])for(let q=0,r;q<l.length;q++)if(r=l[q],1===g[r])if(c)c--;else if(e){if(d.push(r),d.length===b)return d}else{const t=k+(p?f:0);d[t]||(d[t]=[]);d[t].push(r); this.not(l.not);else continue;d[h]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Ya(d,e,f,g,k,a.F);return k?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Ya(d,e,f,g,k,this.F));return k?this.result:this};function Ya(a,b,c,d,e,f){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.enrich||!1,b=b.limit||0);return 2>a.length?e?W(a[0],b,c,d):a[0]:Ca(a,c,b,e,f)};X.prototype.and=function(){if(this.result.length){const b=this;let c=arguments;var a=c[0];if(a.then)return a.then(function(){return b.and.apply(b,c)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,f=0,g,k;for(let h=0,l;h<c.length;h++)if(l=c[h]){e=l.limit||0;f=l.offset||0;g=l.resolve;k=l.suggest;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor);
if(++m===b)return d}return d};X.prototype.not=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.not.apply(a,b)});if(c[0]&&c[0].index)return this.not.apply(this,c);let d=[];c=[];let e=0,f=0,g;for(let h=0,k;h<b.length;h++)if(k=b[h]){e=k.limit||0;f=k.offset||0;g=k.resolve;let l;if(k.constructor===X)l=k.result;else if(k.constructor===Array)l=k;else if(k.index)k.resolve=!1,l=k.index.search(k).result;else if(k.or)l=this.or(k.or);else if(k.and)l=this.and(k.and);else if(k.xor)l=this.xor(k.xor); else if(l.not)m=this.not(l.not);else continue;d[h]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,g?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[b.result].concat(d);b.result=Za(d,e,f,g,b.F,k);return g?b.result:b});d=[this.result].concat(d);this.result=Za(d,e,f,g,this.F,k);return g?this.result:this}return this};function Za(a,b,c,d,e,f){if(2>a.length)return[];let g=[];C();let k=ca(a);return k?Ba(a,k,b,c,f,e,d):g};X.prototype.xor=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);let d=[];c=[];let e=0,f=0,g,k;for(let h=0,l;h<b.length;h++)if(l=b[h]){e=l.limit||0;f=l.offset||0;g=l.enrich;k=l.resolve;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.not)m=
else continue;d[h]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=$a.call(a,d,e,f,g);return g?a.result:a});d.length&&(this.result=$a.call(this,d,e,f,g));return g?this.result:this}; this.not(l.not);else continue;d[h]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=$a(d,e,f,g,!k,a.F);return k?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=$a(d,e,f,g,!k,a.F));return k?this.result:this};
function $a(a,b,c,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let f=0,g,h=0;f<this.result.length;f++)if(g=this.result[f])for(let k=0,l;k<g.length;k++)if(l=g[k],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[f]||(e[f]=[]),e[f].push(l),++h===b)return e;return e};function X(a){if(!this||this.constructor!==X)return new X(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.F=a.boost||0,this.result=a.index.search(a).result,this;if(a.constructor===X)return a;this.index=null;this.result=a||[];this.F=0}X.prototype.limit=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}}return this}; function $a(a,b,c,d,e,f){if(!a.length)return a;if(2>a.length)return e?W(a[0],b,c,d):a[0];d=[];const g=C();let k=0;for(let h=0,l;h<a.length;h++)if(l=a[h])for(let m=0,q;m<l.length;m++)if(q=l[m]){k<q.length&&(k=q.length);for(let n=0,p;n<q.length;n++)p=q[n],g[p]?g[p]++:g[p]=1}for(let h=0,l,m=0;h<k;h++)for(let q=0,n;q<a.length;q++)if(n=a[q])if(l=n[h])for(let p=0,r;p<l.length;p++)if(r=l[p],1===g[r])if(c)c--;else if(e){if(d.push(r),d.length===b)return d}else{const t=h+(q?f:0);d[t]||(d[t]=[]);d[t].push(r);
X.prototype.offset=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};X.prototype.boost=function(a){this.F+=a;return this};X.prototype.resolve=function(a,b,c){ab=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.enrich,b=a.offset,a=a.limit),W(d,a||100,b,c)):d};let ab=1; if(++m===b)return d}return d};X.prototype.not=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.not.apply(a,b)});if(c[0]&&c[0].index)return this.not.apply(this,c);let d=[];c=[];let e=0,f=0,g;for(let k=0,h;k<b.length;k++)if(h=b[k]){e=h.limit||0;f=h.offset||0;g=h.resolve;let l;if(h.constructor===X)l=h.result;else if(h.constructor===Array)l=h;else if(h.index)h.resolve=!1,l=h.index.search(h).result;else if(h.or)l=this.or(h.or);else if(h.and)l=this.and(h.and);else if(h.xor)l=this.xor(h.xor);
L.prototype.search=function(a,b,c){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let d=[],e;let f,g=0,h,k,l,m;if(c){a=c.query||a;b=c.limit||b;g=c.offset||0;var p=c.context;f=c.suggest;(h=ab&&!1!==c.resolve)||(ab=0);k=h&&c.enrich;m=c.boost;l=this.db&&c.tag}else h=this.resolve||ab;a=this.encoder.encode(a);e=a.length;b||!h||(b=100);if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);p=this.depth&&!1!==p;if(2===e&&p&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);let n=c=0;if(1<e){const t=B(),u=[];for(let x=0,D;x< else continue;d[k]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=ab.call(a,d,e,f,g);return g?a.result:a});d.length&&(this.result=ab.call(this,d,e,f,g));return g?this.result:this};
e;x++)if((D=a[x])&&!t[D]){if(f||this.db||Y(this,D))u.push(D),t[D]=1;else return h?d:new X(d);const y=D.length;c=Math.max(c,y);n=n?Math.min(n,y):y}a=u;e=a.length}if(!e)return h?d:new X(d);let q=0,r;if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);if(2===e&&p&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);1<e&&(p?(r=a[0],q=1):9<c&&3<c/n&&a.sort(aa));if(this.db){if(this.db.search&&(p=this.db.search(this,a,b,g,f,h,k,l),!1!==p))return p;const t=this;return async function(){for(let u,x;q<e;q++){x=a[q];r?(u= function ab(a,b,c,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let f=0,g,k=0;f<this.result.length;f++)if(g=this.result[f])for(let h=0,l;h<g.length;h++)if(l=g[h],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[f]||(e[f]=[]),e[f].push(l),++k===b)return e;return e};function X(a){if(!this||this.constructor!==X)return new X(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.F=a.boost||0,this.result=a.index.search(a).result,this;if(a.constructor===X)return a;this.index=null;this.result=a||[];this.F=0}X.prototype.limit=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}}return this};
await Y(t,x,r,0,0,!1,!1),u=cb(u,d,f,t.R),f&&!1===u&&d.length||(r=x)):(u=await Y(t,x,"",0,0,!1,!1),u=cb(u,d,f,t.resolution));if(u)return u;if(f&&q===e-1){let D=d.length;if(!D){if(r){r="";q=-1;continue}return d}if(1===D)return h?W(d[0],b,g):new X(d[0])}}return h?Aa(d,t.resolution,b,g,f,m,h):new X(d[0])}()}for(let t,u;q<e;q++){u=a[q];r?(t=Y(this,u,r,0,0,!1,!1),t=cb(t,d,f,this.R),f&&!1===t&&d.length||(r=u)):(t=Y(this,u,"",0,0,!1,!1),t=cb(t,d,f,this.resolution));if(t)return t;if(f&&q===e-1){p=d.length; X.prototype.offset=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};X.prototype.boost=function(a){this.F+=a;return this};X.prototype.resolve=function(a,b,c){bb=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.enrich,b=a.offset,a=a.limit),W(d,a||100,b,c)):d};let bb=1;
if(!p){if(r){r="";q=-1;continue}return d}if(1===p)return h?W(d[0],b,g):new X(d[0])}}d=Aa(d,this.resolution,b,g,f,m,h);return h?d:new X(d)};function bb(a,b,c,d,e,f,g){a=Y(this,a,b,c,d,e,f,g);return this.db?a.then(function(h){return e?h:h&&h.length?e?W(h,c,d):new X(h):e?[]:new X([])}):a&&a.length?e?W(a,c,d):new X(a):e?[]:new X([])}function cb(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let f=0,g;f<d;f++)(g=a[f])&&g&&(e[f]=g);if(e.length){b.push(e);return}}return!c&&e} M.prototype.search=function(a,b,c){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let d=[],e,f,g,k=0,h,l,m,q,n;c?(a=c.query||a,b=c.limit||b,k=c.offset||0,f=c.context,g=c.suggest,(h=bb&&!1!==c.resolve)||(bb=0),l=h&&c.enrich,q=c.boost,n=c.resolution,m=this.db&&c.tag):h=this.resolve||bb;let p=this.encoder.encode(a);e=p.length;b||!h||(b=100);if(1===e)return cb.call(this,p[0],"",b,k,h,l,m);f=this.depth&&!1!==f;if(2===e&&f&&!g)return cb.call(this,p[0],p[1],b,k,h,l,m);let r=c=0;if(1<e){const x=C(),B=[];for(let y=
function Y(a,b,c,d,e,f,g,h){let k;c&&(k=a.bidirectional&&b>c);if(a.db)return c?a.db.get(k?c:b,k?b:c,d,e,f,g,h):a.db.get(b,"",d,e,f,g,h);a=c?(a=a.ctx.get(k?b:c))&&a.get(k?c:b):a.map.get(b);return a};L.prototype.remove=function(a,b){const c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(let d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{const f=e.indexOf(a);f===c.length-1?e.pop():e.splice(f,1)}}else db(this.map,a),this.depth&&db(this.ctx,a);b||this.reg.delete(a)}this.db&&(this.commit_task.push({del:a}),this.T&&Va(this));this.cache&&this.cache.remove(a);return this}; 0,v;y<e;y++)if((v=p[y])&&!x[v]){if(g||this.db||Y(this,v))B.push(v),x[v]=1;else return h?d:new X(d);const A=v.length;c=Math.max(c,A);r=r?Math.min(r,A):A}p=B;e=a.length}if(!e)return h?d:new X(d);let t=0,w;if(1===e)return cb.call(this,p[0],"",b,k,h,l,m);if(2===e&&f&&!g)return cb.call(this,p[0],p[1],b,k,h,l,m);1<e&&(f?(w=p[0],t=1):9<c&&3<c/r&&p.sort(aa));n||0===n||(n=this.resolution);if(this.db){if(this.db.search&&(a=this.db.search(this,p,b,k,g,h,l,m),!1!==a))return a;const x=this;return async function(){for(let B,
function db(a,b){let c=0;if(a.constructor===Array)for(let d=0,e,f;d<a.length;d++){if((e=a[d])&&e.length)if(f=e.indexOf(b),0<=f){1<e.length?(e.splice(f,1),c++):delete a[d];break}else c++}else for(let d of a){const e=d[0],f=db(d[1],b);f?c+=f:a.delete(e)}return c};function L(a,b){if(!this||this.constructor!==L)return new L(a);if(a){var c=F(a)?a:a.preset;c&&(a=Object.assign({},Ta[c],a))}else a={};c=a.context||{};const d=F(a.encoder)?Sa[a.encoder]:a.encode||a.encoder||Ka;this.encoder=d.encode?d:"object"===typeof d?new K(d):{encode:d};let e;this.resolution=a.resolution||9;this.tokenize=e=a.tokenize||"strict";this.depth="strict"===e&&c.depth||0;this.bidirectional=!1!==c.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;(e=a.keystore||0)&&(this.keystore= y;t<e;t++){y=p[t];w?(B=await Y(x,y,w,0,0,!1,!1),B=db(B,d,g,x.R),g&&!1===B&&d.length||(w=y)):(B=await Y(x,y,"",0,0,!1,!1),B=db(B,d,g,n));if(B)return B;if(g&&t===e-1){let v=d.length;if(!v){if(w){w="";t=-1;continue}return d}if(1===v)return h?W(d[0],b,k):new X(d[0])}}return h?Ba(d,n,b,k,g,q,h):new X(d[0])}()}for(let x,B;t<e;t++){B=p[t];w?(x=Y(this,B,w,0,0,!1,!1),x=db(x,d,g,this.R),g&&!1===x&&d.length||(w=B)):(x=Y(this,B,"",0,0,!1,!1),x=db(x,d,g,n));if(x)return x;if(g&&t===e-1){a=d.length;if(!a){if(w){w=
e);this.map=e?new R(e):new Map;this.ctx=e?new R(e):new Map;this.reg=b||(this.fastupdate?e?new R(e):new Map:e?new S(e):new Set);this.R=c.resolution||1;this.rtl=d.rtl||a.rtl||!1;this.cache=(e=a.cache||null)&&new U(e);this.resolve=!1!==a.resolve;if(e=a.db)this.db=this.mount(e);this.T=!1!==a.commit;this.commit_task=[];this.commit_timer=null}v=L.prototype;v.mount=function(a){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return a.mount(this)}; "";t=-1;continue}return d}if(1===a)return h?W(d[0],b,k):new X(d[0])}}d=Ba(d,n,b,k,g,q,h);return h?d:new X(d)};function cb(a,b,c,d,e,f,g){a=Y(this,a,b,c,d,e,f,g);return this.db?a.then(function(k){return e?k:k&&k.length?e?W(k,c,d):new X(k):e?[]:new X([])}):a&&a.length?e?W(a,c,d):new X(a):e?[]:new X([])}function db(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let f=0,g;f<d;f++)(g=a[f])&&g&&(e[f]=g);if(e.length){b.push(e);return}}return!c&&e}
v.commit=function(a,b){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.commit(this,a,b)};v.destroy=function(){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.destroy()};function Va(a){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null;a.db.commit(a,void 0,void 0)},0))} function Y(a,b,c,d,e,f,g,k){let h;c&&(h=a.bidirectional&&b>c);if(a.db)return c?a.db.get(h?c:b,h?b:c,d,e,f,g,k):a.db.get(b,"",d,e,f,g,k);a=c?(a=a.ctx.get(h?b:c))&&a.get(h?c:b):a.map.get(b);return a};M.prototype.remove=function(a,b){const c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(let d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{const f=e.indexOf(a);f===c.length-1?e.pop():e.splice(f,1)}}else eb(this.map,a),this.depth&&eb(this.ctx,a);b||this.reg.delete(a)}this.db&&(this.commit_task.push({del:a}),this.T&&Wa(this));this.cache&&this.cache.remove(a);return this};
v.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]);return this};v.append=function(a,b){return this.add(a,b,!0)};v.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)};v.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)}; function eb(a,b){let c=0;if(a.constructor===Array)for(let d=0,e,f;d<a.length;d++){if((e=a[d])&&e.length)if(f=e.indexOf(b),0<=f){1<e.length?(e.splice(f,1),c++):delete a[d];break}else c++}else for(let d of a){const e=d[0],f=eb(d[1],b);f?c+=f:a.delete(e)}return c};function M(a,b){if(!this||this.constructor!==M)return new M(a);if(a){var c=F(a)?a:a.preset;c&&(a=Object.assign({},Ua[c],a))}else a={};c=a.context;const d=!0===c?{depth:1}:c||{},e=F(a.encoder)?Ta[a.encoder]:a.encode||a.encoder||La;this.encoder=e.encode?e:"object"===typeof e?new K(e):{encode:e};this.resolution=a.resolution||9;this.tokenize=c=a.tokenize||"strict";this.depth="strict"===c&&d.depth||0;this.bidirectional=!1!==d.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;(c=a.keystore||
function eb(a){let b=0;if(a.constructor===Array)for(let c=0,d;c<a.length;c++)(d=a[c])&&(b+=d.length);else for(const c of a){const d=c[0],e=eb(c[1]);e?b+=e:a.delete(d)}return b}v.cleanup=function(){if(!this.fastupdate)return this;eb(this.map);this.depth&&eb(this.ctx);return this};v.searchCache=Ja; 0)&&(this.keystore=c);this.map=c?new R(c):new Map;this.ctx=c?new R(c):new Map;this.reg=b||(this.fastupdate?c?new R(c):new Map:c?new S(c):new Set);this.R=d.resolution||3;this.rtl=e.rtl||a.rtl||!1;this.cache=(c=a.cache||null)&&new U(c);this.resolve=!1!==a.resolve;if(c=a.db)this.db=this.mount(c);this.T=!1!==a.commit;this.commit_task=[];this.commit_timer=null}u=M.prototype;u.mount=function(a){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return a.mount(this)};
v.export=function(a,b,c,d=0){let e,f;switch(d){case 0:e="reg";f=sa(this.reg);break;case 1:e="cfg";f={};break;case 2:e="map";f=oa(this.map,this.reg.size);break;case 3:e="ctx";f=qa(this.ctx,this.reg.size);break;default:return}return ua.call(this,a,b,e,f,c,d)}; u.commit=function(a,b){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.commit(this,a,b)};u.destroy=function(){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.destroy()};function Wa(a){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null;a.db.commit(a,void 0,void 0)},0))}
v.import=function(a,b){if(b)switch(F(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=ta(b,this.reg);break;case "map":this.map=pa(b,this.map);break;case "ctx":this.ctx=ra(b,this.ctx)}}; u.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]);return this};u.append=function(a,b){return this.add(a,b,!0)};u.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)};u.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)};
v.serialize=function(a=!0){if(!this.reg.size)return"";let b="",c="";for(var d of this.reg.keys())c||(c=typeof d),b+=(b?",":"")+("string"===c?'"'+d+'"':d);b="index.reg=new Set(["+b+"]);";d="";for(var e of this.map.entries()){var f=e[0],g=e[1],h="";for(let m=0,p;m<g.length;m++){p=g[m]||[""];var k="";for(var l=0;l<p.length;l++)k+=(k?",":"")+("string"===c?'"'+p[l]+'"':p[l]);k="["+k+"]";h+=(h?",":"")+k}h='["'+f+'",['+h+"]]";d+=(d?",":"")+h}d="index.map=new Map(["+d+"]);";e="";for(const m of this.ctx.entries()){f= function fb(a){let b=0;if(a.constructor===Array)for(let c=0,d;c<a.length;c++)(d=a[c])&&(b+=d.length);else for(const c of a){const d=c[0],e=fb(c[1]);e?b+=e:a.delete(d)}return b}u.cleanup=function(){if(!this.fastupdate)return this;fb(this.map);this.depth&&fb(this.ctx);return this};u.searchCache=Ka;
m[0];g=m[1];for(const p of g.entries()){g=p[0];h=p[1];k="";for(let n=0,q;n<h.length;n++){q=h[n]||[""];l="";for(let r=0;r<q.length;r++)l+=(l?",":"")+("string"===c?'"'+q[r]+'"':q[r]);l="["+l+"]";k+=(k?",":"")+l}k='new Map([["'+g+'",['+k+"]]])";k='["'+f+'",'+k+"]";e+=(e?",":"")+k}}e="index.ctx=new Map(["+e+"]);";return a?"function inject(index){"+b+d+e+"}":b+d+e};na(L.prototype);const fb="undefined"!==typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),gb=["map","ctx","tag","reg","cfg"]; u.export=function(a,b,c,d=0){let e,f;switch(d){case 0:e="reg";f=ta(this.reg);break;case 1:e="cfg";f={};break;case 2:e="map";f=pa(this.map,this.reg.size);break;case 3:e="ctx";f=ra(this.ctx,this.reg.size);break;default:return}return va.call(this,a,b,e,f,c,d)};
function ib(a,b={}){if(!this)return new ib(a,b);"object"===typeof a&&(b=a=a.name);a||console.info("Default storage space was used, because a name was not passed.");this.id="flexsearch"+(a?":"+a.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"");this.field=b.field?b.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"";this.support_tag_search=!1;this.db=null;this.h={}}v=ib.prototype;v.mount=function(a){if(!a.encoder)return a.mount(this);a.db=this;return this.open()}; u.import=function(a,b){if(b)switch(F(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=ua(b,this.reg);break;case "map":this.map=qa(b,this.map);break;case "ctx":this.ctx=sa(b,this.ctx)}};
v.open=function(){let a=this;navigator.storage&&navigator.storage.persist();return this.db||new Promise(function(b,c){const d=fb.open(a.id+(a.field?":"+a.field:""),1);d.onupgradeneeded=function(){const e=a.db=this.result;gb.forEach(f=>{e.objectStoreNames.contains(f)||e.createObjectStore(f)})};d.onblocked=function(e){console.error("blocked",e);c()};d.onerror=function(e){console.error(this.error,e);c()};d.onsuccess=function(){a.db=this.result;a.db.onversionchange=function(){a.close()};b(a)}})}; u.serialize=function(a=!0){if(!this.reg.size)return"";let b="",c="";for(var d of this.reg.keys())c||(c=typeof d),b+=(b?",":"")+("string"===c?'"'+d+'"':d);b="index.reg=new Set(["+b+"]);";d="";for(var e of this.map.entries()){var f=e[0],g=e[1],k="";for(let m=0,q;m<g.length;m++){q=g[m]||[""];var h="";for(var l=0;l<q.length;l++)h+=(h?",":"")+("string"===c?'"'+q[l]+'"':q[l]);h="["+h+"]";k+=(k?",":"")+h}k='["'+f+'",['+k+"]]";d+=(d?",":"")+k}d="index.map=new Map(["+d+"]);";e="";for(const m of this.ctx.entries()){f=
v.close=function(){this.db.close();this.db=null};v.destroy=function(){return fb.deleteDatabase(this.id+(this.field?":"+this.field:""))};v.clear=function(){const a=this.db.transaction(gb,"readwrite");for(let b=0;b<gb.length;b++)a.objectStore(gb[b]).clear();return Z(a)}; m[0];g=m[1];for(const q of g.entries()){g=q[0];k=q[1];h="";for(let n=0,p;n<k.length;n++){p=k[n]||[""];l="";for(let r=0;r<p.length;r++)l+=(l?",":"")+("string"===c?'"'+p[r]+'"':p[r]);l="["+l+"]";h+=(h?",":"")+l}h='new Map([["'+g+'",['+h+"]]])";h='["'+f+'",'+h+"]";e+=(e?",":"")+h}}e="index.ctx=new Map(["+e+"]);";return a?"function inject(index){"+b+d+e+"}":b+d+e};oa(M.prototype);const gb="undefined"!==typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),hb=["map","ctx","tag","reg","cfg"];
v.get=function(a,b,c=0,d=0,e=!0,f=!1){a=this.db.transaction(b?"ctx":"map","readonly").objectStore(b?"ctx":"map").get(b?b+":"+a:a);const g=this;return Z(a).then(function(h){let k=[];if(!h||!h.length)return k;if(e){if(!c&&!d&&1===h.length)return h[0];for(let l=0,m;l<h.length;l++)if((m=h[l])&&m.length){if(d>=m.length){d-=m.length;continue}const p=c?d+Math.min(m.length-d,c):m.length;for(let n=d;n<p;n++)k.push(m[n]);d=0;if(k.length===c)break}return f?g.enrich(k):k}return h})}; function jb(a,b={}){if(!this)return new jb(a,b);"object"===typeof a&&(b=a=a.name);a||console.info("Default storage space was used, because a name was not passed.");this.id="flexsearch"+(a?":"+a.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"");this.field=b.field?b.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"";this.support_tag_search=!1;this.db=null;this.h={}}u=jb.prototype;u.mount=function(a){if(!a.encoder)return a.mount(this);a.db=this;return this.open()};
v.tag=function(a,b=0,c=0,d=!1){a=this.db.transaction("tag","readonly").objectStore("tag").get(a);const e=this;return Z(a).then(function(f){if(!f||!f.length||c>=f.length)return[];if(!b&&!c)return f;f=f.slice(c,c+b);return d?e.enrich(f):f})}; u.open=function(){let a=this;navigator.storage&&navigator.storage.persist();return this.db||new Promise(function(b,c){const d=gb.open(a.id+(a.field?":"+a.field:""),1);d.onupgradeneeded=function(){const e=a.db=this.result;hb.forEach(f=>{e.objectStoreNames.contains(f)||e.createObjectStore(f)})};d.onblocked=function(e){console.error("blocked",e);c()};d.onerror=function(e){console.error(this.error,e);c()};d.onsuccess=function(){a.db=this.result;a.db.onversionchange=function(){a.close()};b(a)}})};
v.enrich=function(a){"object"!==typeof a&&(a=[a]);const b=this.db.transaction("reg","readonly").objectStore("reg"),c=[];for(let d=0;d<a.length;d++)c[d]=Z(b.get(a[d]));return Promise.all(c).then(function(d){for(let e=0;e<d.length;e++)d[e]={id:a[e],doc:d[e]?JSON.parse(d[e]):null};return d})};v.has=function(a){a=this.db.transaction("reg","readonly").objectStore("reg").getKey(a);return Z(a)};v.search=null;v.info=function(){}; u.close=function(){this.db.close();this.db=null};u.destroy=function(){return gb.deleteDatabase(this.id+(this.field?":"+this.field:""))};u.clear=function(){const a=this.db.transaction(hb,"readwrite");for(let b=0;b<hb.length;b++)a.objectStore(hb[b]).clear();return Z(a)};
v.transaction=function(a,b,c){let d=this.h[a+":"+b];if(d)return c.call(this,d);let e=this.db.transaction(a,b);this.h[a+":"+b]=d=e.objectStore(a);return new Promise((f,g)=>{e.onerror=h=>{this.h[a+":"+b]=null;e.abort();e=d=null;g(h)};e.oncomplete=h=>{e=d=this.h[a+":"+b]=null;f(h||!0)};return c.call(this,d)})}; u.get=function(a,b,c=0,d=0,e=!0,f=!1){a=this.db.transaction(b?"ctx":"map","readonly").objectStore(b?"ctx":"map").get(b?b+":"+a:a);const g=this;return Z(a).then(function(k){let h=[];if(!k||!k.length)return h;if(e){if(!c&&!d&&1===k.length)return k[0];for(let l=0,m;l<k.length;l++)if((m=k[l])&&m.length){if(d>=m.length){d-=m.length;continue}const q=c?d+Math.min(m.length-d,c):m.length;for(let n=d;n<q;n++)h.push(m[n]);d=0;if(h.length===c)break}return f?g.enrich(h):h}return k})};
v.commit=async function(a,b,c){if(b)await this.clear(),a.commit_task=[];else{let d=a.commit_task;a.commit_task=[];for(let e=0,f;e<d.length;e++)if(f=d[e],f.clear){await this.clear();b=!0;break}else d[e]=f.V;b||(c||(d=d.concat(ba(a.reg))),d.length&&await this.remove(d))}a.reg.size&&(await this.transaction("map","readwrite",function(d){for(const e of a.map){const f=e[0],g=e[1];g.length&&(b?d.put(g,f):d.get(f).onsuccess=function(){let h=this.result;var k;if(h&&h.length){const l=Math.max(h.length,g.length); u.tag=function(a,b=0,c=0,d=!1){a=this.db.transaction("tag","readonly").objectStore("tag").get(a);const e=this;return Z(a).then(function(f){if(!f||!f.length||c>=f.length)return[];if(!b&&!c)return f;f=f.slice(c,c+b);return d?e.enrich(f):f})};
for(let m=0,p,n;m<l;m++)if((n=g[m])&&n.length){if((p=h[m])&&p.length)for(k=0;k<n.length;k++)p.push(n[k]);else h[m]=n;k=1}}else h=g,k=1;k&&d.put(h,f)})}}),await this.transaction("ctx","readwrite",function(d){for(const e of a.ctx){const f=e[0],g=e[1];for(const h of g){const k=h[0],l=h[1];l.length&&(b?d.put(l,f+":"+k):d.get(f+":"+k).onsuccess=function(){let m=this.result;var p;if(m&&m.length){const n=Math.max(m.length,l.length);for(let q=0,r,t;q<n;q++)if((t=l[q])&&t.length){if((r=m[q])&&r.length)for(p= u.enrich=function(a){"object"!==typeof a&&(a=[a]);const b=this.db.transaction("reg","readonly").objectStore("reg"),c=[];for(let d=0;d<a.length;d++)c[d]=Z(b.get(a[d]));return Promise.all(c).then(function(d){for(let e=0;e<d.length;e++)d[e]={id:a[e],doc:d[e]?JSON.parse(d[e]):null};return d})};u.has=function(a){a=this.db.transaction("reg","readonly").objectStore("reg").getKey(a);return Z(a)};u.search=null;u.info=function(){};
0;p<t.length;p++)r.push(t[p]);else m[q]=t;p=1}}else m=l,p=1;p&&d.put(m,f+":"+k)})}}}),a.store?await this.transaction("reg","readwrite",function(d){for(const e of a.store){const f=e[0],g=e[1];d.put("object"===typeof g?JSON.stringify(g):1,f)}}):a.bypass||await this.transaction("reg","readwrite",function(d){for(const e of a.reg.keys())d.put(1,e)}),a.tag&&await this.transaction("tag","readwrite",function(d){for(const e of a.tag){const f=e[0],g=e[1];g.length&&(d.get(f).onsuccess=function(){let h=this.result; u.transaction=function(a,b,c){let d=this.h[a+":"+b];if(d)return c.call(this,d);let e=this.db.transaction(a,b);this.h[a+":"+b]=d=e.objectStore(a);return new Promise((f,g)=>{e.onerror=k=>{this.h[a+":"+b]=null;e.abort();e=d=null;g(k)};e.oncomplete=k=>{e=d=this.h[a+":"+b]=null;f(k||!0)};return c.call(this,d)})};
h=h&&h.length?h.concat(g):g;d.put(h,f)})}}),a.map.clear(),a.ctx.clear(),a.tag&&a.tag.clear(),a.store&&a.store.clear(),a.document||a.reg.clear())}; u.commit=async function(a,b,c){if(b)await this.clear(),a.commit_task=[];else{let d=a.commit_task;a.commit_task=[];for(let e=0,f;e<d.length;e++)if(f=d[e],f.clear){await this.clear();b=!0;break}else d[e]=f.V;b||(c||(d=d.concat(ba(a.reg))),d.length&&await this.remove(d))}a.reg.size&&(await this.transaction("map","readwrite",function(d){for(const e of a.map){const f=e[0],g=e[1];g.length&&(b?d.put(g,f):d.get(f).onsuccess=function(){let k=this.result;var h;if(k&&k.length){const l=Math.max(k.length,g.length);
function jb(a,b,c){const d=a.value;let e,f,g=0;for(let h=0,k;h<d.length;h++){if(k=c?d:d[h]){for(let l=0,m,p;l<b.length;l++)if(p=b[l],m=k.indexOf(f?parseInt(p,10):p),0>m&&!f&&"string"===typeof p&&!isNaN(p)&&(m=k.indexOf(parseInt(p,10)))&&(f=1),0<=m)if(e=1,1<k.length)k.splice(m,1);else{d[h]=[];break}g+=k.length}if(c)break}g?e&&a.update(d):a.delete();a.continue()} for(let m=0,q,n;m<l;m++)if((n=g[m])&&n.length){if((q=k[m])&&q.length)for(h=0;h<n.length;h++)q.push(n[h]);else k[m]=n;h=1}}else k=g,h=1;h&&d.put(k,f)})}}),await this.transaction("ctx","readwrite",function(d){for(const e of a.ctx){const f=e[0],g=e[1];for(const k of g){const h=k[0],l=k[1];l.length&&(b?d.put(l,f+":"+h):d.get(f+":"+h).onsuccess=function(){let m=this.result;var q;if(m&&m.length){const n=Math.max(m.length,l.length);for(let p=0,r,t;p<n;p++)if((t=l[p])&&t.length){if((r=m[p])&&r.length)for(q=
v.remove=function(a){"object"!==typeof a&&(a=[a]);return Promise.all([this.transaction("map","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&jb(c,a)}}),this.transaction("ctx","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&jb(c,a)}}),this.transaction("tag","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&jb(c,a,!0)}}),this.transaction("reg","readwrite",function(b){for(let c=0;c<a.length;c++)b.delete(a[c])})])}; 0;q<t.length;q++)r.push(t[q]);else m[p]=t;q=1}}else m=l,q=1;q&&d.put(m,f+":"+h)})}}}),a.store?await this.transaction("reg","readwrite",function(d){for(const e of a.store){const f=e[0],g=e[1];d.put("object"===typeof g?JSON.stringify(g):1,f)}}):a.bypass||await this.transaction("reg","readwrite",function(d){for(const e of a.reg.keys())d.put(1,e)}),a.tag&&await this.transaction("tag","readwrite",function(d){for(const e of a.tag){const f=e[0],g=e[1];g.length&&(d.get(f).onsuccess=function(){let k=this.result;
function Z(a){return new Promise((b,c)=>{a.onsuccess=function(){b(this.result)};a.oncomplete=function(){b(this.result)};a.onerror=c;a=null})};const kb={Index:L,Charset:Sa,Encoder:K,Document:T,Worker:N,Resolver:X,IndexedDB:ib,Language:{}},lb=self;let mb;(mb=lb.define)&&mb.amd?mb([],function(){return kb}):"object"===typeof lb.exports?lb.exports=kb:lb.FlexSearch=kb;}(this||self)); k=k&&k.length?k.concat(g):g;d.put(k,f)})}}),a.map.clear(),a.ctx.clear(),a.tag&&a.tag.clear(),a.store&&a.store.clear(),a.document||a.reg.clear())};
function kb(a,b,c){const d=a.value;let e,f,g=0;for(let k=0,h;k<d.length;k++){if(h=c?d:d[k]){for(let l=0,m,q;l<b.length;l++)if(q=b[l],m=h.indexOf(f?parseInt(q,10):q),0>m&&!f&&"string"===typeof q&&!isNaN(q)&&(m=h.indexOf(parseInt(q,10)))&&(f=1),0<=m)if(e=1,1<h.length)h.splice(m,1);else{d[k]=[];break}g+=h.length}if(c)break}g?e&&a.update(d):a.delete();a.continue()}
u.remove=function(a){"object"!==typeof a&&(a=[a]);return Promise.all([this.transaction("map","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&kb(c,a)}}),this.transaction("ctx","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&kb(c,a)}}),this.transaction("tag","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&kb(c,a,!0)}}),this.transaction("reg","readwrite",function(b){for(let c=0;c<a.length;c++)b.delete(a[c])})])};
function Z(a){return new Promise((b,c)=>{a.onsuccess=function(){b(this.result)};a.oncomplete=function(){b(this.result)};a.onerror=c;a=null})};const lb={Index:M,Charset:Ta,Encoder:K,Document:T,Worker:N,Resolver:X,IndexedDB:jb,Language:{}},mb=self;let nb;(nb=mb.define)&&nb.amd?nb([],function(){return lb}):"object"===typeof mb.exports?mb.exports=lb:mb.FlexSearch=lb;}(this||self));

File diff suppressed because it is too large Load Diff

View File

@@ -5,99 +5,102 @@
* Hosted by Nextapps GmbH * Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
var v;function z(a,b,c){const d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var f=new Map(c);for(var g of a)f.set(g[0],g[1]);return f}if(b===Set){g=new Set(c);for(f of a.values())g.add(f);return g}}}return a}return c}return"undefined"===e?b:a}function B(){return Object.create(null)}function aa(a,b){return b.length-a.length} var u;function z(a,b,c){const d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(k){return a(c(k))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var f=new Map(c);for(var g of a)f.set(g[0],g[1]);return f}if(b===Set){g=new Set(c);for(f of a.values())g.add(f);return g}}}return a}return c}return"undefined"===e?b:a}function C(){return Object.create(null)}function aa(a,b){return b.length-a.length}
function F(a){return"string"===typeof a}function G(a){return"object"===typeof a}function ba(a){const b=[];for(const c of a.keys())b.push(c);return b}function J(a,b){if(F(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}function ca(a){let b=0;for(let c=0,d;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var da=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb", function F(a){return"string"===typeof a}function G(a){return"object"===typeof a}function ba(a){const b=[];for(const c of a.keys())b.push(c);return b}function J(a,b){if(F(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}function ca(a){let b=0;for(let c=0,d;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var da=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb",
"u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"], "u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"],
["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0", ["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0",
"i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215", "i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215",
"u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af", "u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af",
"\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"], "\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"],
["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const ea=/[^\p{L}\p{N}]+/u,fa=/(\d{3})/g,ha=/(\D)(\d{3})/g,ia=/(\d{3})(\D)/g,ja="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])} ["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const ea=/[^\p{L}\p{N}]+/u,fa=/(\d{3})/g,ha=/(\D)(\d{3})/g,ia=/(\d{3})(\D)/g,ja="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])}u=K.prototype;
K.prototype.assign=function(a){this.normalize=z(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(f){this.split=/\s+/}this.numeric=d}else{try{this.split=z(c,ea,this.split)}catch(d){this.split= u.assign=function(a){this.normalize=z(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(f){this.split=/\s+/}this.numeric=d}else{try{this.split=z(c,ea,this.split)}catch(d){this.split=
/\s+/}this.numeric=z(this.numeric,!0)}this.prepare=z(a.prepare,null,this.prepare);this.finalize=z(a.finalize,null,this.finalize);ja||(this.mapper=new Map(da));this.rtl=a.rtl||!1;this.dedupe=z(a.dedupe,!0,this.dedupe);this.filter=z((c=a.filter)&&new Set(c),null,this.filter);this.matcher=z((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=z((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=z((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=z(a.replacer,null,this.replacer);this.minlength= /\s+/}this.numeric=z(this.numeric,!0)}this.prepare=z(a.prepare,null,this.prepare);this.finalize=z(a.finalize,null,this.finalize);ja||(this.mapper=new Map(da));this.rtl=a.rtl||!1;this.dedupe=z(a.dedupe,!0,this.dedupe);this.filter=z((c=a.filter)&&new Set(c),null,this.filter);this.matcher=z((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=z((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=z((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=z(a.replacer,null,this.replacer);this.minlength=
z(a.minlength,1,this.minlength);this.maxlength=z(a.maxlength,0,this.maxlength);if(this.cache=c=z(a.cache,!0,this.cache))this.L=null,this.S="number"===typeof c?c:2E5,this.H=new Map,this.J=new Map,this.A=this.h=128;this.B="";this.O=null;this.M="";this.P=null;if(this.matcher)for(const d of this.matcher.keys())this.B+=(this.B?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.M+=(this.M?"|":"")+d;return this}; z(a.minlength,1,this.minlength);this.maxlength=z(a.maxlength,0,this.maxlength);if(this.cache=c=z(a.cache,!0,this.cache))this.L=null,this.S="number"===typeof c?c:2E5,this.H=new Map,this.I=new Map,this.M=this.B=128;this.h="";this.N=null;this.A="";this.O=null;if(this.matcher)for(const d of this.matcher.keys())this.h+=(this.h?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.A+=(this.A?"|":"")+d;return this};
K.prototype.encode=function(a){if(this.cache&&a.length<=this.h)if(this.L){if(this.H.has(a))return this.H.get(a)}else this.L=setTimeout(ka,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ja?a.normalize("NFKD").replace(ja,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(ha,"$1 $2").replace(ia,"$1 $2").replace(fa,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer); u.addMatcher=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(2>a.length)return this.addMapper(a,b);this.matcher||(this.matcher=new Map);this.matcher.set(a,b);this.h+=(this.h?"|":"")+a;this.N=null;this.cache&&L(this);return this};u.addStemmer=function(a,b){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,b);this.A+=(this.A?"|":"")+a;this.O=null;this.cache&&L(this);return this};
let c=[],d=this.split||""===this.split?a.split(this.split):a;for(let f=0,g,h;f<d.length;f++){if(!(g=h=d[f]))continue;if(g.length<this.minlength)continue;if(b){c.push(g);continue}if(this.filter&&this.filter.has(g))continue;if(this.cache&&g.length<=this.A)if(this.L){var e=this.J.get(g);if(e||""===e){e&&c.push(e);continue}}else this.L=setTimeout(ka,50,this);let k;this.stemmer&&2<g.length&&(this.P||(this.P=new RegExp("(?!^)("+this.M+")$")),g=g.replace(this.P,l=>this.stemmer.get(l)),k=1);g&&k&&(g.length< u.addFilter=function(a){this.filter||(this.filter=new Set);this.filter.add(a);this.cache&&L(this);return this};u.addMapper=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(1<a.length)return this.addMatcher(a,b);this.mapper||(this.mapper=new Map);this.mapper.set(a,b);this.cache&&L(this);return this};u.addReplacer=function(a,b){"string"===typeof a&&(a=new RegExp(a,"g"));this.replacer||(this.replacer=[]);this.replacer.push(a,b||"");this.cache&&L(this);return this};
this.minlength||this.filter&&this.filter.has(g))&&(g="");if(g&&(this.mapper||this.dedupe&&1<g.length)){e="";for(let l=0,m="",p,n;l<g.length;l++)p=g.charAt(l),p===m&&this.dedupe||((n=this.mapper&&this.mapper.get(p))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=p);g=e}this.matcher&&1<g.length&&(this.O||(this.O=new RegExp("("+this.B+")","g")),g=g.replace(this.O,l=>this.matcher.get(l)));if(g&&this.replacer)for(e=0;g&&e<this.replacer.length;e+=2)g=g.replace(this.replacer[e],this.replacer[e+1]);this.cache&& function L(a){a.H.clear();a.I.clear()}
h.length<=this.A&&(this.J.set(h,g),this.J.size>this.S&&(this.J.clear(),this.A=this.A/1.1|0));g&&c.push(g)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.h&&(this.H.set(a,c),this.H.size>this.S&&(this.H.clear(),this.h=this.h/1.1|0));return c};function ka(a){a.L=null;a.H.clear();a.J.clear()};async function la(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(b=d.config)&&(d=(await import(b))["default"]);(b=a.factory)?(Function("return "+b)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);postMessage({id:a.id});break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let M=0; u.encode=function(a){if(this.cache&&a.length<=this.B)if(this.L){if(this.H.has(a))return this.H.get(a)}else this.L=setTimeout(ka,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ja?a.normalize("NFKD").replace(ja,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(ha,"$1 $2").replace(ia,"$1 $2").replace(fa,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let c=[],
function N(a={}){function b(g){function h(k){k=k.data||k;const l=k.id,m=l&&e.h[l];m&&(m(k.msg),delete e.h[l])}this.worker=g;this.h=B();if(this.worker){d?this.worker.on("message",h):this.worker.onmessage=h;if(a.config)return new Promise(function(k){e.h[++M]=function(){k(e)};e.worker.postMessage({id:M,task:"init",factory:c,options:a})});this.worker.postMessage({task:"init",factory:c,options:a});return this}}if(!this||this.constructor!==N)return new N(a);let c="undefined"!==typeof self?self._factory:"undefined"!== d=this.split||""===this.split?a.split(this.split):a;for(let f=0,g,k;f<d.length;f++){if(!(g=k=d[f]))continue;if(g.length<this.minlength)continue;if(b){c.push(g);continue}if(this.filter&&this.filter.has(g))continue;if(this.cache&&g.length<=this.M)if(this.L){var e=this.I.get(g);if(e||""===e){e&&c.push(e);continue}}else this.L=setTimeout(ka,50,this);let h;this.stemmer&&2<g.length&&(this.O||(this.O=new RegExp("(?!^)("+this.A+")$")),g=g.replace(this.O,l=>this.stemmer.get(l)),h=1);g&&h&&(g.length<this.minlength||
typeof window?window._factory:null;c&&(c=c.toString());const d="undefined"===typeof window,e=this,f=ma(c,d,a.worker);return f.then?f.then(function(g){return b.call(e,g)}):b.call(this,f)}O("add");O("append");O("search");O("update");O("remove"); this.filter&&this.filter.has(g))&&(g="");if(g&&(this.mapper||this.dedupe&&1<g.length)){e="";for(let l=0,m="",q,n;l<g.length;l++)q=g.charAt(l),q===m&&this.dedupe||((n=this.mapper&&this.mapper.get(q))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=q);g=e}this.matcher&&1<g.length&&(this.N||(this.N=new RegExp("("+this.h+")","g")),g=g.replace(this.N,l=>this.matcher.get(l)));if(g&&this.replacer)for(e=0;g&&e<this.replacer.length;e+=2)g=g.replace(this.replacer[e],this.replacer[e+1]);this.cache&&k.length<=
function O(a){N.prototype[a]=N.prototype[a+"Async"]=async function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;"function"===typeof d&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){b.h[++M]=f;b.worker.postMessage({task:a,id:M,args:c})});return e?(d.then(e),this):d}} this.M&&(this.I.set(k,g),this.I.size>this.S&&(this.I.clear(),this.M=this.M/1.1|0));g&&c.push(g)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.B&&(this.H.set(a,c),this.H.size>this.S&&(this.H.clear(),this.B=this.B/1.1|0));return c};function ka(a){a.L=null;a.H.clear();a.I.clear()};async function la(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(b=a.factory)?(Function("return "+b)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new M(d);postMessage({id:a.id});break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let ma=0;
function ma(a,b,c){return b?"undefined"!==typeof module?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):import("worker_threads").then(function(worker){ return new worker["Worker"](import.meta.dirname + "/node/node.mjs"); }):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+la.toString()],{type:"text/javascript"}))):new window.Worker(F(c)?c:import.meta.url.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js", function N(a={}){function b(g){function k(h){h=h.data||h;const l=h.id,m=l&&e.h[l];m&&(m(h.msg),delete e.h[l])}this.worker=g;this.h=C();if(this.worker){d?this.worker.on("message",k):this.worker.onmessage=k;if(a.config)return new Promise(function(h){e.h[++ma]=function(){h(e)};e.worker.postMessage({id:ma,task:"init",factory:c,options:a})});this.worker.postMessage({task:"init",factory:c,options:a});return this}}if(!this||this.constructor!==N)return new N(a);let c="undefined"!==typeof self?self._factory:"undefined"!==
"module/worker/worker.js"),{type:"module"})};function na(a){P.call(a,"add");P.call(a,"append");P.call(a,"search");P.call(a,"update");P.call(a,"remove")}function P(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let d;"function"===typeof c&&(d=c,delete b[b.length-1]);b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function oa(a,b=0){let c=[],d=[];b&&(b=25E4/b*5E3|0);for(const e of a.entries())d.push(e),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}function pa(a,b){b||(b=new Map);for(let c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b}function qa(a,b=0){let c=[],d=[];b&&(b=25E4/b*1E3|0);for(const e of a.entries())d.push([e[0],oa(e[1])[0]]),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c} typeof window?window._factory:null;c&&(c=c.toString());const d="undefined"===typeof window,e=this,f=na(c,d,a.worker);return f.then?f.then(function(g){return b.call(e,g)}):b.call(this,f)}O("add");O("append");O("search");O("update");O("remove");
function ra(a,b){b||(b=new Map);for(let c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],pa(d[1],e));return b}function sa(a){let b=[],c=[];for(const d of a.keys())c.push(d),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}function ta(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b} function O(a){N.prototype[a]=N.prototype[a+"Async"]=async function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;"function"===typeof d&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){b.h[++ma]=f;b.worker.postMessage({task:a,id:ma,args:c})});return e?(d.then(e),this):d}}
function ua(a,b,c,d,e,f,g=0){const h=d&&d.constructor===Array;var k=h?d.shift():d;if(!k)return this.export(a,b,e,f+1);if((k=a((b?b+".":"")+(g+1)+"."+c,JSON.stringify(k)))&&k.then){const l=this;return k.then(function(){return ua.call(l,a,b,c,h?d:null,e,f,g+1)})}return ua.call(this,a,b,c,h?d:null,e,f,g+1)};function va(a,b,c,d){let e=[];for(let f=0,g;f<a.index.length;f++)if(g=a.index[f],b>=g.length)b-=g.length;else{b=g[d?"splice":"slice"](b,c);const h=b.length;if(h&&(e=e.length?e.concat(b):b,c-=h,d&&(a.length-=h),!c))break;b=0}return e} function na(a,b,c){return b?"undefined"!==typeof module?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):import("worker_threads").then(function(worker){ return new worker["Worker"](import.meta.dirname + "/node/node.mjs"); }):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+la.toString()],{type:"text/javascript"}))):new window.Worker(F(c)?c:import.meta.url.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js",
function Q(a){if(!this)return new Q(a);this.index=a?[a]:[];this.length=a?a.length:0;const b=this;return new Proxy([],{get(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){let f=0;for(let g=0,h,k;g<b.index.length;g++){h=b.index[g];k=h.indexOf(e);if(0<=k)return f+k;f+=h.length}return-1};if("includes"===d)return function(e){for(let f= "module/worker/worker.js"),{type:"module"})};function oa(a){P.call(a,"add");P.call(a,"append");P.call(a,"search");P.call(a,"update");P.call(a,"remove")}function P(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let d;"function"===typeof c&&(d=c,delete b[b.length-1]);b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function pa(a,b=0){let c=[],d=[];b&&(b=25E4/b*5E3|0);for(const e of a.entries())d.push(e),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}function qa(a,b){b||(b=new Map);for(let c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b}function ra(a,b=0){let c=[],d=[];b&&(b=25E4/b*1E3|0);for(const e of a.entries())d.push([e[0],pa(e[1])[0]]),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}
0;f<b.index.length;f++)if(b.index[f].includes(e))return!0;return!1};if("slice"===d)return function(e,f){return va(b,e||0,f||b.length,!1)};if("splice"===d)return function(e,f){return va(b,e||0,f||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/2**31|0])&&c[d]},set(c,d,e){c=d/2**31|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}Q.prototype.clear=function(){this.index.length=0};Q.prototype.destroy=function(){this.proxy=this.index=null}; function sa(a,b){b||(b=new Map);for(let c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],qa(d[1],e));return b}function ta(a){let b=[],c=[];for(const d of a.keys())c.push(d),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}function ua(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b}
Q.prototype.push=function(){};function R(a=8){if(!this)return new R(a);this.index=B();this.B=[];this.size=0;32<a?(this.h=wa,this.A=BigInt(a)):(this.h=xa,this.A=a)}R.prototype.get=function(a){const b=this.index[this.h(a)];return b&&b.get(a)};R.prototype.set=function(a,b){var c=this.h(a);let d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.B.push(d))}; function va(a,b,c,d,e,f,g=0){const k=d&&d.constructor===Array;var h=k?d.shift():d;if(!h)return this.export(a,b,e,f+1);if((h=a((b?b+".":"")+(g+1)+"."+c,JSON.stringify(h)))&&h.then){const l=this;return h.then(function(){return va.call(l,a,b,c,k?d:null,e,f,g+1)})}return va.call(this,a,b,c,k?d:null,e,f,g+1)};function wa(a,b,c,d){let e=[];for(let f=0,g;f<a.index.length;f++)if(g=a.index[f],b>=g.length)b-=g.length;else{b=g[d?"splice":"slice"](b,c);const k=b.length;if(k&&(e=e.length?e.concat(b):b,c-=k,d&&(a.length-=k),!c))break;b=0}return e}
function S(a=8){if(!this)return new S(a);this.index=B();this.h=[];32<a?(this.B=wa,this.A=BigInt(a)):(this.B=xa,this.A=a)}S.prototype.add=function(a){var b=this.B(a);let c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};v=R.prototype;v.has=S.prototype.has=function(a){const b=this.index[this.B(a)];return b&&b.has(a)};v.delete=S.prototype.delete=function(a){const b=this.index[this.B(a)];b&&b.delete(a)&&this.size--}; function Q(a){if(!this)return new Q(a);this.index=a?[a]:[];this.length=a?a.length:0;const b=this;return new Proxy([],{get(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){let f=0;for(let g=0,k,h;g<b.index.length;g++){k=b.index[g];h=k.indexOf(e);if(0<=h)return f+h;f+=k.length}return-1};if("includes"===d)return function(e){for(let f=
v.clear=S.prototype.clear=function(){this.index=B();this.h=[];this.size=0};v.values=S.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].values())yield b};v.keys=S.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].keys())yield b};v.entries=S.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].entries())yield b}; 0;f<b.index.length;f++)if(b.index[f].includes(e))return!0;return!1};if("slice"===d)return function(e,f){return wa(b,e||0,f||b.length,!1)};if("splice"===d)return function(e,f){return wa(b,e||0,f||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/2**31|0])&&c[d]},set(c,d,e){c=d/2**31|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}Q.prototype.clear=function(){this.index.length=0};Q.prototype.destroy=function(){this.proxy=this.index=null};
function xa(a){let b=2**this.A-1;if("number"==typeof a)return a&b;let c=0,d=this.A+1;for(let e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.A?c+2**31:c}function wa(a){let b=BigInt(2)**this.A-BigInt(1);var c=typeof a;if("bigint"===c)return a&b;if("number"===c)return BigInt(a)&b;c=BigInt(0);let d=this.A+BigInt(1);for(let e=0;e<a.length;e++)c=(c*d^BigInt(a.charCodeAt(e)))&b;return c};T.prototype.add=function(a,b,c){G(a)&&(b=a,a=J(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(let h=0,k;h<this.field.length;h++){k=this.D[h];var d=this.index.get(this.field[h]);if("function"===typeof k){var e=k(b);e&&d.add(a,e,!1,!0)}else if(e=k.I,!e||e(b))k.constructor===String?k=[""+k]:F(k)&&(k=[k]),ya(b,k,this.K,0,d,a,k[0],c)}if(this.tag)for(d=0;d<this.G.length;d++){var f=this.G[d];e=this.tag.get(this.N[d]);let h=B();if("function"===typeof f){if(f=f(b),!f)continue}else{var g= Q.prototype.push=function(){};function R(a=8){if(!this)return new R(a);this.index=C();this.B=[];this.size=0;32<a?(this.h=xa,this.A=BigInt(a)):(this.h=ya,this.A=a)}R.prototype.get=function(a){const b=this.index[this.h(a)];return b&&b.get(a)};R.prototype.set=function(a,b){var c=this.h(a);let d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.B.push(d))};
f.I;if(g&&!g(b))continue;f.constructor===String&&(f=""+f);f=J(b,f)}if(e&&f){F(f)&&(f=[f]);for(let k=0,l,m;k<f.length;k++)if(l=f[k],!h[l]&&(h[l]=1,(g=e.get(l))?m=g:e.set(l,m=[]),!c||!m.includes(a))){if(m.length===2**31-1){g=new Q(m);if(this.fastupdate)for(let p of this.reg.values())p.includes(m)&&(p[p.indexOf(m)]=g);e.set(l,m=g)}m.push(a);this.fastupdate&&((g=this.reg.get(a))?g.push(m):this.reg.set(a,[m]))}}}if(this.store&&(!c||!this.store.has(a))){let h;if(this.C){h=B();for(let k=0,l;k<this.C.length;k++){l= function S(a=8){if(!this)return new S(a);this.index=C();this.h=[];32<a?(this.B=xa,this.A=BigInt(a)):(this.B=ya,this.A=a)}S.prototype.add=function(a){var b=this.B(a);let c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};u=R.prototype;u.has=S.prototype.has=function(a){const b=this.index[this.B(a)];return b&&b.has(a)};u.delete=S.prototype.delete=function(a){const b=this.index[this.B(a)];b&&b.delete(a)&&this.size--};
this.C[k];if((c=l.I)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.U]}else if(F(l)||l.constructor===String){h[l]=b[l];continue}za(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function za(a,b,c,d,e,f){a=a[e];if(d===c.length-1)b[e]=f||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)za(a,b,c,d,e);else b=b[e]||(b[e]=B()),e=c[++d],za(a,b,c,d,e)} u.clear=S.prototype.clear=function(){this.index=C();this.h=[];this.size=0};u.values=S.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].values())yield b};u.keys=S.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].keys())yield b};u.entries=S.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].entries())yield b};
function ya(a,b,c,d,e,f,g,h){if(a=a[g])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)ya(a,b,c,d,e,f,g,h);else g=b[++d],ya(a,b,c,d,e,f,g,h);else e.db&&e.remove(f)};function Aa(a,b,c,d,e,f,g){const h=a.length;let k=[],l;var m;l=B();for(let p=0,n,q,r,t;p<b;p++)for(let u=0;u<h;u++)if(r=a[u],p<r.length&&(n=r[p]))for(let x=0;x<n.length;x++)q=n[x],(m=l[q])?l[q]++:(m=0,l[q]=1),t=k[m]||(k[m]=[]),g||(m=p+(u?0:f||0),t=t[m]||(t[m]=[])),t.push(q);if(a=k.length)if(e)k=1<k.length?Ba(k,d,c,g,0):(k=k[0]).length>c||d?k.slice(d,c+d):k;else{if(a<h)return[];k=k[a-1];if(c||d)if(g){if(k.length>c||d)k=k.slice(d,c+d)}else{e=[];for(let p=0,n;p<k.length;p++)if(n=k[p],n.length>d)d-=n.length; function ya(a){let b=2**this.A-1;if("number"==typeof a)return a&b;let c=0,d=this.A+1;for(let e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.A?c+2**31:c}function xa(a){let b=BigInt(2)**this.A-BigInt(1);var c=typeof a;if("bigint"===c)return a&b;if("number"===c)return BigInt(a)&b;c=BigInt(0);let d=this.A+BigInt(1);for(let e=0;e<a.length;e++)c=(c*d^BigInt(a.charCodeAt(e)))&b;return c};T.prototype.add=function(a,b,c){G(a)&&(b=a,a=J(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(let k=0,h;k<this.field.length;k++){h=this.D[k];var d=this.index.get(this.field[k]);if("function"===typeof h){var e=h(b);e&&d.add(a,e,!1,!0)}else if(e=h.J,!e||e(b))h.constructor===String?h=[""+h]:F(h)&&(h=[h]),za(b,h,this.K,0,d,a,h[0],c)}if(this.tag)for(d=0;d<this.G.length;d++){var f=this.G[d];e=this.tag.get(this.P[d]);let k=C();if("function"===typeof f){if(f=f(b),!f)continue}else{var g=
else{if(n.length>c||d)n=n.slice(d,c+d),c-=n.length,d&&(d-=n.length);e.push(n);if(!c)break}k=1<e.length?[].concat.apply([],e):e[0]}}return k} f.J;if(g&&!g(b))continue;f.constructor===String&&(f=""+f);f=J(b,f)}if(e&&f){F(f)&&(f=[f]);for(let h=0,l,m;h<f.length;h++)if(l=f[h],!k[l]&&(k[l]=1,(g=e.get(l))?m=g:e.set(l,m=[]),!c||!m.includes(a))){if(m.length===2**31-1){g=new Q(m);if(this.fastupdate)for(let q of this.reg.values())q.includes(m)&&(q[q.indexOf(m)]=g);e.set(l,m=g)}m.push(a);this.fastupdate&&((g=this.reg.get(a))?g.push(m):this.reg.set(a,[m]))}}}if(this.store&&(!c||!this.store.has(a))){let k;if(this.C){k=C();for(let h=0,l;h<this.C.length;h++){l=
function Ba(a,b,c,d,e){const f=[],g=B();let h;var k=a.length;let l,m=0;if(d)for(e=k-1;0<=e;e--)for(d=a[e],l=d.length,k=0;k<l;k++){if(h=d[k],!g[h])if(g[h]=1,b)b--;else if(f.push(h),f.length===c)return f}else{let p=ca(a);for(let n=0;n<p;n++)for(let q=k-1;0<=q;q--)if(l=(d=a[q][n])&&d.length)for(let r=0;r<l;r++)if(h=d[r],!g[h])if(g[h]=1,b)b--;else{let t=n+(q<k-1?e||0:0);(f[t]||(f[t]=[])).push(h);if(++m===c)return f}}return f} this.C[h];if((c=l.J)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.U]}else if(F(l)||l.constructor===String){k[l]=b[l];continue}Aa(b,k,l,0,l[0],m)}}this.store.set(a,k||b)}}return this};function Aa(a,b,c,d,e,f){a=a[e];if(d===c.length-1)b[e]=f||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)Aa(a,b,c,d,e);else b=b[e]||(b[e]=C()),e=c[++d],Aa(a,b,c,d,e)}
function Ca(a,b){const c=B(),d=[];for(let e=0,f;e<b.length;e++){f=b[e];for(let g=0;g<f.length;g++)c[f[g]]=1}for(let e=0,f;e<a.length;e++)f=a[e],1===c[f]&&(d.push(f),c[f]=2);return d};T.prototype.search=function(a,b,c,d){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let e=[],f=[],g;let h;let k;let l,m=0,p;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;g=c.pluck;h=c.merge;k=g||c.field||c.index;var n=this.tag&&c.tag;var q=this.store&&c.enrich;var r=c.suggest;p=c.highlight;b=c.limit||b;l=c.offset||0;b||(b=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var t=[];for(let y=0,w;y<n.length;y++)if(w=n[y],w.field&&w.tag){var u=w.tag;if(u.constructor===Array)for(var x=0;x< function za(a,b,c,d,e,f,g,k){if(a=a[g])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,k,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)za(a,b,c,d,e,f,g,k);else g=b[++d],za(a,b,c,d,e,f,g,k);else e.db&&e.remove(f)};function Ba(a,b,c,d,e,f,g){const k=a.length;let h=[],l;var m;l=C();for(let q=0,n,p,r,t;q<b;q++)for(let w=0;w<k;w++)if(r=a[w],q<r.length&&(n=r[q]))for(let x=0;x<n.length;x++)p=n[x],(m=l[p])?l[p]++:(m=0,l[p]=1),t=h[m]||(h[m]=[]),g||(m=q+(w?0:f||0),t=t[m]||(t[m]=[])),t.push(p);if(a=h.length)if(e)h=1<h.length?Ca(h,d,c,g,0):(h=h[0]).length>c||d?h.slice(d,c+d):h;else{if(a<k)return[];h=h[a-1];if(c||d)if(g){if(h.length>c||d)h=h.slice(d,c+d)}else{e=[];for(let q=0,n;q<h.length;q++)if(n=h[q],n.length>d)d-=n.length;
u.length;x++)t.push(w.field,u[x]);else t.push(w.field,u)}else{u=Object.keys(w);for(let A=0,H,C;A<u.length;A++)if(H=u[A],C=w[H],C.constructor===Array)for(x=0;x<C.length;x++)t.push(H,C[x]);else t.push(H,C)}n=t;if(!a){r=[];if(t.length)for(n=0;n<t.length;n+=2){if(this.db){d=this.index.get(t[n]);if(!d)continue;r.push(d=d.db.tag(t[n+1],b,l,q))}else d=Da.call(this,t[n],t[n+1],b,l,q);e.push({field:t[n],tag:t[n+1],result:d})}return r.length?Promise.all(r).then(function(y){for(let w=0;w<y.length;w++)e[w].result= else{if(n.length>c||d)n=n.slice(d,c+d),c-=n.length,d&&(d-=n.length);e.push(n);if(!c)break}h=1<e.length?[].concat.apply([],e):e[0]}}return h}
y[w];return e}):e}}F(k)&&(k=[k])}k||(k=this.field);t=!d&&(this.worker||this.db)&&[];let D;for(let y=0,w,A,H;y<k.length;y++){A=k[y];if(this.db&&this.tag&&!this.D[y])continue;let C;F(A)||(C=A,A=C.field,a=C.query||a,b=C.limit||b,l=C.offset||l,r=C.suggest||r,q=this.store&&(C.enrich||q));if(d)w=d[y];else if(u=C||c,x=this.index.get(A),n&&(this.db&&(u.tag=n,D=x.db.support_tag_search,u.field=k),D||(u.enrich=!1)),t){t[y]=x.search(a,b,u);u&&q&&(u.enrich=q);continue}else w=x.search(a,b,u),u&&q&&(u.enrich=q); function Ca(a,b,c,d,e){const f=[],g=C();let k;var h=a.length;let l,m=0;if(d)for(e=h-1;0<=e;e--)for(d=a[e],l=d.length,h=0;h<l;h++){if(k=d[h],!g[k])if(g[k]=1,b)b--;else if(f.push(k),f.length===c)return f}else{let q=ca(a);for(let n=0;n<q;n++)for(let p=h-1;0<=p;p--)if(l=(d=a[p][n])&&d.length)for(let r=0;r<l;r++)if(k=d[r],!g[k])if(g[k]=1,b)b--;else{let t=n+(p<h-1?e||0:0);(f[t]||(f[t]=[])).push(k);if(++m===c)return f}}return f}
H=w&&w.length;if(n&&H){u=[];x=0;if(this.db&&d){if(!D)for(let I=k.length;I<d.length;I++){let E=d[I];if(E&&E.length)x++,u.push(E);else if(!r)return e}}else for(let I=0,E,eb;I<n.length;I+=2){E=this.tag.get(n[I]);if(!E)if(r)continue;else return e;if(eb=(E=E&&E.get(n[I+1]))&&E.length)x++,u.push(E);else if(!r)return e}if(x){w=Ca(w,u);H=w.length;if(!H&&!r)return e;x--}}if(H)f[m]=A,e.push(w),m++;else if(1===k.length)return e}if(t){if(this.db&&n&&n.length&&!D)for(q=0;q<n.length;q+=2){d=this.index.get(n[q]); function Da(a,b){const c=C(),d=[];for(let e=0,f;e<b.length;e++){f=b[e];for(let g=0;g<f.length;g++)c[f[g]]=1}for(let e=0,f;e<a.length;e++)f=a[e],1===c[f]&&(d.push(f),c[f]=2);return d};T.prototype.search=function(a,b,c,d){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let e=[],f=[],g;let k;let h;let l,m=0,q;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;g=c.pluck;k=c.merge;h=g||c.field||c.index;var n=this.tag&&c.tag;var p=this.store&&c.enrich;var r=c.suggest;q=c.highlight;b=c.limit||b;l=c.offset||0;b||(b=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var t=[];for(let y=0,v;y<n.length;y++)if(v=n[y],v.field&&v.tag){var w=v.tag;if(w.constructor===Array)for(var x=0;x<
if(!d)if(r)continue;else return e;t.push(d.db.tag(n[q+1],b,l,!1))}const y=this;return Promise.all(t).then(function(w){return w.length?y.search(a,b,c,w):w})}if(!m)return e;if(g&&(!q||!this.store))return e[0];t=[];for(let y=0,w;y<f.length;y++){w=e[y];q&&w.length&&!w[0].doc&&(this.db?t.push(w=this.index.get(this.field[0]).db.enrich(w)):w.length&&(w=Ea.call(this,w)));if(g)return w;e[y]={field:f[y],result:w}}if(q&&this.db&&t.length){const y=this;return Promise.all(t).then(function(w){for(let A=0;A<w.length;A++)e[A].result= w.length;x++)t.push(v.field,w[x]);else t.push(v.field,w)}else{w=Object.keys(v);for(let A=0,H,D;A<w.length;A++)if(H=w[A],D=v[H],D.constructor===Array)for(x=0;x<D.length;x++)t.push(H,D[x]);else t.push(H,D)}n=t;if(!a){r=[];if(t.length)for(n=0;n<t.length;n+=2){if(this.db){d=this.index.get(t[n]);if(!d)continue;r.push(d=d.db.tag(t[n+1],b,l,p))}else d=Ea.call(this,t[n],t[n+1],b,l,p);e.push({field:t[n],tag:t[n+1],result:d})}return r.length?Promise.all(r).then(function(y){for(let v=0;v<y.length;v++)e[v].result=
w[A];return h?Fa(e,b):p?Ga(e,a,y.index,y.field,y.D,p):e})}return h?Fa(e,b):p?Ga(e,a,this.index,this.field,this.D,p):e}; y[v];return e}):e}}F(h)&&(h=[h])}h||(h=this.field);t=!d&&(this.worker||this.db)&&[];let B;for(let y=0,v,A,H;y<h.length;y++){A=h[y];if(this.db&&this.tag&&!this.D[y])continue;let D;F(A)||(D=A,A=D.field,a=D.query||a,b=D.limit||b,l=D.offset||l,r=D.suggest||r,p=this.store&&(D.enrich||p));if(d)v=d[y];else if(w=D||c,x=this.index.get(A),n&&(this.db&&(w.tag=n,B=x.db.support_tag_search,w.field=h),B||(w.enrich=!1)),t){t[y]=x.search(a,b,w);w&&p&&(w.enrich=p);continue}else v=x.search(a,b,w),w&&p&&(w.enrich=p);
function Ga(a,b,c,d,e,f){let g,h,k;for(let m=0,p,n,q,r,t;m<a.length;m++){p=a[m].result;n=a[m].field;r=c.get(n);q=r.encoder;k=r.tokenize;t=e[d.indexOf(n)];q!==g&&(g=q,h=g.encode(b));for(let u=0;u<p.length;u++){let x="";var l=J(p[u].doc,t);let D=g.encode(l);l=l.split(g.split);for(let y=0,w,A;y<D.length;y++){w=D[y];A=l[y];let H;for(let C=0,I;C<h.length;C++)if(I=h[C],"strict"===k){if(w===I){x+=(x?" ":"")+f.replace("$1",A);H=!0;break}}else{const E=w.indexOf(I);if(-1<E){x+=(x?" ":"")+A.substring(0,E)+f.replace("$1", H=v&&v.length;if(n&&H){w=[];x=0;if(this.db&&d){if(!B)for(let I=h.length;I<d.length;I++){let E=d[I];if(E&&E.length)x++,w.push(E);else if(!r)return e}}else for(let I=0,E,fb;I<n.length;I+=2){E=this.tag.get(n[I]);if(!E)if(r)continue;else return e;if(fb=(E=E&&E.get(n[I+1]))&&E.length)x++,w.push(E);else if(!r)return e}if(x){v=Da(v,w);H=v.length;if(!H&&!r)return e;x--}}if(H)f[m]=A,e.push(v),m++;else if(1===h.length)return e}if(t){if(this.db&&n&&n.length&&!B)for(p=0;p<n.length;p+=2){d=this.index.get(n[p]);
A.substring(E,I.length))+A.substring(E+I.length);H=!0;break}}H||(x+=(x?" ":"")+l[y])}p[u].highlight=x}}return a}function Fa(a,b){const c=[],d=B();for(let e=0,f,g;e<a.length;e++){f=a[e];g=f.result;for(let h=0,k,l,m;h<g.length;h++)if(l=g[h],k=l.id,m=d[k])m.push(f.field);else{if(c.length===b)return c;l.field=d[k]=[f.field];c.push(l)}}return c}function Da(a,b,c,d,e){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-d)&&0<b){if(b>c||d)a=a.slice(d,d+c);e&&(a=Ea.call(this,a));return a}} if(!d)if(r)continue;else return e;t.push(d.db.tag(n[p+1],b,l,!1))}const y=this;return Promise.all(t).then(function(v){return v.length?y.search(a,b,c,v):v})}if(!m)return e;if(g&&(!p||!this.store))return e[0];t=[];for(let y=0,v;y<f.length;y++){v=e[y];p&&v.length&&!v[0].doc&&(this.db?t.push(v=this.index.get(this.field[0]).db.enrich(v)):v.length&&(v=Fa.call(this,v)));if(g)return v;e[y]={field:f[y],result:v}}if(p&&this.db&&t.length){const y=this;return Promise.all(t).then(function(v){for(let A=0;A<v.length;A++)e[A].result=
function Ea(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function T(a){if(!this||this.constructor!==T)return new T(a);const b=a.document||a.doc||a;let c,d;this.D=[];this.field=[];this.K=[];this.key=(c=b.key||b.id)&&Ha(c,this.K)||"id";(d=a.keystore||0)&&(this.keystore=d);this.reg=(this.fastupdate=!!a.fastupdate)?d?new R(d):new Map:d?new S(d):new Set;this.C=(c=b.store||null)&&!0!==c&&[];this.store=c&&(d?new R(d):new Map);this.cache=(c=a.cache||null)&&new U(c);a.cache=!1;this.worker=a.worker;this.index=Ia.call(this,a,b);this.tag=null;if(c=b.tag)if("string"=== v[A];return k?Ga(e,b):q?Ha(e,a,y.index,y.field,y.D,q):e})}return k?Ga(e,b):q?Ha(e,a,this.index,this.field,this.D,q):e};
typeof c&&(c=[c]),c.length){this.tag=new Map;this.G=[];this.N=[];for(let e=0,f,g;e<c.length;e++){f=c[e];g=f.field||f;if(!g)throw Error("The tag field from the document descriptor is undefined.");f.custom?this.G[e]=f.custom:(this.G[e]=Ha(g,this.K),f.filter&&("string"===typeof this.G[e]&&(this.G[e]=new String(this.G[e])),this.G[e].I=f.filter));this.N[e]=g;this.tag.set(g,new Map)}}if(this.worker){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(f){let g= function Ha(a,b,c,d,e,f){let g,k,h;for(let m=0,q,n,p,r,t;m<a.length;m++){q=a[m].result;n=a[m].field;r=c.get(n);p=r.encoder;h=r.tokenize;t=e[d.indexOf(n)];p!==g&&(g=p,k=g.encode(b));for(let w=0;w<q.length;w++){let x="";var l=J(q[w].doc,t);let B=g.encode(l);l=l.split(g.split);for(let y=0,v,A;y<B.length;y++){v=B[y];A=l[y];let H;for(let D=0,I;D<k.length;D++)if(I=k[D],"strict"===h){if(v===I){x+=(x?" ":"")+f.replace("$1",A);H=!0;break}}else{const E=v.indexOf(I);if(-1<E){x+=(x?" ":"")+A.substring(0,E)+f.replace("$1",
0;for(const h of e.index.entries()){const k=h[0];h[1].then&&e.index.set(k,f[g++])}return e})}}else a.db&&this.mount(a.db)}v=T.prototype; A.substring(E,I.length))+A.substring(E+I.length);H=!0;break}}H||(x+=(x?" ":"")+l[y])}q[w].highlight=x}}return a}function Ga(a,b){const c=[],d=C();for(let e=0,f,g;e<a.length;e++){f=a[e];g=f.result;for(let k=0,h,l,m;k<g.length;k++)if(l=g[k],h=l.id,m=d[h])m.push(f.field);else{if(c.length===b)return c;l.field=d[h]=[f.field];c.push(l)}}return c}function Ea(a,b,c,d,e){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-d)&&0<b){if(b>c||d)a=a.slice(d,d+c);e&&(a=Fa.call(this,a));return a}}
v.mount=function(a){let b=this.field;if(this.tag)for(let e=0,f;e<this.N.length;e++){f=this.N[e];var c=void 0;this.index.set(f,c=new L({},this.reg));b===this.field&&(b=b.slice(0));b.push(f);c.tag=this.tag.get(f)}c=[];const d={db:a.db,type:a.type,fastupdate:a.fastupdate};for(let e=0,f,g;e<b.length;e++){d.field=g=b[e];f=this.index.get(g);const h=new a.constructor(a.id,d);h.id=a.id;c[e]=h.mount(f);f.document=!0;e?f.bypass=!0:f.store=this.store}this.db=!0;return Promise.all(c)}; function Fa(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function T(a){if(!this||this.constructor!==T)return new T(a);const b=a.document||a.doc||a;let c,d;this.D=[];this.field=[];this.K=[];this.key=(c=b.key||b.id)&&Ia(c,this.K)||"id";(d=a.keystore||0)&&(this.keystore=d);this.reg=(this.fastupdate=!!a.fastupdate)?d?new R(d):new Map:d?new S(d):new Set;this.C=(c=b.store||null)&&c&&!0!==c&&[];this.store=c&&(d?new R(d):new Map);this.cache=(c=a.cache||null)&&new U(c);a.cache=!1;this.worker=a.worker;this.index=Ja.call(this,a,b);this.tag=null;if(c=b.tag)if("string"===
v.commit=async function(a,b){const c=[];for(const d of this.index.values())c.push(d.db.commit(d,a,b));await Promise.all(c);this.reg.clear()};v.destroy=function(){const a=[];for(const b of this.index.values())a.push(b.destroy());return Promise.all(a)}; typeof c&&(c=[c]),c.length){this.tag=new Map;this.G=[];this.P=[];for(let e=0,f,g;e<c.length;e++){f=c[e];g=f.field||f;if(!g)throw Error("The tag field from the document descriptor is undefined.");f.custom?this.G[e]=f.custom:(this.G[e]=Ia(g,this.K),f.filter&&("string"===typeof this.G[e]&&(this.G[e]=new String(this.G[e])),this.G[e].J=f.filter));this.P[e]=g;this.tag.set(g,new Map)}}if(this.worker){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(f){let g=
function Ia(a,b){const c=new Map;let d=b.index||b.field||b;F(d)&&(d=[d]);for(let e=0,f,g;e<d.length;e++){f=d[e];F(f)||(g=f,f=f.field);g=G(g)?Object.assign({},a,g):a;if(this.worker){const h=new N(g);c.set(f,h)}this.worker||c.set(f,new L(g,this.reg));g.custom?this.D[e]=g.custom:(this.D[e]=Ha(f,this.K),g.filter&&("string"===typeof this.D[e]&&(this.D[e]=new String(this.D[e])),this.D[e].I=g.filter));this.field[e]=f}if(this.C){a=b.store;F(a)&&(a=[a]);for(let e=0,f,g;e<a.length;e++)f=a[e],g=f.field||f,f.custom? 0;for(const k of e.index.entries()){const h=k[0];k[1].then&&e.index.set(h,f[g++])}return e})}}else a.db&&this.mount(a.db)}u=T.prototype;
(this.C[e]=f.custom,f.custom.U=g):(this.C[e]=Ha(g,this.K),f.filter&&("string"===typeof this.C[e]&&(this.C[e]=new String(this.C[e])),this.C[e].I=f.filter))}return c}function Ha(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}v.append=function(a,b){return this.add(a,b,!0)};v.update=function(a,b){return this.remove(a).add(a,b)}; u.mount=function(a){let b=this.field;if(this.tag)for(let e=0,f;e<this.P.length;e++){f=this.P[e];var c=void 0;this.index.set(f,c=new M({},this.reg));b===this.field&&(b=b.slice(0));b.push(f);c.tag=this.tag.get(f)}c=[];const d={db:a.db,type:a.type,fastupdate:a.fastupdate};for(let e=0,f,g;e<b.length;e++){d.field=g=b[e];f=this.index.get(g);const k=new a.constructor(a.id,d);k.id=a.id;c[e]=k.mount(f);f.document=!0;e?f.bypass=!0:f.store=this.store}this.db=!0;return Promise.all(c)};
v.remove=function(a){G(a)&&(a=J(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let c of this.tag.values())for(let d of c){b=d[0];const e=d[1],f=e.indexOf(a);-1<f&&(1<e.length?e.splice(f,1):c.delete(b))}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; u.commit=async function(a,b){const c=[];for(const d of this.index.values())c.push(d.db.commit(d,a,b));await Promise.all(c);this.reg.clear()};u.destroy=function(){const a=[];for(const b of this.index.values())a.push(b.destroy());return Promise.all(a)};
v.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};v.contain=function(a){return this.db?this.index.get(this.field[0]).db.has(a):this.reg.has(a)};v.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};v.get=function(a){return this.db?this.index.get(this.field[0]).db.enrich(a).then(function(b){return b[0]&&b[0].doc}):this.store.get(a)}; function Ja(a,b){const c=new Map;let d=b.index||b.field||b;F(d)&&(d=[d]);for(let e=0,f,g;e<d.length;e++){f=d[e];F(f)||(g=f,f=f.field);g=G(g)?Object.assign({},a,g):a;if(this.worker){const k=new N(g);c.set(f,k)}this.worker||c.set(f,new M(g,this.reg));g.custom?this.D[e]=g.custom:(this.D[e]=Ia(f,this.K),g.filter&&("string"===typeof this.D[e]&&(this.D[e]=new String(this.D[e])),this.D[e].J=g.filter));this.field[e]=f}if(this.C){a=b.store;F(a)&&(a=[a]);for(let e=0,f,g;e<a.length;e++)f=a[e],g=f.field||f,f.custom?
v.set=function(a,b){this.store.set(a,b);return this};v.searchCache=Ja; (this.C[e]=f.custom,f.custom.U=g):(this.C[e]=Ia(g,this.K),f.filter&&("string"===typeof this.C[e]&&(this.C[e]=new String(this.C[e])),this.C[e].J=f.filter))}return c}function Ia(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}u.append=function(a,b){return this.add(a,b,!0)};u.update=function(a,b){return this.remove(a).add(a,b)};
v.export=function(a,b,c=0,d=0){if(c<this.field.length){const g=this.field[c];if((b=this.index.get(g).export(a,g,c,d=1))&&b.then){const h=this;return b.then(function(){return h.export(a,g,c+1)})}return this.export(a,g,c+1)}let e,f;switch(d){case 0:e="reg";f=sa(this.reg);b=null;break;case 1:e="tag";f=qa(this.tag,this.reg.size);b=null;break;case 2:e="doc";f=oa(this.store);b=null;break;case 3:e="cfg";f={};b=null;break;default:return}return ua.call(this,a,b,e,f,c,d)}; u.remove=function(a){G(a)&&(a=J(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let c of this.tag.values())for(let d of c){b=d[0];const e=d[1],f=e.indexOf(a);-1<f&&(1<e.length?e.splice(f,1):c.delete(b))}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
v.import=function(a,b){if(b){F(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=ta(b,this.reg);for(let d=0,e;d<this.field.length;d++)e=this.index.get(this.field[d]),e.fastupdate=!1,e.reg=this.reg;break;case "tag":this.tag=ra(b,this.tag);break;case "doc":this.store=pa(b,this.store)}}};na(T.prototype);function Ja(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();let d=this.cache.get(a);if(!d){d=this.search(a,b,c);if(d.then){const e=this;d.then(function(f){e.cache.set(a,f);return f})}this.cache.set(a,d)}return d}function U(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}U.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)}; u.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};u.contain=function(a){return this.db?this.index.get(this.field[0]).db.has(a):this.reg.has(a)};u.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};u.get=function(a){return this.db?this.index.get(this.field[0]).db.enrich(a).then(function(b){return b[0]&&b[0].doc}):this.store.get(a)};
U.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};U.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};U.prototype.clear=function(){this.cache.clear();this.h=""};const Ka={normalize:function(a){return a.toLowerCase()},dedupe:!1};const La=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Ma=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Na=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Oa={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Pa=/[\x00-\x7F]+/g;const Qa=/[\x00-\x7F]+/g;const Ra=/[\x00-\x7F]+/g;var Sa={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:Ka,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:La},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:La,matcher:Ma,replacer:Na},LatinExtra:{normalize:!0,dedupe:!0,mapper:La,replacer:Na.concat([/(?!^)[aeo]/g,""]),matcher:Ma},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let d=b.charAt(0),e=Oa[d];for(let f=1,g;f<b.length&&(g=b.charAt(f),"h"=== u.set=function(a,b){this.store.set(a,b);return this};u.searchCache=Ka;
g||"w"===g||!(g=Oa[g])||g===e||(d+=g,e=g,4!==d.length));f++);a[c]=d}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Pa," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(Qa,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ra," ")}}};const Ta={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};B();L.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(d=b.length){const l=B(),m=B(),p=this.depth,n=this.resolution;for(let q=0;q<d;q++){let r=b[this.rtl?d-1-q:q];var e=r.length;if(e&&(p||!m[r])){var f=this.score?this.score(b,r,q,null,0):Ua(n,d,q),g="";switch(this.tokenize){case "full":if(2<e){for(f=0;f<e;f++)for(var h=e;h>f;h--){g=r.substring(f,h);var k=this.score?this.score(b,r,q,g,f):Ua(n,d,q,e,f);V(this,m,g,k,a,c)}break}case "reverse":if(1< u.export=function(a,b,c=0,d=0){if(c<this.field.length){const g=this.field[c];if((b=this.index.get(g).export(a,g,c,d=1))&&b.then){const k=this;return b.then(function(){return k.export(a,g,c+1)})}return this.export(a,g,c+1)}let e,f;switch(d){case 0:e="reg";f=ta(this.reg);b=null;break;case 1:e="tag";f=ra(this.tag,this.reg.size);b=null;break;case 2:e="doc";f=pa(this.store);b=null;break;case 3:e="cfg";f={};b=null;break;default:return}return va.call(this,a,b,e,f,c,d)};
e){for(h=e-1;0<h;h--)g=r[h]+g,k=this.score?this.score(b,r,q,g,h):Ua(n,d,q,e,h),V(this,m,g,k,a,c);g=""}case "forward":if(1<e){for(h=0;h<e;h++)g+=r[h],V(this,m,g,f,a,c);break}default:if(V(this,m,r,f,a,c),p&&1<d&&q<d-1)for(e=B(),g=this.R,f=r,h=Math.min(p+1,d-q),e[f]=1,k=1;k<h;k++)if((r=b[this.rtl?d-1-q-k:q+k])&&!e[r]){e[r]=1;const t=this.score?this.score(b,f,q,r,k):Ua(g+(d/2>g?0:1),d,q,h-1,k-1),u=this.bidirectional&&r>f;V(this,l,u?f:r,t,a,c,u?r:f)}}}}this.fastupdate||this.reg.add(a)}else b=""}this.db&& u.import=function(a,b){if(b){F(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=ua(b,this.reg);for(let d=0,e;d<this.field.length;d++)e=this.index.get(this.field[d]),e.fastupdate=!1,e.reg=this.reg;break;case "tag":this.tag=sa(b,this.tag);break;case "doc":this.store=qa(b,this.store)}}};oa(T.prototype);function Ka(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();let d=this.cache.get(a);if(!d){d=this.search(a,b,c);if(d.then){const e=this;d.then(function(f){e.cache.set(a,f);return f})}this.cache.set(a,d)}return d}function U(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}U.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};
(b||this.commit_task.push({del:a}),this.T&&Va(this));return this};function V(a,b,c,d,e,f,g){let h=g?a.ctx:a.map,k;if(!b[c]||g&&!(k=b[c])[g])if(g?(b=k||(b[c]=B()),b[g]=1,(k=h.get(g))?h=k:h.set(g,h=new Map)):b[c]=1,(k=h.get(c))?h=k:h.set(c,h=k=[]),h=h[d]||(h[d]=[]),!f||!h.includes(e)){if(h.length===2**31-1){b=new Q(h);if(a.fastupdate)for(let l of a.reg.values())l.includes(h)&&(l[l.indexOf(h)]=b);k[d]=h=b}h.push(e);a.fastupdate&&((d=a.reg.get(e))?d.push(h):a.reg.set(e,[h]))}} U.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};U.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};U.prototype.clear=function(){this.cache.clear();this.h=""};const La={normalize:function(a){return a.toLowerCase()},dedupe:!1};const Ma=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Na=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Oa=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Pa={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Qa=/[\x00-\x7F]+/g;const Ra=/[\x00-\x7F]+/g;const Sa=/[\x00-\x7F]+/g;var Ta={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:La,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:Ma},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:Ma,matcher:Na,replacer:Oa},LatinExtra:{normalize:!0,dedupe:!0,mapper:Ma,replacer:Oa.concat([/(?!^)[aeo]/g,""]),matcher:Na},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let d=b.charAt(0),e=Pa[d];for(let f=1,g;f<b.length&&(g=b.charAt(f),"h"===
function Ua(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function W(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Wa(a):a;let e=[];for(let f=0,g,h;f<a.length;f++)if((g=a[f])&&(h=g.length)){if(c){if(c>=h){c-=h;continue}c<h&&(g=b?g.slice(c,c+b):g.slice(c),h=g.length,c=0)}if(e.length)h>b&&(g=g.slice(0,b),h=g.length),e.push(g);else{if(h>=b)return h>b&&(g=g.slice(0,b)),d?Wa(g):g;e=[g]}b-=h;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Wa(e):e} g||"w"===g||!(g=Pa[g])||g===e||(d+=g,e=g,4!==d.length));f++);a[c]=d}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Qa," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(Ra,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Sa," ")}}};const Ua={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};C();M.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(d=b.length){const l=C(),m=C(),q=this.depth,n=this.resolution;for(let p=0;p<d;p++){let r=b[this.rtl?d-1-p:p];var e=r.length;if(e&&(q||!m[r])){var f=this.score?this.score(b,r,p,null,0):Va(n,d,p),g="";switch(this.tokenize){case "full":if(2<e){for(f=0;f<e;f++)for(var k=e;k>f;k--){g=r.substring(f,k);var h=this.score?this.score(b,r,p,g,f):Va(n,d,p,e,f);V(this,m,g,h,a,c)}break}case "reverse":if(1<
function Wa(a){for(let b=0;b<a.length;b++)a[b]={score:b,id:a[b]};return a};X.prototype.or=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.limit||0;f=l.offset||0;g=l.enrich;h=l.resolve;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.not)m= e){for(k=e-1;0<k;k--)g=r[k]+g,h=this.score?this.score(b,r,p,g,k):Va(n,d,p,e,k),V(this,m,g,h,a,c);g=""}case "forward":if(1<e){for(k=0;k<e;k++)g+=r[k],V(this,m,g,f,a,c);break}default:if(V(this,m,r,f,a,c),q&&1<d&&p<d-1)for(e=C(),g=this.R,f=r,k=Math.min(q+1,d-p),e[f]=1,h=1;h<k;h++)if((r=b[this.rtl?d-1-p-h:p+h])&&!e[r]){e[r]=1;const t=this.score?this.score(b,f,p,r,h):Va(g+(d/2>g?0:1),d,p,k-1,h-1),w=this.bidirectional&&r>f;V(this,l,w?f:r,t,a,c,w?r:f)}}}}this.fastupdate||this.reg.add(a)}else b=""}this.db&&
this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Xa(d,e,f,g,h,a.F);return h?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Xa(d,e,f,g,h,this.F));return h?this.result:this};function Xa(a,b,c,d,e,f){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.enrich||!1,b=b.limit||0);return 2>a.length?e?W(a[0],b,c,d):a[0]:Ba(a,c,b,e,f)};X.prototype.and=function(){if(this.result.length){const b=this;let c=arguments;var a=c[0];if(a.then)return a.then(function(){return b.and.apply(b,c)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,f=0,g,h;for(let k=0,l;k<c.length;k++)if(l=c[k]){e=l.limit||0;f=l.offset||0;g=l.resolve;h=l.suggest;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor); (b||this.commit_task.push({del:a}),this.T&&Wa(this));return this};function V(a,b,c,d,e,f,g){let k=g?a.ctx:a.map,h;if(!b[c]||g&&!(h=b[c])[g])if(g?(b=h||(b[c]=C()),b[g]=1,(h=k.get(g))?k=h:k.set(g,k=new Map)):b[c]=1,(h=k.get(c))?k=h:k.set(c,k=h=[]),k=k[d]||(k[d]=[]),!f||!k.includes(e)){if(k.length===2**31-1){b=new Q(k);if(a.fastupdate)for(let l of a.reg.values())l.includes(k)&&(l[l.indexOf(k)]=b);h[d]=k=b}k.push(e);a.fastupdate&&((d=a.reg.get(e))?d.push(k):a.reg.set(e,[k]))}}
else if(l.not)m=this.not(l.not);else continue;d[k]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,g?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[b.result].concat(d);b.result=Ya(d,e,f,g,b.F,h);return g?b.result:b});d=[this.result].concat(d);this.result=Ya(d,e,f,g,this.F,h);return g?this.result:this}return this};function Ya(a,b,c,d,e,f){if(2>a.length)return[];let g=[];B();let h=ca(a);return h?Aa(a,h,b,c,f,e,d):g};X.prototype.xor=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.limit||0;f=l.offset||0;g=l.enrich;h=l.resolve;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.not)m= function Va(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function W(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Xa(a):a;let e=[];for(let f=0,g,k;f<a.length;f++)if((g=a[f])&&(k=g.length)){if(c){if(c>=k){c-=k;continue}c<k&&(g=b?g.slice(c,c+b):g.slice(c),k=g.length,c=0)}if(e.length)k>b&&(g=g.slice(0,b),k=g.length),e.push(g);else{if(k>=b)return k>b&&(g=g.slice(0,b)),d?Xa(g):g;e=[g]}b-=k;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Xa(e):e}
this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Za(d,e,f,g,!h,a.F);return h?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Za(d,e,f,g,!h,a.F));return h?this.result:this}; function Xa(a){for(let b=0;b<a.length;b++)a[b]={score:b,id:a[b]};return a};X.prototype.or=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);let d=[];c=[];let e=0,f=0,g,k;for(let h=0,l;h<b.length;h++)if(l=b[h]){e=l.limit||0;f=l.offset||0;g=l.enrich;k=l.resolve;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.not)m=
function Za(a,b,c,d,e,f){if(!a.length)return a;if(2>a.length)return e?W(a[0],b,c,d):a[0];d=[];const g=B();let h=0;for(let k=0,l;k<a.length;k++)if(l=a[k])for(let m=0,p;m<l.length;m++)if(p=l[m]){h<p.length&&(h=p.length);for(let n=0,q;n<p.length;n++)q=p[n],g[q]?g[q]++:g[q]=1}for(let k=0,l,m=0;k<h;k++)for(let p=0,n;p<a.length;p++)if(n=a[p])if(l=n[k])for(let q=0,r;q<l.length;q++)if(r=l[q],1===g[r])if(c)c--;else if(e){if(d.push(r),d.length===b)return d}else{const t=k+(p?f:0);d[t]||(d[t]=[]);d[t].push(r); this.not(l.not);else continue;d[h]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Ya(d,e,f,g,k,a.F);return k?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Ya(d,e,f,g,k,this.F));return k?this.result:this};function Ya(a,b,c,d,e,f){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.enrich||!1,b=b.limit||0);return 2>a.length?e?W(a[0],b,c,d):a[0]:Ca(a,c,b,e,f)};X.prototype.and=function(){if(this.result.length){const b=this;let c=arguments;var a=c[0];if(a.then)return a.then(function(){return b.and.apply(b,c)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,f=0,g,k;for(let h=0,l;h<c.length;h++)if(l=c[h]){e=l.limit||0;f=l.offset||0;g=l.resolve;k=l.suggest;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor);
if(++m===b)return d}return d};X.prototype.not=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.not.apply(a,b)});if(c[0]&&c[0].index)return this.not.apply(this,c);let d=[];c=[];let e=0,f=0,g;for(let h=0,k;h<b.length;h++)if(k=b[h]){e=k.limit||0;f=k.offset||0;g=k.resolve;let l;if(k.constructor===X)l=k.result;else if(k.constructor===Array)l=k;else if(k.index)k.resolve=!1,l=k.index.search(k).result;else if(k.or)l=this.or(k.or);else if(k.and)l=this.and(k.and);else if(k.xor)l=this.xor(k.xor); else if(l.not)m=this.not(l.not);else continue;d[h]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,g?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[b.result].concat(d);b.result=Za(d,e,f,g,b.F,k);return g?b.result:b});d=[this.result].concat(d);this.result=Za(d,e,f,g,this.F,k);return g?this.result:this}return this};function Za(a,b,c,d,e,f){if(2>a.length)return[];let g=[];C();let k=ca(a);return k?Ba(a,k,b,c,f,e,d):g};X.prototype.xor=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);let d=[];c=[];let e=0,f=0,g,k;for(let h=0,l;h<b.length;h++)if(l=b[h]){e=l.limit||0;f=l.offset||0;g=l.enrich;k=l.resolve;let m;if(l.constructor===X)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.not)m=
else continue;d[h]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=$a.call(a,d,e,f,g);return g?a.result:a});d.length&&(this.result=$a.call(this,d,e,f,g));return g?this.result:this}; this.not(l.not);else continue;d[h]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=$a(d,e,f,g,!k,a.F);return k?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=$a(d,e,f,g,!k,a.F));return k?this.result:this};
function $a(a,b,c,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let f=0,g,h=0;f<this.result.length;f++)if(g=this.result[f])for(let k=0,l;k<g.length;k++)if(l=g[k],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[f]||(e[f]=[]),e[f].push(l),++h===b)return e;return e};function X(a){if(!this||this.constructor!==X)return new X(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.F=a.boost||0,this.result=a.index.search(a).result,this;if(a.constructor===X)return a;this.index=null;this.result=a||[];this.F=0}X.prototype.limit=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}}return this}; function $a(a,b,c,d,e,f){if(!a.length)return a;if(2>a.length)return e?W(a[0],b,c,d):a[0];d=[];const g=C();let k=0;for(let h=0,l;h<a.length;h++)if(l=a[h])for(let m=0,q;m<l.length;m++)if(q=l[m]){k<q.length&&(k=q.length);for(let n=0,p;n<q.length;n++)p=q[n],g[p]?g[p]++:g[p]=1}for(let h=0,l,m=0;h<k;h++)for(let q=0,n;q<a.length;q++)if(n=a[q])if(l=n[h])for(let p=0,r;p<l.length;p++)if(r=l[p],1===g[r])if(c)c--;else if(e){if(d.push(r),d.length===b)return d}else{const t=h+(q?f:0);d[t]||(d[t]=[]);d[t].push(r);
X.prototype.offset=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};X.prototype.boost=function(a){this.F+=a;return this};X.prototype.resolve=function(a,b,c){ab=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.enrich,b=a.offset,a=a.limit),W(d,a||100,b,c)):d};let ab=1; if(++m===b)return d}return d};X.prototype.not=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.not.apply(a,b)});if(c[0]&&c[0].index)return this.not.apply(this,c);let d=[];c=[];let e=0,f=0,g;for(let k=0,h;k<b.length;k++)if(h=b[k]){e=h.limit||0;f=h.offset||0;g=h.resolve;let l;if(h.constructor===X)l=h.result;else if(h.constructor===Array)l=h;else if(h.index)h.resolve=!1,l=h.index.search(h).result;else if(h.or)l=this.or(h.or);else if(h.and)l=this.and(h.and);else if(h.xor)l=this.xor(h.xor);
L.prototype.search=function(a,b,c){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let d=[],e;let f,g=0,h,k,l,m;if(c){a=c.query||a;b=c.limit||b;g=c.offset||0;var p=c.context;f=c.suggest;(h=ab&&!1!==c.resolve)||(ab=0);k=h&&c.enrich;m=c.boost;l=this.db&&c.tag}else h=this.resolve||ab;a=this.encoder.encode(a);e=a.length;b||!h||(b=100);if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);p=this.depth&&!1!==p;if(2===e&&p&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);let n=c=0;if(1<e){const t=B(),u=[];for(let x=0,D;x< else continue;d[k]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=ab.call(a,d,e,f,g);return g?a.result:a});d.length&&(this.result=ab.call(this,d,e,f,g));return g?this.result:this};
e;x++)if((D=a[x])&&!t[D]){if(f||this.db||Y(this,D))u.push(D),t[D]=1;else return h?d:new X(d);const y=D.length;c=Math.max(c,y);n=n?Math.min(n,y):y}a=u;e=a.length}if(!e)return h?d:new X(d);let q=0,r;if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);if(2===e&&p&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);1<e&&(p?(r=a[0],q=1):9<c&&3<c/n&&a.sort(aa));if(this.db){if(this.db.search&&(p=this.db.search(this,a,b,g,f,h,k,l),!1!==p))return p;const t=this;return async function(){for(let u,x;q<e;q++){x=a[q];r?(u= function ab(a,b,c,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let f=0,g,k=0;f<this.result.length;f++)if(g=this.result[f])for(let h=0,l;h<g.length;h++)if(l=g[h],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[f]||(e[f]=[]),e[f].push(l),++k===b)return e;return e};function X(a){if(!this||this.constructor!==X)return new X(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.F=a.boost||0,this.result=a.index.search(a).result,this;if(a.constructor===X)return a;this.index=null;this.result=a||[];this.F=0}X.prototype.limit=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}}return this};
await Y(t,x,r,0,0,!1,!1),u=cb(u,d,f,t.R),f&&!1===u&&d.length||(r=x)):(u=await Y(t,x,"",0,0,!1,!1),u=cb(u,d,f,t.resolution));if(u)return u;if(f&&q===e-1){let D=d.length;if(!D){if(r){r="";q=-1;continue}return d}if(1===D)return h?W(d[0],b,g):new X(d[0])}}return h?Aa(d,t.resolution,b,g,f,m,h):new X(d[0])}()}for(let t,u;q<e;q++){u=a[q];r?(t=Y(this,u,r,0,0,!1,!1),t=cb(t,d,f,this.R),f&&!1===t&&d.length||(r=u)):(t=Y(this,u,"",0,0,!1,!1),t=cb(t,d,f,this.resolution));if(t)return t;if(f&&q===e-1){p=d.length; X.prototype.offset=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};X.prototype.boost=function(a){this.F+=a;return this};X.prototype.resolve=function(a,b,c){bb=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.enrich,b=a.offset,a=a.limit),W(d,a||100,b,c)):d};let bb=1;
if(!p){if(r){r="";q=-1;continue}return d}if(1===p)return h?W(d[0],b,g):new X(d[0])}}d=Aa(d,this.resolution,b,g,f,m,h);return h?d:new X(d)};function bb(a,b,c,d,e,f,g){a=Y(this,a,b,c,d,e,f,g);return this.db?a.then(function(h){return e?h:h&&h.length?e?W(h,c,d):new X(h):e?[]:new X([])}):a&&a.length?e?W(a,c,d):new X(a):e?[]:new X([])}function cb(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let f=0,g;f<d;f++)(g=a[f])&&g&&(e[f]=g);if(e.length){b.push(e);return}}return!c&&e} M.prototype.search=function(a,b,c){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let d=[],e,f,g,k=0,h,l,m,q,n;c?(a=c.query||a,b=c.limit||b,k=c.offset||0,f=c.context,g=c.suggest,(h=bb&&!1!==c.resolve)||(bb=0),l=h&&c.enrich,q=c.boost,n=c.resolution,m=this.db&&c.tag):h=this.resolve||bb;let p=this.encoder.encode(a);e=p.length;b||!h||(b=100);if(1===e)return cb.call(this,p[0],"",b,k,h,l,m);f=this.depth&&!1!==f;if(2===e&&f&&!g)return cb.call(this,p[0],p[1],b,k,h,l,m);let r=c=0;if(1<e){const x=C(),B=[];for(let y=
function Y(a,b,c,d,e,f,g,h){let k;c&&(k=a.bidirectional&&b>c);if(a.db)return c?a.db.get(k?c:b,k?b:c,d,e,f,g,h):a.db.get(b,"",d,e,f,g,h);a=c?(a=a.ctx.get(k?b:c))&&a.get(k?c:b):a.map.get(b);return a};L.prototype.remove=function(a,b){const c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(let d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{const f=e.indexOf(a);f===c.length-1?e.pop():e.splice(f,1)}}else db(this.map,a),this.depth&&db(this.ctx,a);b||this.reg.delete(a)}this.db&&(this.commit_task.push({del:a}),this.T&&Va(this));this.cache&&this.cache.remove(a);return this}; 0,v;y<e;y++)if((v=p[y])&&!x[v]){if(g||this.db||Y(this,v))B.push(v),x[v]=1;else return h?d:new X(d);const A=v.length;c=Math.max(c,A);r=r?Math.min(r,A):A}p=B;e=a.length}if(!e)return h?d:new X(d);let t=0,w;if(1===e)return cb.call(this,p[0],"",b,k,h,l,m);if(2===e&&f&&!g)return cb.call(this,p[0],p[1],b,k,h,l,m);1<e&&(f?(w=p[0],t=1):9<c&&3<c/r&&p.sort(aa));n||0===n||(n=this.resolution);if(this.db){if(this.db.search&&(a=this.db.search(this,p,b,k,g,h,l,m),!1!==a))return a;const x=this;return async function(){for(let B,
function db(a,b){let c=0;if(a.constructor===Array)for(let d=0,e,f;d<a.length;d++){if((e=a[d])&&e.length)if(f=e.indexOf(b),0<=f){1<e.length?(e.splice(f,1),c++):delete a[d];break}else c++}else for(let d of a){const e=d[0],f=db(d[1],b);f?c+=f:a.delete(e)}return c};function L(a,b){if(!this||this.constructor!==L)return new L(a);if(a){var c=F(a)?a:a.preset;c&&(a=Object.assign({},Ta[c],a))}else a={};c=a.context||{};const d=F(a.encoder)?Sa[a.encoder]:a.encode||a.encoder||Ka;this.encoder=d.encode?d:"object"===typeof d?new K(d):{encode:d};let e;this.resolution=a.resolution||9;this.tokenize=e=a.tokenize||"strict";this.depth="strict"===e&&c.depth||0;this.bidirectional=!1!==c.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;(e=a.keystore||0)&&(this.keystore= y;t<e;t++){y=p[t];w?(B=await Y(x,y,w,0,0,!1,!1),B=db(B,d,g,x.R),g&&!1===B&&d.length||(w=y)):(B=await Y(x,y,"",0,0,!1,!1),B=db(B,d,g,n));if(B)return B;if(g&&t===e-1){let v=d.length;if(!v){if(w){w="";t=-1;continue}return d}if(1===v)return h?W(d[0],b,k):new X(d[0])}}return h?Ba(d,n,b,k,g,q,h):new X(d[0])}()}for(let x,B;t<e;t++){B=p[t];w?(x=Y(this,B,w,0,0,!1,!1),x=db(x,d,g,this.R),g&&!1===x&&d.length||(w=B)):(x=Y(this,B,"",0,0,!1,!1),x=db(x,d,g,n));if(x)return x;if(g&&t===e-1){a=d.length;if(!a){if(w){w=
e);this.map=e?new R(e):new Map;this.ctx=e?new R(e):new Map;this.reg=b||(this.fastupdate?e?new R(e):new Map:e?new S(e):new Set);this.R=c.resolution||1;this.rtl=d.rtl||a.rtl||!1;this.cache=(e=a.cache||null)&&new U(e);this.resolve=!1!==a.resolve;if(e=a.db)this.db=this.mount(e);this.T=!1!==a.commit;this.commit_task=[];this.commit_timer=null}v=L.prototype;v.mount=function(a){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return a.mount(this)}; "";t=-1;continue}return d}if(1===a)return h?W(d[0],b,k):new X(d[0])}}d=Ba(d,n,b,k,g,q,h);return h?d:new X(d)};function cb(a,b,c,d,e,f,g){a=Y(this,a,b,c,d,e,f,g);return this.db?a.then(function(k){return e?k:k&&k.length?e?W(k,c,d):new X(k):e?[]:new X([])}):a&&a.length?e?W(a,c,d):new X(a):e?[]:new X([])}function db(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let f=0,g;f<d;f++)(g=a[f])&&g&&(e[f]=g);if(e.length){b.push(e);return}}return!c&&e}
v.commit=function(a,b){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.commit(this,a,b)};v.destroy=function(){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.destroy()};function Va(a){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null;a.db.commit(a,void 0,void 0)},0))} function Y(a,b,c,d,e,f,g,k){let h;c&&(h=a.bidirectional&&b>c);if(a.db)return c?a.db.get(h?c:b,h?b:c,d,e,f,g,k):a.db.get(b,"",d,e,f,g,k);a=c?(a=a.ctx.get(h?b:c))&&a.get(h?c:b):a.map.get(b);return a};M.prototype.remove=function(a,b){const c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(let d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{const f=e.indexOf(a);f===c.length-1?e.pop():e.splice(f,1)}}else eb(this.map,a),this.depth&&eb(this.ctx,a);b||this.reg.delete(a)}this.db&&(this.commit_task.push({del:a}),this.T&&Wa(this));this.cache&&this.cache.remove(a);return this};
v.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]);return this};v.append=function(a,b){return this.add(a,b,!0)};v.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)};v.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)}; function eb(a,b){let c=0;if(a.constructor===Array)for(let d=0,e,f;d<a.length;d++){if((e=a[d])&&e.length)if(f=e.indexOf(b),0<=f){1<e.length?(e.splice(f,1),c++):delete a[d];break}else c++}else for(let d of a){const e=d[0],f=eb(d[1],b);f?c+=f:a.delete(e)}return c};function M(a,b){if(!this||this.constructor!==M)return new M(a);if(a){var c=F(a)?a:a.preset;c&&(a=Object.assign({},Ua[c],a))}else a={};c=a.context;const d=!0===c?{depth:1}:c||{},e=F(a.encoder)?Ta[a.encoder]:a.encode||a.encoder||La;this.encoder=e.encode?e:"object"===typeof e?new K(e):{encode:e};this.resolution=a.resolution||9;this.tokenize=c=a.tokenize||"strict";this.depth="strict"===c&&d.depth||0;this.bidirectional=!1!==d.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;(c=a.keystore||
function fb(a){let b=0;if(a.constructor===Array)for(let c=0,d;c<a.length;c++)(d=a[c])&&(b+=d.length);else for(const c of a){const d=c[0],e=fb(c[1]);e?b+=e:a.delete(d)}return b}v.cleanup=function(){if(!this.fastupdate)return this;fb(this.map);this.depth&&fb(this.ctx);return this};v.searchCache=Ja; 0)&&(this.keystore=c);this.map=c?new R(c):new Map;this.ctx=c?new R(c):new Map;this.reg=b||(this.fastupdate?c?new R(c):new Map:c?new S(c):new Set);this.R=d.resolution||3;this.rtl=e.rtl||a.rtl||!1;this.cache=(c=a.cache||null)&&new U(c);this.resolve=!1!==a.resolve;if(c=a.db)this.db=this.mount(c);this.T=!1!==a.commit;this.commit_task=[];this.commit_timer=null}u=M.prototype;u.mount=function(a){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return a.mount(this)};
v.export=function(a,b,c,d=0){let e,f;switch(d){case 0:e="reg";f=sa(this.reg);break;case 1:e="cfg";f={};break;case 2:e="map";f=oa(this.map,this.reg.size);break;case 3:e="ctx";f=qa(this.ctx,this.reg.size);break;default:return}return ua.call(this,a,b,e,f,c,d)}; u.commit=function(a,b){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.commit(this,a,b)};u.destroy=function(){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.destroy()};function Wa(a){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null;a.db.commit(a,void 0,void 0)},0))}
v.import=function(a,b){if(b)switch(F(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=ta(b,this.reg);break;case "map":this.map=pa(b,this.map);break;case "ctx":this.ctx=ra(b,this.ctx)}}; u.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]);return this};u.append=function(a,b){return this.add(a,b,!0)};u.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)};u.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)};
v.serialize=function(a=!0){if(!this.reg.size)return"";let b="",c="";for(var d of this.reg.keys())c||(c=typeof d),b+=(b?",":"")+("string"===c?'"'+d+'"':d);b="index.reg=new Set(["+b+"]);";d="";for(var e of this.map.entries()){var f=e[0],g=e[1],h="";for(let m=0,p;m<g.length;m++){p=g[m]||[""];var k="";for(var l=0;l<p.length;l++)k+=(k?",":"")+("string"===c?'"'+p[l]+'"':p[l]);k="["+k+"]";h+=(h?",":"")+k}h='["'+f+'",['+h+"]]";d+=(d?",":"")+h}d="index.map=new Map(["+d+"]);";e="";for(const m of this.ctx.entries()){f= function gb(a){let b=0;if(a.constructor===Array)for(let c=0,d;c<a.length;c++)(d=a[c])&&(b+=d.length);else for(const c of a){const d=c[0],e=gb(c[1]);e?b+=e:a.delete(d)}return b}u.cleanup=function(){if(!this.fastupdate)return this;gb(this.map);this.depth&&gb(this.ctx);return this};u.searchCache=Ka;
m[0];g=m[1];for(const p of g.entries()){g=p[0];h=p[1];k="";for(let n=0,q;n<h.length;n++){q=h[n]||[""];l="";for(let r=0;r<q.length;r++)l+=(l?",":"")+("string"===c?'"'+q[r]+'"':q[r]);l="["+l+"]";k+=(k?",":"")+l}k='new Map([["'+g+'",['+k+"]]])";k='["'+f+'",'+k+"]";e+=(e?",":"")+k}}e="index.ctx=new Map(["+e+"]);";return a?"function inject(index){"+b+d+e+"}":b+d+e};na(L.prototype);const gb="undefined"!==typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),hb=["map","ctx","tag","reg","cfg"]; u.export=function(a,b,c,d=0){let e,f;switch(d){case 0:e="reg";f=ta(this.reg);break;case 1:e="cfg";f={};break;case 2:e="map";f=pa(this.map,this.reg.size);break;case 3:e="ctx";f=ra(this.ctx,this.reg.size);break;default:return}return va.call(this,a,b,e,f,c,d)};
function ib(a,b={}){if(!this)return new ib(a,b);"object"===typeof a&&(b=a=a.name);a||console.info("Default storage space was used, because a name was not passed.");this.id="flexsearch"+(a?":"+a.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"");this.field=b.field?b.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"";this.support_tag_search=!1;this.db=null;this.h={}}v=ib.prototype;v.mount=function(a){if(!a.encoder)return a.mount(this);a.db=this;return this.open()}; u.import=function(a,b){if(b)switch(F(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=ua(b,this.reg);break;case "map":this.map=qa(b,this.map);break;case "ctx":this.ctx=sa(b,this.ctx)}};
v.open=function(){let a=this;navigator.storage&&navigator.storage.persist();return this.db||new Promise(function(b,c){const d=gb.open(a.id+(a.field?":"+a.field:""),1);d.onupgradeneeded=function(){const e=a.db=this.result;hb.forEach(f=>{e.objectStoreNames.contains(f)||e.createObjectStore(f)})};d.onblocked=function(e){console.error("blocked",e);c()};d.onerror=function(e){console.error(this.error,e);c()};d.onsuccess=function(){a.db=this.result;a.db.onversionchange=function(){a.close()};b(a)}})}; u.serialize=function(a=!0){if(!this.reg.size)return"";let b="",c="";for(var d of this.reg.keys())c||(c=typeof d),b+=(b?",":"")+("string"===c?'"'+d+'"':d);b="index.reg=new Set(["+b+"]);";d="";for(var e of this.map.entries()){var f=e[0],g=e[1],k="";for(let m=0,q;m<g.length;m++){q=g[m]||[""];var h="";for(var l=0;l<q.length;l++)h+=(h?",":"")+("string"===c?'"'+q[l]+'"':q[l]);h="["+h+"]";k+=(k?",":"")+h}k='["'+f+'",['+k+"]]";d+=(d?",":"")+k}d="index.map=new Map(["+d+"]);";e="";for(const m of this.ctx.entries()){f=
v.close=function(){this.db.close();this.db=null};v.destroy=function(){return gb.deleteDatabase(this.id+(this.field?":"+this.field:""))};v.clear=function(){const a=this.db.transaction(hb,"readwrite");for(let b=0;b<hb.length;b++)a.objectStore(hb[b]).clear();return Z(a)}; m[0];g=m[1];for(const q of g.entries()){g=q[0];k=q[1];h="";for(let n=0,p;n<k.length;n++){p=k[n]||[""];l="";for(let r=0;r<p.length;r++)l+=(l?",":"")+("string"===c?'"'+p[r]+'"':p[r]);l="["+l+"]";h+=(h?",":"")+l}h='new Map([["'+g+'",['+h+"]]])";h='["'+f+'",'+h+"]";e+=(e?",":"")+h}}e="index.ctx=new Map(["+e+"]);";return a?"function inject(index){"+b+d+e+"}":b+d+e};oa(M.prototype);const hb="undefined"!==typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),ib=["map","ctx","tag","reg","cfg"];
v.get=function(a,b,c=0,d=0,e=!0,f=!1){a=this.db.transaction(b?"ctx":"map","readonly").objectStore(b?"ctx":"map").get(b?b+":"+a:a);const g=this;return Z(a).then(function(h){let k=[];if(!h||!h.length)return k;if(e){if(!c&&!d&&1===h.length)return h[0];for(let l=0,m;l<h.length;l++)if((m=h[l])&&m.length){if(d>=m.length){d-=m.length;continue}const p=c?d+Math.min(m.length-d,c):m.length;for(let n=d;n<p;n++)k.push(m[n]);d=0;if(k.length===c)break}return f?g.enrich(k):k}return h})}; function jb(a,b={}){if(!this)return new jb(a,b);"object"===typeof a&&(b=a=a.name);a||console.info("Default storage space was used, because a name was not passed.");this.id="flexsearch"+(a?":"+a.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"");this.field=b.field?b.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"";this.support_tag_search=!1;this.db=null;this.h={}}u=jb.prototype;u.mount=function(a){if(!a.encoder)return a.mount(this);a.db=this;return this.open()};
v.tag=function(a,b=0,c=0,d=!1){a=this.db.transaction("tag","readonly").objectStore("tag").get(a);const e=this;return Z(a).then(function(f){if(!f||!f.length||c>=f.length)return[];if(!b&&!c)return f;f=f.slice(c,c+b);return d?e.enrich(f):f})}; u.open=function(){let a=this;navigator.storage&&navigator.storage.persist();return this.db||new Promise(function(b,c){const d=hb.open(a.id+(a.field?":"+a.field:""),1);d.onupgradeneeded=function(){const e=a.db=this.result;ib.forEach(f=>{e.objectStoreNames.contains(f)||e.createObjectStore(f)})};d.onblocked=function(e){console.error("blocked",e);c()};d.onerror=function(e){console.error(this.error,e);c()};d.onsuccess=function(){a.db=this.result;a.db.onversionchange=function(){a.close()};b(a)}})};
v.enrich=function(a){"object"!==typeof a&&(a=[a]);const b=this.db.transaction("reg","readonly").objectStore("reg"),c=[];for(let d=0;d<a.length;d++)c[d]=Z(b.get(a[d]));return Promise.all(c).then(function(d){for(let e=0;e<d.length;e++)d[e]={id:a[e],doc:d[e]?JSON.parse(d[e]):null};return d})};v.has=function(a){a=this.db.transaction("reg","readonly").objectStore("reg").getKey(a);return Z(a)};v.search=null;v.info=function(){}; u.close=function(){this.db.close();this.db=null};u.destroy=function(){return hb.deleteDatabase(this.id+(this.field?":"+this.field:""))};u.clear=function(){const a=this.db.transaction(ib,"readwrite");for(let b=0;b<ib.length;b++)a.objectStore(ib[b]).clear();return Z(a)};
v.transaction=function(a,b,c){let d=this.h[a+":"+b];if(d)return c.call(this,d);let e=this.db.transaction(a,b);this.h[a+":"+b]=d=e.objectStore(a);return new Promise((f,g)=>{e.onerror=h=>{this.h[a+":"+b]=null;e.abort();e=d=null;g(h)};e.oncomplete=h=>{e=d=this.h[a+":"+b]=null;f(h||!0)};return c.call(this,d)})}; u.get=function(a,b,c=0,d=0,e=!0,f=!1){a=this.db.transaction(b?"ctx":"map","readonly").objectStore(b?"ctx":"map").get(b?b+":"+a:a);const g=this;return Z(a).then(function(k){let h=[];if(!k||!k.length)return h;if(e){if(!c&&!d&&1===k.length)return k[0];for(let l=0,m;l<k.length;l++)if((m=k[l])&&m.length){if(d>=m.length){d-=m.length;continue}const q=c?d+Math.min(m.length-d,c):m.length;for(let n=d;n<q;n++)h.push(m[n]);d=0;if(h.length===c)break}return f?g.enrich(h):h}return k})};
v.commit=async function(a,b,c){if(b)await this.clear(),a.commit_task=[];else{let d=a.commit_task;a.commit_task=[];for(let e=0,f;e<d.length;e++)if(f=d[e],f.clear){await this.clear();b=!0;break}else d[e]=f.V;b||(c||(d=d.concat(ba(a.reg))),d.length&&await this.remove(d))}a.reg.size&&(await this.transaction("map","readwrite",function(d){for(const e of a.map){const f=e[0],g=e[1];g.length&&(b?d.put(g,f):d.get(f).onsuccess=function(){let h=this.result;var k;if(h&&h.length){const l=Math.max(h.length,g.length); u.tag=function(a,b=0,c=0,d=!1){a=this.db.transaction("tag","readonly").objectStore("tag").get(a);const e=this;return Z(a).then(function(f){if(!f||!f.length||c>=f.length)return[];if(!b&&!c)return f;f=f.slice(c,c+b);return d?e.enrich(f):f})};
for(let m=0,p,n;m<l;m++)if((n=g[m])&&n.length){if((p=h[m])&&p.length)for(k=0;k<n.length;k++)p.push(n[k]);else h[m]=n;k=1}}else h=g,k=1;k&&d.put(h,f)})}}),await this.transaction("ctx","readwrite",function(d){for(const e of a.ctx){const f=e[0],g=e[1];for(const h of g){const k=h[0],l=h[1];l.length&&(b?d.put(l,f+":"+k):d.get(f+":"+k).onsuccess=function(){let m=this.result;var p;if(m&&m.length){const n=Math.max(m.length,l.length);for(let q=0,r,t;q<n;q++)if((t=l[q])&&t.length){if((r=m[q])&&r.length)for(p= u.enrich=function(a){"object"!==typeof a&&(a=[a]);const b=this.db.transaction("reg","readonly").objectStore("reg"),c=[];for(let d=0;d<a.length;d++)c[d]=Z(b.get(a[d]));return Promise.all(c).then(function(d){for(let e=0;e<d.length;e++)d[e]={id:a[e],doc:d[e]?JSON.parse(d[e]):null};return d})};u.has=function(a){a=this.db.transaction("reg","readonly").objectStore("reg").getKey(a);return Z(a)};u.search=null;u.info=function(){};
0;p<t.length;p++)r.push(t[p]);else m[q]=t;p=1}}else m=l,p=1;p&&d.put(m,f+":"+k)})}}}),a.store?await this.transaction("reg","readwrite",function(d){for(const e of a.store){const f=e[0],g=e[1];d.put("object"===typeof g?JSON.stringify(g):1,f)}}):a.bypass||await this.transaction("reg","readwrite",function(d){for(const e of a.reg.keys())d.put(1,e)}),a.tag&&await this.transaction("tag","readwrite",function(d){for(const e of a.tag){const f=e[0],g=e[1];g.length&&(d.get(f).onsuccess=function(){let h=this.result; u.transaction=function(a,b,c){let d=this.h[a+":"+b];if(d)return c.call(this,d);let e=this.db.transaction(a,b);this.h[a+":"+b]=d=e.objectStore(a);return new Promise((f,g)=>{e.onerror=k=>{this.h[a+":"+b]=null;e.abort();e=d=null;g(k)};e.oncomplete=k=>{e=d=this.h[a+":"+b]=null;f(k||!0)};return c.call(this,d)})};
h=h&&h.length?h.concat(g):g;d.put(h,f)})}}),a.map.clear(),a.ctx.clear(),a.tag&&a.tag.clear(),a.store&&a.store.clear(),a.document||a.reg.clear())}; u.commit=async function(a,b,c){if(b)await this.clear(),a.commit_task=[];else{let d=a.commit_task;a.commit_task=[];for(let e=0,f;e<d.length;e++)if(f=d[e],f.clear){await this.clear();b=!0;break}else d[e]=f.V;b||(c||(d=d.concat(ba(a.reg))),d.length&&await this.remove(d))}a.reg.size&&(await this.transaction("map","readwrite",function(d){for(const e of a.map){const f=e[0],g=e[1];g.length&&(b?d.put(g,f):d.get(f).onsuccess=function(){let k=this.result;var h;if(k&&k.length){const l=Math.max(k.length,g.length);
function jb(a,b,c){const d=a.value;let e,f,g=0;for(let h=0,k;h<d.length;h++){if(k=c?d:d[h]){for(let l=0,m,p;l<b.length;l++)if(p=b[l],m=k.indexOf(f?parseInt(p,10):p),0>m&&!f&&"string"===typeof p&&!isNaN(p)&&(m=k.indexOf(parseInt(p,10)))&&(f=1),0<=m)if(e=1,1<k.length)k.splice(m,1);else{d[h]=[];break}g+=k.length}if(c)break}g?e&&a.update(d):a.delete();a.continue()} for(let m=0,q,n;m<l;m++)if((n=g[m])&&n.length){if((q=k[m])&&q.length)for(h=0;h<n.length;h++)q.push(n[h]);else k[m]=n;h=1}}else k=g,h=1;h&&d.put(k,f)})}}),await this.transaction("ctx","readwrite",function(d){for(const e of a.ctx){const f=e[0],g=e[1];for(const k of g){const h=k[0],l=k[1];l.length&&(b?d.put(l,f+":"+h):d.get(f+":"+h).onsuccess=function(){let m=this.result;var q;if(m&&m.length){const n=Math.max(m.length,l.length);for(let p=0,r,t;p<n;p++)if((t=l[p])&&t.length){if((r=m[p])&&r.length)for(q=
v.remove=function(a){"object"!==typeof a&&(a=[a]);return Promise.all([this.transaction("map","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&jb(c,a)}}),this.transaction("ctx","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&jb(c,a)}}),this.transaction("tag","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&jb(c,a,!0)}}),this.transaction("reg","readwrite",function(b){for(let c=0;c<a.length;c++)b.delete(a[c])})])}; 0;q<t.length;q++)r.push(t[q]);else m[p]=t;q=1}}else m=l,q=1;q&&d.put(m,f+":"+h)})}}}),a.store?await this.transaction("reg","readwrite",function(d){for(const e of a.store){const f=e[0],g=e[1];d.put("object"===typeof g?JSON.stringify(g):1,f)}}):a.bypass||await this.transaction("reg","readwrite",function(d){for(const e of a.reg.keys())d.put(1,e)}),a.tag&&await this.transaction("tag","readwrite",function(d){for(const e of a.tag){const f=e[0],g=e[1];g.length&&(d.get(f).onsuccess=function(){let k=this.result;
function Z(a){return new Promise((b,c)=>{a.onsuccess=function(){b(this.result)};a.oncomplete=function(){b(this.result)};a.onerror=c;a=null})};export default {Index:L,Charset:Sa,Encoder:K,Document:T,Worker:N,Resolver:X,IndexedDB:ib,Language:{}}; k=k&&k.length?k.concat(g):g;d.put(k,f)})}}),a.map.clear(),a.ctx.clear(),a.tag&&a.tag.clear(),a.store&&a.store.clear(),a.document||a.reg.clear())};
export const Index=L;export const Charset=Sa;export const Encoder=K;export const Document=T;export const Worker=N;export const Resolver=X;export const IndexedDB=ib;export const Language={}; function kb(a,b,c){const d=a.value;let e,f,g=0;for(let k=0,h;k<d.length;k++){if(h=c?d:d[k]){for(let l=0,m,q;l<b.length;l++)if(q=b[l],m=h.indexOf(f?parseInt(q,10):q),0>m&&!f&&"string"===typeof q&&!isNaN(q)&&(m=h.indexOf(parseInt(q,10)))&&(f=1),0<=m)if(e=1,1<h.length)h.splice(m,1);else{d[k]=[];break}g+=h.length}if(c)break}g?e&&a.update(d):a.delete();a.continue()}
u.remove=function(a){"object"!==typeof a&&(a=[a]);return Promise.all([this.transaction("map","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&kb(c,a)}}),this.transaction("ctx","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&kb(c,a)}}),this.transaction("tag","readwrite",function(b){b.openCursor().onsuccess=function(){const c=this.result;c&&kb(c,a,!0)}}),this.transaction("reg","readwrite",function(b){for(let c=0;c<a.length;c++)b.delete(a[c])})])};
function Z(a){return new Promise((b,c)=>{a.onsuccess=function(){b(this.result)};a.oncomplete=function(){b(this.result)};a.onerror=c;a=null})};export default {Index:M,Charset:Ta,Encoder:K,Document:T,Worker:N,Resolver:X,IndexedDB:jb,Language:{}};
export const Index=M;export const Charset=Ta;export const Encoder=K;export const Document=T;export const Worker=N;export const Resolver=X;export const IndexedDB=jb;export const Language={};

File diff suppressed because it is too large Load Diff

View File

@@ -5,50 +5,53 @@
* Hosted by Nextapps GmbH * Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;var x;function B(a,b,c){const e=typeof c,d=typeof a;if("undefined"!==e){if("undefined"!==d){if(c){if("function"===d&&e===d)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var g=new Map(c);for(var f of a)g.set(f[0],f[1]);return g}if(b===Set){f=new Set(c);for(g of a.values())f.add(g);return f}}}return a}return c}return"undefined"===d?b:a}function D(){return Object.create(null)}function aa(a,b){return b.length-a.length} (function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;var w;function B(a,b,c){const e=typeof c,d=typeof a;if("undefined"!==e){if("undefined"!==d){if(c){if("function"===d&&e===d)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var g=new Map(c);for(var f of a)g.set(f[0],f[1]);return g}if(b===Set){f=new Set(c);for(g of a.values())f.add(g);return f}}}return a}return c}return"undefined"===d?b:a}function D(){return Object.create(null)}function aa(a,b){return b.length-a.length}
function E(a){return"string"===typeof a}function G(a){return"object"===typeof a}function I(a,b){if(E(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a};var ba=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb", function E(a){return"string"===typeof a}function G(a){return"object"===typeof a}function I(a,b){if(E(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a};var ba=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb",
"u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"], "u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"],
["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0", ["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0",
"i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215", "i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215",
"u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af", "u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af",
"\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"], "\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"],
["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const ca=/[^\p{L}\p{N}]+/u,da=/(\d{3})/g,ea=/(\D)(\d{3})/g,fa=/(\d{3})(\D)/g,J="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])} ["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const ca=/[^\p{L}\p{N}]+/u,da=/(\d{3})/g,ea=/(\D)(\d{3})/g,fa=/(\d{3})(\D)/g,J="".normalize&&/[\u0300-\u036f]/g;function L(a){if(!this||this.constructor!==L)return new L(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])}w=L.prototype;
K.prototype.assign=function(a){this.normalize=B(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let e=!b,d="";a.include||(d+="\\p{Z}");c.letter&&(d+="\\p{L}");c.number&&(d+="\\p{N}",e=!!b);c.symbol&&(d+="\\p{S}");c.punctuation&&(d+="\\p{P}");c.control&&(d+="\\p{C}");if(c=c.char)d+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+d+"]+","u")}catch(g){this.split=/\s+/}this.numeric=e}else{try{this.split=B(c,ca,this.split)}catch(e){this.split= w.assign=function(a){this.normalize=B(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let e=!b,d="";a.include||(d+="\\p{Z}");c.letter&&(d+="\\p{L}");c.number&&(d+="\\p{N}",e=!!b);c.symbol&&(d+="\\p{S}");c.punctuation&&(d+="\\p{P}");c.control&&(d+="\\p{C}");if(c=c.char)d+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+d+"]+","u")}catch(g){this.split=/\s+/}this.numeric=e}else{try{this.split=B(c,ca,this.split)}catch(e){this.split=
/\s+/}this.numeric=B(this.numeric,!0)}this.prepare=B(a.prepare,null,this.prepare);this.finalize=B(a.finalize,null,this.finalize);J||(this.mapper=new Map(ba));this.rtl=a.rtl||!1;this.dedupe=B(a.dedupe,!0,this.dedupe);this.filter=B((c=a.filter)&&new Set(c),null,this.filter);this.matcher=B((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=B((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=B((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=B(a.replacer,null,this.replacer);this.minlength= /\s+/}this.numeric=B(this.numeric,!0)}this.prepare=B(a.prepare,null,this.prepare);this.finalize=B(a.finalize,null,this.finalize);J||(this.mapper=new Map(ba));this.rtl=a.rtl||!1;this.dedupe=B(a.dedupe,!0,this.dedupe);this.filter=B((c=a.filter)&&new Set(c),null,this.filter);this.matcher=B((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=B((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=B((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=B(a.replacer,null,this.replacer);this.minlength=
B(a.minlength,1,this.minlength);this.maxlength=B(a.maxlength,0,this.maxlength);if(this.cache=c=B(a.cache,!0,this.cache))this.I=null,this.O="number"===typeof c?c:2E5,this.D=new Map,this.G=new Map,this.J=this.A=128;this.K="";this.M=null;this.L="";this.N=null;if(this.matcher)for(const e of this.matcher.keys())this.K+=(this.K?"|":"")+e;if(this.stemmer)for(const e of this.stemmer.keys())this.L+=(this.L?"|":"")+e;return this}; B(a.minlength,1,this.minlength);this.maxlength=B(a.maxlength,0,this.maxlength);if(this.cache=c=B(a.cache,!0,this.cache))this.J=null,this.O="number"===typeof c?c:2E5,this.F=new Map,this.G=new Map,this.L=this.K=128;this.h="";this.M=null;this.D="";this.N=null;if(this.matcher)for(const e of this.matcher.keys())this.h+=(this.h?"|":"")+e;if(this.stemmer)for(const e of this.stemmer.keys())this.D+=(this.D?"|":"")+e;return this};
K.prototype.encode=function(a){if(this.cache&&a.length<=this.A)if(this.I){if(this.D.has(a))return this.D.get(a)}else this.I=setTimeout(ha,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):J?a.normalize("NFKD").replace(J,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(ea,"$1 $2").replace(fa,"$1 $2").replace(da,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer); w.addMatcher=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(2>a.length)return this.addMapper(a,b);this.matcher||(this.matcher=new Map);this.matcher.set(a,b);this.h+=(this.h?"|":"")+a;this.M=null;this.cache&&M(this);return this};w.addStemmer=function(a,b){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,b);this.D+=(this.D?"|":"")+a;this.N=null;this.cache&&M(this);return this};
let c=[],e=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,h;g<e.length;g++){if(!(f=h=e[g]))continue;if(f.length<this.minlength)continue;if(b){c.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.J)if(this.I){var d=this.G.get(f);if(d||""===d){d&&c.push(d);continue}}else this.I=setTimeout(ha,50,this);let k;this.stemmer&&2<f.length&&(this.N||(this.N=new RegExp("(?!^)("+this.L+")$")),f=f.replace(this.N,l=>this.stemmer.get(l)),k=1);f&&k&&(f.length< w.addFilter=function(a){this.filter||(this.filter=new Set);this.filter.add(a);this.cache&&M(this);return this};w.addMapper=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(1<a.length)return this.addMatcher(a,b);this.mapper||(this.mapper=new Map);this.mapper.set(a,b);this.cache&&M(this);return this};w.addReplacer=function(a,b){"string"===typeof a&&(a=new RegExp(a,"g"));this.replacer||(this.replacer=[]);this.replacer.push(a,b||"");this.cache&&M(this);return this};
this.minlength||this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){d="";for(let l=0,m="",n,t;l<f.length;l++)n=f.charAt(l),n===m&&this.dedupe||((t=this.mapper&&this.mapper.get(n))||""===t?t===m&&this.dedupe||!(m=t)||(d+=t):d+=m=n);f=d}this.matcher&&1<f.length&&(this.M||(this.M=new RegExp("("+this.K+")","g")),f=f.replace(this.M,l=>this.matcher.get(l)));if(f&&this.replacer)for(d=0;f&&d<this.replacer.length;d+=2)f=f.replace(this.replacer[d],this.replacer[d+1]);this.cache&& function M(a){a.F.clear();a.G.clear()}
h.length<=this.J&&(this.G.set(h,f),this.G.size>this.O&&(this.G.clear(),this.J=this.J/1.1|0));f&&c.push(f)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.A&&(this.D.set(a,c),this.D.size>this.O&&(this.D.clear(),this.A=this.A/1.1|0));return c};function ha(a){a.I=null;a.D.clear();a.G.clear()};function ia(a){M.call(a,"add");M.call(a,"append");M.call(a,"search");M.call(a,"update");M.call(a,"remove")}function M(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let e;"function"===typeof c&&(e=c,delete b[b.length-1]);b=this[a].apply(this,b);e&&(b.then?b.then(e):e(b));return b}};function N(a,b=0){let c=[],e=[];b&&(b=25E4/b*5E3|0);for(const d of a.entries())e.push(d),e.length===b&&(c.push(e),e=[]);e.length&&c.push(e);return c}function O(a,b){b||(b=new Map);for(let c=0,e;c<a.length;c++)e=a[c],b.set(e[0],e[1]);return b}function ja(a,b=0){let c=[],e=[];b&&(b=25E4/b*1E3|0);for(const d of a.entries())e.push([d[0],N(d[1])[0]]),e.length===b&&(c.push(e),e=[]);e.length&&c.push(e);return c} w.encode=function(a){if(this.cache&&a.length<=this.K)if(this.J){if(this.F.has(a))return this.F.get(a)}else this.J=setTimeout(ha,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):J?a.normalize("NFKD").replace(J,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(ea,"$1 $2").replace(fa,"$1 $2").replace(da,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let c=[],
function ka(a,b){b||(b=new Map);for(let c=0,e,d;c<a.length;c++)e=a[c],d=b.get(e[0]),b.set(e[0],O(e[1],d));return b}function la(a){let b=[],c=[];for(const e of a.keys())c.push(e),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}function ma(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b} e=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,h;g<e.length;g++){if(!(f=h=e[g]))continue;if(f.length<this.minlength)continue;if(b){c.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.L)if(this.J){var d=this.G.get(f);if(d||""===d){d&&c.push(d);continue}}else this.J=setTimeout(ha,50,this);let k;this.stemmer&&2<f.length&&(this.N||(this.N=new RegExp("(?!^)("+this.D+")$")),f=f.replace(this.N,l=>this.stemmer.get(l)),k=1);f&&k&&(f.length<this.minlength||
function P(a,b,c,e,d,g,f=0){const h=e&&e.constructor===Array;var k=h?e.shift():e;if(!k)return this.export(a,b,d,g+1);if((k=a((b?b+".":"")+(f+1)+"."+c,JSON.stringify(k)))&&k.then){const l=this;return k.then(function(){return P.call(l,a,b,c,h?e:null,d,g,f+1)})}return P.call(this,a,b,c,h?e:null,d,g,f+1)};Q.prototype.add=function(a,b,c){G(a)&&(b=a,a=I(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(let h=0,k;h<this.field.length;h++){k=this.C[h];var e=this.index.get(this.field[h]);if("function"===typeof k){var d=k(b);d&&e.add(a,d,!1,!0)}else if(d=k.F,!d||d(b))k.constructor===String?k=[""+k]:E(k)&&(k=[k]),R(b,k,this.H,0,e,a,k[0],c)}if(this.tag)for(e=0;e<this.B.length;e++){var g=this.B[e];d=this.tag.get(this.R[e]);let h=D();if("function"===typeof g){if(g=g(b),!g)continue}else{var f= this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){d="";for(let l=0,m="",r,t;l<f.length;l++)r=f.charAt(l),r===m&&this.dedupe||((t=this.mapper&&this.mapper.get(r))||""===t?t===m&&this.dedupe||!(m=t)||(d+=t):d+=m=r);f=d}this.matcher&&1<f.length&&(this.M||(this.M=new RegExp("("+this.h+")","g")),f=f.replace(this.M,l=>this.matcher.get(l)));if(f&&this.replacer)for(d=0;f&&d<this.replacer.length;d+=2)f=f.replace(this.replacer[d],this.replacer[d+1]);this.cache&&h.length<=
g.F;if(f&&!f(b))continue;g.constructor===String&&(g=""+g);g=I(b,g)}if(d&&g){E(g)&&(g=[g]);for(let k=0,l,m;k<g.length;k++)l=g[k],h[l]||(h[l]=1,(f=d.get(l))?m=f:d.set(l,m=[]),c&&m.includes(a)||(m.push(a),this.fastupdate&&((f=this.reg.get(a))?f.push(m):this.reg.set(a,[m]))))}}if(this.store&&(!c||!this.store.has(a))){let h;if(this.h){h=D();for(let k=0,l;k<this.h.length;k++){l=this.h[k];if((c=l.F)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.S]}else if(E(l)||l.constructor=== this.L&&(this.G.set(h,f),this.G.size>this.O&&(this.G.clear(),this.L=this.L/1.1|0));f&&c.push(f)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.K&&(this.F.set(a,c),this.F.size>this.O&&(this.F.clear(),this.K=this.K/1.1|0));return c};function ha(a){a.J=null;a.F.clear();a.G.clear()};function ia(a){N.call(a,"add");N.call(a,"append");N.call(a,"search");N.call(a,"update");N.call(a,"remove")}function N(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let e;"function"===typeof c&&(e=c,delete b[b.length-1]);b=this[a].apply(this,b);e&&(b.then?b.then(e):e(b));return b}};function O(a,b=0){let c=[],e=[];b&&(b=25E4/b*5E3|0);for(const d of a.entries())e.push(d),e.length===b&&(c.push(e),e=[]);e.length&&c.push(e);return c}function P(a,b){b||(b=new Map);for(let c=0,e;c<a.length;c++)e=a[c],b.set(e[0],e[1]);return b}function ja(a,b=0){let c=[],e=[];b&&(b=25E4/b*1E3|0);for(const d of a.entries())e.push([d[0],O(d[1])[0]]),e.length===b&&(c.push(e),e=[]);e.length&&c.push(e);return c}
String){h[l]=b[l];continue}na(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function na(a,b,c,e,d,g){a=a[d];if(e===c.length-1)b[d]=g||a;else if(a)if(a.constructor===Array)for(b=b[d]=Array(a.length),d=0;d<a.length;d++)na(a,b,c,e,d);else b=b[d]||(b[d]=D()),d=c[++e],na(a,b,c,e,d)} function ka(a,b){b||(b=new Map);for(let c=0,e,d;c<a.length;c++)e=a[c],d=b.get(e[0]),b.set(e[0],P(e[1],d));return b}function la(a){let b=[],c=[];for(const e of a.keys())c.push(e),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}function ma(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b}
function R(a,b,c,e,d,g,f,h){if(a=a[f])if(e===b.length-1){if(a.constructor===Array){if(c[e]){for(b=0;b<a.length;b++)d.add(g,a[b],!0,!0);return}a=a.join(" ")}d.add(g,a,h,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)R(a,b,c,e,d,g,f,h);else f=b[++e],R(a,b,c,e,d,g,f,h)};function oa(a,b){const c=D(),e=[];for(let d=0,g;d<b.length;d++){g=b[d];for(let f=0;f<g.length;f++)c[g[f]]=1}for(let d=0,g;d<a.length;d++)g=a[d],1===c[g]&&(e.push(g),c[g]=2);return e};Q.prototype.search=function(a,b,c,e){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let d=[];var g=[];let f,h,k,l,m,n,t=0,p;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;var r=c.pluck;h=c.merge;l=r||c.field||c.index;m=this.tag&&c.tag;f=this.store&&c.enrich;k=c.suggest;p=c.highlight;b=c.limit||b;n=c.offset||0;b||(b=100);if(m){m.constructor!==Array&&(m=[m]);var v=[];for(let w=0,q;w<m.length;w++)if(q=m[w],q.field&&q.tag){var u=q.tag;if(u.constructor===Array)for(var y=0;y<u.length;y++)v.push(q.field, function Q(a,b,c,e,d,g,f=0){const h=e&&e.constructor===Array;var k=h?e.shift():e;if(!k)return this.export(a,b,d,g+1);if((k=a((b?b+".":"")+(f+1)+"."+c,JSON.stringify(k)))&&k.then){const l=this;return k.then(function(){return Q.call(l,a,b,c,h?e:null,d,g,f+1)})}return Q.call(this,a,b,c,h?e:null,d,g,f+1)};R.prototype.add=function(a,b,c){G(a)&&(b=a,a=I(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(let h=0,k;h<this.field.length;h++){k=this.C[h];var e=this.index.get(this.field[h]);if("function"===typeof k){var d=k(b);d&&e.add(a,d,!1,!0)}else if(d=k.H,!d||d(b))k.constructor===String?k=[""+k]:E(k)&&(k=[k]),na(b,k,this.I,0,e,a,k[0],c)}if(this.tag)for(e=0;e<this.B.length;e++){var g=this.B[e];d=this.tag.get(this.R[e]);let h=D();if("function"===typeof g){if(g=g(b),!g)continue}else{var f=
u[y]);else v.push(q.field,u)}else{u=Object.keys(q);for(let C=0,A,z;C<u.length;C++)if(A=u[C],z=q[A],z.constructor===Array)for(y=0;y<z.length;y++)v.push(A,z[y]);else v.push(A,z)}m=v;if(!a){e=[];if(v.length)for(g=0;g<v.length;g+=2)r=pa.call(this,v[g],v[g+1],b,n,f),d.push({field:v[g],tag:v[g+1],result:r});return e.length?Promise.all(e).then(function(w){for(let q=0;q<w.length;q++)d[q].result=w[q];return d}):d}}E(l)&&(l=[l])}l||(l=this.field);v=!e&&(this.worker||this.db)&&[];for(let w=0,q,C,A;w<l.length;w++){C= g.H;if(f&&!f(b))continue;g.constructor===String&&(g=""+g);g=I(b,g)}if(d&&g){E(g)&&(g=[g]);for(let k=0,l,m;k<g.length;k++)l=g[k],h[l]||(h[l]=1,(f=d.get(l))?m=f:d.set(l,m=[]),c&&m.includes(a)||(m.push(a),this.fastupdate&&((f=this.reg.get(a))?f.push(m):this.reg.set(a,[m]))))}}if(this.store&&(!c||!this.store.has(a))){let h;if(this.A){h=D();for(let k=0,l;k<this.A.length;k++){l=this.A[k];if((c=l.H)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.S]}else if(E(l)||l.constructor===
l[w];let z;E(C)||(z=C,C=z.field,a=z.query||a,b=z.limit||b,n=z.offset||n,k=z.suggest||k,f=this.store&&(z.enrich||f));if(e)q=e[w];else if(u=z||c,y=this.index.get(C),m&&(u.enrich=!1),v){v[w]=y.search(a,b,u);u&&f&&(u.enrich=f);continue}else q=y.search(a,b,u),u&&f&&(u.enrich=f);A=q&&q.length;if(m&&A){u=[];y=0;for(let H=0,F,L;H<m.length;H+=2){F=this.tag.get(m[H]);if(!F)if(k)continue;else return d;if(L=(F=F&&F.get(m[H+1]))&&F.length)y++,u.push(F);else if(!k)return d}if(y){q=oa(q,u);A=q.length;if(!A&&!k)return d; String){h[l]=b[l];continue}oa(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function oa(a,b,c,e,d,g){a=a[d];if(e===c.length-1)b[d]=g||a;else if(a)if(a.constructor===Array)for(b=b[d]=Array(a.length),d=0;d<a.length;d++)oa(a,b,c,e,d);else b=b[d]||(b[d]=D()),d=c[++e],oa(a,b,c,e,d)}
y--}}if(A)g[t]=C,d.push(q),t++;else if(1===l.length)return d}if(v){const w=this;return Promise.all(v).then(function(q){return q.length?w.search(a,b,c,q):q})}if(!t)return d;if(r&&(!f||!this.store))return d[0];v=[];for(let w=0,q;w<g.length;w++){q=d[w];f&&q.length&&!q[0].doc&&q.length&&(q=qa.call(this,q));if(r)return q;d[w]={field:g[w],result:q}}return h?ra(d,b):p?sa(d,a,this.index,this.field,this.C,p):d}; function na(a,b,c,e,d,g,f,h){if(a=a[f])if(e===b.length-1){if(a.constructor===Array){if(c[e]){for(b=0;b<a.length;b++)d.add(g,a[b],!0,!0);return}a=a.join(" ")}d.add(g,a,h,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)na(a,b,c,e,d,g,f,h);else f=b[++e],na(a,b,c,e,d,g,f,h)};function pa(a,b){const c=D(),e=[];for(let d=0,g;d<b.length;d++){g=b[d];for(let f=0;f<g.length;f++)c[g[f]]=1}for(let d=0,g;d<a.length;d++)g=a[d],1===c[g]&&(e.push(g),c[g]=2);return e};R.prototype.search=function(a,b,c,e){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let d=[];var g=[];let f,h,k,l,m,r,t=0,p;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;var n=c.pluck;h=c.merge;l=n||c.field||c.index;m=this.tag&&c.tag;f=this.store&&c.enrich;k=c.suggest;p=c.highlight;b=c.limit||b;r=c.offset||0;b||(b=100);if(m){m.constructor!==Array&&(m=[m]);var u=[];for(let x=0,q;x<m.length;x++)if(q=m[x],q.field&&q.tag){var v=q.tag;if(v.constructor===Array)for(var y=0;y<v.length;y++)u.push(q.field,
function sa(a,b,c,e,d,g){let f,h,k;for(let m=0,n,t,p,r,v;m<a.length;m++){n=a[m].result;t=a[m].field;r=c.get(t);p=r.encoder;k=r.tokenize;v=d[e.indexOf(t)];p!==f&&(f=p,h=f.encode(b));for(let u=0;u<n.length;u++){let y="";var l=I(n[u].doc,v);let w=f.encode(l);l=l.split(f.split);for(let q=0,C,A;q<w.length;q++){C=w[q];A=l[q];let z;for(let H=0,F;H<h.length;H++)if(F=h[H],"strict"===k){if(C===F){y+=(y?" ":"")+g.replace("$1",A);z=!0;break}}else{const L=C.indexOf(F);if(-1<L){y+=(y?" ":"")+A.substring(0,L)+g.replace("$1", v[y]);else u.push(q.field,v)}else{v=Object.keys(q);for(let C=0,A,z;C<v.length;C++)if(A=v[C],z=q[A],z.constructor===Array)for(y=0;y<z.length;y++)u.push(A,z[y]);else u.push(A,z)}m=u;if(!a){e=[];if(u.length)for(g=0;g<u.length;g+=2)n=qa.call(this,u[g],u[g+1],b,r,f),d.push({field:u[g],tag:u[g+1],result:n});return e.length?Promise.all(e).then(function(x){for(let q=0;q<x.length;q++)d[q].result=x[q];return d}):d}}E(l)&&(l=[l])}l||(l=this.field);u=!e&&(this.worker||this.db)&&[];for(let x=0,q,C,A;x<l.length;x++){C=
A.substring(L,F.length))+A.substring(L+F.length);z=!0;break}}z||(y+=(y?" ":"")+l[q])}n[u].highlight=y}}return a}function ra(a,b){const c=[],e=D();for(let d=0,g,f;d<a.length;d++){g=a[d];f=g.result;for(let h=0,k,l,m;h<f.length;h++)if(l=f[h],k=l.id,m=e[k])m.push(g.field);else{if(c.length===b)return c;l.field=e[k]=[g.field];c.push(l)}}return c}function pa(a,b,c,e,d){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-e)&&0<b){if(b>c||e)a=a.slice(e,e+c);d&&(a=qa.call(this,a));return a}} l[x];let z;E(C)||(z=C,C=z.field,a=z.query||a,b=z.limit||b,r=z.offset||r,k=z.suggest||k,f=this.store&&(z.enrich||f));if(e)q=e[x];else if(v=z||c,y=this.index.get(C),m&&(v.enrich=!1),u){u[x]=y.search(a,b,v);v&&f&&(v.enrich=f);continue}else q=y.search(a,b,v),v&&f&&(v.enrich=f);A=q&&q.length;if(m&&A){v=[];y=0;for(let H=0,F,K;H<m.length;H+=2){F=this.tag.get(m[H]);if(!F)if(k)continue;else return d;if(K=(F=F&&F.get(m[H+1]))&&F.length)y++,v.push(F);else if(!k)return d}if(y){q=pa(q,v);A=q.length;if(!A&&!k)return d;
function qa(a){const b=Array(a.length);for(let c=0,e;c<a.length;c++)e=a[c],b[c]={id:e,doc:this.store.get(e)};return b};function Q(a){if(!this||this.constructor!==Q)return new Q(a);const b=a.document||a.doc||a;var c;this.C=[];this.field=[];this.H=[];this.key=(c=b.key||b.id)&&S(c,this.H)||"id";this.reg=(this.fastupdate=!!a.fastupdate)?new Map:new Set;this.h=(c=b.store||null)&&!0!==c&&[];this.store=c&&new Map;this.cache=(c=a.cache||null)&&new T(c);a.cache=!1;c=new Map;let e=b.index||b.field||b;E(e)&&(e=[e]);for(let d=0,g,f;d<e.length;d++)g=e[d],E(g)||(f=g,g=g.field),f=G(f)?Object.assign({},a,f):a,c.set(g,new U(f,this.reg)), y--}}if(A)g[t]=C,d.push(q),t++;else if(1===l.length)return d}if(u){const x=this;return Promise.all(u).then(function(q){return q.length?x.search(a,b,c,q):q})}if(!t)return d;if(n&&(!f||!this.store))return d[0];u=[];for(let x=0,q;x<g.length;x++){q=d[x];f&&q.length&&!q[0].doc&&q.length&&(q=ra.call(this,q));if(n)return q;d[x]={field:g[x],result:q}}return h?sa(d,b):p?ta(d,a,this.index,this.field,this.C,p):d};
f.custom?this.C[d]=f.custom:(this.C[d]=S(g,this.H),f.filter&&("string"===typeof this.C[d]&&(this.C[d]=new String(this.C[d])),this.C[d].F=f.filter)),this.field[d]=g;if(this.h){a=b.store;E(a)&&(a=[a]);for(let d=0,g,f;d<a.length;d++)g=a[d],f=g.field||g,g.custom?(this.h[d]=g.custom,g.custom.S=f):(this.h[d]=S(f,this.H),g.filter&&("string"===typeof this.h[d]&&(this.h[d]=new String(this.h[d])),this.h[d].F=g.filter))}this.index=c;this.tag=null;if(c=b.tag)if("string"===typeof c&&(c=[c]),c.length){this.tag= function ta(a,b,c,e,d,g){let f,h,k;for(let m=0,r,t,p,n,u;m<a.length;m++){r=a[m].result;t=a[m].field;n=c.get(t);p=n.encoder;k=n.tokenize;u=d[e.indexOf(t)];p!==f&&(f=p,h=f.encode(b));for(let v=0;v<r.length;v++){let y="";var l=I(r[v].doc,u);let x=f.encode(l);l=l.split(f.split);for(let q=0,C,A;q<x.length;q++){C=x[q];A=l[q];let z;for(let H=0,F;H<h.length;H++)if(F=h[H],"strict"===k){if(C===F){y+=(y?" ":"")+g.replace("$1",A);z=!0;break}}else{const K=C.indexOf(F);if(-1<K){y+=(y?" ":"")+A.substring(0,K)+g.replace("$1",
new Map;this.B=[];this.R=[];for(let d=0,g,f;d<c.length;d++){g=c[d];f=g.field||g;if(!f)throw Error("The tag field from the document descriptor is undefined.");g.custom?this.B[d]=g.custom:(this.B[d]=S(f,this.H),g.filter&&("string"===typeof this.B[d]&&(this.B[d]=new String(this.B[d])),this.B[d].F=g.filter));this.R[d]=f;this.tag.set(f,new Map)}}} A.substring(K,F.length))+A.substring(K+F.length);z=!0;break}}z||(y+=(y?" ":"")+l[q])}r[v].highlight=y}}return a}function sa(a,b){const c=[],e=D();for(let d=0,g,f;d<a.length;d++){g=a[d];f=g.result;for(let h=0,k,l,m;h<f.length;h++)if(l=f[h],k=l.id,m=e[k])m.push(g.field);else{if(c.length===b)return c;l.field=e[k]=[g.field];c.push(l)}}return c}function qa(a,b,c,e,d){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-e)&&0<b){if(b>c||e)a=a.slice(e,e+c);d&&(a=ra.call(this,a));return a}}
function S(a,b){const c=a.split(":");let e=0;for(let d=0;d<c.length;d++)a=c[d],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[e]=!0),a&&(c[e++]=a);e<c.length&&(c.length=e);return 1<e?c:c[0]}x=Q.prototype;x.append=function(a,b){return this.add(a,b,!0)};x.update=function(a,b){return this.remove(a).add(a,b)}; function ra(a){const b=Array(a.length);for(let c=0,e;c<a.length;c++)e=a[c],b[c]={id:e,doc:this.store.get(e)};return b};function R(a){if(!this||this.constructor!==R)return new R(a);const b=a.document||a.doc||a;var c;this.C=[];this.field=[];this.I=[];this.key=(c=b.key||b.id)&&S(c,this.I)||"id";this.reg=(this.fastupdate=!!a.fastupdate)?new Map:new Set;this.A=(c=b.store||null)&&c&&!0!==c&&[];this.store=c&&new Map;this.cache=(c=a.cache||null)&&new T(c);a.cache=!1;c=new Map;let e=b.index||b.field||b;E(e)&&(e=[e]);for(let d=0,g,f;d<e.length;d++)g=e[d],E(g)||(f=g,g=g.field),f=G(f)?Object.assign({},a,f):a,c.set(g,new U(f,
x.remove=function(a){G(a)&&(a=I(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let c of this.tag.values())for(let e of c){b=e[0];const d=e[1],g=d.indexOf(a);-1<g&&(1<d.length?d.splice(g,1):c.delete(b))}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; this.reg)),f.custom?this.C[d]=f.custom:(this.C[d]=S(g,this.I),f.filter&&("string"===typeof this.C[d]&&(this.C[d]=new String(this.C[d])),this.C[d].H=f.filter)),this.field[d]=g;if(this.A){a=b.store;E(a)&&(a=[a]);for(let d=0,g,f;d<a.length;d++)g=a[d],f=g.field||g,g.custom?(this.A[d]=g.custom,g.custom.S=f):(this.A[d]=S(f,this.I),g.filter&&("string"===typeof this.A[d]&&(this.A[d]=new String(this.A[d])),this.A[d].H=g.filter))}this.index=c;this.tag=null;if(c=b.tag)if("string"===typeof c&&(c=[c]),c.length){this.tag=
x.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};x.contain=function(a){return this.reg.has(a)};x.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};x.get=function(a){return this.store.get(a)};x.set=function(a,b){this.store.set(a,b);return this};x.searchCache=ta; new Map;this.B=[];this.R=[];for(let d=0,g,f;d<c.length;d++){g=c[d];f=g.field||g;if(!f)throw Error("The tag field from the document descriptor is undefined.");g.custom?this.B[d]=g.custom:(this.B[d]=S(f,this.I),g.filter&&("string"===typeof this.B[d]&&(this.B[d]=new String(this.B[d])),this.B[d].H=g.filter));this.R[d]=f;this.tag.set(f,new Map)}}}
x.export=function(a,b,c=0,e=0){if(c<this.field.length){const f=this.field[c];if((b=this.index.get(f).export(a,f,c,e=1))&&b.then){const h=this;return b.then(function(){return h.export(a,f,c+1)})}return this.export(a,f,c+1)}let d,g;switch(e){case 0:d="reg";g=la(this.reg);b=null;break;case 1:d="tag";g=ja(this.tag,this.reg.size);b=null;break;case 2:d="doc";g=N(this.store);b=null;break;case 3:d="cfg";g={};b=null;break;default:return}return P.call(this,a,b,d,g,c,e)}; function S(a,b){const c=a.split(":");let e=0;for(let d=0;d<c.length;d++)a=c[d],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[e]=!0),a&&(c[e++]=a);e<c.length&&(c.length=e);return 1<e?c:c[0]}w=R.prototype;w.append=function(a,b){return this.add(a,b,!0)};w.update=function(a,b){return this.remove(a).add(a,b)};
x.import=function(a,b){if(b){E(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=ma(b,this.reg);for(let e=0,d;e<this.field.length;e++)d=this.index.get(this.field[e]),d.fastupdate=!1,d.reg=this.reg;break;case "tag":this.tag=ka(b,this.tag);break;case "doc":this.store=O(b,this.store)}}};ia(Q.prototype);function ta(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();let e=this.cache.get(a);if(!e){e=this.search(a,b,c);if(e.then){const d=this;e.then(function(g){d.cache.set(a,g);return g})}this.cache.set(a,e)}return e}function T(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.A=""}T.prototype.set=function(a,b){this.cache.set(this.A=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)}; w.remove=function(a){G(a)&&(a=I(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let c of this.tag.values())for(let e of c){b=e[0];const d=e[1],g=d.indexOf(a);-1<g&&(1<d.length?d.splice(g,1):c.delete(b))}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
T.prototype.get=function(a){const b=this.cache.get(a);b&&this.A!==a&&(this.cache.delete(a),this.cache.set(this.A=a,b));return b};T.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};T.prototype.clear=function(){this.cache.clear();this.A=""};const ua={normalize:function(a){return a.toLowerCase()},dedupe:!1};const va=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const wa=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),xa=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const ya={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const za=/[\x00-\x7F]+/g;const Aa=/[\x00-\x7F]+/g;const Ba=/[\x00-\x7F]+/g;var Ca={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:ua,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:va},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:va,matcher:wa,replacer:xa},LatinExtra:{normalize:!0,dedupe:!0,mapper:va,replacer:xa.concat([/(?!^)[aeo]/g,""]),matcher:wa},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let e=b.charAt(0),d=ya[e];for(let g=1,f;g<b.length&&(f=b.charAt(g),"h"=== w.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};w.contain=function(a){return this.reg.has(a)};w.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};w.get=function(a){return this.store.get(a)};w.set=function(a,b){this.store.set(a,b);return this};w.searchCache=ua;
f||"w"===f||!(f=ya[f])||f===d||(e+=f,d=f,4!==e.length));g++);a[c]=e}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(za," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(Aa,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ba," ")}}};const Da={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};D();U.prototype.add=function(a,b,c,e){if(b&&(a||0===a)){if(!e&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(e=b.length){const l=D(),m=D(),n=this.depth,t=this.resolution;for(let p=0;p<e;p++){let r=b[this.rtl?e-1-p:p];var d=r.length;if(d&&(n||!m[r])){var g=this.score?this.score(b,r,p,null,0):V(t,e,p),f="";switch(this.tokenize){case "full":if(2<d){for(g=0;g<d;g++)for(var h=d;h>g;h--){f=r.substring(g,h);var k=this.score?this.score(b,r,p,f,g):V(t,e,p,d,g);W(this,m,f,k,a,c)}break}case "reverse":if(1< w.export=function(a,b,c=0,e=0){if(c<this.field.length){const f=this.field[c];if((b=this.index.get(f).export(a,f,c,e=1))&&b.then){const h=this;return b.then(function(){return h.export(a,f,c+1)})}return this.export(a,f,c+1)}let d,g;switch(e){case 0:d="reg";g=la(this.reg);b=null;break;case 1:d="tag";g=ja(this.tag,this.reg.size);b=null;break;case 2:d="doc";g=O(this.store);b=null;break;case 3:d="cfg";g={};b=null;break;default:return}return Q.call(this,a,b,d,g,c,e)};
d){for(h=d-1;0<h;h--)f=r[h]+f,k=this.score?this.score(b,r,p,f,h):V(t,e,p,d,h),W(this,m,f,k,a,c);f=""}case "forward":if(1<d){for(h=0;h<d;h++)f+=r[h],W(this,m,f,g,a,c);break}default:if(W(this,m,r,g,a,c),n&&1<e&&p<e-1)for(d=D(),f=this.P,g=r,h=Math.min(n+1,e-p),d[g]=1,k=1;k<h;k++)if((r=b[this.rtl?e-1-p-k:p+k])&&!d[r]){d[r]=1;const v=this.score?this.score(b,g,p,r,k):V(f+(e/2>f?0:1),e,p,h-1,k-1),u=this.bidirectional&&r>g;W(this,l,u?g:r,v,a,c,u?r:g)}}}}this.fastupdate||this.reg.add(a)}}return this}; w.import=function(a,b){if(b){E(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=ma(b,this.reg);for(let e=0,d;e<this.field.length;e++)d=this.index.get(this.field[e]),d.fastupdate=!1,d.reg=this.reg;break;case "tag":this.tag=ka(b,this.tag);break;case "doc":this.store=P(b,this.store)}}};ia(R.prototype);function ua(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();let e=this.cache.get(a);if(!e){e=this.search(a,b,c);if(e.then){const d=this;e.then(function(g){d.cache.set(a,g);return g})}this.cache.set(a,e)}return e}function T(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}T.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};
function W(a,b,c,e,d,g,f){let h=f?a.ctx:a.map,k;if(!b[c]||f&&!(k=b[c])[f])f?(b=k||(b[c]=D()),b[f]=1,(k=h.get(f))?h=k:h.set(f,h=new Map)):b[c]=1,(k=h.get(c))?h=k:h.set(c,h=[]),h=h[e]||(h[e]=[]),g&&h.includes(d)||(h.push(d),a.fastupdate&&((b=a.reg.get(d))?b.push(h):a.reg.set(d,[h])))}function V(a,b,c,e,d){return c&&1<a?b+(e||0)<=a?c+(d||0):(a-1)/(b+(e||0))*(c+(d||0))+1|0:0};function Ea(a,b,c){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a;let e=[];for(let d=0,g,f;d<a.length;d++)if((g=a[d])&&(f=g.length)){if(c){if(c>=f){c-=f;continue}c<f&&(g=b?g.slice(c,c+b):g.slice(c),f=g.length,c=0)}if(e.length)f>b&&(g=g.slice(0,b),f=g.length),e.push(g);else{if(f>=b)return f>b&&(g=g.slice(0,b)),g;e=[g]}b-=f;if(!b)break}return e.length?e=1<e.length?[].concat.apply([],e):e[0]:e};U.prototype.search=function(a,b,c){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));var e=[],d=0;if(c){a=c.query||a;b=c.limit||b;d=c.offset||0;var g=c.context;var f=c.suggest}a=this.encoder.encode(a);c=a.length;b||(b=100);if(1===c)return X.call(this,a[0],"",b,d);g=this.depth&&!1!==g;if(2===c&&g&&!f)return X.call(this,a[0],a[1],b,d);var h=0,k=0;if(1<c){var l=D();const n=[];for(let t=0,p;t<c;t++)if((p=a[t])&&!l[p]){if(f||Y(this,p))n.push(p),l[p]=1;else return e;const r=p.length;h=Math.max(h,r);k=k?Math.min(k, T.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};T.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};T.prototype.clear=function(){this.cache.clear();this.h=""};const va={normalize:function(a){return a.toLowerCase()},dedupe:!1};const wa=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const xa=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),ya=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const za={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Aa=/[\x00-\x7F]+/g;const Ba=/[\x00-\x7F]+/g;const Ca=/[\x00-\x7F]+/g;var Da={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:va,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:wa},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:wa,matcher:xa,replacer:ya},LatinExtra:{normalize:!0,dedupe:!0,mapper:wa,replacer:ya.concat([/(?!^)[aeo]/g,""]),matcher:xa},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let e=b.charAt(0),d=za[e];for(let g=1,f;g<b.length&&(f=b.charAt(g),"h"===
r):r}a=n;c=a.length}if(!c)return e;l=0;if(1===c)return X.call(this,a[0],"",b,d);if(2===c&&g&&!f)return X.call(this,a[0],a[1],b,d);if(1<c)if(g){var m=a[0];l=1}else 9<h&&3<h/k&&a.sort(aa);for(let n,t;l<c;l++){t=a[l];m?(n=Y(this,t,m),n=Fa(n,e,f,this.P),f&&!1===n&&e.length||(m=t)):(n=Y(this,t,""),n=Fa(n,e,f,this.resolution));if(n)return n;if(f&&l===c-1){g=e.length;if(!g){if(m){m="";l=-1;continue}return e}if(1===g)return Ea(e[0],b,d)}}a:{a=e;e=this.resolution;m=f;c=a.length;f=[];g=D();for(let n=0,t,p, f||"w"===f||!(f=za[f])||f===d||(e+=f,d=f,4!==e.length));g++);a[c]=e}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Aa," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(Ba,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ca," ")}}};const Ea={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};D();U.prototype.add=function(a,b,c,e){if(b&&(a||0===a)){if(!e&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(e=b.length){const l=D(),m=D(),r=this.depth,t=this.resolution;for(let p=0;p<e;p++){let n=b[this.rtl?e-1-p:p];var d=n.length;if(d&&(r||!m[n])){var g=this.score?this.score(b,n,p,null,0):V(t,e,p),f="";switch(this.tokenize){case "full":if(2<d){for(g=0;g<d;g++)for(var h=d;h>g;h--){f=n.substring(g,h);var k=this.score?this.score(b,n,p,f,g):V(t,e,p,d,g);W(this,m,f,k,a,c)}break}case "reverse":if(1<
r,v;n<e;n++)for(k=0;k<c;k++)if(r=a[k],n<r.length&&(t=r[n]))for(l=0;l<t.length;l++)p=t[l],(h=g[p])?g[p]++:(h=0,g[p]=1),v=f[h]||(f[h]=[]),v.push(p);if(a=f.length)if(m){if(1<f.length)b:for(a=[],e=D(),m=f.length,h=m-1;0<=h;h--)for(m=f[h],g=m.length,k=0;k<g;k++){if(c=m[k],!e[c])if(e[c]=1,d)d--;else if(a.push(c),a.length===b)break b}else a=(f=f[0]).length>b||d?f.slice(d,b+d):f;f=a}else{if(a<c){e=[];break a}f=f[a-1];if(b||d)if(f.length>b||d)f=f.slice(d,b+d)}e=f}return e}; d){for(h=d-1;0<h;h--)f=n[h]+f,k=this.score?this.score(b,n,p,f,h):V(t,e,p,d,h),W(this,m,f,k,a,c);f=""}case "forward":if(1<d){for(h=0;h<d;h++)f+=n[h],W(this,m,f,g,a,c);break}default:if(W(this,m,n,g,a,c),r&&1<e&&p<e-1)for(d=D(),f=this.P,g=n,h=Math.min(r+1,e-p),d[g]=1,k=1;k<h;k++)if((n=b[this.rtl?e-1-p-k:p+k])&&!d[n]){d[n]=1;const u=this.score?this.score(b,g,p,n,k):V(f+(e/2>f?0:1),e,p,h-1,k-1),v=this.bidirectional&&n>g;W(this,l,v?g:n,u,a,c,v?n:g)}}}}this.fastupdate||this.reg.add(a)}}return this};
function X(a,b,c,e){return(a=Y(this,a,b))&&a.length?Ea(a,c,e):[]}function Fa(a,b,c,e){let d=[];if(a){e=Math.min(a.length,e);for(let g=0,f;g<e;g++)(f=a[g])&&f&&(d[g]=f);if(d.length){b.push(d);return}}return!c&&d}function Y(a,b,c){let e;c&&(e=a.bidirectional&&b>c);a=c?(a=a.ctx.get(e?b:c))&&a.get(e?c:b):a.map.get(b);return a};U.prototype.remove=function(a,b){const c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(let e=0,d;e<c.length;e++){if(d=c[e])if(2>d.length)d.pop();else{const g=d.indexOf(a);g===c.length-1?d.pop():d.splice(g,1)}}else Ga(this.map,a),this.depth&&Ga(this.ctx,a);b||this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; function W(a,b,c,e,d,g,f){let h=f?a.ctx:a.map,k;if(!b[c]||f&&!(k=b[c])[f])f?(b=k||(b[c]=D()),b[f]=1,(k=h.get(f))?h=k:h.set(f,h=new Map)):b[c]=1,(k=h.get(c))?h=k:h.set(c,h=[]),h=h[e]||(h[e]=[]),g&&h.includes(d)||(h.push(d),a.fastupdate&&((b=a.reg.get(d))?b.push(h):a.reg.set(d,[h])))}function V(a,b,c,e,d){return c&&1<a?b+(e||0)<=a?c+(d||0):(a-1)/(b+(e||0))*(c+(d||0))+1|0:0};function Fa(a,b,c){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a;let e=[];for(let d=0,g,f;d<a.length;d++)if((g=a[d])&&(f=g.length)){if(c){if(c>=f){c-=f;continue}c<f&&(g=b?g.slice(c,c+b):g.slice(c),f=g.length,c=0)}if(e.length)f>b&&(g=g.slice(0,b),f=g.length),e.push(g);else{if(f>=b)return f>b&&(g=g.slice(0,b)),g;e=[g]}b-=f;if(!b)break}return e.length?e=1<e.length?[].concat.apply([],e):e[0]:e};U.prototype.search=function(a,b,c){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));var e=[],d=0;if(c){a=c.query||a;b=c.limit||b;d=c.offset||0;var g=c.context;var f=c.suggest;var h=!0;var k=c.resolution}else h=!0;var l=this.encoder.encode(a);c=l.length;b||!h||(b=100);if(1===c)return X.call(this,l[0],"",b,d);g=this.depth&&!1!==g;if(2===c&&g&&!f)return X.call(this,l[0],l[1],b,d);let m=h=0;if(1<c){const t=D(),p=[];for(let n=0,u;n<c;n++)if((u=l[n])&&!t[u]){if(f||Y(this,u))p.push(u),t[u]=1;else return e;const v=
function Ga(a,b){let c=0;if(a.constructor===Array)for(let e=0,d,g;e<a.length;e++){if((d=a[e])&&d.length)if(g=d.indexOf(b),0<=g){1<d.length?(d.splice(g,1),c++):delete a[e];break}else c++}else for(let e of a){const d=e[0],g=Ga(e[1],b);g?c+=g:a.delete(d)}return c};function U(a,b){if(!this||this.constructor!==U)return new U(a);if(a){var c=E(a)?a:a.preset;c&&(a=Object.assign({},Da[c],a))}else a={};c=a.context||{};const e=E(a.encoder)?Ca[a.encoder]:a.encode||a.encoder||ua;this.encoder=e.encode?e:"object"===typeof e?new K(e):{encode:e};let d;this.resolution=a.resolution||9;this.tokenize=d=a.tokenize||"strict";this.depth="strict"===d&&c.depth||0;this.bidirectional=!1!==c.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;d=!1;this.map=new Map; u.length;h=Math.max(h,v);m=m?Math.min(m,v):v}l=p;c=a.length}if(!c)return e;a=0;if(1===c)return X.call(this,l[0],"",b,d);if(2===c&&g&&!f)return X.call(this,l[0],l[1],b,d);if(1<c)if(g){var r=l[0];a=1}else 9<h&&3<h/m&&l.sort(aa);k||0===k||(k=this.resolution);for(let t,p;a<c;a++){p=l[a];r?(t=Y(this,p,r),t=Ga(t,e,f,this.P),f&&!1===t&&e.length||(r=p)):(t=Y(this,p,""),t=Ga(t,e,f,k));if(t)return t;if(f&&a===c-1){g=e.length;if(!g){if(r){r="";a=-1;continue}return e}if(1===g)return Fa(e[0],b,d)}}a:{r=f;c=e.length;
this.ctx=new Map;this.reg=b||(this.fastupdate?new Map:new Set);this.P=c.resolution||1;this.rtl=e.rtl||a.rtl||!1;this.cache=(d=a.cache||null)&&new T(d)}x=U.prototype;x.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};x.append=function(a,b){return this.add(a,b,!0)};x.contain=function(a){return this.reg.has(a)};x.update=function(a,b){const c=this,e=this.remove(a);return e&&e.then?e.then(()=>c.add(a,b)):this.add(a,b)}; f=[];g=D();for(let t=0,p,n,u,v;t<k;t++)for(a=0;a<c;a++)if(u=e[a],t<u.length&&(p=u[t]))for(h=0;h<p.length;h++)n=p[h],(l=g[n])?g[n]++:(l=0,g[n]=1),v=f[l]||(f[l]=[]),v.push(n);if(k=f.length)if(r){if(1<f.length)b:for(k=[],e=D(),r=f.length,l=r-1;0<=l;l--)for(r=f[l],g=r.length,a=0;a<g;a++){if(c=r[a],!e[c])if(e[c]=1,d)d--;else if(k.push(c),k.length===b)break b}else k=(f=f[0]).length>b||d?f.slice(d,b+d):f;f=k}else{if(k<c){e=[];break a}f=f[k-1];if(b||d)if(f.length>b||d)f=f.slice(d,b+d)}e=f}return e};
function Ha(a){let b=0;if(a.constructor===Array)for(let c=0,e;c<a.length;c++)(e=a[c])&&(b+=e.length);else for(const c of a){const e=c[0],d=Ha(c[1]);d?b+=d:a.delete(e)}return b}x.cleanup=function(){if(!this.fastupdate)return this;Ha(this.map);this.depth&&Ha(this.ctx);return this};x.searchCache=ta; function X(a,b,c,e){return(a=Y(this,a,b))&&a.length?Fa(a,c,e):[]}function Ga(a,b,c,e){let d=[];if(a){e=Math.min(a.length,e);for(let g=0,f;g<e;g++)(f=a[g])&&f&&(d[g]=f);if(d.length){b.push(d);return}}return!c&&d}function Y(a,b,c){let e;c&&(e=a.bidirectional&&b>c);a=c?(a=a.ctx.get(e?b:c))&&a.get(e?c:b):a.map.get(b);return a};U.prototype.remove=function(a,b){const c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(let e=0,d;e<c.length;e++){if(d=c[e])if(2>d.length)d.pop();else{const g=d.indexOf(a);g===c.length-1?d.pop():d.splice(g,1)}}else Ha(this.map,a),this.depth&&Ha(this.ctx,a);b||this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
x.export=function(a,b,c,e=0){let d,g;switch(e){case 0:d="reg";g=la(this.reg);break;case 1:d="cfg";g={};break;case 2:d="map";g=N(this.map,this.reg.size);break;case 3:d="ctx";g=ja(this.ctx,this.reg.size);break;default:return}return P.call(this,a,b,d,g,c,e)}; function Ha(a,b){let c=0;if(a.constructor===Array)for(let e=0,d,g;e<a.length;e++){if((d=a[e])&&d.length)if(g=d.indexOf(b),0<=g){1<d.length?(d.splice(g,1),c++):delete a[e];break}else c++}else for(let e of a){const d=e[0],g=Ha(e[1],b);g?c+=g:a.delete(d)}return c};function U(a,b){if(!this||this.constructor!==U)return new U(a);if(a){var c=E(a)?a:a.preset;c&&(a=Object.assign({},Ea[c],a))}else a={};c=a.context;const e=!0===c?{depth:1}:c||{},d=E(a.encoder)?Da[a.encoder]:a.encode||a.encoder||va;this.encoder=d.encode?d:"object"===typeof d?new L(d):{encode:d};this.resolution=a.resolution||9;this.tokenize=c=a.tokenize||"strict";this.depth="strict"===c&&e.depth||0;this.bidirectional=!1!==e.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;c=!1;this.map=
x.import=function(a,b){if(b)switch(E(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=ma(b,this.reg);break;case "map":this.map=O(b,this.map);break;case "ctx":this.ctx=ka(b,this.ctx)}}; new Map;this.ctx=new Map;this.reg=b||(this.fastupdate?new Map:new Set);this.P=e.resolution||3;this.rtl=d.rtl||a.rtl||!1;this.cache=(c=a.cache||null)&&new T(c)}w=U.prototype;w.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};w.append=function(a,b){return this.add(a,b,!0)};w.contain=function(a){return this.reg.has(a)};w.update=function(a,b){const c=this,e=this.remove(a);return e&&e.then?e.then(()=>c.add(a,b)):this.add(a,b)};
x.serialize=function(a=!0){if(!this.reg.size)return"";let b="",c="";for(var e of this.reg.keys())c||(c=typeof e),b+=(b?",":"")+("string"===c?'"'+e+'"':e);b="index.reg=new Set(["+b+"]);";e="";for(var d of this.map.entries()){var g=d[0],f=d[1],h="";for(let m=0,n;m<f.length;m++){n=f[m]||[""];var k="";for(var l=0;l<n.length;l++)k+=(k?",":"")+("string"===c?'"'+n[l]+'"':n[l]);k="["+k+"]";h+=(h?",":"")+k}h='["'+g+'",['+h+"]]";e+=(e?",":"")+h}e="index.map=new Map(["+e+"]);";d="";for(const m of this.ctx.entries()){g= function Ia(a){let b=0;if(a.constructor===Array)for(let c=0,e;c<a.length;c++)(e=a[c])&&(b+=e.length);else for(const c of a){const e=c[0],d=Ia(c[1]);d?b+=d:a.delete(e)}return b}w.cleanup=function(){if(!this.fastupdate)return this;Ia(this.map);this.depth&&Ia(this.ctx);return this};w.searchCache=ua;
m[0];f=m[1];for(const n of f.entries()){f=n[0];h=n[1];k="";for(let t=0,p;t<h.length;t++){p=h[t]||[""];l="";for(let r=0;r<p.length;r++)l+=(l?",":"")+("string"===c?'"'+p[r]+'"':p[r]);l="["+l+"]";k+=(k?",":"")+l}k='new Map([["'+f+'",['+k+"]]])";k='["'+g+'",'+k+"]";d+=(d?",":"")+k}}d="index.ctx=new Map(["+d+"]);";return a?"function inject(index){"+b+e+d+"}":b+e+d};ia(U.prototype);const Ia={Index:U,Charset:Ca,Encoder:K,Document:Q,Worker:null,Resolver:null,IndexedDB:null,Language:{}},Z=self;let Ja;(Ja=Z.define)&&Ja.amd?Ja([],function(){return Ia}):"object"===typeof Z.exports?Z.exports=Ia:Z.FlexSearch=Ia;}(this||self)); w.export=function(a,b,c,e=0){let d,g;switch(e){case 0:d="reg";g=la(this.reg);break;case 1:d="cfg";g={};break;case 2:d="map";g=O(this.map,this.reg.size);break;case 3:d="ctx";g=ja(this.ctx,this.reg.size);break;default:return}return Q.call(this,a,b,d,g,c,e)};
w.import=function(a,b){if(b)switch(E(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=ma(b,this.reg);break;case "map":this.map=P(b,this.map);break;case "ctx":this.ctx=ka(b,this.ctx)}};
w.serialize=function(a=!0){if(!this.reg.size)return"";let b="",c="";for(var e of this.reg.keys())c||(c=typeof e),b+=(b?",":"")+("string"===c?'"'+e+'"':e);b="index.reg=new Set(["+b+"]);";e="";for(var d of this.map.entries()){var g=d[0],f=d[1],h="";for(let m=0,r;m<f.length;m++){r=f[m]||[""];var k="";for(var l=0;l<r.length;l++)k+=(k?",":"")+("string"===c?'"'+r[l]+'"':r[l]);k="["+k+"]";h+=(h?",":"")+k}h='["'+g+'",['+h+"]]";e+=(e?",":"")+h}e="index.map=new Map(["+e+"]);";d="";for(const m of this.ctx.entries()){g=
m[0];f=m[1];for(const r of f.entries()){f=r[0];h=r[1];k="";for(let t=0,p;t<h.length;t++){p=h[t]||[""];l="";for(let n=0;n<p.length;n++)l+=(l?",":"")+("string"===c?'"'+p[n]+'"':p[n]);l="["+l+"]";k+=(k?",":"")+l}k='new Map([["'+f+'",['+k+"]]])";k='["'+g+'",'+k+"]";d+=(d?",":"")+k}}d="index.ctx=new Map(["+d+"]);";return a?"function inject(index){"+b+e+d+"}":b+e+d};ia(U.prototype);const Ja={Index:U,Charset:Da,Encoder:L,Document:R,Worker:null,Resolver:null,IndexedDB:null,Language:{}},Z=self;let Ka;(Ka=Z.define)&&Ka.amd?Ka([],function(){return Ja}):"object"===typeof Z.exports?Z.exports=Ja:Z.FlexSearch=Ja;}(this||self));

File diff suppressed because it is too large Load Diff

View File

@@ -5,51 +5,54 @@
* Hosted by Nextapps GmbH * Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
var x;function B(a,b,c){const e=typeof c,d=typeof a;if("undefined"!==e){if("undefined"!==d){if(c){if("function"===d&&e===d)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var g=new Map(c);for(var f of a)g.set(f[0],f[1]);return g}if(b===Set){f=new Set(c);for(g of a.values())f.add(g);return f}}}return a}return c}return"undefined"===d?b:a}function D(){return Object.create(null)}function aa(a,b){return b.length-a.length} var w;function B(a,b,c){const e=typeof c,d=typeof a;if("undefined"!==e){if("undefined"!==d){if(c){if("function"===d&&e===d)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var g=new Map(c);for(var f of a)g.set(f[0],f[1]);return g}if(b===Set){f=new Set(c);for(g of a.values())f.add(g);return f}}}return a}return c}return"undefined"===d?b:a}function D(){return Object.create(null)}function aa(a,b){return b.length-a.length}
function E(a){return"string"===typeof a}function G(a){return"object"===typeof a}function I(a,b){if(E(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a};var ba=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb", function E(a){return"string"===typeof a}function G(a){return"object"===typeof a}function I(a,b){if(E(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a};var ba=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb",
"u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"], "u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"],
["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0", ["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0",
"i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215", "i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215",
"u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af", "u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af",
"\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"], "\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"],
["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const ca=/[^\p{L}\p{N}]+/u,da=/(\d{3})/g,ea=/(\D)(\d{3})/g,fa=/(\d{3})(\D)/g,J="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])} ["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const ca=/[^\p{L}\p{N}]+/u,da=/(\d{3})/g,ea=/(\D)(\d{3})/g,fa=/(\d{3})(\D)/g,J="".normalize&&/[\u0300-\u036f]/g;function L(a){if(!this||this.constructor!==L)return new L(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])}w=L.prototype;
K.prototype.assign=function(a){this.normalize=B(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let e=!b,d="";a.include||(d+="\\p{Z}");c.letter&&(d+="\\p{L}");c.number&&(d+="\\p{N}",e=!!b);c.symbol&&(d+="\\p{S}");c.punctuation&&(d+="\\p{P}");c.control&&(d+="\\p{C}");if(c=c.char)d+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+d+"]+","u")}catch(g){this.split=/\s+/}this.numeric=e}else{try{this.split=B(c,ca,this.split)}catch(e){this.split= w.assign=function(a){this.normalize=B(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let e=!b,d="";a.include||(d+="\\p{Z}");c.letter&&(d+="\\p{L}");c.number&&(d+="\\p{N}",e=!!b);c.symbol&&(d+="\\p{S}");c.punctuation&&(d+="\\p{P}");c.control&&(d+="\\p{C}");if(c=c.char)d+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+d+"]+","u")}catch(g){this.split=/\s+/}this.numeric=e}else{try{this.split=B(c,ca,this.split)}catch(e){this.split=
/\s+/}this.numeric=B(this.numeric,!0)}this.prepare=B(a.prepare,null,this.prepare);this.finalize=B(a.finalize,null,this.finalize);J||(this.mapper=new Map(ba));this.rtl=a.rtl||!1;this.dedupe=B(a.dedupe,!0,this.dedupe);this.filter=B((c=a.filter)&&new Set(c),null,this.filter);this.matcher=B((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=B((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=B((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=B(a.replacer,null,this.replacer);this.minlength= /\s+/}this.numeric=B(this.numeric,!0)}this.prepare=B(a.prepare,null,this.prepare);this.finalize=B(a.finalize,null,this.finalize);J||(this.mapper=new Map(ba));this.rtl=a.rtl||!1;this.dedupe=B(a.dedupe,!0,this.dedupe);this.filter=B((c=a.filter)&&new Set(c),null,this.filter);this.matcher=B((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=B((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=B((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=B(a.replacer,null,this.replacer);this.minlength=
B(a.minlength,1,this.minlength);this.maxlength=B(a.maxlength,0,this.maxlength);if(this.cache=c=B(a.cache,!0,this.cache))this.I=null,this.O="number"===typeof c?c:2E5,this.D=new Map,this.G=new Map,this.J=this.A=128;this.K="";this.M=null;this.L="";this.N=null;if(this.matcher)for(const e of this.matcher.keys())this.K+=(this.K?"|":"")+e;if(this.stemmer)for(const e of this.stemmer.keys())this.L+=(this.L?"|":"")+e;return this}; B(a.minlength,1,this.minlength);this.maxlength=B(a.maxlength,0,this.maxlength);if(this.cache=c=B(a.cache,!0,this.cache))this.J=null,this.O="number"===typeof c?c:2E5,this.F=new Map,this.G=new Map,this.L=this.K=128;this.h="";this.M=null;this.D="";this.N=null;if(this.matcher)for(const e of this.matcher.keys())this.h+=(this.h?"|":"")+e;if(this.stemmer)for(const e of this.stemmer.keys())this.D+=(this.D?"|":"")+e;return this};
K.prototype.encode=function(a){if(this.cache&&a.length<=this.A)if(this.I){if(this.D.has(a))return this.D.get(a)}else this.I=setTimeout(ha,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):J?a.normalize("NFKD").replace(J,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(ea,"$1 $2").replace(fa,"$1 $2").replace(da,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer); w.addMatcher=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(2>a.length)return this.addMapper(a,b);this.matcher||(this.matcher=new Map);this.matcher.set(a,b);this.h+=(this.h?"|":"")+a;this.M=null;this.cache&&M(this);return this};w.addStemmer=function(a,b){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,b);this.D+=(this.D?"|":"")+a;this.N=null;this.cache&&M(this);return this};
let c=[],e=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,h;g<e.length;g++){if(!(f=h=e[g]))continue;if(f.length<this.minlength)continue;if(b){c.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.J)if(this.I){var d=this.G.get(f);if(d||""===d){d&&c.push(d);continue}}else this.I=setTimeout(ha,50,this);let k;this.stemmer&&2<f.length&&(this.N||(this.N=new RegExp("(?!^)("+this.L+")$")),f=f.replace(this.N,l=>this.stemmer.get(l)),k=1);f&&k&&(f.length< w.addFilter=function(a){this.filter||(this.filter=new Set);this.filter.add(a);this.cache&&M(this);return this};w.addMapper=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(1<a.length)return this.addMatcher(a,b);this.mapper||(this.mapper=new Map);this.mapper.set(a,b);this.cache&&M(this);return this};w.addReplacer=function(a,b){"string"===typeof a&&(a=new RegExp(a,"g"));this.replacer||(this.replacer=[]);this.replacer.push(a,b||"");this.cache&&M(this);return this};
this.minlength||this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){d="";for(let l=0,m="",n,t;l<f.length;l++)n=f.charAt(l),n===m&&this.dedupe||((t=this.mapper&&this.mapper.get(n))||""===t?t===m&&this.dedupe||!(m=t)||(d+=t):d+=m=n);f=d}this.matcher&&1<f.length&&(this.M||(this.M=new RegExp("("+this.K+")","g")),f=f.replace(this.M,l=>this.matcher.get(l)));if(f&&this.replacer)for(d=0;f&&d<this.replacer.length;d+=2)f=f.replace(this.replacer[d],this.replacer[d+1]);this.cache&& function M(a){a.F.clear();a.G.clear()}
h.length<=this.J&&(this.G.set(h,f),this.G.size>this.O&&(this.G.clear(),this.J=this.J/1.1|0));f&&c.push(f)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.A&&(this.D.set(a,c),this.D.size>this.O&&(this.D.clear(),this.A=this.A/1.1|0));return c};function ha(a){a.I=null;a.D.clear();a.G.clear()};function ia(a){M.call(a,"add");M.call(a,"append");M.call(a,"search");M.call(a,"update");M.call(a,"remove")}function M(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let e;"function"===typeof c&&(e=c,delete b[b.length-1]);b=this[a].apply(this,b);e&&(b.then?b.then(e):e(b));return b}};function N(a,b=0){let c=[],e=[];b&&(b=25E4/b*5E3|0);for(const d of a.entries())e.push(d),e.length===b&&(c.push(e),e=[]);e.length&&c.push(e);return c}function O(a,b){b||(b=new Map);for(let c=0,e;c<a.length;c++)e=a[c],b.set(e[0],e[1]);return b}function ja(a,b=0){let c=[],e=[];b&&(b=25E4/b*1E3|0);for(const d of a.entries())e.push([d[0],N(d[1])[0]]),e.length===b&&(c.push(e),e=[]);e.length&&c.push(e);return c} w.encode=function(a){if(this.cache&&a.length<=this.K)if(this.J){if(this.F.has(a))return this.F.get(a)}else this.J=setTimeout(ha,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):J?a.normalize("NFKD").replace(J,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(ea,"$1 $2").replace(fa,"$1 $2").replace(da,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let c=[],
function ka(a,b){b||(b=new Map);for(let c=0,e,d;c<a.length;c++)e=a[c],d=b.get(e[0]),b.set(e[0],O(e[1],d));return b}function la(a){let b=[],c=[];for(const e of a.keys())c.push(e),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}function ma(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b} e=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,h;g<e.length;g++){if(!(f=h=e[g]))continue;if(f.length<this.minlength)continue;if(b){c.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.L)if(this.J){var d=this.G.get(f);if(d||""===d){d&&c.push(d);continue}}else this.J=setTimeout(ha,50,this);let k;this.stemmer&&2<f.length&&(this.N||(this.N=new RegExp("(?!^)("+this.D+")$")),f=f.replace(this.N,l=>this.stemmer.get(l)),k=1);f&&k&&(f.length<this.minlength||
function P(a,b,c,e,d,g,f=0){const h=e&&e.constructor===Array;var k=h?e.shift():e;if(!k)return this.export(a,b,d,g+1);if((k=a((b?b+".":"")+(f+1)+"."+c,JSON.stringify(k)))&&k.then){const l=this;return k.then(function(){return P.call(l,a,b,c,h?e:null,d,g,f+1)})}return P.call(this,a,b,c,h?e:null,d,g,f+1)};Q.prototype.add=function(a,b,c){G(a)&&(b=a,a=I(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(let h=0,k;h<this.field.length;h++){k=this.C[h];var e=this.index.get(this.field[h]);if("function"===typeof k){var d=k(b);d&&e.add(a,d,!1,!0)}else if(d=k.F,!d||d(b))k.constructor===String?k=[""+k]:E(k)&&(k=[k]),R(b,k,this.H,0,e,a,k[0],c)}if(this.tag)for(e=0;e<this.B.length;e++){var g=this.B[e];d=this.tag.get(this.R[e]);let h=D();if("function"===typeof g){if(g=g(b),!g)continue}else{var f= this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){d="";for(let l=0,m="",r,t;l<f.length;l++)r=f.charAt(l),r===m&&this.dedupe||((t=this.mapper&&this.mapper.get(r))||""===t?t===m&&this.dedupe||!(m=t)||(d+=t):d+=m=r);f=d}this.matcher&&1<f.length&&(this.M||(this.M=new RegExp("("+this.h+")","g")),f=f.replace(this.M,l=>this.matcher.get(l)));if(f&&this.replacer)for(d=0;f&&d<this.replacer.length;d+=2)f=f.replace(this.replacer[d],this.replacer[d+1]);this.cache&&h.length<=
g.F;if(f&&!f(b))continue;g.constructor===String&&(g=""+g);g=I(b,g)}if(d&&g){E(g)&&(g=[g]);for(let k=0,l,m;k<g.length;k++)l=g[k],h[l]||(h[l]=1,(f=d.get(l))?m=f:d.set(l,m=[]),c&&m.includes(a)||(m.push(a),this.fastupdate&&((f=this.reg.get(a))?f.push(m):this.reg.set(a,[m]))))}}if(this.store&&(!c||!this.store.has(a))){let h;if(this.h){h=D();for(let k=0,l;k<this.h.length;k++){l=this.h[k];if((c=l.F)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.S]}else if(E(l)||l.constructor=== this.L&&(this.G.set(h,f),this.G.size>this.O&&(this.G.clear(),this.L=this.L/1.1|0));f&&c.push(f)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.K&&(this.F.set(a,c),this.F.size>this.O&&(this.F.clear(),this.K=this.K/1.1|0));return c};function ha(a){a.J=null;a.F.clear();a.G.clear()};function ia(a){N.call(a,"add");N.call(a,"append");N.call(a,"search");N.call(a,"update");N.call(a,"remove")}function N(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let e;"function"===typeof c&&(e=c,delete b[b.length-1]);b=this[a].apply(this,b);e&&(b.then?b.then(e):e(b));return b}};function O(a,b=0){let c=[],e=[];b&&(b=25E4/b*5E3|0);for(const d of a.entries())e.push(d),e.length===b&&(c.push(e),e=[]);e.length&&c.push(e);return c}function P(a,b){b||(b=new Map);for(let c=0,e;c<a.length;c++)e=a[c],b.set(e[0],e[1]);return b}function ja(a,b=0){let c=[],e=[];b&&(b=25E4/b*1E3|0);for(const d of a.entries())e.push([d[0],O(d[1])[0]]),e.length===b&&(c.push(e),e=[]);e.length&&c.push(e);return c}
String){h[l]=b[l];continue}S(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function S(a,b,c,e,d,g){a=a[d];if(e===c.length-1)b[d]=g||a;else if(a)if(a.constructor===Array)for(b=b[d]=Array(a.length),d=0;d<a.length;d++)S(a,b,c,e,d);else b=b[d]||(b[d]=D()),d=c[++e],S(a,b,c,e,d)} function ka(a,b){b||(b=new Map);for(let c=0,e,d;c<a.length;c++)e=a[c],d=b.get(e[0]),b.set(e[0],P(e[1],d));return b}function la(a){let b=[],c=[];for(const e of a.keys())c.push(e),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}function ma(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b}
function R(a,b,c,e,d,g,f,h){if(a=a[f])if(e===b.length-1){if(a.constructor===Array){if(c[e]){for(b=0;b<a.length;b++)d.add(g,a[b],!0,!0);return}a=a.join(" ")}d.add(g,a,h,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)R(a,b,c,e,d,g,f,h);else f=b[++e],R(a,b,c,e,d,g,f,h)};function na(a,b){const c=D(),e=[];for(let d=0,g;d<b.length;d++){g=b[d];for(let f=0;f<g.length;f++)c[g[f]]=1}for(let d=0,g;d<a.length;d++)g=a[d],1===c[g]&&(e.push(g),c[g]=2);return e};Q.prototype.search=function(a,b,c,e){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let d=[];var g=[];let f,h,k,l,m,n,t=0,p;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;var r=c.pluck;h=c.merge;l=r||c.field||c.index;m=this.tag&&c.tag;f=this.store&&c.enrich;k=c.suggest;p=c.highlight;b=c.limit||b;n=c.offset||0;b||(b=100);if(m){m.constructor!==Array&&(m=[m]);var v=[];for(let w=0,q;w<m.length;w++)if(q=m[w],q.field&&q.tag){var u=q.tag;if(u.constructor===Array)for(var y=0;y<u.length;y++)v.push(q.field, function Q(a,b,c,e,d,g,f=0){const h=e&&e.constructor===Array;var k=h?e.shift():e;if(!k)return this.export(a,b,d,g+1);if((k=a((b?b+".":"")+(f+1)+"."+c,JSON.stringify(k)))&&k.then){const l=this;return k.then(function(){return Q.call(l,a,b,c,h?e:null,d,g,f+1)})}return Q.call(this,a,b,c,h?e:null,d,g,f+1)};R.prototype.add=function(a,b,c){G(a)&&(b=a,a=I(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(let h=0,k;h<this.field.length;h++){k=this.C[h];var e=this.index.get(this.field[h]);if("function"===typeof k){var d=k(b);d&&e.add(a,d,!1,!0)}else if(d=k.H,!d||d(b))k.constructor===String?k=[""+k]:E(k)&&(k=[k]),S(b,k,this.I,0,e,a,k[0],c)}if(this.tag)for(e=0;e<this.B.length;e++){var g=this.B[e];d=this.tag.get(this.R[e]);let h=D();if("function"===typeof g){if(g=g(b),!g)continue}else{var f=
u[y]);else v.push(q.field,u)}else{u=Object.keys(q);for(let C=0,A,z;C<u.length;C++)if(A=u[C],z=q[A],z.constructor===Array)for(y=0;y<z.length;y++)v.push(A,z[y]);else v.push(A,z)}m=v;if(!a){e=[];if(v.length)for(g=0;g<v.length;g+=2)r=oa.call(this,v[g],v[g+1],b,n,f),d.push({field:v[g],tag:v[g+1],result:r});return e.length?Promise.all(e).then(function(w){for(let q=0;q<w.length;q++)d[q].result=w[q];return d}):d}}E(l)&&(l=[l])}l||(l=this.field);v=!e&&(this.worker||this.db)&&[];for(let w=0,q,C,A;w<l.length;w++){C= g.H;if(f&&!f(b))continue;g.constructor===String&&(g=""+g);g=I(b,g)}if(d&&g){E(g)&&(g=[g]);for(let k=0,l,m;k<g.length;k++)l=g[k],h[l]||(h[l]=1,(f=d.get(l))?m=f:d.set(l,m=[]),c&&m.includes(a)||(m.push(a),this.fastupdate&&((f=this.reg.get(a))?f.push(m):this.reg.set(a,[m]))))}}if(this.store&&(!c||!this.store.has(a))){let h;if(this.A){h=D();for(let k=0,l;k<this.A.length;k++){l=this.A[k];if((c=l.H)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.S]}else if(E(l)||l.constructor===
l[w];let z;E(C)||(z=C,C=z.field,a=z.query||a,b=z.limit||b,n=z.offset||n,k=z.suggest||k,f=this.store&&(z.enrich||f));if(e)q=e[w];else if(u=z||c,y=this.index.get(C),m&&(u.enrich=!1),v){v[w]=y.search(a,b,u);u&&f&&(u.enrich=f);continue}else q=y.search(a,b,u),u&&f&&(u.enrich=f);A=q&&q.length;if(m&&A){u=[];y=0;for(let H=0,F,L;H<m.length;H+=2){F=this.tag.get(m[H]);if(!F)if(k)continue;else return d;if(L=(F=F&&F.get(m[H+1]))&&F.length)y++,u.push(F);else if(!k)return d}if(y){q=na(q,u);A=q.length;if(!A&&!k)return d; String){h[l]=b[l];continue}na(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function na(a,b,c,e,d,g){a=a[d];if(e===c.length-1)b[d]=g||a;else if(a)if(a.constructor===Array)for(b=b[d]=Array(a.length),d=0;d<a.length;d++)na(a,b,c,e,d);else b=b[d]||(b[d]=D()),d=c[++e],na(a,b,c,e,d)}
y--}}if(A)g[t]=C,d.push(q),t++;else if(1===l.length)return d}if(v){const w=this;return Promise.all(v).then(function(q){return q.length?w.search(a,b,c,q):q})}if(!t)return d;if(r&&(!f||!this.store))return d[0];v=[];for(let w=0,q;w<g.length;w++){q=d[w];f&&q.length&&!q[0].doc&&q.length&&(q=pa.call(this,q));if(r)return q;d[w]={field:g[w],result:q}}return h?qa(d,b):p?ra(d,a,this.index,this.field,this.C,p):d}; function S(a,b,c,e,d,g,f,h){if(a=a[f])if(e===b.length-1){if(a.constructor===Array){if(c[e]){for(b=0;b<a.length;b++)d.add(g,a[b],!0,!0);return}a=a.join(" ")}d.add(g,a,h,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)S(a,b,c,e,d,g,f,h);else f=b[++e],S(a,b,c,e,d,g,f,h)};function oa(a,b){const c=D(),e=[];for(let d=0,g;d<b.length;d++){g=b[d];for(let f=0;f<g.length;f++)c[g[f]]=1}for(let d=0,g;d<a.length;d++)g=a[d],1===c[g]&&(e.push(g),c[g]=2);return e};R.prototype.search=function(a,b,c,e){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));let d=[];var g=[];let f,h,k,l,m,r,t=0,p;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;var n=c.pluck;h=c.merge;l=n||c.field||c.index;m=this.tag&&c.tag;f=this.store&&c.enrich;k=c.suggest;p=c.highlight;b=c.limit||b;r=c.offset||0;b||(b=100);if(m){m.constructor!==Array&&(m=[m]);var u=[];for(let x=0,q;x<m.length;x++)if(q=m[x],q.field&&q.tag){var v=q.tag;if(v.constructor===Array)for(var y=0;y<v.length;y++)u.push(q.field,
function ra(a,b,c,e,d,g){let f,h,k;for(let m=0,n,t,p,r,v;m<a.length;m++){n=a[m].result;t=a[m].field;r=c.get(t);p=r.encoder;k=r.tokenize;v=d[e.indexOf(t)];p!==f&&(f=p,h=f.encode(b));for(let u=0;u<n.length;u++){let y="";var l=I(n[u].doc,v);let w=f.encode(l);l=l.split(f.split);for(let q=0,C,A;q<w.length;q++){C=w[q];A=l[q];let z;for(let H=0,F;H<h.length;H++)if(F=h[H],"strict"===k){if(C===F){y+=(y?" ":"")+g.replace("$1",A);z=!0;break}}else{const L=C.indexOf(F);if(-1<L){y+=(y?" ":"")+A.substring(0,L)+g.replace("$1", v[y]);else u.push(q.field,v)}else{v=Object.keys(q);for(let C=0,A,z;C<v.length;C++)if(A=v[C],z=q[A],z.constructor===Array)for(y=0;y<z.length;y++)u.push(A,z[y]);else u.push(A,z)}m=u;if(!a){e=[];if(u.length)for(g=0;g<u.length;g+=2)n=pa.call(this,u[g],u[g+1],b,r,f),d.push({field:u[g],tag:u[g+1],result:n});return e.length?Promise.all(e).then(function(x){for(let q=0;q<x.length;q++)d[q].result=x[q];return d}):d}}E(l)&&(l=[l])}l||(l=this.field);u=!e&&(this.worker||this.db)&&[];for(let x=0,q,C,A;x<l.length;x++){C=
A.substring(L,F.length))+A.substring(L+F.length);z=!0;break}}z||(y+=(y?" ":"")+l[q])}n[u].highlight=y}}return a}function qa(a,b){const c=[],e=D();for(let d=0,g,f;d<a.length;d++){g=a[d];f=g.result;for(let h=0,k,l,m;h<f.length;h++)if(l=f[h],k=l.id,m=e[k])m.push(g.field);else{if(c.length===b)return c;l.field=e[k]=[g.field];c.push(l)}}return c}function oa(a,b,c,e,d){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-e)&&0<b){if(b>c||e)a=a.slice(e,e+c);d&&(a=pa.call(this,a));return a}} l[x];let z;E(C)||(z=C,C=z.field,a=z.query||a,b=z.limit||b,r=z.offset||r,k=z.suggest||k,f=this.store&&(z.enrich||f));if(e)q=e[x];else if(v=z||c,y=this.index.get(C),m&&(v.enrich=!1),u){u[x]=y.search(a,b,v);v&&f&&(v.enrich=f);continue}else q=y.search(a,b,v),v&&f&&(v.enrich=f);A=q&&q.length;if(m&&A){v=[];y=0;for(let H=0,F,K;H<m.length;H+=2){F=this.tag.get(m[H]);if(!F)if(k)continue;else return d;if(K=(F=F&&F.get(m[H+1]))&&F.length)y++,v.push(F);else if(!k)return d}if(y){q=oa(q,v);A=q.length;if(!A&&!k)return d;
function pa(a){const b=Array(a.length);for(let c=0,e;c<a.length;c++)e=a[c],b[c]={id:e,doc:this.store.get(e)};return b};function Q(a){if(!this||this.constructor!==Q)return new Q(a);const b=a.document||a.doc||a;var c;this.C=[];this.field=[];this.H=[];this.key=(c=b.key||b.id)&&T(c,this.H)||"id";this.reg=(this.fastupdate=!!a.fastupdate)?new Map:new Set;this.h=(c=b.store||null)&&!0!==c&&[];this.store=c&&new Map;this.cache=(c=a.cache||null)&&new U(c);a.cache=!1;c=new Map;let e=b.index||b.field||b;E(e)&&(e=[e]);for(let d=0,g,f;d<e.length;d++)g=e[d],E(g)||(f=g,g=g.field),f=G(f)?Object.assign({},a,f):a,c.set(g,new V(f,this.reg)), y--}}if(A)g[t]=C,d.push(q),t++;else if(1===l.length)return d}if(u){const x=this;return Promise.all(u).then(function(q){return q.length?x.search(a,b,c,q):q})}if(!t)return d;if(n&&(!f||!this.store))return d[0];u=[];for(let x=0,q;x<g.length;x++){q=d[x];f&&q.length&&!q[0].doc&&q.length&&(q=qa.call(this,q));if(n)return q;d[x]={field:g[x],result:q}}return h?ra(d,b):p?sa(d,a,this.index,this.field,this.C,p):d};
f.custom?this.C[d]=f.custom:(this.C[d]=T(g,this.H),f.filter&&("string"===typeof this.C[d]&&(this.C[d]=new String(this.C[d])),this.C[d].F=f.filter)),this.field[d]=g;if(this.h){a=b.store;E(a)&&(a=[a]);for(let d=0,g,f;d<a.length;d++)g=a[d],f=g.field||g,g.custom?(this.h[d]=g.custom,g.custom.S=f):(this.h[d]=T(f,this.H),g.filter&&("string"===typeof this.h[d]&&(this.h[d]=new String(this.h[d])),this.h[d].F=g.filter))}this.index=c;this.tag=null;if(c=b.tag)if("string"===typeof c&&(c=[c]),c.length){this.tag= function sa(a,b,c,e,d,g){let f,h,k;for(let m=0,r,t,p,n,u;m<a.length;m++){r=a[m].result;t=a[m].field;n=c.get(t);p=n.encoder;k=n.tokenize;u=d[e.indexOf(t)];p!==f&&(f=p,h=f.encode(b));for(let v=0;v<r.length;v++){let y="";var l=I(r[v].doc,u);let x=f.encode(l);l=l.split(f.split);for(let q=0,C,A;q<x.length;q++){C=x[q];A=l[q];let z;for(let H=0,F;H<h.length;H++)if(F=h[H],"strict"===k){if(C===F){y+=(y?" ":"")+g.replace("$1",A);z=!0;break}}else{const K=C.indexOf(F);if(-1<K){y+=(y?" ":"")+A.substring(0,K)+g.replace("$1",
new Map;this.B=[];this.R=[];for(let d=0,g,f;d<c.length;d++){g=c[d];f=g.field||g;if(!f)throw Error("The tag field from the document descriptor is undefined.");g.custom?this.B[d]=g.custom:(this.B[d]=T(f,this.H),g.filter&&("string"===typeof this.B[d]&&(this.B[d]=new String(this.B[d])),this.B[d].F=g.filter));this.R[d]=f;this.tag.set(f,new Map)}}} A.substring(K,F.length))+A.substring(K+F.length);z=!0;break}}z||(y+=(y?" ":"")+l[q])}r[v].highlight=y}}return a}function ra(a,b){const c=[],e=D();for(let d=0,g,f;d<a.length;d++){g=a[d];f=g.result;for(let h=0,k,l,m;h<f.length;h++)if(l=f[h],k=l.id,m=e[k])m.push(g.field);else{if(c.length===b)return c;l.field=e[k]=[g.field];c.push(l)}}return c}function pa(a,b,c,e,d){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-e)&&0<b){if(b>c||e)a=a.slice(e,e+c);d&&(a=qa.call(this,a));return a}}
function T(a,b){const c=a.split(":");let e=0;for(let d=0;d<c.length;d++)a=c[d],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[e]=!0),a&&(c[e++]=a);e<c.length&&(c.length=e);return 1<e?c:c[0]}x=Q.prototype;x.append=function(a,b){return this.add(a,b,!0)};x.update=function(a,b){return this.remove(a).add(a,b)}; function qa(a){const b=Array(a.length);for(let c=0,e;c<a.length;c++)e=a[c],b[c]={id:e,doc:this.store.get(e)};return b};function R(a){if(!this||this.constructor!==R)return new R(a);const b=a.document||a.doc||a;var c;this.C=[];this.field=[];this.I=[];this.key=(c=b.key||b.id)&&T(c,this.I)||"id";this.reg=(this.fastupdate=!!a.fastupdate)?new Map:new Set;this.A=(c=b.store||null)&&c&&!0!==c&&[];this.store=c&&new Map;this.cache=(c=a.cache||null)&&new U(c);a.cache=!1;c=new Map;let e=b.index||b.field||b;E(e)&&(e=[e]);for(let d=0,g,f;d<e.length;d++)g=e[d],E(g)||(f=g,g=g.field),f=G(f)?Object.assign({},a,f):a,c.set(g,new V(f,
x.remove=function(a){G(a)&&(a=I(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let c of this.tag.values())for(let e of c){b=e[0];const d=e[1],g=d.indexOf(a);-1<g&&(1<d.length?d.splice(g,1):c.delete(b))}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; this.reg)),f.custom?this.C[d]=f.custom:(this.C[d]=T(g,this.I),f.filter&&("string"===typeof this.C[d]&&(this.C[d]=new String(this.C[d])),this.C[d].H=f.filter)),this.field[d]=g;if(this.A){a=b.store;E(a)&&(a=[a]);for(let d=0,g,f;d<a.length;d++)g=a[d],f=g.field||g,g.custom?(this.A[d]=g.custom,g.custom.S=f):(this.A[d]=T(f,this.I),g.filter&&("string"===typeof this.A[d]&&(this.A[d]=new String(this.A[d])),this.A[d].H=g.filter))}this.index=c;this.tag=null;if(c=b.tag)if("string"===typeof c&&(c=[c]),c.length){this.tag=
x.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};x.contain=function(a){return this.reg.has(a)};x.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};x.get=function(a){return this.store.get(a)};x.set=function(a,b){this.store.set(a,b);return this};x.searchCache=sa; new Map;this.B=[];this.R=[];for(let d=0,g,f;d<c.length;d++){g=c[d];f=g.field||g;if(!f)throw Error("The tag field from the document descriptor is undefined.");g.custom?this.B[d]=g.custom:(this.B[d]=T(f,this.I),g.filter&&("string"===typeof this.B[d]&&(this.B[d]=new String(this.B[d])),this.B[d].H=g.filter));this.R[d]=f;this.tag.set(f,new Map)}}}
x.export=function(a,b,c=0,e=0){if(c<this.field.length){const f=this.field[c];if((b=this.index.get(f).export(a,f,c,e=1))&&b.then){const h=this;return b.then(function(){return h.export(a,f,c+1)})}return this.export(a,f,c+1)}let d,g;switch(e){case 0:d="reg";g=la(this.reg);b=null;break;case 1:d="tag";g=ja(this.tag,this.reg.size);b=null;break;case 2:d="doc";g=N(this.store);b=null;break;case 3:d="cfg";g={};b=null;break;default:return}return P.call(this,a,b,d,g,c,e)}; function T(a,b){const c=a.split(":");let e=0;for(let d=0;d<c.length;d++)a=c[d],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[e]=!0),a&&(c[e++]=a);e<c.length&&(c.length=e);return 1<e?c:c[0]}w=R.prototype;w.append=function(a,b){return this.add(a,b,!0)};w.update=function(a,b){return this.remove(a).add(a,b)};
x.import=function(a,b){if(b){E(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=ma(b,this.reg);for(let e=0,d;e<this.field.length;e++)d=this.index.get(this.field[e]),d.fastupdate=!1,d.reg=this.reg;break;case "tag":this.tag=ka(b,this.tag);break;case "doc":this.store=O(b,this.store)}}};ia(Q.prototype);function sa(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();let e=this.cache.get(a);if(!e){e=this.search(a,b,c);if(e.then){const d=this;e.then(function(g){d.cache.set(a,g);return g})}this.cache.set(a,e)}return e}function U(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.A=""}U.prototype.set=function(a,b){this.cache.set(this.A=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)}; w.remove=function(a){G(a)&&(a=I(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let c of this.tag.values())for(let e of c){b=e[0];const d=e[1],g=d.indexOf(a);-1<g&&(1<d.length?d.splice(g,1):c.delete(b))}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
U.prototype.get=function(a){const b=this.cache.get(a);b&&this.A!==a&&(this.cache.delete(a),this.cache.set(this.A=a,b));return b};U.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};U.prototype.clear=function(){this.cache.clear();this.A=""};const ta={normalize:function(a){return a.toLowerCase()},dedupe:!1};const ua=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const va=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),wa=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const xa={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const ya=/[\x00-\x7F]+/g;const za=/[\x00-\x7F]+/g;const Aa=/[\x00-\x7F]+/g;var Ba={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:ta,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:ua},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:ua,matcher:va,replacer:wa},LatinExtra:{normalize:!0,dedupe:!0,mapper:ua,replacer:wa.concat([/(?!^)[aeo]/g,""]),matcher:va},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let e=b.charAt(0),d=xa[e];for(let g=1,f;g<b.length&&(f=b.charAt(g),"h"=== w.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};w.contain=function(a){return this.reg.has(a)};w.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};w.get=function(a){return this.store.get(a)};w.set=function(a,b){this.store.set(a,b);return this};w.searchCache=ta;
f||"w"===f||!(f=xa[f])||f===d||(e+=f,d=f,4!==e.length));g++);a[c]=e}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(ya," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(za,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Aa," ")}}};const Ca={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};D();V.prototype.add=function(a,b,c,e){if(b&&(a||0===a)){if(!e&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(e=b.length){const l=D(),m=D(),n=this.depth,t=this.resolution;for(let p=0;p<e;p++){let r=b[this.rtl?e-1-p:p];var d=r.length;if(d&&(n||!m[r])){var g=this.score?this.score(b,r,p,null,0):W(t,e,p),f="";switch(this.tokenize){case "full":if(2<d){for(g=0;g<d;g++)for(var h=d;h>g;h--){f=r.substring(g,h);var k=this.score?this.score(b,r,p,f,g):W(t,e,p,d,g);X(this,m,f,k,a,c)}break}case "reverse":if(1< w.export=function(a,b,c=0,e=0){if(c<this.field.length){const f=this.field[c];if((b=this.index.get(f).export(a,f,c,e=1))&&b.then){const h=this;return b.then(function(){return h.export(a,f,c+1)})}return this.export(a,f,c+1)}let d,g;switch(e){case 0:d="reg";g=la(this.reg);b=null;break;case 1:d="tag";g=ja(this.tag,this.reg.size);b=null;break;case 2:d="doc";g=O(this.store);b=null;break;case 3:d="cfg";g={};b=null;break;default:return}return Q.call(this,a,b,d,g,c,e)};
d){for(h=d-1;0<h;h--)f=r[h]+f,k=this.score?this.score(b,r,p,f,h):W(t,e,p,d,h),X(this,m,f,k,a,c);f=""}case "forward":if(1<d){for(h=0;h<d;h++)f+=r[h],X(this,m,f,g,a,c);break}default:if(X(this,m,r,g,a,c),n&&1<e&&p<e-1)for(d=D(),f=this.P,g=r,h=Math.min(n+1,e-p),d[g]=1,k=1;k<h;k++)if((r=b[this.rtl?e-1-p-k:p+k])&&!d[r]){d[r]=1;const v=this.score?this.score(b,g,p,r,k):W(f+(e/2>f?0:1),e,p,h-1,k-1),u=this.bidirectional&&r>g;X(this,l,u?g:r,v,a,c,u?r:g)}}}}this.fastupdate||this.reg.add(a)}}return this}; w.import=function(a,b){if(b){E(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=ma(b,this.reg);for(let e=0,d;e<this.field.length;e++)d=this.index.get(this.field[e]),d.fastupdate=!1,d.reg=this.reg;break;case "tag":this.tag=ka(b,this.tag);break;case "doc":this.store=P(b,this.store)}}};ia(R.prototype);function ta(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();let e=this.cache.get(a);if(!e){e=this.search(a,b,c);if(e.then){const d=this;e.then(function(g){d.cache.set(a,g);return g})}this.cache.set(a,e)}return e}function U(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}U.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};
function X(a,b,c,e,d,g,f){let h=f?a.ctx:a.map,k;if(!b[c]||f&&!(k=b[c])[f])f?(b=k||(b[c]=D()),b[f]=1,(k=h.get(f))?h=k:h.set(f,h=new Map)):b[c]=1,(k=h.get(c))?h=k:h.set(c,h=[]),h=h[e]||(h[e]=[]),g&&h.includes(d)||(h.push(d),a.fastupdate&&((b=a.reg.get(d))?b.push(h):a.reg.set(d,[h])))}function W(a,b,c,e,d){return c&&1<a?b+(e||0)<=a?c+(d||0):(a-1)/(b+(e||0))*(c+(d||0))+1|0:0};function Da(a,b,c){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a;let e=[];for(let d=0,g,f;d<a.length;d++)if((g=a[d])&&(f=g.length)){if(c){if(c>=f){c-=f;continue}c<f&&(g=b?g.slice(c,c+b):g.slice(c),f=g.length,c=0)}if(e.length)f>b&&(g=g.slice(0,b),f=g.length),e.push(g);else{if(f>=b)return f>b&&(g=g.slice(0,b)),g;e=[g]}b-=f;if(!b)break}return e.length?e=1<e.length?[].concat.apply([],e):e[0]:e};V.prototype.search=function(a,b,c){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));var e=[],d=0;if(c){a=c.query||a;b=c.limit||b;d=c.offset||0;var g=c.context;var f=c.suggest}a=this.encoder.encode(a);c=a.length;b||(b=100);if(1===c)return Y.call(this,a[0],"",b,d);g=this.depth&&!1!==g;if(2===c&&g&&!f)return Y.call(this,a[0],a[1],b,d);var h=0,k=0;if(1<c){var l=D();const n=[];for(let t=0,p;t<c;t++)if((p=a[t])&&!l[p]){if(f||Z(this,p))n.push(p),l[p]=1;else return e;const r=p.length;h=Math.max(h,r);k=k?Math.min(k, U.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};U.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};U.prototype.clear=function(){this.cache.clear();this.h=""};const ua={normalize:function(a){return a.toLowerCase()},dedupe:!1};const va=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const wa=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),xa=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const ya={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const za=/[\x00-\x7F]+/g;const Aa=/[\x00-\x7F]+/g;const Ba=/[\x00-\x7F]+/g;var Ca={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:ua,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:va},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:va,matcher:wa,replacer:xa},LatinExtra:{normalize:!0,dedupe:!0,mapper:va,replacer:xa.concat([/(?!^)[aeo]/g,""]),matcher:wa},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let e=b.charAt(0),d=ya[e];for(let g=1,f;g<b.length&&(f=b.charAt(g),"h"===
r):r}a=n;c=a.length}if(!c)return e;l=0;if(1===c)return Y.call(this,a[0],"",b,d);if(2===c&&g&&!f)return Y.call(this,a[0],a[1],b,d);if(1<c)if(g){var m=a[0];l=1}else 9<h&&3<h/k&&a.sort(aa);for(let n,t;l<c;l++){t=a[l];m?(n=Z(this,t,m),n=Ea(n,e,f,this.P),f&&!1===n&&e.length||(m=t)):(n=Z(this,t,""),n=Ea(n,e,f,this.resolution));if(n)return n;if(f&&l===c-1){g=e.length;if(!g){if(m){m="";l=-1;continue}return e}if(1===g)return Da(e[0],b,d)}}a:{a=e;e=this.resolution;m=f;c=a.length;f=[];g=D();for(let n=0,t,p, f||"w"===f||!(f=ya[f])||f===d||(e+=f,d=f,4!==e.length));g++);a[c]=e}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(za," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(Aa,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ba," ")}}};const Da={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};D();V.prototype.add=function(a,b,c,e){if(b&&(a||0===a)){if(!e&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(e=b.length){const l=D(),m=D(),r=this.depth,t=this.resolution;for(let p=0;p<e;p++){let n=b[this.rtl?e-1-p:p];var d=n.length;if(d&&(r||!m[n])){var g=this.score?this.score(b,n,p,null,0):W(t,e,p),f="";switch(this.tokenize){case "full":if(2<d){for(g=0;g<d;g++)for(var h=d;h>g;h--){f=n.substring(g,h);var k=this.score?this.score(b,n,p,f,g):W(t,e,p,d,g);X(this,m,f,k,a,c)}break}case "reverse":if(1<
r,v;n<e;n++)for(k=0;k<c;k++)if(r=a[k],n<r.length&&(t=r[n]))for(l=0;l<t.length;l++)p=t[l],(h=g[p])?g[p]++:(h=0,g[p]=1),v=f[h]||(f[h]=[]),v.push(p);if(a=f.length)if(m){if(1<f.length)b:for(a=[],e=D(),m=f.length,h=m-1;0<=h;h--)for(m=f[h],g=m.length,k=0;k<g;k++){if(c=m[k],!e[c])if(e[c]=1,d)d--;else if(a.push(c),a.length===b)break b}else a=(f=f[0]).length>b||d?f.slice(d,b+d):f;f=a}else{if(a<c){e=[];break a}f=f[a-1];if(b||d)if(f.length>b||d)f=f.slice(d,b+d)}e=f}return e}; d){for(h=d-1;0<h;h--)f=n[h]+f,k=this.score?this.score(b,n,p,f,h):W(t,e,p,d,h),X(this,m,f,k,a,c);f=""}case "forward":if(1<d){for(h=0;h<d;h++)f+=n[h],X(this,m,f,g,a,c);break}default:if(X(this,m,n,g,a,c),r&&1<e&&p<e-1)for(d=D(),f=this.P,g=n,h=Math.min(r+1,e-p),d[g]=1,k=1;k<h;k++)if((n=b[this.rtl?e-1-p-k:p+k])&&!d[n]){d[n]=1;const u=this.score?this.score(b,g,p,n,k):W(f+(e/2>f?0:1),e,p,h-1,k-1),v=this.bidirectional&&n>g;X(this,l,v?g:n,u,a,c,v?n:g)}}}}this.fastupdate||this.reg.add(a)}}return this};
function Y(a,b,c,e){return(a=Z(this,a,b))&&a.length?Da(a,c,e):[]}function Ea(a,b,c,e){let d=[];if(a){e=Math.min(a.length,e);for(let g=0,f;g<e;g++)(f=a[g])&&f&&(d[g]=f);if(d.length){b.push(d);return}}return!c&&d}function Z(a,b,c){let e;c&&(e=a.bidirectional&&b>c);a=c?(a=a.ctx.get(e?b:c))&&a.get(e?c:b):a.map.get(b);return a};V.prototype.remove=function(a,b){const c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(let e=0,d;e<c.length;e++){if(d=c[e])if(2>d.length)d.pop();else{const g=d.indexOf(a);g===c.length-1?d.pop():d.splice(g,1)}}else Fa(this.map,a),this.depth&&Fa(this.ctx,a);b||this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; function X(a,b,c,e,d,g,f){let h=f?a.ctx:a.map,k;if(!b[c]||f&&!(k=b[c])[f])f?(b=k||(b[c]=D()),b[f]=1,(k=h.get(f))?h=k:h.set(f,h=new Map)):b[c]=1,(k=h.get(c))?h=k:h.set(c,h=[]),h=h[e]||(h[e]=[]),g&&h.includes(d)||(h.push(d),a.fastupdate&&((b=a.reg.get(d))?b.push(h):a.reg.set(d,[h])))}function W(a,b,c,e,d){return c&&1<a?b+(e||0)<=a?c+(d||0):(a-1)/(b+(e||0))*(c+(d||0))+1|0:0};function Ea(a,b,c){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a;let e=[];for(let d=0,g,f;d<a.length;d++)if((g=a[d])&&(f=g.length)){if(c){if(c>=f){c-=f;continue}c<f&&(g=b?g.slice(c,c+b):g.slice(c),f=g.length,c=0)}if(e.length)f>b&&(g=g.slice(0,b),f=g.length),e.push(g);else{if(f>=b)return f>b&&(g=g.slice(0,b)),g;e=[g]}b-=f;if(!b)break}return e.length?e=1<e.length?[].concat.apply([],e):e[0]:e};V.prototype.search=function(a,b,c){c||(!b&&G(a)?(c=a,a=""):G(b)&&(c=b,b=0));var e=[],d=0;if(c){a=c.query||a;b=c.limit||b;d=c.offset||0;var g=c.context;var f=c.suggest;var h=!0;var k=c.resolution}else h=!0;var l=this.encoder.encode(a);c=l.length;b||!h||(b=100);if(1===c)return Y.call(this,l[0],"",b,d);g=this.depth&&!1!==g;if(2===c&&g&&!f)return Y.call(this,l[0],l[1],b,d);let m=h=0;if(1<c){const t=D(),p=[];for(let n=0,u;n<c;n++)if((u=l[n])&&!t[u]){if(f||Z(this,u))p.push(u),t[u]=1;else return e;const v=
function Fa(a,b){let c=0;if(a.constructor===Array)for(let e=0,d,g;e<a.length;e++){if((d=a[e])&&d.length)if(g=d.indexOf(b),0<=g){1<d.length?(d.splice(g,1),c++):delete a[e];break}else c++}else for(let e of a){const d=e[0],g=Fa(e[1],b);g?c+=g:a.delete(d)}return c};function V(a,b){if(!this||this.constructor!==V)return new V(a);if(a){var c=E(a)?a:a.preset;c&&(a=Object.assign({},Ca[c],a))}else a={};c=a.context||{};const e=E(a.encoder)?Ba[a.encoder]:a.encode||a.encoder||ta;this.encoder=e.encode?e:"object"===typeof e?new K(e):{encode:e};let d;this.resolution=a.resolution||9;this.tokenize=d=a.tokenize||"strict";this.depth="strict"===d&&c.depth||0;this.bidirectional=!1!==c.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;d=!1;this.map=new Map; u.length;h=Math.max(h,v);m=m?Math.min(m,v):v}l=p;c=a.length}if(!c)return e;a=0;if(1===c)return Y.call(this,l[0],"",b,d);if(2===c&&g&&!f)return Y.call(this,l[0],l[1],b,d);if(1<c)if(g){var r=l[0];a=1}else 9<h&&3<h/m&&l.sort(aa);k||0===k||(k=this.resolution);for(let t,p;a<c;a++){p=l[a];r?(t=Z(this,p,r),t=Fa(t,e,f,this.P),f&&!1===t&&e.length||(r=p)):(t=Z(this,p,""),t=Fa(t,e,f,k));if(t)return t;if(f&&a===c-1){g=e.length;if(!g){if(r){r="";a=-1;continue}return e}if(1===g)return Ea(e[0],b,d)}}a:{r=f;c=e.length;
this.ctx=new Map;this.reg=b||(this.fastupdate?new Map:new Set);this.P=c.resolution||1;this.rtl=e.rtl||a.rtl||!1;this.cache=(d=a.cache||null)&&new U(d)}x=V.prototype;x.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};x.append=function(a,b){return this.add(a,b,!0)};x.contain=function(a){return this.reg.has(a)};x.update=function(a,b){const c=this,e=this.remove(a);return e&&e.then?e.then(()=>c.add(a,b)):this.add(a,b)}; f=[];g=D();for(let t=0,p,n,u,v;t<k;t++)for(a=0;a<c;a++)if(u=e[a],t<u.length&&(p=u[t]))for(h=0;h<p.length;h++)n=p[h],(l=g[n])?g[n]++:(l=0,g[n]=1),v=f[l]||(f[l]=[]),v.push(n);if(k=f.length)if(r){if(1<f.length)b:for(k=[],e=D(),r=f.length,l=r-1;0<=l;l--)for(r=f[l],g=r.length,a=0;a<g;a++){if(c=r[a],!e[c])if(e[c]=1,d)d--;else if(k.push(c),k.length===b)break b}else k=(f=f[0]).length>b||d?f.slice(d,b+d):f;f=k}else{if(k<c){e=[];break a}f=f[k-1];if(b||d)if(f.length>b||d)f=f.slice(d,b+d)}e=f}return e};
function Ga(a){let b=0;if(a.constructor===Array)for(let c=0,e;c<a.length;c++)(e=a[c])&&(b+=e.length);else for(const c of a){const e=c[0],d=Ga(c[1]);d?b+=d:a.delete(e)}return b}x.cleanup=function(){if(!this.fastupdate)return this;Ga(this.map);this.depth&&Ga(this.ctx);return this};x.searchCache=sa; function Y(a,b,c,e){return(a=Z(this,a,b))&&a.length?Ea(a,c,e):[]}function Fa(a,b,c,e){let d=[];if(a){e=Math.min(a.length,e);for(let g=0,f;g<e;g++)(f=a[g])&&f&&(d[g]=f);if(d.length){b.push(d);return}}return!c&&d}function Z(a,b,c){let e;c&&(e=a.bidirectional&&b>c);a=c?(a=a.ctx.get(e?b:c))&&a.get(e?c:b):a.map.get(b);return a};V.prototype.remove=function(a,b){const c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(let e=0,d;e<c.length;e++){if(d=c[e])if(2>d.length)d.pop();else{const g=d.indexOf(a);g===c.length-1?d.pop():d.splice(g,1)}}else Ga(this.map,a),this.depth&&Ga(this.ctx,a);b||this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
x.export=function(a,b,c,e=0){let d,g;switch(e){case 0:d="reg";g=la(this.reg);break;case 1:d="cfg";g={};break;case 2:d="map";g=N(this.map,this.reg.size);break;case 3:d="ctx";g=ja(this.ctx,this.reg.size);break;default:return}return P.call(this,a,b,d,g,c,e)}; function Ga(a,b){let c=0;if(a.constructor===Array)for(let e=0,d,g;e<a.length;e++){if((d=a[e])&&d.length)if(g=d.indexOf(b),0<=g){1<d.length?(d.splice(g,1),c++):delete a[e];break}else c++}else for(let e of a){const d=e[0],g=Ga(e[1],b);g?c+=g:a.delete(d)}return c};function V(a,b){if(!this||this.constructor!==V)return new V(a);if(a){var c=E(a)?a:a.preset;c&&(a=Object.assign({},Da[c],a))}else a={};c=a.context;const e=!0===c?{depth:1}:c||{},d=E(a.encoder)?Ca[a.encoder]:a.encode||a.encoder||ua;this.encoder=d.encode?d:"object"===typeof d?new L(d):{encode:d};this.resolution=a.resolution||9;this.tokenize=c=a.tokenize||"strict";this.depth="strict"===c&&e.depth||0;this.bidirectional=!1!==e.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;c=!1;this.map=
x.import=function(a,b){if(b)switch(E(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=ma(b,this.reg);break;case "map":this.map=O(b,this.map);break;case "ctx":this.ctx=ka(b,this.ctx)}}; new Map;this.ctx=new Map;this.reg=b||(this.fastupdate?new Map:new Set);this.P=e.resolution||3;this.rtl=d.rtl||a.rtl||!1;this.cache=(c=a.cache||null)&&new U(c)}w=V.prototype;w.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};w.append=function(a,b){return this.add(a,b,!0)};w.contain=function(a){return this.reg.has(a)};w.update=function(a,b){const c=this,e=this.remove(a);return e&&e.then?e.then(()=>c.add(a,b)):this.add(a,b)};
x.serialize=function(a=!0){if(!this.reg.size)return"";let b="",c="";for(var e of this.reg.keys())c||(c=typeof e),b+=(b?",":"")+("string"===c?'"'+e+'"':e);b="index.reg=new Set(["+b+"]);";e="";for(var d of this.map.entries()){var g=d[0],f=d[1],h="";for(let m=0,n;m<f.length;m++){n=f[m]||[""];var k="";for(var l=0;l<n.length;l++)k+=(k?",":"")+("string"===c?'"'+n[l]+'"':n[l]);k="["+k+"]";h+=(h?",":"")+k}h='["'+g+'",['+h+"]]";e+=(e?",":"")+h}e="index.map=new Map(["+e+"]);";d="";for(const m of this.ctx.entries()){g= function Ha(a){let b=0;if(a.constructor===Array)for(let c=0,e;c<a.length;c++)(e=a[c])&&(b+=e.length);else for(const c of a){const e=c[0],d=Ha(c[1]);d?b+=d:a.delete(e)}return b}w.cleanup=function(){if(!this.fastupdate)return this;Ha(this.map);this.depth&&Ha(this.ctx);return this};w.searchCache=ta;
m[0];f=m[1];for(const n of f.entries()){f=n[0];h=n[1];k="";for(let t=0,p;t<h.length;t++){p=h[t]||[""];l="";for(let r=0;r<p.length;r++)l+=(l?",":"")+("string"===c?'"'+p[r]+'"':p[r]);l="["+l+"]";k+=(k?",":"")+l}k='new Map([["'+f+'",['+k+"]]])";k='["'+g+'",'+k+"]";d+=(d?",":"")+k}}d="index.ctx=new Map(["+d+"]);";return a?"function inject(index){"+b+e+d+"}":b+e+d};ia(V.prototype);export default {Index:V,Charset:Ba,Encoder:K,Document:Q,Worker:null,Resolver:null,IndexedDB:null,Language:{}}; w.export=function(a,b,c,e=0){let d,g;switch(e){case 0:d="reg";g=la(this.reg);break;case 1:d="cfg";g={};break;case 2:d="map";g=O(this.map,this.reg.size);break;case 3:d="ctx";g=ja(this.ctx,this.reg.size);break;default:return}return Q.call(this,a,b,d,g,c,e)};
export const Index=V;export const Charset=Ba;export const Encoder=K;export const Document=Q;export const Worker=null;export const Resolver=null;export const IndexedDB=null;export const Language={}; w.import=function(a,b){if(b)switch(E(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=ma(b,this.reg);break;case "map":this.map=P(b,this.map);break;case "ctx":this.ctx=ka(b,this.ctx)}};
w.serialize=function(a=!0){if(!this.reg.size)return"";let b="",c="";for(var e of this.reg.keys())c||(c=typeof e),b+=(b?",":"")+("string"===c?'"'+e+'"':e);b="index.reg=new Set(["+b+"]);";e="";for(var d of this.map.entries()){var g=d[0],f=d[1],h="";for(let m=0,r;m<f.length;m++){r=f[m]||[""];var k="";for(var l=0;l<r.length;l++)k+=(k?",":"")+("string"===c?'"'+r[l]+'"':r[l]);k="["+k+"]";h+=(h?",":"")+k}h='["'+g+'",['+h+"]]";e+=(e?",":"")+h}e="index.map=new Map(["+e+"]);";d="";for(const m of this.ctx.entries()){g=
m[0];f=m[1];for(const r of f.entries()){f=r[0];h=r[1];k="";for(let t=0,p;t<h.length;t++){p=h[t]||[""];l="";for(let n=0;n<p.length;n++)l+=(l?",":"")+("string"===c?'"'+p[n]+'"':p[n]);l="["+l+"]";k+=(k?",":"")+l}k='new Map([["'+f+'",['+k+"]]])";k='["'+g+'",'+k+"]";d+=(d?",":"")+k}}d="index.ctx=new Map(["+d+"]);";return a?"function inject(index){"+b+e+d+"}":b+e+d};ia(V.prototype);export default {Index:V,Charset:Ca,Encoder:L,Document:R,Worker:null,Resolver:null,IndexedDB:null,Language:{}};
export const Index=V;export const Charset=Ca;export const Encoder=L;export const Document=R;export const Worker=null;export const Resolver=null;export const IndexedDB=null;export const Language={};

File diff suppressed because it is too large Load Diff

View File

@@ -5,132 +5,135 @@
* Hosted by Nextapps GmbH * Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;var u;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function x(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if("number"==typeof a.length)return{next:aa(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}var ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; (function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;var t;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function x(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if("number"==typeof a.length)return{next:aa(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}var ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
function ca(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var C=ca(this);function E(a,b){if(b)a:{var c=C;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}}var da; function ca(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var C=ca(this);function E(a,b){if(b)a:{var c=C;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}}var da;
if("function"==typeof Object.setPrototypeOf)da=Object.setPrototypeOf;else{var ea;a:{var fa={a:!0},ha={};try{ha.__proto__=fa;ea=ha.a;break a}catch(a){}ea=!1}da=ea?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ia=da;function ja(){this.C=!1;this.A=null;this.F=void 0;this.h=1;this.L=0;this.B=null}function ka(a){if(a.C)throw new TypeError("Generator is already running");a.C=!0}ja.prototype.G=function(a){this.F=a}; if("function"==typeof Object.setPrototypeOf)da=Object.setPrototypeOf;else{var ea;a:{var fa={a:!0},ha={};try{ha.__proto__=fa;ea=ha.a;break a}catch(a){}ea=!1}da=ea?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ia=da;function ja(){this.C=!1;this.A=null;this.D=void 0;this.h=1;this.L=0;this.B=null}function ka(a){if(a.C)throw new TypeError("Generator is already running");a.C=!0}ja.prototype.G=function(a){this.D=a};
function la(a,b){a.B={ma:b,na:!0};a.h=a.L}ja.prototype.return=function(a){this.B={return:a};this.h=this.L};function G(a,b,c){a.h=c;return{value:b}}function ma(a){this.h=new ja;this.A=a}function na(a,b){ka(a.h);var c=a.h.A;if(c)return oa(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.h.return);a.h.return(b);return pa(a)} function la(a,b){a.B={ma:b,na:!0};a.h=a.L}ja.prototype.return=function(a){this.B={return:a};this.h=this.L};function H(a,b,c){a.h=c;return{value:b}}function ma(a){this.h=new ja;this.A=a}function na(a,b){ka(a.h);var c=a.h.A;if(c)return oa(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.h.return);a.h.return(b);return pa(a)}
function oa(a,b,c,d){try{var e=b.call(a.h.A,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.h.C=!1,e;var h=e.value}catch(f){return a.h.A=null,la(a.h,f),pa(a)}a.h.A=null;d.call(a.h,h);return pa(a)}function pa(a){for(;a.h.h;)try{var b=a.A(a.h);if(b)return a.h.C=!1,{value:b.value,done:!1}}catch(c){a.h.F=void 0,la(a.h,c)}a.h.C=!1;if(a.h.B){b=a.h.B;a.h.B=null;if(b.na)throw b.ma;return{value:b.return,done:!0}}return{value:void 0,done:!0}} function oa(a,b,c,d){try{var e=b.call(a.h.A,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.h.C=!1,e;var h=e.value}catch(f){return a.h.A=null,la(a.h,f),pa(a)}a.h.A=null;d.call(a.h,h);return pa(a)}function pa(a){for(;a.h.h;)try{var b=a.A(a.h);if(b)return a.h.C=!1,{value:b.value,done:!1}}catch(c){a.h.D=void 0,la(a.h,c)}a.h.C=!1;if(a.h.B){b=a.h.B;a.h.B=null;if(b.na)throw b.ma;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
function qa(a){this.next=function(b){ka(a.h);a.h.A?b=oa(a,a.h.A.next,b,a.h.G):(a.h.G(b),b=pa(a));return b};this.throw=function(b){ka(a.h);a.h.A?b=oa(a,a.h.A["throw"],b,a.h.G):(la(a.h,b),b=pa(a));return b};this.return=function(b){return na(a,b)};this[Symbol.iterator]=function(){return this}}function ra(a,b){b=new qa(new ma(b));ia&&a.prototype&&ia(b,a.prototype);return b} function qa(a){this.next=function(b){ka(a.h);a.h.A?b=oa(a,a.h.A.next,b,a.h.G):(a.h.G(b),b=pa(a));return b};this.throw=function(b){ka(a.h);a.h.A?b=oa(a,a.h.A["throw"],b,a.h.G):(la(a.h,b),b=pa(a));return b};this.return=function(b){return na(a,b)};this[Symbol.iterator]=function(){return this}}function ra(a,b){b=new qa(new ma(b));ia&&a.prototype&&ia(b,a.prototype);return b}
function sa(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function h(f){f.done?d(f.value):Promise.resolve(f.value).then(b,c).then(h,e)}h(a.next())})}function ta(a){return sa(new qa(new ma(a)))} function sa(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function h(f){f.done?d(f.value):Promise.resolve(f.value).then(b,c).then(h,e)}h(a.next())})}function ta(a){return sa(new qa(new ma(a)))}
E("Symbol",function(a){function b(h){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(h||"")+"_"+e++,h)}function c(h,f){this.h=h;ba(this,"description",{configurable:!0,writable:!0,value:f})}if(a)return a;c.prototype.toString=function(){return this.h};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b}); E("Symbol",function(a){function b(h){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(h||"")+"_"+e++,h)}function c(h,f){this.h=h;ba(this,"description",{configurable:!0,writable:!0,value:f})}if(a)return a;c.prototype.toString=function(){return this.h};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b});
E("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=C[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ba(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ua(aa(this))}})}return a});function ua(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} E("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=C[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ba(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ua(aa(this))}})}return a});function ua(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
E("Promise",function(a){function b(f){this.A=0;this.B=void 0;this.h=[];this.L=!1;var g=this.C();try{f(g.resolve,g.reject)}catch(k){g.reject(k)}}function c(){this.h=null}function d(f){return f instanceof b?f:new b(function(g){g(f)})}if(a)return a;c.prototype.A=function(f){if(null==this.h){this.h=[];var g=this;this.B(function(){g.F()})}this.h.push(f)};var e=C.setTimeout;c.prototype.B=function(f){e(f,0)};c.prototype.F=function(){for(;this.h&&this.h.length;){var f=this.h;this.h=[];for(var g=0;g<f.length;++g){var k= E("Promise",function(a){function b(f){this.A=0;this.B=void 0;this.h=[];this.L=!1;var g=this.C();try{f(g.resolve,g.reject)}catch(k){g.reject(k)}}function c(){this.h=null}function d(f){return f instanceof b?f:new b(function(g){g(f)})}if(a)return a;c.prototype.A=function(f){if(null==this.h){this.h=[];var g=this;this.B(function(){g.D()})}this.h.push(f)};var e=C.setTimeout;c.prototype.B=function(f){e(f,0)};c.prototype.D=function(){for(;this.h&&this.h.length;){var f=this.h;this.h=[];for(var g=0;g<f.length;++g){var k=
f[g];f[g]=null;try{k()}catch(l){this.C(l)}}}this.h=null};c.prototype.C=function(f){this.B(function(){throw f;})};b.prototype.C=function(){function f(l){return function(m){k||(k=!0,l.call(g,m))}}var g=this,k=!1;return{resolve:f(this.ha),reject:f(this.F)}};b.prototype.ha=function(f){if(f===this)this.F(new TypeError("A Promise cannot resolve to itself"));else if(f instanceof b)this.ja(f);else{a:switch(typeof f){case "object":var g=null!=f;break a;case "function":g=!0;break a;default:g=!1}g?this.ga(f): f[g];f[g]=null;try{k()}catch(l){this.C(l)}}}this.h=null};c.prototype.C=function(f){this.B(function(){throw f;})};b.prototype.C=function(){function f(l){return function(m){k||(k=!0,l.call(g,m))}}var g=this,k=!1;return{resolve:f(this.ha),reject:f(this.D)}};b.prototype.ha=function(f){if(f===this)this.D(new TypeError("A Promise cannot resolve to itself"));else if(f instanceof b)this.ja(f);else{a:switch(typeof f){case "object":var g=null!=f;break a;case "function":g=!0;break a;default:g=!1}g?this.ga(f):
this.G(f)}};b.prototype.ga=function(f){var g=void 0;try{g=f.then}catch(k){this.F(k);return}"function"==typeof g?this.ka(g,f):this.G(f)};b.prototype.F=function(f){this.ca(2,f)};b.prototype.G=function(f){this.ca(1,f)};b.prototype.ca=function(f,g){if(0!=this.A)throw Error("Cannot settle("+f+", "+g+"): Promise already settled in state"+this.A);this.A=f;this.B=g;2===this.A&&this.ia();this.ea()};b.prototype.ia=function(){var f=this;e(function(){if(f.fa()){var g=C.console;"undefined"!==typeof g&&g.error(f.B)}}, this.G(f)}};b.prototype.ga=function(f){var g=void 0;try{g=f.then}catch(k){this.D(k);return}"function"==typeof g?this.ka(g,f):this.G(f)};b.prototype.D=function(f){this.ca(2,f)};b.prototype.G=function(f){this.ca(1,f)};b.prototype.ca=function(f,g){if(0!=this.A)throw Error("Cannot settle("+f+", "+g+"): Promise already settled in state"+this.A);this.A=f;this.B=g;2===this.A&&this.ia();this.ea()};b.prototype.ia=function(){var f=this;e(function(){if(f.fa()){var g=C.console;"undefined"!==typeof g&&g.error(f.B)}},
1)};b.prototype.fa=function(){if(this.L)return!1;var f=C.CustomEvent,g=C.Event,k=C.dispatchEvent;if("undefined"===typeof k)return!0;"function"===typeof f?f=new f("unhandledrejection",{cancelable:!0}):"function"===typeof g?f=new g("unhandledrejection",{cancelable:!0}):(f=C.document.createEvent("CustomEvent"),f.initCustomEvent("unhandledrejection",!1,!0,f));f.promise=this;f.reason=this.B;return k(f)};b.prototype.ea=function(){if(null!=this.h){for(var f=0;f<this.h.length;++f)h.A(this.h[f]);this.h=null}}; 1)};b.prototype.fa=function(){if(this.L)return!1;var f=C.CustomEvent,g=C.Event,k=C.dispatchEvent;if("undefined"===typeof k)return!0;"function"===typeof f?f=new f("unhandledrejection",{cancelable:!0}):"function"===typeof g?f=new g("unhandledrejection",{cancelable:!0}):(f=C.document.createEvent("CustomEvent"),f.initCustomEvent("unhandledrejection",!1,!0,f));f.promise=this;f.reason=this.B;return k(f)};b.prototype.ea=function(){if(null!=this.h){for(var f=0;f<this.h.length;++f)h.A(this.h[f]);this.h=null}};
var h=new c;b.prototype.ja=function(f){var g=this.C();f.V(g.resolve,g.reject)};b.prototype.ka=function(f,g){var k=this.C();try{f.call(g,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(f,g){function k(p,q){return"function"==typeof p?function(r){try{l(p(r))}catch(v){m(v)}}:q}var l,m,n=new b(function(p,q){l=p;m=q});this.V(k(f,l),k(g,m));return n};b.prototype.catch=function(f){return this.then(void 0,f)};b.prototype.V=function(f,g){function k(){switch(l.A){case 1:f(l.B);break;case 2:g(l.B); var h=new c;b.prototype.ja=function(f){var g=this.C();f.V(g.resolve,g.reject)};b.prototype.ka=function(f,g){var k=this.C();try{f.call(g,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(f,g){function k(n,q){return"function"==typeof n?function(r){try{l(n(r))}catch(v){m(v)}}:q}var l,m,p=new b(function(n,q){l=n;m=q});this.V(k(f,l),k(g,m));return p};b.prototype.catch=function(f){return this.then(void 0,f)};b.prototype.V=function(f,g){function k(){switch(l.A){case 1:f(l.B);break;case 2:g(l.B);
break;default:throw Error("Unexpected state: "+l.A);}}var l=this;null==this.h?h.A(k):this.h.push(k);this.L=!0};b.resolve=d;b.reject=function(f){return new b(function(g,k){k(f)})};b.race=function(f){return new b(function(g,k){for(var l=x(f),m=l.next();!m.done;m=l.next())d(m.value).V(g,k)})};b.all=function(f){var g=x(f),k=g.next();return k.done?d([]):new b(function(l,m){function n(r){return function(v){p[r]=v;q--;0==q&&l(p)}}var p=[],q=0;do p.push(void 0),q++,d(k.value).V(n(p.length-1),m),k=g.next(); break;default:throw Error("Unexpected state: "+l.A);}}var l=this;null==this.h?h.A(k):this.h.push(k);this.L=!0};b.resolve=d;b.reject=function(f){return new b(function(g,k){k(f)})};b.race=function(f){return new b(function(g,k){for(var l=x(f),m=l.next();!m.done;m=l.next())d(m.value).V(g,k)})};b.all=function(f){var g=x(f),k=g.next();return k.done?d([]):new b(function(l,m){function p(r){return function(v){n[r]=v;q--;0==q&&l(n)}}var n=[],q=0;do n.push(void 0),q++,d(k.value).V(p(n.length-1),m),k=g.next();
while(!k.done)})};return b});function va(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var h=c++;return{value:b(h,a[h]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}E("Array.prototype.values",function(a){return a?a:function(){return va(this,function(b,c){return c})}});function H(a,b){return Object.prototype.hasOwnProperty.call(a,b)} while(!k.done)})};return b});function va(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var h=c++;return{value:b(h,a[h]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}E("Array.prototype.values",function(a){return a?a:function(){return va(this,function(b,c){return c})}});function I(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
E("WeakMap",function(a){function b(k){this.h=(g+=Math.random()+1).toString();if(k){k=x(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}}function c(){}function d(k){var l=typeof k;return"object"===l&&null!==k||"function"===l}function e(k){if(!H(k,f)){var l=new c;ba(k,f,{value:l})}}function h(k){var l=Object[k];l&&(Object[k]=function(m){if(m instanceof c)return m;Object.isExtensible(m)&&e(m);return l(m)})}if(function(){if(!a||!Object.seal)return!1;try{var k=Object.seal({}),l=Object.seal({}), E("WeakMap",function(a){function b(k){this.h=(g+=Math.random()+1).toString();if(k){k=x(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}}function c(){}function d(k){var l=typeof k;return"object"===l&&null!==k||"function"===l}function e(k){if(!I(k,f)){var l=new c;ba(k,f,{value:l})}}function h(k){var l=Object[k];l&&(Object[k]=function(m){if(m instanceof c)return m;Object.isExtensible(m)&&e(m);return l(m)})}if(function(){if(!a||!Object.seal)return!1;try{var k=Object.seal({}),l=Object.seal({}),
m=new a([[k,2],[l,3]]);if(2!=m.get(k)||3!=m.get(l))return!1;m.delete(k);m.set(l,4);return!m.has(k)&&4==m.get(l)}catch(n){return!1}}())return a;var f="$jscomp_hidden_"+Math.random();h("freeze");h("preventExtensions");h("seal");var g=0;b.prototype.set=function(k,l){if(!d(k))throw Error("Invalid WeakMap key");e(k);if(!H(k,f))throw Error("WeakMap key fail: "+k);k[f][this.h]=l;return this};b.prototype.get=function(k){return d(k)&&H(k,f)?k[f][this.h]:void 0};b.prototype.has=function(k){return d(k)&&H(k, m=new a([[k,2],[l,3]]);if(2!=m.get(k)||3!=m.get(l))return!1;m.delete(k);m.set(l,4);return!m.has(k)&&4==m.get(l)}catch(p){return!1}}())return a;var f="$jscomp_hidden_"+Math.random();h("freeze");h("preventExtensions");h("seal");var g=0;b.prototype.set=function(k,l){if(!d(k))throw Error("Invalid WeakMap key");e(k);if(!I(k,f))throw Error("WeakMap key fail: "+k);k[f][this.h]=l;return this};b.prototype.get=function(k){return d(k)&&I(k,f)?k[f][this.h]:void 0};b.prototype.has=function(k){return d(k)&&I(k,
f)&&H(k[f],this.h)};b.prototype.delete=function(k){return d(k)&&H(k,f)&&H(k[f],this.h)?delete k[f][this.h]:!1};return b}); f)&&I(k[f],this.h)};b.prototype.delete=function(k){return d(k)&&I(k,f)&&I(k[f],this.h)?delete k[f][this.h]:!1};return b});
E("Map",function(a){function b(){var g={};return g.K=g.next=g.head=g}function c(g,k){var l=g[1];return ua(function(){if(l){for(;l.head!=g[1];)l=l.K;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};l=null}return{done:!0,value:void 0}})}function d(g,k){var l=k&&typeof k;"object"==l||"function"==l?h.has(k)?l=h.get(k):(l=""+ ++f,h.set(k,l)):l="p_"+k;var m=g[0][l];if(m&&H(g[0],l))for(g=0;g<m.length;g++){var n=m[g];if(k!==k&&n.key!==n.key||k===n.key)return{id:l,list:m,index:g,D:n}}return{id:l, E("Map",function(a){function b(){var g={};return g.K=g.next=g.head=g}function c(g,k){var l=g[1];return ua(function(){if(l){for(;l.head!=g[1];)l=l.K;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};l=null}return{done:!0,value:void 0}})}function d(g,k){var l=k&&typeof k;"object"==l||"function"==l?h.has(k)?l=h.get(k):(l=""+ ++f,h.set(k,l)):l="p_"+k;var m=g[0][l];if(m&&I(g[0],l))for(g=0;g<m.length;g++){var p=m[g];if(k!==k&&p.key!==p.key||k===p.key)return{id:l,list:m,index:g,F:p}}return{id:l,
list:m,index:-1,D:void 0}}function e(g){this[0]={};this[1]=b();this.size=0;if(g){g=x(g);for(var k;!(k=g.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var g=Object.seal({x:4}),k=new a(x([[g,"s"]]));if("s"!=k.get(g)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=g||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x|| list:m,index:-1,F:void 0}}function e(g){this[0]={};this[1]=b();this.size=0;if(g){g=x(g);for(var k;!(k=g.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var g=Object.seal({x:4}),k=new a(x([[g,"s"]]));if("s"!=k.get(g)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=g||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x||
"t"!=m.value[1]||!l.next().done?!1:!0}catch(n){return!1}}())return a;var h=new WeakMap;e.prototype.set=function(g,k){g=0===g?0:g;var l=d(this,g);l.list||(l.list=this[0][l.id]=[]);l.D?l.D.value=k:(l.D={next:this[1],K:this[1].K,head:this[1],key:g,value:k},l.list.push(l.D),this[1].K.next=l.D,this[1].K=l.D,this.size++);return this};e.prototype.delete=function(g){g=d(this,g);return g.D&&g.list?(g.list.splice(g.index,1),g.list.length||delete this[0][g.id],g.D.K.next=g.D.next,g.D.next.K=g.D.K,g.D.head=null, "t"!=m.value[1]||!l.next().done?!1:!0}catch(p){return!1}}())return a;var h=new WeakMap;e.prototype.set=function(g,k){g=0===g?0:g;var l=d(this,g);l.list||(l.list=this[0][l.id]=[]);l.F?l.F.value=k:(l.F={next:this[1],K:this[1].K,head:this[1],key:g,value:k},l.list.push(l.F),this[1].K.next=l.F,this[1].K=l.F,this.size++);return this};e.prototype.delete=function(g){g=d(this,g);return g.F&&g.list?(g.list.splice(g.index,1),g.list.length||delete this[0][g.id],g.F.K.next=g.F.next,g.F.next.K=g.F.K,g.F.head=null,
this.size--,!0):!1};e.prototype.clear=function(){this[0]={};this[1]=this[1].K=b();this.size=0};e.prototype.has=function(g){return!!d(this,g).D};e.prototype.get=function(g){return(g=d(this,g).D)&&g.value};e.prototype.entries=function(){return c(this,function(g){return[g.key,g.value]})};e.prototype.keys=function(){return c(this,function(g){return g.key})};e.prototype.values=function(){return c(this,function(g){return g.value})};e.prototype.forEach=function(g,k){for(var l=this.entries(),m;!(m=l.next()).done;)m= this.size--,!0):!1};e.prototype.clear=function(){this[0]={};this[1]=this[1].K=b();this.size=0};e.prototype.has=function(g){return!!d(this,g).F};e.prototype.get=function(g){return(g=d(this,g).F)&&g.value};e.prototype.entries=function(){return c(this,function(g){return[g.key,g.value]})};e.prototype.keys=function(){return c(this,function(g){return g.key})};e.prototype.values=function(){return c(this,function(g){return g.value})};e.prototype.forEach=function(g,k){for(var l=this.entries(),m;!(m=l.next()).done;)m=
m.value,g.call(k,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var f=0;return e});E("Array.prototype.keys",function(a){return a?a:function(){return va(this,function(b){return b})}}); m.value,g.call(k,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var f=0;return e});E("Array.prototype.keys",function(a){return a?a:function(){return va(this,function(b){return b})}});
E("Set",function(a){function b(c){this.h=new Map;if(c){c=x(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.h.size}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(x([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)return!1;var e=d.entries(),h=e.next();if(h.done||h.value[0]!=c||h.value[1]!=c)return!1;h=e.next();return h.done||h.value[0]==c||4!=h.value[0].x|| E("Set",function(a){function b(c){this.h=new Map;if(c){c=x(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.h.size}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(x([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)return!1;var e=d.entries(),h=e.next();if(h.done||h.value[0]!=c||h.value[1]!=c)return!1;h=e.next();return h.done||h.value[0]==c||4!=h.value[0].x||
h.value[1]!=h.value[0]?!1:e.next().done}catch(f){return!1}}())return a;b.prototype.add=function(c){c=0===c?0:c;this.h.set(c,c);this.size=this.h.size;return this};b.prototype.delete=function(c){c=this.h.delete(c);this.size=this.h.size;return c};b.prototype.clear=function(){this.h.clear();this.size=0};b.prototype.has=function(c){return this.h.has(c)};b.prototype.entries=function(){return this.h.entries()};b.prototype.values=function(){return this.h.values()};b.prototype.keys=b.prototype.values;b.prototype[Symbol.iterator]= h.value[1]!=h.value[0]?!1:e.next().done}catch(f){return!1}}())return a;b.prototype.add=function(c){c=0===c?0:c;this.h.set(c,c);this.size=this.h.size;return this};b.prototype.delete=function(c){c=this.h.delete(c);this.size=this.h.size;return c};b.prototype.clear=function(){this.h.clear();this.size=0};b.prototype.has=function(c){return this.h.has(c)};b.prototype.entries=function(){return this.h.entries()};b.prototype.values=function(){return this.h.values()};b.prototype.keys=b.prototype.values;b.prototype[Symbol.iterator]=
b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.h.forEach(function(h){return c.call(d,h,h,e)})};return b});E("Array.prototype.entries",function(a){return a?a:function(){return va(this,function(b,c){return[b,c]})}});E("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}}); b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.h.forEach(function(h){return c.call(d,h,h,e)})};return b});E("Array.prototype.entries",function(a){return a?a:function(){return va(this,function(b,c){return[b,c]})}});E("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}});
E("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var h=d[c];if(h===b||Object.is(h,b))return!0}return!1}}); E("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var h=d[c];if(h===b||Object.is(h,b))return!0}return!1}});
E("String.prototype.includes",function(a){return a?a:function(b,c){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(b,c||0)}});var wa="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)H(d,e)&&(a[e]=d[e])}return a}; E("String.prototype.includes",function(a){return a?a:function(b,c){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(b,c||0)}});var wa="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)I(d,e)&&(a[e]=d[e])}return a};
E("Object.assign",function(a){return a||wa});E("Array.prototype.flat",function(a){return a?a:function(b){b=void 0===b?1:b;var c=[];Array.prototype.forEach.call(this,function(d){Array.isArray(d)&&0<b?(d=Array.prototype.flat.call(d,b-1),c.push.apply(c,d)):c.push(d)});return c}});function I(a,b,c){var d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){b=new Map(c);d=x(a);for(e=d.next();!e.done;e=d.next())e=e.value,b.set(e[0],e[1]);return b}if(b===Set){b=new Set(c);d=x(a.values());for(e=d.next();!e.done;e=d.next())b.add(e.value);return b}}}return a}return c}return"undefined"===e?b:a} E("Object.assign",function(a){return a||wa});E("Array.prototype.flat",function(a){return a?a:function(b){b=void 0===b?1:b;var c=[];Array.prototype.forEach.call(this,function(d){Array.isArray(d)&&0<b?(d=Array.prototype.flat.call(d,b-1),c.push.apply(c,d)):c.push(d)});return c}});function J(a,b,c){var d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){b=new Map(c);d=x(a);for(e=d.next();!e.done;e=d.next())e=e.value,b.set(e[0],e[1]);return b}if(b===Set){b=new Set(c);d=x(a.values());for(e=d.next();!e.done;e=d.next())b.add(e.value);return b}}}return a}return c}return"undefined"===e?b:a}
function J(){return Object.create(null)}function xa(a,b){return b.length-a.length}function K(a){return"string"===typeof a}function M(a){return"object"===typeof a}function ya(a){var b=[];a=x(a.keys());for(var c=a.next();!c.done;c=a.next())b.push(c.value);return b}function za(a,b){if(K(b))a=a[b];else for(var c=0;a&&c<b.length;c++)a=a[b[c]];return a}function Aa(a){for(var b=0,c=0,d=void 0;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var Ba=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb", function K(){return Object.create(null)}function xa(a,b){return b.length-a.length}function L(a){return"string"===typeof a}function M(a){return"object"===typeof a}function ya(a){var b=[];a=x(a.keys());for(var c=a.next();!c.done;c=a.next())b.push(c.value);return b}function za(a,b){if(L(b))a=a[b];else for(var c=0;a&&c<b.length;c++)a=a[b[c]];return a}function Aa(a){for(var b=0,c=0,d=void 0;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var Ba=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb",
"u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"], "u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"],
["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0", ["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0",
"i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215", "i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215",
"u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af", "u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af",
"\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"], "\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"],
["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];var Ca=/[^\p{L}\p{N}]+/u,Da=/(\d{3})/g,Ea=/(\D)(\d{3})/g,Fa=/(\d{3})(\D)/g,Ha="".normalize&&/[\u0300-\u036f]/g;function N(a){if(!this||this.constructor!==N){var b=Function.prototype.bind,c=b.apply,d=[null],e=d.concat;if(arguments instanceof Array)var h=arguments;else{h=x(arguments);for(var f,g=[];!(f=h.next()).done;)g.push(f.value);h=g}return new (c.call(b,N,e.call(d,h)))}for(b=0;b<arguments.length;b++)this.assign(arguments[b])} ["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];var Ca=/[^\p{L}\p{N}]+/u,Da=/(\d{3})/g,Ea=/(\D)(\d{3})/g,Fa=/(\d{3})(\D)/g,Ga="".normalize&&/[\u0300-\u036f]/g;function Ha(a){if(!this||this.constructor!==Ha){var b=Function.prototype.bind,c=b.apply,d=[null],e=d.concat;if(arguments instanceof Array)var h=arguments;else{h=x(arguments);for(var f,g=[];!(f=h.next()).done;)g.push(f.value);h=g}return new (c.call(b,Ha,e.call(d,h)))}for(b=0;b<arguments.length;b++)this.assign(arguments[b])}t=Ha.prototype;
N.prototype.assign=function(a){this.normalize=I(a.normalize,!0,this.normalize);var b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){var d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(h){this.split=/\s+/}this.numeric=d}else{try{this.split=I(c,Ca,this.split)}catch(h){this.split= t.assign=function(a){this.normalize=J(a.normalize,!0,this.normalize);var b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){var d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(h){this.split=/\s+/}this.numeric=d}else{try{this.split=J(c,Ca,this.split)}catch(h){this.split=
/\s+/}this.numeric=I(this.numeric,!0)}this.prepare=I(a.prepare,null,this.prepare);this.finalize=I(a.finalize,null,this.finalize);Ha||(this.mapper=new Map(Ba));this.rtl=a.rtl||!1;this.dedupe=I(a.dedupe,!0,this.dedupe);this.filter=I((c=a.filter)&&new Set(c),null,this.filter);this.matcher=I((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=I((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=I((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=I(a.replacer,null,this.replacer);this.minlength= /\s+/}this.numeric=J(this.numeric,!0)}this.prepare=J(a.prepare,null,this.prepare);this.finalize=J(a.finalize,null,this.finalize);Ga||(this.mapper=new Map(Ba));this.rtl=a.rtl||!1;this.dedupe=J(a.dedupe,!0,this.dedupe);this.filter=J((c=a.filter)&&new Set(c),null,this.filter);this.matcher=J((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=J((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=J((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=J(a.replacer,null,this.replacer);this.minlength=
I(a.minlength,1,this.minlength);this.maxlength=I(a.maxlength,0,this.maxlength);if(this.cache=c=I(a.cache,!0,this.cache))this.U=null,this.L="number"===typeof c?c:2E5,this.N=new Map,this.S=new Map,this.A=this.h=128;this.B="";this.F=null;this.C="";this.G=null;if(this.matcher)for(a=x(this.matcher.keys()),b=a.next();!b.done;b=a.next())this.B+=(this.B?"|":"")+b.value;if(this.stemmer)for(a=x(this.stemmer.keys()),b=a.next();!b.done;b=a.next())this.C+=(this.C?"|":"")+b.value;return this}; J(a.minlength,1,this.minlength);this.maxlength=J(a.maxlength,0,this.maxlength);if(this.cache=c=J(a.cache,!0,this.cache))this.U=null,this.L="number"===typeof c?c:2E5,this.N=new Map,this.O=new Map,this.C=this.B=128;this.h="";this.D=null;this.A="";this.G=null;if(this.matcher)for(a=x(this.matcher.keys()),b=a.next();!b.done;b=a.next())this.h+=(this.h?"|":"")+b.value;if(this.stemmer)for(a=x(this.stemmer.keys()),b=a.next();!b.done;b=a.next())this.A+=(this.A?"|":"")+b.value;return this};
N.prototype.encode=function(a){var b=this;if(this.cache&&a.length<=this.h)if(this.U){if(this.N.has(a))return this.N.get(a)}else this.U=setTimeout(Ia,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):Ha?a.normalize("NFKD").replace(Ha,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(Ea,"$1 $2").replace(Fa,"$1 $2").replace(Da,"$1 "));for(var c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer|| t.addMatcher=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(2>a.length)return this.addMapper(a,b);this.matcher||(this.matcher=new Map);this.matcher.set(a,b);this.h+=(this.h?"|":"")+a;this.D=null;this.cache&&Ja(this);return this};t.addStemmer=function(a,b){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,b);this.A+=(this.A?"|":"")+a;this.G=null;this.cache&&Ja(this);return this};
this.replacer),d=[],e=this.split||""===this.split?a.split(this.split):a,h=0,f=void 0,g=void 0;h<e.length;h++)if((f=g=e[h])&&!(f.length<this.minlength))if(c)d.push(f);else if(!this.filter||!this.filter.has(f)){if(this.cache&&f.length<=this.A)if(this.U){var k=this.S.get(f);if(k||""===k){k&&d.push(k);continue}}else this.U=setTimeout(Ia,50,this);k=void 0;this.stemmer&&2<f.length&&(this.G||(this.G=new RegExp("(?!^)("+this.C+")$")),f=f.replace(this.G,function(q){return b.stemmer.get(q)}),k=1);f&&k&&(f.length< t.addFilter=function(a){this.filter||(this.filter=new Set);this.filter.add(a);this.cache&&Ja(this);return this};t.addMapper=function(a,b){if("object"===typeof a)return this.addReplacer(a,b);if(1<a.length)return this.addMatcher(a,b);this.mapper||(this.mapper=new Map);this.mapper.set(a,b);this.cache&&Ja(this);return this};t.addReplacer=function(a,b){"string"===typeof a&&(a=new RegExp(a,"g"));this.replacer||(this.replacer=[]);this.replacer.push(a,b||"");this.cache&&Ja(this);return this};
this.minlength||this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){k="";for(var l=0,m="",n=void 0,p=void 0;l<f.length;l++)n=f.charAt(l),n===m&&this.dedupe||((p=this.mapper&&this.mapper.get(n))||""===p?p===m&&this.dedupe||!(m=p)||(k+=p):k+=m=n);f=k}this.matcher&&1<f.length&&(this.F||(this.F=new RegExp("("+this.B+")","g")),f=f.replace(this.F,function(q){return b.matcher.get(q)}));if(f&&this.replacer)for(k=0;f&&k<this.replacer.length;k+=2)f=f.replace(this.replacer[k], function Ja(a){a.N.clear();a.O.clear()}
this.replacer[k+1]);this.cache&&g.length<=this.A&&(this.S.set(g,f),this.S.size>this.L&&(this.S.clear(),this.A=this.A/1.1|0));f&&d.push(f)}this.finalize&&(d=this.finalize(d)||d);this.cache&&a.length<=this.h&&(this.N.set(a,d),this.N.size>this.L&&(this.N.clear(),this.h=this.h/1.1|0));return d};function Ia(a){a.U=null;a.N.clear();a.S.clear()};function Ja(a){var b,c,d,e,h,f,g,k;return ta(function(l){a=a.data;b=self._index;c=a.args;d=a.task;switch(d){case "init":e=a.options||{};(h=e.config)&&(e=(await import(h))["default"]);(f=a.factory)?(Function("return "+f)()(self),self._index=new self.FlexSearch.Index(e),delete self.FlexSearch):self._index=new O(e);postMessage({id:a.id});break;default:g=a.id,k=b[d].apply(b,c),postMessage("search"===d?{id:g,msg:k}:{id:g})}l.h=0})};var Ka=0; t.encode=function(a){var b=this;if(this.cache&&a.length<=this.B)if(this.U){if(this.N.has(a))return this.N.get(a)}else this.U=setTimeout(Ka,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):Ga?a.normalize("NFKD").replace(Ga,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(Ea,"$1 $2").replace(Fa,"$1 $2").replace(Da,"$1 "));for(var c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer),
function R(a){function b(f){function g(k){k=k.data||k;var l=k.id,m=l&&e.h[l];m&&(m(k.msg),delete e.h[l])}this.worker=f;this.h=J();if(this.worker){d?this.worker.on("message",g):this.worker.onmessage=g;if(a.config)return new Promise(function(k){e.h[++Ka]=function(){k(e)};e.worker.postMessage({id:Ka,task:"init",factory:c,options:a})});this.worker.postMessage({task:"init",factory:c,options:a});return this}}a=void 0===a?{}:a;if(!this||this.constructor!==R)return new R(a);var c="undefined"!==typeof self?self._factory: d=[],e=this.split||""===this.split?a.split(this.split):a,h=0,f=void 0,g=void 0;h<e.length;h++)if((f=g=e[h])&&!(f.length<this.minlength))if(c)d.push(f);else if(!this.filter||!this.filter.has(f)){if(this.cache&&f.length<=this.C)if(this.U){var k=this.O.get(f);if(k||""===k){k&&d.push(k);continue}}else this.U=setTimeout(Ka,50,this);k=void 0;this.stemmer&&2<f.length&&(this.G||(this.G=new RegExp("(?!^)("+this.A+")$")),f=f.replace(this.G,function(q){return b.stemmer.get(q)}),k=1);f&&k&&(f.length<this.minlength||
"undefined"!==typeof window?window._factory:null;c&&(c=c.toString());var d="undefined"===typeof window,e=this,h=La(c,d,a.worker);return h.then?h.then(function(f){return b.call(e,f)}):b.call(this,h)}Ma("add");Ma("append");Ma("search");Ma("update");Ma("remove"); this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){k="";for(var l=0,m="",p=void 0,n=void 0;l<f.length;l++)p=f.charAt(l),p===m&&this.dedupe||((n=this.mapper&&this.mapper.get(p))||""===n?n===m&&this.dedupe||!(m=n)||(k+=n):k+=m=p);f=k}this.matcher&&1<f.length&&(this.D||(this.D=new RegExp("("+this.h+")","g")),f=f.replace(this.D,function(q){return b.matcher.get(q)}));if(f&&this.replacer)for(k=0;f&&k<this.replacer.length;k+=2)f=f.replace(this.replacer[k],this.replacer[k+
function Ma(a){R.prototype[a]=R.prototype[a+"Async"]=function(){var b=this,c=arguments,d,e,h,f,g;return ta(function(k){d=b;e=[].slice.call(c);h=e[e.length-1];"function"===typeof h&&(f=h,e.splice(e.length-1,1));g=new Promise(function(l){d.h[++Ka]=l;d.worker.postMessage({task:a,id:Ka,args:e})});return f?(g.then(f),k.return(b)):k.return(g)})}} 1]);this.cache&&g.length<=this.C&&(this.O.set(g,f),this.O.size>this.L&&(this.O.clear(),this.C=this.C/1.1|0));f&&d.push(f)}this.finalize&&(d=this.finalize(d)||d);this.cache&&a.length<=this.B&&(this.N.set(a,d),this.N.size>this.L&&(this.N.clear(),this.B=this.B/1.1|0));return d};function Ka(a){a.U=null;a.N.clear();a.O.clear()};function La(a){var b,c,d,e,h,f,g;return ta(function(k){a=a.data;b=self._index;c=a.args;d=a.task;switch(d){case "init":e=a.options||{};(h=a.factory)?(Function("return "+h)()(self),self._index=new self.FlexSearch.Index(e),delete self.FlexSearch):self._index=new N(e);postMessage({id:a.id});break;default:f=a.id,g=b[d].apply(b,c),postMessage("search"===d?{id:f,msg:g}:{id:f})}k.h=0})};var Ma=0;
function La(a,b,c){return b?"undefined"!==typeof module?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); }):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+Ja.toString()],{type:"text/javascript"}))):new window.Worker(K(c)?c:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js", function O(a){function b(f){function g(k){k=k.data||k;var l=k.id,m=l&&e.h[l];m&&(m(k.msg),delete e.h[l])}this.worker=f;this.h=K();if(this.worker){d?this.worker.on("message",g):this.worker.onmessage=g;if(a.config)return new Promise(function(k){e.h[++Ma]=function(){k(e)};e.worker.postMessage({id:Ma,task:"init",factory:c,options:a})});this.worker.postMessage({task:"init",factory:c,options:a});return this}}a=void 0===a?{}:a;if(!this||this.constructor!==O)return new O(a);var c="undefined"!==typeof self?self._factory:
"module/worker/worker.js"),{type:"module"})};function Na(a){Oa.call(a,"add");Oa.call(a,"append");Oa.call(a,"search");Oa.call(a,"update");Oa.call(a,"remove")}function Oa(a){this[a+"Async"]=function(){var b=arguments,c=b[b.length-1];if("function"===typeof c){var d=c;delete b[b.length-1]}b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function Pa(a,b){b=void 0===b?0:b;var c=[],d=[];b&&(b=25E4/b*5E3|0);a=x(a.entries());for(var e=a.next();!e.done;e=a.next())d.push(e.value),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}function Qa(a,b){b||(b=new Map);for(var c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b} "undefined"!==typeof window?window._factory:null;c&&(c=c.toString());var d="undefined"===typeof window,e=this,h=Na(c,d,a.worker);return h.then?h.then(function(f){return b.call(e,f)}):b.call(this,h)}Oa("add");Oa("append");Oa("search");Oa("update");Oa("remove");
function Ra(a,b){b=void 0===b?0:b;var c=[],d=[];b&&(b=25E4/b*1E3|0);a=x(a.entries());for(var e=a.next();!e.done;e=a.next())e=e.value,d.push([e[0],Pa(e[1])[0]]),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}function Sa(a,b){b||(b=new Map);for(var c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],Qa(d[1],e));return b}function Ta(a){var b=[],c=[];a=x(a.keys());for(var d=a.next();!d.done;d=a.next())c.push(d.value),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b} function Oa(a){O.prototype[a]=O.prototype[a+"Async"]=function(){var b=this,c=arguments,d,e,h,f,g;return ta(function(k){d=b;e=[].slice.call(c);h=e[e.length-1];"function"===typeof h&&(f=h,e.splice(e.length-1,1));g=new Promise(function(l){d.h[++Ma]=l;d.worker.postMessage({task:a,id:Ma,args:e})});return f?(g.then(f),k.return(b)):k.return(g)})}}
function Ua(a,b){b||(b=new Set);for(var c=0;c<a.length;c++)b.add(a[c]);return b}function Va(a,b,c,d,e,h,f){f=void 0===f?0:f;var g=d&&d.constructor===Array,k=g?d.shift():d;if(!k)return this.export(a,b,e,h+1);if((k=a((b?b+".":"")+(f+1)+"."+c,JSON.stringify(k)))&&k.then){var l=this;return k.then(function(){return Va.call(l,a,b,c,g?d:null,e,h,f+1)})}return Va.call(this,a,b,c,g?d:null,e,h,f+1)};function Wa(a,b,c,d){for(var e=[],h=0,f;h<a.index.length;h++)if(f=a.index[h],b>=f.length)b-=f.length;else{b=f[d?"splice":"slice"](b,c);if(f=b.length)if(e=e.length?e.concat(b):b,c-=f,d&&(a.length-=f),!c)break;b=0}return e} function Na(a,b,c){return b?"undefined"!==typeof module?new (require("worker_threads")["Worker"])(__dirname + "/node/node.js"):import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); }):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+La.toString()],{type:"text/javascript"}))):new window.Worker(L(c)?c:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js",
"module/worker/worker.js"),{type:"module"})};function Pa(a){Qa.call(a,"add");Qa.call(a,"append");Qa.call(a,"search");Qa.call(a,"update");Qa.call(a,"remove")}function Qa(a){this[a+"Async"]=function(){var b=arguments,c=b[b.length-1];if("function"===typeof c){var d=c;delete b[b.length-1]}b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function Ra(a,b){b=void 0===b?0:b;var c=[],d=[];b&&(b=25E4/b*5E3|0);a=x(a.entries());for(var e=a.next();!e.done;e=a.next())d.push(e.value),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}function Sa(a,b){b||(b=new Map);for(var c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b}
function Ta(a,b){b=void 0===b?0:b;var c=[],d=[];b&&(b=25E4/b*1E3|0);a=x(a.entries());for(var e=a.next();!e.done;e=a.next())e=e.value,d.push([e[0],Ra(e[1])[0]]),d.length===b&&(c.push(d),d=[]);d.length&&c.push(d);return c}function Ua(a,b){b||(b=new Map);for(var c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],Sa(d[1],e));return b}function Va(a){var b=[],c=[];a=x(a.keys());for(var d=a.next();!d.done;d=a.next())c.push(d.value),25E4===c.length&&(b.push(c),c=[]);c.length&&b.push(c);return b}
function Wa(a,b){b||(b=new Set);for(var c=0;c<a.length;c++)b.add(a[c]);return b}function Xa(a,b,c,d,e,h,f){f=void 0===f?0:f;var g=d&&d.constructor===Array,k=g?d.shift():d;if(!k)return this.export(a,b,e,h+1);if((k=a((b?b+".":"")+(f+1)+"."+c,JSON.stringify(k)))&&k.then){var l=this;return k.then(function(){return Xa.call(l,a,b,c,g?d:null,e,h,f+1)})}return Xa.call(this,a,b,c,g?d:null,e,h,f+1)};function Ya(a,b,c,d){for(var e=[],h=0,f;h<a.index.length;h++)if(f=a.index[h],b>=f.length)b-=f.length;else{b=f[d?"splice":"slice"](b,c);if(f=b.length)if(e=e.length?e.concat(b):b,c-=f,d&&(a.length-=f),!c)break;b=0}return e}
function S(a){if(!this)return new S(a);this.index=a?[a]:[];this.length=a?a.length:0;var b=this;return new Proxy([],{get:function(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){for(var h=0,f=0,g,k;f<b.index.length;f++){g=b.index[f];k=g.indexOf(e);if(0<=k)return h+k;h+=g.length}return-1};if("includes"=== function S(a){if(!this)return new S(a);this.index=a?[a]:[];this.length=a?a.length:0;var b=this;return new Proxy([],{get:function(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){for(var h=0,f=0,g,k;f<b.index.length;f++){g=b.index[f];k=g.indexOf(e);if(0<=k)return h+k;h+=g.length}return-1};if("includes"===
d)return function(e){for(var h=0;h<b.index.length;h++)if(b.index[h].includes(e))return!0;return!1};if("slice"===d)return function(e,h){return Wa(b,e||0,h||b.length,!1)};if("splice"===d)return function(e,h){return Wa(b,e||0,h||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/Math.pow(2,31)|0])&&c[d]},set:function(c,d,e){c=d/Math.pow(2,31)|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}S.prototype.clear=function(){this.index.length=0}; d)return function(e){for(var h=0;h<b.index.length;h++)if(b.index[h].includes(e))return!0;return!1};if("slice"===d)return function(e,h){return Ya(b,e||0,h||b.length,!1)};if("splice"===d)return function(e,h){return Ya(b,e||0,h||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/Math.pow(2,31)|0])&&c[d]},set:function(c,d,e){c=d/Math.pow(2,31)|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}S.prototype.clear=function(){this.index.length=0};
S.prototype.destroy=function(){this.proxy=this.index=null};S.prototype.push=function(){};function T(a){a=void 0===a?8:a;if(!this)return new T(a);this.index=J();this.B=[];this.size=0;32<a?(this.h=Xa,this.A=BigInt(a)):(this.h=Ya,this.A=a)}T.prototype.get=function(a){var b=this.h(a);return(b=this.index[b])&&b.get(a)};T.prototype.set=function(a,b){var c=this.h(a),d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.B.push(d))}; S.prototype.destroy=function(){this.proxy=this.index=null};S.prototype.push=function(){};function T(a){a=void 0===a?8:a;if(!this)return new T(a);this.index=K();this.B=[];this.size=0;32<a?(this.h=Za,this.A=BigInt(a)):(this.h=$a,this.A=a)}T.prototype.get=function(a){var b=this.h(a);return(b=this.index[b])&&b.get(a)};T.prototype.set=function(a,b){var c=this.h(a),d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.B.push(d))};
function U(a){a=void 0===a?8:a;if(!this)return new U(a);this.index=J();this.h=[];32<a?(this.B=Xa,this.A=BigInt(a)):(this.B=Ya,this.A=a)}U.prototype.add=function(a){var b=this.B(a),c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};u=T.prototype;u.has=U.prototype.has=function(a){var b=this.B(a);return(b=this.index[b])&&b.has(a)};u.delete=U.prototype.delete=function(a){var b=this.B(a);(b=this.index[b])&&b.delete(a)&&this.size--}; function U(a){a=void 0===a?8:a;if(!this)return new U(a);this.index=K();this.h=[];32<a?(this.B=Za,this.A=BigInt(a)):(this.B=$a,this.A=a)}U.prototype.add=function(a){var b=this.B(a),c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};t=T.prototype;t.has=U.prototype.has=function(a){var b=this.B(a);return(b=this.index[b])&&b.has(a)};t.delete=U.prototype.delete=function(a){var b=this.B(a);(b=this.index[b])&&b.delete(a)&&this.size--};
u.clear=U.prototype.clear=function(){this.index=J();this.h=[];this.size=0};u.values=U.prototype.values=function Za(){var b,c=this,d,e,h;return ra(Za,function(f){switch(f.h){case 1:b=0;case 2:if(!(b<c.h.length)){f.h=0;break}d=x(c.h[b].values());e=d.next();case 5:if(e.done){b++;f.h=2;break}h=e.value;return G(f,h,6);case 6:e=d.next(),f.h=5}})}; t.clear=U.prototype.clear=function(){this.index=K();this.h=[];this.size=0};t.values=U.prototype.values=function ab(){var b,c=this,d,e,h;return ra(ab,function(f){switch(f.h){case 1:b=0;case 2:if(!(b<c.h.length)){f.h=0;break}d=x(c.h[b].values());e=d.next();case 5:if(e.done){b++;f.h=2;break}h=e.value;return H(f,h,6);case 6:e=d.next(),f.h=5}})};
u.keys=U.prototype.keys=function $a(){var b,c=this,d,e,h;return ra($a,function(f){switch(f.h){case 1:b=0;case 2:if(!(b<c.h.length)){f.h=0;break}d=x(c.h[b].keys());e=d.next();case 5:if(e.done){b++;f.h=2;break}h=e.value;return G(f,h,6);case 6:e=d.next(),f.h=5}})}; t.keys=U.prototype.keys=function bb(){var b,c=this,d,e,h;return ra(bb,function(f){switch(f.h){case 1:b=0;case 2:if(!(b<c.h.length)){f.h=0;break}d=x(c.h[b].keys());e=d.next();case 5:if(e.done){b++;f.h=2;break}h=e.value;return H(f,h,6);case 6:e=d.next(),f.h=5}})};
u.entries=U.prototype.entries=function ab(){var b,c=this,d,e,h;return ra(ab,function(f){switch(f.h){case 1:b=0;case 2:if(!(b<c.h.length)){f.h=0;break}d=x(c.h[b].entries());e=d.next();case 5:if(e.done){b++;f.h=2;break}h=e.value;return G(f,h,6);case 6:e=d.next(),f.h=5}})};function Ya(a){var b=Math.pow(2,this.A)-1;if("number"==typeof a)return a&b;for(var c=0,d=this.A+1,e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.A?c+Math.pow(2,31):c} t.entries=U.prototype.entries=function cb(){var b,c=this,d,e,h;return ra(cb,function(f){switch(f.h){case 1:b=0;case 2:if(!(b<c.h.length)){f.h=0;break}d=x(c.h[b].entries());e=d.next();case 5:if(e.done){b++;f.h=2;break}h=e.value;return H(f,h,6);case 6:e=d.next(),f.h=5}})};function $a(a){var b=Math.pow(2,this.A)-1;if("number"==typeof a)return a&b;for(var c=0,d=this.A+1,e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.A?c+Math.pow(2,31):c}
function Xa(){throw Error("The keystore is limited to 32 for EcmaScript5");};V.prototype.add=function(a,b,c){M(a)&&(b=a,a=za(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(var d=0,e;d<this.field.length;d++){e=this.I[d];var h=this.index.get(this.field[d]);if("function"===typeof e)(e=e(b))&&h.add(a,e,!1,!0);else{var f=e.R;if(!f||f(b))e.constructor===String?e=[""+e]:K(e)&&(e=[e]),bb(b,e,this.T,0,h,a,e[0],c)}}if(this.tag)for(d=0;d<this.M.length;d++){f=this.M[d];h=this.tag.get(this.$[d]);e=J();if("function"===typeof f){if(f=f(b),!f)continue}else{var g= function Za(){throw Error("The keystore is limited to 32 for EcmaScript5");};V.prototype.add=function(a,b,c){M(a)&&(b=a,a=za(b,this.key));if(b&&(a||0===a)){if(!c&&this.reg.has(a))return this.update(a,b);for(var d=0,e;d<this.field.length;d++){e=this.I[d];var h=this.index.get(this.field[d]);if("function"===typeof e)(e=e(b))&&h.add(a,e,!1,!0);else{var f=e.S;if(!f||f(b))e.constructor===String?e=[""+e]:L(e)&&(e=[e]),db(b,e,this.T,0,h,a,e[0],c)}}if(this.tag)for(d=0;d<this.M.length;d++){f=this.M[d];h=this.tag.get(this.$[d]);e=K();if("function"===typeof f){if(f=f(b),!f)continue}else{var g=
f.R;if(g&&!g(b))continue;f.constructor===String&&(f=""+f);f=za(b,f)}if(h&&f){K(f)&&(f=[f]);g=0;for(var k,l=void 0;g<f.length;g++)if(k=f[g],!e[k]){e[k]=1;var m;(m=h.get(k))?l=m:h.set(k,l=[]);if(!c||!l.includes(a)){if(l.length===Math.pow(2,31)-1){m=new S(l);if(this.fastupdate)for(var n=x(this.reg.values()),p=n.next();!p.done;p=n.next())p=p.value,p.includes(l)&&(p[p.indexOf(l)]=m);h.set(k,l=m)}l.push(a);this.fastupdate&&((k=this.reg.get(a))?k.push(l):this.reg.set(a,[l]))}}}}if(this.store&&(!c||!this.store.has(a))){if(this.H){var q= f.S;if(g&&!g(b))continue;f.constructor===String&&(f=""+f);f=za(b,f)}if(h&&f){L(f)&&(f=[f]);g=0;for(var k,l=void 0;g<f.length;g++)if(k=f[g],!e[k]){e[k]=1;var m;(m=h.get(k))?l=m:h.set(k,l=[]);if(!c||!l.includes(a)){if(l.length===Math.pow(2,31)-1){m=new S(l);if(this.fastupdate)for(var p=x(this.reg.values()),n=p.next();!n.done;n=p.next())n=n.value,n.includes(l)&&(n[n.indexOf(l)]=m);h.set(k,l=m)}l.push(a);this.fastupdate&&((k=this.reg.get(a))?k.push(l):this.reg.set(a,[l]))}}}}if(this.store&&(!c||!this.store.has(a))){if(this.H){var q=
J();for(c=0;c<this.H.length;c++)if(d=this.H[c],h=d.R,!h||h(b)){h=void 0;if("function"===typeof d){h=d(b);if(!h)continue;d=[d.la]}else if(K(d)||d.constructor===String){q[d]=b[d];continue}cb(b,q,d,0,d[0],h)}}this.store.set(a,q||b)}}return this};function cb(a,b,c,d,e,h){a=a[e];if(d===c.length-1)b[e]=h||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)cb(a,b,c,d,e);else b=b[e]||(b[e]=J()),e=c[++d],cb(a,b,c,d,e)} K();for(c=0;c<this.H.length;c++)if(d=this.H[c],h=d.S,!h||h(b)){h=void 0;if("function"===typeof d){h=d(b);if(!h)continue;d=[d.la]}else if(L(d)||d.constructor===String){q[d]=b[d];continue}eb(b,q,d,0,d[0],h)}}this.store.set(a,q||b)}}return this};function eb(a,b,c,d,e,h){a=a[e];if(d===c.length-1)b[e]=h||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)eb(a,b,c,d,e);else b=b[e]||(b[e]=K()),e=c[++d],eb(a,b,c,d,e)}
function bb(a,b,c,d,e,h,f,g){if(a=a[f])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(h,a[b],!0,!0);return}a=a.join(" ")}e.add(h,a,g,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)bb(a,b,c,d,e,h,f,g);else f=b[++d],bb(a,b,c,d,e,h,f,g);else e.db&&e.remove(h)};function db(a,b,c,d,e,h,f){var g=a.length,k=[],l;var m=J();for(var n=0,p=void 0,q;n<b;n++)for(var r=0;r<g;r++)if(q=a[r],n<q.length&&(p=q[n]))for(var v=0;v<p.length;v++){q=p[v];(l=m[q])?m[q]++:(l=0,m[q]=1);l=k[l]||(k[l]=[]);if(!f){var w=n+(r?0:h||0);l=l[w]||(l[w]=[])}l.push(q)}if(a=k.length)if(e)k=1<k.length?eb(k,d,c,f,0):(k=k[0]).length>c||d?k.slice(d,c+d):k;else{if(a<g)return[];k=k[a-1];if(c||d)if(f){if(k.length>c||d)k=k.slice(d,c+d)}else{e=[];for(f=0;f<k.length;f++)if(g=k[f],g.length>d)d-=g.length; function db(a,b,c,d,e,h,f,g){if(a=a[f])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(h,a[b],!0,!0);return}a=a.join(" ")}e.add(h,a,g,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)db(a,b,c,d,e,h,f,g);else f=b[++d],db(a,b,c,d,e,h,f,g);else e.db&&e.remove(h)};function fb(a,b,c,d,e,h,f){var g=a.length,k=[],l;var m=K();for(var p=0,n=void 0,q;p<b;p++)for(var r=0;r<g;r++)if(q=a[r],p<q.length&&(n=q[p]))for(var v=0;v<n.length;v++){q=n[v];(l=m[q])?m[q]++:(l=0,m[q]=1);l=k[l]||(k[l]=[]);if(!f){var y=p+(r?0:h||0);l=l[y]||(l[y]=[])}l.push(q)}if(a=k.length)if(e)k=1<k.length?gb(k,d,c,f,0):(k=k[0]).length>c||d?k.slice(d,c+d):k;else{if(a<g)return[];k=k[a-1];if(c||d)if(f){if(k.length>c||d)k=k.slice(d,c+d)}else{e=[];for(f=0;f<k.length;f++)if(g=k[f],g.length>d)d-=g.length;
else{if(g.length>c||d)g=g.slice(d,c+d),c-=g.length,d&&(d-=g.length);e.push(g);if(!c)break}k=1<e.length?[].concat.apply([],e):e[0]}}return k} else{if(g.length>c||d)g=g.slice(d,c+d),c-=g.length,d&&(d-=g.length);e.push(g);if(!c)break}k=1<e.length?[].concat.apply([],e):e[0]}}return k}
function eb(a,b,c,d,e){var h=[],f=J(),g=a.length,k=0;if(d)for(e=g-1;0<=e;e--){d=a[e];var l=d.length;for(g=0;g<l;g++){var m=d[g];if(!f[m])if(f[m]=1,b)b--;else if(h.push(m),h.length===c)return h}}else for(var n=Aa(a),p=0;p<n;p++)for(var q=g-1;0<=q;q--)if(l=(d=a[q][p])&&d.length)for(var r=0;r<l;r++)if(m=d[r],!f[m])if(f[m]=1,b)b--;else{var v=p+(q<g-1?e||0:0);(h[v]||(h[v]=[])).push(m);if(++k===c)return h}return h} function gb(a,b,c,d,e){var h=[],f=K(),g=a.length,k=0;if(d)for(e=g-1;0<=e;e--){d=a[e];var l=d.length;for(g=0;g<l;g++){var m=d[g];if(!f[m])if(f[m]=1,b)b--;else if(h.push(m),h.length===c)return h}}else for(var p=Aa(a),n=0;n<p;n++)for(var q=g-1;0<=q;q--)if(l=(d=a[q][n])&&d.length)for(var r=0;r<l;r++)if(m=d[r],!f[m])if(f[m]=1,b)b--;else{var v=n+(q<g-1?e||0:0);(h[v]||(h[v]=[])).push(m);if(++k===c)return h}return h}
function fb(a,b){for(var c=J(),d=[],e=0,h;e<b.length;e++){h=b[e];for(var f=0;f<h.length;f++)c[h[f]]=1}for(b=0;b<a.length;b++)e=a[b],1===c[e]&&(d.push(e),c[e]=2);return d};V.prototype.search=function(a,b,c,d){c||(!b&&M(a)?(c=a,a=""):M(b)&&(c=b,b=0));var e=[],h=[],f=0;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;var g=c.pluck;var k=c.merge;var l=g||c.field||c.index;var m=this.tag&&c.tag;var n=this.store&&c.enrich;var p=c.suggest;var q=c.highlight;b=c.limit||b;var r=c.offset||0;b||(b=100);if(m&&(!this.db||!d)){m.constructor!==Array&&(m=[m]);for(var v=[],w=0,y=void 0;w<m.length;w++)if(y=m[w],y.field&&y.tag){var t=y.tag;if(t.constructor===Array)for(var z=0;z< function hb(a,b){for(var c=K(),d=[],e=0,h;e<b.length;e++){h=b[e];for(var f=0;f<h.length;f++)c[h[f]]=1}for(b=0;b<a.length;b++)e=a[b],1===c[e]&&(d.push(e),c[e]=2);return d};V.prototype.search=function(a,b,c,d){c||(!b&&M(a)?(c=a,a=""):M(b)&&(c=b,b=0));var e=[],h=[],f=0;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;var g=c.pluck;var k=c.merge;var l=g||c.field||c.index;var m=this.tag&&c.tag;var p=this.store&&c.enrich;var n=c.suggest;var q=c.highlight;b=c.limit||b;var r=c.offset||0;b||(b=100);if(m&&(!this.db||!d)){m.constructor!==Array&&(m=[m]);for(var v=[],y=0,z=void 0;y<m.length;y++)if(z=m[y],z.field&&z.tag){var u=z.tag;if(u.constructor===Array)for(var w=0;w<
t.length;z++)v.push(y.field,t[z]);else v.push(y.field,t)}else{t=Object.keys(y);z=0;for(var A=void 0,B=void 0;z<t.length;z++)if(A=t[z],B=y[A],B.constructor===Array)for(var D=0;D<B.length;D++)v.push(A,B[D]);else v.push(A,B)}m=v;if(!a){h=[];if(v.length)for(g=0;g<v.length;g+=2){p=void 0;if(this.db){p=this.index.get(v[g]);if(!p)continue;h.push(p=p.db.tag(v[g+1],b,r,n))}else p=gb.call(this,v[g],v[g+1],b,r,n);e.push({field:v[g],tag:v[g+1],result:p})}return h.length?Promise.all(h).then(function(P){for(var Q= u.length;w++)v.push(z.field,u[w]);else v.push(z.field,u)}else{u=Object.keys(z);w=0;for(var A=void 0,D=void 0;w<u.length;w++)if(A=u[w],D=z[A],D.constructor===Array)for(var B=0;B<D.length;B++)v.push(A,D[B]);else v.push(A,D)}m=v;if(!a){h=[];if(v.length)for(g=0;g<v.length;g+=2){n=void 0;if(this.db){n=this.index.get(v[g]);if(!n)continue;h.push(n=n.db.tag(v[g+1],b,r,p))}else n=ib.call(this,v[g],v[g+1],b,r,p);e.push({field:v[g],tag:v[g+1],result:n})}return h.length?Promise.all(h).then(function(P){for(var Q=
0;Q<P.length;Q++)e[Q].result=P[Q];return e}):e}}K(l)&&(l=[l])}l||(l=this.field);v=!d&&(this.worker||this.db)&&[];w=0;for(z=y=t=void 0;w<l.length;w++)if(y=l[w],!this.db||!this.tag||this.I[w]){t=void 0;K(y)||(t=y,y=t.field,a=t.query||a,b=t.limit||b,r=t.offset||r,p=t.suggest||p,n=this.store&&(t.enrich||n));if(d)t=d[w];else{z=t||c;t=this.index.get(y);if(m){if(this.db){z.tag=m;var F=t.db.support_tag_search;z.field=l}F||(z.enrich=!1)}if(v){v[w]=t.search(a,b,z);z&&n&&(z.enrich=n);continue}else t=t.search(a, 0;Q<P.length;Q++)e[Q].result=P[Q];return e}):e}}L(l)&&(l=[l])}l||(l=this.field);v=!d&&(this.worker||this.db)&&[];y=0;for(w=z=u=void 0;y<l.length;y++)if(z=l[y],!this.db||!this.tag||this.I[y]){u=void 0;L(z)||(u=z,z=u.field,a=u.query||a,b=u.limit||b,r=u.offset||r,n=u.suggest||n,p=this.store&&(u.enrich||p));if(d)u=d[y];else{w=u||c;u=this.index.get(z);if(m){if(this.db){w.tag=m;var R=u.db.support_tag_search;w.field=l}R||(w.enrich=!1)}if(v){v[y]=u.search(a,b,w);w&&p&&(w.enrich=p);continue}else u=u.search(a,
b,z),z&&n&&(z.enrich=n)}z=t&&t.length;if(m&&z){A=[];B=0;if(this.db&&d){if(!F)for(D=l.length;D<d.length;D++){var L=d[D];if(L&&L.length)B++,A.push(L);else if(!p)return e}}else{D=0;for(var Nb=L=void 0;D<m.length;D+=2){L=this.tag.get(m[D]);if(!L)if(p)continue;else return e;if(Nb=(L=L&&L.get(m[D+1]))&&L.length)B++,A.push(L);else if(!p)return e}}if(B){t=fb(t,A);z=t.length;if(!z&&!p)return e;B--}}if(z)h[f]=y,e.push(t),f++;else if(1===l.length)return e}if(v){if(this.db&&m&&m.length&&!F)for(n=0;n<m.length;n+= b,w),w&&p&&(w.enrich=p)}w=u&&u.length;if(m&&w){A=[];D=0;if(this.db&&d){if(!R)for(B=l.length;B<d.length;B++){var F=d[B];if(F&&F.length)D++,A.push(F);else if(!n)return e}}else{B=0;for(var G=F=void 0;B<m.length;B+=2){F=this.tag.get(m[B]);if(!F)if(n)continue;else return e;if(G=(F=F&&F.get(m[B+1]))&&F.length)D++,A.push(F);else if(!n)return e}}if(D){u=hb(u,A);w=u.length;if(!w&&!n)return e;D--}}if(w)h[f]=z,e.push(u),f++;else if(1===l.length)return e}if(v){if(this.db&&m&&m.length&&!R)for(p=0;p<m.length;p+=
2){h=this.index.get(m[n]);if(!h)if(p)continue;else return e;v.push(h.db.tag(m[n+1],b,r,!1))}var Ob=this;return Promise.all(v).then(function(P){return P.length?Ob.search(a,b,c,P):P})}if(!f)return e;if(g&&(!n||!this.store))return e[0];v=[];r=0;for(p=void 0;r<h.length;r++){p=e[r];n&&p.length&&!p[0].doc&&(this.db?v.push(p=this.index.get(this.field[0]).db.enrich(p)):p.length&&(p=hb.call(this,p)));if(g)return p;e[r]={field:h[r],result:p}}if(n&&this.db&&v.length){var Ga=this;return Promise.all(v).then(function(P){for(var Q= 2){h=this.index.get(m[p]);if(!h)if(n)continue;else return e;v.push(h.db.tag(m[p+1],b,r,!1))}var Pb=this;return Promise.all(v).then(function(P){return P.length?Pb.search(a,b,c,P):P})}if(!f)return e;if(g&&(!p||!this.store))return e[0];v=[];r=0;for(n=void 0;r<h.length;r++){n=e[r];p&&n.length&&!n[0].doc&&(this.db?v.push(n=this.index.get(this.field[0]).db.enrich(n)):n.length&&(n=jb.call(this,n)));if(g)return n;e[r]={field:h[r],result:n}}if(p&&this.db&&v.length){var Ia=this;return Promise.all(v).then(function(P){for(var Q=
0;Q<P.length;Q++)e[Q].result=P[Q];return k?ib(e,b):q?jb(e,a,Ga.index,Ga.field,Ga.I,q):e})}return k?ib(e,b):q?jb(e,a,this.index,this.field,this.I,q):e}; 0;Q<P.length;Q++)e[Q].result=P[Q];return k?kb(e,b):q?lb(e,a,Ia.index,Ia.field,Ia.I,q):e})}return k?kb(e,b):q?lb(e,a,this.index,this.field,this.I,q):e};
function jb(a,b,c,d,e,h){for(var f,g,k,l=0,m,n,p;l<a.length;l++)for(m=a[l].result,n=a[l].field,k=c.get(n),p=k.encoder,k=k.tokenize,n=e[d.indexOf(n)],p!==f&&(f=p,g=f.encode(b)),p=0;p<m.length;p++){var q="",r=za(m[p].doc,n),v=f.encode(r);r=r.split(f.split);for(var w=0,y,t;w<v.length;w++){y=v[w];t=r[w];for(var z=void 0,A=0,B;A<g.length;A++)if(B=g[A],"strict"===k){if(y===B){q+=(q?" ":"")+h.replace("$1",t);z=!0;break}}else{var D=y.indexOf(B);if(-1<D){q+=(q?" ":"")+t.substring(0,D)+h.replace("$1",t.substring(D, function lb(a,b,c,d,e,h){for(var f,g,k,l=0,m,p,n;l<a.length;l++)for(m=a[l].result,p=a[l].field,k=c.get(p),n=k.encoder,k=k.tokenize,p=e[d.indexOf(p)],n!==f&&(f=n,g=f.encode(b)),n=0;n<m.length;n++){var q="",r=za(m[n].doc,p),v=f.encode(r);r=r.split(f.split);for(var y=0,z,u;y<v.length;y++){z=v[y];u=r[y];for(var w=void 0,A=0,D;A<g.length;A++)if(D=g[A],"strict"===k){if(z===D){q+=(q?" ":"")+h.replace("$1",u);w=!0;break}}else{var B=z.indexOf(D);if(-1<B){q+=(q?" ":"")+u.substring(0,B)+h.replace("$1",u.substring(B,
B.length))+t.substring(D+B.length);z=!0;break}}z||(q+=(q?" ":"")+r[w])}m[p].highlight=q}return a}function ib(a,b){for(var c=[],d=J(),e=0,h,f;e<a.length;e++){h=a[e];f=h.result;for(var g=0,k,l,m;g<f.length;g++)if(l=f[g],k=l.id,m=d[k])m.push(h.field);else{if(c.length===b)return c;l.field=d[k]=[h.field];c.push(l)}}return c}function gb(a,b,c,d,e){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-d)&&0<b){if(b>c||d)a=a.slice(d,d+c);e&&(a=hb.call(this,a));return a}} D.length))+u.substring(B+D.length);w=!0;break}}w||(q+=(q?" ":"")+r[y])}m[n].highlight=q}return a}function kb(a,b){for(var c=[],d=K(),e=0,h,f;e<a.length;e++){h=a[e];f=h.result;for(var g=0,k,l,m;g<f.length;g++)if(l=f[g],k=l.id,m=d[k])m.push(h.field);else{if(c.length===b)return c;l.field=d[k]=[h.field];c.push(l)}}return c}function ib(a,b,c,d,e){a=this.tag.get(a);if(!a)return[];if((b=(a=a&&a.get(b))&&a.length-d)&&0<b){if(b>c||d)a=a.slice(d,d+c);e&&(a=jb.call(this,a));return a}}
function hb(a){for(var b=Array(a.length),c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function V(a){if(!this||this.constructor!==V)return new V(a);var b=a.document||a.doc||a,c,d;this.I=[];this.field=[];this.T=[];this.key=(c=b.key||b.id)&&kb(c,this.T)||"id";(d=a.keystore||0)&&(this.keystore=d);this.reg=(this.fastupdate=!!a.fastupdate)?d?new T(d):new Map:d?new U(d):new Set;this.H=(c=b.store||null)&&!0!==c&&[];this.store=c&&(d?new T(d):new Map);this.cache=(c=a.cache||null)&&new W(c);a.cache=!1;this.worker=a.worker;this.index=lb.call(this,a,b);this.tag=null;if(c=b.tag)if("string"===typeof c&& function jb(a){for(var b=Array(a.length),c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function V(a){if(!this||this.constructor!==V)return new V(a);var b=a.document||a.doc||a,c,d;this.I=[];this.field=[];this.T=[];this.key=(c=b.key||b.id)&&mb(c,this.T)||"id";(d=a.keystore||0)&&(this.keystore=d);this.reg=(this.fastupdate=!!a.fastupdate)?d?new T(d):new Map:d?new U(d):new Set;this.H=(c=b.store||null)&&c&&!0!==c&&[];this.store=c&&(d?new T(d):new Map);this.cache=(c=a.cache||null)&&new W(c);a.cache=!1;this.worker=a.worker;this.index=nb.call(this,a,b);this.tag=null;if(c=b.tag)if("string"===
(c=[c]),c.length){this.tag=new Map;this.M=[];this.$=[];b=0;for(var e=d=void 0;b<c.length;b++){d=c[b];e=d.field||d;if(!e)throw Error("The tag field from the document descriptor is undefined.");d.custom?this.M[b]=d.custom:(this.M[b]=kb(e,this.T),d.filter&&("string"===typeof this.M[b]&&(this.M[b]=new String(this.M[b])),this.M[b].R=d.filter));this.$[b]=e;this.tag.set(e,new Map)}}if(this.worker){a=[];c=x(this.index.values());for(b=c.next();!b.done;b=c.next())b=b.value,b.then&&a.push(b);if(a.length){var h= typeof c&&(c=[c]),c.length){this.tag=new Map;this.M=[];this.$=[];b=0;for(var e=d=void 0;b<c.length;b++){d=c[b];e=d.field||d;if(!e)throw Error("The tag field from the document descriptor is undefined.");d.custom?this.M[b]=d.custom:(this.M[b]=mb(e,this.T),d.filter&&("string"===typeof this.M[b]&&(this.M[b]=new String(this.M[b])),this.M[b].S=d.filter));this.$[b]=e;this.tag.set(e,new Map)}}if(this.worker){a=[];c=x(this.index.values());for(b=c.next();!b.done;b=c.next())b=b.value,b.then&&a.push(b);if(a.length){var h=
this;return Promise.all(a).then(function(f){for(var g=0,k=x(h.index.entries()),l=k.next();!l.done;l=k.next()){l=l.value;var m=l[0];l[1].then&&h.index.set(m,f[g++])}return h})}}else a.db&&this.mount(a.db)}u=V.prototype; this;return Promise.all(a).then(function(f){for(var g=0,k=x(h.index.entries()),l=k.next();!l.done;l=k.next()){l=l.value;var m=l[0];l[1].then&&h.index.set(m,f[g++])}return h})}}else a.db&&this.mount(a.db)}t=V.prototype;
u.mount=function(a){var b=this.field;if(this.tag)for(var c=0,d;c<this.$.length;c++){d=this.$[c];var e;this.index.set(d,e=new O({},this.reg));b===this.field&&(b=b.slice(0));b.push(d);e.tag=this.tag.get(d)}c=[];d={db:a.db,type:a.type,fastupdate:a.fastupdate};e=0;for(var h;e<b.length;e++){d.field=h=b[e];h=this.index.get(h);var f=new a.constructor(a.id,d);f.id=a.id;c[e]=f.mount(h);h.document=!0;e?h.bypass=!0:h.store=this.store}this.db=!0;return Promise.all(c)}; t.mount=function(a){var b=this.field;if(this.tag)for(var c=0,d;c<this.$.length;c++){d=this.$[c];var e;this.index.set(d,e=new N({},this.reg));b===this.field&&(b=b.slice(0));b.push(d);e.tag=this.tag.get(d)}c=[];d={db:a.db,type:a.type,fastupdate:a.fastupdate};e=0;for(var h;e<b.length;e++){d.field=h=b[e];h=this.index.get(h);var f=new a.constructor(a.id,d);f.id=a.id;c[e]=f.mount(h);h.document=!0;e?h.bypass=!0:h.store=this.store}this.db=!0;return Promise.all(c)};
u.commit=function(a,b){var c=this,d,e,h,f;return ta(function(g){if(1==g.h){d=[];e=x(c.index.values());for(h=e.next();!h.done;h=e.next())f=h.value,d.push(f.db.commit(f,a,b));return G(g,Promise.all(d),2)}c.reg.clear();g.h=0})};u.destroy=function(){for(var a=[],b=x(this.index.values()),c=b.next();!c.done;c=b.next())a.push(c.value.destroy());return Promise.all(a)}; t.commit=function(a,b){var c=this,d,e,h,f;return ta(function(g){if(1==g.h){d=[];e=x(c.index.values());for(h=e.next();!h.done;h=e.next())f=h.value,d.push(f.db.commit(f,a,b));return H(g,Promise.all(d),2)}c.reg.clear();g.h=0})};t.destroy=function(){for(var a=[],b=x(this.index.values()),c=b.next();!c.done;c=b.next())a.push(c.value.destroy());return Promise.all(a)};
function lb(a,b){var c=new Map,d=b.index||b.field||b;K(d)&&(d=[d]);for(var e=0,h,f=void 0;e<d.length;e++){h=d[e];K(h)||(f=h,h=h.field);f=M(f)?Object.assign({},a,f):a;if(this.worker){var g=new R(f);c.set(h,g)}this.worker||c.set(h,new O(f,this.reg));f.custom?this.I[e]=f.custom:(this.I[e]=kb(h,this.T),f.filter&&("string"===typeof this.I[e]&&(this.I[e]=new String(this.I[e])),this.I[e].R=f.filter));this.field[e]=h}if(this.H)for(a=b.store,K(a)&&(a=[a]),b=0;b<a.length;b++)d=a[b],e=d.field||d,d.custom?(this.H[b]= function nb(a,b){var c=new Map,d=b.index||b.field||b;L(d)&&(d=[d]);for(var e=0,h,f=void 0;e<d.length;e++){h=d[e];L(h)||(f=h,h=h.field);f=M(f)?Object.assign({},a,f):a;if(this.worker){var g=new O(f);c.set(h,g)}this.worker||c.set(h,new N(f,this.reg));f.custom?this.I[e]=f.custom:(this.I[e]=mb(h,this.T),f.filter&&("string"===typeof this.I[e]&&(this.I[e]=new String(this.I[e])),this.I[e].S=f.filter));this.field[e]=h}if(this.H)for(a=b.store,L(a)&&(a=[a]),b=0;b<a.length;b++)d=a[b],e=d.field||d,d.custom?(this.H[b]=
d.custom,d.custom.la=e):(this.H[b]=kb(e,this.T),d.filter&&("string"===typeof this.H[b]&&(this.H[b]=new String(this.H[b])),this.H[b].R=d.filter));return c}function kb(a,b){for(var c=a.split(":"),d=0,e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}u.append=function(a,b){return this.add(a,b,!0)};u.update=function(a,b){return this.remove(a).add(a,b)}; d.custom,d.custom.la=e):(this.H[b]=mb(e,this.T),d.filter&&("string"===typeof this.H[b]&&(this.H[b]=new String(this.H[b])),this.H[b].S=d.filter));return c}function mb(a,b){for(var c=a.split(":"),d=0,e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
u.remove=function(a){M(a)&&(a=za(a,this.key));for(var b=x(this.index.values()),c=b.next();!c.done;c=b.next())c.value.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(b=x(this.tag.values()),c=b.next();!c.done;c=b.next()){c=c.value;for(var d=x(c),e=d.next();!e.done;e=d.next()){var h=e.value;e=h[0];h=h[1];var f=h.indexOf(a);-1<f&&(1<h.length?h.splice(f,1):c.delete(e))}}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; t.remove=function(a){M(a)&&(a=za(a,this.key));for(var b=x(this.index.values()),c=b.next();!c.done;c=b.next())c.value.remove(a,!0);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(b=x(this.tag.values()),c=b.next();!c.done;c=b.next()){c=c.value;for(var d=x(c),e=d.next();!e.done;e=d.next()){var h=e.value;e=h[0];h=h[1];var f=h.indexOf(a);-1<f&&(1<h.length?h.splice(f,1):c.delete(e))}}this.store&&this.store.delete(a);this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
u.clear=function(){for(var a=x(this.index.values()),b=a.next();!b.done;b=a.next())b.value.clear();if(this.tag)for(a=x(this.tag.values()),b=a.next();!b.done;b=a.next())b.value.clear();this.store&&this.store.clear();return this};u.contain=function(a){return this.db?this.index.get(this.field[0]).db.has(a):this.reg.has(a)};u.cleanup=function(){for(var a=x(this.index.values()),b=a.next();!b.done;b=a.next())b.value.cleanup();return this}; t.clear=function(){for(var a=x(this.index.values()),b=a.next();!b.done;b=a.next())b.value.clear();if(this.tag)for(a=x(this.tag.values()),b=a.next();!b.done;b=a.next())b.value.clear();this.store&&this.store.clear();return this};t.contain=function(a){return this.db?this.index.get(this.field[0]).db.has(a):this.reg.has(a)};t.cleanup=function(){for(var a=x(this.index.values()),b=a.next();!b.done;b=a.next())b.value.cleanup();return this};
u.get=function(a){return this.db?this.index.get(this.field[0]).db.enrich(a).then(function(b){return b[0]&&b[0].doc}):this.store.get(a)};u.set=function(a,b){this.store.set(a,b);return this};u.searchCache=mb; t.get=function(a){return this.db?this.index.get(this.field[0]).db.enrich(a).then(function(b){return b[0]&&b[0].doc}):this.store.get(a)};t.set=function(a,b){this.store.set(a,b);return this};t.searchCache=ob;
u.export=function(a,b,c,d){c=void 0===c?0:c;d=void 0===d?0:d;if(c<this.field.length){var e=this.field[c];if((b=this.index.get(e).export(a,e,c,d=1))&&b.then){var h=this;return b.then(function(){return h.export(a,e,c+1)})}return this.export(a,e,c+1)}switch(d){case 0:var f="reg";var g=Ta(this.reg);b=null;break;case 1:f="tag";g=Ra(this.tag,this.reg.size);b=null;break;case 2:f="doc";g=Pa(this.store);b=null;break;case 3:f="cfg";g={};b=null;break;default:return}return Va.call(this,a,b,f,g,c,d)}; t.export=function(a,b,c,d){c=void 0===c?0:c;d=void 0===d?0:d;if(c<this.field.length){var e=this.field[c];if((b=this.index.get(e).export(a,e,c,d=1))&&b.then){var h=this;return b.then(function(){return h.export(a,e,c+1)})}return this.export(a,e,c+1)}switch(d){case 0:var f="reg";var g=Va(this.reg);b=null;break;case 1:f="tag";g=Ta(this.tag,this.reg.size);b=null;break;case 2:f="doc";g=Ra(this.store);b=null;break;case 3:f="cfg";g={};b=null;break;default:return}return Xa.call(this,a,b,f,g,c,d)};
u.import=function(a,b){if(b){K(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=Ua(b,this.reg);for(b=0;b<this.field.length;b++)c=this.index.get(this.field[b]),c.fastupdate=!1,c.reg=this.reg;break;case "tag":this.tag=Sa(b,this.tag);break;case "doc":this.store=Qa(b,this.store)}}};Na(V.prototype);function mb(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();var d=this.cache.get(a);if(!d){d=this.search(a,b,c);if(d.then){var e=this;d.then(function(h){e.cache.set(a,h);return h})}this.cache.set(a,d)}return d}function W(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}W.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)}; t.import=function(a,b){if(b){L(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.fastupdate=!1;this.reg=Wa(b,this.reg);for(b=0;b<this.field.length;b++)c=this.index.get(this.field[b]),c.fastupdate=!1,c.reg=this.reg;break;case "tag":this.tag=Ua(b,this.tag);break;case "doc":this.store=Sa(b,this.store)}}};Pa(V.prototype);function ob(a,b,c){a=("object"===typeof a?""+a.query:a).toLowerCase();var d=this.cache.get(a);if(!d){d=this.search(a,b,c);if(d.then){var e=this;d.then(function(h){e.cache.set(a,h);return h})}this.cache.set(a,d)}return d}function W(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}W.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};
W.prototype.get=function(a){var b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};W.prototype.remove=function(a){for(var b=x(this.cache),c=b.next();!c.done;c=b.next()){c=c.value;var d=c[0];c[1].includes(a)&&this.cache.delete(d)}};W.prototype.clear=function(){this.cache.clear();this.h=""};var nb={normalize:function(a){return a.toLowerCase()},dedupe:!1};var ob=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);var pb=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),qb=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];var rb={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};var sb=/[\x00-\x7F]+/g;var tb=/[\x00-\x7F]+/g;var ub=/[\x00-\x7F]+/g;var vb={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:nb,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:ob},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:ob,matcher:pb,replacer:qb},LatinExtra:{normalize:!0,dedupe:!0,mapper:ob,replacer:qb.concat([/(?!^)[aeo]/g,""]),matcher:pb},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(var b=0;b<a.length;b++){for(var c=a[b],d=c.charAt(0),e=rb[d],h=1,f;h<c.length&&(f=c.charAt(h),"h"===f||"w"=== W.prototype.get=function(a){var b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};W.prototype.remove=function(a){for(var b=x(this.cache),c=b.next();!c.done;c=b.next()){c=c.value;var d=c[0];c[1].includes(a)&&this.cache.delete(d)}};W.prototype.clear=function(){this.cache.clear();this.h=""};var pb={normalize:function(a){return a.toLowerCase()},dedupe:!1};var qb=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);var rb=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),sb=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];var tb={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};var ub=/[\x00-\x7F]+/g;var vb=/[\x00-\x7F]+/g;var wb=/[\x00-\x7F]+/g;var xb={LatinExact:{normalize:!1,dedupe:!1},LatinDefault:pb,LatinSimple:{normalize:!0,dedupe:!0},LatinBalance:{normalize:!0,dedupe:!0,mapper:qb},LatinAdvanced:{normalize:!0,dedupe:!0,mapper:qb,matcher:rb,replacer:sb},LatinExtra:{normalize:!0,dedupe:!0,mapper:qb,replacer:sb.concat([/(?!^)[aeo]/g,""]),matcher:rb},LatinSoundex:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(var b=0;b<a.length;b++){for(var c=a[b],d=c.charAt(0),e=tb[d],h=1,f;h<c.length&&(f=c.charAt(h),"h"===f||"w"===
f||!(f=rb[f])||f===e||(d+=f,e=f,4!==d.length));h++);a[b]=d}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(sb," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(tb,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(ub," ")}}};var wb={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};J();O.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(d=b.length){for(var e=J(),h=J(),f=this.depth,g=this.resolution,k=0;k<d;k++){var l=b[this.rtl?d-1-k:k],m=l.length;if(m&&(f||!h[l])){var n=this.score?this.score(b,l,k,null,0):xb(g,d,k),p="";switch(this.tokenize){case "full":if(2<m){for(n=0;n<m;n++)for(var q=m;q>n;q--){p=l.substring(n,q);var r=this.score?this.score(b,l,k,p,n):xb(g,d,k,m,n);yb(this,h,p,r,a,c)}break}case "reverse":if(1< f||!(f=tb[f])||f===e||(d+=f,e=f,4!==d.length));h++);a[b]=d}}},ArabicDefault:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(ub," ")}},CjkDefault:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(vb,"")}},CyrillicDefault:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(wb," ")}}};var yb={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};K();N.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.reg.has(a))return this.update(a,b);b=this.encoder.encode(b);if(d=b.length){for(var e=K(),h=K(),f=this.depth,g=this.resolution,k=0;k<d;k++){var l=b[this.rtl?d-1-k:k],m=l.length;if(m&&(f||!h[l])){var p=this.score?this.score(b,l,k,null,0):zb(g,d,k),n="";switch(this.tokenize){case "full":if(2<m){for(p=0;p<m;p++)for(var q=m;q>p;q--){n=l.substring(p,q);var r=this.score?this.score(b,l,k,n,p):zb(g,d,k,m,p);Ab(this,h,n,r,a,c)}break}case "reverse":if(1<
m){for(q=m-1;0<q;q--)p=l[q]+p,r=this.score?this.score(b,l,k,p,q):xb(g,d,k,m,q),yb(this,h,p,r,a,c);p=""}case "forward":if(1<m){for(q=0;q<m;q++)p+=l[q],yb(this,h,p,n,a,c);break}default:if(yb(this,h,l,n,a,c),f&&1<d&&k<d-1)for(m=J(),p=this.aa,n=l,q=Math.min(f+1,d-k),r=m[n]=1;r<q;r++)if((l=b[this.rtl?d-1-k-r:k+r])&&!m[l]){m[l]=1;var v=this.score?this.score(b,n,k,l,r):xb(p+(d/2>p?0:1),d,k,q-1,r-1),w=this.bidirectional&&l>n;yb(this,e,w?n:l,v,a,c,w?l:n)}}}}this.fastupdate||this.reg.add(a)}else b=""}this.db&& m){for(q=m-1;0<q;q--)n=l[q]+n,r=this.score?this.score(b,l,k,n,q):zb(g,d,k,m,q),Ab(this,h,n,r,a,c);n=""}case "forward":if(1<m){for(q=0;q<m;q++)n+=l[q],Ab(this,h,n,p,a,c);break}default:if(Ab(this,h,l,p,a,c),f&&1<d&&k<d-1)for(m=K(),n=this.aa,p=l,q=Math.min(f+1,d-k),r=m[p]=1;r<q;r++)if((l=b[this.rtl?d-1-k-r:k+r])&&!m[l]){m[l]=1;var v=this.score?this.score(b,p,k,l,r):zb(n+(d/2>n?0:1),d,k,q-1,r-1),y=this.bidirectional&&l>p;Ab(this,e,y?p:l,v,a,c,y?l:p)}}}}this.fastupdate||this.reg.add(a)}else b=""}this.db&&
(b||this.commit_task.push({del:a}),this.da&&zb(this));return this}; (b||this.commit_task.push({del:a}),this.da&&Bb(this));return this};
function yb(a,b,c,d,e,h,f){var g=f?a.ctx:a.map,k;if(!b[c]||f&&!(k=b[c])[f])if(f?(b=k||(b[c]=J()),b[f]=1,(k=g.get(f))?g=k:g.set(f,g=new Map)):b[c]=1,(k=g.get(c))?g=k:g.set(c,g=k=[]),g=g[d]||(g[d]=[]),!h||!g.includes(e)){if(g.length===Math.pow(2,31)-1){b=new S(g);if(a.fastupdate)for(c=x(a.reg.values()),h=c.next();!h.done;h=c.next())h=h.value,h.includes(g)&&(h[h.indexOf(g)]=b);k[d]=g=b}g.push(e);a.fastupdate&&((d=a.reg.get(e))?d.push(g):a.reg.set(e,[g]))}} function Ab(a,b,c,d,e,h,f){var g=f?a.ctx:a.map,k;if(!b[c]||f&&!(k=b[c])[f])if(f?(b=k||(b[c]=K()),b[f]=1,(k=g.get(f))?g=k:g.set(f,g=new Map)):b[c]=1,(k=g.get(c))?g=k:g.set(c,g=k=[]),g=g[d]||(g[d]=[]),!h||!g.includes(e)){if(g.length===Math.pow(2,31)-1){b=new S(g);if(a.fastupdate)for(c=x(a.reg.values()),h=c.next();!h.done;h=c.next())h=h.value,h.includes(g)&&(h[h.indexOf(g)]=b);k[d]=g=b}g.push(e);a.fastupdate&&((d=a.reg.get(e))?d.push(g):a.reg.set(e,[g]))}}
function xb(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function X(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Ab(a):a;for(var e=[],h=0,f=void 0,g=void 0;h<a.length;h++)if((f=a[h])&&(g=f.length)){if(c){if(c>=g){c-=g;continue}c<g&&(f=b?f.slice(c,c+b):f.slice(c),g=f.length,c=0)}if(e.length)g>b&&(f=f.slice(0,b),g=f.length),e.push(f);else{if(g>=b)return g>b&&(f=f.slice(0,b)),d?Ab(f):f;e=[f]}b-=g;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Ab(e):e} function zb(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function X(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Cb(a):a;for(var e=[],h=0,f=void 0,g=void 0;h<a.length;h++)if((f=a[h])&&(g=f.length)){if(c){if(c>=g){c-=g;continue}c<g&&(f=b?f.slice(c,c+b):f.slice(c),g=f.length,c=0)}if(e.length)g>b&&(f=f.slice(0,b),g=f.length),e.push(f);else{if(g>=b)return g>b&&(f=f.slice(0,b)),d?Cb(f):f;e=[f]}b-=g;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Cb(e):e}
function Ab(a){for(var b=0;b<a.length;b++)a[b]={score:b,id:a[b]};return a};Y.prototype.or=function(){var a=this,b=arguments,c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);var d=[];c=[];for(var e=0,h=0,f,g,k=0,l=void 0;k<b.length;k++)if(l=b[k]){e=l.limit||0;h=l.offset||0;f=l.enrich;g=l.resolve;var m=void 0;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.not)m= function Cb(a){for(var b=0;b<a.length;b++)a[b]={score:b,id:a[b]};return a};Y.prototype.or=function(){var a=this,b=arguments,c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);var d=[];c=[];for(var e=0,h=0,f,g,k=0,l=void 0;k<b.length;k++)if(l=b[k]){e=l.limit||0;h=l.offset||0;f=l.enrich;g=l.resolve;var m=void 0;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.not)m=
this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Bb(d,e,h,f,g,a.J);return g?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Bb(d,e,h,f,g,this.J));return g?this.result:this};function Bb(a,b,c,d,e,h){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.enrich||!1,b=b.limit||0);return 2>a.length?e?X(a[0],b,c,d):a[0]:eb(a,c,b,e,h)};Y.prototype.and=function(){if(this.result.length){var a=this,b=arguments,c=b[0];if(c.then)return c.then(function(){return a.and.apply(a,b)});if(c[0]&&c[0].index)return this.and.apply(this,c);var d=[];c=[];for(var e=0,h=0,f,g,k=0,l=void 0;k<b.length;k++)if(l=b[k]){e=l.limit||0;h=l.offset||0;f=l.resolve;g=l.suggest;var m=void 0;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor); this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Db(d,e,h,f,g,a.J);return g?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Db(d,e,h,f,g,this.J));return g?this.result:this};function Db(a,b,c,d,e,h){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.enrich||!1,b=b.limit||0);return 2>a.length?e?X(a[0],b,c,d):a[0]:gb(a,c,b,e,h)};Y.prototype.and=function(){if(this.result.length){var a=this,b=arguments,c=b[0];if(c.then)return c.then(function(){return a.and.apply(a,b)});if(c[0]&&c[0].index)return this.and.apply(this,c);var d=[];c=[];for(var e=0,h=0,f,g,k=0,l=void 0;k<b.length;k++)if(l=b[k]){e=l.limit||0;h=l.offset||0;f=l.resolve;g=l.suggest;var m=void 0;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor);
else if(l.not)m=this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(!d.length)return this.result=d,f?this.result:this;if(c.length)return Promise.all(c).then(function(){d=[a.result].concat(d);a.result=Cb(d,e,h,f,a.J,g);return f?a.result:a});d=[this.result].concat(d);this.result=Cb(d,e,h,f,this.J,g);return f?this.result:this}return this};function Cb(a,b,c,d,e,h){if(2>a.length)return[];var f=[];J();var g=Aa(a);return g?db(a,g,b,c,h,e,d):f};Y.prototype.xor=function(){var a=this,b=arguments,c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);var d=[];c=[];for(var e=0,h=0,f,g,k=0,l=void 0;k<b.length;k++)if(l=b[k]){e=l.limit||0;h=l.offset||0;f=l.enrich;g=l.resolve;var m=void 0;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.not)m= else if(l.not)m=this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(!d.length)return this.result=d,f?this.result:this;if(c.length)return Promise.all(c).then(function(){d=[a.result].concat(d);a.result=Eb(d,e,h,f,a.J,g);return f?a.result:a});d=[this.result].concat(d);this.result=Eb(d,e,h,f,this.J,g);return f?this.result:this}return this};function Eb(a,b,c,d,e,h){if(2>a.length)return[];var f=[];K();var g=Aa(a);return g?fb(a,g,b,c,h,e,d):f};Y.prototype.xor=function(){var a=this,b=arguments,c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);var d=[];c=[];for(var e=0,h=0,f,g,k=0,l=void 0;k<b.length;k++)if(l=b[k]){e=l.limit||0;h=l.offset||0;f=l.enrich;g=l.resolve;var m=void 0;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.not)m=
this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Db(d,e,h,f,!g,a.J);return g?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Db(d,e,h,f,!g,a.J));return g?this.result:this}; this.not(l.not);else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Fb(d,e,h,f,!g,a.J);return g?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Fb(d,e,h,f,!g,a.J));return g?this.result:this};
function Db(a,b,c,d,e,h){if(!a.length)return a;if(2>a.length)return e?X(a[0],b,c,d):a[0];d=[];for(var f=J(),g=0,k=0,l;k<a.length;k++)if(l=a[k])for(var m=0,n;m<l.length;m++)if(n=l[m]){g<n.length&&(g=n.length);for(var p=0,q;p<n.length;p++)q=n[p],f[q]?f[q]++:f[q]=1}for(l=k=0;k<g;k++)for(m=0;m<a.length;m++)if(n=a[m])if(n=n[k])for(p=0;p<n.length;p++)if(q=n[p],1===f[q])if(c)c--;else if(e){if(d.push(q),d.length===b)return d}else{var r=k+(m?h:0);d[r]||(d[r]=[]);d[r].push(q);if(++l===b)return d}return d};Y.prototype.not=function(){var a=this,b=arguments,c=b[0];if(c.then)return c.then(function(){return a.not.apply(a,b)});if(c[0]&&c[0].index)return this.not.apply(this,c);var d=[];c=[];for(var e=0,h=0,f,g=0,k=void 0;g<b.length;g++)if(k=b[g]){e=k.limit||0;h=k.offset||0;f=k.resolve;var l=void 0;if(k.constructor===Y)l=k.result;else if(k.constructor===Array)l=k;else if(k.index)k.resolve=!1,l=k.index.search(k).result;else if(k.or)l=this.or(k.or);else if(k.and)l=this.and(k.and);else if(k.xor)l=this.xor(k.xor); function Fb(a,b,c,d,e,h){if(!a.length)return a;if(2>a.length)return e?X(a[0],b,c,d):a[0];d=[];for(var f=K(),g=0,k=0,l;k<a.length;k++)if(l=a[k])for(var m=0,p;m<l.length;m++)if(p=l[m]){g<p.length&&(g=p.length);for(var n=0,q;n<p.length;n++)q=p[n],f[q]?f[q]++:f[q]=1}for(l=k=0;k<g;k++)for(m=0;m<a.length;m++)if(p=a[m])if(p=p[k])for(n=0;n<p.length;n++)if(q=p[n],1===f[q])if(c)c--;else if(e){if(d.push(q),d.length===b)return d}else{var r=k+(m?h:0);d[r]||(d[r]=[]);d[r].push(q);if(++l===b)return d}return d};Y.prototype.not=function(){var a=this,b=arguments,c=b[0];if(c.then)return c.then(function(){return a.not.apply(a,b)});if(c[0]&&c[0].index)return this.not.apply(this,c);var d=[];c=[];for(var e=0,h=0,f,g=0,k=void 0;g<b.length;g++)if(k=b[g]){e=k.limit||0;h=k.offset||0;f=k.resolve;var l=void 0;if(k.constructor===Y)l=k.result;else if(k.constructor===Array)l=k;else if(k.index)k.resolve=!1,l=k.index.search(k).result;else if(k.or)l=this.or(k.or);else if(k.and)l=this.and(k.and);else if(k.xor)l=this.xor(k.xor);
else continue;d[g]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=Eb.call(a,d,e,h,f);return f?a.result:a});d.length&&(this.result=Eb.call(this,d,e,h,f));return f?this.result:this}; else continue;d[g]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=Gb.call(a,d,e,h,f);return f?a.result:a});d.length&&(this.result=Gb.call(this,d,e,h,f));return f?this.result:this};
function Eb(a,b,c,d){if(!a.length)return this.result;var e=[];a=new Set(a.flat().flat());for(var h=0,f,g=0;h<this.result.length;h++)if(f=this.result[h])for(var k=0,l;k<f.length;k++)if(l=f[k],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[h]||(e[h]=[]),e[h].push(l),++g===b)return e;return e};function Y(a){if(!this||this.constructor!==Y)return new Y(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.J=a.boost||0,this.result=a.index.search(a).result,this;if(a.constructor===Y)return a;this.index=null;this.result=a||[];this.J=0}Y.prototype.limit=function(a){if(this.result.length)for(var b=[],c=0,d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}return this}; function Gb(a,b,c,d){if(!a.length)return this.result;var e=[];a=new Set(a.flat().flat());for(var h=0,f,g=0;h<this.result.length;h++)if(f=this.result[h])for(var k=0,l;k<f.length;k++)if(l=f[k],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[h]||(e[h]=[]),e[h].push(l),++g===b)return e;return e};function Y(a){if(!this||this.constructor!==Y)return new Y(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.J=a.boost||0,this.result=a.index.search(a).result,this;if(a.constructor===Y)return a;this.index=null;this.result=a||[];this.J=0}Y.prototype.limit=function(a){if(this.result.length)for(var b=[],c=0,d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}return this};
Y.prototype.offset=function(a){if(this.result.length){for(var b=[],c=0,d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};Y.prototype.boost=function(a){this.J+=a;return this};Y.prototype.resolve=function(a,b,c){Fb=1;var d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.enrich,b=a.offset,a=a.limit),X(d,a||100,b,c)):d};var Fb=1; Y.prototype.offset=function(a){if(this.result.length){for(var b=[],c=0,d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};Y.prototype.boost=function(a){this.J+=a;return this};Y.prototype.resolve=function(a,b,c){Hb=1;var d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.enrich,b=a.offset,a=a.limit),X(d,a||100,b,c)):d};var Hb=1;
O.prototype.search=function(a,b,c){c||(!b&&M(a)?(c=a,a=""):M(b)&&(c=b,b=0));var d=[],e=0,h;if(c){a=c.query||a;b=c.limit||b;e=c.offset||0;var f=c.context;var g=c.suggest;(h=Fb&&!1!==c.resolve)||(Fb=0);var k=h&&c.enrich;var l=c.boost;var m=this.db&&c.tag}else h=this.resolve||Fb;a=this.encoder.encode(a);var n=a.length;b||!h||(b=100);if(1===n)return Gb.call(this,a[0],"",b,e,h,k,m);f=this.depth&&!1!==f;if(2===n&&f&&!g)return Gb.call(this,a[0],a[1],b,e,h,k,m);var p=c=0;if(1<n){for(var q=J(),r=[],v=0,w= N.prototype.search=function(a,b,c){c||(!b&&M(a)?(c=a,a=""):M(b)&&(c=b,b=0));var d=[],e=0,h;if(c){a=c.query||a;b=c.limit||b;e=c.offset||0;var f=c.context;var g=c.suggest;(h=Hb&&!1!==c.resolve)||(Hb=0);var k=h&&c.enrich;var l=c.boost;var m=c.resolution;var p=this.db&&c.tag}else h=this.resolve||Hb;var n=this.encoder.encode(a);var q=n.length;b||!h||(b=100);if(1===q)return Ib.call(this,n[0],"",b,e,h,k,p);f=this.depth&&!1!==f;if(2===q&&f&&!g)return Ib.call(this,n[0],n[1],b,e,h,k,p);var r=c=0;if(1<q){for(var v=
void 0;v<n;v++)if((w=a[v])&&!q[w]){if(g||this.db||Z(this,w))r.push(w),q[w]=1;else return h?d:new Y(d);w=w.length;c=Math.max(c,w);p=p?Math.min(p,w):w}a=r;n=a.length}if(!n)return h?d:new Y(d);var y=0;if(1===n)return Gb.call(this,a[0],"",b,e,h,k,m);if(2===n&&f&&!g)return Gb.call(this,a[0],a[1],b,e,h,k,m);if(1<n)if(f){var t=a[0];y=1}else 9<c&&3<c/p&&a.sort(xa);if(this.db){if(this.db.search&&(f=this.db.search(this,a,b,e,g,h,k,m),!1!==f))return f;var z=this;return function(){var A,B,D;return ta(function(F){switch(F.h){case 1:B= K(),y=[],z=0,u=void 0;z<q;z++)if((u=n[z])&&!v[u]){if(g||this.db||Z(this,u))y.push(u),v[u]=1;else return h?d:new Y(d);u=u.length;c=Math.max(c,u);r=r?Math.min(r,u):u}n=y;q=a.length}if(!q)return h?d:new Y(d);var w=0;if(1===q)return Ib.call(this,n[0],"",b,e,h,k,p);if(2===q&&f&&!g)return Ib.call(this,n[0],n[1],b,e,h,k,p);if(1<q)if(f){var A=n[0];w=1}else 9<c&&3<c/r&&n.sort(xa);m||0===m||(m=this.resolution);if(this.db){if(this.db.search&&(a=this.db.search(this,n,b,e,g,h,k,p),!1!==a))return a;var D=this;
A=void 0;case 2:if(!(y<n)){F.h=4;break}B=a[y];return t?G(F,Z(z,B,t,0,0,!1,!1),8):G(F,Z(z,B,"",0,0,!1,!1),7);case 7:A=F.F;A=Hb(A,d,g,z.resolution);F.h=6;break;case 8:A=F.F,A=Hb(A,d,g,z.aa),g&&!1===A&&d.length||(t=B);case 6:if(A)return F.return(A);if(g&&y===n-1){D=d.length;if(!D){if(t){t="";y=-1;F.h=3;break}return F.return(d)}if(1===D)return F.return(h?X(d[0],b,e):new Y(d[0]))}case 3:y++;F.h=2;break;case 4:return F.return(h?db(d,z.resolution,b,e,g,l,h):new Y(d[0]))}})}()}for(k=f=void 0;y<n;y++){k=a[y]; return function(){var B,R,F;return ta(function(G){switch(G.h){case 1:R=B=void 0;case 2:if(!(w<q)){G.h=4;break}R=n[w];return A?H(G,Z(D,R,A,0,0,!1,!1),8):H(G,Z(D,R,"",0,0,!1,!1),7);case 7:B=G.D;B=Jb(B,d,g,m);G.h=6;break;case 8:B=G.D,B=Jb(B,d,g,D.aa),g&&!1===B&&d.length||(A=R);case 6:if(B)return G.return(B);if(g&&w===q-1){F=d.length;if(!F){if(A){A="";w=-1;G.h=3;break}return G.return(d)}if(1===F)return G.return(h?X(d[0],b,e):new Y(d[0]))}case 3:w++;G.h=2;break;case 4:return G.return(h?fb(d,m,b,e,g,l,
t?(f=Z(this,k,t,0,0,!1,!1),f=Hb(f,d,g,this.aa),g&&!1===f&&d.length||(t=k)):(f=Z(this,k,"",0,0,!1,!1),f=Hb(f,d,g,this.resolution));if(f)return f;if(g&&y===n-1){f=d.length;if(!f){if(t){t="";y=-1;continue}return d}if(1===f)return h?X(d[0],b,e):new Y(d[0])}}d=db(d,this.resolution,b,e,g,l,h);return h?d:new Y(d)}; h):new Y(d[0]))}})}()}for(f=a=void 0;w<q;w++){f=n[w];A?(a=Z(this,f,A,0,0,!1,!1),a=Jb(a,d,g,this.aa),g&&!1===a&&d.length||(A=f)):(a=Z(this,f,"",0,0,!1,!1),a=Jb(a,d,g,m));if(a)return a;if(g&&w===q-1){a=d.length;if(!a){if(A){A="";w=-1;continue}return d}if(1===a)return h?X(d[0],b,e):new Y(d[0])}}d=fb(d,m,b,e,g,l,h);return h?d:new Y(d)};
function Gb(a,b,c,d,e,h,f){a=Z(this,a,b,c,d,e,h,f);return this.db?a.then(function(g){return e?g:g&&g.length?e?X(g,c,d):new Y(g):e?[]:new Y([])}):a&&a.length?e?X(a,c,d):new Y(a):e?[]:new Y([])}function Hb(a,b,c,d){var e=[];if(a){d=Math.min(a.length,d);for(var h=0,f=void 0;h<d;h++)(f=a[h])&&f&&(e[h]=f);if(e.length){b.push(e);return}}return!c&&e} function Ib(a,b,c,d,e,h,f){a=Z(this,a,b,c,d,e,h,f);return this.db?a.then(function(g){return e?g:g&&g.length?e?X(g,c,d):new Y(g):e?[]:new Y([])}):a&&a.length?e?X(a,c,d):new Y(a):e?[]:new Y([])}function Jb(a,b,c,d){var e=[];if(a){d=Math.min(a.length,d);for(var h=0,f=void 0;h<d;h++)(f=a[h])&&f&&(e[h]=f);if(e.length){b.push(e);return}}return!c&&e}
function Z(a,b,c,d,e,h,f,g){var k;c&&(k=a.bidirectional&&b>c);if(a.db)return c?a.db.get(k?c:b,k?b:c,d,e,h,f,g):a.db.get(b,"",d,e,h,f,g);a=c?(a=a.ctx.get(k?b:c))&&a.get(k?c:b):a.map.get(b);return a};O.prototype.remove=function(a,b){var c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(var d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{var h=e.indexOf(a);h===c.length-1?e.pop():e.splice(h,1)}}else Ib(this.map,a),this.depth&&Ib(this.ctx,a);b||this.reg.delete(a)}this.db&&(this.commit_task.push({del:a}),this.da&&zb(this));this.cache&&this.cache.remove(a);return this}; function Z(a,b,c,d,e,h,f,g){var k;c&&(k=a.bidirectional&&b>c);if(a.db)return c?a.db.get(k?c:b,k?b:c,d,e,h,f,g):a.db.get(b,"",d,e,h,f,g);a=c?(a=a.ctx.get(k?b:c))&&a.get(k?c:b):a.map.get(b);return a};N.prototype.remove=function(a,b){var c=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(c){if(this.fastupdate)for(var d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{var h=e.indexOf(a);h===c.length-1?e.pop():e.splice(h,1)}}else Kb(this.map,a),this.depth&&Kb(this.ctx,a);b||this.reg.delete(a)}this.db&&(this.commit_task.push({del:a}),this.da&&Bb(this));this.cache&&this.cache.remove(a);return this};
function Ib(a,b){var c=0;if(a.constructor===Array)for(var d=0,e=void 0,h;d<a.length;d++){if((e=a[d])&&e.length)if(h=e.indexOf(b),0<=h){1<e.length?(e.splice(h,1),c++):delete a[d];break}else c++}else for(d=x(a),e=d.next();!e.done;e=d.next())h=e.value,e=h[0],(h=Ib(h[1],b))?c+=h:a.delete(e);return c};function O(a,b){if(!this||this.constructor!==O)return new O(a);if(a){var c=K(a)?a:a.preset;c&&(a=Object.assign({},wb[c],a))}else a={};c=a.context||{};var d=K(a.encoder)?vb[a.encoder]:a.encode||a.encoder||nb;this.encoder=d.encode?d:"object"===typeof d?new N(d):{encode:d};var e;this.resolution=a.resolution||9;this.tokenize=e=a.tokenize||"strict";this.depth="strict"===e&&c.depth||0;this.bidirectional=!1!==c.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;(e=a.keystore||0)&&(this.keystore= function Kb(a,b){var c=0;if(a.constructor===Array)for(var d=0,e=void 0,h;d<a.length;d++){if((e=a[d])&&e.length)if(h=e.indexOf(b),0<=h){1<e.length?(e.splice(h,1),c++):delete a[d];break}else c++}else for(d=x(a),e=d.next();!e.done;e=d.next())h=e.value,e=h[0],(h=Kb(h[1],b))?c+=h:a.delete(e);return c};function N(a,b){if(!this||this.constructor!==N)return new N(a);if(a){var c=L(a)?a:a.preset;c&&(a=Object.assign({},yb[c],a))}else a={};c=a.context;var d=!0===c?{depth:1}:c||{},e=L(a.encoder)?xb[a.encoder]:a.encode||a.encoder||pb;this.encoder=e.encode?e:"object"===typeof e?new Ha(e):{encode:e};this.resolution=a.resolution||9;this.tokenize=c=a.tokenize||"strict";this.depth="strict"===c&&d.depth||0;this.bidirectional=!1!==d.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;(c=a.keystore||
e);this.map=e?new T(e):new Map;this.ctx=e?new T(e):new Map;this.reg=b||(this.fastupdate?e?new T(e):new Map:e?new U(e):new Set);this.aa=c.resolution||1;this.rtl=d.rtl||a.rtl||!1;this.cache=(e=a.cache||null)&&new W(e);this.resolve=!1!==a.resolve;if(e=a.db)this.db=this.mount(e);this.da=!1!==a.commit;this.commit_task=[];this.commit_timer=null}u=O.prototype;u.mount=function(a){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return a.mount(this)}; 0)&&(this.keystore=c);this.map=c?new T(c):new Map;this.ctx=c?new T(c):new Map;this.reg=b||(this.fastupdate?c?new T(c):new Map:c?new U(c):new Set);this.aa=d.resolution||3;this.rtl=e.rtl||a.rtl||!1;this.cache=(c=a.cache||null)&&new W(c);this.resolve=!1!==a.resolve;if(c=a.db)this.db=this.mount(c);this.da=!1!==a.commit;this.commit_task=[];this.commit_timer=null}t=N.prototype;t.mount=function(a){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return a.mount(this)};
u.commit=function(a,b){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.commit(this,a,b)};u.destroy=function(){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.destroy()};function zb(a){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null;a.db.commit(a,void 0,void 0)},0))} t.commit=function(a,b){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.commit(this,a,b)};t.destroy=function(){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.destroy()};function Bb(a){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null;a.db.commit(a,void 0,void 0)},0))}
u.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]);return this};u.append=function(a,b){return this.add(a,b,!0)};u.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)};u.update=function(a,b){var c=this,d=this.remove(a);return d&&d.then?d.then(function(){return c.add(a,b)}):this.add(a,b)}; t.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]);return this};t.append=function(a,b){return this.add(a,b,!0)};t.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)};t.update=function(a,b){var c=this,d=this.remove(a);return d&&d.then?d.then(function(){return c.add(a,b)}):this.add(a,b)};
function Jb(a){var b=0;if(a.constructor===Array)for(var c=0,d=void 0;c<a.length;c++)(d=a[c])&&(b+=d.length);else for(c=x(a),d=c.next();!d.done;d=c.next()){var e=d.value;d=e[0];(e=Jb(e[1]))?b+=e:a.delete(d)}return b}u.cleanup=function(){if(!this.fastupdate)return this;Jb(this.map);this.depth&&Jb(this.ctx);return this};u.searchCache=mb; function Lb(a){var b=0;if(a.constructor===Array)for(var c=0,d=void 0;c<a.length;c++)(d=a[c])&&(b+=d.length);else for(c=x(a),d=c.next();!d.done;d=c.next()){var e=d.value;d=e[0];(e=Lb(e[1]))?b+=e:a.delete(d)}return b}t.cleanup=function(){if(!this.fastupdate)return this;Lb(this.map);this.depth&&Lb(this.ctx);return this};t.searchCache=ob;
u.export=function(a,b,c,d){d=void 0===d?0:d;switch(d){case 0:var e="reg";var h=Ta(this.reg);break;case 1:e="cfg";h={};break;case 2:e="map";h=Pa(this.map,this.reg.size);break;case 3:e="ctx";h=Ra(this.ctx,this.reg.size);break;default:return}return Va.call(this,a,b,e,h,c,d)}; t.export=function(a,b,c,d){d=void 0===d?0:d;switch(d){case 0:var e="reg";var h=Va(this.reg);break;case 1:e="cfg";h={};break;case 2:e="map";h=Ra(this.map,this.reg.size);break;case 3:e="ctx";h=Ta(this.ctx,this.reg.size);break;default:return}return Xa.call(this,a,b,e,h,c,d)};
u.import=function(a,b){if(b)switch(K(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=Ua(b,this.reg);break;case "map":this.map=Qa(b,this.map);break;case "ctx":this.ctx=Sa(b,this.ctx)}}; t.import=function(a,b){if(b)switch(L(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.fastupdate=!1;this.reg=Wa(b,this.reg);break;case "map":this.map=Sa(b,this.map);break;case "ctx":this.ctx=Ua(b,this.ctx)}};
u.serialize=function(a){a=void 0===a?!0:a;if(!this.reg.size)return"";for(var b="",c="",d=x(this.reg.keys()),e=d.next();!e.done;e=d.next())e=e.value,c||(c=typeof e),b+=(b?",":"")+("string"===c?'"'+e+'"':e);b="index.reg=new Set(["+b+"]);";d="";e=x(this.map.entries());for(var h=e.next();!h.done;h=e.next()){var f=h.value;h=f[0];f=f[1];for(var g="",k=0,l;k<f.length;k++){l=f[k]||[""];for(var m="",n=0;n<l.length;n++)m+=(m?",":"")+("string"===c?'"'+l[n]+'"':l[n]);m="["+m+"]";g+=(g?",":"")+m}g='["'+h+'",['+ t.serialize=function(a){a=void 0===a?!0:a;if(!this.reg.size)return"";for(var b="",c="",d=x(this.reg.keys()),e=d.next();!e.done;e=d.next())e=e.value,c||(c=typeof e),b+=(b?",":"")+("string"===c?'"'+e+'"':e);b="index.reg=new Set(["+b+"]);";d="";e=x(this.map.entries());for(var h=e.next();!h.done;h=e.next()){var f=h.value;h=f[0];f=f[1];for(var g="",k=0,l;k<f.length;k++){l=f[k]||[""];for(var m="",p=0;p<l.length;p++)m+=(m?",":"")+("string"===c?'"'+l[p]+'"':l[p]);m="["+m+"]";g+=(g?",":"")+m}g='["'+h+'",['+
g+"]]";d+=(d?",":"")+g}d="index.map=new Map(["+d+"]);";e="";h=x(this.ctx.entries());for(f=h.next();!f.done;f=h.next())for(g=f.value,f=g[0],g=x(g[1].entries()),k=g.next();!k.done;k=g.next()){l=k.value;k=l[0];l=l[1];m="";n=0;for(var p;n<l.length;n++){p=l[n]||[""];for(var q="",r=0;r<p.length;r++)q+=(q?",":"")+("string"===c?'"'+p[r]+'"':p[r]);q="["+q+"]";m+=(m?",":"")+q}m='new Map([["'+k+'",['+m+"]]])";m='["'+f+'",'+m+"]";e+=(e?",":"")+m}e="index.ctx=new Map(["+e+"]);";return a?"function inject(index){"+ g+"]]";d+=(d?",":"")+g}d="index.map=new Map(["+d+"]);";e="";h=x(this.ctx.entries());for(f=h.next();!f.done;f=h.next())for(g=f.value,f=g[0],g=x(g[1].entries()),k=g.next();!k.done;k=g.next()){l=k.value;k=l[0];l=l[1];m="";p=0;for(var n;p<l.length;p++){n=l[p]||[""];for(var q="",r=0;r<n.length;r++)q+=(q?",":"")+("string"===c?'"'+n[r]+'"':n[r]);q="["+q+"]";m+=(m?",":"")+q}m='new Map([["'+k+'",['+m+"]]])";m='["'+f+'",'+m+"]";e+=(e?",":"")+m}e="index.ctx=new Map(["+e+"]);";return a?"function inject(index){"+
b+d+e+"}":b+d+e};Na(O.prototype);var Kb="undefined"!==typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Lb=["map","ctx","tag","reg","cfg"]; b+d+e+"}":b+d+e};Pa(N.prototype);var Mb="undefined"!==typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Nb=["map","ctx","tag","reg","cfg"];
function Mb(a,b){b=void 0===b?{}:b;if(!this)return new Mb(a,b);"object"===typeof a&&(b=a=a.name);a||console.info("Default storage space was used, because a name was not passed.");this.id="flexsearch"+(a?":"+a.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"");this.field=b.field?b.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"";this.support_tag_search=!1;this.db=null;this.h={}}u=Mb.prototype;u.mount=function(a){if(!a.encoder)return a.mount(this);a.db=this;return this.open()}; function Ob(a,b){b=void 0===b?{}:b;if(!this)return new Ob(a,b);"object"===typeof a&&(b=a=a.name);a||console.info("Default storage space was used, because a name was not passed.");this.id="flexsearch"+(a?":"+a.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"");this.field=b.field?b.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"";this.support_tag_search=!1;this.db=null;this.h={}}t=Ob.prototype;t.mount=function(a){if(!a.encoder)return a.mount(this);a.db=this;return this.open()};
u.open=function(){var a=this;navigator.storage&&navigator.storage.persist();return this.db||new Promise(function(b,c){var d=Kb.open(a.id+(a.field?":"+a.field:""),1);d.onupgradeneeded=function(){var e=a.db=this.result;Lb.forEach(function(h){e.objectStoreNames.contains(h)||e.createObjectStore(h)})};d.onblocked=function(e){console.error("blocked",e);c()};d.onerror=function(e){console.error(this.error,e);c()};d.onsuccess=function(){a.db=this.result;a.db.onversionchange=function(){a.close()};b(a)}})}; t.open=function(){var a=this;navigator.storage&&navigator.storage.persist();return this.db||new Promise(function(b,c){var d=Mb.open(a.id+(a.field?":"+a.field:""),1);d.onupgradeneeded=function(){var e=a.db=this.result;Nb.forEach(function(h){e.objectStoreNames.contains(h)||e.createObjectStore(h)})};d.onblocked=function(e){console.error("blocked",e);c()};d.onerror=function(e){console.error(this.error,e);c()};d.onsuccess=function(){a.db=this.result;a.db.onversionchange=function(){a.close()};b(a)}})};
u.close=function(){this.db.close();this.db=null};u.destroy=function(){return Kb.deleteDatabase(this.id+(this.field?":"+this.field:""))};u.clear=function(){for(var a=this.db.transaction(Lb,"readwrite"),b=0;b<Lb.length;b++)a.objectStore(Lb[b]).clear();return Pb(a)}; t.close=function(){this.db.close();this.db=null};t.destroy=function(){return Mb.deleteDatabase(this.id+(this.field?":"+this.field:""))};t.clear=function(){for(var a=this.db.transaction(Nb,"readwrite"),b=0;b<Nb.length;b++)a.objectStore(Nb[b]).clear();return Qb(a)};
u.get=function(a,b,c,d,e,h){c=void 0===c?0:c;d=void 0===d?0:d;e=void 0===e?!0:e;h=void 0===h?!1:h;a=this.db.transaction(b?"ctx":"map","readonly").objectStore(b?"ctx":"map").get(b?b+":"+a:a);var f=this;return Pb(a).then(function(g){var k=[];if(!g||!g.length)return k;if(e){if(!c&&!d&&1===g.length)return g[0];for(var l=0,m=void 0;l<g.length;l++)if((m=g[l])&&m.length)if(d>=m.length)d-=m.length;else{for(var n=c?d+Math.min(m.length-d,c):m.length,p=d;p<n;p++)k.push(m[p]);d=0;if(k.length===c)break}return h? t.get=function(a,b,c,d,e,h){c=void 0===c?0:c;d=void 0===d?0:d;e=void 0===e?!0:e;h=void 0===h?!1:h;a=this.db.transaction(b?"ctx":"map","readonly").objectStore(b?"ctx":"map").get(b?b+":"+a:a);var f=this;return Qb(a).then(function(g){var k=[];if(!g||!g.length)return k;if(e){if(!c&&!d&&1===g.length)return g[0];for(var l=0,m=void 0;l<g.length;l++)if((m=g[l])&&m.length)if(d>=m.length)d-=m.length;else{for(var p=c?d+Math.min(m.length-d,c):m.length,n=d;n<p;n++)k.push(m[n]);d=0;if(k.length===c)break}return h?
f.enrich(k):k}return g})};u.tag=function(a,b,c,d){b=void 0===b?0:b;c=void 0===c?0:c;d=void 0===d?!1:d;a=this.db.transaction("tag","readonly").objectStore("tag").get(a);var e=this;return Pb(a).then(function(h){if(!h||!h.length||c>=h.length)return[];if(!b&&!c)return h;h=h.slice(c,c+b);return d?e.enrich(h):h})}; f.enrich(k):k}return g})};t.tag=function(a,b,c,d){b=void 0===b?0:b;c=void 0===c?0:c;d=void 0===d?!1:d;a=this.db.transaction("tag","readonly").objectStore("tag").get(a);var e=this;return Qb(a).then(function(h){if(!h||!h.length||c>=h.length)return[];if(!b&&!c)return h;h=h.slice(c,c+b);return d?e.enrich(h):h})};
u.enrich=function(a){"object"!==typeof a&&(a=[a]);for(var b=this.db.transaction("reg","readonly").objectStore("reg"),c=[],d=0;d<a.length;d++)c[d]=Pb(b.get(a[d]));return Promise.all(c).then(function(e){for(var h=0;h<e.length;h++)e[h]={id:a[h],doc:e[h]?JSON.parse(e[h]):null};return e})};u.has=function(a){a=this.db.transaction("reg","readonly").objectStore("reg").getKey(a);return Pb(a)};u.search=null;u.info=function(){}; t.enrich=function(a){"object"!==typeof a&&(a=[a]);for(var b=this.db.transaction("reg","readonly").objectStore("reg"),c=[],d=0;d<a.length;d++)c[d]=Qb(b.get(a[d]));return Promise.all(c).then(function(e){for(var h=0;h<e.length;h++)e[h]={id:a[h],doc:e[h]?JSON.parse(e[h]):null};return e})};t.has=function(a){a=this.db.transaction("reg","readonly").objectStore("reg").getKey(a);return Qb(a)};t.search=null;t.info=function(){};
u.transaction=function(a,b,c){var d=this,e=this.h[a+":"+b];if(e)return c.call(this,e);var h=this.db.transaction(a,b);this.h[a+":"+b]=e=h.objectStore(a);return new Promise(function(f,g){h.onerror=function(k){d.h[a+":"+b]=null;h.abort();h=e=null;g(k)};h.oncomplete=function(k){h=e=d.h[a+":"+b]=null;f(k||!0)};return c.call(d,e)})}; t.transaction=function(a,b,c){var d=this,e=this.h[a+":"+b];if(e)return c.call(this,e);var h=this.db.transaction(a,b);this.h[a+":"+b]=e=h.objectStore(a);return new Promise(function(f,g){h.onerror=function(k){d.h[a+":"+b]=null;h.abort();h=e=null;g(k)};h.oncomplete=function(k){h=e=d.h[a+":"+b]=null;f(k||!0)};return c.call(d,e)})};
u.commit=function(a,b,c){var d=this,e,h,f;return ta(function(g){switch(g.h){case 1:if(b)return G(g,d.clear(),12);e=a.commit_task;a.commit_task=[];h=0;f=void 0;case 4:if(!(h<e.length)){g.h=6;break}f=e[h];if(!f.clear){e[h]=f.oa;g.h=5;break}return G(g,d.clear(),8);case 8:b=!0;g.h=6;break;case 5:h++;g.h=4;break;case 6:if(b){g.h=3;break}c||(e=e.concat(ya(a.reg)));if(!e.length){g.h=10;break}return G(g,d.remove(e),11);case 11:case 10:g.h=3;break;case 12:a.commit_task=[];case 3:return a.reg.size?G(g,d.transaction("map", t.commit=function(a,b,c){var d=this,e,h,f;return ta(function(g){switch(g.h){case 1:if(b)return H(g,d.clear(),12);e=a.commit_task;a.commit_task=[];h=0;f=void 0;case 4:if(!(h<e.length)){g.h=6;break}f=e[h];if(!f.clear){e[h]=f.oa;g.h=5;break}return H(g,d.clear(),8);case 8:b=!0;g.h=6;break;case 5:h++;g.h=4;break;case 6:if(b){g.h=3;break}c||(e=e.concat(ya(a.reg)));if(!e.length){g.h=10;break}return H(g,d.remove(e),11);case 11:case 10:g.h=3;break;case 12:a.commit_task=[];case 3:return a.reg.size?H(g,d.transaction("map",
"readwrite",function(k){for(var l=x(a.map),m=l.next(),n={};!m.done;n={O:void 0,Y:void 0},m=l.next())m=m.value,n.Y=m[0],n.O=m[1],n.O.length&&(b?k.put(n.O,n.Y):k.get(n.Y).onsuccess=function(p){return function(){var q=this.result,r;if(q&&q.length)for(var v=Math.max(q.length,p.O.length),w=0,y;w<v;w++){if((y=p.O[w])&&y.length){if((r=q[w])&&r.length)for(var t=0;t<y.length;t++)r.push(y[t]);else q[w]=y;r=1}}else q=p.O,r=1;r&&k.put(q,p.Y)}}(n))}),13):g.return();case 13:return G(g,d.transaction("ctx","readwrite", "readwrite",function(k){for(var l=x(a.map),m=l.next(),p={};!m.done;p={P:void 0,Y:void 0},m=l.next())m=m.value,p.Y=m[0],p.P=m[1],p.P.length&&(b?k.put(p.P,p.Y):k.get(p.Y).onsuccess=function(n){return function(){var q=this.result,r;if(q&&q.length)for(var v=Math.max(q.length,n.P.length),y=0,z;y<v;y++){if((z=n.P[y])&&z.length){if((r=q[y])&&r.length)for(var u=0;u<z.length;u++)r.push(z[u]);else q[y]=z;r=1}}else q=n.P,r=1;r&&k.put(q,n.Y)}}(p))}),13):g.return();case 13:return H(g,d.transaction("ctx","readwrite",
function(k){for(var l=x(a.ctx),m=l.next(),n={};!m.done;n={W:void 0},m=l.next()){m=m.value;n.W=m[0];m=x(m[1]);for(var p=m.next(),q={};!p.done;q={P:void 0,Z:void 0},p=m.next())p=p.value,q.Z=p[0],q.P=p[1],q.P.length&&(b?k.put(q.P,n.W+":"+q.Z):k.get(n.W+":"+q.Z).onsuccess=function(r,v){return function(){var w=this.result,y;if(w&&w.length)for(var t=Math.max(w.length,r.P.length),z=0,A;z<t;z++){if((A=r.P[z])&&A.length){if((y=w[z])&&y.length)for(var B=0;B<A.length;B++)y.push(A[B]);else w[z]=A;y=1}}else w= function(k){for(var l=x(a.ctx),m=l.next(),p={};!m.done;p={W:void 0},m=l.next()){m=m.value;p.W=m[0];m=x(m[1]);for(var n=m.next(),q={};!n.done;q={R:void 0,Z:void 0},n=m.next())n=n.value,q.Z=n[0],q.R=n[1],q.R.length&&(b?k.put(q.R,p.W+":"+q.Z):k.get(p.W+":"+q.Z).onsuccess=function(r,v){return function(){var y=this.result,z;if(y&&y.length)for(var u=Math.max(y.length,r.R.length),w=0,A;w<u;w++){if((A=r.R[w])&&A.length){if((z=y[w])&&z.length)for(var D=0;D<A.length;D++)z.push(A[D]);else y[w]=A;z=1}}else y=
r.P,y=1;y&&k.put(w,v.W+":"+r.Z)}}(q,n))}}),14);case 14:if(a.store)return G(g,d.transaction("reg","readwrite",function(k){for(var l=x(a.store),m=l.next();!m.done;m=l.next()){var n=m.value;m=n[0];n=n[1];k.put("object"===typeof n?JSON.stringify(n):1,m)}}),16);if(a.bypass){g.h=16;break}return G(g,d.transaction("reg","readwrite",function(k){for(var l=x(a.reg.keys()),m=l.next();!m.done;m=l.next())k.put(1,m.value)}),16);case 16:if(!a.tag){g.h=20;break}return G(g,d.transaction("tag","readwrite",function(k){for(var l= r.R,z=1;z&&k.put(y,v.W+":"+r.Z)}}(q,p))}}),14);case 14:if(a.store)return H(g,d.transaction("reg","readwrite",function(k){for(var l=x(a.store),m=l.next();!m.done;m=l.next()){var p=m.value;m=p[0];p=p[1];k.put("object"===typeof p?JSON.stringify(p):1,m)}}),16);if(a.bypass){g.h=16;break}return H(g,d.transaction("reg","readwrite",function(k){for(var l=x(a.reg.keys()),m=l.next();!m.done;m=l.next())k.put(1,m.value)}),16);case 16:if(!a.tag){g.h=20;break}return H(g,d.transaction("tag","readwrite",function(k){for(var l=
x(a.tag),m=l.next(),n={};!m.done;n={X:void 0,ba:void 0},m=l.next())m=m.value,n.ba=m[0],n.X=m[1],n.X.length&&(k.get(n.ba).onsuccess=function(p){return function(){var q=this.result;q=q&&q.length?q.concat(p.X):p.X;k.put(q,p.ba)}}(n))}),20);case 20:a.map.clear(),a.ctx.clear(),a.tag&&a.tag.clear(),a.store&&a.store.clear(),a.document||a.reg.clear(),g.h=0}})}; x(a.tag),m=l.next(),p={};!m.done;p={X:void 0,ba:void 0},m=l.next())m=m.value,p.ba=m[0],p.X=m[1],p.X.length&&(k.get(p.ba).onsuccess=function(n){return function(){var q=this.result;q=q&&q.length?q.concat(n.X):n.X;k.put(q,n.ba)}}(p))}),20);case 20:a.map.clear(),a.ctx.clear(),a.tag&&a.tag.clear(),a.store&&a.store.clear(),a.document||a.reg.clear(),g.h=0}})};
function Qb(a,b,c){for(var d=a.value,e,h,f=0,g=0,k;g<d.length;g++){if(k=c?d:d[g]){for(var l=0,m,n;l<b.length;l++)if(n=b[l],m=k.indexOf(h?parseInt(n,10):n),0>m&&!h&&"string"===typeof n&&!isNaN(n)&&(m=k.indexOf(parseInt(n,10)))&&(h=1),0<=m)if(e=1,1<k.length)k.splice(m,1);else{d[g]=[];break}f+=k.length}if(c)break}f?e&&a.update(d):a.delete();a.continue()} function Rb(a,b,c){for(var d=a.value,e,h,f=0,g=0,k;g<d.length;g++){if(k=c?d:d[g]){for(var l=0,m,p;l<b.length;l++)if(p=b[l],m=k.indexOf(h?parseInt(p,10):p),0>m&&!h&&"string"===typeof p&&!isNaN(p)&&(m=k.indexOf(parseInt(p,10)))&&(h=1),0<=m)if(e=1,1<k.length)k.splice(m,1);else{d[g]=[];break}f+=k.length}if(c)break}f?e&&a.update(d):a.delete();a.continue()}
u.remove=function(a){"object"!==typeof a&&(a=[a]);return Promise.all([this.transaction("map","readwrite",function(b){b.openCursor().onsuccess=function(){var c=this.result;c&&Qb(c,a)}}),this.transaction("ctx","readwrite",function(b){b.openCursor().onsuccess=function(){var c=this.result;c&&Qb(c,a)}}),this.transaction("tag","readwrite",function(b){b.openCursor().onsuccess=function(){var c=this.result;c&&Qb(c,a,!0)}}),this.transaction("reg","readwrite",function(b){for(var c=0;c<a.length;c++)b.delete(a[c])})])}; t.remove=function(a){"object"!==typeof a&&(a=[a]);return Promise.all([this.transaction("map","readwrite",function(b){b.openCursor().onsuccess=function(){var c=this.result;c&&Rb(c,a)}}),this.transaction("ctx","readwrite",function(b){b.openCursor().onsuccess=function(){var c=this.result;c&&Rb(c,a)}}),this.transaction("tag","readwrite",function(b){b.openCursor().onsuccess=function(){var c=this.result;c&&Rb(c,a,!0)}}),this.transaction("reg","readwrite",function(b){for(var c=0;c<a.length;c++)b.delete(a[c])})])};
function Pb(a){return new Promise(function(b,c){a.onsuccess=function(){b(this.result)};a.oncomplete=function(){b(this.result)};a.onerror=c;a=null})};var Rb={Index:O,Charset:vb,Encoder:N,Document:V,Worker:R,Resolver:Y,IndexedDB:Mb,Language:{}},Sb=self,Tb;(Tb=Sb.define)&&Tb.amd?Tb([],function(){return Rb}):"object"===typeof Sb.exports?Sb.exports=Rb:Sb.FlexSearch=Rb;}(this||self)); function Qb(a){return new Promise(function(b,c){a.onsuccess=function(){b(this.result)};a.oncomplete=function(){b(this.result)};a.onerror=c;a=null})};var Sb={Index:N,Charset:xb,Encoder:Ha,Document:V,Worker:O,Resolver:Y,IndexedDB:Ob,Language:{}},Tb=self,Ub;(Ub=Tb.define)&&Ub.amd?Ub([],function(){return Sb}):"object"===typeof Tb.exports?Tb.exports=Sb:Tb.FlexSearch=Sb;}(this||self));

View File

@@ -6,7 +6,8 @@
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f; (function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;
function t(a, c, b) { var r;
function u(a, c, b) {
const d = typeof b, e = typeof a; const d = typeof b, e = typeof a;
if ("undefined" !== d) { if ("undefined" !== d) {
if ("undefined" !== e) { if ("undefined" !== e) {
@@ -43,23 +44,24 @@ function t(a, c, b) {
} }
return "undefined" === e ? c : a; return "undefined" === e ? c : a;
} }
function u() { function x() {
return Object.create(null); return Object.create(null);
} }
function v(a, c) { function y(a, c) {
return c.length - a.length; return c.length - a.length;
} }
;const w = /[^\p{L}\p{N}]+/u, x = /(\d{3})/g, y = /(\D)(\d{3})/g, z = /(\d{3})(\D)/g, B = "".normalize && /[\u0300-\u036f]/g; ;const z = /[^\p{L}\p{N}]+/u, A = /(\d{3})/g, B = /(\D)(\d{3})/g, C = /(\d{3})(\D)/g, D = "".normalize && /[\u0300-\u036f]/g;
function C(a) { function E(a) {
if (!this || this.constructor !== C) { if (!this || this.constructor !== E) {
return new C(...arguments); return new E(...arguments);
} }
for (let c = 0; c < arguments.length; c++) { for (let c = 0; c < arguments.length; c++) {
this.assign(arguments[c]); this.assign(arguments[c]);
} }
} }
C.prototype.assign = function(a) { r = E.prototype;
this.normalize = t(a.normalize, !0, this.normalize); r.assign = function(a) {
this.normalize = u(a.normalize, !0, this.normalize);
let c = a.include, b = c || a.exclude || a.split; let c = a.include, b = c || a.exclude || a.split;
if ("object" === typeof b) { if ("object" === typeof b) {
let d = !c, e = ""; let d = !c, e = "";
@@ -80,55 +82,106 @@ C.prototype.assign = function(a) {
this.numeric = d; this.numeric = d;
} else { } else {
try { try {
this.split = t(b, w, this.split); this.split = u(b, z, this.split);
} catch (d) { } catch (d) {
this.split = /\s+/; this.split = /\s+/;
} }
this.numeric = t(this.numeric, !0); this.numeric = u(this.numeric, !0);
} }
this.prepare = t(a.prepare, null, this.prepare); this.prepare = u(a.prepare, null, this.prepare);
this.finalize = t(a.finalize, null, this.finalize); this.finalize = u(a.finalize, null, this.finalize);
this.rtl = a.rtl || !1; this.rtl = a.rtl || !1;
this.dedupe = t(a.dedupe, !0, this.dedupe); this.dedupe = u(a.dedupe, !0, this.dedupe);
this.filter = t((b = a.filter) && new Set(b), null, this.filter); this.filter = u((b = a.filter) && new Set(b), null, this.filter);
this.matcher = t((b = a.matcher) && new Map(b), null, this.matcher); this.matcher = u((b = a.matcher) && new Map(b), null, this.matcher);
this.mapper = t((b = a.mapper) && new Map(b), null, this.mapper); this.mapper = u((b = a.mapper) && new Map(b), null, this.mapper);
this.stemmer = t((b = a.stemmer) && new Map(b), null, this.stemmer); this.stemmer = u((b = a.stemmer) && new Map(b), null, this.stemmer);
this.replacer = t(a.replacer, null, this.replacer); this.replacer = u(a.replacer, null, this.replacer);
this.minlength = t(a.minlength, 1, this.minlength); this.minlength = u(a.minlength, 1, this.minlength);
this.maxlength = t(a.maxlength, 0, this.maxlength); this.maxlength = u(a.maxlength, 0, this.maxlength);
if (this.cache = b = t(a.cache, !0, this.cache)) { if (this.cache = b = u(a.cache, !0, this.cache)) {
this.j = null, this.v = "number" === typeof b ? b : 2e5, this.h = new Map(), this.i = new Map(), this.l = this.g = 128; this.l = null, this.v = "number" === typeof b ? b : 2e5, this.h = new Map(), this.j = new Map(), this.o = this.m = 128;
} }
this.m = ""; this.g = "";
this.s = null; this.s = null;
this.o = ""; this.i = "";
this.u = null; this.u = null;
if (this.matcher) { if (this.matcher) {
for (const d of this.matcher.keys()) { for (const d of this.matcher.keys()) {
this.m += (this.m ? "|" : "") + d; this.g += (this.g ? "|" : "") + d;
} }
} }
if (this.stemmer) { if (this.stemmer) {
for (const d of this.stemmer.keys()) { for (const d of this.stemmer.keys()) {
this.o += (this.o ? "|" : "") + d; this.i += (this.i ? "|" : "") + d;
} }
} }
return this; return this;
}; };
C.prototype.encode = function(a) { r.addMatcher = function(a, c) {
if (this.cache && a.length <= this.g) { if ("object" === typeof a) {
if (this.j) { return this.addReplacer(a, c);
}
if (2 > a.length) {
return this.addMapper(a, c);
}
this.matcher || (this.matcher = new Map());
this.matcher.set(a, c);
this.g += (this.g ? "|" : "") + a;
this.s = null;
this.cache && F(this);
return this;
};
r.addStemmer = function(a, c) {
this.stemmer || (this.stemmer = new Map());
this.stemmer.set(a, c);
this.i += (this.i ? "|" : "") + a;
this.u = null;
this.cache && F(this);
return this;
};
r.addFilter = function(a) {
this.filter || (this.filter = new Set());
this.filter.add(a);
this.cache && F(this);
return this;
};
r.addMapper = function(a, c) {
if ("object" === typeof a) {
return this.addReplacer(a, c);
}
if (1 < a.length) {
return this.addMatcher(a, c);
}
this.mapper || (this.mapper = new Map());
this.mapper.set(a, c);
this.cache && F(this);
return this;
};
r.addReplacer = function(a, c) {
"string" === typeof a && (a = new RegExp(a, "g"));
this.replacer || (this.replacer = []);
this.replacer.push(a, c || "");
this.cache && F(this);
return this;
};
function F(a) {
a.h.clear();
a.j.clear();
}
r.encode = function(a) {
if (this.cache && a.length <= this.m) {
if (this.l) {
if (this.h.has(a)) { if (this.h.has(a)) {
return this.h.get(a); return this.h.get(a);
} }
} else { } else {
this.j = setTimeout(D, 50, this); this.l = setTimeout(G, 50, this);
} }
} }
this.normalize && (a = "function" === typeof this.normalize ? this.normalize(a) : B ? a.normalize("NFKD").replace(B, "").toLowerCase() : a.toLowerCase()); this.normalize && (a = "function" === typeof this.normalize ? this.normalize(a) : D ? a.normalize("NFKD").replace(D, "").toLowerCase() : a.toLowerCase());
this.prepare && (a = this.prepare(a)); this.prepare && (a = this.prepare(a));
this.numeric && 3 < a.length && (a = a.replace(y, "$1 $2").replace(z, "$1 $2").replace(x, "$1 ")); this.numeric && 3 < a.length && (a = a.replace(B, "$1 $2").replace(C, "$1 $2").replace(A, "$1 "));
const c = !(this.dedupe || this.mapper || this.filter || this.matcher || this.stemmer || this.replacer); const c = !(this.dedupe || this.mapper || this.filter || this.matcher || this.stemmer || this.replacer);
let b = [], d = this.split || "" === this.split ? a.split(this.split) : a; let b = [], d = this.split || "" === this.split ? a.split(this.split) : a;
for (let g = 0, f, h; g < d.length; g++) { for (let g = 0, f, h; g < d.length; g++) {
@@ -145,95 +198,95 @@ C.prototype.encode = function(a) {
if (this.filter && this.filter.has(f)) { if (this.filter && this.filter.has(f)) {
continue; continue;
} }
if (this.cache && f.length <= this.l) { if (this.cache && f.length <= this.o) {
if (this.j) { if (this.l) {
var e = this.i.get(f); var e = this.j.get(f);
if (e || "" === e) { if (e || "" === e) {
e && b.push(e); e && b.push(e);
continue; continue;
} }
} else { } else {
this.j = setTimeout(D, 50, this); this.l = setTimeout(G, 50, this);
} }
} }
let k; let k;
this.stemmer && 2 < f.length && (this.u || (this.u = new RegExp("(?!^)(" + this.o + ")$")), f = f.replace(this.u, p => this.stemmer.get(p)), k = 1); this.stemmer && 2 < f.length && (this.u || (this.u = new RegExp("(?!^)(" + this.i + ")$")), f = f.replace(this.u, l => this.stemmer.get(l)), k = 1);
f && k && (f.length < this.minlength || this.filter && this.filter.has(f)) && (f = ""); f && k && (f.length < this.minlength || this.filter && this.filter.has(f)) && (f = "");
if (f && (this.mapper || this.dedupe && 1 < f.length)) { if (f && (this.mapper || this.dedupe && 1 < f.length)) {
e = ""; e = "";
for (let p = 0, q = "", m, r; p < f.length; p++) { for (let l = 0, t = "", q, n; l < f.length; l++) {
m = f.charAt(p), m === q && this.dedupe || ((r = this.mapper && this.mapper.get(m)) || "" === r ? r === q && this.dedupe || !(q = r) || (e += r) : e += q = m); q = f.charAt(l), q === t && this.dedupe || ((n = this.mapper && this.mapper.get(q)) || "" === n ? n === t && this.dedupe || !(t = n) || (e += n) : e += t = q);
} }
f = e; f = e;
} }
this.matcher && 1 < f.length && (this.s || (this.s = new RegExp("(" + this.m + ")", "g")), f = f.replace(this.s, p => this.matcher.get(p))); this.matcher && 1 < f.length && (this.s || (this.s = new RegExp("(" + this.g + ")", "g")), f = f.replace(this.s, l => this.matcher.get(l)));
if (f && this.replacer) { if (f && this.replacer) {
for (e = 0; f && e < this.replacer.length; e += 2) { for (e = 0; f && e < this.replacer.length; e += 2) {
f = f.replace(this.replacer[e], this.replacer[e + 1]); f = f.replace(this.replacer[e], this.replacer[e + 1]);
} }
} }
this.cache && h.length <= this.l && (this.i.set(h, f), this.i.size > this.v && (this.i.clear(), this.l = this.l / 1.1 | 0)); this.cache && h.length <= this.o && (this.j.set(h, f), this.j.size > this.v && (this.j.clear(), this.o = this.o / 1.1 | 0));
f && b.push(f); f && b.push(f);
} }
this.finalize && (b = this.finalize(b) || b); this.finalize && (b = this.finalize(b) || b);
this.cache && a.length <= this.g && (this.h.set(a, b), this.h.size > this.v && (this.h.clear(), this.g = this.g / 1.1 | 0)); this.cache && a.length <= this.m && (this.h.set(a, b), this.h.size > this.v && (this.h.clear(), this.m = this.m / 1.1 | 0));
return b; return b;
}; };
function D(a) { function G(a) {
a.j = null; a.l = null;
a.h.clear(); a.h.clear();
a.i.clear(); a.j.clear();
} }
;function E(a) { ;function H(a) {
this.limit = a && !0 !== a ? a : 1000; this.limit = a && !0 !== a ? a : 1000;
this.cache = new Map(); this.cache = new Map();
this.g = ""; this.g = "";
} }
E.prototype.set = function(a, c) { H.prototype.set = function(a, c) {
this.cache.set(this.g = a, c); this.cache.set(this.g = a, c);
this.cache.size > this.limit && this.cache.delete(this.cache.keys().next().value); this.cache.size > this.limit && this.cache.delete(this.cache.keys().next().value);
}; };
E.prototype.get = function(a) { H.prototype.get = function(a) {
const c = this.cache.get(a); const c = this.cache.get(a);
c && this.g !== a && (this.cache.delete(a), this.cache.set(this.g = a, c)); c && this.g !== a && (this.cache.delete(a), this.cache.set(this.g = a, c));
return c; return c;
}; };
E.prototype.remove = function(a) { H.prototype.remove = function(a) {
for (const c of this.cache) { for (const c of this.cache) {
const b = c[0]; const b = c[0];
c[1].includes(a) && this.cache.delete(b); c[1].includes(a) && this.cache.delete(b);
} }
}; };
E.prototype.clear = function() { H.prototype.clear = function() {
this.cache.clear(); this.cache.clear();
this.g = ""; this.g = "";
}; };
const F = {normalize:function(a) { const I = {normalize:function(a) {
return a.toLowerCase(); return a.toLowerCase();
}, dedupe:!1}; }, dedupe:!1};
const G = {memory:{resolution:1}, performance:{resolution:6, fastupdate:!0, context:{depth:1, resolution:3}}, match:{tokenize:"forward"}, score:{resolution:9, context:{depth:2, resolution:9}}}; const J = {memory:{resolution:1}, performance:{resolution:6, fastupdate:!0, context:{depth:1, resolution:3}}, match:{tokenize:"forward"}, score:{resolution:9, context:{depth:2, resolution:9}}};
u(); x();
H.prototype.add = function(a, c, b, d) { K.prototype.add = function(a, c, b, d) {
if (c && (a || 0 === a)) { if (c && (a || 0 === a)) {
if (!d && !b && this.reg.has(a)) { if (!d && !b && this.reg.has(a)) {
return this.update(a, c); return this.update(a, c);
} }
c = this.encoder.encode(c); c = this.encoder.encode(c);
if (d = c.length) { if (d = c.length) {
const p = u(), q = u(), m = this.depth, r = this.resolution; const l = x(), t = x(), q = this.depth, n = this.resolution;
for (let l = 0; l < d; l++) { for (let m = 0; m < d; m++) {
let n = c[this.rtl ? d - 1 - l : l]; let p = c[this.rtl ? d - 1 - m : m];
var e = n.length; var e = p.length;
if (e && (m || !q[n])) { if (e && (q || !t[p])) {
var g = this.score ? this.score(c, n, l, null, 0) : I(r, d, l), f = ""; var g = this.score ? this.score(c, p, m, null, 0) : L(n, d, m), f = "";
switch(this.tokenize) { switch(this.tokenize) {
case "full": case "full":
if (2 < e) { if (2 < e) {
for (g = 0; g < e; g++) { for (g = 0; g < e; g++) {
for (var h = e; h > g; h--) { for (var h = e; h > g; h--) {
f = n.substring(g, h); f = p.substring(g, h);
var k = this.score ? this.score(c, n, l, f, g) : I(r, d, l, e, g); var k = this.score ? this.score(c, p, m, f, g) : L(n, d, m, e, g);
J(this, q, f, k, a, b); M(this, t, f, k, a, b);
} }
} }
break; break;
@@ -241,24 +294,24 @@ H.prototype.add = function(a, c, b, d) {
case "reverse": case "reverse":
if (1 < e) { if (1 < e) {
for (h = e - 1; 0 < h; h--) { for (h = e - 1; 0 < h; h--) {
f = n[h] + f, k = this.score ? this.score(c, n, l, f, h) : I(r, d, l, e, h), J(this, q, f, k, a, b); f = p[h] + f, k = this.score ? this.score(c, p, m, f, h) : L(n, d, m, e, h), M(this, t, f, k, a, b);
} }
f = ""; f = "";
} }
case "forward": case "forward":
if (1 < e) { if (1 < e) {
for (h = 0; h < e; h++) { for (h = 0; h < e; h++) {
f += n[h], J(this, q, f, g, a, b); f += p[h], M(this, t, f, g, a, b);
} }
break; break;
} }
default: default:
if (J(this, q, n, g, a, b), m && 1 < d && l < d - 1) { if (M(this, t, p, g, a, b), q && 1 < d && m < d - 1) {
for (e = u(), f = this.A, g = n, h = Math.min(m + 1, d - l), e[g] = 1, k = 1; k < h; k++) { for (e = x(), f = this.A, g = p, h = Math.min(q + 1, d - m), e[g] = 1, k = 1; k < h; k++) {
if ((n = c[this.rtl ? d - 1 - l - k : l + k]) && !e[n]) { if ((p = c[this.rtl ? d - 1 - m - k : m + k]) && !e[p]) {
e[n] = 1; e[p] = 1;
const A = this.score ? this.score(c, g, l, n, k) : I(f + (d / 2 > f ? 0 : 1), d, l, h - 1, k - 1), L = this.bidirectional && n > g; const v = this.score ? this.score(c, g, m, p, k) : L(f + (d / 2 > f ? 0 : 1), d, m, h - 1, k - 1), w = this.bidirectional && p > g;
J(this, p, L ? g : n, A, a, b, L ? n : g); M(this, l, w ? g : p, v, a, b, w ? p : g);
} }
} }
} }
@@ -270,16 +323,16 @@ H.prototype.add = function(a, c, b, d) {
} }
return this; return this;
}; };
function J(a, c, b, d, e, g, f) { function M(a, c, b, d, e, g, f) {
let h = f ? a.ctx : a.map, k; let h = f ? a.ctx : a.map, k;
if (!c[b] || f && !(k = c[b])[f]) { if (!c[b] || f && !(k = c[b])[f]) {
f ? (c = k || (c[b] = u()), c[f] = 1, (k = h.get(f)) ? h = k : h.set(f, h = new Map())) : c[b] = 1, (k = h.get(b)) ? h = k : h.set(b, h = []), h = h[d] || (h[d] = []), g && h.includes(e) || (h.push(e), a.fastupdate && ((c = a.reg.get(e)) ? c.push(h) : a.reg.set(e, [h]))); f ? (c = k || (c[b] = x()), c[f] = 1, (k = h.get(f)) ? h = k : h.set(f, h = new Map())) : c[b] = 1, (k = h.get(b)) ? h = k : h.set(b, h = []), h = h[d] || (h[d] = []), g && h.includes(e) || (h.push(e), a.fastupdate && ((c = a.reg.get(e)) ? c.push(h) : a.reg.set(e, [h])));
} }
} }
function I(a, c, b, d, e) { function L(a, c, b, d, e) {
return b && 1 < a ? c + (d || 0) <= a ? b + (e || 0) : (a - 1) / (c + (d || 0)) * (b + (e || 0)) + 1 | 0 : 0; return b && 1 < a ? c + (d || 0) <= a ? b + (e || 0) : (a - 1) / (c + (d || 0)) * (b + (e || 0)) + 1 | 0 : 0;
} }
;function K(a, c, b) { ;function N(a, c, b) {
if (1 === a.length) { if (1 === a.length) {
return a = a[0], a = b || a.length > c ? c ? a.slice(b, b + c) : a.slice(b) : a; return a = a[0], a = b || a.length > c ? c ? a.slice(b, b + c) : a.slice(b) : a;
} }
@@ -309,7 +362,7 @@ function I(a, c, b, d, e) {
} }
return d.length ? d = 1 < d.length ? [].concat.apply([], d) : d[0] : d; return d.length ? d = 1 < d.length ? [].concat.apply([], d) : d[0] : d;
} }
;H.prototype.search = function(a, c, b) { ;K.prototype.search = function(a, c, b) {
b || (c || "object" !== typeof a ? "object" === typeof c && (b = c, c = 0) : (b = a, a = "")); b || (c || "object" !== typeof a ? "object" === typeof c && (b = c, c = 0) : (b = a, a = ""));
var d = [], e = 0; var d = [], e = 0;
if (b) { if (b) {
@@ -318,102 +371,104 @@ function I(a, c, b, d, e) {
e = b.offset || 0; e = b.offset || 0;
var g = b.context; var g = b.context;
var f = b.suggest; var f = b.suggest;
var h = !0;
var k = b.resolution;
} else {
h = !0;
} }
a = this.encoder.encode(a); var l = this.encoder.encode(a);
b = a.length; b = l.length;
c || (c = 100); c || !h || (c = 100);
if (1 === b) { if (1 === b) {
return M.call(this, a[0], "", c, e); return O.call(this, l[0], "", c, e);
} }
g = this.depth && !1 !== g; g = this.depth && !1 !== g;
if (2 === b && g && !f) { if (2 === b && g && !f) {
return M.call(this, a[0], a[1], c, e); return O.call(this, l[0], l[1], c, e);
} }
var h = 0, k = 0; let t = h = 0;
if (1 < b) { if (1 < b) {
var p = u(); const n = x(), m = [];
const m = []; for (let p = 0, v; p < b; p++) {
for (let r = 0, l; r < b; r++) { if ((v = l[p]) && !n[v]) {
if ((l = a[r]) && !p[l]) { if (f || P(this, v)) {
if (f || N(this, l)) { m.push(v), n[v] = 1;
m.push(l), p[l] = 1;
} else { } else {
return d; return d;
} }
const n = l.length; const w = v.length;
h = Math.max(h, n); h = Math.max(h, w);
k = k ? Math.min(k, n) : n; t = t ? Math.min(t, w) : w;
} }
} }
a = m; l = m;
b = a.length; b = a.length;
} }
if (!b) { if (!b) {
return d; return d;
} }
p = 0; a = 0;
if (1 === b) { if (1 === b) {
return M.call(this, a[0], "", c, e); return O.call(this, l[0], "", c, e);
} }
if (2 === b && g && !f) { if (2 === b && g && !f) {
return M.call(this, a[0], a[1], c, e); return O.call(this, l[0], l[1], c, e);
} }
if (1 < b) { if (1 < b) {
if (g) { if (g) {
var q = a[0]; var q = l[0];
p = 1; a = 1;
} else { } else {
9 < h && 3 < h / k && a.sort(v); 9 < h && 3 < h / t && l.sort(y);
} }
} }
for (let m, r; p < b; p++) { k || 0 === k || (k = this.resolution);
r = a[p]; for (let n, m; a < b; a++) {
q ? (m = N(this, r, q), m = O(m, d, f, this.A), f && !1 === m && d.length || (q = r)) : (m = N(this, r, ""), m = O(m, d, f, this.resolution)); m = l[a];
if (m) { q ? (n = P(this, m, q), n = Q(n, d, f, this.A), f && !1 === n && d.length || (q = m)) : (n = P(this, m, ""), n = Q(n, d, f, k));
return m; if (n) {
return n;
} }
if (f && p === b - 1) { if (f && a === b - 1) {
g = d.length; g = d.length;
if (!g) { if (!g) {
if (q) { if (q) {
q = ""; q = "";
p = -1; a = -1;
continue; continue;
} }
return d; return d;
} }
if (1 === g) { if (1 === g) {
return K(d[0], c, e); return N(d[0], c, e);
} }
} }
} }
a: { a: {
a = d;
d = this.resolution;
q = f; q = f;
b = a.length; b = d.length;
f = []; f = [];
g = u(); g = x();
for (let m = 0, r, l, n, A; m < d; m++) { for (let n = 0, m, p, v, w; n < k; n++) {
for (k = 0; k < b; k++) { for (a = 0; a < b; a++) {
if (n = a[k], m < n.length && (r = n[m])) { if (v = d[a], n < v.length && (m = v[n])) {
for (p = 0; p < r.length; p++) { for (h = 0; h < m.length; h++) {
l = r[p], (h = g[l]) ? g[l]++ : (h = 0, g[l] = 1), A = f[h] || (f[h] = []), A.push(l); p = m[h], (l = g[p]) ? g[p]++ : (l = 0, g[p] = 1), w = f[l] || (f[l] = []), w.push(p);
} }
} }
} }
} }
if (a = f.length) { if (k = f.length) {
if (q) { if (q) {
if (1 < f.length) { if (1 < f.length) {
b: { b: {
for (a = [], d = u(), q = f.length, h = q - 1; 0 <= h; h--) { for (k = [], d = x(), q = f.length, l = q - 1; 0 <= l; l--) {
for (q = f[h], g = q.length, k = 0; k < g; k++) { for (q = f[l], g = q.length, a = 0; a < g; a++) {
if (b = q[k], !d[b]) { if (b = q[a], !d[b]) {
if (d[b] = 1, e) { if (d[b] = 1, e) {
e--; e--;
} else { } else {
if (a.push(b), a.length === c) { if (k.push(b), k.length === c) {
break b; break b;
} }
} }
@@ -422,15 +477,15 @@ function I(a, c, b, d, e) {
} }
} }
} else { } else {
a = (f = f[0]).length > c || e ? f.slice(e, c + e) : f; k = (f = f[0]).length > c || e ? f.slice(e, c + e) : f;
} }
f = a; f = k;
} else { } else {
if (a < b) { if (k < b) {
d = []; d = [];
break a; break a;
} }
f = f[a - 1]; f = f[k - 1];
if (c || e) { if (c || e) {
if (f.length > c || e) { if (f.length > c || e) {
f = f.slice(e, c + e); f = f.slice(e, c + e);
@@ -442,10 +497,10 @@ function I(a, c, b, d, e) {
} }
return d; return d;
}; };
function M(a, c, b, d) {
return (a = N(this, a, c)) && a.length ? K(a, b, d) : [];
}
function O(a, c, b, d) { function O(a, c, b, d) {
return (a = P(this, a, c)) && a.length ? N(a, b, d) : [];
}
function Q(a, c, b, d) {
let e = []; let e = [];
if (a) { if (a) {
d = Math.min(a.length, d); d = Math.min(a.length, d);
@@ -459,13 +514,13 @@ function O(a, c, b, d) {
} }
return !b && e; return !b && e;
} }
function N(a, c, b) { function P(a, c, b) {
let d; let d;
b && (d = a.bidirectional && c > b); b && (d = a.bidirectional && c > b);
a = b ? (a = a.ctx.get(d ? c : b)) && a.get(d ? b : c) : a.map.get(c); a = b ? (a = a.ctx.get(d ? c : b)) && a.get(d ? b : c) : a.map.get(c);
return a; return a;
} }
;H.prototype.remove = function(a, c) { ;K.prototype.remove = function(a, c) {
const b = this.reg.size && (this.fastupdate ? this.reg.get(a) : this.reg.has(a)); const b = this.reg.size && (this.fastupdate ? this.reg.get(a) : this.reg.has(a));
if (b) { if (b) {
if (this.fastupdate) { if (this.fastupdate) {
@@ -480,14 +535,14 @@ function N(a, c, b) {
} }
} }
} else { } else {
P(this.map, a), this.depth && P(this.ctx, a); R(this.map, a), this.depth && R(this.ctx, a);
} }
c || this.reg.delete(a); c || this.reg.delete(a);
} }
this.cache && this.cache.remove(a); this.cache && this.cache.remove(a);
return this; return this;
}; };
function P(a, c) { function R(a, c) {
let b = 0; let b = 0;
if (a.constructor === Array) { if (a.constructor === Array) {
for (let d = 0, e, g; d < a.length; d++) { for (let d = 0, e, g; d < a.length; d++) {
@@ -502,58 +557,58 @@ function P(a, c) {
} }
} else { } else {
for (let d of a) { for (let d of a) {
const e = d[0], g = P(d[1], c); const e = d[0], g = R(d[1], c);
g ? b += g : a.delete(e); g ? b += g : a.delete(e);
} }
} }
return b; return b;
} }
;function H(a, c) { ;function K(a, c) {
if (!this || this.constructor !== H) { if (!this || this.constructor !== K) {
return new H(a); return new K(a);
} }
if (a) { if (a) {
var b = "string" === typeof a ? a : a.preset; var b = "string" === typeof a ? a : a.preset;
b && (G[b] || console.warn("Preset not found: " + b), a = Object.assign({}, G[b], a)); b && (J[b] || console.warn("Preset not found: " + b), a = Object.assign({}, J[b], a));
} else { } else {
a = {}; a = {};
} }
b = a.context || {}; b = a.context;
const d = a.encode || a.encoder || F; const d = !0 === b ? {depth:1} : b || {}, e = a.encode || a.encoder || I;
this.encoder = d.encode ? d : "object" === typeof d ? new C(d) : {encode:d}; this.encoder = e.encode ? e : "object" === typeof e ? new E(e) : {encode:e};
let e;
this.resolution = a.resolution || 9; this.resolution = a.resolution || 9;
this.tokenize = e = a.tokenize || "strict"; this.tokenize = b = a.tokenize || "strict";
this.depth = "strict" === e && b.depth || 0; this.depth = "strict" === b && d.depth || 0;
this.bidirectional = !1 !== b.bidirectional; this.bidirectional = !1 !== d.bidirectional;
this.fastupdate = !!a.fastupdate; this.fastupdate = !!a.fastupdate;
this.score = a.score || null; this.score = a.score || null;
e = !1; b = !1;
this.map = new Map(); this.map = new Map();
this.ctx = new Map(); this.ctx = new Map();
this.reg = c || (this.fastupdate ? new Map() : new Set()); this.reg = c || (this.fastupdate ? new Map() : new Set());
this.A = b.resolution || 1; this.A = d.resolution || 3;
this.rtl = d.rtl || a.rtl || !1; this.rtl = e.rtl || a.rtl || !1;
this.cache = (e = a.cache || null) && new E(e); this.cache = (b = a.cache || null) && new H(b);
} }
H.prototype.clear = function() { r = K.prototype;
r.clear = function() {
this.map.clear(); this.map.clear();
this.ctx.clear(); this.ctx.clear();
this.reg.clear(); this.reg.clear();
this.cache && this.cache.clear(); this.cache && this.cache.clear();
return this; return this;
}; };
H.prototype.append = function(a, c) { r.append = function(a, c) {
return this.add(a, c, !0); return this.add(a, c, !0);
}; };
H.prototype.contain = function(a) { r.contain = function(a) {
return this.reg.has(a); return this.reg.has(a);
}; };
H.prototype.update = function(a, c) { r.update = function(a, c) {
const b = this, d = this.remove(a); const b = this, d = this.remove(a);
return d && d.then ? d.then(() => b.add(a, c)) : this.add(a, c); return d && d.then ? d.then(() => b.add(a, c)) : this.add(a, c);
}; };
function Q(a) { function S(a) {
let c = 0; let c = 0;
if (a.constructor === Array) { if (a.constructor === Array) {
for (let b = 0, d; b < a.length; b++) { for (let b = 0, d; b < a.length; b++) {
@@ -561,21 +616,21 @@ function Q(a) {
} }
} else { } else {
for (const b of a) { for (const b of a) {
const d = b[0], e = Q(b[1]); const d = b[0], e = S(b[1]);
e ? c += e : a.delete(d); e ? c += e : a.delete(d);
} }
} }
return c; return c;
} }
H.prototype.cleanup = function() { r.cleanup = function() {
if (!this.fastupdate) { if (!this.fastupdate) {
return console.info('Cleanup the index isn\'t required when not using "fastupdate".'), this; return console.info('Cleanup the index isn\'t required when not using "fastupdate".'), this;
} }
Q(this.map); S(this.map);
this.depth && Q(this.ctx); this.depth && S(this.ctx);
return this; return this;
}; };
H.prototype.searchCache = function(a, c, b) { r.searchCache = function(a, c, b) {
a = ("object" === typeof a ? "" + a.query : a).toLowerCase(); a = ("object" === typeof a ? "" + a.query : a).toLowerCase();
let d = this.cache.get(a); let d = this.cache.get(a);
if (!d) { if (!d) {
@@ -591,9 +646,9 @@ H.prototype.searchCache = function(a, c, b) {
} }
return d; return d;
}; };
const R = {Index:H, Charset:null, Encoder:C, Document:null, Worker:null, Resolver:null, IndexedDB:null, Language:{}}, S = self; const T = {Index:K, Charset:null, Encoder:E, Document:null, Worker:null, Resolver:null, IndexedDB:null, Language:{}}, U = self;
let T; let V;
(T = S.define) && T.amd ? T([], function() { (V = U.define) && V.amd ? V([], function() {
return R; return T;
}) : "object" === typeof S.exports ? S.exports = R : S.FlexSearch = R; }) : "object" === typeof U.exports ? U.exports = T : U.FlexSearch = T;
}(this||self)); }(this||self));

View File

@@ -5,21 +5,23 @@
* Hosted by Nextapps GmbH * Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;function t(a,c,b){const d=typeof b,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(b){if("function"===e&&d===e)return function(h){return a(b(h))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var g=new Map(b);for(var f of a)g.set(f[0],f[1]);return g}if(c===Set){f=new Set(b);for(g of a.values())f.add(g);return f}}}return a}return b}return"undefined"===e?c:a}function u(){return Object.create(null)}function v(a,c){return c.length-a.length};const w=/[^\p{L}\p{N}]+/u,x=/(\d{3})/g,y=/(\D)(\d{3})/g,z=/(\d{3})(\D)/g,B="".normalize&&/[\u0300-\u036f]/g;function C(a){if(!this||this.constructor!==C)return new C(...arguments);for(let c=0;c<arguments.length;c++)this.assign(arguments[c])} (function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;var r;function u(a,c,b){const d=typeof b,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(b){if("function"===e&&d===e)return function(h){return a(b(h))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var g=new Map(b);for(var f of a)g.set(f[0],f[1]);return g}if(c===Set){f=new Set(b);for(g of a.values())f.add(g);return f}}}return a}return b}return"undefined"===e?c:a}function x(){return Object.create(null)}function y(a,c){return c.length-a.length};const z=/[^\p{L}\p{N}]+/u,A=/(\d{3})/g,B=/(\D)(\d{3})/g,C=/(\d{3})(\D)/g,D="".normalize&&/[\u0300-\u036f]/g;function E(a){if(!this||this.constructor!==E)return new E(...arguments);for(let c=0;c<arguments.length;c++)this.assign(arguments[c])}r=E.prototype;
C.prototype.assign=function(a){this.normalize=t(a.normalize,!0,this.normalize);let c=a.include,b=c||a.exclude||a.split;if("object"===typeof b){let d=!c,e="";a.include||(e+="\\p{Z}");b.letter&&(e+="\\p{L}");b.number&&(e+="\\p{N}",d=!!c);b.symbol&&(e+="\\p{S}");b.punctuation&&(e+="\\p{P}");b.control&&(e+="\\p{C}");if(b=b.char)e+="object"===typeof b?b.join(""):b;try{this.split=new RegExp("["+(c?"^":"")+e+"]+","u")}catch(g){this.split=/\s+/}this.numeric=d}else{try{this.split=t(b,w,this.split)}catch(d){this.split= r.assign=function(a){this.normalize=u(a.normalize,!0,this.normalize);let c=a.include,b=c||a.exclude||a.split;if("object"===typeof b){let d=!c,e="";a.include||(e+="\\p{Z}");b.letter&&(e+="\\p{L}");b.number&&(e+="\\p{N}",d=!!c);b.symbol&&(e+="\\p{S}");b.punctuation&&(e+="\\p{P}");b.control&&(e+="\\p{C}");if(b=b.char)e+="object"===typeof b?b.join(""):b;try{this.split=new RegExp("["+(c?"^":"")+e+"]+","u")}catch(g){this.split=/\s+/}this.numeric=d}else{try{this.split=u(b,z,this.split)}catch(d){this.split=
/\s+/}this.numeric=t(this.numeric,!0)}this.prepare=t(a.prepare,null,this.prepare);this.finalize=t(a.finalize,null,this.finalize);this.rtl=a.rtl||!1;this.dedupe=t(a.dedupe,!0,this.dedupe);this.filter=t((b=a.filter)&&new Set(b),null,this.filter);this.matcher=t((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=t((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=t((b=a.stemmer)&&new Map(b),null,this.stemmer);this.replacer=t(a.replacer,null,this.replacer);this.minlength=t(a.minlength,1,this.minlength); /\s+/}this.numeric=u(this.numeric,!0)}this.prepare=u(a.prepare,null,this.prepare);this.finalize=u(a.finalize,null,this.finalize);this.rtl=a.rtl||!1;this.dedupe=u(a.dedupe,!0,this.dedupe);this.filter=u((b=a.filter)&&new Set(b),null,this.filter);this.matcher=u((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=u((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=u((b=a.stemmer)&&new Map(b),null,this.stemmer);this.replacer=u(a.replacer,null,this.replacer);this.minlength=u(a.minlength,1,this.minlength);
this.maxlength=t(a.maxlength,0,this.maxlength);if(this.cache=b=t(a.cache,!0,this.cache))this.j=null,this.v="number"===typeof b?b:2E5,this.h=new Map,this.i=new Map,this.l=this.g=128;this.m="";this.s=null;this.o="";this.u=null;if(this.matcher)for(const d of this.matcher.keys())this.m+=(this.m?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.o+=(this.o?"|":"")+d;return this}; this.maxlength=u(a.maxlength,0,this.maxlength);if(this.cache=b=u(a.cache,!0,this.cache))this.l=null,this.v="number"===typeof b?b:2E5,this.h=new Map,this.j=new Map,this.o=this.m=128;this.g="";this.s=null;this.i="";this.u=null;if(this.matcher)for(const d of this.matcher.keys())this.g+=(this.g?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.i+=(this.i?"|":"")+d;return this};
C.prototype.encode=function(a){if(this.cache&&a.length<=this.g)if(this.j){if(this.h.has(a))return this.h.get(a)}else this.j=setTimeout(D,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):B?a.normalize("NFKD").replace(B,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(y,"$1 $2").replace(z,"$1 $2").replace(x,"$1 "));const c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let b= r.addMatcher=function(a,c){if("object"===typeof a)return this.addReplacer(a,c);if(2>a.length)return this.addMapper(a,c);this.matcher||(this.matcher=new Map);this.matcher.set(a,c);this.g+=(this.g?"|":"")+a;this.s=null;this.cache&&F(this);return this};r.addStemmer=function(a,c){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,c);this.i+=(this.i?"|":"")+a;this.u=null;this.cache&&F(this);return this};
[],d=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,h;g<d.length;g++){if(!(f=h=d[g]))continue;if(f.length<this.minlength)continue;if(c){b.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.l)if(this.j){var e=this.i.get(f);if(e||""===e){e&&b.push(e);continue}}else this.j=setTimeout(D,50,this);let k;this.stemmer&&2<f.length&&(this.u||(this.u=new RegExp("(?!^)("+this.o+")$")),f=f.replace(this.u,p=>this.stemmer.get(p)),k=1);f&&k&&(f.length<this.minlength|| r.addFilter=function(a){this.filter||(this.filter=new Set);this.filter.add(a);this.cache&&F(this);return this};r.addMapper=function(a,c){if("object"===typeof a)return this.addReplacer(a,c);if(1<a.length)return this.addMatcher(a,c);this.mapper||(this.mapper=new Map);this.mapper.set(a,c);this.cache&&F(this);return this};r.addReplacer=function(a,c){"string"===typeof a&&(a=new RegExp(a,"g"));this.replacer||(this.replacer=[]);this.replacer.push(a,c||"");this.cache&&F(this);return this};
this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){e="";for(let p=0,q="",m,r;p<f.length;p++)m=f.charAt(p),m===q&&this.dedupe||((r=this.mapper&&this.mapper.get(m))||""===r?r===q&&this.dedupe||!(q=r)||(e+=r):e+=q=m);f=e}this.matcher&&1<f.length&&(this.s||(this.s=new RegExp("("+this.m+")","g")),f=f.replace(this.s,p=>this.matcher.get(p)));if(f&&this.replacer)for(e=0;f&&e<this.replacer.length;e+=2)f=f.replace(this.replacer[e],this.replacer[e+1]);this.cache&&h.length<= function F(a){a.h.clear();a.j.clear()}
this.l&&(this.i.set(h,f),this.i.size>this.v&&(this.i.clear(),this.l=this.l/1.1|0));f&&b.push(f)}this.finalize&&(b=this.finalize(b)||b);this.cache&&a.length<=this.g&&(this.h.set(a,b),this.h.size>this.v&&(this.h.clear(),this.g=this.g/1.1|0));return b};function D(a){a.j=null;a.h.clear();a.i.clear()};function E(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.g=""}E.prototype.set=function(a,c){this.cache.set(this.g=a,c);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};E.prototype.get=function(a){const c=this.cache.get(a);c&&this.g!==a&&(this.cache.delete(a),this.cache.set(this.g=a,c));return c};E.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b)}}; r.encode=function(a){if(this.cache&&a.length<=this.m)if(this.l){if(this.h.has(a))return this.h.get(a)}else this.l=setTimeout(G,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):D?a.normalize("NFKD").replace(D,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(B,"$1 $2").replace(C,"$1 $2").replace(A,"$1 "));const c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let b=[],d=this.split||
E.prototype.clear=function(){this.cache.clear();this.g=""};const F={normalize:function(a){return a.toLowerCase()},dedupe:!1};const G={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};u();H.prototype.add=function(a,c,b,d){if(c&&(a||0===a)){if(!d&&!b&&this.reg.has(a))return this.update(a,c);c=this.encoder.encode(c);if(d=c.length){const p=u(),q=u(),m=this.depth,r=this.resolution;for(let l=0;l<d;l++){let n=c[this.rtl?d-1-l:l];var e=n.length;if(e&&(m||!q[n])){var g=this.score?this.score(c,n,l,null,0):I(r,d,l),f="";switch(this.tokenize){case "full":if(2<e){for(g=0;g<e;g++)for(var h=e;h>g;h--){f=n.substring(g,h);var k=this.score?this.score(c,n,l,f,g):I(r,d,l,e,g);J(this,q,f,k,a,b)}break}case "reverse":if(1< ""===this.split?a.split(this.split):a;for(let g=0,f,h;g<d.length;g++){if(!(f=h=d[g]))continue;if(f.length<this.minlength)continue;if(c){b.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.o)if(this.l){var e=this.j.get(f);if(e||""===e){e&&b.push(e);continue}}else this.l=setTimeout(G,50,this);let k;this.stemmer&&2<f.length&&(this.u||(this.u=new RegExp("(?!^)("+this.i+")$")),f=f.replace(this.u,l=>this.stemmer.get(l)),k=1);f&&k&&(f.length<this.minlength||this.filter&&
e){for(h=e-1;0<h;h--)f=n[h]+f,k=this.score?this.score(c,n,l,f,h):I(r,d,l,e,h),J(this,q,f,k,a,b);f=""}case "forward":if(1<e){for(h=0;h<e;h++)f+=n[h],J(this,q,f,g,a,b);break}default:if(J(this,q,n,g,a,b),m&&1<d&&l<d-1)for(e=u(),f=this.A,g=n,h=Math.min(m+1,d-l),e[g]=1,k=1;k<h;k++)if((n=c[this.rtl?d-1-l-k:l+k])&&!e[n]){e[n]=1;const A=this.score?this.score(c,g,l,n,k):I(f+(d/2>f?0:1),d,l,h-1,k-1),K=this.bidirectional&&n>g;J(this,p,K?g:n,A,a,b,K?n:g)}}}}this.fastupdate||this.reg.add(a)}}return this}; this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){e="";for(let l=0,t="",q,n;l<f.length;l++)q=f.charAt(l),q===t&&this.dedupe||((n=this.mapper&&this.mapper.get(q))||""===n?n===t&&this.dedupe||!(t=n)||(e+=n):e+=t=q);f=e}this.matcher&&1<f.length&&(this.s||(this.s=new RegExp("("+this.g+")","g")),f=f.replace(this.s,l=>this.matcher.get(l)));if(f&&this.replacer)for(e=0;f&&e<this.replacer.length;e+=2)f=f.replace(this.replacer[e],this.replacer[e+1]);this.cache&&h.length<=this.o&&(this.j.set(h,
function J(a,c,b,d,e,g,f){let h=f?a.ctx:a.map,k;if(!c[b]||f&&!(k=c[b])[f])f?(c=k||(c[b]=u()),c[f]=1,(k=h.get(f))?h=k:h.set(f,h=new Map)):c[b]=1,(k=h.get(b))?h=k:h.set(b,h=[]),h=h[d]||(h[d]=[]),g&&h.includes(e)||(h.push(e),a.fastupdate&&((c=a.reg.get(e))?c.push(h):a.reg.set(e,[h])))}function I(a,c,b,d,e){return b&&1<a?c+(d||0)<=a?b+(e||0):(a-1)/(c+(d||0))*(b+(e||0))+1|0:0};function L(a,c,b){if(1===a.length)return a=a[0],a=b||a.length>c?c?a.slice(b,b+c):a.slice(b):a;let d=[];for(let e=0,g,f;e<a.length;e++)if((g=a[e])&&(f=g.length)){if(b){if(b>=f){b-=f;continue}b<f&&(g=c?g.slice(b,b+c):g.slice(b),f=g.length,b=0)}if(d.length)f>c&&(g=g.slice(0,c),f=g.length),d.push(g);else{if(f>=c)return f>c&&(g=g.slice(0,c)),g;d=[g]}c-=f;if(!c)break}return d.length?d=1<d.length?[].concat.apply([],d):d[0]:d};H.prototype.search=function(a,c,b){b||(c||"object"!==typeof a?"object"===typeof c&&(b=c,c=0):(b=a,a=""));var d=[],e=0;if(b){a=b.query||a;c=b.limit||c;e=b.offset||0;var g=b.context;var f=b.suggest}a=this.encoder.encode(a);b=a.length;c||(c=100);if(1===b)return M.call(this,a[0],"",c,e);g=this.depth&&!1!==g;if(2===b&&g&&!f)return M.call(this,a[0],a[1],c,e);var h=0,k=0;if(1<b){var p=u();const m=[];for(let r=0,l;r<b;r++)if((l=a[r])&&!p[l]){if(f||N(this,l))m.push(l),p[l]=1;else return d;const n=l.length; f),this.j.size>this.v&&(this.j.clear(),this.o=this.o/1.1|0));f&&b.push(f)}this.finalize&&(b=this.finalize(b)||b);this.cache&&a.length<=this.m&&(this.h.set(a,b),this.h.size>this.v&&(this.h.clear(),this.m=this.m/1.1|0));return b};function G(a){a.l=null;a.h.clear();a.j.clear()};function H(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.g=""}H.prototype.set=function(a,c){this.cache.set(this.g=a,c);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};H.prototype.get=function(a){const c=this.cache.get(a);c&&this.g!==a&&(this.cache.delete(a),this.cache.set(this.g=a,c));return c};H.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b)}};
h=Math.max(h,n);k=k?Math.min(k,n):n}a=m;b=a.length}if(!b)return d;p=0;if(1===b)return M.call(this,a[0],"",c,e);if(2===b&&g&&!f)return M.call(this,a[0],a[1],c,e);if(1<b)if(g){var q=a[0];p=1}else 9<h&&3<h/k&&a.sort(v);for(let m,r;p<b;p++){r=a[p];q?(m=N(this,r,q),m=O(m,d,f,this.A),f&&!1===m&&d.length||(q=r)):(m=N(this,r,""),m=O(m,d,f,this.resolution));if(m)return m;if(f&&p===b-1){g=d.length;if(!g){if(q){q="";p=-1;continue}return d}if(1===g)return L(d[0],c,e)}}a:{a=d;d=this.resolution;q=f;b=a.length; H.prototype.clear=function(){this.cache.clear();this.g=""};const I={normalize:function(a){return a.toLowerCase()},dedupe:!1};const J={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};x();K.prototype.add=function(a,c,b,d){if(c&&(a||0===a)){if(!d&&!b&&this.reg.has(a))return this.update(a,c);c=this.encoder.encode(c);if(d=c.length){const l=x(),t=x(),q=this.depth,n=this.resolution;for(let m=0;m<d;m++){let p=c[this.rtl?d-1-m:m];var e=p.length;if(e&&(q||!t[p])){var g=this.score?this.score(c,p,m,null,0):L(n,d,m),f="";switch(this.tokenize){case "full":if(2<e){for(g=0;g<e;g++)for(var h=e;h>g;h--){f=p.substring(g,h);var k=this.score?this.score(c,p,m,f,g):L(n,d,m,e,g);M(this,t,f,k,a,b)}break}case "reverse":if(1<
f=[];g=u();for(let m=0,r,l,n,A;m<d;m++)for(k=0;k<b;k++)if(n=a[k],m<n.length&&(r=n[m]))for(p=0;p<r.length;p++)l=r[p],(h=g[l])?g[l]++:(h=0,g[l]=1),A=f[h]||(f[h]=[]),A.push(l);if(a=f.length)if(q){if(1<f.length)b:for(a=[],d=u(),q=f.length,h=q-1;0<=h;h--)for(q=f[h],g=q.length,k=0;k<g;k++){if(b=q[k],!d[b])if(d[b]=1,e)e--;else if(a.push(b),a.length===c)break b}else a=(f=f[0]).length>c||e?f.slice(e,c+e):f;f=a}else{if(a<b){d=[];break a}f=f[a-1];if(c||e)if(f.length>c||e)f=f.slice(e,c+e)}d=f}return d}; e){for(h=e-1;0<h;h--)f=p[h]+f,k=this.score?this.score(c,p,m,f,h):L(n,d,m,e,h),M(this,t,f,k,a,b);f=""}case "forward":if(1<e){for(h=0;h<e;h++)f+=p[h],M(this,t,f,g,a,b);break}default:if(M(this,t,p,g,a,b),q&&1<d&&m<d-1)for(e=x(),f=this.A,g=p,h=Math.min(q+1,d-m),e[g]=1,k=1;k<h;k++)if((p=c[this.rtl?d-1-m-k:m+k])&&!e[p]){e[p]=1;const v=this.score?this.score(c,g,m,p,k):L(f+(d/2>f?0:1),d,m,h-1,k-1),w=this.bidirectional&&p>g;M(this,l,w?g:p,v,a,b,w?p:g)}}}}this.fastupdate||this.reg.add(a)}}return this};
function M(a,c,b,d){return(a=N(this,a,c))&&a.length?L(a,b,d):[]}function O(a,c,b,d){let e=[];if(a){d=Math.min(a.length,d);for(let g=0,f;g<d;g++)(f=a[g])&&f&&(e[g]=f);if(e.length){c.push(e);return}}return!b&&e}function N(a,c,b){let d;b&&(d=a.bidirectional&&c>b);a=b?(a=a.ctx.get(d?c:b))&&a.get(d?b:c):a.map.get(c);return a};H.prototype.remove=function(a,c){const b=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(b){if(this.fastupdate)for(let d=0,e;d<b.length;d++){if(e=b[d])if(2>e.length)e.pop();else{const g=e.indexOf(a);g===b.length-1?e.pop():e.splice(g,1)}}else P(this.map,a),this.depth&&P(this.ctx,a);c||this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; function M(a,c,b,d,e,g,f){let h=f?a.ctx:a.map,k;if(!c[b]||f&&!(k=c[b])[f])f?(c=k||(c[b]=x()),c[f]=1,(k=h.get(f))?h=k:h.set(f,h=new Map)):c[b]=1,(k=h.get(b))?h=k:h.set(b,h=[]),h=h[d]||(h[d]=[]),g&&h.includes(e)||(h.push(e),a.fastupdate&&((c=a.reg.get(e))?c.push(h):a.reg.set(e,[h])))}function L(a,c,b,d,e){return b&&1<a?c+(d||0)<=a?b+(e||0):(a-1)/(c+(d||0))*(b+(e||0))+1|0:0};function N(a,c,b){if(1===a.length)return a=a[0],a=b||a.length>c?c?a.slice(b,b+c):a.slice(b):a;let d=[];for(let e=0,g,f;e<a.length;e++)if((g=a[e])&&(f=g.length)){if(b){if(b>=f){b-=f;continue}b<f&&(g=c?g.slice(b,b+c):g.slice(b),f=g.length,b=0)}if(d.length)f>c&&(g=g.slice(0,c),f=g.length),d.push(g);else{if(f>=c)return f>c&&(g=g.slice(0,c)),g;d=[g]}c-=f;if(!c)break}return d.length?d=1<d.length?[].concat.apply([],d):d[0]:d};K.prototype.search=function(a,c,b){b||(c||"object"!==typeof a?"object"===typeof c&&(b=c,c=0):(b=a,a=""));var d=[],e=0;if(b){a=b.query||a;c=b.limit||c;e=b.offset||0;var g=b.context;var f=b.suggest;var h=!0;var k=b.resolution}else h=!0;var l=this.encoder.encode(a);b=l.length;c||!h||(c=100);if(1===b)return O.call(this,l[0],"",c,e);g=this.depth&&!1!==g;if(2===b&&g&&!f)return O.call(this,l[0],l[1],c,e);let t=h=0;if(1<b){const n=x(),m=[];for(let p=0,v;p<b;p++)if((v=l[p])&&!n[v]){if(f||P(this,v))m.push(v),
function P(a,c){let b=0;if(a.constructor===Array)for(let d=0,e,g;d<a.length;d++){if((e=a[d])&&e.length)if(g=e.indexOf(c),0<=g){1<e.length?(e.splice(g,1),b++):delete a[d];break}else b++}else for(let d of a){const e=d[0],g=P(d[1],c);g?b+=g:a.delete(e)}return b};function H(a,c){if(!this||this.constructor!==H)return new H(a);if(a){var b="string"===typeof a?a:a.preset;b&&(a=Object.assign({},G[b],a))}else a={};b=a.context||{};const d=a.encode||a.encoder||F;this.encoder=d.encode?d:"object"===typeof d?new C(d):{encode:d};let e;this.resolution=a.resolution||9;this.tokenize=e=a.tokenize||"strict";this.depth="strict"===e&&b.depth||0;this.bidirectional=!1!==b.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;e=!1;this.map=new Map;this.ctx=new Map; n[v]=1;else return d;const w=v.length;h=Math.max(h,w);t=t?Math.min(t,w):w}l=m;b=a.length}if(!b)return d;a=0;if(1===b)return O.call(this,l[0],"",c,e);if(2===b&&g&&!f)return O.call(this,l[0],l[1],c,e);if(1<b)if(g){var q=l[0];a=1}else 9<h&&3<h/t&&l.sort(y);k||0===k||(k=this.resolution);for(let n,m;a<b;a++){m=l[a];q?(n=P(this,m,q),n=Q(n,d,f,this.A),f&&!1===n&&d.length||(q=m)):(n=P(this,m,""),n=Q(n,d,f,k));if(n)return n;if(f&&a===b-1){g=d.length;if(!g){if(q){q="";a=-1;continue}return d}if(1===g)return N(d[0],
this.reg=c||(this.fastupdate?new Map:new Set);this.A=b.resolution||1;this.rtl=d.rtl||a.rtl||!1;this.cache=(e=a.cache||null)&&new E(e)}H.prototype.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};H.prototype.append=function(a,c){return this.add(a,c,!0)};H.prototype.contain=function(a){return this.reg.has(a)};H.prototype.update=function(a,c){const b=this,d=this.remove(a);return d&&d.then?d.then(()=>b.add(a,c)):this.add(a,c)}; c,e)}}a:{q=f;b=d.length;f=[];g=x();for(let n=0,m,p,v,w;n<k;n++)for(a=0;a<b;a++)if(v=d[a],n<v.length&&(m=v[n]))for(h=0;h<m.length;h++)p=m[h],(l=g[p])?g[p]++:(l=0,g[p]=1),w=f[l]||(f[l]=[]),w.push(p);if(k=f.length)if(q){if(1<f.length)b:for(k=[],d=x(),q=f.length,l=q-1;0<=l;l--)for(q=f[l],g=q.length,a=0;a<g;a++){if(b=q[a],!d[b])if(d[b]=1,e)e--;else if(k.push(b),k.length===c)break b}else k=(f=f[0]).length>c||e?f.slice(e,c+e):f;f=k}else{if(k<b){d=[];break a}f=f[k-1];if(c||e)if(f.length>c||e)f=f.slice(e,
function Q(a){let c=0;if(a.constructor===Array)for(let b=0,d;b<a.length;b++)(d=a[b])&&(c+=d.length);else for(const b of a){const d=b[0],e=Q(b[1]);e?c+=e:a.delete(d)}return c}H.prototype.cleanup=function(){if(!this.fastupdate)return this;Q(this.map);this.depth&&Q(this.ctx);return this}; c+e)}d=f}return d};function O(a,c,b,d){return(a=P(this,a,c))&&a.length?N(a,b,d):[]}function Q(a,c,b,d){let e=[];if(a){d=Math.min(a.length,d);for(let g=0,f;g<d;g++)(f=a[g])&&f&&(e[g]=f);if(e.length){c.push(e);return}}return!b&&e}function P(a,c,b){let d;b&&(d=a.bidirectional&&c>b);a=b?(a=a.ctx.get(d?c:b))&&a.get(d?b:c):a.map.get(c);return a};K.prototype.remove=function(a,c){const b=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(b){if(this.fastupdate)for(let d=0,e;d<b.length;d++){if(e=b[d])if(2>e.length)e.pop();else{const g=e.indexOf(a);g===b.length-1?e.pop():e.splice(g,1)}}else R(this.map,a),this.depth&&R(this.ctx,a);c||this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
H.prototype.searchCache=function(a,c,b){a=("object"===typeof a?""+a.query:a).toLowerCase();let d=this.cache.get(a);if(!d){d=this.search(a,c,b);if(d.then){const e=this;d.then(function(g){e.cache.set(a,g);return g})}this.cache.set(a,d)}return d};const R={Index:H,Charset:null,Encoder:C,Document:null,Worker:null,Resolver:null,IndexedDB:null,Language:{}},S=self;let T;(T=S.define)&&T.amd?T([],function(){return R}):"object"===typeof S.exports?S.exports=R:S.FlexSearch=R;}(this||self)); function R(a,c){let b=0;if(a.constructor===Array)for(let d=0,e,g;d<a.length;d++){if((e=a[d])&&e.length)if(g=e.indexOf(c),0<=g){1<e.length?(e.splice(g,1),b++):delete a[d];break}else b++}else for(let d of a){const e=d[0],g=R(d[1],c);g?b+=g:a.delete(e)}return b};function K(a,c){if(!this||this.constructor!==K)return new K(a);if(a){var b="string"===typeof a?a:a.preset;b&&(a=Object.assign({},J[b],a))}else a={};b=a.context;const d=!0===b?{depth:1}:b||{},e=a.encode||a.encoder||I;this.encoder=e.encode?e:"object"===typeof e?new E(e):{encode:e};this.resolution=a.resolution||9;this.tokenize=b=a.tokenize||"strict";this.depth="strict"===b&&d.depth||0;this.bidirectional=!1!==d.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;b=!1;this.map=new Map;
this.ctx=new Map;this.reg=c||(this.fastupdate?new Map:new Set);this.A=d.resolution||3;this.rtl=e.rtl||a.rtl||!1;this.cache=(b=a.cache||null)&&new H(b)}r=K.prototype;r.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};r.append=function(a,c){return this.add(a,c,!0)};r.contain=function(a){return this.reg.has(a)};r.update=function(a,c){const b=this,d=this.remove(a);return d&&d.then?d.then(()=>b.add(a,c)):this.add(a,c)};
function S(a){let c=0;if(a.constructor===Array)for(let b=0,d;b<a.length;b++)(d=a[b])&&(c+=d.length);else for(const b of a){const d=b[0],e=S(b[1]);e?c+=e:a.delete(d)}return c}r.cleanup=function(){if(!this.fastupdate)return this;S(this.map);this.depth&&S(this.ctx);return this};r.searchCache=function(a,c,b){a=("object"===typeof a?""+a.query:a).toLowerCase();let d=this.cache.get(a);if(!d){d=this.search(a,c,b);if(d.then){const e=this;d.then(function(g){e.cache.set(a,g);return g})}this.cache.set(a,d)}return d};const T={Index:K,Charset:null,Encoder:E,Document:null,Worker:null,Resolver:null,IndexedDB:null,Language:{}},U=self;let V;(V=U.define)&&V.amd?V([],function(){return T}):"object"===typeof U.exports?U.exports=T:U.FlexSearch=T;}(this||self));

View File

@@ -5,7 +5,8 @@
* Hosted by Nextapps GmbH * Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
function t(a, c, b) { var r;
function u(a, c, b) {
const d = typeof b, e = typeof a; const d = typeof b, e = typeof a;
if ("undefined" !== d) { if ("undefined" !== d) {
if ("undefined" !== e) { if ("undefined" !== e) {
@@ -42,23 +43,24 @@ function t(a, c, b) {
} }
return "undefined" === e ? c : a; return "undefined" === e ? c : a;
} }
function u() { function x() {
return Object.create(null); return Object.create(null);
} }
function v(a, c) { function y(a, c) {
return c.length - a.length; return c.length - a.length;
} }
;const w = /[^\p{L}\p{N}]+/u, x = /(\d{3})/g, y = /(\D)(\d{3})/g, z = /(\d{3})(\D)/g, B = "".normalize && /[\u0300-\u036f]/g; ;const z = /[^\p{L}\p{N}]+/u, A = /(\d{3})/g, B = /(\D)(\d{3})/g, C = /(\d{3})(\D)/g, D = "".normalize && /[\u0300-\u036f]/g;
function C(a) { function E(a) {
if (!this || this.constructor !== C) { if (!this || this.constructor !== E) {
return new C(...arguments); return new E(...arguments);
} }
for (let c = 0; c < arguments.length; c++) { for (let c = 0; c < arguments.length; c++) {
this.assign(arguments[c]); this.assign(arguments[c]);
} }
} }
C.prototype.assign = function(a) { r = E.prototype;
this.normalize = t(a.normalize, !0, this.normalize); r.assign = function(a) {
this.normalize = u(a.normalize, !0, this.normalize);
let c = a.include, b = c || a.exclude || a.split; let c = a.include, b = c || a.exclude || a.split;
if ("object" === typeof b) { if ("object" === typeof b) {
let d = !c, e = ""; let d = !c, e = "";
@@ -79,55 +81,106 @@ C.prototype.assign = function(a) {
this.numeric = d; this.numeric = d;
} else { } else {
try { try {
this.split = t(b, w, this.split); this.split = u(b, z, this.split);
} catch (d) { } catch (d) {
this.split = /\s+/; this.split = /\s+/;
} }
this.numeric = t(this.numeric, !0); this.numeric = u(this.numeric, !0);
} }
this.prepare = t(a.prepare, null, this.prepare); this.prepare = u(a.prepare, null, this.prepare);
this.finalize = t(a.finalize, null, this.finalize); this.finalize = u(a.finalize, null, this.finalize);
this.rtl = a.rtl || !1; this.rtl = a.rtl || !1;
this.dedupe = t(a.dedupe, !0, this.dedupe); this.dedupe = u(a.dedupe, !0, this.dedupe);
this.filter = t((b = a.filter) && new Set(b), null, this.filter); this.filter = u((b = a.filter) && new Set(b), null, this.filter);
this.matcher = t((b = a.matcher) && new Map(b), null, this.matcher); this.matcher = u((b = a.matcher) && new Map(b), null, this.matcher);
this.mapper = t((b = a.mapper) && new Map(b), null, this.mapper); this.mapper = u((b = a.mapper) && new Map(b), null, this.mapper);
this.stemmer = t((b = a.stemmer) && new Map(b), null, this.stemmer); this.stemmer = u((b = a.stemmer) && new Map(b), null, this.stemmer);
this.replacer = t(a.replacer, null, this.replacer); this.replacer = u(a.replacer, null, this.replacer);
this.minlength = t(a.minlength, 1, this.minlength); this.minlength = u(a.minlength, 1, this.minlength);
this.maxlength = t(a.maxlength, 0, this.maxlength); this.maxlength = u(a.maxlength, 0, this.maxlength);
if (this.cache = b = t(a.cache, !0, this.cache)) { if (this.cache = b = u(a.cache, !0, this.cache)) {
this.j = null, this.v = "number" === typeof b ? b : 2e5, this.h = new Map(), this.i = new Map(), this.l = this.g = 128; this.l = null, this.v = "number" === typeof b ? b : 2e5, this.h = new Map(), this.j = new Map(), this.o = this.m = 128;
} }
this.m = ""; this.g = "";
this.s = null; this.s = null;
this.o = ""; this.i = "";
this.u = null; this.u = null;
if (this.matcher) { if (this.matcher) {
for (const d of this.matcher.keys()) { for (const d of this.matcher.keys()) {
this.m += (this.m ? "|" : "") + d; this.g += (this.g ? "|" : "") + d;
} }
} }
if (this.stemmer) { if (this.stemmer) {
for (const d of this.stemmer.keys()) { for (const d of this.stemmer.keys()) {
this.o += (this.o ? "|" : "") + d; this.i += (this.i ? "|" : "") + d;
} }
} }
return this; return this;
}; };
C.prototype.encode = function(a) { r.addMatcher = function(a, c) {
if (this.cache && a.length <= this.g) { if ("object" === typeof a) {
if (this.j) { return this.addReplacer(a, c);
}
if (2 > a.length) {
return this.addMapper(a, c);
}
this.matcher || (this.matcher = new Map());
this.matcher.set(a, c);
this.g += (this.g ? "|" : "") + a;
this.s = null;
this.cache && F(this);
return this;
};
r.addStemmer = function(a, c) {
this.stemmer || (this.stemmer = new Map());
this.stemmer.set(a, c);
this.i += (this.i ? "|" : "") + a;
this.u = null;
this.cache && F(this);
return this;
};
r.addFilter = function(a) {
this.filter || (this.filter = new Set());
this.filter.add(a);
this.cache && F(this);
return this;
};
r.addMapper = function(a, c) {
if ("object" === typeof a) {
return this.addReplacer(a, c);
}
if (1 < a.length) {
return this.addMatcher(a, c);
}
this.mapper || (this.mapper = new Map());
this.mapper.set(a, c);
this.cache && F(this);
return this;
};
r.addReplacer = function(a, c) {
"string" === typeof a && (a = new RegExp(a, "g"));
this.replacer || (this.replacer = []);
this.replacer.push(a, c || "");
this.cache && F(this);
return this;
};
function F(a) {
a.h.clear();
a.j.clear();
}
r.encode = function(a) {
if (this.cache && a.length <= this.m) {
if (this.l) {
if (this.h.has(a)) { if (this.h.has(a)) {
return this.h.get(a); return this.h.get(a);
} }
} else { } else {
this.j = setTimeout(D, 50, this); this.l = setTimeout(G, 50, this);
} }
} }
this.normalize && (a = "function" === typeof this.normalize ? this.normalize(a) : B ? a.normalize("NFKD").replace(B, "").toLowerCase() : a.toLowerCase()); this.normalize && (a = "function" === typeof this.normalize ? this.normalize(a) : D ? a.normalize("NFKD").replace(D, "").toLowerCase() : a.toLowerCase());
this.prepare && (a = this.prepare(a)); this.prepare && (a = this.prepare(a));
this.numeric && 3 < a.length && (a = a.replace(y, "$1 $2").replace(z, "$1 $2").replace(x, "$1 ")); this.numeric && 3 < a.length && (a = a.replace(B, "$1 $2").replace(C, "$1 $2").replace(A, "$1 "));
const c = !(this.dedupe || this.mapper || this.filter || this.matcher || this.stemmer || this.replacer); const c = !(this.dedupe || this.mapper || this.filter || this.matcher || this.stemmer || this.replacer);
let b = [], d = this.split || "" === this.split ? a.split(this.split) : a; let b = [], d = this.split || "" === this.split ? a.split(this.split) : a;
for (let g = 0, f, h; g < d.length; g++) { for (let g = 0, f, h; g < d.length; g++) {
@@ -144,95 +197,95 @@ C.prototype.encode = function(a) {
if (this.filter && this.filter.has(f)) { if (this.filter && this.filter.has(f)) {
continue; continue;
} }
if (this.cache && f.length <= this.l) { if (this.cache && f.length <= this.o) {
if (this.j) { if (this.l) {
var e = this.i.get(f); var e = this.j.get(f);
if (e || "" === e) { if (e || "" === e) {
e && b.push(e); e && b.push(e);
continue; continue;
} }
} else { } else {
this.j = setTimeout(D, 50, this); this.l = setTimeout(G, 50, this);
} }
} }
let k; let k;
this.stemmer && 2 < f.length && (this.u || (this.u = new RegExp("(?!^)(" + this.o + ")$")), f = f.replace(this.u, p => this.stemmer.get(p)), k = 1); this.stemmer && 2 < f.length && (this.u || (this.u = new RegExp("(?!^)(" + this.i + ")$")), f = f.replace(this.u, l => this.stemmer.get(l)), k = 1);
f && k && (f.length < this.minlength || this.filter && this.filter.has(f)) && (f = ""); f && k && (f.length < this.minlength || this.filter && this.filter.has(f)) && (f = "");
if (f && (this.mapper || this.dedupe && 1 < f.length)) { if (f && (this.mapper || this.dedupe && 1 < f.length)) {
e = ""; e = "";
for (let p = 0, q = "", m, r; p < f.length; p++) { for (let l = 0, t = "", q, n; l < f.length; l++) {
m = f.charAt(p), m === q && this.dedupe || ((r = this.mapper && this.mapper.get(m)) || "" === r ? r === q && this.dedupe || !(q = r) || (e += r) : e += q = m); q = f.charAt(l), q === t && this.dedupe || ((n = this.mapper && this.mapper.get(q)) || "" === n ? n === t && this.dedupe || !(t = n) || (e += n) : e += t = q);
} }
f = e; f = e;
} }
this.matcher && 1 < f.length && (this.s || (this.s = new RegExp("(" + this.m + ")", "g")), f = f.replace(this.s, p => this.matcher.get(p))); this.matcher && 1 < f.length && (this.s || (this.s = new RegExp("(" + this.g + ")", "g")), f = f.replace(this.s, l => this.matcher.get(l)));
if (f && this.replacer) { if (f && this.replacer) {
for (e = 0; f && e < this.replacer.length; e += 2) { for (e = 0; f && e < this.replacer.length; e += 2) {
f = f.replace(this.replacer[e], this.replacer[e + 1]); f = f.replace(this.replacer[e], this.replacer[e + 1]);
} }
} }
this.cache && h.length <= this.l && (this.i.set(h, f), this.i.size > this.v && (this.i.clear(), this.l = this.l / 1.1 | 0)); this.cache && h.length <= this.o && (this.j.set(h, f), this.j.size > this.v && (this.j.clear(), this.o = this.o / 1.1 | 0));
f && b.push(f); f && b.push(f);
} }
this.finalize && (b = this.finalize(b) || b); this.finalize && (b = this.finalize(b) || b);
this.cache && a.length <= this.g && (this.h.set(a, b), this.h.size > this.v && (this.h.clear(), this.g = this.g / 1.1 | 0)); this.cache && a.length <= this.m && (this.h.set(a, b), this.h.size > this.v && (this.h.clear(), this.m = this.m / 1.1 | 0));
return b; return b;
}; };
function D(a) { function G(a) {
a.j = null; a.l = null;
a.h.clear(); a.h.clear();
a.i.clear(); a.j.clear();
} }
;function E(a) { ;function H(a) {
this.limit = a && !0 !== a ? a : 1000; this.limit = a && !0 !== a ? a : 1000;
this.cache = new Map(); this.cache = new Map();
this.g = ""; this.g = "";
} }
E.prototype.set = function(a, c) { H.prototype.set = function(a, c) {
this.cache.set(this.g = a, c); this.cache.set(this.g = a, c);
this.cache.size > this.limit && this.cache.delete(this.cache.keys().next().value); this.cache.size > this.limit && this.cache.delete(this.cache.keys().next().value);
}; };
E.prototype.get = function(a) { H.prototype.get = function(a) {
const c = this.cache.get(a); const c = this.cache.get(a);
c && this.g !== a && (this.cache.delete(a), this.cache.set(this.g = a, c)); c && this.g !== a && (this.cache.delete(a), this.cache.set(this.g = a, c));
return c; return c;
}; };
E.prototype.remove = function(a) { H.prototype.remove = function(a) {
for (const c of this.cache) { for (const c of this.cache) {
const b = c[0]; const b = c[0];
c[1].includes(a) && this.cache.delete(b); c[1].includes(a) && this.cache.delete(b);
} }
}; };
E.prototype.clear = function() { H.prototype.clear = function() {
this.cache.clear(); this.cache.clear();
this.g = ""; this.g = "";
}; };
const F = {normalize:function(a) { const I = {normalize:function(a) {
return a.toLowerCase(); return a.toLowerCase();
}, dedupe:!1}; }, dedupe:!1};
const G = {memory:{resolution:1}, performance:{resolution:6, fastupdate:!0, context:{depth:1, resolution:3}}, match:{tokenize:"forward"}, score:{resolution:9, context:{depth:2, resolution:9}}}; const J = {memory:{resolution:1}, performance:{resolution:6, fastupdate:!0, context:{depth:1, resolution:3}}, match:{tokenize:"forward"}, score:{resolution:9, context:{depth:2, resolution:9}}};
u(); x();
H.prototype.add = function(a, c, b, d) { K.prototype.add = function(a, c, b, d) {
if (c && (a || 0 === a)) { if (c && (a || 0 === a)) {
if (!d && !b && this.reg.has(a)) { if (!d && !b && this.reg.has(a)) {
return this.update(a, c); return this.update(a, c);
} }
c = this.encoder.encode(c); c = this.encoder.encode(c);
if (d = c.length) { if (d = c.length) {
const p = u(), q = u(), m = this.depth, r = this.resolution; const l = x(), t = x(), q = this.depth, n = this.resolution;
for (let l = 0; l < d; l++) { for (let m = 0; m < d; m++) {
let n = c[this.rtl ? d - 1 - l : l]; let p = c[this.rtl ? d - 1 - m : m];
var e = n.length; var e = p.length;
if (e && (m || !q[n])) { if (e && (q || !t[p])) {
var g = this.score ? this.score(c, n, l, null, 0) : J(r, d, l), f = ""; var g = this.score ? this.score(c, p, m, null, 0) : L(n, d, m), f = "";
switch(this.tokenize) { switch(this.tokenize) {
case "full": case "full":
if (2 < e) { if (2 < e) {
for (g = 0; g < e; g++) { for (g = 0; g < e; g++) {
for (var h = e; h > g; h--) { for (var h = e; h > g; h--) {
f = n.substring(g, h); f = p.substring(g, h);
var k = this.score ? this.score(c, n, l, f, g) : J(r, d, l, e, g); var k = this.score ? this.score(c, p, m, f, g) : L(n, d, m, e, g);
K(this, q, f, k, a, b); M(this, t, f, k, a, b);
} }
} }
break; break;
@@ -240,24 +293,24 @@ H.prototype.add = function(a, c, b, d) {
case "reverse": case "reverse":
if (1 < e) { if (1 < e) {
for (h = e - 1; 0 < h; h--) { for (h = e - 1; 0 < h; h--) {
f = n[h] + f, k = this.score ? this.score(c, n, l, f, h) : J(r, d, l, e, h), K(this, q, f, k, a, b); f = p[h] + f, k = this.score ? this.score(c, p, m, f, h) : L(n, d, m, e, h), M(this, t, f, k, a, b);
} }
f = ""; f = "";
} }
case "forward": case "forward":
if (1 < e) { if (1 < e) {
for (h = 0; h < e; h++) { for (h = 0; h < e; h++) {
f += n[h], K(this, q, f, g, a, b); f += p[h], M(this, t, f, g, a, b);
} }
break; break;
} }
default: default:
if (K(this, q, n, g, a, b), m && 1 < d && l < d - 1) { if (M(this, t, p, g, a, b), q && 1 < d && m < d - 1) {
for (e = u(), f = this.A, g = n, h = Math.min(m + 1, d - l), e[g] = 1, k = 1; k < h; k++) { for (e = x(), f = this.A, g = p, h = Math.min(q + 1, d - m), e[g] = 1, k = 1; k < h; k++) {
if ((n = c[this.rtl ? d - 1 - l - k : l + k]) && !e[n]) { if ((p = c[this.rtl ? d - 1 - m - k : m + k]) && !e[p]) {
e[n] = 1; e[p] = 1;
const A = this.score ? this.score(c, g, l, n, k) : J(f + (d / 2 > f ? 0 : 1), d, l, h - 1, k - 1), I = this.bidirectional && n > g; const v = this.score ? this.score(c, g, m, p, k) : L(f + (d / 2 > f ? 0 : 1), d, m, h - 1, k - 1), w = this.bidirectional && p > g;
K(this, p, I ? g : n, A, a, b, I ? n : g); M(this, l, w ? g : p, v, a, b, w ? p : g);
} }
} }
} }
@@ -269,16 +322,16 @@ H.prototype.add = function(a, c, b, d) {
} }
return this; return this;
}; };
function K(a, c, b, d, e, g, f) { function M(a, c, b, d, e, g, f) {
let h = f ? a.ctx : a.map, k; let h = f ? a.ctx : a.map, k;
if (!c[b] || f && !(k = c[b])[f]) { if (!c[b] || f && !(k = c[b])[f]) {
f ? (c = k || (c[b] = u()), c[f] = 1, (k = h.get(f)) ? h = k : h.set(f, h = new Map())) : c[b] = 1, (k = h.get(b)) ? h = k : h.set(b, h = []), h = h[d] || (h[d] = []), g && h.includes(e) || (h.push(e), a.fastupdate && ((c = a.reg.get(e)) ? c.push(h) : a.reg.set(e, [h]))); f ? (c = k || (c[b] = x()), c[f] = 1, (k = h.get(f)) ? h = k : h.set(f, h = new Map())) : c[b] = 1, (k = h.get(b)) ? h = k : h.set(b, h = []), h = h[d] || (h[d] = []), g && h.includes(e) || (h.push(e), a.fastupdate && ((c = a.reg.get(e)) ? c.push(h) : a.reg.set(e, [h])));
} }
} }
function J(a, c, b, d, e) { function L(a, c, b, d, e) {
return b && 1 < a ? c + (d || 0) <= a ? b + (e || 0) : (a - 1) / (c + (d || 0)) * (b + (e || 0)) + 1 | 0 : 0; return b && 1 < a ? c + (d || 0) <= a ? b + (e || 0) : (a - 1) / (c + (d || 0)) * (b + (e || 0)) + 1 | 0 : 0;
} }
;function L(a, c, b) { ;function N(a, c, b) {
if (1 === a.length) { if (1 === a.length) {
return a = a[0], a = b || a.length > c ? c ? a.slice(b, b + c) : a.slice(b) : a; return a = a[0], a = b || a.length > c ? c ? a.slice(b, b + c) : a.slice(b) : a;
} }
@@ -308,7 +361,7 @@ function J(a, c, b, d, e) {
} }
return d.length ? d = 1 < d.length ? [].concat.apply([], d) : d[0] : d; return d.length ? d = 1 < d.length ? [].concat.apply([], d) : d[0] : d;
} }
;H.prototype.search = function(a, c, b) { ;K.prototype.search = function(a, c, b) {
b || (c || "object" !== typeof a ? "object" === typeof c && (b = c, c = 0) : (b = a, a = "")); b || (c || "object" !== typeof a ? "object" === typeof c && (b = c, c = 0) : (b = a, a = ""));
var d = [], e = 0; var d = [], e = 0;
if (b) { if (b) {
@@ -317,102 +370,104 @@ function J(a, c, b, d, e) {
e = b.offset || 0; e = b.offset || 0;
var g = b.context; var g = b.context;
var f = b.suggest; var f = b.suggest;
var h = !0;
var k = b.resolution;
} else {
h = !0;
} }
a = this.encoder.encode(a); var l = this.encoder.encode(a);
b = a.length; b = l.length;
c || (c = 100); c || !h || (c = 100);
if (1 === b) { if (1 === b) {
return M.call(this, a[0], "", c, e); return O.call(this, l[0], "", c, e);
} }
g = this.depth && !1 !== g; g = this.depth && !1 !== g;
if (2 === b && g && !f) { if (2 === b && g && !f) {
return M.call(this, a[0], a[1], c, e); return O.call(this, l[0], l[1], c, e);
} }
var h = 0, k = 0; let t = h = 0;
if (1 < b) { if (1 < b) {
var p = u(); const n = x(), m = [];
const m = []; for (let p = 0, v; p < b; p++) {
for (let r = 0, l; r < b; r++) { if ((v = l[p]) && !n[v]) {
if ((l = a[r]) && !p[l]) { if (f || P(this, v)) {
if (f || N(this, l)) { m.push(v), n[v] = 1;
m.push(l), p[l] = 1;
} else { } else {
return d; return d;
} }
const n = l.length; const w = v.length;
h = Math.max(h, n); h = Math.max(h, w);
k = k ? Math.min(k, n) : n; t = t ? Math.min(t, w) : w;
} }
} }
a = m; l = m;
b = a.length; b = a.length;
} }
if (!b) { if (!b) {
return d; return d;
} }
p = 0; a = 0;
if (1 === b) { if (1 === b) {
return M.call(this, a[0], "", c, e); return O.call(this, l[0], "", c, e);
} }
if (2 === b && g && !f) { if (2 === b && g && !f) {
return M.call(this, a[0], a[1], c, e); return O.call(this, l[0], l[1], c, e);
} }
if (1 < b) { if (1 < b) {
if (g) { if (g) {
var q = a[0]; var q = l[0];
p = 1; a = 1;
} else { } else {
9 < h && 3 < h / k && a.sort(v); 9 < h && 3 < h / t && l.sort(y);
} }
} }
for (let m, r; p < b; p++) { k || 0 === k || (k = this.resolution);
r = a[p]; for (let n, m; a < b; a++) {
q ? (m = N(this, r, q), m = O(m, d, f, this.A), f && !1 === m && d.length || (q = r)) : (m = N(this, r, ""), m = O(m, d, f, this.resolution)); m = l[a];
if (m) { q ? (n = P(this, m, q), n = Q(n, d, f, this.A), f && !1 === n && d.length || (q = m)) : (n = P(this, m, ""), n = Q(n, d, f, k));
return m; if (n) {
return n;
} }
if (f && p === b - 1) { if (f && a === b - 1) {
g = d.length; g = d.length;
if (!g) { if (!g) {
if (q) { if (q) {
q = ""; q = "";
p = -1; a = -1;
continue; continue;
} }
return d; return d;
} }
if (1 === g) { if (1 === g) {
return L(d[0], c, e); return N(d[0], c, e);
} }
} }
} }
a: { a: {
a = d;
d = this.resolution;
q = f; q = f;
b = a.length; b = d.length;
f = []; f = [];
g = u(); g = x();
for (let m = 0, r, l, n, A; m < d; m++) { for (let n = 0, m, p, v, w; n < k; n++) {
for (k = 0; k < b; k++) { for (a = 0; a < b; a++) {
if (n = a[k], m < n.length && (r = n[m])) { if (v = d[a], n < v.length && (m = v[n])) {
for (p = 0; p < r.length; p++) { for (h = 0; h < m.length; h++) {
l = r[p], (h = g[l]) ? g[l]++ : (h = 0, g[l] = 1), A = f[h] || (f[h] = []), A.push(l); p = m[h], (l = g[p]) ? g[p]++ : (l = 0, g[p] = 1), w = f[l] || (f[l] = []), w.push(p);
} }
} }
} }
} }
if (a = f.length) { if (k = f.length) {
if (q) { if (q) {
if (1 < f.length) { if (1 < f.length) {
b: { b: {
for (a = [], d = u(), q = f.length, h = q - 1; 0 <= h; h--) { for (k = [], d = x(), q = f.length, l = q - 1; 0 <= l; l--) {
for (q = f[h], g = q.length, k = 0; k < g; k++) { for (q = f[l], g = q.length, a = 0; a < g; a++) {
if (b = q[k], !d[b]) { if (b = q[a], !d[b]) {
if (d[b] = 1, e) { if (d[b] = 1, e) {
e--; e--;
} else { } else {
if (a.push(b), a.length === c) { if (k.push(b), k.length === c) {
break b; break b;
} }
} }
@@ -421,15 +476,15 @@ function J(a, c, b, d, e) {
} }
} }
} else { } else {
a = (f = f[0]).length > c || e ? f.slice(e, c + e) : f; k = (f = f[0]).length > c || e ? f.slice(e, c + e) : f;
} }
f = a; f = k;
} else { } else {
if (a < b) { if (k < b) {
d = []; d = [];
break a; break a;
} }
f = f[a - 1]; f = f[k - 1];
if (c || e) { if (c || e) {
if (f.length > c || e) { if (f.length > c || e) {
f = f.slice(e, c + e); f = f.slice(e, c + e);
@@ -441,10 +496,10 @@ function J(a, c, b, d, e) {
} }
return d; return d;
}; };
function M(a, c, b, d) {
return (a = N(this, a, c)) && a.length ? L(a, b, d) : [];
}
function O(a, c, b, d) { function O(a, c, b, d) {
return (a = P(this, a, c)) && a.length ? N(a, b, d) : [];
}
function Q(a, c, b, d) {
let e = []; let e = [];
if (a) { if (a) {
d = Math.min(a.length, d); d = Math.min(a.length, d);
@@ -458,13 +513,13 @@ function O(a, c, b, d) {
} }
return !b && e; return !b && e;
} }
function N(a, c, b) { function P(a, c, b) {
let d; let d;
b && (d = a.bidirectional && c > b); b && (d = a.bidirectional && c > b);
a = b ? (a = a.ctx.get(d ? c : b)) && a.get(d ? b : c) : a.map.get(c); a = b ? (a = a.ctx.get(d ? c : b)) && a.get(d ? b : c) : a.map.get(c);
return a; return a;
} }
;H.prototype.remove = function(a, c) { ;K.prototype.remove = function(a, c) {
const b = this.reg.size && (this.fastupdate ? this.reg.get(a) : this.reg.has(a)); const b = this.reg.size && (this.fastupdate ? this.reg.get(a) : this.reg.has(a));
if (b) { if (b) {
if (this.fastupdate) { if (this.fastupdate) {
@@ -479,14 +534,14 @@ function N(a, c, b) {
} }
} }
} else { } else {
P(this.map, a), this.depth && P(this.ctx, a); R(this.map, a), this.depth && R(this.ctx, a);
} }
c || this.reg.delete(a); c || this.reg.delete(a);
} }
this.cache && this.cache.remove(a); this.cache && this.cache.remove(a);
return this; return this;
}; };
function P(a, c) { function R(a, c) {
let b = 0; let b = 0;
if (a.constructor === Array) { if (a.constructor === Array) {
for (let d = 0, e, g; d < a.length; d++) { for (let d = 0, e, g; d < a.length; d++) {
@@ -501,58 +556,58 @@ function P(a, c) {
} }
} else { } else {
for (let d of a) { for (let d of a) {
const e = d[0], g = P(d[1], c); const e = d[0], g = R(d[1], c);
g ? b += g : a.delete(e); g ? b += g : a.delete(e);
} }
} }
return b; return b;
} }
;function H(a, c) { ;function K(a, c) {
if (!this || this.constructor !== H) { if (!this || this.constructor !== K) {
return new H(a); return new K(a);
} }
if (a) { if (a) {
var b = "string" === typeof a ? a : a.preset; var b = "string" === typeof a ? a : a.preset;
b && (G[b] || console.warn("Preset not found: " + b), a = Object.assign({}, G[b], a)); b && (J[b] || console.warn("Preset not found: " + b), a = Object.assign({}, J[b], a));
} else { } else {
a = {}; a = {};
} }
b = a.context || {}; b = a.context;
const d = a.encode || a.encoder || F; const d = !0 === b ? {depth:1} : b || {}, e = a.encode || a.encoder || I;
this.encoder = d.encode ? d : "object" === typeof d ? new C(d) : {encode:d}; this.encoder = e.encode ? e : "object" === typeof e ? new E(e) : {encode:e};
let e;
this.resolution = a.resolution || 9; this.resolution = a.resolution || 9;
this.tokenize = e = a.tokenize || "strict"; this.tokenize = b = a.tokenize || "strict";
this.depth = "strict" === e && b.depth || 0; this.depth = "strict" === b && d.depth || 0;
this.bidirectional = !1 !== b.bidirectional; this.bidirectional = !1 !== d.bidirectional;
this.fastupdate = !!a.fastupdate; this.fastupdate = !!a.fastupdate;
this.score = a.score || null; this.score = a.score || null;
e = !1; b = !1;
this.map = new Map(); this.map = new Map();
this.ctx = new Map(); this.ctx = new Map();
this.reg = c || (this.fastupdate ? new Map() : new Set()); this.reg = c || (this.fastupdate ? new Map() : new Set());
this.A = b.resolution || 1; this.A = d.resolution || 3;
this.rtl = d.rtl || a.rtl || !1; this.rtl = e.rtl || a.rtl || !1;
this.cache = (e = a.cache || null) && new E(e); this.cache = (b = a.cache || null) && new H(b);
} }
H.prototype.clear = function() { r = K.prototype;
r.clear = function() {
this.map.clear(); this.map.clear();
this.ctx.clear(); this.ctx.clear();
this.reg.clear(); this.reg.clear();
this.cache && this.cache.clear(); this.cache && this.cache.clear();
return this; return this;
}; };
H.prototype.append = function(a, c) { r.append = function(a, c) {
return this.add(a, c, !0); return this.add(a, c, !0);
}; };
H.prototype.contain = function(a) { r.contain = function(a) {
return this.reg.has(a); return this.reg.has(a);
}; };
H.prototype.update = function(a, c) { r.update = function(a, c) {
const b = this, d = this.remove(a); const b = this, d = this.remove(a);
return d && d.then ? d.then(() => b.add(a, c)) : this.add(a, c); return d && d.then ? d.then(() => b.add(a, c)) : this.add(a, c);
}; };
function Q(a) { function S(a) {
let c = 0; let c = 0;
if (a.constructor === Array) { if (a.constructor === Array) {
for (let b = 0, d; b < a.length; b++) { for (let b = 0, d; b < a.length; b++) {
@@ -560,21 +615,21 @@ function Q(a) {
} }
} else { } else {
for (const b of a) { for (const b of a) {
const d = b[0], e = Q(b[1]); const d = b[0], e = S(b[1]);
e ? c += e : a.delete(d); e ? c += e : a.delete(d);
} }
} }
return c; return c;
} }
H.prototype.cleanup = function() { r.cleanup = function() {
if (!this.fastupdate) { if (!this.fastupdate) {
return console.info('Cleanup the index isn\'t required when not using "fastupdate".'), this; return console.info('Cleanup the index isn\'t required when not using "fastupdate".'), this;
} }
Q(this.map); S(this.map);
this.depth && Q(this.ctx); this.depth && S(this.ctx);
return this; return this;
}; };
H.prototype.searchCache = function(a, c, b) { r.searchCache = function(a, c, b) {
a = ("object" === typeof a ? "" + a.query : a).toLowerCase(); a = ("object" === typeof a ? "" + a.query : a).toLowerCase();
let d = this.cache.get(a); let d = this.cache.get(a);
if (!d) { if (!d) {
@@ -590,6 +645,6 @@ H.prototype.searchCache = function(a, c, b) {
} }
return d; return d;
}; };
export default {Index:H, Charset:null, Encoder:C, Document:null, Worker:null, Resolver:null, IndexedDB:null, Language:{}}; export default {Index:K, Charset:null, Encoder:E, Document:null, Worker:null, Resolver:null, IndexedDB:null, Language:{}};
export const Index=H;export const Charset=null;export const Encoder=C;export const Document=null;export const Worker=null;export const Resolver=null;export const IndexedDB=null;export const Language={}; export const Index=K;export const Charset=null;export const Encoder=E;export const Document=null;export const Worker=null;export const Resolver=null;export const IndexedDB=null;export const Language={};

View File

@@ -5,22 +5,24 @@
* Hosted by Nextapps GmbH * Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
function t(a,c,b){const d=typeof b,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(b){if("function"===e&&d===e)return function(h){return a(b(h))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var g=new Map(b);for(var f of a)g.set(f[0],f[1]);return g}if(c===Set){f=new Set(b);for(g of a.values())f.add(g);return f}}}return a}return b}return"undefined"===e?c:a}function u(){return Object.create(null)}function v(a,c){return c.length-a.length};const w=/[^\p{L}\p{N}]+/u,x=/(\d{3})/g,y=/(\D)(\d{3})/g,z=/(\d{3})(\D)/g,B="".normalize&&/[\u0300-\u036f]/g;function C(a){if(!this||this.constructor!==C)return new C(...arguments);for(let c=0;c<arguments.length;c++)this.assign(arguments[c])} var r;function u(a,c,b){const d=typeof b,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(b){if("function"===e&&d===e)return function(h){return a(b(h))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var g=new Map(b);for(var f of a)g.set(f[0],f[1]);return g}if(c===Set){f=new Set(b);for(g of a.values())f.add(g);return f}}}return a}return b}return"undefined"===e?c:a}function x(){return Object.create(null)}function y(a,c){return c.length-a.length};const z=/[^\p{L}\p{N}]+/u,A=/(\d{3})/g,B=/(\D)(\d{3})/g,C=/(\d{3})(\D)/g,D="".normalize&&/[\u0300-\u036f]/g;function E(a){if(!this||this.constructor!==E)return new E(...arguments);for(let c=0;c<arguments.length;c++)this.assign(arguments[c])}r=E.prototype;
C.prototype.assign=function(a){this.normalize=t(a.normalize,!0,this.normalize);let c=a.include,b=c||a.exclude||a.split;if("object"===typeof b){let d=!c,e="";a.include||(e+="\\p{Z}");b.letter&&(e+="\\p{L}");b.number&&(e+="\\p{N}",d=!!c);b.symbol&&(e+="\\p{S}");b.punctuation&&(e+="\\p{P}");b.control&&(e+="\\p{C}");if(b=b.char)e+="object"===typeof b?b.join(""):b;try{this.split=new RegExp("["+(c?"^":"")+e+"]+","u")}catch(g){this.split=/\s+/}this.numeric=d}else{try{this.split=t(b,w,this.split)}catch(d){this.split= r.assign=function(a){this.normalize=u(a.normalize,!0,this.normalize);let c=a.include,b=c||a.exclude||a.split;if("object"===typeof b){let d=!c,e="";a.include||(e+="\\p{Z}");b.letter&&(e+="\\p{L}");b.number&&(e+="\\p{N}",d=!!c);b.symbol&&(e+="\\p{S}");b.punctuation&&(e+="\\p{P}");b.control&&(e+="\\p{C}");if(b=b.char)e+="object"===typeof b?b.join(""):b;try{this.split=new RegExp("["+(c?"^":"")+e+"]+","u")}catch(g){this.split=/\s+/}this.numeric=d}else{try{this.split=u(b,z,this.split)}catch(d){this.split=
/\s+/}this.numeric=t(this.numeric,!0)}this.prepare=t(a.prepare,null,this.prepare);this.finalize=t(a.finalize,null,this.finalize);this.rtl=a.rtl||!1;this.dedupe=t(a.dedupe,!0,this.dedupe);this.filter=t((b=a.filter)&&new Set(b),null,this.filter);this.matcher=t((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=t((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=t((b=a.stemmer)&&new Map(b),null,this.stemmer);this.replacer=t(a.replacer,null,this.replacer);this.minlength=t(a.minlength,1,this.minlength); /\s+/}this.numeric=u(this.numeric,!0)}this.prepare=u(a.prepare,null,this.prepare);this.finalize=u(a.finalize,null,this.finalize);this.rtl=a.rtl||!1;this.dedupe=u(a.dedupe,!0,this.dedupe);this.filter=u((b=a.filter)&&new Set(b),null,this.filter);this.matcher=u((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=u((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=u((b=a.stemmer)&&new Map(b),null,this.stemmer);this.replacer=u(a.replacer,null,this.replacer);this.minlength=u(a.minlength,1,this.minlength);
this.maxlength=t(a.maxlength,0,this.maxlength);if(this.cache=b=t(a.cache,!0,this.cache))this.j=null,this.v="number"===typeof b?b:2E5,this.h=new Map,this.i=new Map,this.l=this.g=128;this.m="";this.s=null;this.o="";this.u=null;if(this.matcher)for(const d of this.matcher.keys())this.m+=(this.m?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.o+=(this.o?"|":"")+d;return this}; this.maxlength=u(a.maxlength,0,this.maxlength);if(this.cache=b=u(a.cache,!0,this.cache))this.l=null,this.v="number"===typeof b?b:2E5,this.h=new Map,this.j=new Map,this.o=this.m=128;this.g="";this.s=null;this.i="";this.u=null;if(this.matcher)for(const d of this.matcher.keys())this.g+=(this.g?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.i+=(this.i?"|":"")+d;return this};
C.prototype.encode=function(a){if(this.cache&&a.length<=this.g)if(this.j){if(this.h.has(a))return this.h.get(a)}else this.j=setTimeout(D,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):B?a.normalize("NFKD").replace(B,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(y,"$1 $2").replace(z,"$1 $2").replace(x,"$1 "));const c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let b= r.addMatcher=function(a,c){if("object"===typeof a)return this.addReplacer(a,c);if(2>a.length)return this.addMapper(a,c);this.matcher||(this.matcher=new Map);this.matcher.set(a,c);this.g+=(this.g?"|":"")+a;this.s=null;this.cache&&F(this);return this};r.addStemmer=function(a,c){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,c);this.i+=(this.i?"|":"")+a;this.u=null;this.cache&&F(this);return this};
[],d=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,h;g<d.length;g++){if(!(f=h=d[g]))continue;if(f.length<this.minlength)continue;if(c){b.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.l)if(this.j){var e=this.i.get(f);if(e||""===e){e&&b.push(e);continue}}else this.j=setTimeout(D,50,this);let k;this.stemmer&&2<f.length&&(this.u||(this.u=new RegExp("(?!^)("+this.o+")$")),f=f.replace(this.u,p=>this.stemmer.get(p)),k=1);f&&k&&(f.length<this.minlength|| r.addFilter=function(a){this.filter||(this.filter=new Set);this.filter.add(a);this.cache&&F(this);return this};r.addMapper=function(a,c){if("object"===typeof a)return this.addReplacer(a,c);if(1<a.length)return this.addMatcher(a,c);this.mapper||(this.mapper=new Map);this.mapper.set(a,c);this.cache&&F(this);return this};r.addReplacer=function(a,c){"string"===typeof a&&(a=new RegExp(a,"g"));this.replacer||(this.replacer=[]);this.replacer.push(a,c||"");this.cache&&F(this);return this};
this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){e="";for(let p=0,q="",m,r;p<f.length;p++)m=f.charAt(p),m===q&&this.dedupe||((r=this.mapper&&this.mapper.get(m))||""===r?r===q&&this.dedupe||!(q=r)||(e+=r):e+=q=m);f=e}this.matcher&&1<f.length&&(this.s||(this.s=new RegExp("("+this.m+")","g")),f=f.replace(this.s,p=>this.matcher.get(p)));if(f&&this.replacer)for(e=0;f&&e<this.replacer.length;e+=2)f=f.replace(this.replacer[e],this.replacer[e+1]);this.cache&&h.length<= function F(a){a.h.clear();a.j.clear()}
this.l&&(this.i.set(h,f),this.i.size>this.v&&(this.i.clear(),this.l=this.l/1.1|0));f&&b.push(f)}this.finalize&&(b=this.finalize(b)||b);this.cache&&a.length<=this.g&&(this.h.set(a,b),this.h.size>this.v&&(this.h.clear(),this.g=this.g/1.1|0));return b};function D(a){a.j=null;a.h.clear();a.i.clear()};function E(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.g=""}E.prototype.set=function(a,c){this.cache.set(this.g=a,c);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};E.prototype.get=function(a){const c=this.cache.get(a);c&&this.g!==a&&(this.cache.delete(a),this.cache.set(this.g=a,c));return c};E.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b)}}; r.encode=function(a){if(this.cache&&a.length<=this.m)if(this.l){if(this.h.has(a))return this.h.get(a)}else this.l=setTimeout(G,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):D?a.normalize("NFKD").replace(D,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(B,"$1 $2").replace(C,"$1 $2").replace(A,"$1 "));const c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let b=[],d=this.split||
E.prototype.clear=function(){this.cache.clear();this.g=""};const F={normalize:function(a){return a.toLowerCase()},dedupe:!1};const G={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};u();I.prototype.add=function(a,c,b,d){if(c&&(a||0===a)){if(!d&&!b&&this.reg.has(a))return this.update(a,c);c=this.encoder.encode(c);if(d=c.length){const p=u(),q=u(),m=this.depth,r=this.resolution;for(let l=0;l<d;l++){let n=c[this.rtl?d-1-l:l];var e=n.length;if(e&&(m||!q[n])){var g=this.score?this.score(c,n,l,null,0):J(r,d,l),f="";switch(this.tokenize){case "full":if(2<e){for(g=0;g<e;g++)for(var h=e;h>g;h--){f=n.substring(g,h);var k=this.score?this.score(c,n,l,f,g):J(r,d,l,e,g);K(this,q,f,k,a,b)}break}case "reverse":if(1< ""===this.split?a.split(this.split):a;for(let g=0,f,h;g<d.length;g++){if(!(f=h=d[g]))continue;if(f.length<this.minlength)continue;if(c){b.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.o)if(this.l){var e=this.j.get(f);if(e||""===e){e&&b.push(e);continue}}else this.l=setTimeout(G,50,this);let k;this.stemmer&&2<f.length&&(this.u||(this.u=new RegExp("(?!^)("+this.i+")$")),f=f.replace(this.u,l=>this.stemmer.get(l)),k=1);f&&k&&(f.length<this.minlength||this.filter&&
e){for(h=e-1;0<h;h--)f=n[h]+f,k=this.score?this.score(c,n,l,f,h):J(r,d,l,e,h),K(this,q,f,k,a,b);f=""}case "forward":if(1<e){for(h=0;h<e;h++)f+=n[h],K(this,q,f,g,a,b);break}default:if(K(this,q,n,g,a,b),m&&1<d&&l<d-1)for(e=u(),f=this.A,g=n,h=Math.min(m+1,d-l),e[g]=1,k=1;k<h;k++)if((n=c[this.rtl?d-1-l-k:l+k])&&!e[n]){e[n]=1;const A=this.score?this.score(c,g,l,n,k):J(f+(d/2>f?0:1),d,l,h-1,k-1),H=this.bidirectional&&n>g;K(this,p,H?g:n,A,a,b,H?n:g)}}}}this.fastupdate||this.reg.add(a)}}return this}; this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){e="";for(let l=0,t="",q,n;l<f.length;l++)q=f.charAt(l),q===t&&this.dedupe||((n=this.mapper&&this.mapper.get(q))||""===n?n===t&&this.dedupe||!(t=n)||(e+=n):e+=t=q);f=e}this.matcher&&1<f.length&&(this.s||(this.s=new RegExp("("+this.g+")","g")),f=f.replace(this.s,l=>this.matcher.get(l)));if(f&&this.replacer)for(e=0;f&&e<this.replacer.length;e+=2)f=f.replace(this.replacer[e],this.replacer[e+1]);this.cache&&h.length<=this.o&&(this.j.set(h,
function K(a,c,b,d,e,g,f){let h=f?a.ctx:a.map,k;if(!c[b]||f&&!(k=c[b])[f])f?(c=k||(c[b]=u()),c[f]=1,(k=h.get(f))?h=k:h.set(f,h=new Map)):c[b]=1,(k=h.get(b))?h=k:h.set(b,h=[]),h=h[d]||(h[d]=[]),g&&h.includes(e)||(h.push(e),a.fastupdate&&((c=a.reg.get(e))?c.push(h):a.reg.set(e,[h])))}function J(a,c,b,d,e){return b&&1<a?c+(d||0)<=a?b+(e||0):(a-1)/(c+(d||0))*(b+(e||0))+1|0:0};function L(a,c,b){if(1===a.length)return a=a[0],a=b||a.length>c?c?a.slice(b,b+c):a.slice(b):a;let d=[];for(let e=0,g,f;e<a.length;e++)if((g=a[e])&&(f=g.length)){if(b){if(b>=f){b-=f;continue}b<f&&(g=c?g.slice(b,b+c):g.slice(b),f=g.length,b=0)}if(d.length)f>c&&(g=g.slice(0,c),f=g.length),d.push(g);else{if(f>=c)return f>c&&(g=g.slice(0,c)),g;d=[g]}c-=f;if(!c)break}return d.length?d=1<d.length?[].concat.apply([],d):d[0]:d};I.prototype.search=function(a,c,b){b||(c||"object"!==typeof a?"object"===typeof c&&(b=c,c=0):(b=a,a=""));var d=[],e=0;if(b){a=b.query||a;c=b.limit||c;e=b.offset||0;var g=b.context;var f=b.suggest}a=this.encoder.encode(a);b=a.length;c||(c=100);if(1===b)return M.call(this,a[0],"",c,e);g=this.depth&&!1!==g;if(2===b&&g&&!f)return M.call(this,a[0],a[1],c,e);var h=0,k=0;if(1<b){var p=u();const m=[];for(let r=0,l;r<b;r++)if((l=a[r])&&!p[l]){if(f||N(this,l))m.push(l),p[l]=1;else return d;const n=l.length; f),this.j.size>this.v&&(this.j.clear(),this.o=this.o/1.1|0));f&&b.push(f)}this.finalize&&(b=this.finalize(b)||b);this.cache&&a.length<=this.m&&(this.h.set(a,b),this.h.size>this.v&&(this.h.clear(),this.m=this.m/1.1|0));return b};function G(a){a.l=null;a.h.clear();a.j.clear()};function H(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.g=""}H.prototype.set=function(a,c){this.cache.set(this.g=a,c);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};H.prototype.get=function(a){const c=this.cache.get(a);c&&this.g!==a&&(this.cache.delete(a),this.cache.set(this.g=a,c));return c};H.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b)}};
h=Math.max(h,n);k=k?Math.min(k,n):n}a=m;b=a.length}if(!b)return d;p=0;if(1===b)return M.call(this,a[0],"",c,e);if(2===b&&g&&!f)return M.call(this,a[0],a[1],c,e);if(1<b)if(g){var q=a[0];p=1}else 9<h&&3<h/k&&a.sort(v);for(let m,r;p<b;p++){r=a[p];q?(m=N(this,r,q),m=O(m,d,f,this.A),f&&!1===m&&d.length||(q=r)):(m=N(this,r,""),m=O(m,d,f,this.resolution));if(m)return m;if(f&&p===b-1){g=d.length;if(!g){if(q){q="";p=-1;continue}return d}if(1===g)return L(d[0],c,e)}}a:{a=d;d=this.resolution;q=f;b=a.length; H.prototype.clear=function(){this.cache.clear();this.g=""};const I={normalize:function(a){return a.toLowerCase()},dedupe:!1};const J={memory:{resolution:1},performance:{resolution:6,fastupdate:!0,context:{depth:1,resolution:3}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:9}}};x();K.prototype.add=function(a,c,b,d){if(c&&(a||0===a)){if(!d&&!b&&this.reg.has(a))return this.update(a,c);c=this.encoder.encode(c);if(d=c.length){const l=x(),t=x(),q=this.depth,n=this.resolution;for(let m=0;m<d;m++){let p=c[this.rtl?d-1-m:m];var e=p.length;if(e&&(q||!t[p])){var g=this.score?this.score(c,p,m,null,0):L(n,d,m),f="";switch(this.tokenize){case "full":if(2<e){for(g=0;g<e;g++)for(var h=e;h>g;h--){f=p.substring(g,h);var k=this.score?this.score(c,p,m,f,g):L(n,d,m,e,g);M(this,t,f,k,a,b)}break}case "reverse":if(1<
f=[];g=u();for(let m=0,r,l,n,A;m<d;m++)for(k=0;k<b;k++)if(n=a[k],m<n.length&&(r=n[m]))for(p=0;p<r.length;p++)l=r[p],(h=g[l])?g[l]++:(h=0,g[l]=1),A=f[h]||(f[h]=[]),A.push(l);if(a=f.length)if(q){if(1<f.length)b:for(a=[],d=u(),q=f.length,h=q-1;0<=h;h--)for(q=f[h],g=q.length,k=0;k<g;k++){if(b=q[k],!d[b])if(d[b]=1,e)e--;else if(a.push(b),a.length===c)break b}else a=(f=f[0]).length>c||e?f.slice(e,c+e):f;f=a}else{if(a<b){d=[];break a}f=f[a-1];if(c||e)if(f.length>c||e)f=f.slice(e,c+e)}d=f}return d}; e){for(h=e-1;0<h;h--)f=p[h]+f,k=this.score?this.score(c,p,m,f,h):L(n,d,m,e,h),M(this,t,f,k,a,b);f=""}case "forward":if(1<e){for(h=0;h<e;h++)f+=p[h],M(this,t,f,g,a,b);break}default:if(M(this,t,p,g,a,b),q&&1<d&&m<d-1)for(e=x(),f=this.A,g=p,h=Math.min(q+1,d-m),e[g]=1,k=1;k<h;k++)if((p=c[this.rtl?d-1-m-k:m+k])&&!e[p]){e[p]=1;const v=this.score?this.score(c,g,m,p,k):L(f+(d/2>f?0:1),d,m,h-1,k-1),w=this.bidirectional&&p>g;M(this,l,w?g:p,v,a,b,w?p:g)}}}}this.fastupdate||this.reg.add(a)}}return this};
function M(a,c,b,d){return(a=N(this,a,c))&&a.length?L(a,b,d):[]}function O(a,c,b,d){let e=[];if(a){d=Math.min(a.length,d);for(let g=0,f;g<d;g++)(f=a[g])&&f&&(e[g]=f);if(e.length){c.push(e);return}}return!b&&e}function N(a,c,b){let d;b&&(d=a.bidirectional&&c>b);a=b?(a=a.ctx.get(d?c:b))&&a.get(d?b:c):a.map.get(c);return a};I.prototype.remove=function(a,c){const b=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(b){if(this.fastupdate)for(let d=0,e;d<b.length;d++){if(e=b[d])if(2>e.length)e.pop();else{const g=e.indexOf(a);g===b.length-1?e.pop():e.splice(g,1)}}else P(this.map,a),this.depth&&P(this.ctx,a);c||this.reg.delete(a)}this.cache&&this.cache.remove(a);return this}; function M(a,c,b,d,e,g,f){let h=f?a.ctx:a.map,k;if(!c[b]||f&&!(k=c[b])[f])f?(c=k||(c[b]=x()),c[f]=1,(k=h.get(f))?h=k:h.set(f,h=new Map)):c[b]=1,(k=h.get(b))?h=k:h.set(b,h=[]),h=h[d]||(h[d]=[]),g&&h.includes(e)||(h.push(e),a.fastupdate&&((c=a.reg.get(e))?c.push(h):a.reg.set(e,[h])))}function L(a,c,b,d,e){return b&&1<a?c+(d||0)<=a?b+(e||0):(a-1)/(c+(d||0))*(b+(e||0))+1|0:0};function N(a,c,b){if(1===a.length)return a=a[0],a=b||a.length>c?c?a.slice(b,b+c):a.slice(b):a;let d=[];for(let e=0,g,f;e<a.length;e++)if((g=a[e])&&(f=g.length)){if(b){if(b>=f){b-=f;continue}b<f&&(g=c?g.slice(b,b+c):g.slice(b),f=g.length,b=0)}if(d.length)f>c&&(g=g.slice(0,c),f=g.length),d.push(g);else{if(f>=c)return f>c&&(g=g.slice(0,c)),g;d=[g]}c-=f;if(!c)break}return d.length?d=1<d.length?[].concat.apply([],d):d[0]:d};K.prototype.search=function(a,c,b){b||(c||"object"!==typeof a?"object"===typeof c&&(b=c,c=0):(b=a,a=""));var d=[],e=0;if(b){a=b.query||a;c=b.limit||c;e=b.offset||0;var g=b.context;var f=b.suggest;var h=!0;var k=b.resolution}else h=!0;var l=this.encoder.encode(a);b=l.length;c||!h||(c=100);if(1===b)return O.call(this,l[0],"",c,e);g=this.depth&&!1!==g;if(2===b&&g&&!f)return O.call(this,l[0],l[1],c,e);let t=h=0;if(1<b){const n=x(),m=[];for(let p=0,v;p<b;p++)if((v=l[p])&&!n[v]){if(f||P(this,v))m.push(v),
function P(a,c){let b=0;if(a.constructor===Array)for(let d=0,e,g;d<a.length;d++){if((e=a[d])&&e.length)if(g=e.indexOf(c),0<=g){1<e.length?(e.splice(g,1),b++):delete a[d];break}else b++}else for(let d of a){const e=d[0],g=P(d[1],c);g?b+=g:a.delete(e)}return b};function I(a,c){if(!this||this.constructor!==I)return new I(a);if(a){var b="string"===typeof a?a:a.preset;b&&(a=Object.assign({},G[b],a))}else a={};b=a.context||{};const d=a.encode||a.encoder||F;this.encoder=d.encode?d:"object"===typeof d?new C(d):{encode:d};let e;this.resolution=a.resolution||9;this.tokenize=e=a.tokenize||"strict";this.depth="strict"===e&&b.depth||0;this.bidirectional=!1!==b.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;e=!1;this.map=new Map;this.ctx=new Map; n[v]=1;else return d;const w=v.length;h=Math.max(h,w);t=t?Math.min(t,w):w}l=m;b=a.length}if(!b)return d;a=0;if(1===b)return O.call(this,l[0],"",c,e);if(2===b&&g&&!f)return O.call(this,l[0],l[1],c,e);if(1<b)if(g){var q=l[0];a=1}else 9<h&&3<h/t&&l.sort(y);k||0===k||(k=this.resolution);for(let n,m;a<b;a++){m=l[a];q?(n=P(this,m,q),n=Q(n,d,f,this.A),f&&!1===n&&d.length||(q=m)):(n=P(this,m,""),n=Q(n,d,f,k));if(n)return n;if(f&&a===b-1){g=d.length;if(!g){if(q){q="";a=-1;continue}return d}if(1===g)return N(d[0],
this.reg=c||(this.fastupdate?new Map:new Set);this.A=b.resolution||1;this.rtl=d.rtl||a.rtl||!1;this.cache=(e=a.cache||null)&&new E(e)}I.prototype.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};I.prototype.append=function(a,c){return this.add(a,c,!0)};I.prototype.contain=function(a){return this.reg.has(a)};I.prototype.update=function(a,c){const b=this,d=this.remove(a);return d&&d.then?d.then(()=>b.add(a,c)):this.add(a,c)}; c,e)}}a:{q=f;b=d.length;f=[];g=x();for(let n=0,m,p,v,w;n<k;n++)for(a=0;a<b;a++)if(v=d[a],n<v.length&&(m=v[n]))for(h=0;h<m.length;h++)p=m[h],(l=g[p])?g[p]++:(l=0,g[p]=1),w=f[l]||(f[l]=[]),w.push(p);if(k=f.length)if(q){if(1<f.length)b:for(k=[],d=x(),q=f.length,l=q-1;0<=l;l--)for(q=f[l],g=q.length,a=0;a<g;a++){if(b=q[a],!d[b])if(d[b]=1,e)e--;else if(k.push(b),k.length===c)break b}else k=(f=f[0]).length>c||e?f.slice(e,c+e):f;f=k}else{if(k<b){d=[];break a}f=f[k-1];if(c||e)if(f.length>c||e)f=f.slice(e,
function Q(a){let c=0;if(a.constructor===Array)for(let b=0,d;b<a.length;b++)(d=a[b])&&(c+=d.length);else for(const b of a){const d=b[0],e=Q(b[1]);e?c+=e:a.delete(d)}return c}I.prototype.cleanup=function(){if(!this.fastupdate)return this;Q(this.map);this.depth&&Q(this.ctx);return this}; c+e)}d=f}return d};function O(a,c,b,d){return(a=P(this,a,c))&&a.length?N(a,b,d):[]}function Q(a,c,b,d){let e=[];if(a){d=Math.min(a.length,d);for(let g=0,f;g<d;g++)(f=a[g])&&f&&(e[g]=f);if(e.length){c.push(e);return}}return!b&&e}function P(a,c,b){let d;b&&(d=a.bidirectional&&c>b);a=b?(a=a.ctx.get(d?c:b))&&a.get(d?b:c):a.map.get(c);return a};K.prototype.remove=function(a,c){const b=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(b){if(this.fastupdate)for(let d=0,e;d<b.length;d++){if(e=b[d])if(2>e.length)e.pop();else{const g=e.indexOf(a);g===b.length-1?e.pop():e.splice(g,1)}}else R(this.map,a),this.depth&&R(this.ctx,a);c||this.reg.delete(a)}this.cache&&this.cache.remove(a);return this};
I.prototype.searchCache=function(a,c,b){a=("object"===typeof a?""+a.query:a).toLowerCase();let d=this.cache.get(a);if(!d){d=this.search(a,c,b);if(d.then){const e=this;d.then(function(g){e.cache.set(a,g);return g})}this.cache.set(a,d)}return d};export default {Index:I,Charset:null,Encoder:C,Document:null,Worker:null,Resolver:null,IndexedDB:null,Language:{}}; function R(a,c){let b=0;if(a.constructor===Array)for(let d=0,e,g;d<a.length;d++){if((e=a[d])&&e.length)if(g=e.indexOf(c),0<=g){1<e.length?(e.splice(g,1),b++):delete a[d];break}else b++}else for(let d of a){const e=d[0],g=R(d[1],c);g?b+=g:a.delete(e)}return b};function K(a,c){if(!this||this.constructor!==K)return new K(a);if(a){var b="string"===typeof a?a:a.preset;b&&(a=Object.assign({},J[b],a))}else a={};b=a.context;const d=!0===b?{depth:1}:b||{},e=a.encode||a.encoder||I;this.encoder=e.encode?e:"object"===typeof e?new E(e):{encode:e};this.resolution=a.resolution||9;this.tokenize=b=a.tokenize||"strict";this.depth="strict"===b&&d.depth||0;this.bidirectional=!1!==d.bidirectional;this.fastupdate=!!a.fastupdate;this.score=a.score||null;b=!1;this.map=new Map;
export const Index=I;export const Charset=null;export const Encoder=C;export const Document=null;export const Worker=null;export const Resolver=null;export const IndexedDB=null;export const Language={}; this.ctx=new Map;this.reg=c||(this.fastupdate?new Map:new Set);this.A=d.resolution||3;this.rtl=e.rtl||a.rtl||!1;this.cache=(b=a.cache||null)&&new H(b)}r=K.prototype;r.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};r.append=function(a,c){return this.add(a,c,!0)};r.contain=function(a){return this.reg.has(a)};r.update=function(a,c){const b=this,d=this.remove(a);return d&&d.then?d.then(()=>b.add(a,c)):this.add(a,c)};
function S(a){let c=0;if(a.constructor===Array)for(let b=0,d;b<a.length;b++)(d=a[b])&&(c+=d.length);else for(const b of a){const d=b[0],e=S(b[1]);e?c+=e:a.delete(d)}return c}r.cleanup=function(){if(!this.fastupdate)return this;S(this.map);this.depth&&S(this.ctx);return this};r.searchCache=function(a,c,b){a=("object"===typeof a?""+a.query:a).toLowerCase();let d=this.cache.get(a);if(!d){d=this.search(a,c,b);if(d.then){const e=this;d.then(function(g){e.cache.set(a,g);return g})}this.cache.set(a,d)}return d};export default {Index:K,Charset:null,Encoder:E,Document:null,Worker:null,Resolver:null,IndexedDB:null,Language:{}};
export const Index=K;export const Charset=null;export const Encoder=E;export const Document=null;export const Worker=null;export const Resolver=null;export const IndexedDB=null;export const Language={};

132
dist/lang/de.min.js vendored
View File

@@ -1,72 +1,72 @@
(function(self){'use strict';var y;function z(a,b,c){const d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var f=new Map(c);for(var g of a)f.set(g[0],g[1]);return f}if(b===Set){g=new Set(c);for(f of a.values())g.add(f);return g}}}return a}return c}return"undefined"===e?b:a}function B(){return Object.create(null)}function aa(a,b){return b.length-a.length} (function(self){'use strict';var A;function B(a,c,b){const d=typeof b,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(b){if("function"===e&&d===e)return function(k){return a(b(k))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var g=new Map(b);for(var f of a)g.set(f[0],f[1]);return g}if(c===Set){f=new Set(b);for(g of a.values())f.add(g);return f}}}return a}return b}return"undefined"===e?c:a}function C(){return Object.create(null)}function aa(a,c){return c.length-a.length}
function G(a){return"string"===typeof a}function H(a){return"object"===typeof a}function J(a,b){if(G(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}function ba(a){let b=0;for(let c=0,d;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var ca=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb", function G(a){return"string"===typeof a}function H(a){return"object"===typeof a}function J(a,c){if(G(c))a=a[c];else for(let b=0;a&&b<c.length;b++)a=a[c[b]];return a}function ba(a){let c=0;for(let b=0,d;b<a.length;b++)(d=a[b])&&c<d.length&&(c=d.length);return c};var ca=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb",
"u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"], "u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"],
["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0", ["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0",
"i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215", "i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215",
"u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af", "u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af",
"\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"], "\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"],
["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const da=/[^\p{L}\p{N}]+/u,ea=/(\d{3})/g,fa=/(\D)(\d{3})/g,ha=/(\d{3})(\D)/g,ia="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])} ["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const da=/[^\p{L}\p{N}]+/u,ea=/(\d{3})/g,fa=/(\D)(\d{3})/g,ha=/(\d{3})(\D)/g,ia="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let c=0;c<arguments.length;c++)this.assign(arguments[c])}
K.prototype.assign=function(a){this.normalize=z(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(f){this.split=/\s+/}this.numeric=d}else{try{this.split=z(c,da,this.split)}catch(d){this.split= K.prototype.assign=function(a){this.normalize=B(a.normalize,!0,this.normalize);let c=a.include,b=c||a.exclude||a.split;if("object"===typeof b){let d=!c,e="";a.include||(e+="\\p{Z}");b.letter&&(e+="\\p{L}");b.number&&(e+="\\p{N}",d=!!c);b.symbol&&(e+="\\p{S}");b.punctuation&&(e+="\\p{P}");b.control&&(e+="\\p{C}");if(b=b.char)e+="object"===typeof b?b.join(""):b;try{this.split=new RegExp("["+(c?"^":"")+e+"]+","u")}catch(g){this.split=/\s+/}this.numeric=d}else{try{this.split=B(b,da,this.split)}catch(d){this.split=
/\s+/}this.numeric=z(this.numeric,!0)}this.prepare=z(a.prepare,null,this.prepare);this.finalize=z(a.finalize,null,this.finalize);ia||(this.mapper=new Map(ca));this.rtl=a.rtl||!1;this.dedupe=z(a.dedupe,!0,this.dedupe);this.filter=z((c=a.filter)&&new Set(c),null,this.filter);this.matcher=z((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=z((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=z((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=z(a.replacer,null,this.replacer);this.minlength= /\s+/}this.numeric=B(this.numeric,!0)}this.prepare=B(a.prepare,null,this.prepare);this.finalize=B(a.finalize,null,this.finalize);ia||(this.mapper=new Map(ca));this.rtl=a.rtl||!1;this.dedupe=B(a.dedupe,!0,this.dedupe);this.filter=B((b=a.filter)&&new Set(b),null,this.filter);this.matcher=B((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=B((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=B((b=a.stemmer)&&new Map(b),null,this.stemmer);this.replacer=B(a.replacer,null,this.replacer);this.minlength=
z(a.minlength,1,this.minlength);this.maxlength=z(a.maxlength,0,this.maxlength);if(this.cache=c=z(a.cache,!0,this.cache))this.Z=null,this.la="number"===typeof c?c:2E5,this.R=new Map,this.W=new Map,this.D=this.h=128;this.H="";this.da=null;this.$="";this.ea=null;if(this.matcher)for(const d of this.matcher.keys())this.H+=(this.H?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.$+=(this.$?"|":"")+d;return this}; B(a.minlength,1,this.minlength);this.maxlength=B(a.maxlength,0,this.maxlength);if(this.cache=b=B(a.cache,!0,this.cache))this.Z=null,this.la="number"===typeof b?b:2E5,this.R=new Map,this.W=new Map,this.D=this.h=128;this.G="";this.da=null;this.$="";this.ea=null;if(this.matcher)for(const d of this.matcher.keys())this.G+=(this.G?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.$+=(this.$?"|":"")+d;return this};
K.prototype.encode=function(a){if(this.cache&&a.length<=this.h)if(this.Z){if(this.R.has(a))return this.R.get(a)}else this.Z=setTimeout(ja,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ia?a.normalize("NFKD").replace(ia,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(fa,"$1 $2").replace(ha,"$1 $2").replace(ea,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer); K.prototype.encode=function(a){if(this.cache&&a.length<=this.h)if(this.Z){if(this.R.has(a))return this.R.get(a)}else this.Z=setTimeout(ja,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ia?a.normalize("NFKD").replace(ia,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(fa,"$1 $2").replace(ha,"$1 $2").replace(ea,"$1 "));const c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);
let c=[],d=this.split||""===this.split?a.split(this.split):a;for(let f=0,g,h;f<d.length;f++){if(!(g=h=d[f]))continue;if(g.length<this.minlength)continue;if(b){c.push(g);continue}if(this.filter&&this.filter.has(g))continue;if(this.cache&&g.length<=this.D)if(this.Z){var e=this.W.get(g);if(e||""===e){e&&c.push(e);continue}}else this.Z=setTimeout(ja,50,this);let k;this.stemmer&&2<g.length&&(this.ea||(this.ea=new RegExp("(?!^)("+this.$+")$")),g=g.replace(this.ea,l=>this.stemmer.get(l)),k=1);g&&k&&(g.length< let b=[],d=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,k;g<d.length;g++){if(!(f=k=d[g]))continue;if(f.length<this.minlength)continue;if(c){b.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.D)if(this.Z){var e=this.W.get(f);if(e||""===e){e&&b.push(e);continue}}else this.Z=setTimeout(ja,50,this);let h;this.stemmer&&2<f.length&&(this.ea||(this.ea=new RegExp("(?!^)("+this.$+")$")),f=f.replace(this.ea,l=>this.stemmer.get(l)),h=1);f&&h&&(f.length<
this.minlength||this.filter&&this.filter.has(g))&&(g="");if(g&&(this.mapper||this.dedupe&&1<g.length)){e="";for(let l=0,m="",r,n;l<g.length;l++)r=g.charAt(l),r===m&&this.dedupe||((n=this.mapper&&this.mapper.get(r))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=r);g=e}this.matcher&&1<g.length&&(this.da||(this.da=new RegExp("("+this.H+")","g")),g=g.replace(this.da,l=>this.matcher.get(l)));if(g&&this.replacer)for(e=0;g&&e<this.replacer.length;e+=2)g=g.replace(this.replacer[e],this.replacer[e+1]);this.cache&& this.minlength||this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){e="";for(let l=0,m="",u,n;l<f.length;l++)u=f.charAt(l),u===m&&this.dedupe||((n=this.mapper&&this.mapper.get(u))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=u);f=e}this.matcher&&1<f.length&&(this.da||(this.da=new RegExp("("+this.G+")","g")),f=f.replace(this.da,l=>this.matcher.get(l)));if(f&&this.replacer)for(e=0;f&&e<this.replacer.length;e+=2)f=f.replace(this.replacer[e],this.replacer[e+1]);this.cache&&
h.length<=this.D&&(this.W.set(h,g),this.W.size>this.la&&(this.W.clear(),this.D=this.D/1.1|0));g&&c.push(g)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.h&&(this.R.set(a,c),this.R.size>this.la&&(this.R.clear(),this.h=this.h/1.1|0));return c};function ja(a){a.Z=null;a.R.clear();a.W.clear()};async function ka(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(b=d.config)&&(d=b);(b=a.factory)?(Function("return "+b)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);postMessage({id:a.id});break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let la=0; k.length<=this.D&&(this.W.set(k,f),this.W.size>this.la&&(this.W.clear(),this.D=this.D/1.1|0));f&&b.push(f)}this.finalize&&(b=this.finalize(b)||b);this.cache&&a.length<=this.h&&(this.R.set(a,b),this.R.size>this.la&&(this.R.clear(),this.h=this.h/1.1|0));return b};function ja(a){a.Z=null;a.R.clear();a.W.clear()};async function ka(a){a=a.data;var c=self._index;const b=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(c=a.factory)?(Function("return "+c)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);postMessage({id:a.id});break;default:a=a.id,c=c[d].apply(c,b),postMessage("search"===d?{id:a,msg:c}:{id:a})}};let la=0;
function M(a={}){function b(g){function h(k){k=k.data||k;const l=k.id,m=l&&e.h[l];m&&(m(k.msg),delete e.h[l])}this.F=g;this.h=B();if(this.F){d?this.F.on("message",h):this.F.onmessage=h;if(a.config)return new Promise(function(k){e.h[++la]=function(){k(e)};e.F.postMessage({id:la,task:"init",factory:c,options:a})});this.F.postMessage({task:"init",factory:c,options:a});return this}}if(!this||this.constructor!==M)return new M(a);let c="undefined"!==typeof self?self._factory:"undefined"!==typeof window?window._factory: function M(a={}){function c(f){function k(h){h=h.data||h;const l=h.id,m=l&&e.h[l];m&&(m(h.msg),delete e.h[l])}this.F=f;this.h=C();if(this.F){d?this.F.on("message",k):this.F.onmessage=k;if(a.config)return new Promise(function(h){e.h[++la]=function(){h(e)};e.F.postMessage({id:la,task:"init",factory:b,options:a})});this.F.postMessage({task:"init",factory:b,options:a});return this}}if(!this||this.constructor!==M)return new M(a);let b="undefined"!==typeof self?self._factory:"undefined"!==typeof window?window._factory:
null;c&&(c=c.toString());const d="undefined"===typeof window,e=this,f=ma(c,d,a.F);return f.then?f.then(function(g){return b.call(e,g)}):b.call(this,f)}N("add");N("append");N("search");N("update");N("remove"); null;b&&(b=b.toString());const d="undefined"===typeof window,e=this,g=ma(b,d,a.F);return g.then?g.then(function(f){return c.call(e,f)}):c.call(this,g)}N("add");N("append");N("search");N("update");N("remove");
function N(a){M.prototype[a]=M.prototype[a+"Async"]=async function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;"function"===typeof d&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){b.h[++la]=f;b.F.postMessage({task:a,id:la,args:c})});return e?(d.then(e),this):d}} function N(a){M.prototype[a]=M.prototype[a+"Async"]=async function(){const c=this,b=[].slice.call(arguments);var d=b[b.length-1];let e;"function"===typeof d&&(e=d,b.splice(b.length-1,1));d=new Promise(function(g){c.h[++la]=g;c.F.postMessage({task:a,id:la,args:b})});return e?(d.then(e),this):d}}
function ma(a,b,c){return b?"undefined"!==typeof module?(0,eval)('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")'):(0,eval)('import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); })'):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+ka.toString()],{type:"text/javascript"}))):new window.Worker(G(c)?c:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js", function ma(a,c,b){return c?"undefined"!==typeof module?(0,eval)('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")'):(0,eval)('import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); })'):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+ka.toString()],{type:"text/javascript"}))):new window.Worker(G(b)?b:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js",
"module/worker/worker.js"),{type:"module"})};function na(a){O.call(a,"add");O.call(a,"append");O.call(a,"search");O.call(a,"update");O.call(a,"remove")}function O(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let d;"function"===typeof c&&(d=c,delete b[b.length-1]);b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function oa(a,b){b||(b=new Map);for(let c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b}function pa(a,b){b||(b=new Map);for(let c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],oa(d[1],e));return b}function qa(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b};function ra(a,b,c,d){let e=[];for(let f=0,g;f<a.index.length;f++)if(g=a.index[f],b>=g.length)b-=g.length;else{b=g[d?"splice":"slice"](b,c);const h=b.length;if(h&&(e=e.length?e.concat(b):b,c-=h,d&&(a.length-=h),!c))break;b=0}return e} "module/worker/worker.js"),{type:"module"})};function na(a){O.call(a,"add");O.call(a,"append");O.call(a,"search");O.call(a,"update");O.call(a,"remove")}function O(a){this[a+"Async"]=function(){var c=arguments;const b=c[c.length-1];let d;"function"===typeof b&&(d=b,delete c[c.length-1]);c=this[a].apply(this,c);d&&(c.then?c.then(d):d(c));return c}};function oa(a,c){c||(c=new Map);for(let b=0,d;b<a.length;b++)d=a[b],c.set(d[0],d[1]);return c}function pa(a,c){c||(c=new Map);for(let b=0,d,e;b<a.length;b++)d=a[b],e=c.get(d[0]),c.set(d[0],oa(d[1],e));return c}function qa(a,c){c||(c=new Set);for(let b=0;b<a.length;b++)c.add(a[b]);return c};function ra(a,c,b,d){let e=[];for(let g=0,f;g<a.index.length;g++)if(f=a.index[g],c>=f.length)c-=f.length;else{c=f[d?"splice":"slice"](c,b);const k=c.length;if(k&&(e=e.length?e.concat(c):c,b-=k,d&&(a.length-=k),!b))break;c=0}return e}
function P(a){if(!this)return new P(a);this.index=a?[a]:[];this.length=a?a.length:0;const b=this;return new Proxy([],{get(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){let f=0;for(let g=0,h,k;g<b.index.length;g++){h=b.index[g];k=h.indexOf(e);if(0<=k)return f+k;f+=h.length}return-1};if("includes"===d)return function(e){for(let f= function P(a){if(!this)return new P(a);this.index=a?[a]:[];this.length=a?a.length:0;const c=this;return new Proxy([],{get(b,d){if("length"===d)return c.length;if("push"===d)return function(e){c.index[c.index.length-1].push(e);c.length++};if("pop"===d)return function(){if(c.length)return c.length--,c.index[c.index.length-1].pop()};if("indexOf"===d)return function(e){let g=0;for(let f=0,k,h;f<c.index.length;f++){k=c.index[f];h=k.indexOf(e);if(0<=h)return g+h;g+=k.length}return-1};if("includes"===d)return function(e){for(let g=
0;f<b.index.length;f++)if(b.index[f].includes(e))return!0;return!1};if("slice"===d)return function(e,f){return ra(b,e||0,f||b.length,!1)};if("splice"===d)return function(e,f){return ra(b,e||0,f||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/2**31|0])&&c[d]},set(c,d,e){c=d/2**31|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}P.prototype.clear=function(){this.index.length=0};P.prototype.push=function(){}; 0;g<c.index.length;g++)if(c.index[g].includes(e))return!0;return!1};if("slice"===d)return function(e,g){return ra(c,e||0,g||c.length,!1)};if("splice"===d)return function(e,g){return ra(c,e||0,g||c.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(b=c.index[d/2**31|0])&&b[d]},set(b,d,e){b=d/2**31|0;(c.index[b]||(c.index[b]=[]))[d]=e;c.length++;return!0}})}P.prototype.clear=function(){this.index.length=0};P.prototype.push=function(){};
function Q(a=8){if(!this)return new Q(a);this.index=B();this.H=[];this.size=0;32<a?(this.h=sa,this.D=BigInt(a)):(this.h=ta,this.D=a)}Q.prototype.get=function(a){const b=this.index[this.h(a)];return b&&b.get(a)};Q.prototype.set=function(a,b){var c=this.h(a);let d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.H.push(d))};function R(a=8){if(!this)return new R(a);this.index=B();this.h=[];32<a?(this.H=sa,this.D=BigInt(a)):(this.H=ta,this.D=a)} function Q(a=8){if(!this)return new Q(a);this.index=C();this.G=[];this.size=0;32<a?(this.h=sa,this.D=BigInt(a)):(this.h=ta,this.D=a)}Q.prototype.get=function(a){const c=this.index[this.h(a)];return c&&c.get(a)};Q.prototype.set=function(a,c){var b=this.h(a);let d=this.index[b];d?(b=d.size,d.set(a,c),(b-=d.size)&&this.size++):(this.index[b]=d=new Map([[a,c]]),this.G.push(d))};function R(a=8){if(!this)return new R(a);this.index=C();this.h=[];32<a?(this.G=sa,this.D=BigInt(a)):(this.G=ta,this.D=a)}
R.prototype.add=function(a){var b=this.H(a);let c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};y=Q.prototype;y.has=R.prototype.has=function(a){const b=this.index[this.H(a)];return b&&b.has(a)};y.delete=R.prototype.delete=function(a){const b=this.index[this.H(a)];b&&b.delete(a)&&this.size--};y.clear=R.prototype.clear=function(){this.index=B();this.h=[];this.size=0};y.values=R.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].values())yield b}; R.prototype.add=function(a){var c=this.G(a);let b=this.index[c];b?(c=b.size,b.add(a),(c-=b.size)&&this.size++):(this.index[c]=b=new Set([a]),this.h.push(b))};A=Q.prototype;A.has=R.prototype.has=function(a){const c=this.index[this.G(a)];return c&&c.has(a)};A.delete=R.prototype.delete=function(a){const c=this.index[this.G(a)];c&&c.delete(a)&&this.size--};A.clear=R.prototype.clear=function(){this.index=C();this.h=[];this.size=0};A.values=R.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].values())yield c};
y.keys=R.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].keys())yield b};y.entries=R.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].entries())yield b};function ta(a){let b=2**this.D-1;if("number"==typeof a)return a&b;let c=0,d=this.D+1;for(let e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.D?c+2**31:c} A.keys=R.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].keys())yield c};A.entries=R.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].entries())yield c};function ta(a){let c=2**this.D-1;if("number"==typeof a)return a&c;let b=0,d=this.D+1;for(let e=0;e<a.length;e++)b=(b*d^a.charCodeAt(e))&c;return 32===this.D?b+2**31:b}
function sa(a){let b=BigInt(2)**this.D-BigInt(1);var c=typeof a;if("bigint"===c)return a&b;if("number"===c)return BigInt(a)&b;c=BigInt(0);let d=this.D+BigInt(1);for(let e=0;e<a.length;e++)c=(c*d^BigInt(a.charCodeAt(e)))&b;return c};S.prototype.add=function(a,b,c){H(a)&&(b=a,a=J(b,this.key));if(b&&(a||0===a)){if(!c&&this.B.has(a))return this.update(a,b);for(let h=0,k;h<this.A.length;h++){k=this.N[h];var d=this.index.get(this.A[h]);if("function"===typeof k){var e=k(b);e&&d.add(a,e,!1,!0)}else if(e=k.V,!e||e(b))k.constructor===String?k=[""+k]:G(k)&&(k=[k]),ua(b,k,this.X,0,d,a,k[0],c)}if(this.tag)for(d=0;d<this.P.length;d++){var f=this.P[d],g=this.ba[d];e=this.tag.get(g);let h=B();if("function"===typeof f){if(f=f(b),!f)continue}else{const k= function sa(a){let c=BigInt(2)**this.D-BigInt(1);var b=typeof a;if("bigint"===b)return a&c;if("number"===b)return BigInt(a)&c;b=BigInt(0);let d=this.D+BigInt(1);for(let e=0;e<a.length;e++)b=(b*d^BigInt(a.charCodeAt(e)))&c;return b};S.prototype.add=function(a,c,b){H(a)&&(c=a,a=J(c,this.key));if(c&&(a||0===a)){if(!b&&this.B.has(a))return this.update(a,c);for(let k=0,h;k<this.A.length;k++){h=this.M[k];var d=this.index.get(this.A[k]);if("function"===typeof h){var e=h(c);e&&d.add(a,e,!1,!0)}else if(e=h.V,!e||e(c))h.constructor===String?h=[""+h]:G(h)&&(h=[h]),ua(c,h,this.X,0,d,a,h[0],b)}if(this.tag)for(d=0;d<this.P.length;d++){var g=this.P[d],f=this.ba[d];e=this.tag.get(f);let k=C();if("function"===typeof g){if(g=g(c),!g)continue}else{const h=
f.V;if(k&&!k(b))continue;f.constructor===String&&(f=""+f);f=J(b,f)}if(e&&f){G(f)&&(f=[f]);for(let k=0,l,m;k<f.length;k++)if(l=f[k],!h[l]&&(h[l]=1,(g=e.get(l))?m=g:e.set(l,m=[]),!c||!m.includes(a))){if(m.length===2**31-1){g=new P(m);if(this.C)for(let r of this.B.values())r.includes(m)&&(r[r.indexOf(m)]=g);e.set(l,m=g)}m.push(a);this.C&&((g=this.B.get(a))?g.push(m):this.B.set(a,[m]))}}else e||console.warn("Tag '"+g+"' was not found")}if(this.store&&(!c||!this.store.has(a))){let h;if(this.M){h=B();for(let k= g.V;if(h&&!h(c))continue;g.constructor===String&&(g=""+g);g=J(c,g)}if(e&&g){G(g)&&(g=[g]);for(let h=0,l,m;h<g.length;h++)if(l=g[h],!k[l]&&(k[l]=1,(f=e.get(l))?m=f:e.set(l,m=[]),!b||!m.includes(a))){if(m.length===2**31-1){f=new P(m);if(this.C)for(let u of this.B.values())u.includes(m)&&(u[u.indexOf(m)]=f);e.set(l,m=f)}m.push(a);this.C&&((f=this.B.get(a))?f.push(m):this.B.set(a,[m]))}}else e||console.warn("Tag '"+f+"' was not found")}if(this.store&&(!b||!this.store.has(a))){let k;if(this.L){k=C();for(let h=
0,l;k<this.M.length;k++){l=this.M[k];if((c=l.V)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.oa]}else if(G(l)||l.constructor===String){h[l]=b[l];continue}va(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function va(a,b,c,d,e,f){a=a[e];if(d===c.length-1)b[e]=f||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)va(a,b,c,d,e);else b=b[e]||(b[e]=B()),e=c[++d],va(a,b,c,d,e)} 0,l;h<this.L.length;h++){l=this.L[h];if((b=l.V)&&!b(c))continue;let m;if("function"===typeof l){m=l(c);if(!m)continue;l=[l.oa]}else if(G(l)||l.constructor===String){k[l]=c[l];continue}va(c,k,l,0,l[0],m)}}this.store.set(a,k||c)}}return this};function va(a,c,b,d,e,g){a=a[e];if(d===b.length-1)c[e]=g||a;else if(a)if(a.constructor===Array)for(c=c[e]=Array(a.length),e=0;e<a.length;e++)va(a,c,b,d,e);else c=c[e]||(c[e]=C()),e=b[++d],va(a,c,b,d,e)}
function ua(a,b,c,d,e,f,g,h){if(a=a[g])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)ua(a,b,c,d,e,f,g,h);else g=b[++d],ua(a,b,c,d,e,f,g,h);else e.db&&e.remove(f)};function wa(a,b,c,d,e,f,g){const h=a.length;let k=[],l;var m;l=B();for(let r=0,n,p,t,q;r<b;r++)for(let u=0;u<h;u++)if(t=a[u],r<t.length&&(n=t[r]))for(let w=0;w<n.length;w++)p=n[w],(m=l[p])?l[p]++:(m=0,l[p]=1),q=k[m]||(k[m]=[]),g||(m=r+(u?0:f||0),q=q[m]||(q[m]=[])),q.push(p);if(a=k.length)if(e)k=1<k.length?xa(k,d,c,g,0):(k=k[0]).length>c||d?k.slice(d,c+d):k;else{if(a<h)return[];k=k[a-1];if(c||d)if(g){if(k.length>c||d)k=k.slice(d,c+d)}else{e=[];for(let r=0,n;r<k.length;r++)if(n=k[r],n.length>d)d-=n.length; function ua(a,c,b,d,e,g,f,k){if(a=a[f])if(d===c.length-1){if(a.constructor===Array){if(b[d]){for(c=0;c<a.length;c++)e.add(g,a[c],!0,!0);return}a=a.join(" ")}e.add(g,a,k,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)ua(a,c,b,d,e,g,f,k);else f=c[++d],ua(a,c,b,d,e,g,f,k);else e.db&&e.remove(g)};function wa(a,c,b,d,e,g,f){const k=a.length;let h=[],l;var m;l=C();for(let u=0,n,p,t,q;u<c;u++)for(let v=0;v<k;v++)if(t=a[v],u<t.length&&(n=t[u]))for(let w=0;w<n.length;w++)p=n[w],(m=l[p])?l[p]++:(m=0,l[p]=1),q=h[m]||(h[m]=[]),f||(m=u+(v?0:g||0),q=q[m]||(q[m]=[])),q.push(p);if(a=h.length)if(e)h=1<h.length?xa(h,d,b,f,0):(h=h[0]).length>b||d?h.slice(d,b+d):h;else{if(a<k)return[];h=h[a-1];if(b||d)if(f){if(h.length>b||d)h=h.slice(d,b+d)}else{e=[];for(let u=0,n;u<h.length;u++)if(n=h[u],n.length>d)d-=n.length;
else{if(n.length>c||d)n=n.slice(d,c+d),c-=n.length,d&&(d-=n.length);e.push(n);if(!c)break}k=1<e.length?[].concat.apply([],e):e[0]}}return k} else{if(n.length>b||d)n=n.slice(d,b+d),b-=n.length,d&&(d-=n.length);e.push(n);if(!b)break}h=1<e.length?[].concat.apply([],e):e[0]}}return h}
function xa(a,b,c,d,e){const f=[],g=B();let h;var k=a.length;let l,m=0;if(d)for(e=k-1;0<=e;e--)for(d=a[e],l=d.length,k=0;k<l;k++){if(h=d[k],!g[h])if(g[h]=1,b)b--;else if(f.push(h),f.length===c)return f}else{let r=ba(a);for(let n=0;n<r;n++)for(let p=k-1;0<=p;p--)if(l=(d=a[p][n])&&d.length)for(let t=0;t<l;t++)if(h=d[t],!g[h])if(g[h]=1,b)b--;else{let q=n+(p<k-1?e||0:0);(f[q]||(f[q]=[])).push(h);if(++m===c)return f}}return f} function xa(a,c,b,d,e){const g=[],f=C();let k;var h=a.length;let l,m=0;if(d)for(e=h-1;0<=e;e--)for(d=a[e],l=d.length,h=0;h<l;h++){if(k=d[h],!f[k])if(f[k]=1,c)c--;else if(g.push(k),g.length===b)return g}else{let u=ba(a);for(let n=0;n<u;n++)for(let p=h-1;0<=p;p--)if(l=(d=a[p][n])&&d.length)for(let t=0;t<l;t++)if(k=d[t],!f[k])if(f[k]=1,c)c--;else{let q=n+(p<h-1?e||0:0);(g[q]||(g[q]=[])).push(k);if(++m===b)return g}}return g}
function ya(a,b){const c=B(),d=[];for(let e=0,f;e<b.length;e++){f=b[e];for(let g=0;g<f.length;g++)c[f[g]]=1}for(let e=0,f;e<a.length;e++)f=a[e],1===c[f]&&(d.push(f),c[f]=2);return d};S.prototype.search=function(a,b,c,d){c||(!b&&H(a)?(c=a,a=""):H(b)&&(c=b,b=0));let e=[],f=[],g;let h;let k;let l,m=0,r;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;g=c.Da;h=c.Ca;k=g||c.A||c.index;var n=this.tag&&c.tag;var p=this.store&&c.I;var t=c.ka;r=c.pa;b=c.J||b;l=c.offset||0;b||(b=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var q=[];for(let x=0,v;x<n.length;x++){v=n[x];if(G(v))throw Error("A tag option can't be a string, instead it needs a { field: tag } format.");if(v.A&& function ya(a,c){const b=C(),d=[];for(let e=0,g;e<c.length;e++){g=c[e];for(let f=0;f<g.length;f++)b[g[f]]=1}for(let e=0,g;e<a.length;e++)g=a[e],1===b[g]&&(d.push(g),b[g]=2);return d};S.prototype.search=function(a,c,b,d){b||(!c&&H(a)?(b=a,a=""):H(c)&&(b=c,c=0));let e=[],g=[],f;let k;let h;let l,m=0,u;if(b){b.constructor===Array&&(b={index:b});a=b.query||a;f=b.Da;k=b.Ca;h=f||b.A||b.index;var n=this.tag&&b.tag;var p=this.store&&b.H;var t=b.ka;u=b.pa;c=b.I||c;l=b.offset||0;c||(c=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var q=[];for(let x=0,r;x<n.length;x++){r=n[x];if(G(r))throw Error("A tag option can't be a string, instead it needs a { field: tag } format.");if(r.A&&
v.tag){var u=v.tag;if(u.constructor===Array)for(var w=0;w<u.length;w++)q.push(v.A,u[w]);else q.push(v.A,u)}else{u=Object.keys(v);for(let A=0,I,C;A<u.length;A++)if(I=u[A],C=v[I],C.constructor===Array)for(w=0;w<C.length;w++)q.push(I,C[w]);else q.push(I,C)}}if(!q.length)throw Error("Your tag definition within the search options is probably wrong. No valid tags found.");n=q;if(!a){t=[];if(q.length)for(n=0;n<q.length;n+=2){if(this.db){d=this.index.get(q[n]);if(!d){console.warn("Tag '"+q[n]+":"+q[n+1]+ r.tag){var v=r.tag;if(v.constructor===Array)for(var w=0;w<v.length;w++)q.push(r.A,v[w]);else q.push(r.A,v)}else{v=Object.keys(r);for(let y=0,I,D;y<v.length;y++)if(I=v[y],D=r[I],D.constructor===Array)for(w=0;w<D.length;w++)q.push(I,D[w]);else q.push(I,D)}}if(!q.length)throw Error("Your tag definition within the search options is probably wrong. No valid tags found.");n=q;if(!a){t=[];if(q.length)for(n=0;n<q.length;n+=2){if(this.db){d=this.index.get(q[n]);if(!d){console.warn("Tag '"+q[n]+":"+q[n+1]+
"' will be skipped because there is no field '"+q[n]+"'.");continue}t.push(d=d.db.tag(q[n+1],b,l,p))}else d=za.call(this,q[n],q[n+1],b,l,p);e.push({field:q[n],tag:q[n+1],result:d})}return t.length?Promise.all(t).then(function(x){for(let v=0;v<x.length;v++)e[v].result=x[v];return e}):e}}G(k)&&(k=[k])}k||(k=this.A);q=!d&&(this.F||this.db)&&[];let D;for(let x=0,v,A,I;x<k.length;x++){A=k[x];if(this.db&&this.tag&&!this.N[x])continue;let C;G(A)||(C=A,A=C.A,a=C.query||a,b=C.J||b,l=C.offset||l,t=C.ka||t, "' will be skipped because there is no field '"+q[n]+"'.");continue}t.push(d=d.db.tag(q[n+1],c,l,p))}else d=za.call(this,q[n],q[n+1],c,l,p);e.push({field:q[n],tag:q[n+1],result:d})}return t.length?Promise.all(t).then(function(x){for(let r=0;r<x.length;r++)e[r].result=x[r];return e}):e}}G(h)&&(h=[h])}h||(h=this.A);q=!d&&(this.F||this.db)&&[];let z;for(let x=0,r,y,I;x<h.length;x++){y=h[x];if(this.db&&this.tag&&!this.M[x])continue;let D;G(y)||(D=y,y=D.A,a=D.query||a,c=D.I||c,l=D.offset||l,t=D.ka||t,
p=this.store&&(C.I||p));if(d)v=d[x];else if(u=C||c,w=this.index.get(A),n&&(this.db&&(u.tag=n,D=w.db.Ea,u.A=k),D||(u.I=!1)),q){q[x]=w.search(a,b,u);u&&p&&(u.I=p);continue}else v=w.search(a,b,u),u&&p&&(u.I=p);I=v&&v.length;if(n&&I){u=[];w=0;if(this.db&&d){if(!D)for(let E=k.length;E<d.length;E++){let F=d[E];if(F&&F.length)w++,u.push(F);else if(!t)return e}}else for(let E=0,F,Za;E<n.length;E+=2){F=this.tag.get(n[E]);if(!F)if(console.warn("Tag '"+n[E]+":"+n[E+1]+"' will be skipped because there is no field '"+ p=this.store&&(D.H||p));if(d)r=d[x];else if(v=D||b,w=this.index.get(y),n&&(this.db&&(v.tag=n,z=w.db.Fa,v.A=h),z||(v.H=!1)),q){q[x]=w.search(a,c,v);v&&p&&(v.H=p);continue}else r=w.search(a,c,v),v&&p&&(v.H=p);I=r&&r.length;if(n&&I){v=[];w=0;if(this.db&&d){if(!z)for(let E=h.length;E<d.length;E++){let F=d[E];if(F&&F.length)w++,v.push(F);else if(!t)return e}}else for(let E=0,F,Za;E<n.length;E+=2){F=this.tag.get(n[E]);if(!F)if(console.warn("Tag '"+n[E]+":"+n[E+1]+"' will be skipped because there is no field '"+
n[E]+"'."),t)continue;else return e;if(Za=(F=F&&F.get(n[E+1]))&&F.length)w++,u.push(F);else if(!t)return e}if(w){v=ya(v,u);I=v.length;if(!I&&!t)return e;w--}}if(I)f[m]=A,e.push(v),m++;else if(1===k.length)return e}if(q){if(this.db&&n&&n.length&&!D)for(p=0;p<n.length;p+=2){d=this.index.get(n[p]);if(!d)if(console.warn("Tag '"+n[p]+":"+n[p+1]+"' was not found because there is no field '"+n[p]+"'."),t)continue;else return e;q.push(d.db.tag(n[p+1],b,l,!1))}const x=this;return Promise.all(q).then(function(v){return v.length? n[E]+"'."),t)continue;else return e;if(Za=(F=F&&F.get(n[E+1]))&&F.length)w++,v.push(F);else if(!t)return e}if(w){r=ya(r,v);I=r.length;if(!I&&!t)return e;w--}}if(I)g[m]=y,e.push(r),m++;else if(1===h.length)return e}if(q){if(this.db&&n&&n.length&&!z)for(p=0;p<n.length;p+=2){d=this.index.get(n[p]);if(!d)if(console.warn("Tag '"+n[p]+":"+n[p+1]+"' was not found because there is no field '"+n[p]+"'."),t)continue;else return e;q.push(d.db.tag(n[p+1],c,l,!1))}const x=this;return Promise.all(q).then(function(r){return r.length?
x.search(a,b,c,v):v})}if(!m)return e;if(g&&(!p||!this.store))return e[0];q=[];for(let x=0,v;x<f.length;x++){v=e[x];p&&v.length&&!v[0].ha&&(this.db?q.push(v=this.index.get(this.A[0]).db.I(v)):v.length&&(v=Aa.call(this,v)));if(g)return v;e[x]={field:f[x],result:v}}if(p&&this.db&&q.length){const x=this;return Promise.all(q).then(function(v){for(let A=0;A<v.length;A++)e[A].result=v[A];return h?Ba(e,b):r?Ca(e,a,x.index,x.A,x.N,r):e})}return h?Ba(e,b):r?Ca(e,a,this.index,this.A,this.N,r):e}; x.search(a,c,b,r):r})}if(!m)return e;if(f&&(!p||!this.store))return e[0];q=[];for(let x=0,r;x<g.length;x++){r=e[x];p&&r.length&&!r[0].ha&&(this.db?q.push(r=this.index.get(this.A[0]).db.H(r)):r.length&&(r=Aa.call(this,r)));if(f)return r;e[x]={field:g[x],result:r}}if(p&&this.db&&q.length){const x=this;return Promise.all(q).then(function(r){for(let y=0;y<r.length;y++)e[y].result=r[y];return k?Ba(e,c):u?Ca(e,a,x.index,x.A,x.M,u):e})}return k?Ba(e,c):u?Ca(e,a,this.index,this.A,this.M,u):e};
function Ca(a,b,c,d,e,f){let g,h,k;for(let m=0,r,n,p,t,q;m<a.length;m++){r=a[m].result;n=a[m].A;t=c.get(n);p=t.U;k=t.ca;q=e[d.indexOf(n)];p!==g&&(g=p,h=g.encode(b));for(let u=0;u<r.length;u++){let w="";var l=J(r[u].ha,q);let D=g.encode(l);l=l.split(g.split);for(let x=0,v,A;x<D.length;x++){v=D[x];A=l[x];let I;for(let C=0,E;C<h.length;C++)if(E=h[C],"strict"===k){if(v===E){w+=(w?" ":"")+f.replace("$1",A);I=!0;break}}else{const F=v.indexOf(E);if(-1<F){w+=(w?" ":"")+A.substring(0,F)+f.replace("$1",A.substring(F, function Ca(a,c,b,d,e,g){let f,k,h;for(let m=0,u,n,p,t,q;m<a.length;m++){u=a[m].result;n=a[m].A;t=b.get(n);p=t.U;h=t.ca;q=e[d.indexOf(n)];p!==f&&(f=p,k=f.encode(c));for(let v=0;v<u.length;v++){let w="";var l=J(u[v].ha,q);let z=f.encode(l);l=l.split(f.split);for(let x=0,r,y;x<z.length;x++){r=z[x];y=l[x];let I;for(let D=0,E;D<k.length;D++)if(E=k[D],"strict"===h){if(r===E){w+=(w?" ":"")+g.replace("$1",y);I=!0;break}}else{const F=r.indexOf(E);if(-1<F){w+=(w?" ":"")+y.substring(0,F)+g.replace("$1",y.substring(F,
E.length))+A.substring(F+E.length);I=!0;break}}I||(w+=(w?" ":"")+l[x])}r[u].pa=w}}return a}function Ba(a,b){const c=[],d=B();for(let e=0,f,g;e<a.length;e++){f=a[e];g=f.result;for(let h=0,k,l,m;h<g.length;h++)if(l=g[h],k=l.id,m=d[k])m.push(f.A);else{if(c.length===b)return c;l.A=d[k]=[f.A];c.push(l)}}return c} E.length))+y.substring(F+E.length);I=!0;break}}I||(w+=(w?" ":"")+l[x])}u[v].pa=w}}return a}function Ba(a,c){const b=[],d=C();for(let e=0,g,f;e<a.length;e++){g=a[e];f=g.result;for(let k=0,h,l,m;k<f.length;k++)if(l=f[k],h=l.id,m=d[h])m.push(g.A);else{if(b.length===c)return b;l.A=d[h]=[g.A];b.push(l)}}return b}
function za(a,b,c,d,e){let f=this.tag.get(a);if(!f)return console.warn("Tag '"+a+"' was not found"),[];if((a=(f=f&&f.get(b))&&f.length-d)&&0<a){if(a>c||d)f=f.slice(d,d+c);e&&(f=Aa.call(this,f));return f}}function Aa(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function S(a){if(!this||this.constructor!==S)return new S(a);const b=a.document||a.ha||a;let c,d;this.N=[];this.A=[];this.X=[];this.key=(c=b.key||b.id)&&Da(c,this.X)||"id";(d=a.ia||0)&&(this.ia=d);this.B=(this.C=!!a.C)?d?new Q(d):new Map:d?new R(d):new Set;this.M=(c=b.store||null)&&!0!==c&&[];this.store=c&&(d?new Q(d):new Map);this.cache=(c=a.cache||null)&&new T(c);a.cache=!1;this.F=a.F;this.index=Ea.call(this,a,b);this.tag=null;if(c=b.tag)if("string"===typeof c&&(c=[c]),c.length){this.tag=new Map; function za(a,c,b,d,e){let g=this.tag.get(a);if(!g)return console.warn("Tag '"+a+"' was not found"),[];if((a=(g=g&&g.get(c))&&g.length-d)&&0<a){if(a>b||d)g=g.slice(d,d+b);e&&(g=Aa.call(this,g));return g}}function Aa(a){const c=Array(a.length);for(let b=0,d;b<a.length;b++)d=a[b],c[b]={id:d,doc:this.store.get(d)};return c};function S(a){if(!this||this.constructor!==S)return new S(a);const c=a.document||a.ha||a;let b,d;this.M=[];this.A=[];this.X=[];this.key=(b=c.key||c.id)&&Da(b,this.X)||"id";(d=a.ia||0)&&(this.ia=d);this.B=(this.C=!!a.C)?d?new Q(d):new Map:d?new R(d):new Set;this.L=(b=c.store||null)&&b&&!0!==b&&[];this.store=b&&(d?new Q(d):new Map);this.cache=(b=a.cache||null)&&new T(b);a.cache=!1;this.F=a.F;this.index=Ea.call(this,a,c);this.tag=null;if(b=c.tag)if("string"===typeof b&&(b=[b]),b.length){this.tag=new Map;
this.P=[];this.ba=[];for(let e=0,f,g;e<c.length;e++){f=c[e];g=f.A||f;if(!g)throw Error("The tag field from the document descriptor is undefined.");f.T?this.P[e]=f.T:(this.P[e]=Da(g,this.X),f.filter&&("string"===typeof this.P[e]&&(this.P[e]=new String(this.P[e])),this.P[e].V=f.filter));this.ba[e]=g;this.tag.set(g,new Map)}}if(this.F){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(f){let g=0;for(const h of e.index.entries()){const k= this.P=[];this.ba=[];for(let e=0,g,f;e<b.length;e++){g=b[e];f=g.A||g;if(!f)throw Error("The tag field from the document descriptor is undefined.");g.T?this.P[e]=g.T:(this.P[e]=Da(f,this.X),g.filter&&("string"===typeof this.P[e]&&(this.P[e]=new String(this.P[e])),this.P[e].V=g.filter));this.ba[e]=f;this.tag.set(f,new Map)}}if(this.F){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(g){let f=0;for(const k of e.index.entries()){const h=
h[0];h[1].then&&e.index.set(k,f[g++])}return e})}}else a.db&&this.Y(a.db)}y=S.prototype; k[0];k[1].then&&e.index.set(h,g[f++])}return e})}}else a.db&&this.Y(a.db)}A=S.prototype;
y.Y=function(a){let b=this.A;if(this.tag)for(let e=0,f;e<this.ba.length;e++){f=this.ba[e];var c=void 0;this.index.set(f,c=new L({},this.B));b===this.A&&(b=b.slice(0));b.push(f);c.tag=this.tag.get(f)}c=[];const d={db:a.db,type:a.type,C:a.C};for(let e=0,f,g;e<b.length;e++){d.A=g=b[e];f=this.index.get(g);const h=new a.constructor(a.id,d);h.id=a.id;c[e]=h.Y(f);f.document=!0;e?f.Aa=!0:f.store=this.store}this.db=!0;return Promise.all(c)}; A.Y=function(a){let c=this.A;if(this.tag)for(let e=0,g;e<this.ba.length;e++){g=this.ba[e];var b=void 0;this.index.set(g,b=new L({},this.B));c===this.A&&(c=c.slice(0));c.push(g);b.tag=this.tag.get(g)}b=[];const d={db:a.db,type:a.type,C:a.C};for(let e=0,g,f;e<c.length;e++){d.A=f=c[e];g=this.index.get(f);const k=new a.constructor(a.id,d);k.id=a.id;b[e]=k.Y(g);g.document=!0;e?g.Aa=!0:g.store=this.store}this.db=!0;return Promise.all(b)};
y.commit=async function(a,b){const c=[];for(const d of this.index.values())c.push(d.db.commit(d,a,b));await Promise.all(c);this.B.clear()}; A.commit=async function(a,c){const b=[];for(const d of this.index.values())b.push(d.db.commit(d,a,c));await Promise.all(b);this.B.clear()};
function Ea(a,b){const c=new Map;let d=b.index||b.A||b;G(d)&&(d=[d]);for(let e=0,f,g;e<d.length;e++){f=d[e];G(f)||(g=f,f=f.A);g=H(g)?Object.assign({},a,g):a;if(this.F){const h=new M(g);c.set(f,h)}this.F||c.set(f,new L(g,this.B));g.T?this.N[e]=g.T:(this.N[e]=Da(f,this.X),g.filter&&("string"===typeof this.N[e]&&(this.N[e]=new String(this.N[e])),this.N[e].V=g.filter));this.A[e]=f}if(this.M){a=b.store;G(a)&&(a=[a]);for(let e=0,f,g;e<a.length;e++)f=a[e],g=f.A||f,f.T?(this.M[e]=f.T,f.T.oa=g):(this.M[e]= function Ea(a,c){const b=new Map;let d=c.index||c.A||c;G(d)&&(d=[d]);for(let e=0,g,f;e<d.length;e++){g=d[e];G(g)||(f=g,g=g.A);f=H(f)?Object.assign({},a,f):a;if(this.F){const k=new M(f);b.set(g,k)}this.F||b.set(g,new L(f,this.B));f.T?this.M[e]=f.T:(this.M[e]=Da(g,this.X),f.filter&&("string"===typeof this.M[e]&&(this.M[e]=new String(this.M[e])),this.M[e].V=f.filter));this.A[e]=g}if(this.L){a=c.store;G(a)&&(a=[a]);for(let e=0,g,f;e<a.length;e++)g=a[e],f=g.A||g,g.T?(this.L[e]=g.T,g.T.oa=f):(this.L[e]=
Da(g,this.X),f.filter&&("string"===typeof this.M[e]&&(this.M[e]=new String(this.M[e])),this.M[e].V=f.filter))}return c}function Da(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}y.update=function(a,b){return this.remove(a).add(a,b)}; Da(f,this.X),g.filter&&("string"===typeof this.L[e]&&(this.L[e]=new String(this.L[e])),this.L[e].V=g.filter))}return b}function Da(a,c){const b=a.split(":");let d=0;for(let e=0;e<b.length;e++)a=b[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(c[d]=!0),a&&(b[d++]=a);d<b.length&&(b.length=d);return 1<d?b:b[0]}A.update=function(a,c){return this.remove(a).add(a,c)};
y.remove=function(a){H(a)&&(a=J(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.B.has(a)){if(this.tag&&!this.C)for(let c of this.tag.values())for(let d of c){b=d[0];const e=d[1],f=e.indexOf(a);-1<f&&(1<e.length?e.splice(f,1):c.delete(b))}this.store&&this.store.delete(a);this.B.delete(a)}this.cache&&this.cache.remove(a);return this}; A.remove=function(a){H(a)&&(a=J(a,this.key));for(var c of this.index.values())c.remove(a,!0);if(this.B.has(a)){if(this.tag&&!this.C)for(let b of this.tag.values())for(let d of b){c=d[0];const e=d[1],g=e.indexOf(a);-1<g&&(1<e.length?e.splice(g,1):b.delete(c))}this.store&&this.store.delete(a);this.B.delete(a)}this.cache&&this.cache.remove(a);return this};
y.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};y.get=function(a){return this.db?this.index.get(this.A[0]).db.I(a).then(function(b){return b[0]&&b[0].ha}):this.store.get(a)};y.set=function(a,b){this.store.set(a,b);return this}; A.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};A.get=function(a){return this.db?this.index.get(this.A[0]).db.H(a).then(function(c){return c[0]&&c[0].ha}):this.store.get(a)};A.set=function(a,c){this.store.set(a,c);return this};
y.import=function(a,b){if(b){G(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.C=!1;this.B=qa(b,this.B);for(let d=0,e;d<this.A.length;d++)e=this.index.get(this.A[d]),e.C=!1,e.B=this.B;break;case "tag":this.tag=pa(b,this.tag);break;case "doc":this.store=oa(b,this.store)}}};na(S.prototype);function T(a){this.J=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}T.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.J&&this.cache.delete(this.cache.keys().next().value)};T.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};T.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};T.prototype.clear=function(){this.cache.clear();this.h=""};const Fa={normalize:function(a){return a.toLowerCase()},dedupe:!1};const Ga=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Ha=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Ia=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Ja={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Ka=/[\x00-\x7F]+/g;const La=/[\x00-\x7F]+/g;const Ma=/[\x00-\x7F]+/g;var Na={wa:{normalize:!1,dedupe:!1},va:Fa,ya:{normalize:!0,dedupe:!0},ua:{normalize:!0,dedupe:!0,mapper:Ga},ta:{normalize:!0,dedupe:!0,mapper:Ga,matcher:Ha,replacer:Ia},xa:{normalize:!0,dedupe:!0,mapper:Ga,replacer:Ia.concat([/(?!^)[aeo]/g,""]),matcher:Ha},za:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let d=b.charAt(0),e=Ja[d];for(let f=1,g;f<b.length&&(g=b.charAt(f),"h"===g||"w"===g||!(g=Ja[g])||g===e||(d+=g,e=g,4!==d.length));f++);a[c]= A.import=function(a,c){if(c){G(c)&&(c=JSON.parse(c));a=a.split(".");"json"===a[a.length-1]&&a.pop();var b=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(b)return this.index.get(b).import(a,c);switch(a){case "reg":this.C=!1;this.B=qa(c,this.B);for(let d=0,e;d<this.A.length;d++)e=this.index.get(this.A[d]),e.C=!1,e.B=this.B;break;case "tag":this.tag=pa(c,this.tag);break;case "doc":this.store=oa(c,this.store)}}};na(S.prototype);function T(a){this.I=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}T.prototype.set=function(a,c){this.cache.set(this.h=a,c);this.cache.size>this.I&&this.cache.delete(this.cache.keys().next().value)};T.prototype.get=function(a){const c=this.cache.get(a);c&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,c));return c};T.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b)}};T.prototype.clear=function(){this.cache.clear();this.h=""};const Fa={normalize:function(a){return a.toLowerCase()},dedupe:!1};const Ga=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Ha=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Ia=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Ja={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Ka=/[\x00-\x7F]+/g;const La=/[\x00-\x7F]+/g;const Ma=/[\x00-\x7F]+/g;var Na={wa:{normalize:!1,dedupe:!1},va:Fa,ya:{normalize:!0,dedupe:!0},ua:{normalize:!0,dedupe:!0,mapper:Ga},ta:{normalize:!0,dedupe:!0,mapper:Ga,matcher:Ha,replacer:Ia},xa:{normalize:!0,dedupe:!0,mapper:Ga,replacer:Ia.concat([/(?!^)[aeo]/g,""]),matcher:Ha},za:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let b=0;b<a.length;b++){var c=a[b];let d=c.charAt(0),e=Ja[d];for(let g=1,f;g<c.length&&(f=c.charAt(g),"h"===f||"w"===f||!(f=Ja[f])||f===e||(d+=f,e=f,4!==d.length));g++);a[b]=
d}}},qa:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ka," ")}},ra:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(La,"")}},sa:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ma," ")}}};const Oa={memory:{G:1},performance:{G:6,C:!0,context:{depth:1,G:3}},match:{ca:"forward"},score:{G:9,context:{depth:2,G:9}}};const Pa=B();let U,Qa;const V=new Map;function Ra(a){if(Qa){if(V.has(a))return V.get(a)}else Qa=setTimeout(Sa);if("number"==typeof a)var b=a;else{var c=2**32-1;if("number"==typeof a)b=a&c;else{b=0;for(var d=0;d<a.length;d++)b=(33*b^a.charCodeAt(d))&c;b+=2**31}}if(!U){U=Array(255);for(c=0;255>c;c++)U[c]=c+1;U=String.fromCharCode.apply(null,U)}c=b;for(d="";b=c%255,d=U.charAt(b)+d,c=c/255|0,c;);b=d;2E5<V.size&&V.clear();V.set(a,b);return b}function Sa(){Qa=null;V.clear()};L.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.B.has(a))return this.update(a,b);b=this.U.encode(b);if(d=b.length){const l=B(),m=B(),r=this.depth,n=this.G;for(let p=0;p<d;p++){let t=b[this.rtl?d-1-p:p];var e=t.length;if(e&&(r||!m[t])){var f=this.L?this.L(b,t,p,null,0):Ta(n,d,p),g="";switch(this.ca){case "full":if(2<e){for(f=0;f<e;f++)for(var h=e;h>f;h--){g=t.substring(f,h);var k=this.L?this.L(b,t,p,g,f):Ta(n,d,p,e,f);W(this,m,g,k,a,c)}break}case "reverse":if(1<e){for(h=e-1;0<h;h--)g= d}}},qa:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ka," ")}},ra:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(La,"")}},sa:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ma," ")}}};const Oa={memory:{K:1},performance:{K:6,C:!0,context:{depth:1,K:3}},match:{ca:"forward"},score:{K:9,context:{depth:2,K:9}}};const Pa=C();let U,Qa;const V=new Map;function Ra(a){if(Qa){if(V.has(a))return V.get(a)}else Qa=setTimeout(Sa);if("number"==typeof a)var c=a;else{var b=2**32-1;if("number"==typeof a)c=a&b;else{c=0;for(var d=0;d<a.length;d++)c=(33*c^a.charCodeAt(d))&b;c+=2**31}}if(!U){U=Array(255);for(b=0;255>b;b++)U[b]=b+1;U=String.fromCharCode.apply(null,U)}b=c;for(d="";c=b%255,d=U.charAt(c)+d,b=b/255|0,b;);c=d;2E5<V.size&&V.clear();V.set(a,c);return c}function Sa(){Qa=null;V.clear()};L.prototype.add=function(a,c,b,d){if(c&&(a||0===a)){if(!d&&!b&&this.B.has(a))return this.update(a,c);c=this.U.encode(c);if(d=c.length){const l=C(),m=C(),u=this.depth,n=this.K;for(let p=0;p<d;p++){let t=c[this.rtl?d-1-p:p];var e=t.length;if(e&&(u||!m[t])){var g=this.O?this.O(c,t,p,null,0):Ta(n,d,p),f="";switch(this.ca){case "full":if(2<e){for(g=0;g<e;g++)for(var k=e;k>g;k--){f=t.substring(g,k);var h=this.O?this.O(c,t,p,f,g):Ta(n,d,p,e,g);W(this,m,f,h,a,b)}break}case "reverse":if(1<e){for(k=e-1;0<k;k--)f=
t[h]+g,k=this.L?this.L(b,t,p,g,h):Ta(n,d,p,e,h),W(this,m,g,k,a,c);g=""}case "forward":if(1<e){for(h=0;h<e;h++)g+=t[h],W(this,m,g,f,a,c);break}default:if(W(this,m,t,f,a,c),r&&1<d&&p<d-1)for(e=B(),g=this.ja,f=t,h=Math.min(r+1,d-p),e[f]=1,k=1;k<h;k++)if((t=b[this.rtl?d-1-p-k:p+k])&&!e[t]){e[t]=1;const q=this.L?this.L(b,f,p,t,k):Ta(g+(d/2>g?0:1),d,p,h-1,k-1),u=this.fa&&t>f;W(this,l,u?f:t,q,a,c,u?t:f)}}}}this.C||this.B.add(a)}else b=""}this.db&&(b||this.ga.push({del:a}),this.na&&Ua(this));return this}; t[k]+f,h=this.O?this.O(c,t,p,f,k):Ta(n,d,p,e,k),W(this,m,f,h,a,b);f=""}case "forward":if(1<e){for(k=0;k<e;k++)f+=t[k],W(this,m,f,g,a,b);break}default:if(W(this,m,t,g,a,b),u&&1<d&&p<d-1)for(e=C(),f=this.ja,g=t,k=Math.min(u+1,d-p),e[g]=1,h=1;h<k;h++)if((t=c[this.rtl?d-1-p-h:p+h])&&!e[t]){e[t]=1;const q=this.O?this.O(c,g,p,t,h):Ta(f+(d/2>f?0:1),d,p,k-1,h-1),v=this.fa&&t>g;W(this,l,v?g:t,q,a,b,v?t:g)}}}}this.C||this.B.add(a)}else c=""}this.db&&(c||this.ga.push({del:a}),this.na&&Ua(this));return this};
function W(a,b,c,d,e,f,g){let h=g?a.S:a.map,k;if(!b[c]||g&&!(k=b[c])[g])if(g?(b=k||(b[c]=B()),b[g]=1,a.aa&&(g=Ra(g)),(k=h.get(g))?h=k:h.set(g,h=new Map)):b[c]=1,a.aa&&(c=Ra(c)),(k=h.get(c))?h=k:h.set(c,h=k=[]),h=h[d]||(h[d]=[]),!f||!h.includes(e)){if(h.length===2**31-1){b=new P(h);if(a.C)for(let l of a.B.values())l.includes(h)&&(l[l.indexOf(h)]=b);k[d]=h=b}h.push(e);a.C&&((d=a.B.get(e))?d.push(h):a.B.set(e,[h]))}} function W(a,c,b,d,e,g,f){let k=f?a.S:a.map,h;if(!c[b]||f&&!(h=c[b])[f])if(f?(c=h||(c[b]=C()),c[f]=1,a.aa&&(f=Ra(f)),(h=k.get(f))?k=h:k.set(f,k=new Map)):c[b]=1,a.aa&&(b=Ra(b)),(h=k.get(b))?k=h:k.set(b,k=h=[]),k=k[d]||(k[d]=[]),!g||!k.includes(e)){if(k.length===2**31-1){c=new P(k);if(a.C)for(let l of a.B.values())l.includes(k)&&(l[l.indexOf(k)]=c);h[d]=k=c}k.push(e);a.C&&((d=a.B.get(e))?d.push(k):a.B.set(e,[k]))}}
function Ta(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function X(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Va(a):a;let e=[];for(let f=0,g,h;f<a.length;f++)if((g=a[f])&&(h=g.length)){if(c){if(c>=h){c-=h;continue}c<h&&(g=b?g.slice(c,c+b):g.slice(c),h=g.length,c=0)}if(e.length)h>b&&(g=g.slice(0,b),h=g.length),e.push(g);else{if(h>=b)return h>b&&(g=g.slice(0,b)),d?Va(g):g;e=[g]}b-=h;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Va(e):e} function Ta(a,c,b,d,e){return b&&1<a?c+(d||0)<=a?b+(e||0):(a-1)/(c+(d||0))*(b+(e||0))+1|0:0};function X(a,c,b,d){if(1===a.length)return a=a[0],a=b||a.length>c?c?a.slice(b,b+c):a.slice(b):a,d?Va(a):a;let e=[];for(let g=0,f,k;g<a.length;g++)if((f=a[g])&&(k=f.length)){if(b){if(b>=k){b-=k;continue}b<k&&(f=c?f.slice(b,b+c):f.slice(b),k=f.length,b=0)}if(e.length)k>c&&(f=f.slice(0,c),k=f.length),e.push(f);else{if(k>=c)return k>c&&(f=f.slice(0,c)),d?Va(f):f;e=[f]}c-=k;if(!c)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Va(e):e}
function Va(a){for(let b=0;b<a.length;b++)a[b]={L:b,id:a[b]};return a};Y.prototype.or=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.J||0;f=l.offset||0;g=l.I;h=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.K)m=this.K(l.K); function Va(a){for(let c=0;c<a.length;c++)a[c]={score:c,id:a[c]};return a};Y.prototype.or=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.or.apply(a,c)});if(b[0]&&b[0].index)return this.or.apply(this,b);let d=[];b=[];let e=0,g=0,f,k;for(let h=0,l;h<c.length;h++)if(l=c[h]){e=l.I||0;g=l.offset||0;f=l.H;k=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.J)m=this.J(l.J);
else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Wa(d,e,f,g,h,a.O);return h?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Wa(d,e,f,g,h,this.O));return h?this.result:this};function Wa(a,b,c,d,e,f){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.I||!1,b=b.J||0);return 2>a.length?e?X(a[0],b,c,d):a[0]:xa(a,c,b,e,f)};Y.prototype.and=function(){if(this.result.length){const b=this;let c=arguments;var a=c[0];if(a.then)return a.then(function(){return b.and.apply(b,c)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,f=0,g,h;for(let k=0,l;k<c.length;k++)if(l=c[k]){e=l.J||0;f=l.offset||0;g=l.resolve;h=l.ka;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor); else continue;d[h]=m;m.then&&b.push(m)}if(b.length)return Promise.all(b).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Wa(d,e,g,f,k,a.N);return k?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Wa(d,e,g,f,k,this.N));return k?this.result:this};function Wa(a,c,b,d,e,g){if(!a.length)return a;"object"===typeof c&&(b=c.offset||0,d=c.H||!1,c=c.I||0);return 2>a.length?e?X(a[0],c,b,d):a[0]:xa(a,b,c,e,g)};Y.prototype.and=function(){if(this.result.length){const c=this;let b=arguments;var a=b[0];if(a.then)return a.then(function(){return c.and.apply(c,b)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,g=0,f,k;for(let h=0,l;h<b.length;h++)if(l=b[h]){e=l.I||0;g=l.offset||0;f=l.resolve;k=l.ka;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor);
else if(l.K)m=this.K(l.K);else continue;d[k]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,g?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[b.result].concat(d);b.result=Xa(d,e,f,g,b.O,h);return g?b.result:b});d=[this.result].concat(d);this.result=Xa(d,e,f,g,this.O,h);return g?this.result:this}return this};function Xa(a,b,c,d,e,f){if(2>a.length)return[];let g=[];B();let h=ba(a);return h?wa(a,h,b,c,f,e,d):g};Y.prototype.xor=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.J||0;f=l.offset||0;g=l.I;h=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.K)m=this.K(l.K); else if(l.J)m=this.J(l.J);else continue;d[h]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,f?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[c.result].concat(d);c.result=Xa(d,e,g,f,c.N,k);return f?c.result:c});d=[this.result].concat(d);this.result=Xa(d,e,g,f,this.N,k);return f?this.result:this}return this};function Xa(a,c,b,d,e,g){if(2>a.length)return[];let f=[];C();let k=ba(a);return k?wa(a,k,c,b,g,e,d):f};Y.prototype.xor=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.xor.apply(a,c)});if(b[0]&&b[0].index)return this.xor.apply(this,b);let d=[];b=[];let e=0,g=0,f,k;for(let h=0,l;h<c.length;h++)if(l=c[h]){e=l.I||0;g=l.offset||0;f=l.H;k=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.J)m=this.J(l.J);
else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Ya(d,e,f,g,!h,a.O);return h?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Ya(d,e,f,g,!h,a.O));return h?this.result:this}; else continue;d[h]=m;m.then&&b.push(m)}if(b.length)return Promise.all(b).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Ya(d,e,g,f,!k,a.N);return k?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Ya(d,e,g,f,!k,a.N));return k?this.result:this};
function Ya(a,b,c,d,e,f){if(!a.length)return a;if(2>a.length)return e?X(a[0],b,c,d):a[0];d=[];const g=B();let h=0;for(let k=0,l;k<a.length;k++)if(l=a[k])for(let m=0,r;m<l.length;m++)if(r=l[m]){h<r.length&&(h=r.length);for(let n=0,p;n<r.length;n++)p=r[n],g[p]?g[p]++:g[p]=1}for(let k=0,l,m=0;k<h;k++)for(let r=0,n;r<a.length;r++)if(n=a[r])if(l=n[k])for(let p=0,t;p<l.length;p++)if(t=l[p],1===g[t])if(c)c--;else if(e){if(d.push(t),d.length===b)return d}else{const q=k+(r?f:0);d[q]||(d[q]=[]);d[q].push(t); function Ya(a,c,b,d,e,g){if(!a.length)return a;if(2>a.length)return e?X(a[0],c,b,d):a[0];d=[];const f=C();let k=0;for(let h=0,l;h<a.length;h++)if(l=a[h])for(let m=0,u;m<l.length;m++)if(u=l[m]){k<u.length&&(k=u.length);for(let n=0,p;n<u.length;n++)p=u[n],f[p]?f[p]++:f[p]=1}for(let h=0,l,m=0;h<k;h++)for(let u=0,n;u<a.length;u++)if(n=a[u])if(l=n[h])for(let p=0,t;p<l.length;p++)if(t=l[p],1===f[t])if(b)b--;else if(e){if(d.push(t),d.length===c)return d}else{const q=h+(u?g:0);d[q]||(d[q]=[]);d[q].push(t);
if(++m===b)return d}return d};Y.prototype.K=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.K.apply(a,b)});if(c[0]&&c[0].index)return this.K.apply(this,c);let d=[];c=[];let e=0,f=0,g;for(let h=0,k;h<b.length;h++)if(k=b[h]){e=k.J||0;f=k.offset||0;g=k.resolve;let l;if(k.constructor===Y)l=k.result;else if(k.constructor===Array)l=k;else if(k.index)k.resolve=!1,l=k.index.search(k).result;else if(k.or)l=this.or(k.or);else if(k.and)l=this.and(k.and);else if(k.xor)l=this.xor(k.xor);else continue; if(++m===c)return d}return d};Y.prototype.J=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.J.apply(a,c)});if(b[0]&&b[0].index)return this.J.apply(this,b);let d=[];b=[];let e=0,g=0,f;for(let k=0,h;k<c.length;k++)if(h=c[k]){e=h.I||0;g=h.offset||0;f=h.resolve;let l;if(h.constructor===Y)l=h.result;else if(h.constructor===Array)l=h;else if(h.index)h.resolve=!1,l=h.index.search(h).result;else if(h.or)l=this.or(h.or);else if(h.and)l=this.and(h.and);else if(h.xor)l=this.xor(h.xor);else continue;
d[h]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=$a.call(a,d,e,f,g);return g?a.result:a});d.length&&(this.result=$a.call(this,d,e,f,g));return g?this.result:this}; d[k]=l;l.then&&b.push(l)}if(b.length)return Promise.all(b).then(function(){a.result=$a.call(a,d,e,g,f);return f?a.result:a});d.length&&(this.result=$a.call(this,d,e,g,f));return f?this.result:this};
function $a(a,b,c,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let f=0,g,h=0;f<this.result.length;f++)if(g=this.result[f])for(let k=0,l;k<g.length;k++)if(l=g[k],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[f]||(e[f]=[]),e[f].push(l),++h===b)return e;return e};function Y(a){if(!this||this.constructor!==Y)return new Y(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.O=a.ma||0,this.result=a.index.search(a).result,this;if(a.constructor===Y)return a;this.index=null;this.result=a||[];this.O=0}Y.prototype.J=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}}return this}; function $a(a,c,b,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let g=0,f,k=0;g<this.result.length;g++)if(f=this.result[g])for(let h=0,l;h<f.length;h++)if(l=f[h],!a.has(l))if(b)b--;else if(d){if(e.push(l),e.length===c)return e}else if(e[g]||(e[g]=[]),e[g].push(l),++k===c)return e;return e};function Y(a){if(!this||this.constructor!==Y)return new Y(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.N=a.ma||0,this.result=a.index.search(a).result,this;if(a.constructor===Y)return a;this.index=null;this.result=a||[];this.N=0}Y.prototype.I=function(a){if(this.result.length){const c=[];let b=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+b<a)c[d]=e,b+=e.length;else{c[d]=e.slice(0,a-b);this.result=c;break}}return this};
Y.prototype.offset=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};Y.prototype.ma=function(a){this.O+=a;return this};Y.prototype.resolve=function(a,b,c){ab=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.I,b=a.offset,a=a.J),X(d,a||100,b,c)):d};let ab=1; Y.prototype.offset=function(a){if(this.result.length){const c=[];let b=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+b<a?b+=e.length:(c[d]=e.slice(a-b),b=a);this.result=c}return this};Y.prototype.ma=function(a){this.N+=a;return this};Y.prototype.resolve=function(a,c,b){ab=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(b=a.H,c=a.offset,a=a.I),X(d,a||100,c,b)):d};let ab=1;
L.prototype.search=function(a,b,c){c||(!b&&H(a)?(c=a,a=""):H(b)&&(c=b,b=0));let d=[],e;let f,g=0,h,k,l,m;if(c){a=c.query||a;b=c.J||b;g=c.offset||0;var r=c.context;f=c.ka;(h=ab&&!1!==c.resolve)||(ab=0);k=h&&c.I;m=c.ma;l=this.db&&c.tag}else h=this.resolve||ab;a=this.U.encode(a);e=a.length;b||!h||(b=100);if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);r=this.depth&&!1!==r;if(2===e&&r&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);let n=c=0;if(1<e){const q=B(),u=[];for(let w=0,D;w<e;w++)if((D=a[w])&&!q[D]){if(f|| L.prototype.search=function(a,c,b){b||(!c&&H(a)?(b=a,a=""):H(c)&&(b=c,c=0));let d=[],e,g,f,k=0,h,l,m,u,n;b?(a=b.query||a,c=b.I||c,k=b.offset||0,g=b.context,f=b.ka,(h=ab&&!1!==b.resolve)||(ab=0),l=h&&b.H,u=b.ma,n=b.K,m=this.db&&b.tag):h=this.resolve||ab;let p=this.U.encode(a);e=p.length;c||!h||(c=100);if(1===e)return bb.call(this,p[0],"",c,k,h,l,m);g=this.depth&&!1!==g;if(2===e&&g&&!f)return bb.call(this,p[0],p[1],c,k,h,l,m);let t=b=0;if(1<e){const w=C(),z=[];for(let x=0,r;x<e;x++)if((r=p[x])&&!w[r]){if(f||
this.db||Z(this,D))u.push(D),q[D]=1;else return h?d:new Y(d);const x=D.length;c=Math.max(c,x);n=n?Math.min(n,x):x}a=u;e=a.length}if(!e)return h?d:new Y(d);let p=0,t;if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);if(2===e&&r&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);1<e&&(r?(t=a[0],p=1):9<c&&3<c/n&&a.sort(aa));if(this.db){if(this.db.search&&(r=this.db.search(this,a,b,g,f,h,k,l),!1!==r))return r;const q=this;return async function(){for(let u,w;p<e;p++){w=a[p];t?(u=await Z(q,w,t,0,0,!1,!1),u=cb(u, this.db||Z(this,r))z.push(r),w[r]=1;else return h?d:new Y(d);const y=r.length;b=Math.max(b,y);t=t?Math.min(t,y):y}p=z;e=a.length}if(!e)return h?d:new Y(d);let q=0,v;if(1===e)return bb.call(this,p[0],"",c,k,h,l,m);if(2===e&&g&&!f)return bb.call(this,p[0],p[1],c,k,h,l,m);1<e&&(g?(v=p[0],q=1):9<b&&3<b/t&&p.sort(aa));n||0===n||(n=this.K);if(this.db){if(this.db.search&&(a=this.db.search(this,p,c,k,f,h,l,m),!1!==a))return a;const w=this;return async function(){for(let z,x;q<e;q++){x=p[q];v?(z=await Z(w,
d,f,q.ja),f&&!1===u&&d.length||(t=w)):(u=await Z(q,w,"",0,0,!1,!1),u=cb(u,d,f,q.G));if(u)return u;if(f&&p===e-1){let D=d.length;if(!D){if(t){t="";p=-1;continue}return d}if(1===D)return h?X(d[0],b,g):new Y(d[0])}}return h?wa(d,q.G,b,g,f,m,h):new Y(d[0])}()}for(let q,u;p<e;p++){u=a[p];t?(q=Z(this,u,t,0,0,!1,!1),q=cb(q,d,f,this.ja),f&&!1===q&&d.length||(t=u)):(q=Z(this,u,"",0,0,!1,!1),q=cb(q,d,f,this.G));if(q)return q;if(f&&p===e-1){r=d.length;if(!r){if(t){t="";p=-1;continue}return d}if(1===r)return h? x,v,0,0,!1,!1),z=cb(z,d,f,w.ja),f&&!1===z&&d.length||(v=x)):(z=await Z(w,x,"",0,0,!1,!1),z=cb(z,d,f,n));if(z)return z;if(f&&q===e-1){let r=d.length;if(!r){if(v){v="";q=-1;continue}return d}if(1===r)return h?X(d[0],c,k):new Y(d[0])}}return h?wa(d,n,c,k,f,u,h):new Y(d[0])}()}for(let w,z;q<e;q++){z=p[q];v?(w=Z(this,z,v,0,0,!1,!1),w=cb(w,d,f,this.ja),f&&!1===w&&d.length||(v=z)):(w=Z(this,z,"",0,0,!1,!1),w=cb(w,d,f,n));if(w)return w;if(f&&q===e-1){a=d.length;if(!a){if(v){v="";q=-1;continue}return d}if(1===
X(d[0],b,g):new Y(d[0])}}d=wa(d,this.G,b,g,f,m,h);return h?d:new Y(d)};function bb(a,b,c,d,e,f,g){a=Z(this,a,b,c,d,e,f,g);return this.db?a.then(function(h){return e?h:h&&h.length?e?X(h,c,d):new Y(h):e?[]:new Y([])}):a&&a.length?e?X(a,c,d):new Y(a):e?[]:new Y([])}function cb(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let f=0,g;f<d;f++)(g=a[f])&&g&&(e[f]=g);if(e.length){b.push(e);return}}return!c&&e} a)return h?X(d[0],c,k):new Y(d[0])}}d=wa(d,n,c,k,f,u,h);return h?d:new Y(d)};function bb(a,c,b,d,e,g,f){a=Z(this,a,c,b,d,e,g,f);return this.db?a.then(function(k){return e?k:k&&k.length?e?X(k,b,d):new Y(k):e?[]:new Y([])}):a&&a.length?e?X(a,b,d):new Y(a):e?[]:new Y([])}function cb(a,c,b,d){let e=[];if(a){d=Math.min(a.length,d);for(let g=0,f;g<d;g++)(f=a[g])&&f&&(e[g]=f);if(e.length){c.push(e);return}}return!b&&e}
function Z(a,b,c,d,e,f,g,h){let k;c&&(k=a.fa&&b>c);a.aa&&(b=Ra(b),c&&(c=Ra(c)));if(a.db)return c?a.db.get(k?c:b,k?b:c,d,e,f,g,h):a.db.get(b,"",d,e,f,g,h);a=c?(a=a.S.get(k?b:c))&&a.get(k?c:b):a.map.get(b);return a};L.prototype.remove=function(a,b){const c=this.B.size&&(this.C?this.B.get(a):this.B.has(a));if(c){if(this.C)for(let d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{const f=e.indexOf(a);f===c.length-1?e.pop():e.splice(f,1)}}else db(this.map,a),this.depth&&db(this.S,a);b||this.B.delete(a)}this.db&&(this.ga.push({del:a}),this.na&&Ua(this));this.cache&&this.cache.remove(a);return this}; function Z(a,c,b,d,e,g,f,k){let h;b&&(h=a.fa&&c>b);a.aa&&(c=Ra(c),b&&(b=Ra(b)));if(a.db)return b?a.db.get(h?b:c,h?c:b,d,e,g,f,k):a.db.get(c,"",d,e,g,f,k);a=b?(a=a.S.get(h?c:b))&&a.get(h?b:c):a.map.get(c);return a};L.prototype.remove=function(a,c){const b=this.B.size&&(this.C?this.B.get(a):this.B.has(a));if(b){if(this.C)for(let d=0,e;d<b.length;d++){if(e=b[d])if(2>e.length)e.pop();else{const g=e.indexOf(a);g===b.length-1?e.pop():e.splice(g,1)}}else db(this.map,a),this.depth&&db(this.S,a);c||this.B.delete(a)}this.db&&(this.ga.push({del:a}),this.na&&Ua(this));this.cache&&this.cache.remove(a);return this};
function db(a,b){let c=0;if(a.constructor===Array)for(let d=0,e,f;d<a.length;d++){if((e=a[d])&&e.length)if(f=e.indexOf(b),0<=f){1<e.length?(e.splice(f,1),c++):delete a[d];break}else c++}else for(let d of a){const e=d[0],f=db(d[1],b);f?c+=f:a.delete(e)}return c};function L(a,b){if(!this||this.constructor!==L)return new L(a);var c=Pa.profiler||(Pa.profiler={});c["Index.create"]||(c["Index.create"]=0);c["Index.create"]++;if(a){if(c=G(a)?a:a.preset)Oa[c]||console.warn("Preset not found: "+c),a=Object.assign({},Oa[c],a)}else a={};c=a.context||{};const d=G(a.U)?Na[a.U]:a.encode||a.U||Fa;this.U=d.encode?d:"object"===typeof d?new K(d):{encode:d};this.aa=a.aa||a.Ba||!1;let e;this.G=a.G||9;this.ca=e=a.ca||"strict";this.depth="strict"===e&&c.depth||0;this.fa=!1!== function db(a,c){let b=0;if(a.constructor===Array)for(let d=0,e,g;d<a.length;d++){if((e=a[d])&&e.length)if(g=e.indexOf(c),0<=g){1<e.length?(e.splice(g,1),b++):delete a[d];break}else b++}else for(let d of a){const e=d[0],g=db(d[1],c);g?b+=g:a.delete(e)}return b};function L(a,c){if(!this||this.constructor!==L)return new L(a);var b=Pa.profiler||(Pa.profiler={});b["Index.create"]||(b["Index.create"]=0);b["Index.create"]++;if(a){if(b=G(a)?a:a.Ea)Oa[b]||console.warn("Preset not found: "+b),a=Object.assign({},Oa[b],a)}else a={};b=a.context;const d=!0===b?{depth:1}:b||{},e=G(a.U)?Na[a.U]:a.encode||a.U||Fa;this.U=e.encode?e:"object"===typeof e?new K(e):{encode:e};this.aa=a.aa||a.Ba||!1;this.K=a.K||9;this.ca=b=a.ca||"strict";this.depth="strict"===b&&d.depth||0;this.fa=
c.fa;this.C=!!a.C;this.L=a.L||null;(e=a.ia||0)&&(this.ia=e);this.map=e?new Q(e):new Map;this.S=e?new Q(e):new Map;this.B=b||(this.C?e?new Q(e):new Map:e?new R(e):new Set);this.ja=c.G||1;this.rtl=d.rtl||a.rtl||!1;this.cache=(e=a.cache||null)&&new T(e);this.resolve=!1!==a.resolve;if(e=a.db)this.db=this.Y(e);this.na=!1!==a.commit;this.ga=[];this.h=null}y=L.prototype;y.Y=function(a){this.h&&(clearTimeout(this.h),this.h=null);return a.Y(this)}; !1!==d.fa;this.C=!!a.C;this.O=a.O||null;(b=a.ia||0)&&(this.ia=b);this.map=b?new Q(b):new Map;this.S=b?new Q(b):new Map;this.B=c||(this.C?b?new Q(b):new Map:b?new R(b):new Set);this.ja=d.K||3;this.rtl=e.rtl||a.rtl||!1;this.cache=(b=a.cache||null)&&new T(b);this.resolve=!1!==a.resolve;if(b=a.db)this.db=this.Y(b);this.na=!1!==a.commit;this.ga=[];this.h=null}A=L.prototype;A.Y=function(a){this.h&&(clearTimeout(this.h),this.h=null);return a.Y(this)};
y.commit=function(a,b){this.h&&(clearTimeout(this.h),this.h=null);return this.db.commit(this,a,b)};function Ua(a){a.h||(a.h=setTimeout(function(){a.h=null;a.db.commit(a,void 0,void 0)},0))}y.clear=function(){this.map.clear();this.S.clear();this.B.clear();this.cache&&this.cache.clear();this.db&&(this.h&&clearTimeout(this.h),this.h=null,this.ga=[{clear:!0}]);return this};y.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)}; A.commit=function(a,c){this.h&&(clearTimeout(this.h),this.h=null);return this.db.commit(this,a,c)};function Ua(a){a.h||(a.h=setTimeout(function(){a.h=null;a.db.commit(a,void 0,void 0)},0))}A.clear=function(){this.map.clear();this.S.clear();this.B.clear();this.cache&&this.cache.clear();this.db&&(this.h&&clearTimeout(this.h),this.h=null,this.ga=[{clear:!0}]);return this};A.update=function(a,c){const b=this,d=this.remove(a);return d&&d.then?d.then(()=>b.add(a,c)):this.add(a,c)};
y.import=function(a,b){if(b)switch(G(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.C=!1;this.B=qa(b,this.B);break;case "map":this.map=oa(b,this.map);break;case "ctx":this.S=pa(b,this.S)}};na(L.prototype);const eb=new Map([["_"," "],["\u00e4","ae"],["\u00f6","oe"],["\u00fc","ue"],["\u00df","ss"],["&"," und "],["\u20ac"," EUR "]]),fb={prepare:function(a){/[_\u00e4\u00f6\u00fc\u00df&\u20ac]/.test(a)&&(a=a.replace(/[_\u00e4\u00f6\u00fc\u00df&\u20ac]/g,b=>eb.get(b)));return a.replace(/str\b/g,"strasse").replace(/(?!\b)strasse\b/g," strasse")},filter:new Set("aber als am an auch auf aus bei bin bis bist da dadurch daher darum das dass dass dein deine dem den der des dessen deshalb die dies dieser dieses doch dort du durch ein eine einem einen einer eines er es euer eure fuer hatte hatten hattest hattet hier hinter ich ihr ihre im in ist ja jede jedem jeden jeder jedes jener jenes jetzt ggf kann kannst koennen koennt machen mein meine mit muss musst musst muessen muesst nach nachdem nein nicht noch nun oder seid sein seine sich sie sind soll sollen sollst sollt sonst soweit sowie und unser unsere unter usw uvm vom von vor wann warum was weiter weitere wenn wer werde werden werdet weshalb wie wieder wieso wir wird wirst wo woher wohin zu zum zur ueber".split(" ")), A.import=function(a,c){if(c)switch(G(c)&&(c=JSON.parse(c)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.C=!1;this.B=qa(c,this.B);break;case "map":this.map=oa(c,this.map);break;case "ctx":this.S=pa(c,this.S)}};na(L.prototype);const eb=new Map([["_"," "],["\u00e4","ae"],["\u00f6","oe"],["\u00fc","ue"],["\u00df","ss"],["&"," und "],["\u20ac"," EUR "]]),fb={prepare:function(a){/[_\u00e4\u00f6\u00fc\u00df&\u20ac]/.test(a)&&(a=a.replace(/[_\u00e4\u00f6\u00fc\u00df&\u20ac]/g,c=>eb.get(c)));return a.replace(/str\b/g,"strasse").replace(/(?!\b)strasse\b/g," strasse")},filter:new Set("aber als am an auch auf aus bei bin bis bist da dadurch daher darum das dass dass dein deine dem den der des dessen deshalb die dies dieser dieses doch dort du durch ein eine einem einen einer eines er es euer eure fuer hatte hatten hattest hattet hier hinter ich ihr ihre im in ist ja jede jedem jeden jeder jedes jener jenes jetzt ggf kann kannst koennen koennt machen mein meine mit muss musst musst muessen muesst nach nachdem nein nicht noch nun oder seid sein seine sich sie sind soll sollen sollst sollt sonst soweit sowie und unser unsere unter usw uvm vom von vor wann warum was weiter weitere wenn wer werde werden werdet weshalb wie wieder wieso wir wird wirst wo woher wohin zu zum zur ueber".split(" ")),
stemmer:new Map([["niss",""],["isch",""],["lich",""],["heit",""],["keit",""],["ell",""],["bar",""],["end",""],["ung",""],["est",""],["ern",""],["em",""],["er",""],["en",""],["es",""],["st",""],["ig",""],["ik",""],["e",""],["s",""]])};"undefined"!==typeof module&&module.exports?module.exports=fb:self.FlexSearch&&(self.FlexSearch.Language.de=fb);}(this||self)); stemmer:new Map([["niss",""],["isch",""],["lich",""],["heit",""],["keit",""],["ell",""],["bar",""],["end",""],["ung",""],["est",""],["ern",""],["em",""],["er",""],["en",""],["es",""],["st",""],["ig",""],["ik",""],["e",""],["s",""]])};"undefined"!==typeof module&&module.exports?module.exports=fb:self.FlexSearch&&(self.FlexSearch.Language.de=fb);}(this||self));

132
dist/lang/en.min.js vendored
View File

@@ -1,73 +1,73 @@
(function(self){'use strict';var y;function z(a,b,c){const d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var f=new Map(c);for(var g of a)f.set(g[0],g[1]);return f}if(b===Set){g=new Set(c);for(f of a.values())g.add(f);return g}}}return a}return c}return"undefined"===e?b:a}function B(){return Object.create(null)}function aa(a,b){return b.length-a.length} (function(self){'use strict';var A;function B(a,c,b){const d=typeof b,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(b){if("function"===e&&d===e)return function(k){return a(b(k))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var g=new Map(b);for(var f of a)g.set(f[0],f[1]);return g}if(c===Set){f=new Set(b);for(g of a.values())f.add(g);return f}}}return a}return b}return"undefined"===e?c:a}function C(){return Object.create(null)}function aa(a,c){return c.length-a.length}
function G(a){return"string"===typeof a}function H(a){return"object"===typeof a}function J(a,b){if(G(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}function ba(a){let b=0;for(let c=0,d;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var ca=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb", function G(a){return"string"===typeof a}function H(a){return"object"===typeof a}function J(a,c){if(G(c))a=a[c];else for(let b=0;a&&b<c.length;b++)a=a[c[b]];return a}function ba(a){let c=0;for(let b=0,d;b<a.length;b++)(d=a[b])&&c<d.length&&(c=d.length);return c};var ca=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb",
"u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"], "u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"],
["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0", ["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0",
"i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215", "i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215",
"u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af", "u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af",
"\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"], "\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"],
["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const da=/[^\p{L}\p{N}]+/u,ea=/(\d{3})/g,fa=/(\D)(\d{3})/g,ha=/(\d{3})(\D)/g,ia="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])} ["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const da=/[^\p{L}\p{N}]+/u,ea=/(\d{3})/g,fa=/(\D)(\d{3})/g,ha=/(\d{3})(\D)/g,ia="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let c=0;c<arguments.length;c++)this.assign(arguments[c])}
K.prototype.assign=function(a){this.normalize=z(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(f){this.split=/\s+/}this.numeric=d}else{try{this.split=z(c,da,this.split)}catch(d){this.split= K.prototype.assign=function(a){this.normalize=B(a.normalize,!0,this.normalize);let c=a.include,b=c||a.exclude||a.split;if("object"===typeof b){let d=!c,e="";a.include||(e+="\\p{Z}");b.letter&&(e+="\\p{L}");b.number&&(e+="\\p{N}",d=!!c);b.symbol&&(e+="\\p{S}");b.punctuation&&(e+="\\p{P}");b.control&&(e+="\\p{C}");if(b=b.char)e+="object"===typeof b?b.join(""):b;try{this.split=new RegExp("["+(c?"^":"")+e+"]+","u")}catch(g){this.split=/\s+/}this.numeric=d}else{try{this.split=B(b,da,this.split)}catch(d){this.split=
/\s+/}this.numeric=z(this.numeric,!0)}this.prepare=z(a.prepare,null,this.prepare);this.finalize=z(a.finalize,null,this.finalize);ia||(this.mapper=new Map(ca));this.rtl=a.rtl||!1;this.dedupe=z(a.dedupe,!0,this.dedupe);this.filter=z((c=a.filter)&&new Set(c),null,this.filter);this.matcher=z((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=z((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=z((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=z(a.replacer,null,this.replacer);this.minlength= /\s+/}this.numeric=B(this.numeric,!0)}this.prepare=B(a.prepare,null,this.prepare);this.finalize=B(a.finalize,null,this.finalize);ia||(this.mapper=new Map(ca));this.rtl=a.rtl||!1;this.dedupe=B(a.dedupe,!0,this.dedupe);this.filter=B((b=a.filter)&&new Set(b),null,this.filter);this.matcher=B((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=B((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=B((b=a.stemmer)&&new Map(b),null,this.stemmer);this.replacer=B(a.replacer,null,this.replacer);this.minlength=
z(a.minlength,1,this.minlength);this.maxlength=z(a.maxlength,0,this.maxlength);if(this.cache=c=z(a.cache,!0,this.cache))this.Z=null,this.la="number"===typeof c?c:2E5,this.R=new Map,this.W=new Map,this.D=this.h=128;this.H="";this.da=null;this.$="";this.ea=null;if(this.matcher)for(const d of this.matcher.keys())this.H+=(this.H?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.$+=(this.$?"|":"")+d;return this}; B(a.minlength,1,this.minlength);this.maxlength=B(a.maxlength,0,this.maxlength);if(this.cache=b=B(a.cache,!0,this.cache))this.Z=null,this.la="number"===typeof b?b:2E5,this.R=new Map,this.W=new Map,this.D=this.h=128;this.G="";this.da=null;this.$="";this.ea=null;if(this.matcher)for(const d of this.matcher.keys())this.G+=(this.G?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.$+=(this.$?"|":"")+d;return this};
K.prototype.encode=function(a){if(this.cache&&a.length<=this.h)if(this.Z){if(this.R.has(a))return this.R.get(a)}else this.Z=setTimeout(ja,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ia?a.normalize("NFKD").replace(ia,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(fa,"$1 $2").replace(ha,"$1 $2").replace(ea,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer); K.prototype.encode=function(a){if(this.cache&&a.length<=this.h)if(this.Z){if(this.R.has(a))return this.R.get(a)}else this.Z=setTimeout(ja,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ia?a.normalize("NFKD").replace(ia,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(fa,"$1 $2").replace(ha,"$1 $2").replace(ea,"$1 "));const c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);
let c=[],d=this.split||""===this.split?a.split(this.split):a;for(let f=0,g,h;f<d.length;f++){if(!(g=h=d[f]))continue;if(g.length<this.minlength)continue;if(b){c.push(g);continue}if(this.filter&&this.filter.has(g))continue;if(this.cache&&g.length<=this.D)if(this.Z){var e=this.W.get(g);if(e||""===e){e&&c.push(e);continue}}else this.Z=setTimeout(ja,50,this);let k;this.stemmer&&2<g.length&&(this.ea||(this.ea=new RegExp("(?!^)("+this.$+")$")),g=g.replace(this.ea,l=>this.stemmer.get(l)),k=1);g&&k&&(g.length< let b=[],d=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,k;g<d.length;g++){if(!(f=k=d[g]))continue;if(f.length<this.minlength)continue;if(c){b.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.D)if(this.Z){var e=this.W.get(f);if(e||""===e){e&&b.push(e);continue}}else this.Z=setTimeout(ja,50,this);let h;this.stemmer&&2<f.length&&(this.ea||(this.ea=new RegExp("(?!^)("+this.$+")$")),f=f.replace(this.ea,l=>this.stemmer.get(l)),h=1);f&&h&&(f.length<
this.minlength||this.filter&&this.filter.has(g))&&(g="");if(g&&(this.mapper||this.dedupe&&1<g.length)){e="";for(let l=0,m="",r,n;l<g.length;l++)r=g.charAt(l),r===m&&this.dedupe||((n=this.mapper&&this.mapper.get(r))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=r);g=e}this.matcher&&1<g.length&&(this.da||(this.da=new RegExp("("+this.H+")","g")),g=g.replace(this.da,l=>this.matcher.get(l)));if(g&&this.replacer)for(e=0;g&&e<this.replacer.length;e+=2)g=g.replace(this.replacer[e],this.replacer[e+1]);this.cache&& this.minlength||this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){e="";for(let l=0,m="",u,n;l<f.length;l++)u=f.charAt(l),u===m&&this.dedupe||((n=this.mapper&&this.mapper.get(u))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=u);f=e}this.matcher&&1<f.length&&(this.da||(this.da=new RegExp("("+this.G+")","g")),f=f.replace(this.da,l=>this.matcher.get(l)));if(f&&this.replacer)for(e=0;f&&e<this.replacer.length;e+=2)f=f.replace(this.replacer[e],this.replacer[e+1]);this.cache&&
h.length<=this.D&&(this.W.set(h,g),this.W.size>this.la&&(this.W.clear(),this.D=this.D/1.1|0));g&&c.push(g)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.h&&(this.R.set(a,c),this.R.size>this.la&&(this.R.clear(),this.h=this.h/1.1|0));return c};function ja(a){a.Z=null;a.R.clear();a.W.clear()};async function ka(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(b=d.config)&&(d=b);(b=a.factory)?(Function("return "+b)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);postMessage({id:a.id});break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let la=0; k.length<=this.D&&(this.W.set(k,f),this.W.size>this.la&&(this.W.clear(),this.D=this.D/1.1|0));f&&b.push(f)}this.finalize&&(b=this.finalize(b)||b);this.cache&&a.length<=this.h&&(this.R.set(a,b),this.R.size>this.la&&(this.R.clear(),this.h=this.h/1.1|0));return b};function ja(a){a.Z=null;a.R.clear();a.W.clear()};async function ka(a){a=a.data;var c=self._index;const b=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(c=a.factory)?(Function("return "+c)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);postMessage({id:a.id});break;default:a=a.id,c=c[d].apply(c,b),postMessage("search"===d?{id:a,msg:c}:{id:a})}};let la=0;
function M(a={}){function b(g){function h(k){k=k.data||k;const l=k.id,m=l&&e.h[l];m&&(m(k.msg),delete e.h[l])}this.F=g;this.h=B();if(this.F){d?this.F.on("message",h):this.F.onmessage=h;if(a.config)return new Promise(function(k){e.h[++la]=function(){k(e)};e.F.postMessage({id:la,task:"init",factory:c,options:a})});this.F.postMessage({task:"init",factory:c,options:a});return this}}if(!this||this.constructor!==M)return new M(a);let c="undefined"!==typeof self?self._factory:"undefined"!==typeof window?window._factory: function M(a={}){function c(f){function k(h){h=h.data||h;const l=h.id,m=l&&e.h[l];m&&(m(h.msg),delete e.h[l])}this.F=f;this.h=C();if(this.F){d?this.F.on("message",k):this.F.onmessage=k;if(a.config)return new Promise(function(h){e.h[++la]=function(){h(e)};e.F.postMessage({id:la,task:"init",factory:b,options:a})});this.F.postMessage({task:"init",factory:b,options:a});return this}}if(!this||this.constructor!==M)return new M(a);let b="undefined"!==typeof self?self._factory:"undefined"!==typeof window?window._factory:
null;c&&(c=c.toString());const d="undefined"===typeof window,e=this,f=ma(c,d,a.F);return f.then?f.then(function(g){return b.call(e,g)}):b.call(this,f)}N("add");N("append");N("search");N("update");N("remove"); null;b&&(b=b.toString());const d="undefined"===typeof window,e=this,g=ma(b,d,a.F);return g.then?g.then(function(f){return c.call(e,f)}):c.call(this,g)}N("add");N("append");N("search");N("update");N("remove");
function N(a){M.prototype[a]=M.prototype[a+"Async"]=async function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;"function"===typeof d&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){b.h[++la]=f;b.F.postMessage({task:a,id:la,args:c})});return e?(d.then(e),this):d}} function N(a){M.prototype[a]=M.prototype[a+"Async"]=async function(){const c=this,b=[].slice.call(arguments);var d=b[b.length-1];let e;"function"===typeof d&&(e=d,b.splice(b.length-1,1));d=new Promise(function(g){c.h[++la]=g;c.F.postMessage({task:a,id:la,args:b})});return e?(d.then(e),this):d}}
function ma(a,b,c){return b?"undefined"!==typeof module?(0,eval)('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")'):(0,eval)('import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); })'):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+ka.toString()],{type:"text/javascript"}))):new window.Worker(G(c)?c:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js", function ma(a,c,b){return c?"undefined"!==typeof module?(0,eval)('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")'):(0,eval)('import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); })'):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+ka.toString()],{type:"text/javascript"}))):new window.Worker(G(b)?b:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js",
"module/worker/worker.js"),{type:"module"})};function na(a){O.call(a,"add");O.call(a,"append");O.call(a,"search");O.call(a,"update");O.call(a,"remove")}function O(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let d;"function"===typeof c&&(d=c,delete b[b.length-1]);b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function oa(a,b){b||(b=new Map);for(let c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b}function pa(a,b){b||(b=new Map);for(let c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],oa(d[1],e));return b}function qa(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b};function ra(a,b,c,d){let e=[];for(let f=0,g;f<a.index.length;f++)if(g=a.index[f],b>=g.length)b-=g.length;else{b=g[d?"splice":"slice"](b,c);const h=b.length;if(h&&(e=e.length?e.concat(b):b,c-=h,d&&(a.length-=h),!c))break;b=0}return e} "module/worker/worker.js"),{type:"module"})};function na(a){O.call(a,"add");O.call(a,"append");O.call(a,"search");O.call(a,"update");O.call(a,"remove")}function O(a){this[a+"Async"]=function(){var c=arguments;const b=c[c.length-1];let d;"function"===typeof b&&(d=b,delete c[c.length-1]);c=this[a].apply(this,c);d&&(c.then?c.then(d):d(c));return c}};function oa(a,c){c||(c=new Map);for(let b=0,d;b<a.length;b++)d=a[b],c.set(d[0],d[1]);return c}function pa(a,c){c||(c=new Map);for(let b=0,d,e;b<a.length;b++)d=a[b],e=c.get(d[0]),c.set(d[0],oa(d[1],e));return c}function qa(a,c){c||(c=new Set);for(let b=0;b<a.length;b++)c.add(a[b]);return c};function ra(a,c,b,d){let e=[];for(let g=0,f;g<a.index.length;g++)if(f=a.index[g],c>=f.length)c-=f.length;else{c=f[d?"splice":"slice"](c,b);const k=c.length;if(k&&(e=e.length?e.concat(c):c,b-=k,d&&(a.length-=k),!b))break;c=0}return e}
function P(a){if(!this)return new P(a);this.index=a?[a]:[];this.length=a?a.length:0;const b=this;return new Proxy([],{get(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){let f=0;for(let g=0,h,k;g<b.index.length;g++){h=b.index[g];k=h.indexOf(e);if(0<=k)return f+k;f+=h.length}return-1};if("includes"===d)return function(e){for(let f= function P(a){if(!this)return new P(a);this.index=a?[a]:[];this.length=a?a.length:0;const c=this;return new Proxy([],{get(b,d){if("length"===d)return c.length;if("push"===d)return function(e){c.index[c.index.length-1].push(e);c.length++};if("pop"===d)return function(){if(c.length)return c.length--,c.index[c.index.length-1].pop()};if("indexOf"===d)return function(e){let g=0;for(let f=0,k,h;f<c.index.length;f++){k=c.index[f];h=k.indexOf(e);if(0<=h)return g+h;g+=k.length}return-1};if("includes"===d)return function(e){for(let g=
0;f<b.index.length;f++)if(b.index[f].includes(e))return!0;return!1};if("slice"===d)return function(e,f){return ra(b,e||0,f||b.length,!1)};if("splice"===d)return function(e,f){return ra(b,e||0,f||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/2**31|0])&&c[d]},set(c,d,e){c=d/2**31|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}P.prototype.clear=function(){this.index.length=0};P.prototype.push=function(){}; 0;g<c.index.length;g++)if(c.index[g].includes(e))return!0;return!1};if("slice"===d)return function(e,g){return ra(c,e||0,g||c.length,!1)};if("splice"===d)return function(e,g){return ra(c,e||0,g||c.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(b=c.index[d/2**31|0])&&b[d]},set(b,d,e){b=d/2**31|0;(c.index[b]||(c.index[b]=[]))[d]=e;c.length++;return!0}})}P.prototype.clear=function(){this.index.length=0};P.prototype.push=function(){};
function Q(a=8){if(!this)return new Q(a);this.index=B();this.H=[];this.size=0;32<a?(this.h=sa,this.D=BigInt(a)):(this.h=ta,this.D=a)}Q.prototype.get=function(a){const b=this.index[this.h(a)];return b&&b.get(a)};Q.prototype.set=function(a,b){var c=this.h(a);let d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.H.push(d))};function R(a=8){if(!this)return new R(a);this.index=B();this.h=[];32<a?(this.H=sa,this.D=BigInt(a)):(this.H=ta,this.D=a)} function Q(a=8){if(!this)return new Q(a);this.index=C();this.G=[];this.size=0;32<a?(this.h=sa,this.D=BigInt(a)):(this.h=ta,this.D=a)}Q.prototype.get=function(a){const c=this.index[this.h(a)];return c&&c.get(a)};Q.prototype.set=function(a,c){var b=this.h(a);let d=this.index[b];d?(b=d.size,d.set(a,c),(b-=d.size)&&this.size++):(this.index[b]=d=new Map([[a,c]]),this.G.push(d))};function R(a=8){if(!this)return new R(a);this.index=C();this.h=[];32<a?(this.G=sa,this.D=BigInt(a)):(this.G=ta,this.D=a)}
R.prototype.add=function(a){var b=this.H(a);let c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};y=Q.prototype;y.has=R.prototype.has=function(a){const b=this.index[this.H(a)];return b&&b.has(a)};y.delete=R.prototype.delete=function(a){const b=this.index[this.H(a)];b&&b.delete(a)&&this.size--};y.clear=R.prototype.clear=function(){this.index=B();this.h=[];this.size=0};y.values=R.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].values())yield b}; R.prototype.add=function(a){var c=this.G(a);let b=this.index[c];b?(c=b.size,b.add(a),(c-=b.size)&&this.size++):(this.index[c]=b=new Set([a]),this.h.push(b))};A=Q.prototype;A.has=R.prototype.has=function(a){const c=this.index[this.G(a)];return c&&c.has(a)};A.delete=R.prototype.delete=function(a){const c=this.index[this.G(a)];c&&c.delete(a)&&this.size--};A.clear=R.prototype.clear=function(){this.index=C();this.h=[];this.size=0};A.values=R.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].values())yield c};
y.keys=R.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].keys())yield b};y.entries=R.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].entries())yield b};function ta(a){let b=2**this.D-1;if("number"==typeof a)return a&b;let c=0,d=this.D+1;for(let e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.D?c+2**31:c} A.keys=R.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].keys())yield c};A.entries=R.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].entries())yield c};function ta(a){let c=2**this.D-1;if("number"==typeof a)return a&c;let b=0,d=this.D+1;for(let e=0;e<a.length;e++)b=(b*d^a.charCodeAt(e))&c;return 32===this.D?b+2**31:b}
function sa(a){let b=BigInt(2)**this.D-BigInt(1);var c=typeof a;if("bigint"===c)return a&b;if("number"===c)return BigInt(a)&b;c=BigInt(0);let d=this.D+BigInt(1);for(let e=0;e<a.length;e++)c=(c*d^BigInt(a.charCodeAt(e)))&b;return c};S.prototype.add=function(a,b,c){H(a)&&(b=a,a=J(b,this.key));if(b&&(a||0===a)){if(!c&&this.B.has(a))return this.update(a,b);for(let h=0,k;h<this.A.length;h++){k=this.N[h];var d=this.index.get(this.A[h]);if("function"===typeof k){var e=k(b);e&&d.add(a,e,!1,!0)}else if(e=k.V,!e||e(b))k.constructor===String?k=[""+k]:G(k)&&(k=[k]),ua(b,k,this.X,0,d,a,k[0],c)}if(this.tag)for(d=0;d<this.P.length;d++){var f=this.P[d],g=this.ba[d];e=this.tag.get(g);let h=B();if("function"===typeof f){if(f=f(b),!f)continue}else{const k= function sa(a){let c=BigInt(2)**this.D-BigInt(1);var b=typeof a;if("bigint"===b)return a&c;if("number"===b)return BigInt(a)&c;b=BigInt(0);let d=this.D+BigInt(1);for(let e=0;e<a.length;e++)b=(b*d^BigInt(a.charCodeAt(e)))&c;return b};S.prototype.add=function(a,c,b){H(a)&&(c=a,a=J(c,this.key));if(c&&(a||0===a)){if(!b&&this.B.has(a))return this.update(a,c);for(let k=0,h;k<this.A.length;k++){h=this.M[k];var d=this.index.get(this.A[k]);if("function"===typeof h){var e=h(c);e&&d.add(a,e,!1,!0)}else if(e=h.V,!e||e(c))h.constructor===String?h=[""+h]:G(h)&&(h=[h]),ua(c,h,this.X,0,d,a,h[0],b)}if(this.tag)for(d=0;d<this.P.length;d++){var g=this.P[d],f=this.ba[d];e=this.tag.get(f);let k=C();if("function"===typeof g){if(g=g(c),!g)continue}else{const h=
f.V;if(k&&!k(b))continue;f.constructor===String&&(f=""+f);f=J(b,f)}if(e&&f){G(f)&&(f=[f]);for(let k=0,l,m;k<f.length;k++)if(l=f[k],!h[l]&&(h[l]=1,(g=e.get(l))?m=g:e.set(l,m=[]),!c||!m.includes(a))){if(m.length===2**31-1){g=new P(m);if(this.C)for(let r of this.B.values())r.includes(m)&&(r[r.indexOf(m)]=g);e.set(l,m=g)}m.push(a);this.C&&((g=this.B.get(a))?g.push(m):this.B.set(a,[m]))}}else e||console.warn("Tag '"+g+"' was not found")}if(this.store&&(!c||!this.store.has(a))){let h;if(this.M){h=B();for(let k= g.V;if(h&&!h(c))continue;g.constructor===String&&(g=""+g);g=J(c,g)}if(e&&g){G(g)&&(g=[g]);for(let h=0,l,m;h<g.length;h++)if(l=g[h],!k[l]&&(k[l]=1,(f=e.get(l))?m=f:e.set(l,m=[]),!b||!m.includes(a))){if(m.length===2**31-1){f=new P(m);if(this.C)for(let u of this.B.values())u.includes(m)&&(u[u.indexOf(m)]=f);e.set(l,m=f)}m.push(a);this.C&&((f=this.B.get(a))?f.push(m):this.B.set(a,[m]))}}else e||console.warn("Tag '"+f+"' was not found")}if(this.store&&(!b||!this.store.has(a))){let k;if(this.L){k=C();for(let h=
0,l;k<this.M.length;k++){l=this.M[k];if((c=l.V)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.oa]}else if(G(l)||l.constructor===String){h[l]=b[l];continue}va(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function va(a,b,c,d,e,f){a=a[e];if(d===c.length-1)b[e]=f||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)va(a,b,c,d,e);else b=b[e]||(b[e]=B()),e=c[++d],va(a,b,c,d,e)} 0,l;h<this.L.length;h++){l=this.L[h];if((b=l.V)&&!b(c))continue;let m;if("function"===typeof l){m=l(c);if(!m)continue;l=[l.oa]}else if(G(l)||l.constructor===String){k[l]=c[l];continue}va(c,k,l,0,l[0],m)}}this.store.set(a,k||c)}}return this};function va(a,c,b,d,e,g){a=a[e];if(d===b.length-1)c[e]=g||a;else if(a)if(a.constructor===Array)for(c=c[e]=Array(a.length),e=0;e<a.length;e++)va(a,c,b,d,e);else c=c[e]||(c[e]=C()),e=b[++d],va(a,c,b,d,e)}
function ua(a,b,c,d,e,f,g,h){if(a=a[g])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)ua(a,b,c,d,e,f,g,h);else g=b[++d],ua(a,b,c,d,e,f,g,h);else e.db&&e.remove(f)};function wa(a,b,c,d,e,f,g){const h=a.length;let k=[],l;var m;l=B();for(let r=0,n,p,t,q;r<b;r++)for(let u=0;u<h;u++)if(t=a[u],r<t.length&&(n=t[r]))for(let w=0;w<n.length;w++)p=n[w],(m=l[p])?l[p]++:(m=0,l[p]=1),q=k[m]||(k[m]=[]),g||(m=r+(u?0:f||0),q=q[m]||(q[m]=[])),q.push(p);if(a=k.length)if(e)k=1<k.length?xa(k,d,c,g,0):(k=k[0]).length>c||d?k.slice(d,c+d):k;else{if(a<h)return[];k=k[a-1];if(c||d)if(g){if(k.length>c||d)k=k.slice(d,c+d)}else{e=[];for(let r=0,n;r<k.length;r++)if(n=k[r],n.length>d)d-=n.length; function ua(a,c,b,d,e,g,f,k){if(a=a[f])if(d===c.length-1){if(a.constructor===Array){if(b[d]){for(c=0;c<a.length;c++)e.add(g,a[c],!0,!0);return}a=a.join(" ")}e.add(g,a,k,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)ua(a,c,b,d,e,g,f,k);else f=c[++d],ua(a,c,b,d,e,g,f,k);else e.db&&e.remove(g)};function wa(a,c,b,d,e,g,f){const k=a.length;let h=[],l;var m;l=C();for(let u=0,n,p,t,q;u<c;u++)for(let v=0;v<k;v++)if(t=a[v],u<t.length&&(n=t[u]))for(let w=0;w<n.length;w++)p=n[w],(m=l[p])?l[p]++:(m=0,l[p]=1),q=h[m]||(h[m]=[]),f||(m=u+(v?0:g||0),q=q[m]||(q[m]=[])),q.push(p);if(a=h.length)if(e)h=1<h.length?xa(h,d,b,f,0):(h=h[0]).length>b||d?h.slice(d,b+d):h;else{if(a<k)return[];h=h[a-1];if(b||d)if(f){if(h.length>b||d)h=h.slice(d,b+d)}else{e=[];for(let u=0,n;u<h.length;u++)if(n=h[u],n.length>d)d-=n.length;
else{if(n.length>c||d)n=n.slice(d,c+d),c-=n.length,d&&(d-=n.length);e.push(n);if(!c)break}k=1<e.length?[].concat.apply([],e):e[0]}}return k} else{if(n.length>b||d)n=n.slice(d,b+d),b-=n.length,d&&(d-=n.length);e.push(n);if(!b)break}h=1<e.length?[].concat.apply([],e):e[0]}}return h}
function xa(a,b,c,d,e){const f=[],g=B();let h;var k=a.length;let l,m=0;if(d)for(e=k-1;0<=e;e--)for(d=a[e],l=d.length,k=0;k<l;k++){if(h=d[k],!g[h])if(g[h]=1,b)b--;else if(f.push(h),f.length===c)return f}else{let r=ba(a);for(let n=0;n<r;n++)for(let p=k-1;0<=p;p--)if(l=(d=a[p][n])&&d.length)for(let t=0;t<l;t++)if(h=d[t],!g[h])if(g[h]=1,b)b--;else{let q=n+(p<k-1?e||0:0);(f[q]||(f[q]=[])).push(h);if(++m===c)return f}}return f} function xa(a,c,b,d,e){const g=[],f=C();let k;var h=a.length;let l,m=0;if(d)for(e=h-1;0<=e;e--)for(d=a[e],l=d.length,h=0;h<l;h++){if(k=d[h],!f[k])if(f[k]=1,c)c--;else if(g.push(k),g.length===b)return g}else{let u=ba(a);for(let n=0;n<u;n++)for(let p=h-1;0<=p;p--)if(l=(d=a[p][n])&&d.length)for(let t=0;t<l;t++)if(k=d[t],!f[k])if(f[k]=1,c)c--;else{let q=n+(p<h-1?e||0:0);(g[q]||(g[q]=[])).push(k);if(++m===b)return g}}return g}
function ya(a,b){const c=B(),d=[];for(let e=0,f;e<b.length;e++){f=b[e];for(let g=0;g<f.length;g++)c[f[g]]=1}for(let e=0,f;e<a.length;e++)f=a[e],1===c[f]&&(d.push(f),c[f]=2);return d};S.prototype.search=function(a,b,c,d){c||(!b&&H(a)?(c=a,a=""):H(b)&&(c=b,b=0));let e=[],f=[],g;let h;let k;let l,m=0,r;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;g=c.Da;h=c.Ca;k=g||c.A||c.index;var n=this.tag&&c.tag;var p=this.store&&c.I;var t=c.ka;r=c.pa;b=c.J||b;l=c.offset||0;b||(b=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var q=[];for(let x=0,v;x<n.length;x++){v=n[x];if(G(v))throw Error("A tag option can't be a string, instead it needs a { field: tag } format.");if(v.A&& function ya(a,c){const b=C(),d=[];for(let e=0,g;e<c.length;e++){g=c[e];for(let f=0;f<g.length;f++)b[g[f]]=1}for(let e=0,g;e<a.length;e++)g=a[e],1===b[g]&&(d.push(g),b[g]=2);return d};S.prototype.search=function(a,c,b,d){b||(!c&&H(a)?(b=a,a=""):H(c)&&(b=c,c=0));let e=[],g=[],f;let k;let h;let l,m=0,u;if(b){b.constructor===Array&&(b={index:b});a=b.query||a;f=b.Da;k=b.Ca;h=f||b.A||b.index;var n=this.tag&&b.tag;var p=this.store&&b.H;var t=b.ka;u=b.pa;c=b.I||c;l=b.offset||0;c||(c=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var q=[];for(let x=0,r;x<n.length;x++){r=n[x];if(G(r))throw Error("A tag option can't be a string, instead it needs a { field: tag } format.");if(r.A&&
v.tag){var u=v.tag;if(u.constructor===Array)for(var w=0;w<u.length;w++)q.push(v.A,u[w]);else q.push(v.A,u)}else{u=Object.keys(v);for(let A=0,I,C;A<u.length;A++)if(I=u[A],C=v[I],C.constructor===Array)for(w=0;w<C.length;w++)q.push(I,C[w]);else q.push(I,C)}}if(!q.length)throw Error("Your tag definition within the search options is probably wrong. No valid tags found.");n=q;if(!a){t=[];if(q.length)for(n=0;n<q.length;n+=2){if(this.db){d=this.index.get(q[n]);if(!d){console.warn("Tag '"+q[n]+":"+q[n+1]+ r.tag){var v=r.tag;if(v.constructor===Array)for(var w=0;w<v.length;w++)q.push(r.A,v[w]);else q.push(r.A,v)}else{v=Object.keys(r);for(let y=0,I,D;y<v.length;y++)if(I=v[y],D=r[I],D.constructor===Array)for(w=0;w<D.length;w++)q.push(I,D[w]);else q.push(I,D)}}if(!q.length)throw Error("Your tag definition within the search options is probably wrong. No valid tags found.");n=q;if(!a){t=[];if(q.length)for(n=0;n<q.length;n+=2){if(this.db){d=this.index.get(q[n]);if(!d){console.warn("Tag '"+q[n]+":"+q[n+1]+
"' will be skipped because there is no field '"+q[n]+"'.");continue}t.push(d=d.db.tag(q[n+1],b,l,p))}else d=za.call(this,q[n],q[n+1],b,l,p);e.push({field:q[n],tag:q[n+1],result:d})}return t.length?Promise.all(t).then(function(x){for(let v=0;v<x.length;v++)e[v].result=x[v];return e}):e}}G(k)&&(k=[k])}k||(k=this.A);q=!d&&(this.F||this.db)&&[];let D;for(let x=0,v,A,I;x<k.length;x++){A=k[x];if(this.db&&this.tag&&!this.N[x])continue;let C;G(A)||(C=A,A=C.A,a=C.query||a,b=C.J||b,l=C.offset||l,t=C.ka||t, "' will be skipped because there is no field '"+q[n]+"'.");continue}t.push(d=d.db.tag(q[n+1],c,l,p))}else d=za.call(this,q[n],q[n+1],c,l,p);e.push({field:q[n],tag:q[n+1],result:d})}return t.length?Promise.all(t).then(function(x){for(let r=0;r<x.length;r++)e[r].result=x[r];return e}):e}}G(h)&&(h=[h])}h||(h=this.A);q=!d&&(this.F||this.db)&&[];let z;for(let x=0,r,y,I;x<h.length;x++){y=h[x];if(this.db&&this.tag&&!this.M[x])continue;let D;G(y)||(D=y,y=D.A,a=D.query||a,c=D.I||c,l=D.offset||l,t=D.ka||t,
p=this.store&&(C.I||p));if(d)v=d[x];else if(u=C||c,w=this.index.get(A),n&&(this.db&&(u.tag=n,D=w.db.Ea,u.A=k),D||(u.I=!1)),q){q[x]=w.search(a,b,u);u&&p&&(u.I=p);continue}else v=w.search(a,b,u),u&&p&&(u.I=p);I=v&&v.length;if(n&&I){u=[];w=0;if(this.db&&d){if(!D)for(let E=k.length;E<d.length;E++){let F=d[E];if(F&&F.length)w++,u.push(F);else if(!t)return e}}else for(let E=0,F,Za;E<n.length;E+=2){F=this.tag.get(n[E]);if(!F)if(console.warn("Tag '"+n[E]+":"+n[E+1]+"' will be skipped because there is no field '"+ p=this.store&&(D.H||p));if(d)r=d[x];else if(v=D||b,w=this.index.get(y),n&&(this.db&&(v.tag=n,z=w.db.Fa,v.A=h),z||(v.H=!1)),q){q[x]=w.search(a,c,v);v&&p&&(v.H=p);continue}else r=w.search(a,c,v),v&&p&&(v.H=p);I=r&&r.length;if(n&&I){v=[];w=0;if(this.db&&d){if(!z)for(let E=h.length;E<d.length;E++){let F=d[E];if(F&&F.length)w++,v.push(F);else if(!t)return e}}else for(let E=0,F,Za;E<n.length;E+=2){F=this.tag.get(n[E]);if(!F)if(console.warn("Tag '"+n[E]+":"+n[E+1]+"' will be skipped because there is no field '"+
n[E]+"'."),t)continue;else return e;if(Za=(F=F&&F.get(n[E+1]))&&F.length)w++,u.push(F);else if(!t)return e}if(w){v=ya(v,u);I=v.length;if(!I&&!t)return e;w--}}if(I)f[m]=A,e.push(v),m++;else if(1===k.length)return e}if(q){if(this.db&&n&&n.length&&!D)for(p=0;p<n.length;p+=2){d=this.index.get(n[p]);if(!d)if(console.warn("Tag '"+n[p]+":"+n[p+1]+"' was not found because there is no field '"+n[p]+"'."),t)continue;else return e;q.push(d.db.tag(n[p+1],b,l,!1))}const x=this;return Promise.all(q).then(function(v){return v.length? n[E]+"'."),t)continue;else return e;if(Za=(F=F&&F.get(n[E+1]))&&F.length)w++,v.push(F);else if(!t)return e}if(w){r=ya(r,v);I=r.length;if(!I&&!t)return e;w--}}if(I)g[m]=y,e.push(r),m++;else if(1===h.length)return e}if(q){if(this.db&&n&&n.length&&!z)for(p=0;p<n.length;p+=2){d=this.index.get(n[p]);if(!d)if(console.warn("Tag '"+n[p]+":"+n[p+1]+"' was not found because there is no field '"+n[p]+"'."),t)continue;else return e;q.push(d.db.tag(n[p+1],c,l,!1))}const x=this;return Promise.all(q).then(function(r){return r.length?
x.search(a,b,c,v):v})}if(!m)return e;if(g&&(!p||!this.store))return e[0];q=[];for(let x=0,v;x<f.length;x++){v=e[x];p&&v.length&&!v[0].ha&&(this.db?q.push(v=this.index.get(this.A[0]).db.I(v)):v.length&&(v=Aa.call(this,v)));if(g)return v;e[x]={field:f[x],result:v}}if(p&&this.db&&q.length){const x=this;return Promise.all(q).then(function(v){for(let A=0;A<v.length;A++)e[A].result=v[A];return h?Ba(e,b):r?Ca(e,a,x.index,x.A,x.N,r):e})}return h?Ba(e,b):r?Ca(e,a,this.index,this.A,this.N,r):e}; x.search(a,c,b,r):r})}if(!m)return e;if(f&&(!p||!this.store))return e[0];q=[];for(let x=0,r;x<g.length;x++){r=e[x];p&&r.length&&!r[0].ha&&(this.db?q.push(r=this.index.get(this.A[0]).db.H(r)):r.length&&(r=Aa.call(this,r)));if(f)return r;e[x]={field:g[x],result:r}}if(p&&this.db&&q.length){const x=this;return Promise.all(q).then(function(r){for(let y=0;y<r.length;y++)e[y].result=r[y];return k?Ba(e,c):u?Ca(e,a,x.index,x.A,x.M,u):e})}return k?Ba(e,c):u?Ca(e,a,this.index,this.A,this.M,u):e};
function Ca(a,b,c,d,e,f){let g,h,k;for(let m=0,r,n,p,t,q;m<a.length;m++){r=a[m].result;n=a[m].A;t=c.get(n);p=t.U;k=t.ca;q=e[d.indexOf(n)];p!==g&&(g=p,h=g.encode(b));for(let u=0;u<r.length;u++){let w="";var l=J(r[u].ha,q);let D=g.encode(l);l=l.split(g.split);for(let x=0,v,A;x<D.length;x++){v=D[x];A=l[x];let I;for(let C=0,E;C<h.length;C++)if(E=h[C],"strict"===k){if(v===E){w+=(w?" ":"")+f.replace("$1",A);I=!0;break}}else{const F=v.indexOf(E);if(-1<F){w+=(w?" ":"")+A.substring(0,F)+f.replace("$1",A.substring(F, function Ca(a,c,b,d,e,g){let f,k,h;for(let m=0,u,n,p,t,q;m<a.length;m++){u=a[m].result;n=a[m].A;t=b.get(n);p=t.U;h=t.ca;q=e[d.indexOf(n)];p!==f&&(f=p,k=f.encode(c));for(let v=0;v<u.length;v++){let w="";var l=J(u[v].ha,q);let z=f.encode(l);l=l.split(f.split);for(let x=0,r,y;x<z.length;x++){r=z[x];y=l[x];let I;for(let D=0,E;D<k.length;D++)if(E=k[D],"strict"===h){if(r===E){w+=(w?" ":"")+g.replace("$1",y);I=!0;break}}else{const F=r.indexOf(E);if(-1<F){w+=(w?" ":"")+y.substring(0,F)+g.replace("$1",y.substring(F,
E.length))+A.substring(F+E.length);I=!0;break}}I||(w+=(w?" ":"")+l[x])}r[u].pa=w}}return a}function Ba(a,b){const c=[],d=B();for(let e=0,f,g;e<a.length;e++){f=a[e];g=f.result;for(let h=0,k,l,m;h<g.length;h++)if(l=g[h],k=l.id,m=d[k])m.push(f.A);else{if(c.length===b)return c;l.A=d[k]=[f.A];c.push(l)}}return c} E.length))+y.substring(F+E.length);I=!0;break}}I||(w+=(w?" ":"")+l[x])}u[v].pa=w}}return a}function Ba(a,c){const b=[],d=C();for(let e=0,g,f;e<a.length;e++){g=a[e];f=g.result;for(let k=0,h,l,m;k<f.length;k++)if(l=f[k],h=l.id,m=d[h])m.push(g.A);else{if(b.length===c)return b;l.A=d[h]=[g.A];b.push(l)}}return b}
function za(a,b,c,d,e){let f=this.tag.get(a);if(!f)return console.warn("Tag '"+a+"' was not found"),[];if((a=(f=f&&f.get(b))&&f.length-d)&&0<a){if(a>c||d)f=f.slice(d,d+c);e&&(f=Aa.call(this,f));return f}}function Aa(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function S(a){if(!this||this.constructor!==S)return new S(a);const b=a.document||a.ha||a;let c,d;this.N=[];this.A=[];this.X=[];this.key=(c=b.key||b.id)&&Da(c,this.X)||"id";(d=a.ia||0)&&(this.ia=d);this.B=(this.C=!!a.C)?d?new Q(d):new Map:d?new R(d):new Set;this.M=(c=b.store||null)&&!0!==c&&[];this.store=c&&(d?new Q(d):new Map);this.cache=(c=a.cache||null)&&new T(c);a.cache=!1;this.F=a.F;this.index=Ea.call(this,a,b);this.tag=null;if(c=b.tag)if("string"===typeof c&&(c=[c]),c.length){this.tag=new Map; function za(a,c,b,d,e){let g=this.tag.get(a);if(!g)return console.warn("Tag '"+a+"' was not found"),[];if((a=(g=g&&g.get(c))&&g.length-d)&&0<a){if(a>b||d)g=g.slice(d,d+b);e&&(g=Aa.call(this,g));return g}}function Aa(a){const c=Array(a.length);for(let b=0,d;b<a.length;b++)d=a[b],c[b]={id:d,doc:this.store.get(d)};return c};function S(a){if(!this||this.constructor!==S)return new S(a);const c=a.document||a.ha||a;let b,d;this.M=[];this.A=[];this.X=[];this.key=(b=c.key||c.id)&&Da(b,this.X)||"id";(d=a.ia||0)&&(this.ia=d);this.B=(this.C=!!a.C)?d?new Q(d):new Map:d?new R(d):new Set;this.L=(b=c.store||null)&&b&&!0!==b&&[];this.store=b&&(d?new Q(d):new Map);this.cache=(b=a.cache||null)&&new T(b);a.cache=!1;this.F=a.F;this.index=Ea.call(this,a,c);this.tag=null;if(b=c.tag)if("string"===typeof b&&(b=[b]),b.length){this.tag=new Map;
this.P=[];this.ba=[];for(let e=0,f,g;e<c.length;e++){f=c[e];g=f.A||f;if(!g)throw Error("The tag field from the document descriptor is undefined.");f.T?this.P[e]=f.T:(this.P[e]=Da(g,this.X),f.filter&&("string"===typeof this.P[e]&&(this.P[e]=new String(this.P[e])),this.P[e].V=f.filter));this.ba[e]=g;this.tag.set(g,new Map)}}if(this.F){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(f){let g=0;for(const h of e.index.entries()){const k= this.P=[];this.ba=[];for(let e=0,g,f;e<b.length;e++){g=b[e];f=g.A||g;if(!f)throw Error("The tag field from the document descriptor is undefined.");g.T?this.P[e]=g.T:(this.P[e]=Da(f,this.X),g.filter&&("string"===typeof this.P[e]&&(this.P[e]=new String(this.P[e])),this.P[e].V=g.filter));this.ba[e]=f;this.tag.set(f,new Map)}}if(this.F){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(g){let f=0;for(const k of e.index.entries()){const h=
h[0];h[1].then&&e.index.set(k,f[g++])}return e})}}else a.db&&this.Y(a.db)}y=S.prototype; k[0];k[1].then&&e.index.set(h,g[f++])}return e})}}else a.db&&this.Y(a.db)}A=S.prototype;
y.Y=function(a){let b=this.A;if(this.tag)for(let e=0,f;e<this.ba.length;e++){f=this.ba[e];var c=void 0;this.index.set(f,c=new L({},this.B));b===this.A&&(b=b.slice(0));b.push(f);c.tag=this.tag.get(f)}c=[];const d={db:a.db,type:a.type,C:a.C};for(let e=0,f,g;e<b.length;e++){d.A=g=b[e];f=this.index.get(g);const h=new a.constructor(a.id,d);h.id=a.id;c[e]=h.Y(f);f.document=!0;e?f.Aa=!0:f.store=this.store}this.db=!0;return Promise.all(c)}; A.Y=function(a){let c=this.A;if(this.tag)for(let e=0,g;e<this.ba.length;e++){g=this.ba[e];var b=void 0;this.index.set(g,b=new L({},this.B));c===this.A&&(c=c.slice(0));c.push(g);b.tag=this.tag.get(g)}b=[];const d={db:a.db,type:a.type,C:a.C};for(let e=0,g,f;e<c.length;e++){d.A=f=c[e];g=this.index.get(f);const k=new a.constructor(a.id,d);k.id=a.id;b[e]=k.Y(g);g.document=!0;e?g.Aa=!0:g.store=this.store}this.db=!0;return Promise.all(b)};
y.commit=async function(a,b){const c=[];for(const d of this.index.values())c.push(d.db.commit(d,a,b));await Promise.all(c);this.B.clear()}; A.commit=async function(a,c){const b=[];for(const d of this.index.values())b.push(d.db.commit(d,a,c));await Promise.all(b);this.B.clear()};
function Ea(a,b){const c=new Map;let d=b.index||b.A||b;G(d)&&(d=[d]);for(let e=0,f,g;e<d.length;e++){f=d[e];G(f)||(g=f,f=f.A);g=H(g)?Object.assign({},a,g):a;if(this.F){const h=new M(g);c.set(f,h)}this.F||c.set(f,new L(g,this.B));g.T?this.N[e]=g.T:(this.N[e]=Da(f,this.X),g.filter&&("string"===typeof this.N[e]&&(this.N[e]=new String(this.N[e])),this.N[e].V=g.filter));this.A[e]=f}if(this.M){a=b.store;G(a)&&(a=[a]);for(let e=0,f,g;e<a.length;e++)f=a[e],g=f.A||f,f.T?(this.M[e]=f.T,f.T.oa=g):(this.M[e]= function Ea(a,c){const b=new Map;let d=c.index||c.A||c;G(d)&&(d=[d]);for(let e=0,g,f;e<d.length;e++){g=d[e];G(g)||(f=g,g=g.A);f=H(f)?Object.assign({},a,f):a;if(this.F){const k=new M(f);b.set(g,k)}this.F||b.set(g,new L(f,this.B));f.T?this.M[e]=f.T:(this.M[e]=Da(g,this.X),f.filter&&("string"===typeof this.M[e]&&(this.M[e]=new String(this.M[e])),this.M[e].V=f.filter));this.A[e]=g}if(this.L){a=c.store;G(a)&&(a=[a]);for(let e=0,g,f;e<a.length;e++)g=a[e],f=g.A||g,g.T?(this.L[e]=g.T,g.T.oa=f):(this.L[e]=
Da(g,this.X),f.filter&&("string"===typeof this.M[e]&&(this.M[e]=new String(this.M[e])),this.M[e].V=f.filter))}return c}function Da(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}y.update=function(a,b){return this.remove(a).add(a,b)}; Da(f,this.X),g.filter&&("string"===typeof this.L[e]&&(this.L[e]=new String(this.L[e])),this.L[e].V=g.filter))}return b}function Da(a,c){const b=a.split(":");let d=0;for(let e=0;e<b.length;e++)a=b[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(c[d]=!0),a&&(b[d++]=a);d<b.length&&(b.length=d);return 1<d?b:b[0]}A.update=function(a,c){return this.remove(a).add(a,c)};
y.remove=function(a){H(a)&&(a=J(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.B.has(a)){if(this.tag&&!this.C)for(let c of this.tag.values())for(let d of c){b=d[0];const e=d[1],f=e.indexOf(a);-1<f&&(1<e.length?e.splice(f,1):c.delete(b))}this.store&&this.store.delete(a);this.B.delete(a)}this.cache&&this.cache.remove(a);return this}; A.remove=function(a){H(a)&&(a=J(a,this.key));for(var c of this.index.values())c.remove(a,!0);if(this.B.has(a)){if(this.tag&&!this.C)for(let b of this.tag.values())for(let d of b){c=d[0];const e=d[1],g=e.indexOf(a);-1<g&&(1<e.length?e.splice(g,1):b.delete(c))}this.store&&this.store.delete(a);this.B.delete(a)}this.cache&&this.cache.remove(a);return this};
y.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};y.get=function(a){return this.db?this.index.get(this.A[0]).db.I(a).then(function(b){return b[0]&&b[0].ha}):this.store.get(a)};y.set=function(a,b){this.store.set(a,b);return this}; A.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};A.get=function(a){return this.db?this.index.get(this.A[0]).db.H(a).then(function(c){return c[0]&&c[0].ha}):this.store.get(a)};A.set=function(a,c){this.store.set(a,c);return this};
y.import=function(a,b){if(b){G(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.C=!1;this.B=qa(b,this.B);for(let d=0,e;d<this.A.length;d++)e=this.index.get(this.A[d]),e.C=!1,e.B=this.B;break;case "tag":this.tag=pa(b,this.tag);break;case "doc":this.store=oa(b,this.store)}}};na(S.prototype);function T(a){this.J=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}T.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.J&&this.cache.delete(this.cache.keys().next().value)};T.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};T.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};T.prototype.clear=function(){this.cache.clear();this.h=""};const Fa={normalize:function(a){return a.toLowerCase()},dedupe:!1};const Ga=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Ha=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Ia=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Ja={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Ka=/[\x00-\x7F]+/g;const La=/[\x00-\x7F]+/g;const Ma=/[\x00-\x7F]+/g;var Na={wa:{normalize:!1,dedupe:!1},va:Fa,ya:{normalize:!0,dedupe:!0},ua:{normalize:!0,dedupe:!0,mapper:Ga},ta:{normalize:!0,dedupe:!0,mapper:Ga,matcher:Ha,replacer:Ia},xa:{normalize:!0,dedupe:!0,mapper:Ga,replacer:Ia.concat([/(?!^)[aeo]/g,""]),matcher:Ha},za:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let d=b.charAt(0),e=Ja[d];for(let f=1,g;f<b.length&&(g=b.charAt(f),"h"===g||"w"===g||!(g=Ja[g])||g===e||(d+=g,e=g,4!==d.length));f++);a[c]= A.import=function(a,c){if(c){G(c)&&(c=JSON.parse(c));a=a.split(".");"json"===a[a.length-1]&&a.pop();var b=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(b)return this.index.get(b).import(a,c);switch(a){case "reg":this.C=!1;this.B=qa(c,this.B);for(let d=0,e;d<this.A.length;d++)e=this.index.get(this.A[d]),e.C=!1,e.B=this.B;break;case "tag":this.tag=pa(c,this.tag);break;case "doc":this.store=oa(c,this.store)}}};na(S.prototype);function T(a){this.I=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}T.prototype.set=function(a,c){this.cache.set(this.h=a,c);this.cache.size>this.I&&this.cache.delete(this.cache.keys().next().value)};T.prototype.get=function(a){const c=this.cache.get(a);c&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,c));return c};T.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b)}};T.prototype.clear=function(){this.cache.clear();this.h=""};const Fa={normalize:function(a){return a.toLowerCase()},dedupe:!1};const Ga=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Ha=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Ia=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Ja={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Ka=/[\x00-\x7F]+/g;const La=/[\x00-\x7F]+/g;const Ma=/[\x00-\x7F]+/g;var Na={wa:{normalize:!1,dedupe:!1},va:Fa,ya:{normalize:!0,dedupe:!0},ua:{normalize:!0,dedupe:!0,mapper:Ga},ta:{normalize:!0,dedupe:!0,mapper:Ga,matcher:Ha,replacer:Ia},xa:{normalize:!0,dedupe:!0,mapper:Ga,replacer:Ia.concat([/(?!^)[aeo]/g,""]),matcher:Ha},za:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let b=0;b<a.length;b++){var c=a[b];let d=c.charAt(0),e=Ja[d];for(let g=1,f;g<c.length&&(f=c.charAt(g),"h"===f||"w"===f||!(f=Ja[f])||f===e||(d+=f,e=f,4!==d.length));g++);a[b]=
d}}},qa:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ka," ")}},ra:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(La,"")}},sa:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ma," ")}}};const Oa={memory:{G:1},performance:{G:6,C:!0,context:{depth:1,G:3}},match:{ca:"forward"},score:{G:9,context:{depth:2,G:9}}};const Pa=B();let U,Qa;const V=new Map;function Ra(a){if(Qa){if(V.has(a))return V.get(a)}else Qa=setTimeout(Sa);if("number"==typeof a)var b=a;else{var c=2**32-1;if("number"==typeof a)b=a&c;else{b=0;for(var d=0;d<a.length;d++)b=(33*b^a.charCodeAt(d))&c;b+=2**31}}if(!U){U=Array(255);for(c=0;255>c;c++)U[c]=c+1;U=String.fromCharCode.apply(null,U)}c=b;for(d="";b=c%255,d=U.charAt(b)+d,c=c/255|0,c;);b=d;2E5<V.size&&V.clear();V.set(a,b);return b}function Sa(){Qa=null;V.clear()};L.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.B.has(a))return this.update(a,b);b=this.U.encode(b);if(d=b.length){const l=B(),m=B(),r=this.depth,n=this.G;for(let p=0;p<d;p++){let t=b[this.rtl?d-1-p:p];var e=t.length;if(e&&(r||!m[t])){var f=this.L?this.L(b,t,p,null,0):Ta(n,d,p),g="";switch(this.ca){case "full":if(2<e){for(f=0;f<e;f++)for(var h=e;h>f;h--){g=t.substring(f,h);var k=this.L?this.L(b,t,p,g,f):Ta(n,d,p,e,f);W(this,m,g,k,a,c)}break}case "reverse":if(1<e){for(h=e-1;0<h;h--)g= d}}},qa:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ka," ")}},ra:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(La,"")}},sa:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ma," ")}}};const Oa={memory:{K:1},performance:{K:6,C:!0,context:{depth:1,K:3}},match:{ca:"forward"},score:{K:9,context:{depth:2,K:9}}};const Pa=C();let U,Qa;const V=new Map;function Ra(a){if(Qa){if(V.has(a))return V.get(a)}else Qa=setTimeout(Sa);if("number"==typeof a)var c=a;else{var b=2**32-1;if("number"==typeof a)c=a&b;else{c=0;for(var d=0;d<a.length;d++)c=(33*c^a.charCodeAt(d))&b;c+=2**31}}if(!U){U=Array(255);for(b=0;255>b;b++)U[b]=b+1;U=String.fromCharCode.apply(null,U)}b=c;for(d="";c=b%255,d=U.charAt(c)+d,b=b/255|0,b;);c=d;2E5<V.size&&V.clear();V.set(a,c);return c}function Sa(){Qa=null;V.clear()};L.prototype.add=function(a,c,b,d){if(c&&(a||0===a)){if(!d&&!b&&this.B.has(a))return this.update(a,c);c=this.U.encode(c);if(d=c.length){const l=C(),m=C(),u=this.depth,n=this.K;for(let p=0;p<d;p++){let t=c[this.rtl?d-1-p:p];var e=t.length;if(e&&(u||!m[t])){var g=this.O?this.O(c,t,p,null,0):Ta(n,d,p),f="";switch(this.ca){case "full":if(2<e){for(g=0;g<e;g++)for(var k=e;k>g;k--){f=t.substring(g,k);var h=this.O?this.O(c,t,p,f,g):Ta(n,d,p,e,g);W(this,m,f,h,a,b)}break}case "reverse":if(1<e){for(k=e-1;0<k;k--)f=
t[h]+g,k=this.L?this.L(b,t,p,g,h):Ta(n,d,p,e,h),W(this,m,g,k,a,c);g=""}case "forward":if(1<e){for(h=0;h<e;h++)g+=t[h],W(this,m,g,f,a,c);break}default:if(W(this,m,t,f,a,c),r&&1<d&&p<d-1)for(e=B(),g=this.ja,f=t,h=Math.min(r+1,d-p),e[f]=1,k=1;k<h;k++)if((t=b[this.rtl?d-1-p-k:p+k])&&!e[t]){e[t]=1;const q=this.L?this.L(b,f,p,t,k):Ta(g+(d/2>g?0:1),d,p,h-1,k-1),u=this.fa&&t>f;W(this,l,u?f:t,q,a,c,u?t:f)}}}}this.C||this.B.add(a)}else b=""}this.db&&(b||this.ga.push({del:a}),this.na&&Ua(this));return this}; t[k]+f,h=this.O?this.O(c,t,p,f,k):Ta(n,d,p,e,k),W(this,m,f,h,a,b);f=""}case "forward":if(1<e){for(k=0;k<e;k++)f+=t[k],W(this,m,f,g,a,b);break}default:if(W(this,m,t,g,a,b),u&&1<d&&p<d-1)for(e=C(),f=this.ja,g=t,k=Math.min(u+1,d-p),e[g]=1,h=1;h<k;h++)if((t=c[this.rtl?d-1-p-h:p+h])&&!e[t]){e[t]=1;const q=this.O?this.O(c,g,p,t,h):Ta(f+(d/2>f?0:1),d,p,k-1,h-1),v=this.fa&&t>g;W(this,l,v?g:t,q,a,b,v?t:g)}}}}this.C||this.B.add(a)}else c=""}this.db&&(c||this.ga.push({del:a}),this.na&&Ua(this));return this};
function W(a,b,c,d,e,f,g){let h=g?a.S:a.map,k;if(!b[c]||g&&!(k=b[c])[g])if(g?(b=k||(b[c]=B()),b[g]=1,a.aa&&(g=Ra(g)),(k=h.get(g))?h=k:h.set(g,h=new Map)):b[c]=1,a.aa&&(c=Ra(c)),(k=h.get(c))?h=k:h.set(c,h=k=[]),h=h[d]||(h[d]=[]),!f||!h.includes(e)){if(h.length===2**31-1){b=new P(h);if(a.C)for(let l of a.B.values())l.includes(h)&&(l[l.indexOf(h)]=b);k[d]=h=b}h.push(e);a.C&&((d=a.B.get(e))?d.push(h):a.B.set(e,[h]))}} function W(a,c,b,d,e,g,f){let k=f?a.S:a.map,h;if(!c[b]||f&&!(h=c[b])[f])if(f?(c=h||(c[b]=C()),c[f]=1,a.aa&&(f=Ra(f)),(h=k.get(f))?k=h:k.set(f,k=new Map)):c[b]=1,a.aa&&(b=Ra(b)),(h=k.get(b))?k=h:k.set(b,k=h=[]),k=k[d]||(k[d]=[]),!g||!k.includes(e)){if(k.length===2**31-1){c=new P(k);if(a.C)for(let l of a.B.values())l.includes(k)&&(l[l.indexOf(k)]=c);h[d]=k=c}k.push(e);a.C&&((d=a.B.get(e))?d.push(k):a.B.set(e,[k]))}}
function Ta(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function X(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Va(a):a;let e=[];for(let f=0,g,h;f<a.length;f++)if((g=a[f])&&(h=g.length)){if(c){if(c>=h){c-=h;continue}c<h&&(g=b?g.slice(c,c+b):g.slice(c),h=g.length,c=0)}if(e.length)h>b&&(g=g.slice(0,b),h=g.length),e.push(g);else{if(h>=b)return h>b&&(g=g.slice(0,b)),d?Va(g):g;e=[g]}b-=h;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Va(e):e} function Ta(a,c,b,d,e){return b&&1<a?c+(d||0)<=a?b+(e||0):(a-1)/(c+(d||0))*(b+(e||0))+1|0:0};function X(a,c,b,d){if(1===a.length)return a=a[0],a=b||a.length>c?c?a.slice(b,b+c):a.slice(b):a,d?Va(a):a;let e=[];for(let g=0,f,k;g<a.length;g++)if((f=a[g])&&(k=f.length)){if(b){if(b>=k){b-=k;continue}b<k&&(f=c?f.slice(b,b+c):f.slice(b),k=f.length,b=0)}if(e.length)k>c&&(f=f.slice(0,c),k=f.length),e.push(f);else{if(k>=c)return k>c&&(f=f.slice(0,c)),d?Va(f):f;e=[f]}c-=k;if(!c)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Va(e):e}
function Va(a){for(let b=0;b<a.length;b++)a[b]={L:b,id:a[b]};return a};Y.prototype.or=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.J||0;f=l.offset||0;g=l.I;h=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.K)m=this.K(l.K); function Va(a){for(let c=0;c<a.length;c++)a[c]={score:c,id:a[c]};return a};Y.prototype.or=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.or.apply(a,c)});if(b[0]&&b[0].index)return this.or.apply(this,b);let d=[];b=[];let e=0,g=0,f,k;for(let h=0,l;h<c.length;h++)if(l=c[h]){e=l.I||0;g=l.offset||0;f=l.H;k=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.J)m=this.J(l.J);
else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Wa(d,e,f,g,h,a.O);return h?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Wa(d,e,f,g,h,this.O));return h?this.result:this};function Wa(a,b,c,d,e,f){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.I||!1,b=b.J||0);return 2>a.length?e?X(a[0],b,c,d):a[0]:xa(a,c,b,e,f)};Y.prototype.and=function(){if(this.result.length){const b=this;let c=arguments;var a=c[0];if(a.then)return a.then(function(){return b.and.apply(b,c)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,f=0,g,h;for(let k=0,l;k<c.length;k++)if(l=c[k]){e=l.J||0;f=l.offset||0;g=l.resolve;h=l.ka;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor); else continue;d[h]=m;m.then&&b.push(m)}if(b.length)return Promise.all(b).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Wa(d,e,g,f,k,a.N);return k?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Wa(d,e,g,f,k,this.N));return k?this.result:this};function Wa(a,c,b,d,e,g){if(!a.length)return a;"object"===typeof c&&(b=c.offset||0,d=c.H||!1,c=c.I||0);return 2>a.length?e?X(a[0],c,b,d):a[0]:xa(a,b,c,e,g)};Y.prototype.and=function(){if(this.result.length){const c=this;let b=arguments;var a=b[0];if(a.then)return a.then(function(){return c.and.apply(c,b)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,g=0,f,k;for(let h=0,l;h<b.length;h++)if(l=b[h]){e=l.I||0;g=l.offset||0;f=l.resolve;k=l.ka;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor);
else if(l.K)m=this.K(l.K);else continue;d[k]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,g?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[b.result].concat(d);b.result=Xa(d,e,f,g,b.O,h);return g?b.result:b});d=[this.result].concat(d);this.result=Xa(d,e,f,g,this.O,h);return g?this.result:this}return this};function Xa(a,b,c,d,e,f){if(2>a.length)return[];let g=[];B();let h=ba(a);return h?wa(a,h,b,c,f,e,d):g};Y.prototype.xor=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.J||0;f=l.offset||0;g=l.I;h=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.K)m=this.K(l.K); else if(l.J)m=this.J(l.J);else continue;d[h]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,f?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[c.result].concat(d);c.result=Xa(d,e,g,f,c.N,k);return f?c.result:c});d=[this.result].concat(d);this.result=Xa(d,e,g,f,this.N,k);return f?this.result:this}return this};function Xa(a,c,b,d,e,g){if(2>a.length)return[];let f=[];C();let k=ba(a);return k?wa(a,k,c,b,g,e,d):f};Y.prototype.xor=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.xor.apply(a,c)});if(b[0]&&b[0].index)return this.xor.apply(this,b);let d=[];b=[];let e=0,g=0,f,k;for(let h=0,l;h<c.length;h++)if(l=c[h]){e=l.I||0;g=l.offset||0;f=l.H;k=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.J)m=this.J(l.J);
else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Ya(d,e,f,g,!h,a.O);return h?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Ya(d,e,f,g,!h,a.O));return h?this.result:this}; else continue;d[h]=m;m.then&&b.push(m)}if(b.length)return Promise.all(b).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Ya(d,e,g,f,!k,a.N);return k?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Ya(d,e,g,f,!k,a.N));return k?this.result:this};
function Ya(a,b,c,d,e,f){if(!a.length)return a;if(2>a.length)return e?X(a[0],b,c,d):a[0];d=[];const g=B();let h=0;for(let k=0,l;k<a.length;k++)if(l=a[k])for(let m=0,r;m<l.length;m++)if(r=l[m]){h<r.length&&(h=r.length);for(let n=0,p;n<r.length;n++)p=r[n],g[p]?g[p]++:g[p]=1}for(let k=0,l,m=0;k<h;k++)for(let r=0,n;r<a.length;r++)if(n=a[r])if(l=n[k])for(let p=0,t;p<l.length;p++)if(t=l[p],1===g[t])if(c)c--;else if(e){if(d.push(t),d.length===b)return d}else{const q=k+(r?f:0);d[q]||(d[q]=[]);d[q].push(t); function Ya(a,c,b,d,e,g){if(!a.length)return a;if(2>a.length)return e?X(a[0],c,b,d):a[0];d=[];const f=C();let k=0;for(let h=0,l;h<a.length;h++)if(l=a[h])for(let m=0,u;m<l.length;m++)if(u=l[m]){k<u.length&&(k=u.length);for(let n=0,p;n<u.length;n++)p=u[n],f[p]?f[p]++:f[p]=1}for(let h=0,l,m=0;h<k;h++)for(let u=0,n;u<a.length;u++)if(n=a[u])if(l=n[h])for(let p=0,t;p<l.length;p++)if(t=l[p],1===f[t])if(b)b--;else if(e){if(d.push(t),d.length===c)return d}else{const q=h+(u?g:0);d[q]||(d[q]=[]);d[q].push(t);
if(++m===b)return d}return d};Y.prototype.K=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.K.apply(a,b)});if(c[0]&&c[0].index)return this.K.apply(this,c);let d=[];c=[];let e=0,f=0,g;for(let h=0,k;h<b.length;h++)if(k=b[h]){e=k.J||0;f=k.offset||0;g=k.resolve;let l;if(k.constructor===Y)l=k.result;else if(k.constructor===Array)l=k;else if(k.index)k.resolve=!1,l=k.index.search(k).result;else if(k.or)l=this.or(k.or);else if(k.and)l=this.and(k.and);else if(k.xor)l=this.xor(k.xor);else continue; if(++m===c)return d}return d};Y.prototype.J=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.J.apply(a,c)});if(b[0]&&b[0].index)return this.J.apply(this,b);let d=[];b=[];let e=0,g=0,f;for(let k=0,h;k<c.length;k++)if(h=c[k]){e=h.I||0;g=h.offset||0;f=h.resolve;let l;if(h.constructor===Y)l=h.result;else if(h.constructor===Array)l=h;else if(h.index)h.resolve=!1,l=h.index.search(h).result;else if(h.or)l=this.or(h.or);else if(h.and)l=this.and(h.and);else if(h.xor)l=this.xor(h.xor);else continue;
d[h]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=$a.call(a,d,e,f,g);return g?a.result:a});d.length&&(this.result=$a.call(this,d,e,f,g));return g?this.result:this}; d[k]=l;l.then&&b.push(l)}if(b.length)return Promise.all(b).then(function(){a.result=$a.call(a,d,e,g,f);return f?a.result:a});d.length&&(this.result=$a.call(this,d,e,g,f));return f?this.result:this};
function $a(a,b,c,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let f=0,g,h=0;f<this.result.length;f++)if(g=this.result[f])for(let k=0,l;k<g.length;k++)if(l=g[k],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[f]||(e[f]=[]),e[f].push(l),++h===b)return e;return e};function Y(a){if(!this||this.constructor!==Y)return new Y(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.O=a.ma||0,this.result=a.index.search(a).result,this;if(a.constructor===Y)return a;this.index=null;this.result=a||[];this.O=0}Y.prototype.J=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}}return this}; function $a(a,c,b,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let g=0,f,k=0;g<this.result.length;g++)if(f=this.result[g])for(let h=0,l;h<f.length;h++)if(l=f[h],!a.has(l))if(b)b--;else if(d){if(e.push(l),e.length===c)return e}else if(e[g]||(e[g]=[]),e[g].push(l),++k===c)return e;return e};function Y(a){if(!this||this.constructor!==Y)return new Y(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.N=a.ma||0,this.result=a.index.search(a).result,this;if(a.constructor===Y)return a;this.index=null;this.result=a||[];this.N=0}Y.prototype.I=function(a){if(this.result.length){const c=[];let b=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+b<a)c[d]=e,b+=e.length;else{c[d]=e.slice(0,a-b);this.result=c;break}}return this};
Y.prototype.offset=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};Y.prototype.ma=function(a){this.O+=a;return this};Y.prototype.resolve=function(a,b,c){ab=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.I,b=a.offset,a=a.J),X(d,a||100,b,c)):d};let ab=1; Y.prototype.offset=function(a){if(this.result.length){const c=[];let b=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+b<a?b+=e.length:(c[d]=e.slice(a-b),b=a);this.result=c}return this};Y.prototype.ma=function(a){this.N+=a;return this};Y.prototype.resolve=function(a,c,b){ab=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(b=a.H,c=a.offset,a=a.I),X(d,a||100,c,b)):d};let ab=1;
L.prototype.search=function(a,b,c){c||(!b&&H(a)?(c=a,a=""):H(b)&&(c=b,b=0));let d=[],e;let f,g=0,h,k,l,m;if(c){a=c.query||a;b=c.J||b;g=c.offset||0;var r=c.context;f=c.ka;(h=ab&&!1!==c.resolve)||(ab=0);k=h&&c.I;m=c.ma;l=this.db&&c.tag}else h=this.resolve||ab;a=this.U.encode(a);e=a.length;b||!h||(b=100);if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);r=this.depth&&!1!==r;if(2===e&&r&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);let n=c=0;if(1<e){const q=B(),u=[];for(let w=0,D;w<e;w++)if((D=a[w])&&!q[D]){if(f|| L.prototype.search=function(a,c,b){b||(!c&&H(a)?(b=a,a=""):H(c)&&(b=c,c=0));let d=[],e,g,f,k=0,h,l,m,u,n;b?(a=b.query||a,c=b.I||c,k=b.offset||0,g=b.context,f=b.ka,(h=ab&&!1!==b.resolve)||(ab=0),l=h&&b.H,u=b.ma,n=b.K,m=this.db&&b.tag):h=this.resolve||ab;let p=this.U.encode(a);e=p.length;c||!h||(c=100);if(1===e)return bb.call(this,p[0],"",c,k,h,l,m);g=this.depth&&!1!==g;if(2===e&&g&&!f)return bb.call(this,p[0],p[1],c,k,h,l,m);let t=b=0;if(1<e){const w=C(),z=[];for(let x=0,r;x<e;x++)if((r=p[x])&&!w[r]){if(f||
this.db||Z(this,D))u.push(D),q[D]=1;else return h?d:new Y(d);const x=D.length;c=Math.max(c,x);n=n?Math.min(n,x):x}a=u;e=a.length}if(!e)return h?d:new Y(d);let p=0,t;if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);if(2===e&&r&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);1<e&&(r?(t=a[0],p=1):9<c&&3<c/n&&a.sort(aa));if(this.db){if(this.db.search&&(r=this.db.search(this,a,b,g,f,h,k,l),!1!==r))return r;const q=this;return async function(){for(let u,w;p<e;p++){w=a[p];t?(u=await Z(q,w,t,0,0,!1,!1),u=cb(u, this.db||Z(this,r))z.push(r),w[r]=1;else return h?d:new Y(d);const y=r.length;b=Math.max(b,y);t=t?Math.min(t,y):y}p=z;e=a.length}if(!e)return h?d:new Y(d);let q=0,v;if(1===e)return bb.call(this,p[0],"",c,k,h,l,m);if(2===e&&g&&!f)return bb.call(this,p[0],p[1],c,k,h,l,m);1<e&&(g?(v=p[0],q=1):9<b&&3<b/t&&p.sort(aa));n||0===n||(n=this.K);if(this.db){if(this.db.search&&(a=this.db.search(this,p,c,k,f,h,l,m),!1!==a))return a;const w=this;return async function(){for(let z,x;q<e;q++){x=p[q];v?(z=await Z(w,
d,f,q.ja),f&&!1===u&&d.length||(t=w)):(u=await Z(q,w,"",0,0,!1,!1),u=cb(u,d,f,q.G));if(u)return u;if(f&&p===e-1){let D=d.length;if(!D){if(t){t="";p=-1;continue}return d}if(1===D)return h?X(d[0],b,g):new Y(d[0])}}return h?wa(d,q.G,b,g,f,m,h):new Y(d[0])}()}for(let q,u;p<e;p++){u=a[p];t?(q=Z(this,u,t,0,0,!1,!1),q=cb(q,d,f,this.ja),f&&!1===q&&d.length||(t=u)):(q=Z(this,u,"",0,0,!1,!1),q=cb(q,d,f,this.G));if(q)return q;if(f&&p===e-1){r=d.length;if(!r){if(t){t="";p=-1;continue}return d}if(1===r)return h? x,v,0,0,!1,!1),z=cb(z,d,f,w.ja),f&&!1===z&&d.length||(v=x)):(z=await Z(w,x,"",0,0,!1,!1),z=cb(z,d,f,n));if(z)return z;if(f&&q===e-1){let r=d.length;if(!r){if(v){v="";q=-1;continue}return d}if(1===r)return h?X(d[0],c,k):new Y(d[0])}}return h?wa(d,n,c,k,f,u,h):new Y(d[0])}()}for(let w,z;q<e;q++){z=p[q];v?(w=Z(this,z,v,0,0,!1,!1),w=cb(w,d,f,this.ja),f&&!1===w&&d.length||(v=z)):(w=Z(this,z,"",0,0,!1,!1),w=cb(w,d,f,n));if(w)return w;if(f&&q===e-1){a=d.length;if(!a){if(v){v="";q=-1;continue}return d}if(1===
X(d[0],b,g):new Y(d[0])}}d=wa(d,this.G,b,g,f,m,h);return h?d:new Y(d)};function bb(a,b,c,d,e,f,g){a=Z(this,a,b,c,d,e,f,g);return this.db?a.then(function(h){return e?h:h&&h.length?e?X(h,c,d):new Y(h):e?[]:new Y([])}):a&&a.length?e?X(a,c,d):new Y(a):e?[]:new Y([])}function cb(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let f=0,g;f<d;f++)(g=a[f])&&g&&(e[f]=g);if(e.length){b.push(e);return}}return!c&&e} a)return h?X(d[0],c,k):new Y(d[0])}}d=wa(d,n,c,k,f,u,h);return h?d:new Y(d)};function bb(a,c,b,d,e,g,f){a=Z(this,a,c,b,d,e,g,f);return this.db?a.then(function(k){return e?k:k&&k.length?e?X(k,b,d):new Y(k):e?[]:new Y([])}):a&&a.length?e?X(a,b,d):new Y(a):e?[]:new Y([])}function cb(a,c,b,d){let e=[];if(a){d=Math.min(a.length,d);for(let g=0,f;g<d;g++)(f=a[g])&&f&&(e[g]=f);if(e.length){c.push(e);return}}return!b&&e}
function Z(a,b,c,d,e,f,g,h){let k;c&&(k=a.fa&&b>c);a.aa&&(b=Ra(b),c&&(c=Ra(c)));if(a.db)return c?a.db.get(k?c:b,k?b:c,d,e,f,g,h):a.db.get(b,"",d,e,f,g,h);a=c?(a=a.S.get(k?b:c))&&a.get(k?c:b):a.map.get(b);return a};L.prototype.remove=function(a,b){const c=this.B.size&&(this.C?this.B.get(a):this.B.has(a));if(c){if(this.C)for(let d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{const f=e.indexOf(a);f===c.length-1?e.pop():e.splice(f,1)}}else db(this.map,a),this.depth&&db(this.S,a);b||this.B.delete(a)}this.db&&(this.ga.push({del:a}),this.na&&Ua(this));this.cache&&this.cache.remove(a);return this}; function Z(a,c,b,d,e,g,f,k){let h;b&&(h=a.fa&&c>b);a.aa&&(c=Ra(c),b&&(b=Ra(b)));if(a.db)return b?a.db.get(h?b:c,h?c:b,d,e,g,f,k):a.db.get(c,"",d,e,g,f,k);a=b?(a=a.S.get(h?c:b))&&a.get(h?b:c):a.map.get(c);return a};L.prototype.remove=function(a,c){const b=this.B.size&&(this.C?this.B.get(a):this.B.has(a));if(b){if(this.C)for(let d=0,e;d<b.length;d++){if(e=b[d])if(2>e.length)e.pop();else{const g=e.indexOf(a);g===b.length-1?e.pop():e.splice(g,1)}}else db(this.map,a),this.depth&&db(this.S,a);c||this.B.delete(a)}this.db&&(this.ga.push({del:a}),this.na&&Ua(this));this.cache&&this.cache.remove(a);return this};
function db(a,b){let c=0;if(a.constructor===Array)for(let d=0,e,f;d<a.length;d++){if((e=a[d])&&e.length)if(f=e.indexOf(b),0<=f){1<e.length?(e.splice(f,1),c++):delete a[d];break}else c++}else for(let d of a){const e=d[0],f=db(d[1],b);f?c+=f:a.delete(e)}return c};function L(a,b){if(!this||this.constructor!==L)return new L(a);var c=Pa.profiler||(Pa.profiler={});c["Index.create"]||(c["Index.create"]=0);c["Index.create"]++;if(a){if(c=G(a)?a:a.preset)Oa[c]||console.warn("Preset not found: "+c),a=Object.assign({},Oa[c],a)}else a={};c=a.context||{};const d=G(a.U)?Na[a.U]:a.encode||a.U||Fa;this.U=d.encode?d:"object"===typeof d?new K(d):{encode:d};this.aa=a.aa||a.Ba||!1;let e;this.G=a.G||9;this.ca=e=a.ca||"strict";this.depth="strict"===e&&c.depth||0;this.fa=!1!== function db(a,c){let b=0;if(a.constructor===Array)for(let d=0,e,g;d<a.length;d++){if((e=a[d])&&e.length)if(g=e.indexOf(c),0<=g){1<e.length?(e.splice(g,1),b++):delete a[d];break}else b++}else for(let d of a){const e=d[0],g=db(d[1],c);g?b+=g:a.delete(e)}return b};function L(a,c){if(!this||this.constructor!==L)return new L(a);var b=Pa.profiler||(Pa.profiler={});b["Index.create"]||(b["Index.create"]=0);b["Index.create"]++;if(a){if(b=G(a)?a:a.Ea)Oa[b]||console.warn("Preset not found: "+b),a=Object.assign({},Oa[b],a)}else a={};b=a.context;const d=!0===b?{depth:1}:b||{},e=G(a.U)?Na[a.U]:a.encode||a.U||Fa;this.U=e.encode?e:"object"===typeof e?new K(e):{encode:e};this.aa=a.aa||a.Ba||!1;this.K=a.K||9;this.ca=b=a.ca||"strict";this.depth="strict"===b&&d.depth||0;this.fa=
c.fa;this.C=!!a.C;this.L=a.L||null;(e=a.ia||0)&&(this.ia=e);this.map=e?new Q(e):new Map;this.S=e?new Q(e):new Map;this.B=b||(this.C?e?new Q(e):new Map:e?new R(e):new Set);this.ja=c.G||1;this.rtl=d.rtl||a.rtl||!1;this.cache=(e=a.cache||null)&&new T(e);this.resolve=!1!==a.resolve;if(e=a.db)this.db=this.Y(e);this.na=!1!==a.commit;this.ga=[];this.h=null}y=L.prototype;y.Y=function(a){this.h&&(clearTimeout(this.h),this.h=null);return a.Y(this)}; !1!==d.fa;this.C=!!a.C;this.O=a.O||null;(b=a.ia||0)&&(this.ia=b);this.map=b?new Q(b):new Map;this.S=b?new Q(b):new Map;this.B=c||(this.C?b?new Q(b):new Map:b?new R(b):new Set);this.ja=d.K||3;this.rtl=e.rtl||a.rtl||!1;this.cache=(b=a.cache||null)&&new T(b);this.resolve=!1!==a.resolve;if(b=a.db)this.db=this.Y(b);this.na=!1!==a.commit;this.ga=[];this.h=null}A=L.prototype;A.Y=function(a){this.h&&(clearTimeout(this.h),this.h=null);return a.Y(this)};
y.commit=function(a,b){this.h&&(clearTimeout(this.h),this.h=null);return this.db.commit(this,a,b)};function Ua(a){a.h||(a.h=setTimeout(function(){a.h=null;a.db.commit(a,void 0,void 0)},0))}y.clear=function(){this.map.clear();this.S.clear();this.B.clear();this.cache&&this.cache.clear();this.db&&(this.h&&clearTimeout(this.h),this.h=null,this.ga=[{clear:!0}]);return this};y.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)}; A.commit=function(a,c){this.h&&(clearTimeout(this.h),this.h=null);return this.db.commit(this,a,c)};function Ua(a){a.h||(a.h=setTimeout(function(){a.h=null;a.db.commit(a,void 0,void 0)},0))}A.clear=function(){this.map.clear();this.S.clear();this.B.clear();this.cache&&this.cache.clear();this.db&&(this.h&&clearTimeout(this.h),this.h=null,this.ga=[{clear:!0}]);return this};A.update=function(a,c){const b=this,d=this.remove(a);return d&&d.then?d.then(()=>b.add(a,c)):this.add(a,c)};
y.import=function(a,b){if(b)switch(G(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.C=!1;this.B=qa(b,this.B);break;case "map":this.map=oa(b,this.map);break;case "ctx":this.S=pa(b,this.S)}};na(L.prototype);const eb={prepare:function(a){return a.replace(/\u00b4`\u2019\u02bc/g,"'").replace(/_+/g," ").replace(/&/g," and ").replace(/\$/g," USD ").replace(/\u00a3/g," GBP ").replace(/([a-z])'s\b/g,"$1 is").replace(/\bi'm\b/g,"i am").replace(/\b(can't|cannot)\b/g,"can not").replace(/\bwon't\b/g,"will not").replace(/([a-z])n't\b/g,"$1 not").replace(/([a-z])'ll\b/g,"$1 will").replace(/([a-z])'re\b/g,"$1 are").replace(/([a-z])'ve\b/g,"$1 have").replace(/([a-z])'d\b/g,"$1 would")},filter:new Set("a about above after again against all also am an and any are arent as at back be because been before being below between both but by can cannot cant come could couldnt did didnt do does doesnt doing dont down during each even few for from further get go good had hadnt has hasnt have havent having he hed her here heres hers herself hes him himself his how hows i id if ill im in into is isnt it its itself ive just know lets like lot make made me more most mustnt my myself new no nor not now of off on once one only or other ought our ours ourselves out over own people same say see shant she shed shell shes should shouldnt so some such take than that thats the their theirs them themselves then there theres these they theyd theyll theyre theyve think this those through time times to too under until up us use very want was wasnt way we wed well were werent weve what whats when whens where wheres which while who whom whos why whys will with wont work would wouldnt ya you youd youll your youre yours yourself yourselves youve".split(" ")), A.import=function(a,c){if(c)switch(G(c)&&(c=JSON.parse(c)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.C=!1;this.B=qa(c,this.B);break;case "map":this.map=oa(c,this.map);break;case "ctx":this.S=pa(c,this.S)}};na(L.prototype);const eb={prepare:function(a){return a.replace(/\u00b4`\u2019\u02bc/g,"'").replace(/_+/g," ").replace(/&/g," and ").replace(/\$/g," USD ").replace(/\u00a3/g," GBP ").replace(/([a-z])'s\b/g,"$1 is").replace(/\bi'm\b/g,"i am").replace(/\b(can't|cannot)\b/g,"can not").replace(/\bwon't\b/g,"will not").replace(/([a-z])n't\b/g,"$1 not").replace(/([a-z])'ll\b/g,"$1 will").replace(/([a-z])'re\b/g,"$1 are").replace(/([a-z])'ve\b/g,"$1 have").replace(/([a-z])'d\b/g,"$1 would")},filter:new Set("a about above after again against all also am an and any are arent as at back be because been before being below between both but by can cannot cant come could couldnt did didnt do does doesnt doing dont down during each even few for from further get go good had hadnt has hasnt have havent having he hed her here heres hers herself hes him himself his how hows i id if ill im in into is isnt it its itself ive just know lets like lot make made me more most mustnt my myself new no nor not now of off on once one only or other ought our ours ourselves out over own people same say see shant she shed shell shes should shouldnt so some such take than that thats the their theirs them themselves then there theres these they theyd theyll theyre theyve think this those through time times to too under until up us use very want was wasnt way we wed well were werent weve what whats when whens where wheres which while who whom whos why whys will with wont work would wouldnt ya you youd youll your youre yours yourself yourselves youve".split(" ")),
stemmer:new Map([["ational",""],["iveness",""],["fulness",""],["ousness",""],["ization",""],["tional",""],["biliti",""],["icate",""],["ative",""],["alize",""],["iciti",""],["entli",""],["ousli",""],["alism",""],["ation",""],["aliti",""],["iviti",""],["ement",""],["izer",""],["able",""],["alli",""],["ator",""],["logi",""],["ical",""],["ance",""],["ence",""],["ness",""],["ble",""],["ment",""],["eli",""],["bli",""],["ful",""],["ant",""],["ent",""],["ism",""],["ate",""],["iti",""],["ous",""],["ive",""], stemmer:new Map([["ational",""],["iveness",""],["fulness",""],["ousness",""],["ization",""],["tional",""],["biliti",""],["icate",""],["ative",""],["alize",""],["iciti",""],["entli",""],["ousli",""],["alism",""],["ation",""],["aliti",""],["iviti",""],["ement",""],["izer",""],["able",""],["alli",""],["ator",""],["logi",""],["ical",""],["ance",""],["ence",""],["ness",""],["ble",""],["ment",""],["eli",""],["bli",""],["ful",""],["ant",""],["ent",""],["ism",""],["ate",""],["iti",""],["ous",""],["ive",""],
["ize",""],["ing",""],["ion",""],["al",""],["ou",""],["er",""],["ic",""],["ly",""]])};"undefined"!==typeof module&&module.exports?module.exports=eb:self.FlexSearch&&(self.FlexSearch.Language.en=eb);}(this||self)); ["ize",""],["ing",""],["ion",""],["al",""],["ou",""],["er",""],["ic",""],["ly",""]])};"undefined"!==typeof module&&module.exports?module.exports=eb:self.FlexSearch&&(self.FlexSearch.Language.en=eb);}(this||self));

132
dist/lang/fr.min.js vendored
View File

@@ -1,73 +1,73 @@
(function(self){'use strict';var y;function z(a,b,c){const d=typeof c,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(c){if("function"===e&&d===e)return function(h){return a(c(h))};b=a.constructor;if(b===c.constructor){if(b===Array)return c.concat(a);if(b===Map){var f=new Map(c);for(var g of a)f.set(g[0],g[1]);return f}if(b===Set){g=new Set(c);for(f of a.values())g.add(f);return g}}}return a}return c}return"undefined"===e?b:a}function B(){return Object.create(null)}function aa(a,b){return b.length-a.length} (function(self){'use strict';var A;function B(a,c,b){const d=typeof b,e=typeof a;if("undefined"!==d){if("undefined"!==e){if(b){if("function"===e&&d===e)return function(k){return a(b(k))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var g=new Map(b);for(var f of a)g.set(f[0],f[1]);return g}if(c===Set){f=new Set(b);for(g of a.values())f.add(g);return f}}}return a}return b}return"undefined"===e?c:a}function C(){return Object.create(null)}function aa(a,c){return c.length-a.length}
function G(a){return"string"===typeof a}function H(a){return"object"===typeof a}function J(a,b){if(G(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}function ba(a){let b=0;for(let c=0,d;c<a.length;c++)(d=a[c])&&b<d.length&&(b=d.length);return b};var ca=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb", function G(a){return"string"===typeof a}function H(a){return"object"===typeof a}function J(a,c){if(G(c))a=a[c];else for(let b=0;a&&b<c.length;b++)a=a[c[b]];return a}function ba(a){let c=0;for(let b=0,d;b<a.length;b++)(d=a[b])&&c<d.length&&(c=d.length);return c};var ca=[["\u00aa","a"],["\u00b2","2"],["\u00b3","3"],["\u00b9","1"],["\u00ba","o"],["\u00bc","1\u20444"],["\u00bd","1\u20442"],["\u00be","3\u20444"],["\u00e0","a"],["\u00e1","a"],["\u00e2","a"],["\u00e3","a"],["\u00e4","a"],["\u00e5","a"],["\u00e7","c"],["\u00e8","e"],["\u00e9","e"],["\u00ea","e"],["\u00eb","e"],["\u00ec","i"],["\u00ed","i"],["\u00ee","i"],["\u00ef","i"],["\u00f1","n"],["\u00f2","o"],["\u00f3","o"],["\u00f4","o"],["\u00f5","o"],["\u00f6","o"],["\u00f9","u"],["\u00fa","u"],["\u00fb",
"u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"], "u"],["\u00fc","u"],["\u00fd","y"],["\u00ff","y"],["\u0101","a"],["\u0103","a"],["\u0105","a"],["\u0107","c"],["\u0109","c"],["\u010b","c"],["\u010d","c"],["\u010f","d"],["\u0113","e"],["\u0115","e"],["\u0117","e"],["\u0119","e"],["\u011b","e"],["\u011d","g"],["\u011f","g"],["\u0121","g"],["\u0123","g"],["\u0125","h"],["\u0129","i"],["\u012b","i"],["\u012d","i"],["\u012f","i"],["\u0133","ij"],["\u0135","j"],["\u0137","k"],["\u013a","l"],["\u013c","l"],["\u013e","l"],["\u0140","l"],["\u0144","n"],
["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0", ["\u0146","n"],["\u0148","n"],["\u0149","n"],["\u014d","o"],["\u014f","o"],["\u0151","o"],["\u0155","r"],["\u0157","r"],["\u0159","r"],["\u015b","s"],["\u015d","s"],["\u015f","s"],["\u0161","s"],["\u0163","t"],["\u0165","t"],["\u0169","u"],["\u016b","u"],["\u016d","u"],["\u016f","u"],["\u0171","u"],["\u0173","u"],["\u0175","w"],["\u0177","y"],["\u017a","z"],["\u017c","z"],["\u017e","z"],["\u017f","s"],["\u01a1","o"],["\u01b0","u"],["\u01c6","dz"],["\u01c9","lj"],["\u01cc","nj"],["\u01ce","a"],["\u01d0",
"i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215", "i"],["\u01d2","o"],["\u01d4","u"],["\u01d6","u"],["\u01d8","u"],["\u01da","u"],["\u01dc","u"],["\u01df","a"],["\u01e1","a"],["\u01e3","ae"],["\u00e6","ae"],["\u01fd","ae"],["\u01e7","g"],["\u01e9","k"],["\u01eb","o"],["\u01ed","o"],["\u01ef","\u0292"],["\u01f0","j"],["\u01f3","dz"],["\u01f5","g"],["\u01f9","n"],["\u01fb","a"],["\u01ff","\u00f8"],["\u0201","a"],["\u0203","a"],["\u0205","e"],["\u0207","e"],["\u0209","i"],["\u020b","i"],["\u020d","o"],["\u020f","o"],["\u0211","r"],["\u0213","r"],["\u0215",
"u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af", "u"],["\u0217","u"],["\u0219","s"],["\u021b","t"],["\u021f","h"],["\u0227","a"],["\u0229","e"],["\u022b","o"],["\u022d","o"],["\u022f","o"],["\u0231","o"],["\u0233","y"],["\u02b0","h"],["\u02b1","h"],["\u0266","h"],["\u02b2","j"],["\u02b3","r"],["\u02b4","\u0279"],["\u02b5","\u027b"],["\u02b6","\u0281"],["\u02b7","w"],["\u02b8","y"],["\u02e0","\u0263"],["\u02e1","l"],["\u02e2","s"],["\u02e3","x"],["\u02e4","\u0295"],["\u0390","\u03b9"],["\u03ac","\u03b1"],["\u03ad","\u03b5"],["\u03ae","\u03b7"],["\u03af",
"\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"], "\u03b9"],["\u03b0","\u03c5"],["\u03ca","\u03b9"],["\u03cb","\u03c5"],["\u03cc","\u03bf"],["\u03cd","\u03c5"],["\u03ce","\u03c9"],["\u03d0","\u03b2"],["\u03d1","\u03b8"],["\u03d2","\u03a5"],["\u03d3","\u03a5"],["\u03d4","\u03a5"],["\u03d5","\u03c6"],["\u03d6","\u03c0"],["\u03f0","\u03ba"],["\u03f1","\u03c1"],["\u03f2","\u03c2"],["\u03f5","\u03b5"],["\u0439","\u0438"],["\u0450","\u0435"],["\u0451","\u0435"],["\u0453","\u0433"],["\u0457","\u0456"],["\u045c","\u043a"],["\u045d","\u0438"],["\u045e","\u0443"],
["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const da=/[^\p{L}\p{N}]+/u,ea=/(\d{3})/g,fa=/(\D)(\d{3})/g,ha=/(\d{3})(\D)/g,ia="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let b=0;b<arguments.length;b++)this.assign(arguments[b])} ["\u0477","\u0475"],["\u04c2","\u0436"],["\u04d1","\u0430"],["\u04d3","\u0430"],["\u04d7","\u0435"],["\u04db","\u04d9"],["\u04dd","\u0436"],["\u04df","\u0437"],["\u04e3","\u0438"],["\u04e5","\u0438"],["\u04e7","\u043e"],["\u04eb","\u04e9"],["\u04ed","\u044d"],["\u04ef","\u0443"],["\u04f1","\u0443"],["\u04f3","\u0443"],["\u04f5","\u0447"]];const da=/[^\p{L}\p{N}]+/u,ea=/(\d{3})/g,fa=/(\D)(\d{3})/g,ha=/(\d{3})(\D)/g,ia="".normalize&&/[\u0300-\u036f]/g;function K(a){if(!this||this.constructor!==K)return new K(...arguments);for(let c=0;c<arguments.length;c++)this.assign(arguments[c])}
K.prototype.assign=function(a){this.normalize=z(a.normalize,!0,this.normalize);let b=a.include,c=b||a.exclude||a.split;if("object"===typeof c){let d=!b,e="";a.include||(e+="\\p{Z}");c.letter&&(e+="\\p{L}");c.number&&(e+="\\p{N}",d=!!b);c.symbol&&(e+="\\p{S}");c.punctuation&&(e+="\\p{P}");c.control&&(e+="\\p{C}");if(c=c.char)e+="object"===typeof c?c.join(""):c;try{this.split=new RegExp("["+(b?"^":"")+e+"]+","u")}catch(f){this.split=/\s+/}this.numeric=d}else{try{this.split=z(c,da,this.split)}catch(d){this.split= K.prototype.assign=function(a){this.normalize=B(a.normalize,!0,this.normalize);let c=a.include,b=c||a.exclude||a.split;if("object"===typeof b){let d=!c,e="";a.include||(e+="\\p{Z}");b.letter&&(e+="\\p{L}");b.number&&(e+="\\p{N}",d=!!c);b.symbol&&(e+="\\p{S}");b.punctuation&&(e+="\\p{P}");b.control&&(e+="\\p{C}");if(b=b.char)e+="object"===typeof b?b.join(""):b;try{this.split=new RegExp("["+(c?"^":"")+e+"]+","u")}catch(g){this.split=/\s+/}this.numeric=d}else{try{this.split=B(b,da,this.split)}catch(d){this.split=
/\s+/}this.numeric=z(this.numeric,!0)}this.prepare=z(a.prepare,null,this.prepare);this.finalize=z(a.finalize,null,this.finalize);ia||(this.mapper=new Map(ca));this.rtl=a.rtl||!1;this.dedupe=z(a.dedupe,!0,this.dedupe);this.filter=z((c=a.filter)&&new Set(c),null,this.filter);this.matcher=z((c=a.matcher)&&new Map(c),null,this.matcher);this.mapper=z((c=a.mapper)&&new Map(c),null,this.mapper);this.stemmer=z((c=a.stemmer)&&new Map(c),null,this.stemmer);this.replacer=z(a.replacer,null,this.replacer);this.minlength= /\s+/}this.numeric=B(this.numeric,!0)}this.prepare=B(a.prepare,null,this.prepare);this.finalize=B(a.finalize,null,this.finalize);ia||(this.mapper=new Map(ca));this.rtl=a.rtl||!1;this.dedupe=B(a.dedupe,!0,this.dedupe);this.filter=B((b=a.filter)&&new Set(b),null,this.filter);this.matcher=B((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=B((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=B((b=a.stemmer)&&new Map(b),null,this.stemmer);this.replacer=B(a.replacer,null,this.replacer);this.minlength=
z(a.minlength,1,this.minlength);this.maxlength=z(a.maxlength,0,this.maxlength);if(this.cache=c=z(a.cache,!0,this.cache))this.Z=null,this.la="number"===typeof c?c:2E5,this.R=new Map,this.W=new Map,this.D=this.h=128;this.H="";this.da=null;this.$="";this.ea=null;if(this.matcher)for(const d of this.matcher.keys())this.H+=(this.H?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.$+=(this.$?"|":"")+d;return this}; B(a.minlength,1,this.minlength);this.maxlength=B(a.maxlength,0,this.maxlength);if(this.cache=b=B(a.cache,!0,this.cache))this.Z=null,this.la="number"===typeof b?b:2E5,this.R=new Map,this.W=new Map,this.D=this.h=128;this.G="";this.da=null;this.$="";this.ea=null;if(this.matcher)for(const d of this.matcher.keys())this.G+=(this.G?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.$+=(this.$?"|":"")+d;return this};
K.prototype.encode=function(a){if(this.cache&&a.length<=this.h)if(this.Z){if(this.R.has(a))return this.R.get(a)}else this.Z=setTimeout(ja,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ia?a.normalize("NFKD").replace(ia,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(fa,"$1 $2").replace(ha,"$1 $2").replace(ea,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer); K.prototype.encode=function(a){if(this.cache&&a.length<=this.h)if(this.Z){if(this.R.has(a))return this.R.get(a)}else this.Z=setTimeout(ja,50,this);this.normalize&&(a="function"===typeof this.normalize?this.normalize(a):ia?a.normalize("NFKD").replace(ia,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3<a.length&&(a=a.replace(fa,"$1 $2").replace(ha,"$1 $2").replace(ea,"$1 "));const c=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);
let c=[],d=this.split||""===this.split?a.split(this.split):a;for(let f=0,g,h;f<d.length;f++){if(!(g=h=d[f]))continue;if(g.length<this.minlength)continue;if(b){c.push(g);continue}if(this.filter&&this.filter.has(g))continue;if(this.cache&&g.length<=this.D)if(this.Z){var e=this.W.get(g);if(e||""===e){e&&c.push(e);continue}}else this.Z=setTimeout(ja,50,this);let k;this.stemmer&&2<g.length&&(this.ea||(this.ea=new RegExp("(?!^)("+this.$+")$")),g=g.replace(this.ea,l=>this.stemmer.get(l)),k=1);g&&k&&(g.length< let b=[],d=this.split||""===this.split?a.split(this.split):a;for(let g=0,f,k;g<d.length;g++){if(!(f=k=d[g]))continue;if(f.length<this.minlength)continue;if(c){b.push(f);continue}if(this.filter&&this.filter.has(f))continue;if(this.cache&&f.length<=this.D)if(this.Z){var e=this.W.get(f);if(e||""===e){e&&b.push(e);continue}}else this.Z=setTimeout(ja,50,this);let h;this.stemmer&&2<f.length&&(this.ea||(this.ea=new RegExp("(?!^)("+this.$+")$")),f=f.replace(this.ea,l=>this.stemmer.get(l)),h=1);f&&h&&(f.length<
this.minlength||this.filter&&this.filter.has(g))&&(g="");if(g&&(this.mapper||this.dedupe&&1<g.length)){e="";for(let l=0,m="",r,n;l<g.length;l++)r=g.charAt(l),r===m&&this.dedupe||((n=this.mapper&&this.mapper.get(r))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=r);g=e}this.matcher&&1<g.length&&(this.da||(this.da=new RegExp("("+this.H+")","g")),g=g.replace(this.da,l=>this.matcher.get(l)));if(g&&this.replacer)for(e=0;g&&e<this.replacer.length;e+=2)g=g.replace(this.replacer[e],this.replacer[e+1]);this.cache&& this.minlength||this.filter&&this.filter.has(f))&&(f="");if(f&&(this.mapper||this.dedupe&&1<f.length)){e="";for(let l=0,m="",u,n;l<f.length;l++)u=f.charAt(l),u===m&&this.dedupe||((n=this.mapper&&this.mapper.get(u))||""===n?n===m&&this.dedupe||!(m=n)||(e+=n):e+=m=u);f=e}this.matcher&&1<f.length&&(this.da||(this.da=new RegExp("("+this.G+")","g")),f=f.replace(this.da,l=>this.matcher.get(l)));if(f&&this.replacer)for(e=0;f&&e<this.replacer.length;e+=2)f=f.replace(this.replacer[e],this.replacer[e+1]);this.cache&&
h.length<=this.D&&(this.W.set(h,g),this.W.size>this.la&&(this.W.clear(),this.D=this.D/1.1|0));g&&c.push(g)}this.finalize&&(c=this.finalize(c)||c);this.cache&&a.length<=this.h&&(this.R.set(a,c),this.R.size>this.la&&(this.R.clear(),this.h=this.h/1.1|0));return c};function ja(a){a.Z=null;a.R.clear();a.W.clear()};async function ka(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(b=d.config)&&(d=b);(b=a.factory)?(Function("return "+b)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);postMessage({id:a.id});break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let la=0; k.length<=this.D&&(this.W.set(k,f),this.W.size>this.la&&(this.W.clear(),this.D=this.D/1.1|0));f&&b.push(f)}this.finalize&&(b=this.finalize(b)||b);this.cache&&a.length<=this.h&&(this.R.set(a,b),this.R.size>this.la&&(this.R.clear(),this.h=this.h/1.1|0));return b};function ja(a){a.Z=null;a.R.clear();a.W.clear()};async function ka(a){a=a.data;var c=self._index;const b=a.args;var d=a.task;switch(d){case "init":d=a.options||{};(c=a.factory)?(Function("return "+c)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);postMessage({id:a.id});break;default:a=a.id,c=c[d].apply(c,b),postMessage("search"===d?{id:a,msg:c}:{id:a})}};let la=0;
function M(a={}){function b(g){function h(k){k=k.data||k;const l=k.id,m=l&&e.h[l];m&&(m(k.msg),delete e.h[l])}this.F=g;this.h=B();if(this.F){d?this.F.on("message",h):this.F.onmessage=h;if(a.config)return new Promise(function(k){e.h[++la]=function(){k(e)};e.F.postMessage({id:la,task:"init",factory:c,options:a})});this.F.postMessage({task:"init",factory:c,options:a});return this}}if(!this||this.constructor!==M)return new M(a);let c="undefined"!==typeof self?self._factory:"undefined"!==typeof window?window._factory: function M(a={}){function c(f){function k(h){h=h.data||h;const l=h.id,m=l&&e.h[l];m&&(m(h.msg),delete e.h[l])}this.F=f;this.h=C();if(this.F){d?this.F.on("message",k):this.F.onmessage=k;if(a.config)return new Promise(function(h){e.h[++la]=function(){h(e)};e.F.postMessage({id:la,task:"init",factory:b,options:a})});this.F.postMessage({task:"init",factory:b,options:a});return this}}if(!this||this.constructor!==M)return new M(a);let b="undefined"!==typeof self?self._factory:"undefined"!==typeof window?window._factory:
null;c&&(c=c.toString());const d="undefined"===typeof window,e=this,f=ma(c,d,a.F);return f.then?f.then(function(g){return b.call(e,g)}):b.call(this,f)}N("add");N("append");N("search");N("update");N("remove"); null;b&&(b=b.toString());const d="undefined"===typeof window,e=this,g=ma(b,d,a.F);return g.then?g.then(function(f){return c.call(e,f)}):c.call(this,g)}N("add");N("append");N("search");N("update");N("remove");
function N(a){M.prototype[a]=M.prototype[a+"Async"]=async function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;"function"===typeof d&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){b.h[++la]=f;b.F.postMessage({task:a,id:la,args:c})});return e?(d.then(e),this):d}} function N(a){M.prototype[a]=M.prototype[a+"Async"]=async function(){const c=this,b=[].slice.call(arguments);var d=b[b.length-1];let e;"function"===typeof d&&(e=d,b.splice(b.length-1,1));d=new Promise(function(g){c.h[++la]=g;c.F.postMessage({task:a,id:la,args:b})});return e?(d.then(e),this):d}}
function ma(a,b,c){return b?"undefined"!==typeof module?(0,eval)('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")'):(0,eval)('import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); })'):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+ka.toString()],{type:"text/javascript"}))):new window.Worker(G(c)?c:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js", function ma(a,c,b){return c?"undefined"!==typeof module?(0,eval)('new (require("worker_threads")["Worker"])(__dirname + "/node/node.js")'):(0,eval)('import("worker_threads").then(function(worker){ return new worker["Worker"]((1,eval)("import.meta.dirname") + "/node/node.mjs"); })'):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+ka.toString()],{type:"text/javascript"}))):new window.Worker(G(b)?b:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js",
"module/worker/worker.js"),{type:"module"})};function na(a){O.call(a,"add");O.call(a,"append");O.call(a,"search");O.call(a,"update");O.call(a,"remove")}function O(a){this[a+"Async"]=function(){var b=arguments;const c=b[b.length-1];let d;"function"===typeof c&&(d=c,delete b[b.length-1]);b=this[a].apply(this,b);d&&(b.then?b.then(d):d(b));return b}};function oa(a,b){b||(b=new Map);for(let c=0,d;c<a.length;c++)d=a[c],b.set(d[0],d[1]);return b}function pa(a,b){b||(b=new Map);for(let c=0,d,e;c<a.length;c++)d=a[c],e=b.get(d[0]),b.set(d[0],oa(d[1],e));return b}function qa(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.add(a[c]);return b};function ra(a,b,c,d){let e=[];for(let f=0,g;f<a.index.length;f++)if(g=a.index[f],b>=g.length)b-=g.length;else{b=g[d?"splice":"slice"](b,c);const h=b.length;if(h&&(e=e.length?e.concat(b):b,c-=h,d&&(a.length-=h),!c))break;b=0}return e} "module/worker/worker.js"),{type:"module"})};function na(a){O.call(a,"add");O.call(a,"append");O.call(a,"search");O.call(a,"update");O.call(a,"remove")}function O(a){this[a+"Async"]=function(){var c=arguments;const b=c[c.length-1];let d;"function"===typeof b&&(d=b,delete c[c.length-1]);c=this[a].apply(this,c);d&&(c.then?c.then(d):d(c));return c}};function oa(a,c){c||(c=new Map);for(let b=0,d;b<a.length;b++)d=a[b],c.set(d[0],d[1]);return c}function pa(a,c){c||(c=new Map);for(let b=0,d,e;b<a.length;b++)d=a[b],e=c.get(d[0]),c.set(d[0],oa(d[1],e));return c}function qa(a,c){c||(c=new Set);for(let b=0;b<a.length;b++)c.add(a[b]);return c};function ra(a,c,b,d){let e=[];for(let g=0,f;g<a.index.length;g++)if(f=a.index[g],c>=f.length)c-=f.length;else{c=f[d?"splice":"slice"](c,b);const k=c.length;if(k&&(e=e.length?e.concat(c):c,b-=k,d&&(a.length-=k),!b))break;c=0}return e}
function P(a){if(!this)return new P(a);this.index=a?[a]:[];this.length=a?a.length:0;const b=this;return new Proxy([],{get(c,d){if("length"===d)return b.length;if("push"===d)return function(e){b.index[b.index.length-1].push(e);b.length++};if("pop"===d)return function(){if(b.length)return b.length--,b.index[b.index.length-1].pop()};if("indexOf"===d)return function(e){let f=0;for(let g=0,h,k;g<b.index.length;g++){h=b.index[g];k=h.indexOf(e);if(0<=k)return f+k;f+=h.length}return-1};if("includes"===d)return function(e){for(let f= function P(a){if(!this)return new P(a);this.index=a?[a]:[];this.length=a?a.length:0;const c=this;return new Proxy([],{get(b,d){if("length"===d)return c.length;if("push"===d)return function(e){c.index[c.index.length-1].push(e);c.length++};if("pop"===d)return function(){if(c.length)return c.length--,c.index[c.index.length-1].pop()};if("indexOf"===d)return function(e){let g=0;for(let f=0,k,h;f<c.index.length;f++){k=c.index[f];h=k.indexOf(e);if(0<=h)return g+h;g+=k.length}return-1};if("includes"===d)return function(e){for(let g=
0;f<b.index.length;f++)if(b.index[f].includes(e))return!0;return!1};if("slice"===d)return function(e,f){return ra(b,e||0,f||b.length,!1)};if("splice"===d)return function(e,f){return ra(b,e||0,f||b.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(c=b.index[d/2**31|0])&&c[d]},set(c,d,e){c=d/2**31|0;(b.index[c]||(b.index[c]=[]))[d]=e;b.length++;return!0}})}P.prototype.clear=function(){this.index.length=0};P.prototype.push=function(){}; 0;g<c.index.length;g++)if(c.index[g].includes(e))return!0;return!1};if("slice"===d)return function(e,g){return ra(c,e||0,g||c.length,!1)};if("splice"===d)return function(e,g){return ra(c,e||0,g||c.length,!0)};if("constructor"===d)return Array;if("symbol"!==typeof d)return(b=c.index[d/2**31|0])&&b[d]},set(b,d,e){b=d/2**31|0;(c.index[b]||(c.index[b]=[]))[d]=e;c.length++;return!0}})}P.prototype.clear=function(){this.index.length=0};P.prototype.push=function(){};
function Q(a=8){if(!this)return new Q(a);this.index=B();this.H=[];this.size=0;32<a?(this.h=sa,this.D=BigInt(a)):(this.h=ta,this.D=a)}Q.prototype.get=function(a){const b=this.index[this.h(a)];return b&&b.get(a)};Q.prototype.set=function(a,b){var c=this.h(a);let d=this.index[c];d?(c=d.size,d.set(a,b),(c-=d.size)&&this.size++):(this.index[c]=d=new Map([[a,b]]),this.H.push(d))};function R(a=8){if(!this)return new R(a);this.index=B();this.h=[];32<a?(this.H=sa,this.D=BigInt(a)):(this.H=ta,this.D=a)} function Q(a=8){if(!this)return new Q(a);this.index=C();this.G=[];this.size=0;32<a?(this.h=sa,this.D=BigInt(a)):(this.h=ta,this.D=a)}Q.prototype.get=function(a){const c=this.index[this.h(a)];return c&&c.get(a)};Q.prototype.set=function(a,c){var b=this.h(a);let d=this.index[b];d?(b=d.size,d.set(a,c),(b-=d.size)&&this.size++):(this.index[b]=d=new Map([[a,c]]),this.G.push(d))};function R(a=8){if(!this)return new R(a);this.index=C();this.h=[];32<a?(this.G=sa,this.D=BigInt(a)):(this.G=ta,this.D=a)}
R.prototype.add=function(a){var b=this.H(a);let c=this.index[b];c?(b=c.size,c.add(a),(b-=c.size)&&this.size++):(this.index[b]=c=new Set([a]),this.h.push(c))};y=Q.prototype;y.has=R.prototype.has=function(a){const b=this.index[this.H(a)];return b&&b.has(a)};y.delete=R.prototype.delete=function(a){const b=this.index[this.H(a)];b&&b.delete(a)&&this.size--};y.clear=R.prototype.clear=function(){this.index=B();this.h=[];this.size=0};y.values=R.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].values())yield b}; R.prototype.add=function(a){var c=this.G(a);let b=this.index[c];b?(c=b.size,b.add(a),(c-=b.size)&&this.size++):(this.index[c]=b=new Set([a]),this.h.push(b))};A=Q.prototype;A.has=R.prototype.has=function(a){const c=this.index[this.G(a)];return c&&c.has(a)};A.delete=R.prototype.delete=function(a){const c=this.index[this.G(a)];c&&c.delete(a)&&this.size--};A.clear=R.prototype.clear=function(){this.index=C();this.h=[];this.size=0};A.values=R.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].values())yield c};
y.keys=R.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].keys())yield b};y.entries=R.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let b of this.h[a].entries())yield b};function ta(a){let b=2**this.D-1;if("number"==typeof a)return a&b;let c=0,d=this.D+1;for(let e=0;e<a.length;e++)c=(c*d^a.charCodeAt(e))&b;return 32===this.D?c+2**31:c} A.keys=R.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].keys())yield c};A.entries=R.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].entries())yield c};function ta(a){let c=2**this.D-1;if("number"==typeof a)return a&c;let b=0,d=this.D+1;for(let e=0;e<a.length;e++)b=(b*d^a.charCodeAt(e))&c;return 32===this.D?b+2**31:b}
function sa(a){let b=BigInt(2)**this.D-BigInt(1);var c=typeof a;if("bigint"===c)return a&b;if("number"===c)return BigInt(a)&b;c=BigInt(0);let d=this.D+BigInt(1);for(let e=0;e<a.length;e++)c=(c*d^BigInt(a.charCodeAt(e)))&b;return c};S.prototype.add=function(a,b,c){H(a)&&(b=a,a=J(b,this.key));if(b&&(a||0===a)){if(!c&&this.B.has(a))return this.update(a,b);for(let h=0,k;h<this.A.length;h++){k=this.N[h];var d=this.index.get(this.A[h]);if("function"===typeof k){var e=k(b);e&&d.add(a,e,!1,!0)}else if(e=k.V,!e||e(b))k.constructor===String?k=[""+k]:G(k)&&(k=[k]),ua(b,k,this.X,0,d,a,k[0],c)}if(this.tag)for(d=0;d<this.P.length;d++){var f=this.P[d],g=this.ba[d];e=this.tag.get(g);let h=B();if("function"===typeof f){if(f=f(b),!f)continue}else{const k= function sa(a){let c=BigInt(2)**this.D-BigInt(1);var b=typeof a;if("bigint"===b)return a&c;if("number"===b)return BigInt(a)&c;b=BigInt(0);let d=this.D+BigInt(1);for(let e=0;e<a.length;e++)b=(b*d^BigInt(a.charCodeAt(e)))&c;return b};S.prototype.add=function(a,c,b){H(a)&&(c=a,a=J(c,this.key));if(c&&(a||0===a)){if(!b&&this.B.has(a))return this.update(a,c);for(let k=0,h;k<this.A.length;k++){h=this.M[k];var d=this.index.get(this.A[k]);if("function"===typeof h){var e=h(c);e&&d.add(a,e,!1,!0)}else if(e=h.V,!e||e(c))h.constructor===String?h=[""+h]:G(h)&&(h=[h]),ua(c,h,this.X,0,d,a,h[0],b)}if(this.tag)for(d=0;d<this.P.length;d++){var g=this.P[d],f=this.ba[d];e=this.tag.get(f);let k=C();if("function"===typeof g){if(g=g(c),!g)continue}else{const h=
f.V;if(k&&!k(b))continue;f.constructor===String&&(f=""+f);f=J(b,f)}if(e&&f){G(f)&&(f=[f]);for(let k=0,l,m;k<f.length;k++)if(l=f[k],!h[l]&&(h[l]=1,(g=e.get(l))?m=g:e.set(l,m=[]),!c||!m.includes(a))){if(m.length===2**31-1){g=new P(m);if(this.C)for(let r of this.B.values())r.includes(m)&&(r[r.indexOf(m)]=g);e.set(l,m=g)}m.push(a);this.C&&((g=this.B.get(a))?g.push(m):this.B.set(a,[m]))}}else e||console.warn("Tag '"+g+"' was not found")}if(this.store&&(!c||!this.store.has(a))){let h;if(this.M){h=B();for(let k= g.V;if(h&&!h(c))continue;g.constructor===String&&(g=""+g);g=J(c,g)}if(e&&g){G(g)&&(g=[g]);for(let h=0,l,m;h<g.length;h++)if(l=g[h],!k[l]&&(k[l]=1,(f=e.get(l))?m=f:e.set(l,m=[]),!b||!m.includes(a))){if(m.length===2**31-1){f=new P(m);if(this.C)for(let u of this.B.values())u.includes(m)&&(u[u.indexOf(m)]=f);e.set(l,m=f)}m.push(a);this.C&&((f=this.B.get(a))?f.push(m):this.B.set(a,[m]))}}else e||console.warn("Tag '"+f+"' was not found")}if(this.store&&(!b||!this.store.has(a))){let k;if(this.L){k=C();for(let h=
0,l;k<this.M.length;k++){l=this.M[k];if((c=l.V)&&!c(b))continue;let m;if("function"===typeof l){m=l(b);if(!m)continue;l=[l.oa]}else if(G(l)||l.constructor===String){h[l]=b[l];continue}va(b,h,l,0,l[0],m)}}this.store.set(a,h||b)}}return this};function va(a,b,c,d,e,f){a=a[e];if(d===c.length-1)b[e]=f||a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)va(a,b,c,d,e);else b=b[e]||(b[e]=B()),e=c[++d],va(a,b,c,d,e)} 0,l;h<this.L.length;h++){l=this.L[h];if((b=l.V)&&!b(c))continue;let m;if("function"===typeof l){m=l(c);if(!m)continue;l=[l.oa]}else if(G(l)||l.constructor===String){k[l]=c[l];continue}va(c,k,l,0,l[0],m)}}this.store.set(a,k||c)}}return this};function va(a,c,b,d,e,g){a=a[e];if(d===b.length-1)c[e]=g||a;else if(a)if(a.constructor===Array)for(c=c[e]=Array(a.length),e=0;e<a.length;e++)va(a,c,b,d,e);else c=c[e]||(c[e]=C()),e=b[++d],va(a,c,b,d,e)}
function ua(a,b,c,d,e,f,g,h){if(a=a[g])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)ua(a,b,c,d,e,f,g,h);else g=b[++d],ua(a,b,c,d,e,f,g,h);else e.db&&e.remove(f)};function wa(a,b,c,d,e,f,g){const h=a.length;let k=[],l;var m;l=B();for(let r=0,n,p,t,q;r<b;r++)for(let u=0;u<h;u++)if(t=a[u],r<t.length&&(n=t[r]))for(let w=0;w<n.length;w++)p=n[w],(m=l[p])?l[p]++:(m=0,l[p]=1),q=k[m]||(k[m]=[]),g||(m=r+(u?0:f||0),q=q[m]||(q[m]=[])),q.push(p);if(a=k.length)if(e)k=1<k.length?xa(k,d,c,g,0):(k=k[0]).length>c||d?k.slice(d,c+d):k;else{if(a<h)return[];k=k[a-1];if(c||d)if(g){if(k.length>c||d)k=k.slice(d,c+d)}else{e=[];for(let r=0,n;r<k.length;r++)if(n=k[r],n.length>d)d-=n.length; function ua(a,c,b,d,e,g,f,k){if(a=a[f])if(d===c.length-1){if(a.constructor===Array){if(b[d]){for(c=0;c<a.length;c++)e.add(g,a[c],!0,!0);return}a=a.join(" ")}e.add(g,a,k,!0)}else if(a.constructor===Array)for(f=0;f<a.length;f++)ua(a,c,b,d,e,g,f,k);else f=c[++d],ua(a,c,b,d,e,g,f,k);else e.db&&e.remove(g)};function wa(a,c,b,d,e,g,f){const k=a.length;let h=[],l;var m;l=C();for(let u=0,n,p,t,q;u<c;u++)for(let v=0;v<k;v++)if(t=a[v],u<t.length&&(n=t[u]))for(let w=0;w<n.length;w++)p=n[w],(m=l[p])?l[p]++:(m=0,l[p]=1),q=h[m]||(h[m]=[]),f||(m=u+(v?0:g||0),q=q[m]||(q[m]=[])),q.push(p);if(a=h.length)if(e)h=1<h.length?xa(h,d,b,f,0):(h=h[0]).length>b||d?h.slice(d,b+d):h;else{if(a<k)return[];h=h[a-1];if(b||d)if(f){if(h.length>b||d)h=h.slice(d,b+d)}else{e=[];for(let u=0,n;u<h.length;u++)if(n=h[u],n.length>d)d-=n.length;
else{if(n.length>c||d)n=n.slice(d,c+d),c-=n.length,d&&(d-=n.length);e.push(n);if(!c)break}k=1<e.length?[].concat.apply([],e):e[0]}}return k} else{if(n.length>b||d)n=n.slice(d,b+d),b-=n.length,d&&(d-=n.length);e.push(n);if(!b)break}h=1<e.length?[].concat.apply([],e):e[0]}}return h}
function xa(a,b,c,d,e){const f=[],g=B();let h;var k=a.length;let l,m=0;if(d)for(e=k-1;0<=e;e--)for(d=a[e],l=d.length,k=0;k<l;k++){if(h=d[k],!g[h])if(g[h]=1,b)b--;else if(f.push(h),f.length===c)return f}else{let r=ba(a);for(let n=0;n<r;n++)for(let p=k-1;0<=p;p--)if(l=(d=a[p][n])&&d.length)for(let t=0;t<l;t++)if(h=d[t],!g[h])if(g[h]=1,b)b--;else{let q=n+(p<k-1?e||0:0);(f[q]||(f[q]=[])).push(h);if(++m===c)return f}}return f} function xa(a,c,b,d,e){const g=[],f=C();let k;var h=a.length;let l,m=0;if(d)for(e=h-1;0<=e;e--)for(d=a[e],l=d.length,h=0;h<l;h++){if(k=d[h],!f[k])if(f[k]=1,c)c--;else if(g.push(k),g.length===b)return g}else{let u=ba(a);for(let n=0;n<u;n++)for(let p=h-1;0<=p;p--)if(l=(d=a[p][n])&&d.length)for(let t=0;t<l;t++)if(k=d[t],!f[k])if(f[k]=1,c)c--;else{let q=n+(p<h-1?e||0:0);(g[q]||(g[q]=[])).push(k);if(++m===b)return g}}return g}
function ya(a,b){const c=B(),d=[];for(let e=0,f;e<b.length;e++){f=b[e];for(let g=0;g<f.length;g++)c[f[g]]=1}for(let e=0,f;e<a.length;e++)f=a[e],1===c[f]&&(d.push(f),c[f]=2);return d};S.prototype.search=function(a,b,c,d){c||(!b&&H(a)?(c=a,a=""):H(b)&&(c=b,b=0));let e=[],f=[],g;let h;let k;let l,m=0,r;if(c){c.constructor===Array&&(c={index:c});a=c.query||a;g=c.Da;h=c.Ca;k=g||c.A||c.index;var n=this.tag&&c.tag;var p=this.store&&c.I;var t=c.ka;r=c.pa;b=c.J||b;l=c.offset||0;b||(b=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var q=[];for(let x=0,v;x<n.length;x++){v=n[x];if(G(v))throw Error("A tag option can't be a string, instead it needs a { field: tag } format.");if(v.A&& function ya(a,c){const b=C(),d=[];for(let e=0,g;e<c.length;e++){g=c[e];for(let f=0;f<g.length;f++)b[g[f]]=1}for(let e=0,g;e<a.length;e++)g=a[e],1===b[g]&&(d.push(g),b[g]=2);return d};S.prototype.search=function(a,c,b,d){b||(!c&&H(a)?(b=a,a=""):H(c)&&(b=c,c=0));let e=[],g=[],f;let k;let h;let l,m=0,u;if(b){b.constructor===Array&&(b={index:b});a=b.query||a;f=b.Da;k=b.Ca;h=f||b.A||b.index;var n=this.tag&&b.tag;var p=this.store&&b.H;var t=b.ka;u=b.pa;c=b.I||c;l=b.offset||0;c||(c=100);if(n&&(!this.db||!d)){n.constructor!==Array&&(n=[n]);var q=[];for(let x=0,r;x<n.length;x++){r=n[x];if(G(r))throw Error("A tag option can't be a string, instead it needs a { field: tag } format.");if(r.A&&
v.tag){var u=v.tag;if(u.constructor===Array)for(var w=0;w<u.length;w++)q.push(v.A,u[w]);else q.push(v.A,u)}else{u=Object.keys(v);for(let A=0,I,C;A<u.length;A++)if(I=u[A],C=v[I],C.constructor===Array)for(w=0;w<C.length;w++)q.push(I,C[w]);else q.push(I,C)}}if(!q.length)throw Error("Your tag definition within the search options is probably wrong. No valid tags found.");n=q;if(!a){t=[];if(q.length)for(n=0;n<q.length;n+=2){if(this.db){d=this.index.get(q[n]);if(!d){console.warn("Tag '"+q[n]+":"+q[n+1]+ r.tag){var v=r.tag;if(v.constructor===Array)for(var w=0;w<v.length;w++)q.push(r.A,v[w]);else q.push(r.A,v)}else{v=Object.keys(r);for(let y=0,I,D;y<v.length;y++)if(I=v[y],D=r[I],D.constructor===Array)for(w=0;w<D.length;w++)q.push(I,D[w]);else q.push(I,D)}}if(!q.length)throw Error("Your tag definition within the search options is probably wrong. No valid tags found.");n=q;if(!a){t=[];if(q.length)for(n=0;n<q.length;n+=2){if(this.db){d=this.index.get(q[n]);if(!d){console.warn("Tag '"+q[n]+":"+q[n+1]+
"' will be skipped because there is no field '"+q[n]+"'.");continue}t.push(d=d.db.tag(q[n+1],b,l,p))}else d=za.call(this,q[n],q[n+1],b,l,p);e.push({field:q[n],tag:q[n+1],result:d})}return t.length?Promise.all(t).then(function(x){for(let v=0;v<x.length;v++)e[v].result=x[v];return e}):e}}G(k)&&(k=[k])}k||(k=this.A);q=!d&&(this.F||this.db)&&[];let D;for(let x=0,v,A,I;x<k.length;x++){A=k[x];if(this.db&&this.tag&&!this.N[x])continue;let C;G(A)||(C=A,A=C.A,a=C.query||a,b=C.J||b,l=C.offset||l,t=C.ka||t, "' will be skipped because there is no field '"+q[n]+"'.");continue}t.push(d=d.db.tag(q[n+1],c,l,p))}else d=za.call(this,q[n],q[n+1],c,l,p);e.push({field:q[n],tag:q[n+1],result:d})}return t.length?Promise.all(t).then(function(x){for(let r=0;r<x.length;r++)e[r].result=x[r];return e}):e}}G(h)&&(h=[h])}h||(h=this.A);q=!d&&(this.F||this.db)&&[];let z;for(let x=0,r,y,I;x<h.length;x++){y=h[x];if(this.db&&this.tag&&!this.M[x])continue;let D;G(y)||(D=y,y=D.A,a=D.query||a,c=D.I||c,l=D.offset||l,t=D.ka||t,
p=this.store&&(C.I||p));if(d)v=d[x];else if(u=C||c,w=this.index.get(A),n&&(this.db&&(u.tag=n,D=w.db.Ea,u.A=k),D||(u.I=!1)),q){q[x]=w.search(a,b,u);u&&p&&(u.I=p);continue}else v=w.search(a,b,u),u&&p&&(u.I=p);I=v&&v.length;if(n&&I){u=[];w=0;if(this.db&&d){if(!D)for(let E=k.length;E<d.length;E++){let F=d[E];if(F&&F.length)w++,u.push(F);else if(!t)return e}}else for(let E=0,F,Za;E<n.length;E+=2){F=this.tag.get(n[E]);if(!F)if(console.warn("Tag '"+n[E]+":"+n[E+1]+"' will be skipped because there is no field '"+ p=this.store&&(D.H||p));if(d)r=d[x];else if(v=D||b,w=this.index.get(y),n&&(this.db&&(v.tag=n,z=w.db.Fa,v.A=h),z||(v.H=!1)),q){q[x]=w.search(a,c,v);v&&p&&(v.H=p);continue}else r=w.search(a,c,v),v&&p&&(v.H=p);I=r&&r.length;if(n&&I){v=[];w=0;if(this.db&&d){if(!z)for(let E=h.length;E<d.length;E++){let F=d[E];if(F&&F.length)w++,v.push(F);else if(!t)return e}}else for(let E=0,F,Za;E<n.length;E+=2){F=this.tag.get(n[E]);if(!F)if(console.warn("Tag '"+n[E]+":"+n[E+1]+"' will be skipped because there is no field '"+
n[E]+"'."),t)continue;else return e;if(Za=(F=F&&F.get(n[E+1]))&&F.length)w++,u.push(F);else if(!t)return e}if(w){v=ya(v,u);I=v.length;if(!I&&!t)return e;w--}}if(I)f[m]=A,e.push(v),m++;else if(1===k.length)return e}if(q){if(this.db&&n&&n.length&&!D)for(p=0;p<n.length;p+=2){d=this.index.get(n[p]);if(!d)if(console.warn("Tag '"+n[p]+":"+n[p+1]+"' was not found because there is no field '"+n[p]+"'."),t)continue;else return e;q.push(d.db.tag(n[p+1],b,l,!1))}const x=this;return Promise.all(q).then(function(v){return v.length? n[E]+"'."),t)continue;else return e;if(Za=(F=F&&F.get(n[E+1]))&&F.length)w++,v.push(F);else if(!t)return e}if(w){r=ya(r,v);I=r.length;if(!I&&!t)return e;w--}}if(I)g[m]=y,e.push(r),m++;else if(1===h.length)return e}if(q){if(this.db&&n&&n.length&&!z)for(p=0;p<n.length;p+=2){d=this.index.get(n[p]);if(!d)if(console.warn("Tag '"+n[p]+":"+n[p+1]+"' was not found because there is no field '"+n[p]+"'."),t)continue;else return e;q.push(d.db.tag(n[p+1],c,l,!1))}const x=this;return Promise.all(q).then(function(r){return r.length?
x.search(a,b,c,v):v})}if(!m)return e;if(g&&(!p||!this.store))return e[0];q=[];for(let x=0,v;x<f.length;x++){v=e[x];p&&v.length&&!v[0].ha&&(this.db?q.push(v=this.index.get(this.A[0]).db.I(v)):v.length&&(v=Aa.call(this,v)));if(g)return v;e[x]={field:f[x],result:v}}if(p&&this.db&&q.length){const x=this;return Promise.all(q).then(function(v){for(let A=0;A<v.length;A++)e[A].result=v[A];return h?Ba(e,b):r?Ca(e,a,x.index,x.A,x.N,r):e})}return h?Ba(e,b):r?Ca(e,a,this.index,this.A,this.N,r):e}; x.search(a,c,b,r):r})}if(!m)return e;if(f&&(!p||!this.store))return e[0];q=[];for(let x=0,r;x<g.length;x++){r=e[x];p&&r.length&&!r[0].ha&&(this.db?q.push(r=this.index.get(this.A[0]).db.H(r)):r.length&&(r=Aa.call(this,r)));if(f)return r;e[x]={field:g[x],result:r}}if(p&&this.db&&q.length){const x=this;return Promise.all(q).then(function(r){for(let y=0;y<r.length;y++)e[y].result=r[y];return k?Ba(e,c):u?Ca(e,a,x.index,x.A,x.M,u):e})}return k?Ba(e,c):u?Ca(e,a,this.index,this.A,this.M,u):e};
function Ca(a,b,c,d,e,f){let g,h,k;for(let m=0,r,n,p,t,q;m<a.length;m++){r=a[m].result;n=a[m].A;t=c.get(n);p=t.U;k=t.ca;q=e[d.indexOf(n)];p!==g&&(g=p,h=g.encode(b));for(let u=0;u<r.length;u++){let w="";var l=J(r[u].ha,q);let D=g.encode(l);l=l.split(g.split);for(let x=0,v,A;x<D.length;x++){v=D[x];A=l[x];let I;for(let C=0,E;C<h.length;C++)if(E=h[C],"strict"===k){if(v===E){w+=(w?" ":"")+f.replace("$1",A);I=!0;break}}else{const F=v.indexOf(E);if(-1<F){w+=(w?" ":"")+A.substring(0,F)+f.replace("$1",A.substring(F, function Ca(a,c,b,d,e,g){let f,k,h;for(let m=0,u,n,p,t,q;m<a.length;m++){u=a[m].result;n=a[m].A;t=b.get(n);p=t.U;h=t.ca;q=e[d.indexOf(n)];p!==f&&(f=p,k=f.encode(c));for(let v=0;v<u.length;v++){let w="";var l=J(u[v].ha,q);let z=f.encode(l);l=l.split(f.split);for(let x=0,r,y;x<z.length;x++){r=z[x];y=l[x];let I;for(let D=0,E;D<k.length;D++)if(E=k[D],"strict"===h){if(r===E){w+=(w?" ":"")+g.replace("$1",y);I=!0;break}}else{const F=r.indexOf(E);if(-1<F){w+=(w?" ":"")+y.substring(0,F)+g.replace("$1",y.substring(F,
E.length))+A.substring(F+E.length);I=!0;break}}I||(w+=(w?" ":"")+l[x])}r[u].pa=w}}return a}function Ba(a,b){const c=[],d=B();for(let e=0,f,g;e<a.length;e++){f=a[e];g=f.result;for(let h=0,k,l,m;h<g.length;h++)if(l=g[h],k=l.id,m=d[k])m.push(f.A);else{if(c.length===b)return c;l.A=d[k]=[f.A];c.push(l)}}return c} E.length))+y.substring(F+E.length);I=!0;break}}I||(w+=(w?" ":"")+l[x])}u[v].pa=w}}return a}function Ba(a,c){const b=[],d=C();for(let e=0,g,f;e<a.length;e++){g=a[e];f=g.result;for(let k=0,h,l,m;k<f.length;k++)if(l=f[k],h=l.id,m=d[h])m.push(g.A);else{if(b.length===c)return b;l.A=d[h]=[g.A];b.push(l)}}return b}
function za(a,b,c,d,e){let f=this.tag.get(a);if(!f)return console.warn("Tag '"+a+"' was not found"),[];if((a=(f=f&&f.get(b))&&f.length-d)&&0<a){if(a>c||d)f=f.slice(d,d+c);e&&(f=Aa.call(this,f));return f}}function Aa(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store.get(d)};return b};function S(a){if(!this||this.constructor!==S)return new S(a);const b=a.document||a.ha||a;let c,d;this.N=[];this.A=[];this.X=[];this.key=(c=b.key||b.id)&&Da(c,this.X)||"id";(d=a.ia||0)&&(this.ia=d);this.B=(this.C=!!a.C)?d?new Q(d):new Map:d?new R(d):new Set;this.M=(c=b.store||null)&&!0!==c&&[];this.store=c&&(d?new Q(d):new Map);this.cache=(c=a.cache||null)&&new T(c);a.cache=!1;this.F=a.F;this.index=Ea.call(this,a,b);this.tag=null;if(c=b.tag)if("string"===typeof c&&(c=[c]),c.length){this.tag=new Map; function za(a,c,b,d,e){let g=this.tag.get(a);if(!g)return console.warn("Tag '"+a+"' was not found"),[];if((a=(g=g&&g.get(c))&&g.length-d)&&0<a){if(a>b||d)g=g.slice(d,d+b);e&&(g=Aa.call(this,g));return g}}function Aa(a){const c=Array(a.length);for(let b=0,d;b<a.length;b++)d=a[b],c[b]={id:d,doc:this.store.get(d)};return c};function S(a){if(!this||this.constructor!==S)return new S(a);const c=a.document||a.ha||a;let b,d;this.M=[];this.A=[];this.X=[];this.key=(b=c.key||c.id)&&Da(b,this.X)||"id";(d=a.ia||0)&&(this.ia=d);this.B=(this.C=!!a.C)?d?new Q(d):new Map:d?new R(d):new Set;this.L=(b=c.store||null)&&b&&!0!==b&&[];this.store=b&&(d?new Q(d):new Map);this.cache=(b=a.cache||null)&&new T(b);a.cache=!1;this.F=a.F;this.index=Ea.call(this,a,c);this.tag=null;if(b=c.tag)if("string"===typeof b&&(b=[b]),b.length){this.tag=new Map;
this.P=[];this.ba=[];for(let e=0,f,g;e<c.length;e++){f=c[e];g=f.A||f;if(!g)throw Error("The tag field from the document descriptor is undefined.");f.T?this.P[e]=f.T:(this.P[e]=Da(g,this.X),f.filter&&("string"===typeof this.P[e]&&(this.P[e]=new String(this.P[e])),this.P[e].V=f.filter));this.ba[e]=g;this.tag.set(g,new Map)}}if(this.F){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(f){let g=0;for(const h of e.index.entries()){const k= this.P=[];this.ba=[];for(let e=0,g,f;e<b.length;e++){g=b[e];f=g.A||g;if(!f)throw Error("The tag field from the document descriptor is undefined.");g.T?this.P[e]=g.T:(this.P[e]=Da(f,this.X),g.filter&&("string"===typeof this.P[e]&&(this.P[e]=new String(this.P[e])),this.P[e].V=g.filter));this.ba[e]=f;this.tag.set(f,new Map)}}if(this.F){a=[];for(const e of this.index.values())e.then&&a.push(e);if(a.length){const e=this;return Promise.all(a).then(function(g){let f=0;for(const k of e.index.entries()){const h=
h[0];h[1].then&&e.index.set(k,f[g++])}return e})}}else a.db&&this.Y(a.db)}y=S.prototype; k[0];k[1].then&&e.index.set(h,g[f++])}return e})}}else a.db&&this.Y(a.db)}A=S.prototype;
y.Y=function(a){let b=this.A;if(this.tag)for(let e=0,f;e<this.ba.length;e++){f=this.ba[e];var c=void 0;this.index.set(f,c=new L({},this.B));b===this.A&&(b=b.slice(0));b.push(f);c.tag=this.tag.get(f)}c=[];const d={db:a.db,type:a.type,C:a.C};for(let e=0,f,g;e<b.length;e++){d.A=g=b[e];f=this.index.get(g);const h=new a.constructor(a.id,d);h.id=a.id;c[e]=h.Y(f);f.document=!0;e?f.Aa=!0:f.store=this.store}this.db=!0;return Promise.all(c)}; A.Y=function(a){let c=this.A;if(this.tag)for(let e=0,g;e<this.ba.length;e++){g=this.ba[e];var b=void 0;this.index.set(g,b=new L({},this.B));c===this.A&&(c=c.slice(0));c.push(g);b.tag=this.tag.get(g)}b=[];const d={db:a.db,type:a.type,C:a.C};for(let e=0,g,f;e<c.length;e++){d.A=f=c[e];g=this.index.get(f);const k=new a.constructor(a.id,d);k.id=a.id;b[e]=k.Y(g);g.document=!0;e?g.Aa=!0:g.store=this.store}this.db=!0;return Promise.all(b)};
y.commit=async function(a,b){const c=[];for(const d of this.index.values())c.push(d.db.commit(d,a,b));await Promise.all(c);this.B.clear()}; A.commit=async function(a,c){const b=[];for(const d of this.index.values())b.push(d.db.commit(d,a,c));await Promise.all(b);this.B.clear()};
function Ea(a,b){const c=new Map;let d=b.index||b.A||b;G(d)&&(d=[d]);for(let e=0,f,g;e<d.length;e++){f=d[e];G(f)||(g=f,f=f.A);g=H(g)?Object.assign({},a,g):a;if(this.F){const h=new M(g);c.set(f,h)}this.F||c.set(f,new L(g,this.B));g.T?this.N[e]=g.T:(this.N[e]=Da(f,this.X),g.filter&&("string"===typeof this.N[e]&&(this.N[e]=new String(this.N[e])),this.N[e].V=g.filter));this.A[e]=f}if(this.M){a=b.store;G(a)&&(a=[a]);for(let e=0,f,g;e<a.length;e++)f=a[e],g=f.A||f,f.T?(this.M[e]=f.T,f.T.oa=g):(this.M[e]= function Ea(a,c){const b=new Map;let d=c.index||c.A||c;G(d)&&(d=[d]);for(let e=0,g,f;e<d.length;e++){g=d[e];G(g)||(f=g,g=g.A);f=H(f)?Object.assign({},a,f):a;if(this.F){const k=new M(f);b.set(g,k)}this.F||b.set(g,new L(f,this.B));f.T?this.M[e]=f.T:(this.M[e]=Da(g,this.X),f.filter&&("string"===typeof this.M[e]&&(this.M[e]=new String(this.M[e])),this.M[e].V=f.filter));this.A[e]=g}if(this.L){a=c.store;G(a)&&(a=[a]);for(let e=0,g,f;e<a.length;e++)g=a[e],f=g.A||g,g.T?(this.L[e]=g.T,g.T.oa=f):(this.L[e]=
Da(g,this.X),f.filter&&("string"===typeof this.M[e]&&(this.M[e]=new String(this.M[e])),this.M[e].V=f.filter))}return c}function Da(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}y.update=function(a,b){return this.remove(a).add(a,b)}; Da(f,this.X),g.filter&&("string"===typeof this.L[e]&&(this.L[e]=new String(this.L[e])),this.L[e].V=g.filter))}return b}function Da(a,c){const b=a.split(":");let d=0;for(let e=0;e<b.length;e++)a=b[e],"]"===a[a.length-1]&&(a=a.substring(0,a.length-2))&&(c[d]=!0),a&&(b[d++]=a);d<b.length&&(b.length=d);return 1<d?b:b[0]}A.update=function(a,c){return this.remove(a).add(a,c)};
y.remove=function(a){H(a)&&(a=J(a,this.key));for(var b of this.index.values())b.remove(a,!0);if(this.B.has(a)){if(this.tag&&!this.C)for(let c of this.tag.values())for(let d of c){b=d[0];const e=d[1],f=e.indexOf(a);-1<f&&(1<e.length?e.splice(f,1):c.delete(b))}this.store&&this.store.delete(a);this.B.delete(a)}this.cache&&this.cache.remove(a);return this}; A.remove=function(a){H(a)&&(a=J(a,this.key));for(var c of this.index.values())c.remove(a,!0);if(this.B.has(a)){if(this.tag&&!this.C)for(let b of this.tag.values())for(let d of b){c=d[0];const e=d[1],g=e.indexOf(a);-1<g&&(1<e.length?e.splice(g,1):b.delete(c))}this.store&&this.store.delete(a);this.B.delete(a)}this.cache&&this.cache.remove(a);return this};
y.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};y.get=function(a){return this.db?this.index.get(this.A[0]).db.I(a).then(function(b){return b[0]&&b[0].ha}):this.store.get(a)};y.set=function(a,b){this.store.set(a,b);return this}; A.clear=function(){for(const a of this.index.values())a.clear();if(this.tag)for(const a of this.tag.values())a.clear();this.store&&this.store.clear();return this};A.get=function(a){return this.db?this.index.get(this.A[0]).db.H(a).then(function(c){return c[0]&&c[0].ha}):this.store.get(a)};A.set=function(a,c){this.store.set(a,c);return this};
y.import=function(a,b){if(b){G(b)&&(b=JSON.parse(b));a=a.split(".");"json"===a[a.length-1]&&a.pop();var c=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(c)return this.index.get(c).import(a,b);switch(a){case "reg":this.C=!1;this.B=qa(b,this.B);for(let d=0,e;d<this.A.length;d++)e=this.index.get(this.A[d]),e.C=!1,e.B=this.B;break;case "tag":this.tag=pa(b,this.tag);break;case "doc":this.store=oa(b,this.store)}}};na(S.prototype);function T(a){this.J=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}T.prototype.set=function(a,b){this.cache.set(this.h=a,b);this.cache.size>this.J&&this.cache.delete(this.cache.keys().next().value)};T.prototype.get=function(a){const b=this.cache.get(a);b&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,b));return b};T.prototype.remove=function(a){for(const b of this.cache){const c=b[0];b[1].includes(a)&&this.cache.delete(c)}};T.prototype.clear=function(){this.cache.clear();this.h=""};const Fa={normalize:function(a){return a.toLowerCase()},dedupe:!1};const Ga=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Ha=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Ia=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Ja={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Ka=/[\x00-\x7F]+/g;const La=/[\x00-\x7F]+/g;const Ma=/[\x00-\x7F]+/g;var Na={wa:{normalize:!1,dedupe:!1},va:Fa,ya:{normalize:!0,dedupe:!0},ua:{normalize:!0,dedupe:!0,mapper:Ga},ta:{normalize:!0,dedupe:!0,mapper:Ga,matcher:Ha,replacer:Ia},xa:{normalize:!0,dedupe:!0,mapper:Ga,replacer:Ia.concat([/(?!^)[aeo]/g,""]),matcher:Ha},za:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let c=0;c<a.length;c++){var b=a[c];let d=b.charAt(0),e=Ja[d];for(let f=1,g;f<b.length&&(g=b.charAt(f),"h"===g||"w"===g||!(g=Ja[g])||g===e||(d+=g,e=g,4!==d.length));f++);a[c]= A.import=function(a,c){if(c){G(c)&&(c=JSON.parse(c));a=a.split(".");"json"===a[a.length-1]&&a.pop();var b=2<a.length?a[0]:"";a=2<a.length?a[2]:a[1];if(b)return this.index.get(b).import(a,c);switch(a){case "reg":this.C=!1;this.B=qa(c,this.B);for(let d=0,e;d<this.A.length;d++)e=this.index.get(this.A[d]),e.C=!1,e.B=this.B;break;case "tag":this.tag=pa(c,this.tag);break;case "doc":this.store=oa(c,this.store)}}};na(S.prototype);function T(a){this.I=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""}T.prototype.set=function(a,c){this.cache.set(this.h=a,c);this.cache.size>this.I&&this.cache.delete(this.cache.keys().next().value)};T.prototype.get=function(a){const c=this.cache.get(a);c&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,c));return c};T.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b)}};T.prototype.clear=function(){this.cache.clear();this.h=""};const Fa={normalize:function(a){return a.toLowerCase()},dedupe:!1};const Ga=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const Ha=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["pf","f"]]),Ia=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/([^0-9])\1+/g,"$1"];const Ja={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};const Ka=/[\x00-\x7F]+/g;const La=/[\x00-\x7F]+/g;const Ma=/[\x00-\x7F]+/g;var Na={wa:{normalize:!1,dedupe:!1},va:Fa,ya:{normalize:!0,dedupe:!0},ua:{normalize:!0,dedupe:!0,mapper:Ga},ta:{normalize:!0,dedupe:!0,mapper:Ga,matcher:Ha,replacer:Ia},xa:{normalize:!0,dedupe:!0,mapper:Ga,replacer:Ia.concat([/(?!^)[aeo]/g,""]),matcher:Ha},za:{normalize:!0,dedupe:!1,include:{letter:!0},finalize:function(a){for(let b=0;b<a.length;b++){var c=a[b];let d=c.charAt(0),e=Ja[d];for(let g=1,f;g<c.length&&(f=c.charAt(g),"h"===f||"w"===f||!(f=Ja[f])||f===e||(d+=f,e=f,4!==d.length));g++);a[b]=
d}}},qa:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ka," ")}},ra:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(La,"")}},sa:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ma," ")}}};const Oa={memory:{G:1},performance:{G:6,C:!0,context:{depth:1,G:3}},match:{ca:"forward"},score:{G:9,context:{depth:2,G:9}}};const Pa=B();let U,Qa;const V=new Map;function Ra(a){if(Qa){if(V.has(a))return V.get(a)}else Qa=setTimeout(Sa);if("number"==typeof a)var b=a;else{var c=2**32-1;if("number"==typeof a)b=a&c;else{b=0;for(var d=0;d<a.length;d++)b=(33*b^a.charCodeAt(d))&c;b+=2**31}}if(!U){U=Array(255);for(c=0;255>c;c++)U[c]=c+1;U=String.fromCharCode.apply(null,U)}c=b;for(d="";b=c%255,d=U.charAt(b)+d,c=c/255|0,c;);b=d;2E5<V.size&&V.clear();V.set(a,b);return b}function Sa(){Qa=null;V.clear()};L.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.B.has(a))return this.update(a,b);b=this.U.encode(b);if(d=b.length){const l=B(),m=B(),r=this.depth,n=this.G;for(let p=0;p<d;p++){let t=b[this.rtl?d-1-p:p];var e=t.length;if(e&&(r||!m[t])){var f=this.L?this.L(b,t,p,null,0):Ta(n,d,p),g="";switch(this.ca){case "full":if(2<e){for(f=0;f<e;f++)for(var h=e;h>f;h--){g=t.substring(f,h);var k=this.L?this.L(b,t,p,g,f):Ta(n,d,p,e,f);W(this,m,g,k,a,c)}break}case "reverse":if(1<e){for(h=e-1;0<h;h--)g= d}}},qa:{rtl:!0,normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ka," ")}},ra:{normalize:!1,dedupe:!0,split:"",prepare:function(a){return(""+a).replace(La,"")}},sa:{normalize:!1,dedupe:!0,prepare:function(a){return(""+a).replace(Ma," ")}}};const Oa={memory:{K:1},performance:{K:6,C:!0,context:{depth:1,K:3}},match:{ca:"forward"},score:{K:9,context:{depth:2,K:9}}};const Pa=C();let U,Qa;const V=new Map;function Ra(a){if(Qa){if(V.has(a))return V.get(a)}else Qa=setTimeout(Sa);if("number"==typeof a)var c=a;else{var b=2**32-1;if("number"==typeof a)c=a&b;else{c=0;for(var d=0;d<a.length;d++)c=(33*c^a.charCodeAt(d))&b;c+=2**31}}if(!U){U=Array(255);for(b=0;255>b;b++)U[b]=b+1;U=String.fromCharCode.apply(null,U)}b=c;for(d="";c=b%255,d=U.charAt(c)+d,b=b/255|0,b;);c=d;2E5<V.size&&V.clear();V.set(a,c);return c}function Sa(){Qa=null;V.clear()};L.prototype.add=function(a,c,b,d){if(c&&(a||0===a)){if(!d&&!b&&this.B.has(a))return this.update(a,c);c=this.U.encode(c);if(d=c.length){const l=C(),m=C(),u=this.depth,n=this.K;for(let p=0;p<d;p++){let t=c[this.rtl?d-1-p:p];var e=t.length;if(e&&(u||!m[t])){var g=this.O?this.O(c,t,p,null,0):Ta(n,d,p),f="";switch(this.ca){case "full":if(2<e){for(g=0;g<e;g++)for(var k=e;k>g;k--){f=t.substring(g,k);var h=this.O?this.O(c,t,p,f,g):Ta(n,d,p,e,g);W(this,m,f,h,a,b)}break}case "reverse":if(1<e){for(k=e-1;0<k;k--)f=
t[h]+g,k=this.L?this.L(b,t,p,g,h):Ta(n,d,p,e,h),W(this,m,g,k,a,c);g=""}case "forward":if(1<e){for(h=0;h<e;h++)g+=t[h],W(this,m,g,f,a,c);break}default:if(W(this,m,t,f,a,c),r&&1<d&&p<d-1)for(e=B(),g=this.ja,f=t,h=Math.min(r+1,d-p),e[f]=1,k=1;k<h;k++)if((t=b[this.rtl?d-1-p-k:p+k])&&!e[t]){e[t]=1;const q=this.L?this.L(b,f,p,t,k):Ta(g+(d/2>g?0:1),d,p,h-1,k-1),u=this.fa&&t>f;W(this,l,u?f:t,q,a,c,u?t:f)}}}}this.C||this.B.add(a)}else b=""}this.db&&(b||this.ga.push({del:a}),this.na&&Ua(this));return this}; t[k]+f,h=this.O?this.O(c,t,p,f,k):Ta(n,d,p,e,k),W(this,m,f,h,a,b);f=""}case "forward":if(1<e){for(k=0;k<e;k++)f+=t[k],W(this,m,f,g,a,b);break}default:if(W(this,m,t,g,a,b),u&&1<d&&p<d-1)for(e=C(),f=this.ja,g=t,k=Math.min(u+1,d-p),e[g]=1,h=1;h<k;h++)if((t=c[this.rtl?d-1-p-h:p+h])&&!e[t]){e[t]=1;const q=this.O?this.O(c,g,p,t,h):Ta(f+(d/2>f?0:1),d,p,k-1,h-1),v=this.fa&&t>g;W(this,l,v?g:t,q,a,b,v?t:g)}}}}this.C||this.B.add(a)}else c=""}this.db&&(c||this.ga.push({del:a}),this.na&&Ua(this));return this};
function W(a,b,c,d,e,f,g){let h=g?a.S:a.map,k;if(!b[c]||g&&!(k=b[c])[g])if(g?(b=k||(b[c]=B()),b[g]=1,a.aa&&(g=Ra(g)),(k=h.get(g))?h=k:h.set(g,h=new Map)):b[c]=1,a.aa&&(c=Ra(c)),(k=h.get(c))?h=k:h.set(c,h=k=[]),h=h[d]||(h[d]=[]),!f||!h.includes(e)){if(h.length===2**31-1){b=new P(h);if(a.C)for(let l of a.B.values())l.includes(h)&&(l[l.indexOf(h)]=b);k[d]=h=b}h.push(e);a.C&&((d=a.B.get(e))?d.push(h):a.B.set(e,[h]))}} function W(a,c,b,d,e,g,f){let k=f?a.S:a.map,h;if(!c[b]||f&&!(h=c[b])[f])if(f?(c=h||(c[b]=C()),c[f]=1,a.aa&&(f=Ra(f)),(h=k.get(f))?k=h:k.set(f,k=new Map)):c[b]=1,a.aa&&(b=Ra(b)),(h=k.get(b))?k=h:k.set(b,k=h=[]),k=k[d]||(k[d]=[]),!g||!k.includes(e)){if(k.length===2**31-1){c=new P(k);if(a.C)for(let l of a.B.values())l.includes(k)&&(l[l.indexOf(k)]=c);h[d]=k=c}k.push(e);a.C&&((d=a.B.get(e))?d.push(k):a.B.set(e,[k]))}}
function Ta(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0};function X(a,b,c,d){if(1===a.length)return a=a[0],a=c||a.length>b?b?a.slice(c,c+b):a.slice(c):a,d?Va(a):a;let e=[];for(let f=0,g,h;f<a.length;f++)if((g=a[f])&&(h=g.length)){if(c){if(c>=h){c-=h;continue}c<h&&(g=b?g.slice(c,c+b):g.slice(c),h=g.length,c=0)}if(e.length)h>b&&(g=g.slice(0,b),h=g.length),e.push(g);else{if(h>=b)return h>b&&(g=g.slice(0,b)),d?Va(g):g;e=[g]}b-=h;if(!b)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Va(e):e} function Ta(a,c,b,d,e){return b&&1<a?c+(d||0)<=a?b+(e||0):(a-1)/(c+(d||0))*(b+(e||0))+1|0:0};function X(a,c,b,d){if(1===a.length)return a=a[0],a=b||a.length>c?c?a.slice(b,b+c):a.slice(b):a,d?Va(a):a;let e=[];for(let g=0,f,k;g<a.length;g++)if((f=a[g])&&(k=f.length)){if(b){if(b>=k){b-=k;continue}b<k&&(f=c?f.slice(b,b+c):f.slice(b),k=f.length,b=0)}if(e.length)k>c&&(f=f.slice(0,c),k=f.length),e.push(f);else{if(k>=c)return k>c&&(f=f.slice(0,c)),d?Va(f):f;e=[f]}c-=k;if(!c)break}if(!e.length)return e;e=1<e.length?[].concat.apply([],e):e[0];return d?Va(e):e}
function Va(a){for(let b=0;b<a.length;b++)a[b]={L:b,id:a[b]};return a};Y.prototype.or=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.or.apply(a,b)});if(c[0]&&c[0].index)return this.or.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.J||0;f=l.offset||0;g=l.I;h=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.K)m=this.K(l.K); function Va(a){for(let c=0;c<a.length;c++)a[c]={score:c,id:a[c]};return a};Y.prototype.or=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.or.apply(a,c)});if(b[0]&&b[0].index)return this.or.apply(this,b);let d=[];b=[];let e=0,g=0,f,k;for(let h=0,l;h<c.length;h++)if(l=c[h]){e=l.I||0;g=l.offset||0;f=l.H;k=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.and)m=this.and(l.and);else if(l.xor)m=this.xor(l.xor);else if(l.J)m=this.J(l.J);
else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Wa(d,e,f,g,h,a.O);return h?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Wa(d,e,f,g,h,this.O));return h?this.result:this};function Wa(a,b,c,d,e,f){if(!a.length)return a;"object"===typeof b&&(c=b.offset||0,d=b.I||!1,b=b.J||0);return 2>a.length?e?X(a[0],b,c,d):a[0]:xa(a,c,b,e,f)};Y.prototype.and=function(){if(this.result.length){const b=this;let c=arguments;var a=c[0];if(a.then)return a.then(function(){return b.and.apply(b,c)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,f=0,g,h;for(let k=0,l;k<c.length;k++)if(l=c[k]){e=l.J||0;f=l.offset||0;g=l.resolve;h=l.ka;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor); else continue;d[h]=m;m.then&&b.push(m)}if(b.length)return Promise.all(b).then(function(){a.result.length&&(d=d.concat([a.result]));a.result=Wa(d,e,g,f,k,a.N);return k?a.result:a});d.length&&(this.result.length&&(d=d.concat([this.result])),this.result=Wa(d,e,g,f,k,this.N));return k?this.result:this};function Wa(a,c,b,d,e,g){if(!a.length)return a;"object"===typeof c&&(b=c.offset||0,d=c.H||!1,c=c.I||0);return 2>a.length?e?X(a[0],c,b,d):a[0]:xa(a,b,c,e,g)};Y.prototype.and=function(){if(this.result.length){const c=this;let b=arguments;var a=b[0];if(a.then)return a.then(function(){return c.and.apply(c,b)});if(a[0]&&a[0].index)return this.and.apply(this,a);let d=[];a=[];let e=0,g=0,f,k;for(let h=0,l;h<b.length;h++)if(l=b[h]){e=l.I||0;g=l.offset||0;f=l.resolve;k=l.ka;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.xor)m=this.xor(l.xor);
else if(l.K)m=this.K(l.K);else continue;d[k]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,g?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[b.result].concat(d);b.result=Xa(d,e,f,g,b.O,h);return g?b.result:b});d=[this.result].concat(d);this.result=Xa(d,e,f,g,this.O,h);return g?this.result:this}return this};function Xa(a,b,c,d,e,f){if(2>a.length)return[];let g=[];B();let h=ba(a);return h?wa(a,h,b,c,f,e,d):g};Y.prototype.xor=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.xor.apply(a,b)});if(c[0]&&c[0].index)return this.xor.apply(this,c);let d=[];c=[];let e=0,f=0,g,h;for(let k=0,l;k<b.length;k++)if(l=b[k]){e=l.J||0;f=l.offset||0;g=l.I;h=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.K)m=this.K(l.K); else if(l.J)m=this.J(l.J);else continue;d[h]=m;m.then&&a.push(m)}if(!d.length)return this.result=d,f?this.result:this;if(a.length)return Promise.all(a).then(function(){d=[c.result].concat(d);c.result=Xa(d,e,g,f,c.N,k);return f?c.result:c});d=[this.result].concat(d);this.result=Xa(d,e,g,f,this.N,k);return f?this.result:this}return this};function Xa(a,c,b,d,e,g){if(2>a.length)return[];let f=[];C();let k=ba(a);return k?wa(a,k,c,b,g,e,d):f};Y.prototype.xor=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.xor.apply(a,c)});if(b[0]&&b[0].index)return this.xor.apply(this,b);let d=[];b=[];let e=0,g=0,f,k;for(let h=0,l;h<c.length;h++)if(l=c[h]){e=l.I||0;g=l.offset||0;f=l.H;k=l.resolve;let m;if(l.constructor===Y)m=l.result;else if(l.constructor===Array)m=l;else if(l.index)l.resolve=!1,m=l.index.search(l).result;else if(l.or)m=this.or(l.or);else if(l.and)m=this.and(l.and);else if(l.J)m=this.J(l.J);
else continue;d[k]=m;m.then&&c.push(m)}if(c.length)return Promise.all(c).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Ya(d,e,f,g,!h,a.O);return h?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Ya(d,e,f,g,!h,a.O));return h?this.result:this}; else continue;d[h]=m;m.then&&b.push(m)}if(b.length)return Promise.all(b).then(function(){a.result.length&&(d=[a.result].concat(d));a.result=Ya(d,e,g,f,!k,a.N);return k?a.result:a});d.length&&(this.result.length&&(d=[this.result].concat(d)),this.result=Ya(d,e,g,f,!k,a.N));return k?this.result:this};
function Ya(a,b,c,d,e,f){if(!a.length)return a;if(2>a.length)return e?X(a[0],b,c,d):a[0];d=[];const g=B();let h=0;for(let k=0,l;k<a.length;k++)if(l=a[k])for(let m=0,r;m<l.length;m++)if(r=l[m]){h<r.length&&(h=r.length);for(let n=0,p;n<r.length;n++)p=r[n],g[p]?g[p]++:g[p]=1}for(let k=0,l,m=0;k<h;k++)for(let r=0,n;r<a.length;r++)if(n=a[r])if(l=n[k])for(let p=0,t;p<l.length;p++)if(t=l[p],1===g[t])if(c)c--;else if(e){if(d.push(t),d.length===b)return d}else{const q=k+(r?f:0);d[q]||(d[q]=[]);d[q].push(t); function Ya(a,c,b,d,e,g){if(!a.length)return a;if(2>a.length)return e?X(a[0],c,b,d):a[0];d=[];const f=C();let k=0;for(let h=0,l;h<a.length;h++)if(l=a[h])for(let m=0,u;m<l.length;m++)if(u=l[m]){k<u.length&&(k=u.length);for(let n=0,p;n<u.length;n++)p=u[n],f[p]?f[p]++:f[p]=1}for(let h=0,l,m=0;h<k;h++)for(let u=0,n;u<a.length;u++)if(n=a[u])if(l=n[h])for(let p=0,t;p<l.length;p++)if(t=l[p],1===f[t])if(b)b--;else if(e){if(d.push(t),d.length===c)return d}else{const q=h+(u?g:0);d[q]||(d[q]=[]);d[q].push(t);
if(++m===b)return d}return d};Y.prototype.K=function(){const a=this;let b=arguments;var c=b[0];if(c.then)return c.then(function(){return a.K.apply(a,b)});if(c[0]&&c[0].index)return this.K.apply(this,c);let d=[];c=[];let e=0,f=0,g;for(let h=0,k;h<b.length;h++)if(k=b[h]){e=k.J||0;f=k.offset||0;g=k.resolve;let l;if(k.constructor===Y)l=k.result;else if(k.constructor===Array)l=k;else if(k.index)k.resolve=!1,l=k.index.search(k).result;else if(k.or)l=this.or(k.or);else if(k.and)l=this.and(k.and);else if(k.xor)l=this.xor(k.xor);else continue; if(++m===c)return d}return d};Y.prototype.J=function(){const a=this;let c=arguments;var b=c[0];if(b.then)return b.then(function(){return a.J.apply(a,c)});if(b[0]&&b[0].index)return this.J.apply(this,b);let d=[];b=[];let e=0,g=0,f;for(let k=0,h;k<c.length;k++)if(h=c[k]){e=h.I||0;g=h.offset||0;f=h.resolve;let l;if(h.constructor===Y)l=h.result;else if(h.constructor===Array)l=h;else if(h.index)h.resolve=!1,l=h.index.search(h).result;else if(h.or)l=this.or(h.or);else if(h.and)l=this.and(h.and);else if(h.xor)l=this.xor(h.xor);else continue;
d[h]=l;l.then&&c.push(l)}if(c.length)return Promise.all(c).then(function(){a.result=$a.call(a,d,e,f,g);return g?a.result:a});d.length&&(this.result=$a.call(this,d,e,f,g));return g?this.result:this}; d[k]=l;l.then&&b.push(l)}if(b.length)return Promise.all(b).then(function(){a.result=$a.call(a,d,e,g,f);return f?a.result:a});d.length&&(this.result=$a.call(this,d,e,g,f));return f?this.result:this};
function $a(a,b,c,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let f=0,g,h=0;f<this.result.length;f++)if(g=this.result[f])for(let k=0,l;k<g.length;k++)if(l=g[k],!a.has(l))if(c)c--;else if(d){if(e.push(l),e.length===b)return e}else if(e[f]||(e[f]=[]),e[f].push(l),++h===b)return e;return e};function Y(a){if(!this||this.constructor!==Y)return new Y(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.O=a.ma||0,this.result=a.index.search(a).result,this;if(a.constructor===Y)return a;this.index=null;this.result=a||[];this.O=0}Y.prototype.J=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+c<a)b[d]=e,c+=e.length;else{b[d]=e.slice(0,a-c);this.result=b;break}}return this}; function $a(a,c,b,d){if(!a.length)return this.result;const e=[];a=new Set(a.flat().flat());for(let g=0,f,k=0;g<this.result.length;g++)if(f=this.result[g])for(let h=0,l;h<f.length;h++)if(l=f[h],!a.has(l))if(b)b--;else if(d){if(e.push(l),e.length===c)return e}else if(e[g]||(e[g]=[]),e[g].push(l),++k===c)return e;return e};function Y(a){if(!this||this.constructor!==Y)return new Y(a);if(a&&a.index)return a.resolve=!1,this.index=a.index,this.N=a.ma||0,this.result=a.index.search(a).result,this;if(a.constructor===Y)return a;this.index=null;this.result=a||[];this.N=0}Y.prototype.I=function(a){if(this.result.length){const c=[];let b=0;for(let d=0,e;d<this.result.length;d++)if(e=this.result[d],e.length+b<a)c[d]=e,b+=e.length;else{c[d]=e.slice(0,a-b);this.result=c;break}}return this};
Y.prototype.offset=function(a){if(this.result.length){const b=[];let c=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+c<a?c+=e.length:(b[d]=e.slice(a-c),c=a);this.result=b}return this};Y.prototype.ma=function(a){this.O+=a;return this};Y.prototype.resolve=function(a,b,c){ab=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(c=a.I,b=a.offset,a=a.J),X(d,a||100,b,c)):d};let ab=1; Y.prototype.offset=function(a){if(this.result.length){const c=[];let b=0;for(let d=0,e;d<this.result.length;d++)e=this.result[d],e.length+b<a?b+=e.length:(c[d]=e.slice(a-b),b=a);this.result=c}return this};Y.prototype.ma=function(a){this.N+=a;return this};Y.prototype.resolve=function(a,c,b){ab=1;const d=this.result;this.result=this.index=null;return d.length?("object"===typeof a&&(b=a.H,c=a.offset,a=a.I),X(d,a||100,c,b)):d};let ab=1;
L.prototype.search=function(a,b,c){c||(!b&&H(a)?(c=a,a=""):H(b)&&(c=b,b=0));let d=[],e;let f,g=0,h,k,l,m;if(c){a=c.query||a;b=c.J||b;g=c.offset||0;var r=c.context;f=c.ka;(h=ab&&!1!==c.resolve)||(ab=0);k=h&&c.I;m=c.ma;l=this.db&&c.tag}else h=this.resolve||ab;a=this.U.encode(a);e=a.length;b||!h||(b=100);if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);r=this.depth&&!1!==r;if(2===e&&r&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);let n=c=0;if(1<e){const q=B(),u=[];for(let w=0,D;w<e;w++)if((D=a[w])&&!q[D]){if(f|| L.prototype.search=function(a,c,b){b||(!c&&H(a)?(b=a,a=""):H(c)&&(b=c,c=0));let d=[],e,g,f,k=0,h,l,m,u,n;b?(a=b.query||a,c=b.I||c,k=b.offset||0,g=b.context,f=b.ka,(h=ab&&!1!==b.resolve)||(ab=0),l=h&&b.H,u=b.ma,n=b.K,m=this.db&&b.tag):h=this.resolve||ab;let p=this.U.encode(a);e=p.length;c||!h||(c=100);if(1===e)return bb.call(this,p[0],"",c,k,h,l,m);g=this.depth&&!1!==g;if(2===e&&g&&!f)return bb.call(this,p[0],p[1],c,k,h,l,m);let t=b=0;if(1<e){const w=C(),z=[];for(let x=0,r;x<e;x++)if((r=p[x])&&!w[r]){if(f||
this.db||Z(this,D))u.push(D),q[D]=1;else return h?d:new Y(d);const x=D.length;c=Math.max(c,x);n=n?Math.min(n,x):x}a=u;e=a.length}if(!e)return h?d:new Y(d);let p=0,t;if(1===e)return bb.call(this,a[0],"",b,g,h,k,l);if(2===e&&r&&!f)return bb.call(this,a[0],a[1],b,g,h,k,l);1<e&&(r?(t=a[0],p=1):9<c&&3<c/n&&a.sort(aa));if(this.db){if(this.db.search&&(r=this.db.search(this,a,b,g,f,h,k,l),!1!==r))return r;const q=this;return async function(){for(let u,w;p<e;p++){w=a[p];t?(u=await Z(q,w,t,0,0,!1,!1),u=cb(u, this.db||Z(this,r))z.push(r),w[r]=1;else return h?d:new Y(d);const y=r.length;b=Math.max(b,y);t=t?Math.min(t,y):y}p=z;e=a.length}if(!e)return h?d:new Y(d);let q=0,v;if(1===e)return bb.call(this,p[0],"",c,k,h,l,m);if(2===e&&g&&!f)return bb.call(this,p[0],p[1],c,k,h,l,m);1<e&&(g?(v=p[0],q=1):9<b&&3<b/t&&p.sort(aa));n||0===n||(n=this.K);if(this.db){if(this.db.search&&(a=this.db.search(this,p,c,k,f,h,l,m),!1!==a))return a;const w=this;return async function(){for(let z,x;q<e;q++){x=p[q];v?(z=await Z(w,
d,f,q.ja),f&&!1===u&&d.length||(t=w)):(u=await Z(q,w,"",0,0,!1,!1),u=cb(u,d,f,q.G));if(u)return u;if(f&&p===e-1){let D=d.length;if(!D){if(t){t="";p=-1;continue}return d}if(1===D)return h?X(d[0],b,g):new Y(d[0])}}return h?wa(d,q.G,b,g,f,m,h):new Y(d[0])}()}for(let q,u;p<e;p++){u=a[p];t?(q=Z(this,u,t,0,0,!1,!1),q=cb(q,d,f,this.ja),f&&!1===q&&d.length||(t=u)):(q=Z(this,u,"",0,0,!1,!1),q=cb(q,d,f,this.G));if(q)return q;if(f&&p===e-1){r=d.length;if(!r){if(t){t="";p=-1;continue}return d}if(1===r)return h? x,v,0,0,!1,!1),z=cb(z,d,f,w.ja),f&&!1===z&&d.length||(v=x)):(z=await Z(w,x,"",0,0,!1,!1),z=cb(z,d,f,n));if(z)return z;if(f&&q===e-1){let r=d.length;if(!r){if(v){v="";q=-1;continue}return d}if(1===r)return h?X(d[0],c,k):new Y(d[0])}}return h?wa(d,n,c,k,f,u,h):new Y(d[0])}()}for(let w,z;q<e;q++){z=p[q];v?(w=Z(this,z,v,0,0,!1,!1),w=cb(w,d,f,this.ja),f&&!1===w&&d.length||(v=z)):(w=Z(this,z,"",0,0,!1,!1),w=cb(w,d,f,n));if(w)return w;if(f&&q===e-1){a=d.length;if(!a){if(v){v="";q=-1;continue}return d}if(1===
X(d[0],b,g):new Y(d[0])}}d=wa(d,this.G,b,g,f,m,h);return h?d:new Y(d)};function bb(a,b,c,d,e,f,g){a=Z(this,a,b,c,d,e,f,g);return this.db?a.then(function(h){return e?h:h&&h.length?e?X(h,c,d):new Y(h):e?[]:new Y([])}):a&&a.length?e?X(a,c,d):new Y(a):e?[]:new Y([])}function cb(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let f=0,g;f<d;f++)(g=a[f])&&g&&(e[f]=g);if(e.length){b.push(e);return}}return!c&&e} a)return h?X(d[0],c,k):new Y(d[0])}}d=wa(d,n,c,k,f,u,h);return h?d:new Y(d)};function bb(a,c,b,d,e,g,f){a=Z(this,a,c,b,d,e,g,f);return this.db?a.then(function(k){return e?k:k&&k.length?e?X(k,b,d):new Y(k):e?[]:new Y([])}):a&&a.length?e?X(a,b,d):new Y(a):e?[]:new Y([])}function cb(a,c,b,d){let e=[];if(a){d=Math.min(a.length,d);for(let g=0,f;g<d;g++)(f=a[g])&&f&&(e[g]=f);if(e.length){c.push(e);return}}return!b&&e}
function Z(a,b,c,d,e,f,g,h){let k;c&&(k=a.fa&&b>c);a.aa&&(b=Ra(b),c&&(c=Ra(c)));if(a.db)return c?a.db.get(k?c:b,k?b:c,d,e,f,g,h):a.db.get(b,"",d,e,f,g,h);a=c?(a=a.S.get(k?b:c))&&a.get(k?c:b):a.map.get(b);return a};L.prototype.remove=function(a,b){const c=this.B.size&&(this.C?this.B.get(a):this.B.has(a));if(c){if(this.C)for(let d=0,e;d<c.length;d++){if(e=c[d])if(2>e.length)e.pop();else{const f=e.indexOf(a);f===c.length-1?e.pop():e.splice(f,1)}}else db(this.map,a),this.depth&&db(this.S,a);b||this.B.delete(a)}this.db&&(this.ga.push({del:a}),this.na&&Ua(this));this.cache&&this.cache.remove(a);return this}; function Z(a,c,b,d,e,g,f,k){let h;b&&(h=a.fa&&c>b);a.aa&&(c=Ra(c),b&&(b=Ra(b)));if(a.db)return b?a.db.get(h?b:c,h?c:b,d,e,g,f,k):a.db.get(c,"",d,e,g,f,k);a=b?(a=a.S.get(h?c:b))&&a.get(h?b:c):a.map.get(c);return a};L.prototype.remove=function(a,c){const b=this.B.size&&(this.C?this.B.get(a):this.B.has(a));if(b){if(this.C)for(let d=0,e;d<b.length;d++){if(e=b[d])if(2>e.length)e.pop();else{const g=e.indexOf(a);g===b.length-1?e.pop():e.splice(g,1)}}else db(this.map,a),this.depth&&db(this.S,a);c||this.B.delete(a)}this.db&&(this.ga.push({del:a}),this.na&&Ua(this));this.cache&&this.cache.remove(a);return this};
function db(a,b){let c=0;if(a.constructor===Array)for(let d=0,e,f;d<a.length;d++){if((e=a[d])&&e.length)if(f=e.indexOf(b),0<=f){1<e.length?(e.splice(f,1),c++):delete a[d];break}else c++}else for(let d of a){const e=d[0],f=db(d[1],b);f?c+=f:a.delete(e)}return c};function L(a,b){if(!this||this.constructor!==L)return new L(a);var c=Pa.profiler||(Pa.profiler={});c["Index.create"]||(c["Index.create"]=0);c["Index.create"]++;if(a){if(c=G(a)?a:a.preset)Oa[c]||console.warn("Preset not found: "+c),a=Object.assign({},Oa[c],a)}else a={};c=a.context||{};const d=G(a.U)?Na[a.U]:a.encode||a.U||Fa;this.U=d.encode?d:"object"===typeof d?new K(d):{encode:d};this.aa=a.aa||a.Ba||!1;let e;this.G=a.G||9;this.ca=e=a.ca||"strict";this.depth="strict"===e&&c.depth||0;this.fa=!1!== function db(a,c){let b=0;if(a.constructor===Array)for(let d=0,e,g;d<a.length;d++){if((e=a[d])&&e.length)if(g=e.indexOf(c),0<=g){1<e.length?(e.splice(g,1),b++):delete a[d];break}else b++}else for(let d of a){const e=d[0],g=db(d[1],c);g?b+=g:a.delete(e)}return b};function L(a,c){if(!this||this.constructor!==L)return new L(a);var b=Pa.profiler||(Pa.profiler={});b["Index.create"]||(b["Index.create"]=0);b["Index.create"]++;if(a){if(b=G(a)?a:a.Ea)Oa[b]||console.warn("Preset not found: "+b),a=Object.assign({},Oa[b],a)}else a={};b=a.context;const d=!0===b?{depth:1}:b||{},e=G(a.U)?Na[a.U]:a.encode||a.U||Fa;this.U=e.encode?e:"object"===typeof e?new K(e):{encode:e};this.aa=a.aa||a.Ba||!1;this.K=a.K||9;this.ca=b=a.ca||"strict";this.depth="strict"===b&&d.depth||0;this.fa=
c.fa;this.C=!!a.C;this.L=a.L||null;(e=a.ia||0)&&(this.ia=e);this.map=e?new Q(e):new Map;this.S=e?new Q(e):new Map;this.B=b||(this.C?e?new Q(e):new Map:e?new R(e):new Set);this.ja=c.G||1;this.rtl=d.rtl||a.rtl||!1;this.cache=(e=a.cache||null)&&new T(e);this.resolve=!1!==a.resolve;if(e=a.db)this.db=this.Y(e);this.na=!1!==a.commit;this.ga=[];this.h=null}y=L.prototype;y.Y=function(a){this.h&&(clearTimeout(this.h),this.h=null);return a.Y(this)}; !1!==d.fa;this.C=!!a.C;this.O=a.O||null;(b=a.ia||0)&&(this.ia=b);this.map=b?new Q(b):new Map;this.S=b?new Q(b):new Map;this.B=c||(this.C?b?new Q(b):new Map:b?new R(b):new Set);this.ja=d.K||3;this.rtl=e.rtl||a.rtl||!1;this.cache=(b=a.cache||null)&&new T(b);this.resolve=!1!==a.resolve;if(b=a.db)this.db=this.Y(b);this.na=!1!==a.commit;this.ga=[];this.h=null}A=L.prototype;A.Y=function(a){this.h&&(clearTimeout(this.h),this.h=null);return a.Y(this)};
y.commit=function(a,b){this.h&&(clearTimeout(this.h),this.h=null);return this.db.commit(this,a,b)};function Ua(a){a.h||(a.h=setTimeout(function(){a.h=null;a.db.commit(a,void 0,void 0)},0))}y.clear=function(){this.map.clear();this.S.clear();this.B.clear();this.cache&&this.cache.clear();this.db&&(this.h&&clearTimeout(this.h),this.h=null,this.ga=[{clear:!0}]);return this};y.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)}; A.commit=function(a,c){this.h&&(clearTimeout(this.h),this.h=null);return this.db.commit(this,a,c)};function Ua(a){a.h||(a.h=setTimeout(function(){a.h=null;a.db.commit(a,void 0,void 0)},0))}A.clear=function(){this.map.clear();this.S.clear();this.B.clear();this.cache&&this.cache.clear();this.db&&(this.h&&clearTimeout(this.h),this.h=null,this.ga=[{clear:!0}]);return this};A.update=function(a,c){const b=this,d=this.remove(a);return d&&d.then?d.then(()=>b.add(a,c)):this.add(a,c)};
y.import=function(a,b){if(b)switch(G(b)&&(b=JSON.parse(b)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.C=!1;this.B=qa(b,this.B);break;case "map":this.map=oa(b,this.map);break;case "ctx":this.S=pa(b,this.S)}};na(L.prototype);const eb={prepare:function(a){return a.replace(/\u00b4`\u2019\u02bc/g,"'").replace(/_+/g," ").replace(/&/g," et ").replace(/\u20ac/g," EUR ").replace(/\bl'([^\b])/g,"la le $1").replace(/\bt'([^\b])/g,"ta te $1").replace(/\bc'([^\b])/g,"ca ce $1").replace(/\bd'([^\b])/g,"da de $1").replace(/\bj'([^\b])/g,"ja je $1").replace(/\bn'([^\b])/g,"na ne $1").replace(/\bm'([^\b])/g,"ma me $1").replace(/\bs'([^\b])/g,"sa se $1").replace(/\bau\b/g,"a le").replace(/\baux\b/g,"a les").replace(/\bdu\b/g,"de le").replace(/\bdes\b/g, A.import=function(a,c){if(c)switch(G(c)&&(c=JSON.parse(c)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),a=1<a.length?a[1]:a[0],a){case "reg":this.C=!1;this.B=qa(c,this.B);break;case "map":this.map=oa(c,this.map);break;case "ctx":this.S=pa(c,this.S)}};na(L.prototype);const eb={prepare:function(a){return a.replace(/\u00b4`\u2019\u02bc/g,"'").replace(/_+/g," ").replace(/&/g," et ").replace(/\u20ac/g," EUR ").replace(/\bl'([^\b])/g,"la le $1").replace(/\bt'([^\b])/g,"ta te $1").replace(/\bc'([^\b])/g,"ca ce $1").replace(/\bd'([^\b])/g,"da de $1").replace(/\bj'([^\b])/g,"ja je $1").replace(/\bn'([^\b])/g,"na ne $1").replace(/\bm'([^\b])/g,"ma me $1").replace(/\bs'([^\b])/g,"sa se $1").replace(/\bau\b/g,"a le").replace(/\baux\b/g,"a les").replace(/\bdu\b/g,"de le").replace(/\bdes\b/g,
"de les")},filter:new Set("au aux avec ce ces dans de des du elle en et eux il je la le leur lui ma mais me meme mes moi mon ne nos notre nous on ou par pas pour qu que qui sa se ses son sur ta te tes toi ton tu un une vos votre vous c d j l m n s t a y ete etee etees etes etant suis es est sommes etes sont serai seras sera serons serez seront serais serait serions seriez seraient etais etait etions etiez etaient fus fut fumes futes furent sois soit soyons soyez soient fusse fusses fut fussions fussiez fussent ayant eu eue eues eus ai as avons avez ont aurai auras aura aurons aurez auront aurais aurait aurions auriez auraient avais avait avions aviez avaient eut eumes eutes eurent aie aies ait ayons ayez aient eusse eusses eut eussions eussiez eussent ceci cela cela cet cette ici ils les leurs quel quels quelle quelles sans soi".split(" ")), "de les")},filter:new Set("au aux avec ce ces dans de des du elle en et eux il je la le leur lui ma mais me meme mes moi mon ne nos notre nous on ou par pas pour qu que qui sa se ses son sur ta te tes toi ton tu un une vos votre vous c d j l m n s t a y ete etee etees etes etant suis es est sommes etes sont serai seras sera serons serez seront serais serait serions seriez seraient etais etait etions etiez etaient fus fut fumes futes furent sois soit soyons soyez soient fusse fusses fut fussions fussiez fussent ayant eu eue eues eus ai as avons avez ont aurai auras aura aurons aurez auront aurais aurait aurions auriez auraient avais avait avions aviez avaient eut eumes eutes eurent aie aies ait ayons ayez aient eusse eusses eut eussions eussiez eussent ceci cela cela cet cette ici ils les leurs quel quels quelle quelles sans soi".split(" ")),
stemmer:new Map([["lement",""],["ient",""],["nera",""],["ment",""],["ais",""],["ait",""],["ant",""],["ent",""],["iez",""],["ion",""],["nez",""],["ai",""],["es",""],["er",""],["ez",""],["le",""],["na",""],["ne",""],["a",""],["e",""]])};"undefined"!==typeof module&&module.exports?module.exports=eb:self.FlexSearch&&(self.FlexSearch.Language.fr=eb);}(this||self)); stemmer:new Map([["lement",""],["ient",""],["nera",""],["ment",""],["ais",""],["ait",""],["ant",""],["ent",""],["iez",""],["ion",""],["nez",""],["ai",""],["es",""],["er",""],["ez",""],["le",""],["na",""],["ne",""],["a",""],["e",""]])};"undefined"!==typeof module&&module.exports?module.exports=eb:self.FlexSearch&&(self.FlexSearch.Language.fr=eb);}(this||self));

View File

@@ -1,5 +1,5 @@
import { SearchOptions, ContextOptions, DocumentDescriptor, DocumentSearchOptions, DocumentIndexOptions, IndexOptions, DocumentOptions, TagOptions, StoreOptions, EncoderOptions, EncoderSplitOptions, PersistentOptions, ResolverOptions } from "./type.js"; import { SearchOptions, ContextOptions, DocumentDescriptor, DocumentSearchOptions, FieldOptions, IndexOptions, DocumentOptions, TagOptions, StoreOptions, EncoderOptions, EncoderSplitOptions, PersistentOptions, ResolverOptions } from "./type.js";
import StorageInterface from "./db/interface.js"; import StorageInterface from "./db/interface.js";
import Document from "./document.js"; import Document from "./document.js";
import Index from "./index.js"; import Index from "./index.js";
@@ -46,6 +46,14 @@ import Charset from "./charset.js";
/** @export */Index.prototype.document; /** @export */Index.prototype.document;
/** @export */Index.prototype.encoder; /** @export */Index.prototype.encoder;
/** @export */Encoder.prototype.assign;
/** @export */Encoder.prototype.encode;
/** @export */Encoder.prototype.addMatcher;
/** @export */Encoder.prototype.addStemmer;
/** @export */Encoder.prototype.addFilter;
/** @export */Encoder.prototype.addMapper;
/** @export */Encoder.prototype.addReplacer;
/** @export */Document.prototype.add; /** @export */Document.prototype.add;
/** @export */Document.prototype.append; /** @export */Document.prototype.append;
/** @export */Document.prototype.search; /** @export */Document.prototype.search;
@@ -76,6 +84,7 @@ import Charset from "./charset.js";
/** @export */Resolver.prototype.and; /** @export */Resolver.prototype.and;
/** @export */Resolver.prototype.xor; /** @export */Resolver.prototype.xor;
/** @export */Resolver.prototype.not; /** @export */Resolver.prototype.not;
/** @export */Resolver.prototype.result;
/** @export */StorageInterface.db; /** @export */StorageInterface.db;
/** @export */StorageInterface.id; /** @export */StorageInterface.id;
@@ -118,25 +127,27 @@ import Charset from "./charset.js";
/** @export */IndexOptions.cache; /** @export */IndexOptions.cache;
/** @export */IndexOptions.resolve; /** @export */IndexOptions.resolve;
/** @export */IndexOptions.db; /** @export */IndexOptions.db;
/** @export */IndexOptions.config; /** @export */IndexOptions.worker; // worker url
/** @export */IndexOptions.config; // config url
/** @export */DocumentIndexOptions.preset; /** @export */FieldOptions.preset;
/** @export */DocumentIndexOptions.context; /** @export */FieldOptions.context;
/** @export */DocumentIndexOptions.encoder; /** @export */FieldOptions.encoder;
/** @export */DocumentIndexOptions.encode; /** @export */FieldOptions.encode;
/** @export */DocumentIndexOptions.resolution; /** @export */FieldOptions.resolution;
/** @export */DocumentIndexOptions.tokenize; /** @export */FieldOptions.tokenize;
/** @export */DocumentIndexOptions.fastupdate; /** @export */FieldOptions.fastupdate;
/** @export */DocumentIndexOptions.score; /** @export */FieldOptions.score;
/** @export */DocumentIndexOptions.keystore; /** @export */FieldOptions.keystore;
/** @export */DocumentIndexOptions.rtl; /** @export */FieldOptions.rtl;
/** @export */DocumentIndexOptions.cache; /** @export */FieldOptions.cache;
/** @export */DocumentIndexOptions.db; /** @export */FieldOptions.db;
/** @export */DocumentIndexOptions.config; /** @export */FieldOptions.config;
// /** @export */ DocumentIndexOptions.resolve; /** @export */FieldOptions.resolve;
/** @export */DocumentIndexOptions.field; /** @export */FieldOptions.field;
/** @export */DocumentIndexOptions.filter; /** @export */FieldOptions.filter;
/** @export */DocumentIndexOptions.custom; /** @export */FieldOptions.custom;
/** @export */FieldOptions.worker;
/** @export */DocumentOptions.context; /** @export */DocumentOptions.context;
/** @export */DocumentOptions.encoder; /** @export */DocumentOptions.encoder;
@@ -182,6 +193,7 @@ import Charset from "./charset.js";
/** @export */SearchOptions.suggest; /** @export */SearchOptions.suggest;
/** @export */SearchOptions.resolve; /** @export */SearchOptions.resolve;
/** @export */SearchOptions.enrich; /** @export */SearchOptions.enrich;
/** @export */SearchOptions.resolution;
/** @export */DocumentSearchOptions.query; /** @export */DocumentSearchOptions.query;
/** @export */DocumentSearchOptions.limit; /** @export */DocumentSearchOptions.limit;
@@ -231,6 +243,10 @@ import Charset from "./charset.js";
/** @export */ResolverOptions.enrich; /** @export */ResolverOptions.enrich;
/** @export */ResolverOptions.resolve; /** @export */ResolverOptions.resolve;
/** @export */ResolverOptions.suggest; /** @export */ResolverOptions.suggest;
/** @export */ResolverOptions.and;
/** @export */ResolverOptions.or;
/** @export */ResolverOptions.xor;
/** @export */ResolverOptions.not;
const FlexSearch = { const FlexSearch = {
Index: Index, Index: Index,
@@ -268,4 +284,8 @@ const FlexSearch = {
/** @export */ /** @export */
root.FlexSearch = FlexSearch; root.FlexSearch = FlexSearch;
} }
} }
export default FlexSearch;
export { Index, Document, Encoder, Charset, WorkerIndex as Worker, Resolver, IdxDB as IndexedDB };

View File

@@ -1,10 +1,11 @@
import Index from "./index.js"; import Index from "./index.js";
import Document from "./document.js"; import Document from "./document.js";
import { SearchOptions, DocumentSearchOptions } from "./type.js";
/** /**
* @param {string|Object} query * @param {string|SearchOptions|DocumentSearchOptions} query
* @param {number|Object=} limit * @param {number|SearchOptions|DocumentSearchOptions=} limit
* @param {Object=} options * @param {SearchOptions|DocumentSearchOptions=} options
* @this {Index|Document} * @this {Index|Document}
* @returns {Array<number|string>|Promise} * @returns {Array<number|string>|Promise}
*/ */

View File

@@ -1,6 +1,6 @@
import { EncoderOptions } from "../../type.js"; import { EncoderOptions } from "../../type.js";
/** @type EncoderOptions */ /** @type {EncoderOptions} */
const options = { const options = {
normalize: !0, normalize: !0,
dedupe: !1, dedupe: !1,

View File

@@ -27,7 +27,7 @@ export default function IdxDB(name, config = {}) {
} }
if ("object" == typeof name) { if ("object" == typeof name) {
name = name.name; name = name.name;
config = name; config = /** @type PersistentOptions */name;
} }
if (!name) { if (!name) {
console.info("Default storage space was used, because a name was not passed."); console.info("Default storage space was used, because a name was not passed.");

View File

@@ -6,7 +6,7 @@
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
import { DocumentOptions, DocumentDescriptor, DocumentIndexOptions, StoreOptions } from "./type.js"; import { IndexOptions, DocumentOptions, DocumentDescriptor, FieldOptions, StoreOptions } from "./type.js";
import Index from "./index.js"; import Index from "./index.js";
import WorkerIndex from "./worker.js"; import WorkerIndex from "./worker.js";
import Cache, { searchCache } from "./cache.js"; import Cache, { searchCache } from "./cache.js";
@@ -29,8 +29,7 @@ export default function Document(options) {
return new Document(options); return new Document(options);
} }
/** @type DocumentDescriptor */ const document = /** @type DocumentDescriptor */options.document || options.doc || options;
const document = options.document || options.doc || options;
let tmp, keystore; let tmp, keystore;
this.tree = []; this.tree = [];
@@ -44,13 +43,14 @@ export default function Document(options) {
this.reg = this.fastupdate ? keystore && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ ? new KeystoreMap(keystore) : new Map() : keystore && !0 ? new KeystoreSet(keystore) : new Set(); this.reg = this.fastupdate ? keystore && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ ? new KeystoreMap(keystore) : new Map() : keystore && !0 ? new KeystoreSet(keystore) : new Set();
// todo support custom filter function // todo support custom filter function
this.storetree = (tmp = document.store || null) && !0 !== tmp && []; this.storetree = (tmp = document.store || null) && tmp && !0 !== tmp && [];
this.store = tmp && (keystore && !0 ? new KeystoreMap(keystore) : new Map()); this.store = tmp && (keystore && !0 ? new KeystoreMap(keystore) : new Map());
this.cache = (tmp = options.cache || null) && new Cache(tmp); this.cache = (tmp = options.cache || null) && new Cache(tmp);
// do not apply cache again for the indexes since .searchCache() // do not apply cache again for the indexes since .searchCache()
// is just a wrapper over .search() // is just a wrapper over .search()
options.cache = /* suggest */ /* append: */ /* enrich */!1; options.cache =
/* suggest */ /* append: */ /* enrich */!1;
this.worker = options.worker; this.worker = options.worker;
@@ -93,7 +93,6 @@ export default function Document(options) {
this.tagtree[i]._filter = params.filter; this.tagtree[i]._filter = params.filter;
} }
} }
// the tag fields needs to be hold by indices
this.tagfield[i] = field; this.tagfield[i] = field;
this.tag.set(field, new Map()); this.tag.set(field, new Map());
} }
@@ -136,7 +135,7 @@ Document.prototype.mount = function (db) {
let index; // = this.index.get(field); let index; // = this.index.get(field);
//if(!index){ //if(!index){
// create raw index when not exists // create raw index when not exists
this.index.set(field, index = new Index({}, this.reg)); this.index.set(field, index = new Index( /** @type IndexOptions */{}, this.reg));
// copy and push to the field selection // copy and push to the field selection
if (fields === this.field) { if (fields === this.field) {
fields = fields.slice(0); fields = fields.slice(0);
@@ -227,7 +226,7 @@ function parse_descriptor(options, document) {
key = key.field; key = key.field;
} }
opt = /** @type DocumentIndexOptions */is_object(opt) ? Object.assign({}, options, opt) : options; opt = /** @type IndexOptions */is_object(opt) ? Object.assign({}, options, opt) : options;
if (this.worker) { if (this.worker) {
const worker = new WorkerIndex(opt); const worker = new WorkerIndex(opt);
@@ -242,7 +241,7 @@ function parse_descriptor(options, document) {
} }
if (!this.worker) { if (!this.worker) {
index.set(key, new Index(opt, this.reg)); index.set(key, new Index( /** @type IndexOptions */opt, this.reg));
} }
if (opt.custom) { if (opt.custom) {

View File

@@ -1,6 +1,5 @@
import { DocumentSearchOptions, DocumentSearchResults, EnrichedDocumentSearchResults, MergedDocumentSearchResults } from "../type.js";
import { DocumentSearchOptions } from "../type.js";
import { create_object, is_array, is_object, is_string, parse_simple } from "../common.js"; import { create_object, is_array, is_object, is_string, parse_simple } from "../common.js";
import { intersect_union } from "../intersect.js"; import { intersect_union } from "../intersect.js";
import Document from "../document.js"; import Document from "../document.js";
@@ -12,7 +11,7 @@ let debug = /* suggest */ /* append: */ /* enrich */!1;
* @param {number|DocumentSearchOptions=} limit * @param {number|DocumentSearchOptions=} limit
* @param {DocumentSearchOptions=} options * @param {DocumentSearchOptions=} options
* @param {Array<Array>=} _promises For internal use only. * @param {Array<Array>=} _promises For internal use only.
* @returns {Promise|Array} * @returns {DocumentSearchResults|EnrichedDocumentSearchResults|MergedDocumentSearchResults|Promise<DocumentSearchResults|EnrichedDocumentSearchResults|MergedDocumentSearchResults>}
*/ */
Document.prototype.search = function (query, limit, options, _promises) { Document.prototype.search = function (query, limit, options, _promises) {
@@ -43,7 +42,7 @@ Document.prototype.search = function (query, limit, options, _promises) {
if (options) { if (options) {
if (is_array(options)) { if (is_array(options)) {
options = { options = /** @type DocumentSearchOptions */{
index: options index: options
}; };
} }
@@ -363,9 +362,7 @@ Document.prototype.search = function (query, limit, options, _promises) {
}; };
} }
if (enrich && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ if (enrich && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ && this.db && promises.length) {
/*await rows.hasNext()*/
&& this.db && promises.length) {
const self = this; const self = this;
return Promise.all(promises).then(function (promises) { return Promise.all(promises).then(function (promises) {
for (let j = 0; j < promises.length; j++) { for (let j = 0; j < promises.length; j++) {
@@ -390,6 +387,8 @@ function highlight_fields(result, query, index, field, tree, template) {
// if(typeof template === "string"){ // if(typeof template === "string"){
// template = new RegExp(template, "g"); // template = new RegExp(template, "g");
// }
let encoder, query_enc, tokenize; let encoder, query_enc, tokenize;

View File

@@ -6,7 +6,7 @@
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
import { IndexOptions, ContextOptions } from "./type.js"; import { IndexOptions, ContextOptions, EncoderOptions } from "./type.js";
import Encoder from "./encoder.js"; import Encoder from "./encoder.js";
import Cache, { searchCache } from "./cache.js"; import Cache, { searchCache } from "./cache.js";
import Charset from "./charset.js"; import Charset from "./charset.js";
@@ -33,19 +33,19 @@ export default function Index(options, _register) {
return new Index(options); return new Index(options);
} }
options = options ? apply_preset(options) : {}; options = /** @type IndexOptions */options ? apply_preset(options) : {};
let tmp = options.context;
/** @type ContextOptions */ /** @type ContextOptions */
const context = options.context || {}, const context = /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ === tmp ? { depth: 1 } : tmp || {},
encoder = is_string(options.encoder) ? Charset[options.encoder] : options.encode || options.encoder || default_encoder; encoder = is_string(options.encoder) ? Charset[options.encoder] : options.encode || options.encoder || default_encoder;
/** @type Encoder */ /** @type Encoder */
this.encoder = encoder.encode ? encoder : "object" == typeof encoder ? new Encoder(encoder) : { encode: encoder }; this.encoder = encoder.encode ? encoder : "object" == typeof encoder ? new Encoder( /** @type {EncoderOptions} */encoder) : { encode: encoder };
this.compress = options.compress || options.compression || /* suggest */ /* append: */ /* enrich */!1; this.compress = options.compress || options.compression || /* suggest */ /* append: */ /* enrich */!1;
let tmp;
this.resolution = options.resolution || 9; this.resolution = options.resolution || 9;
this.tokenize = tmp = options.tokenize || "strict"; this.tokenize = tmp = options.tokenize || "strict";
this.depth = "strict" === tmp && context.depth || 0; this.depth = "strict" === tmp && context.depth || 0;
@@ -56,10 +56,10 @@ export default function Index(options, _register) {
tmp = options.keystore || 0; tmp = options.keystore || 0;
tmp && (this.keystore = tmp); tmp && (this.keystore = tmp);
this.map = tmp && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ ? new KeystoreMap(tmp) : new Map(); this.map = tmp && !0 ? new KeystoreMap(tmp) : new Map();
this.ctx = tmp && !0 ? new KeystoreMap(tmp) : new Map(); this.ctx = tmp && !0 ? new KeystoreMap(tmp) : new Map();
this.reg = _register || (this.fastupdate ? tmp && !0 ? new KeystoreMap(tmp) : new Map() : tmp && !0 ? new KeystoreSet(tmp) : new Set()); this.reg = _register || (this.fastupdate ? tmp && !0 ? new KeystoreMap(tmp) : new Map() : tmp && !0 ? new KeystoreSet(tmp) : new Set());
this.resolution_ctx = context.resolution || 1; this.resolution_ctx = context.resolution || 3;
this.rtl = encoder.rtl || options.rtl || !1; this.rtl = encoder.rtl || options.rtl || !1;
this.cache = (tmp = options.cache || null) && new Cache(tmp); this.cache = (tmp = options.cache || null) && new Cache(tmp);

View File

@@ -1,6 +1,6 @@
import { SearchOptions } from "../type.js"; import { SearchOptions, SearchResults, EnrichedSearchResults } from "../type.js";
import { create_object, is_object, sort_by_length_down } from "../common.js"; import { create_object, is_object, sort_by_length_down } from "../common.js";
import Index from "../index.js"; import Index from "../index.js";
import default_compress from "../compress.js"; import default_compress from "../compress.js";
@@ -17,7 +17,7 @@ export function set_resolve(resolve) {
* @param {string|SearchOptions} query * @param {string|SearchOptions} query
* @param {number|SearchOptions=} limit * @param {number|SearchOptions=} limit
* @param {SearchOptions=} options * @param {SearchOptions=} options
* @returns {Array|Resolver|Promise<Array|Resolver>} * @returns {SearchResults|EnrichedSearchResults|Resolver|Promise<SearchResults|EnrichedSearchResults|Resolver>}
*/ */
Index.prototype.search = function (query, limit, options) { Index.prototype.search = function (query, limit, options) {
@@ -40,7 +40,8 @@ Index.prototype.search = function (query, limit, options) {
resolve, resolve,
enrich, enrich,
tag, tag,
boost; boost,
resolution;
if (options) { if (options) {
@@ -53,6 +54,7 @@ Index.prototype.search = function (query, limit, options) {
resolve || (global_resolve = 0); resolve || (global_resolve = 0);
enrich = resolve && options.enrich; enrich = resolve && options.enrich;
boost = options.boost; boost = options.boost;
resolution = options.resolution;
tag = this.db && options.tag; tag = this.db && options.tag;
} else { } else {
resolve = this.resolve || global_resolve; resolve = this.resolve || global_resolve;
@@ -62,13 +64,14 @@ Index.prototype.search = function (query, limit, options) {
// do not force a string as input // do not force a string as input
// https://github.com/nextapps-de/flexsearch/issues/432 // https://github.com/nextapps-de/flexsearch/issues/432
query = /** @type {Array<string>} */this.encoder.encode(query); /** @type {Array<string>} */
length = query.length; let query_terms = this.encoder.encode(query);
length = query_terms.length;
limit || !resolve || (limit = 100); limit || !resolve || (limit = 100);
// fast path single term // fast path single term
if (1 === length) { if (1 === length) {
return single_term_query.call(this, query[0], // term return single_term_query.call(this, query_terms[0], // term
"", // ctx "", // ctx
limit, offset, resolve, enrich, tag); limit, offset, resolve, enrich, tag);
} }
@@ -80,8 +83,8 @@ Index.prototype.search = function (query, limit, options) {
// fast path single context // fast path single context
if (2 === length && context && !suggest) { if (2 === length && context && !suggest) {
return single_term_query.call(this, query[0], // term return single_term_query.call(this, query_terms[0], // term
query[1], // ctx query_terms[1], // ctx
limit, offset, resolve, enrich, tag); limit, offset, resolve, enrich, tag);
} }
@@ -98,7 +101,7 @@ Index.prototype.search = function (query, limit, options) {
// if(context){ // if(context){
// keyword = query[0]; // keyword = query_terms[0];
// dupes[keyword] = 1; // dupes[keyword] = 1;
// query_new.push(keyword); // query_new.push(keyword);
// maxlength = minlength = keyword.length; // maxlength = minlength = keyword.length;
@@ -107,7 +110,7 @@ Index.prototype.search = function (query, limit, options) {
for (let i = 0, term; i < length; i++) { for (let i = 0, term; i < length; i++) {
term = query[i]; term = query_terms[i];
if (term && !dupes[term]) { if (term && !dupes[term]) {
@@ -132,7 +135,7 @@ Index.prototype.search = function (query, limit, options) {
// } // }
} }
query = query_new; query_terms = query_new;
length = query.length; length = query.length;
} }
@@ -147,22 +150,22 @@ Index.prototype.search = function (query, limit, options) {
// fast path single term // fast path single term
if (1 === length) { if (1 === length) {
return single_term_query.call(this, query[0], // term return single_term_query.call(this, query_terms[0], // term
"", // ctx "", // ctx
limit, offset, resolve, enrich, tag); limit, offset, resolve, enrich, tag);
} }
// fast path single context // fast path single context
if (2 === length && context && !suggest) { if (2 === length && context && !suggest) {
return single_term_query.call(this, query[0], // term return single_term_query.call(this, query_terms[0], // term
query[1], // ctx query_terms[1], // ctx
limit, offset, resolve, enrich, tag); limit, offset, resolve, enrich, tag);
} }
if (1 < length) { if (1 < length) {
if (context) { if (context) {
// start with context right away // start with context right away
keyword = query[0]; keyword = query_terms[0];
index = 1; index = 1;
} }
// todo // todo
@@ -171,17 +174,21 @@ Index.prototype.search = function (query, limit, options) {
// bigger terms has less occurrence // bigger terms has less occurrence
// this might also reduce the intersection task // this might also reduce the intersection task
// todo check intersection order // todo check intersection order
query.sort(sort_by_length_down); query_terms.sort(sort_by_length_down);
} }
} }
if (!resolution && 0 !== resolution) {
resolution = this.resolution;
}
// from this point there are just multi-term queries // from this point there are just multi-term queries
if (this.db) { if (this.db) {
if (this.db.search) { if (this.db.search) {
// when the configuration is not supported it returns false // when the configuration is not supported it returns false
const result = this.db.search(this, query, limit, offset, suggest, resolve, enrich, tag); const result = this.db.search(this, query_terms, limit, offset, suggest, resolve, enrich, tag);
if (!1 !== result) return result; if (!1 !== result) return result;
} }
@@ -190,7 +197,7 @@ Index.prototype.search = function (query, limit, options) {
for (let arr, term; index < length; index++) { for (let arr, term; index < length; index++) {
term = query[index]; term = query_terms[index];
if (keyword) { if (keyword) {
@@ -211,7 +218,7 @@ Index.prototype.search = function (query, limit, options) {
} else { } else {
arr = await self.get_array(term, "", 0, 0, !1, !1); arr = await self.get_array(term, "", 0, 0, !1, !1);
arr = add_result(arr, result, suggest, self.resolution arr = add_result(arr, result, suggest, resolution
// 0, // /** @type {!number} */ (limit), // 0, // /** @type {!number} */ (limit),
// 0, // offset, // 0, // offset,
// length === 1 // length === 1
@@ -241,13 +248,13 @@ Index.prototype.search = function (query, limit, options) {
} }
} }
return resolve ? intersect(result, self.resolution, /** @type {number} */limit, offset, suggest, boost, resolve) : new Resolver(result[0]); return resolve ? intersect(result, resolution, /** @type {number} */limit, offset, suggest, boost, resolve) : new Resolver(result[0]);
}(); }();
} }
for (let arr, term; index < length; index++) { for (let arr, term; index < length; index++) {
term = query[index]; term = query_terms[index];
if (keyword) { if (keyword) {
@@ -267,7 +274,7 @@ Index.prototype.search = function (query, limit, options) {
} else { } else {
arr = this.get_array(term, "", 0, 0, !1, !1); arr = this.get_array(term, "", 0, 0, !1, !1);
arr = /*this.*/add_result(arr, result, suggest, this.resolution arr = /*this.*/add_result(arr, result, suggest, resolution
// 0, // /** @type {!number} */ (limit), // 0, // /** @type {!number} */ (limit),
// 0, // offset, // 0, // offset,
// length === 1 // length === 1
@@ -293,12 +300,12 @@ Index.prototype.search = function (query, limit, options) {
} }
return result; return result;
} else if (1 === length) { } else if (1 === length) {
return resolve ? resolve_default(result[0], limit, offset) : new Resolver(result[0]); return resolve ? resolve_default(result[0], /** @type {number} */limit, offset) : new Resolver(result[0]);
} }
} }
} }
result = intersect(result, this.resolution, limit, offset, suggest, boost, resolve); result = intersect(result, resolution, limit, offset, suggest, boost, resolve);
return resolve ? result : new Resolver(result); return resolve ? result : new Resolver(result);
}; };
@@ -337,8 +344,8 @@ function single_term_query(term, keyword, limit, offset, resolve, enrich, tag) {
* @private * @private
* @param {Array} arr * @param {Array} arr
* @param {Array} result * @param {Array} result
* @param {Array} suggest * @param {boolean|null=} suggest
* @param {number} resolution * @param {number=} resolution
* @return {Array|boolean|undefined} * @return {Array|boolean|undefined}
*/ */

View File

@@ -14,7 +14,7 @@ export const filter = new Set(["aber", "als", "am", "an", "auch", "auf", "aus",
* Example: The word "correct" and "correctness" could be the same word, so you can define {"ness": ""} to normalize the ending. * Example: The word "correct" and "correctness" could be the same word, so you can define {"ness": ""} to normalize the ending.
* Object Definition: the key represents the word ending, the value contains the replacement (or empty string for removal). * Object Definition: the key represents the word ending, the value contains the replacement (or empty string for removal).
* http://snowball.tartarus.org/algorithms/german/stemmer.html * http://snowball.tartarus.org/algorithms/german/stemmer.html
* @type {Map<string>} * @type {Map<string, string>}
*/ */
export const stemmer = new Map([["niss", ""], ["isch", ""], ["lich", ""], ["heit", ""], ["keit", ""], ["ell", ""], ["bar", ""], ["end", ""], ["ung", ""], ["est", ""], ["ern", ""], ["em", ""], ["er", ""], ["en", ""], ["es", ""], ["st", ""], ["ig", ""], ["ik", ""], ["e", ""], ["s", ""]]); export const stemmer = new Map([["niss", ""], ["isch", ""], ["lich", ""], ["heit", ""], ["keit", ""], ["ell", ""], ["bar", ""], ["end", ""], ["ung", ""], ["est", ""], ["ern", ""], ["em", ""], ["er", ""], ["en", ""], ["es", ""], ["st", ""], ["ig", ""], ["ik", ""], ["e", ""], ["s", ""]]);
@@ -22,7 +22,7 @@ export const stemmer = new Map([["niss", ""], ["isch", ""], ["lich", ""], ["heit
/** /**
* Matcher replaces all occurrences of a given string regardless of its position and is also a kind of "partial normalization". * Matcher replaces all occurrences of a given string regardless of its position and is also a kind of "partial normalization".
* Object Definition: the key represents the target term, the value contains the search string which should be replaced (could also be an array of multiple terms). * Object Definition: the key represents the target term, the value contains the search string which should be replaced (could also be an array of multiple terms).
* @type {Map<string>} * @type {Map<string, string>}
*/ */
const map = new Map([["_", " "], ["ä", "ae"], ["ö", "oe"], ["ü", "ue"], ["ß", "ss"], ["&", " und "], ["€", " EUR "]]), const map = new Map([["_", " "], ["ä", "ae"], ["ö", "oe"], ["ü", "ue"], ["ß", "ss"], ["&", " und "], ["€", " EUR "]]),
options = { options = {

View File

@@ -9,7 +9,7 @@ import { EncoderOptions } from "../type.js";
export const filter = new Set(["au", "aux", "avec", "ce", "ces", "dans", "de", "des", "du", "elle", "en", "et", "eux", "il", "je", "la", "le", "leur", "lui", "ma", "mais", "me", "meme", "mes", "moi", "mon", "ne", "nos", "notre", "nous", "on", "ou", "par", "pas", "pour", "qu", "que", "qui", "sa", "se", "ses", "son", "sur", "ta", "te", "tes", "toi", "ton", "tu", "un", "une", "vos", "votre", "vous", "c", "d", "j", "l", "m", "n", "s", "t", "a", "y", "ete", "etee", "etees", "etes", "etant", "suis", "es", "est", "sommes", "etes", "sont", "serai", "seras", "sera", "serons", "serez", "seront", "serais", "serait", "serions", "seriez", "seraient", "etais", "etait", "etions", "etiez", "etaient", "fus", "fut", "fumes", "futes", "furent", "sois", "soit", "soyons", "soyez", "soient", "fusse", "fusses", "fut", "fussions", "fussiez", "fussent", "ayant", "eu", "eue", "eues", "eus", "ai", "as", "avons", "avez", "ont", "aurai", "auras", "aura", "aurons", "aurez", "auront", "aurais", "aurait", "aurions", "auriez", "auraient", "avais", "avait", "avions", "aviez", "avaient", "eut", "eumes", "eutes", "eurent", "aie", "aies", "ait", "ayons", "ayez", "aient", "eusse", "eusses", "eut", "eussions", "eussiez", "eussent", "ceci", "cela", "cela", "cet", "cette", "ici", "ils", "les", "leurs", "quel", "quels", "quelle", "quelles", "sans", "soi"]); export const filter = new Set(["au", "aux", "avec", "ce", "ces", "dans", "de", "des", "du", "elle", "en", "et", "eux", "il", "je", "la", "le", "leur", "lui", "ma", "mais", "me", "meme", "mes", "moi", "mon", "ne", "nos", "notre", "nous", "on", "ou", "par", "pas", "pour", "qu", "que", "qui", "sa", "se", "ses", "son", "sur", "ta", "te", "tes", "toi", "ton", "tu", "un", "une", "vos", "votre", "vous", "c", "d", "j", "l", "m", "n", "s", "t", "a", "y", "ete", "etee", "etees", "etes", "etant", "suis", "es", "est", "sommes", "etes", "sont", "serai", "seras", "sera", "serons", "serez", "seront", "serais", "serait", "serions", "seriez", "seraient", "etais", "etait", "etions", "etiez", "etaient", "fus", "fut", "fumes", "futes", "furent", "sois", "soit", "soyons", "soyez", "soient", "fusse", "fusses", "fut", "fussions", "fussiez", "fussent", "ayant", "eu", "eue", "eues", "eus", "ai", "as", "avons", "avez", "ont", "aurai", "auras", "aura", "aurons", "aurez", "auront", "aurais", "aurait", "aurions", "auriez", "auraient", "avais", "avait", "avions", "aviez", "avaient", "eut", "eumes", "eutes", "eurent", "aie", "aies", "ait", "ayons", "ayez", "aient", "eusse", "eusses", "eut", "eussions", "eussiez", "eussent", "ceci", "cela", "cela", "cet", "cette", "ici", "ils", "les", "leurs", "quel", "quels", "quelle", "quelles", "sans", "soi"]);
/** /**
* @type {Object<string, string>} * @type {Map<string, string>}
*/ */
export const stemmer = new Map([["lement", ""], ["ient", ""], ["nera", ""], ["ment", ""], ["ais", ""], ["ait", ""], ["ant", ""], ["ent", ""], ["iez", ""], ["ion", ""], ["nez", ""], ["ai", ""], ["es", ""], ["er", ""], ["ez", ""], ["le", ""], ["na", ""], ["ne", ""], ["a", ""], ["e", ""]]); export const stemmer = new Map([["lement", ""], ["ient", ""], ["nera", ""], ["ment", ""], ["ais", ""], ["ait", ""], ["ant", ""], ["ent", ""], ["iez", ""], ["ion", ""], ["nez", ""], ["ai", ""], ["es", ""], ["er", ""], ["ez", ""], ["le", ""], ["na", ""], ["ne", ""], ["a", ""], ["e", ""]]);

View File

@@ -3,7 +3,7 @@ import { is_string } from "./common.js";
import { IndexOptions } from "./type.js"; import { IndexOptions } from "./type.js";
/** /**
* @enum {Object} * @type {Object<string, IndexOptions>}
* @const * @const
*/ */
@@ -38,20 +38,21 @@ const presets = {
/** /**
* *
* @param {!IndexOptions|string} options * @param {IndexOptions|string} options
* @return {IndexOptions} * @return {IndexOptions}
*/ */
export default function apply_preset(options) { export default function apply_preset(options) {
const preset = is_string(options) ? options : options.preset; const preset = /** @type string */is_string(options) ? options : options.preset;
if (preset) { if (preset) {
if (!presets[preset]) { if (!presets[preset]) {
console.warn("Preset not found: " + preset); console.warn("Preset not found: " + preset);
} }
options = Object.assign({}, presets[preset], /** @type {Object} */options); options = /** @type IndexOptions */Object.assign({}, presets[preset], /** @type {Object} */options);
} }
return options; return (/** @type IndexOptions */options
);
} }

View File

@@ -5,230 +5,243 @@ import Encoder from "./encoder.js";
import StorageInterface from "./db/interface.js"; import StorageInterface from "./db/interface.js";
/** /**
* @typedef IndexOptions {{ * @typedef {{
* preset: string|undefined, * preset: (string|undefined),
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (function():number|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|boolean|undefined),
* resolve: [boolean=true], * resolve: (boolean|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* commit: boolean=true, * commit: (boolean|undefined),
* worker: boolean|string|undefined, * worker: (string|undefined),
* config: string|undefined * config: (string|undefined)
* }} * }}
*/ */
export const IndexOptions = {}; export let IndexOptions = {};
/** /**
* @typedef DocumentIndexOptions {{ * @typedef {{
* preset: string|undefined, * preset: (string|undefined),
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (Function|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* commit: boolean=true, * commit: (boolean|undefined),
* config: string|undefined, * config: (string|undefined),
* field: string, * field: (string|undefined),
* filter: Function|undefined, * filter: (Function|undefined),
* custom: Function|undefined * custom: (Function|undefined)
* }} * }}
*/ */
export const DocumentIndexOptions = {}; export let FieldOptions = {};
/** /**
* @typedef DocumentOptions {{ * @typedef {{
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (Function|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|boolean|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* doc: DocumentDescriptor|Array<DocumentDescriptor>|undefined, * doc: (DocumentDescriptor|Array<DocumentDescriptor>|undefined),
* document: DocumentDescriptor|Array<DocumentDescriptor>|undefined, * document: (DocumentDescriptor|Array<DocumentDescriptor>|undefined),
* worker: boolean|string|undefined * worker: (boolean|string|undefined),
* }} * }}
*/ */
export const DocumentOptions = {}; export let DocumentOptions = {};
/** /**
* @typedef ContextOptions {{ * @typedef {{
* depth: number, * depth: (number|undefined),
* bidirectional: boolean|undefined, * bidirectional: (boolean|undefined),
* resolution: number|undefined * resolution: (number|undefined),
* }} * }}
*/ */
export const ContextOptions = {}; export let ContextOptions = {};
/** /**
* @typedef DocumentDescriptor {{ * @typedef {{
* id: string="id", * id: (string|undefined),
* field: FieldOptions|Array<FieldOptions>|undefined, * field: (string|Array<string>|FieldOptions|Array<FieldOptions>|undefined),
* index: FieldOptions|Array<FieldOptions>|undefined, * index: (string|Array<string>|FieldOptions|Array<FieldOptions>|undefined),
* tag: TagOptions|Array<TagOptions>|undefined, * tag: (string|Array<string>|TagOptions|Array<TagOptions>|undefined),
* store: StoreOptions|Array<StoreOptions>|undefined * store: (string|Array<string>|StoreOptions|Array<StoreOptions>|boolean|undefined),
* }} * }}
*/ */
export const DocumentDescriptor = {}; export let DocumentDescriptor = {};
/** /**
* @typedef TagOptions {{ * @typedef {{
* field: string, * field: string,
* tag: Object<string, string|Array<string>>|Array<string>|string, * filter: ((function(string):boolean)|undefined),
* filter: Function|undefined, * custom: ((function(string):string)|undefined),
* custom: Function|undefined, * db: (StorageInterface|undefined),
* keystore: [number=0],
* db: StorageInterface|undefined,
* config: string|undefined
* }} * }}
*/ */
export const TagOptions = {}; export let TagOptions = {};
/** /**
* @typedef StoreOptions {{ * @typedef {{
* field: string, * field: string,
* filter: Function|undefined, * filter: ((function(string):boolean)|undefined),
* custom: Function|undefined, * custom: ((function(string):string)|undefined)
* config: string|undefined
* }} * }}
*/ */
export const StoreOptions = {}; export let StoreOptions = {};
/** /**
* @typedef SearchOptions {{ * @typedef {{
* query: string=, * query: (string|undefined),
* limit: [number=100], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* context: boolean|undefined, * resolution: (number|undefined),
* suggest: [boolean=false], * context: (boolean|undefined),
* resolve: [boolean=true], * suggest: (boolean|undefined),
* enrich: [boolean=false] * resolve: (boolean|undefined),
* enrich: (boolean|undefined),
* }} * }}
*/ */
export const SearchOptions = {}; export let SearchOptions = {};
// tag: Array|undefined
/** /**
* @typedef DocumentSearchOptions {{ * @typedef {{
* query: string=, * query: (string|undefined),
* limit: [number=100], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* context: boolean|undefined, * context: (boolean|undefined),
* suggest: [boolean=false], * suggest: (boolean|undefined),
* enrich: [boolean=false], * enrich: (boolean|undefined),
* tag: Object|Array<Object>|undefined, * tag: (Object|Array<Object>|undefined),
* field: Array<DocumentSearchOptions>|undefined, * field: (Array<string>|Array<DocumentSearchOptions>|string|undefined),
* index: Array<DocumentSearchOptions>|undefined, * index: (Array<string>|Array<DocumentSearchOptions>|undefined),
* pluck: boolean|undefined, * pluck: (string|undefined),
* merge: [boolean=false], * merge: (boolean|undefined),
* highlight: string|undefined * highlight: (string|undefined),
* }} * }}
*/ */
export const DocumentSearchOptions = {}; export let DocumentSearchOptions = {};
/** /**
* @typedef DocumentSearchResults Array<{{ * @typedef Array<number|string>
* field: string|undefined,
* tag: string|undefined,
* result: Array<number|string>,
* highlight: string|undefined
* }}>
*/ */
export const DocumentSearchResults = {}; export let SearchResults = {};
/** /**
* @typedef EnrichedDocumentSearchResults Array<{{ * @typedef Array<{
* field: string|undefined, * id: (number|string),
* tag: string|undefined, * res: number
* result: Array<{{ * }>
* id: number|string,
* doc: Object
* }}>,
* highlight: string|undefined
* }}>
*/ */
export const EnrichedDocumentSearchResults = {}; export let EnrichedSearchResults = {};
/** /**
* @typedef MergedDocumentSearchResults Array<{{ * @typedef Array<{
* id: number|string, * field: (string|undefined),
* doc: Object|undefined, * tag: (string|undefined),
* field: Array<string>, * result: SearchResults
* highlight: string|undefined * }>
* }}>
*/ */
export const MergedDocumentSearchResults = {}; export let DocumentSearchResults = {};
/** /**
* @typedef EncoderOptions {{ * @typedef Array<{
* rtl: boolean=false, * field: (string|undefined),
* dedupe: boolean=true, * tag: (string|undefined),
* split: string|undefined, * highlight: (string|undefined),
* include: EncoderSplitOptions|undefined, * result: Array<{
* exclude: EncoderSplitOptions|undefined, * id: (number|string),
* prepare: function(string):string|undefined, * doc: (Object|null)
* finalize: function(Array<>string>):Array<string>|undefined, * }>
* filter: Set|undefined, * }>
* matcher: Map|undefined, */
* mapper: Map|undefined, export let EnrichedDocumentSearchResults = {};
* stemmer: Map|undefined,
* replacer: Array<string|RegExp>|undefined, /**
* minlength: number=1, * @typedef Array<{
* maxlength: number|undefined, * id: (number|string),
* cache: boolean=true, * doc: (Object|null),
* field: (Array<string>|undefined),
* tag: (Array<string>|undefined)
* }>
*/
export let MergedDocumentSearchResults = {};
/**
* @typedef {{
* letter: (boolean|undefined),
* number: (boolean|undefined),
* symbol: (boolean|undefined),
* punctuation: (boolean|undefined),
* control: (boolean|undefined),
* char: (string|Array<string>|undefined)
* }} * }}
*/ */
export const EncoderOptions = {}; export let EncoderSplitOptions = {};
/** /**
* @typedef EncoderSplitOptions {{ * @typedef {{
* letter: boolean=false, * rtl: (boolean|undefined),
* number: boolean=false, * dedupe: (boolean|undefined),
* symbol: boolean=false, * include: (EncoderSplitOptions|undefined),
* punctuation: boolean=false, * exclude: (EncoderSplitOptions|undefined),
* control: boolean=false, * split: (string|boolean|undefined),
* char: string|Array<string>|undefined, * normalize: (boolean|(function(string):string)|undefined),
* prepare: ((function(string):string)|undefined),
* finalize: ((function(Array<string>):(Array<string>|void))|undefined),
* filter: (Set<string>|undefined),
* matcher: (Map<string, string>|undefined),
* mapper: (Map<string, string>|undefined),
* stemmer: (Map<string, string>|undefined),
* replacer: (Array<string|RegExp, string>|undefined),
* minlength: (number|undefined),
* maxlength: (number|undefined),
* cache: (boolean|undefined)
* }} * }}
*/ */
export const EncoderSplitOptions = {}; export let EncoderOptions = {};
/** /**
* @typedef PersistentOptions {{ * @typedef {{
* name: string="flexsearch", * name: (string|undefined),
* field: string|undefined, * field: (string|undefined),
* type: string|undefined, * type: (string|undefined),
* db: *|undefined * db: (StorageInterface|undefined)
* }} * }}
*/ */
export const PersistentOptions = {}; export let PersistentOptions = {};
/** /**
* @typedef ResolverOptions {{ * @typedef {{
* index: Index|undefined, * index: (Index|undefined),
* query: string, * query: (string|undefined),
* limit: [number=0], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* enrich: boolean=false, * enrich: (boolean|undefined),
* resolve: boolean=false, * resolve: (boolean|undefined),
* suggest: boolean=false * suggest: (boolean|undefined),
* and: (ResolverOptions|Array<ResolverOptions>|undefined),
* or: (ResolverOptions|Array<ResolverOptions>|undefined),
* xor: (ResolverOptions|Array<ResolverOptions>|undefined),
* not: (ResolverOptions|Array<ResolverOptions>|undefined)
* }} * }}
*/ */
export const ResolverOptions = {}; export let ResolverOptions = {};

View File

@@ -9,7 +9,7 @@ let pid = 0;
* @constructor * @constructor
*/ */
export default function WorkerIndex(options = {}) { export default function WorkerIndex(options = /** @type IndexOptions */{}) {
if (!this || this.constructor !== WorkerIndex) { if (!this || this.constructor !== WorkerIndex) {
return new WorkerIndex(options); return new WorkerIndex(options);

View File

@@ -15,12 +15,12 @@ export default (async function (data) {
case "init": case "init":
/** @type IndexOptions */ /** @type {IndexOptions} */
let options = data.options || {}, let options = data.options || {},
filepath = options.config; filepath = options.config;
if (filepath) { if (filepath) {
options = filepath; options = options;
// will be replaced after build with the line below because // will be replaced after build with the line below because
// there is an issue with closure compiler dynamic import // there is an issue with closure compiler dynamic import
options = (await import(filepath))["default"]; options = (await import(filepath))["default"];

1
dist/module-min/bundle.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
import Index from"./index.js";import Document from"./document.js";export function searchCache(a,b,c){a=("object"==typeof a?""+a.query:""+a).toLowerCase();let d=this.cache.get(a);if(!d){if(d=this.search(a,b,c),d.then){const b=this;d.then(function(c){return b.cache.set(a,c),c})}this.cache.set(a,d)}return d}export default function CacheClass(a){this.limit=a&&!0!==a?a:1000,this.cache=new Map,this.last=""}CacheClass.prototype.set=function(a,b){this.cache.set(this.last=a,b),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},CacheClass.prototype.get=function(a){const b=this.cache.get(a);return b&&this.last!==a&&(this.cache.delete(a),this.cache.set(this.last=a,b)),b},CacheClass.prototype.remove=function(a){for(const b of this.cache){const c=b[0],d=b[1];d.includes(a)&&this.cache.delete(c)}},CacheClass.prototype.clear=function(){this.cache.clear(),this.last=""}; import Index from"./index.js";import Document from"./document.js";import{SearchOptions,DocumentSearchOptions}from"./type.js";export function searchCache(a,b,c){a=("object"==typeof a?""+a.query:""+a).toLowerCase();let d=this.cache.get(a);if(!d){if(d=this.search(a,b,c),d.then){const b=this;d.then(function(c){return b.cache.set(a,c),c})}this.cache.set(a,d)}return d}export default function CacheClass(a){this.limit=a&&!0!==a?a:1000,this.cache=new Map,this.last=""}CacheClass.prototype.set=function(a,b){this.cache.set(this.last=a,b),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},CacheClass.prototype.get=function(a){const b=this.cache.get(a);return b&&this.last!==a&&(this.cache.delete(a),this.cache.set(this.last=a,b)),b},CacheClass.prototype.remove=function(a){for(const b of this.cache){const c=b[0],d=b[1];d.includes(a)&&this.cache.delete(c)}},CacheClass.prototype.clear=function(){this.cache.clear(),this.last=""};

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
import{DocumentSearchOptions}from"../type.js";import{create_object,is_array,is_object,is_string,parse_simple}from"../common.js";import{intersect_union}from"../intersect.js";import Document from"../document.js";let debug=!1;Document.prototype.search=function(a,b,c,d){debug,c||(!b&&is_object(a)?(c=a,a=""):is_object(b)&&(c=b,b=0));let e,f,g,h,j,k,l,m,n=[],o=[],p=0;if(c){if(is_array(c)&&(c={index:c}),a=c.query||a,e=c.pluck,g=c.merge,j=e||c.field||c.index,k=this.tag&&c.tag,f=this.store&&c.enrich,h=c.suggest,m=c.highlight,b=c.limit||b,l=c.offset||0,b||(b=100),k&&(!this.db||!d)){debug,k.constructor!==Array&&(k=[k]);let c=[];for(let a,b=0;b<k.length;b++)if(a=k[b],a.field&&a.tag){const b=a.tag;if(b.constructor===Array)for(let d=0;d<b.length;d++)c.push(a.field,b[d]);else c.push(a.field,b)}else{const b=Object.keys(a);for(let d,e,f=0;f<b.length;f++)if(d=b[f],e=a[d],e.constructor===Array)for(let a=0;a<e.length;a++)c.push(d,e[a]);else c.push(d,e)}if(k=c,!a){let a=[];if(c.length)for(let d=0;d<c.length;d+=2){let e;if(this.db){const g=this.index.get(c[d]);if(!g){continue}debug,a.push(e=g.db.tag(c[d+1],b,l,f))}else debug,e=get_tag.call(this,c[d],c[d+1],b,l,f);n.push({field:c[d],tag:c[d+1],result:e})}return a.length?Promise.all(a).then(function(a){for(let b=0;b<a.length;b++)n[b].result=a[b];return n}):n}}is_string(j)&&(j=[j])}j||(j=this.field);let q,r=!d&&(this.worker||this.db)&&[];for(let e,g,m,s=0;s<j.length;s++){if(g=j[s],this.db&&this.tag&&!this.tree[s])continue;let i;if(is_string(g)||(i=g,g=i.field,a=i.query||a,b=i.limit||b,l=i.offset||l,h=i.suggest||h,f=this.store&&(i.enrich||f)),d)e=d[s];else{let d=i||c,h=this.index.get(g);if(k&&(this.db&&(d.tag=k,q=h.db.support_tag_search,d.field=j),!q&&(d.enrich=!1)),r){r[s]=h.search(a,b,d),d&&f&&(d.enrich=f);continue}else e=h.search(a,b,d),d&&f&&(d.enrich=f)}if(m=e&&e.length,k&&m){const a=[];let b=0;if(!(this.db&&d))for(let c,d,e=0;e<k.length;e+=2){if(debug,c=this.tag.get(k[e]),!c)if(!1,h)continue;else return n;if(c=c&&c.get(k[e+1]),d=c&&c.length,d)b++,a.push(c);else if(!h)return n}else if(!q)for(let c=j.length;c<d.length;c++){let e=d[c],f=e&&e.length;if(f)b++,a.push(e);else if(!h)return n}if(b){if(debug,e=intersect_union(e,a),m=e.length,!m&&!h)return n;b--}}if(m)o[p]=g,n.push(e),p++;else if(1===j.length)return n}if(r){if(this.db&&k&&k.length&&!q)for(let a=0;a<k.length;a+=2){const c=this.index.get(k[a]);if(!c)if(!1,h)continue;else return n;debug,r.push(c.db.tag(k[a+1],b,l,!1))}const d=this;return Promise.all(r).then(function(e){return e.length?d.search(a,b,c,e):e})}if(!p)return n;if(e&&(!f||!this.store))return n[0];r=[];for(let g,h=0;h<o.length;h++){if(g=n[h],f&&g.length&&!g[0].doc&&(this.db?(debug,r.push(g=this.index.get(this.field[0]).db.enrich(g))):g.length&&(g=apply_enrich.call(this,g))),e)return g;n[h]={field:o[h],result:g}}if(f&&!0&&this.db&&r.length){const c=this;return Promise.all(r).then(function(d){for(let a=0;a<d.length;a++)n[a].result=d[a];return g?merge_fields(n,b,l):m?highlight_fields(n,a,c.index,c.field,c.tree,m,b,l):n})}return g?merge_fields(n,b,l):m?highlight_fields(n,a,this.index,this.field,this.tree,m,b,l):n};function highlight_fields(a,b,c,d,e,f){let g,h,j;for(let k,l,m,n,o,p=0;p<a.length;p++){k=a[p].result,l=a[p].field,n=c.get(l),m=n.encoder,j=n.tokenize,o=e[d.indexOf(l)],m!==g&&(g=m,h=g.encode(b));for(let a=0;a<k.length;a++){let b="",c=parse_simple(k[a].doc,o),d=g.encode(c),e=c.split(g.split);for(let a,c,g=0;g<d.length;g++){a=d[g],c=e[g];let i;for(let d,e=0;e<h.length;e++)if(d=h[e],"strict"!==j){const e=a.indexOf(d);if(-1<e){b+=(b?" ":"")+c.substring(0,e)+f.replace("$1",c.substring(e,d.length))+c.substring(e+d.length),i=!0;break}}else if(a===d){b+=(b?" ":"")+f.replace("$1",c),i=!0;break}i||(b+=(b?" ":"")+e[g])}k[a].highlight=b}}return a}function merge_fields(a,b){const c=[],d=create_object();for(let e,f,g=0;g<a.length;g++){e=a[g],f=e.result;for(let a,g,h,i=0;i<f.length;i++)if(g=f[i],a=g.id,h=d[a],!h){if(c.length===b)return c;g.field=d[a]=[e.field],c.push(g)}else h.push(e.field)}return c}function get_tag(a,b,c,d){let e=this.tag.get(a);if(!e)return!1,[];e=e&&e.get(b);e&&e.length-d}function apply_enrich(a){const b=Array(a.length);for(let c,d=0;d<a.length;d++)c=a[d],b[d]={id:c,doc:this.store.get(c)};return b} import{DocumentSearchOptions,DocumentSearchResults,EnrichedDocumentSearchResults,MergedDocumentSearchResults}from"../type.js";import{create_object,is_array,is_object,is_string,parse_simple}from"../common.js";import{intersect_union}from"../intersect.js";import Document from"../document.js";let debug=!1;Document.prototype.search=function(a,b,c,d){debug,c||(!b&&is_object(a)?(c=a,a=""):is_object(b)&&(c=b,b=0));let e,f,g,h,j,k,l,m,n=[],o=[],p=0;if(c){if(is_array(c)&&(c={index:c}),a=c.query||a,e=c.pluck,g=c.merge,j=e||c.field||c.index,k=this.tag&&c.tag,f=this.store&&c.enrich,h=c.suggest,m=c.highlight,b=c.limit||b,l=c.offset||0,b||(b=100),k&&(!this.db||!d)){debug,k.constructor!==Array&&(k=[k]);let c=[];for(let a,b=0;b<k.length;b++)if(a=k[b],a.field&&a.tag){const b=a.tag;if(b.constructor===Array)for(let d=0;d<b.length;d++)c.push(a.field,b[d]);else c.push(a.field,b)}else{const b=Object.keys(a);for(let d,e,f=0;f<b.length;f++)if(d=b[f],e=a[d],e.constructor===Array)for(let a=0;a<e.length;a++)c.push(d,e[a]);else c.push(d,e)}if(k=c,!a){let a=[];if(c.length)for(let d=0;d<c.length;d+=2){let e;if(this.db){const g=this.index.get(c[d]);if(!g){continue}debug,a.push(e=g.db.tag(c[d+1],b,l,f))}else debug,e=get_tag.call(this,c[d],c[d+1],b,l,f);n.push({field:c[d],tag:c[d+1],result:e})}return a.length?Promise.all(a).then(function(a){for(let b=0;b<a.length;b++)n[b].result=a[b];return n}):n}}is_string(j)&&(j=[j])}j||(j=this.field);let q,r=!d&&(this.worker||this.db)&&[];for(let e,g,m,s=0;s<j.length;s++){if(g=j[s],this.db&&this.tag&&!this.tree[s])continue;let i;if(is_string(g)||(i=g,g=i.field,a=i.query||a,b=i.limit||b,l=i.offset||l,h=i.suggest||h,f=this.store&&(i.enrich||f)),d)e=d[s];else{let d=i||c,h=this.index.get(g);if(k&&(this.db&&(d.tag=k,q=h.db.support_tag_search,d.field=j),!q&&(d.enrich=!1)),r){r[s]=h.search(a,b,d),d&&f&&(d.enrich=f);continue}else e=h.search(a,b,d),d&&f&&(d.enrich=f)}if(m=e&&e.length,k&&m){const a=[];let b=0;if(!(this.db&&d))for(let c,d,e=0;e<k.length;e+=2){if(debug,c=this.tag.get(k[e]),!c)if(!1,h)continue;else return n;if(c=c&&c.get(k[e+1]),d=c&&c.length,d)b++,a.push(c);else if(!h)return n}else if(!q)for(let c=j.length;c<d.length;c++){let e=d[c],f=e&&e.length;if(f)b++,a.push(e);else if(!h)return n}if(b){if(debug,e=intersect_union(e,a),m=e.length,!m&&!h)return n;b--}}if(m)o[p]=g,n.push(e),p++;else if(1===j.length)return n}if(r){if(this.db&&k&&k.length&&!q)for(let a=0;a<k.length;a+=2){const c=this.index.get(k[a]);if(!c)if(!1,h)continue;else return n;debug,r.push(c.db.tag(k[a+1],b,l,!1))}const d=this;return Promise.all(r).then(function(e){return e.length?d.search(a,b,c,e):e})}if(!p)return n;if(e&&(!f||!this.store))return n[0];r=[];for(let g,h=0;h<o.length;h++){if(g=n[h],f&&g.length&&!g[0].doc&&(this.db?(debug,r.push(g=this.index.get(this.field[0]).db.enrich(g))):g.length&&(g=apply_enrich.call(this,g))),e)return g;n[h]={field:o[h],result:g}}if(f&&!0&&this.db&&r.length){const c=this;return Promise.all(r).then(function(d){for(let a=0;a<d.length;a++)n[a].result=d[a];return g?merge_fields(n,b,l):m?highlight_fields(n,a,c.index,c.field,c.tree,m,b,l):n})}return g?merge_fields(n,b,l):m?highlight_fields(n,a,this.index,this.field,this.tree,m,b,l):n};function highlight_fields(a,b,c,d,e,f){let g,h,j;for(let k,l,m,n,o,p=0;p<a.length;p++){k=a[p].result,l=a[p].field,n=c.get(l),m=n.encoder,j=n.tokenize,o=e[d.indexOf(l)],m!==g&&(g=m,h=g.encode(b));for(let a=0;a<k.length;a++){let b="",c=parse_simple(k[a].doc,o),d=g.encode(c),e=c.split(g.split);for(let a,c,g=0;g<d.length;g++){a=d[g],c=e[g];let i;for(let d,e=0;e<h.length;e++)if(d=h[e],"strict"!==j){const e=a.indexOf(d);if(-1<e){b+=(b?" ":"")+c.substring(0,e)+f.replace("$1",c.substring(e,d.length))+c.substring(e+d.length),i=!0;break}}else if(a===d){b+=(b?" ":"")+f.replace("$1",c),i=!0;break}i||(b+=(b?" ":"")+e[g])}k[a].highlight=b}}return a}function merge_fields(a,b){const c=[],d=create_object();for(let e,f,g=0;g<a.length;g++){e=a[g],f=e.result;for(let a,g,h,i=0;i<f.length;i++)if(g=f[i],a=g.id,h=d[a],!h){if(c.length===b)return c;g.field=d[a]=[e.field],c.push(g)}else h.push(e.field)}return c}function get_tag(a,b,c,d){let e=this.tag.get(a);if(!e)return!1,[];e=e&&e.get(b);e&&e.length-d}function apply_enrich(a){const b=Array(a.length);for(let c,d=0;d<a.length;d++)c=a[d],b[d]={id:c,doc:this.store.get(c)};return b}

View File

@@ -1 +1 @@
import{IndexOptions,ContextOptions}from"./type.js";import Encoder from"./encoder.js";import Cache,{searchCache}from"./cache.js";import Charset from"./charset.js";import{KeystoreMap,KeystoreSet}from"./keystore.js";import{is_array,is_string}from"./common.js";import{exportIndex,importIndex,serialize}from"./serialize.js";import default_encoder from"./charset/latin/default.js";import apply_preset from"./preset.js";import apply_async from"./async.js";import tick from"./profiler.js";import"./index/add.js";import"./index/search.js";import"./index/remove.js";export default function Index(a,b){if(!this||this.constructor!==Index)return new Index(a);!1,a=a?apply_preset(a):{};const c=a.context||{},d=is_string(a.encoder)?Charset[a.encoder]:a.encode||a.encoder||default_encoder;this.encoder=d.encode?d:"object"==typeof d?new Encoder(d):{encode:d},this.compress=a.compress||a.compression||!1;let e;this.resolution=a.resolution||9,this.tokenize=e=a.tokenize||"strict",this.depth="strict"===e&&c.depth||0,this.bidirectional=!1!==c.bidirectional,this.fastupdate=!!a.fastupdate,this.score=a.score||null,e=a.keystore||0,e&&(this.keystore=e),this.map=e&&!0?new KeystoreMap(e):new Map,this.ctx=e&&!0?new KeystoreMap(e):new Map,this.reg=b||(this.fastupdate?e&&!0?new KeystoreMap(e):new Map:e&&!0?new KeystoreSet(e):new Set),this.resolution_ctx=c.resolution||1,this.rtl=d.rtl||a.rtl||!1,this.cache=(e=a.cache||null)&&new Cache(e),this.resolve=!1!==a.resolve,(e=a.db)&&(this.db=this.mount(e)),this.commit_auto=!1!==a.commit,this.commit_task=[],this.commit_timer=null}Index.prototype.mount=function(a){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),a.mount(this)},Index.prototype.commit=function(a,b){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this,a,b)},Index.prototype.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};export function autoCommit(a,b,c){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null,a.db.commit(a,b,c)},0))}Index.prototype.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]),this},Index.prototype.append=function(a,b){return this.add(a,b,!0)},Index.prototype.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)},Index.prototype.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)};function cleanup_index(a){let b=0;if(is_array(a))for(let c,d=0;d<a.length;d++)(c=a[d])&&(b+=c.length);else for(const c of a){const d=c[0],e=c[1],f=cleanup_index(e);f?b+=f:a.delete(d)}return b}Index.prototype.cleanup=function(){return this.fastupdate?(cleanup_index(this.map),this.depth&&cleanup_index(this.ctx),this):(!1,this)},Index.prototype.searchCache=searchCache,Index.prototype.export=exportIndex,Index.prototype.import=importIndex,Index.prototype.serialize=serialize,apply_async(Index.prototype); import{IndexOptions,ContextOptions,EncoderOptions}from"./type.js";import Encoder from"./encoder.js";import Cache,{searchCache}from"./cache.js";import Charset from"./charset.js";import{KeystoreMap,KeystoreSet}from"./keystore.js";import{is_array,is_string}from"./common.js";import{exportIndex,importIndex,serialize}from"./serialize.js";import default_encoder from"./charset/latin/default.js";import apply_preset from"./preset.js";import apply_async from"./async.js";import tick from"./profiler.js";import"./index/add.js";import"./index/search.js";import"./index/remove.js";export default function Index(a,b){if(!this||this.constructor!==Index)return new Index(a);!1,a=a?apply_preset(a):{};let c=a.context;const d=!0===c?{depth:1}:c||{},e=is_string(a.encoder)?Charset[a.encoder]:a.encode||a.encoder||default_encoder;this.encoder=e.encode?e:"object"==typeof e?new Encoder(e):{encode:e},this.compress=a.compress||a.compression||!1,this.resolution=a.resolution||9,this.tokenize=c=a.tokenize||"strict",this.depth="strict"===c&&d.depth||0,this.bidirectional=!1!==d.bidirectional,this.fastupdate=!!a.fastupdate,this.score=a.score||null,c=a.keystore||0,c&&(this.keystore=c),this.map=c&&!0?new KeystoreMap(c):new Map,this.ctx=c&&!0?new KeystoreMap(c):new Map,this.reg=b||(this.fastupdate?c&&!0?new KeystoreMap(c):new Map:c&&!0?new KeystoreSet(c):new Set),this.resolution_ctx=d.resolution||3,this.rtl=e.rtl||a.rtl||!1,this.cache=(c=a.cache||null)&&new Cache(c),this.resolve=!1!==a.resolve,(c=a.db)&&(this.db=this.mount(c)),this.commit_auto=!1!==a.commit,this.commit_task=[],this.commit_timer=null}Index.prototype.mount=function(a){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),a.mount(this)},Index.prototype.commit=function(a,b){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this,a,b)},Index.prototype.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};export function autoCommit(a,b,c){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null,a.db.commit(a,b,c)},0))}Index.prototype.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]),this},Index.prototype.append=function(a,b){return this.add(a,b,!0)},Index.prototype.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)},Index.prototype.update=function(a,b){const c=this,d=this.remove(a);return d&&d.then?d.then(()=>c.add(a,b)):this.add(a,b)};function cleanup_index(a){let b=0;if(is_array(a))for(let c,d=0;d<a.length;d++)(c=a[d])&&(b+=c.length);else for(const c of a){const d=c[0],e=c[1],f=cleanup_index(e);f?b+=f:a.delete(d)}return b}Index.prototype.cleanup=function(){return this.fastupdate?(cleanup_index(this.map),this.depth&&cleanup_index(this.ctx),this):(!1,this)},Index.prototype.searchCache=searchCache,Index.prototype.export=exportIndex,Index.prototype.import=importIndex,Index.prototype.serialize=serialize,apply_async(Index.prototype);

View File

@@ -1 +1 @@
import{SearchOptions}from"../type.js";import{create_object,is_object,sort_by_length_down}from"../common.js";import Index from"../index.js";import default_compress from"../compress.js";import Resolver from"../resolver.js";import{intersect}from"../intersect.js";import resolve_default from"../resolve/default.js";let global_resolve=1;export function set_resolve(a){global_resolve=a}Index.prototype.search=function(a,b,c){c||(!b&&is_object(a)?(c=a,a=""):is_object(b)&&(c=b,b=0));let d,e,f,g,h,i,j,k=[],l=0;if(c?(a=c.query||a,b=c.limit||b,l=c.offset||0,e=c.context,f=c.suggest,g=global_resolve&&!1!==c.resolve,g||(global_resolve=0),h=g&&c.enrich,j=c.boost,i=this.db&&c.tag):g=this.resolve||global_resolve,a=this.encoder.encode(a),d=a.length,b||!g||(b=100),1===d)return single_term_query.call(this,a[0],"",b,l,g,h,i);if(e=this.depth&&!1!==e,2===d&&e&&!f)return single_term_query.call(this,a[0],a[1],b,l,g,h,i);let m=0,n=0;if(1<d){const b=create_object(),c=[];for(let e,h=0;h<d;h++)if(e=a[h],e&&!b[e]){if(!f&&!this.db&&!this.get_array(e))return g?k:new Resolver(k);c.push(e),b[e]=1;const a=e.length;m=Math.max(m,a),n=n?Math.min(n,a):a}a=c,d=a.length}if(!d)return g?k:new Resolver(k);let o,p=0;if(1===d)return single_term_query.call(this,a[0],"",b,l,g,h,i);if(2===d&&e&&!f)return single_term_query.call(this,a[0],a[1],b,l,g,h,i);if(1<d&&(e?(o=a[0],p=1):9<m&&3<m/n&&a.sort(sort_by_length_down)),this.db){if(this.db.search){const c=this.db.search(this,a,b,l,f,g,h,i);if(!1!==c)return c}const c=this;return async function(){for(let e,h;p<d;p++){if(h=a[p],o?(e=await c.get_array(h,o,0,0,!1,!1),e=add_result(e,k,f,c.resolution_ctx),(!f||!1!==e||!k.length)&&(o=h)):(e=await c.get_array(h,"",0,0,!1,!1),e=add_result(e,k,f,c.resolution)),e)return e;if(f&&p==d-1){let a=k.length;if(!a){if(o){o="",p=-1;continue}return k}if(1===a)return g?resolve_default(k[0],b,l):new Resolver(k[0])}}return g?intersect(k,c.resolution,b,l,f,j,g):new Resolver(k[0])}()}for(let e,h;p<d;p++){if(h=a[p],o?(e=this.get_array(h,o,0,0,!1,!1),e=add_result(e,k,f,this.resolution_ctx),(!f||!1!==e||!k.length)&&(o=h)):(e=this.get_array(h,"",0,0,!1,!1),e=add_result(e,k,f,this.resolution)),e)return e;if(f&&p==d-1){const a=k.length;if(!a){if(o){o="",p=-1;continue}return k}if(1===a)return g?resolve_default(k[0],b,l):new Resolver(k[0])}}return k=intersect(k,this.resolution,b,l,f,j,g),g?k:new Resolver(k)};function single_term_query(a,b,c,d,e,f,g){const h=this.get_array(a,b,c,d,e,f,g);return this.db?h.then(function(a){return e?a:a&&a.length?e?resolve_default(a,c,d):new Resolver(a):e?[]:new Resolver([])}):h&&h.length?e?resolve_default(h,c,d):new Resolver(h):e?[]:new Resolver([])}function add_result(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let b,c=0;c<d;c++)(b=a[c])&&b&&(e[c]=b);if(e.length)return void b.push(e)}return!c&&e}Index.prototype.get_array=function(a,b,c,d,e,f,g){let h,i;return(b&&(i=this.bidirectional&&a>b),this.compress&&(a=default_compress(a),b&&(b=default_compress(b))),this.db)?b?this.db.get(i?b:a,i?a:b,c,d,e,f,g):this.db.get(a,"",c,d,e,f,g):(b?(h=this.ctx.get(i?a:b),h=h&&h.get(i?b:a)):h=this.map.get(a),h)}; import{SearchOptions,SearchResults,EnrichedSearchResults}from"../type.js";import{create_object,is_object,sort_by_length_down}from"../common.js";import Index from"../index.js";import default_compress from"../compress.js";import Resolver from"../resolver.js";import{intersect}from"../intersect.js";import resolve_default from"../resolve/default.js";let global_resolve=1;export function set_resolve(a){global_resolve=a}Index.prototype.search=function(a,b,c){c||(!b&&is_object(a)?(c=a,a=""):is_object(b)&&(c=b,b=0));let d,e,f,g,h,i,j,k,l=[],m=0;c?(a=c.query||a,b=c.limit||b,m=c.offset||0,e=c.context,f=c.suggest,g=global_resolve&&!1!==c.resolve,g||(global_resolve=0),h=g&&c.enrich,j=c.boost,k=c.resolution,i=this.db&&c.tag):g=this.resolve||global_resolve;let n=this.encoder.encode(a);if(d=n.length,b||!g||(b=100),1===d)return single_term_query.call(this,n[0],"",b,m,g,h,i);if(e=this.depth&&!1!==e,2===d&&e&&!f)return single_term_query.call(this,n[0],n[1],b,m,g,h,i);let o=0,p=0;if(1<d){const b=create_object(),c=[];for(let a,e=0;e<d;e++)if(a=n[e],a&&!b[a]){if(!f&&!this.db&&!this.get_array(a))return g?l:new Resolver(l);c.push(a),b[a]=1;const d=a.length;o=Math.max(o,d),p=p?Math.min(p,d):d}n=c,d=a.length}if(!d)return g?l:new Resolver(l);let q,r=0;if(1===d)return single_term_query.call(this,n[0],"",b,m,g,h,i);if(2===d&&e&&!f)return single_term_query.call(this,n[0],n[1],b,m,g,h,i);if(1<d&&(e?(q=n[0],r=1):9<o&&3<o/p&&n.sort(sort_by_length_down)),k||0===k||(k=this.resolution),this.db){if(this.db.search){const a=this.db.search(this,n,b,m,f,g,h,i);if(!1!==a)return a}const a=this;return async function(){for(let c,e;r<d;r++){if(e=n[r],q?(c=await a.get_array(e,q,0,0,!1,!1),c=add_result(c,l,f,a.resolution_ctx),(!f||!1!==c||!l.length)&&(q=e)):(c=await a.get_array(e,"",0,0,!1,!1),c=add_result(c,l,f,k)),c)return c;if(f&&r==d-1){let a=l.length;if(!a){if(q){q="",r=-1;continue}return l}if(1===a)return g?resolve_default(l[0],b,m):new Resolver(l[0])}}return g?intersect(l,k,b,m,f,j,g):new Resolver(l[0])}()}for(let e,h;r<d;r++){if(h=n[r],q?(e=this.get_array(h,q,0,0,!1,!1),e=add_result(e,l,f,this.resolution_ctx),(!f||!1!==e||!l.length)&&(q=h)):(e=this.get_array(h,"",0,0,!1,!1),e=add_result(e,l,f,k)),e)return e;if(f&&r==d-1){const a=l.length;if(!a){if(q){q="",r=-1;continue}return l}if(1===a)return g?resolve_default(l[0],b,m):new Resolver(l[0])}}return l=intersect(l,k,b,m,f,j,g),g?l:new Resolver(l)};function single_term_query(a,b,c,d,e,f,g){const h=this.get_array(a,b,c,d,e,f,g);return this.db?h.then(function(a){return e?a:a&&a.length?e?resolve_default(a,c,d):new Resolver(a):e?[]:new Resolver([])}):h&&h.length?e?resolve_default(h,c,d):new Resolver(h):e?[]:new Resolver([])}function add_result(a,b,c,d){let e=[];if(a){d=Math.min(a.length,d);for(let b,c=0;c<d;c++)(b=a[c])&&b&&(e[c]=b);if(e.length)return void b.push(e)}return!c&&e}Index.prototype.get_array=function(a,b,c,d,e,f,g){let h,i;return(b&&(i=this.bidirectional&&a>b),this.compress&&(a=default_compress(a),b&&(b=default_compress(b))),this.db)?b?this.db.get(i?b:a,i?a:b,c,d,e,f,g):this.db.get(a,"",c,d,e,f,g):(b?(h=this.ctx.get(i?a:b),h=h&&h.get(i?b:a)):h=this.map.get(a),h)};

View File

@@ -1 +1 @@
import Index from"./index.js";import Encoder from"./encoder.js";import StorageInterface from"./db/interface.js";export const IndexOptions={};export const DocumentIndexOptions={};export const DocumentOptions={};export const ContextOptions={};export const DocumentDescriptor={};export const TagOptions={};export const StoreOptions={};export const SearchOptions={};export const DocumentSearchOptions={};export const DocumentSearchResults={};export const EnrichedDocumentSearchResults={};export const MergedDocumentSearchResults={};export const EncoderOptions={};export const EncoderSplitOptions={};export const PersistentOptions={};export const ResolverOptions={}; import Index from"./index.js";import Encoder from"./encoder.js";import StorageInterface from"./db/interface.js";export let IndexOptions={};export let FieldOptions={};export let DocumentOptions={};export let ContextOptions={};export let DocumentDescriptor={};export let TagOptions={};export let StoreOptions={};export let SearchOptions={};export let DocumentSearchOptions={};export let SearchResults={};export let EnrichedSearchResults={};export let DocumentSearchResults={};export let EnrichedDocumentSearchResults={};export let MergedDocumentSearchResults={};export let EncoderSplitOptions={};export let EncoderOptions={};export let PersistentOptions={};export let ResolverOptions={};

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
import Index from"../index.js";import{IndexOptions}from"../type.js";export default(async function(a){a=a.data;const b=self._index,c=a.args,d=a.task;switch(d){case"init":let e=a.options||{},f=e.config;f&&(e=f);const g=a.factory;g?(Function("return "+g)()(self),self._index=new self.FlexSearch.Index(e),delete self.FlexSearch):self._index=new Index(e),postMessage({id:a.id});break;default:const h=a.id,i=b[d].apply(b,c);postMessage("search"===d?{id:h,msg:i}:{id:h});}}); import Index from"../index.js";import{IndexOptions}from"../type.js";export default(async function(a){a=a.data;const b=self._index,c=a.args,d=a.task;switch(d){case"init":let e=a.options||{},f=e.config;f&&(e=e);const g=a.factory;g?(Function("return "+g)()(self),self._index=new self.FlexSearch.Index(e),delete self.FlexSearch):self._index=new Index(e),postMessage({id:a.id});break;default:const h=a.id,i=b[d].apply(b,c);postMessage("search"===d?{id:h,msg:i}:{id:h});}});

View File

@@ -1,5 +1,5 @@
import { SearchOptions, ContextOptions, DocumentDescriptor, DocumentSearchOptions, DocumentIndexOptions, IndexOptions, DocumentOptions, TagOptions, StoreOptions, EncoderOptions, EncoderSplitOptions, PersistentOptions, ResolverOptions } from "./type.js"; import { SearchOptions, ContextOptions, DocumentDescriptor, DocumentSearchOptions, FieldOptions, IndexOptions, DocumentOptions, TagOptions, StoreOptions, EncoderOptions, EncoderSplitOptions, PersistentOptions, ResolverOptions } from "./type.js";
import StorageInterface from "./db/interface.js"; import StorageInterface from "./db/interface.js";
import Document from "./document.js"; import Document from "./document.js";
import Index from "./index.js"; import Index from "./index.js";
@@ -46,6 +46,14 @@ import Charset from "./charset.js";
/** @export */Index.prototype.document; /** @export */Index.prototype.document;
/** @export */Index.prototype.encoder; /** @export */Index.prototype.encoder;
/** @export */Encoder.prototype.assign;
/** @export */Encoder.prototype.encode;
/** @export */Encoder.prototype.addMatcher;
/** @export */Encoder.prototype.addStemmer;
/** @export */Encoder.prototype.addFilter;
/** @export */Encoder.prototype.addMapper;
/** @export */Encoder.prototype.addReplacer;
/** @export */Document.prototype.add; /** @export */Document.prototype.add;
/** @export */Document.prototype.append; /** @export */Document.prototype.append;
/** @export */Document.prototype.search; /** @export */Document.prototype.search;
@@ -76,6 +84,7 @@ import Charset from "./charset.js";
/** @export */Resolver.prototype.and; /** @export */Resolver.prototype.and;
/** @export */Resolver.prototype.xor; /** @export */Resolver.prototype.xor;
/** @export */Resolver.prototype.not; /** @export */Resolver.prototype.not;
/** @export */Resolver.prototype.result;
/** @export */StorageInterface.db; /** @export */StorageInterface.db;
/** @export */StorageInterface.id; /** @export */StorageInterface.id;
@@ -118,25 +127,27 @@ import Charset from "./charset.js";
/** @export */IndexOptions.cache; /** @export */IndexOptions.cache;
/** @export */IndexOptions.resolve; /** @export */IndexOptions.resolve;
/** @export */IndexOptions.db; /** @export */IndexOptions.db;
/** @export */IndexOptions.config; /** @export */IndexOptions.worker; // worker url
/** @export */IndexOptions.config; // config url
/** @export */DocumentIndexOptions.preset; /** @export */FieldOptions.preset;
/** @export */DocumentIndexOptions.context; /** @export */FieldOptions.context;
/** @export */DocumentIndexOptions.encoder; /** @export */FieldOptions.encoder;
/** @export */DocumentIndexOptions.encode; /** @export */FieldOptions.encode;
/** @export */DocumentIndexOptions.resolution; /** @export */FieldOptions.resolution;
/** @export */DocumentIndexOptions.tokenize; /** @export */FieldOptions.tokenize;
/** @export */DocumentIndexOptions.fastupdate; /** @export */FieldOptions.fastupdate;
/** @export */DocumentIndexOptions.score; /** @export */FieldOptions.score;
/** @export */DocumentIndexOptions.keystore; /** @export */FieldOptions.keystore;
/** @export */DocumentIndexOptions.rtl; /** @export */FieldOptions.rtl;
/** @export */DocumentIndexOptions.cache; /** @export */FieldOptions.cache;
/** @export */DocumentIndexOptions.db; /** @export */FieldOptions.db;
/** @export */DocumentIndexOptions.config; /** @export */FieldOptions.config;
// /** @export */ DocumentIndexOptions.resolve; /** @export */FieldOptions.resolve;
/** @export */DocumentIndexOptions.field; /** @export */FieldOptions.field;
/** @export */DocumentIndexOptions.filter; /** @export */FieldOptions.filter;
/** @export */DocumentIndexOptions.custom; /** @export */FieldOptions.custom;
/** @export */FieldOptions.worker;
/** @export */DocumentOptions.context; /** @export */DocumentOptions.context;
/** @export */DocumentOptions.encoder; /** @export */DocumentOptions.encoder;
@@ -182,6 +193,7 @@ import Charset from "./charset.js";
/** @export */SearchOptions.suggest; /** @export */SearchOptions.suggest;
/** @export */SearchOptions.resolve; /** @export */SearchOptions.resolve;
/** @export */SearchOptions.enrich; /** @export */SearchOptions.enrich;
/** @export */SearchOptions.resolution;
/** @export */DocumentSearchOptions.query; /** @export */DocumentSearchOptions.query;
/** @export */DocumentSearchOptions.limit; /** @export */DocumentSearchOptions.limit;
@@ -231,6 +243,10 @@ import Charset from "./charset.js";
/** @export */ResolverOptions.enrich; /** @export */ResolverOptions.enrich;
/** @export */ResolverOptions.resolve; /** @export */ResolverOptions.resolve;
/** @export */ResolverOptions.suggest; /** @export */ResolverOptions.suggest;
/** @export */ResolverOptions.and;
/** @export */ResolverOptions.or;
/** @export */ResolverOptions.xor;
/** @export */ResolverOptions.not;
const FlexSearch = { const FlexSearch = {
Index: Index, Index: Index,
@@ -268,4 +284,8 @@ const FlexSearch = {
/** @export */ /** @export */
root.FlexSearch = FlexSearch; root.FlexSearch = FlexSearch;
} }
} }
export default FlexSearch;
export { Index, Document, Encoder, Charset, WorkerIndex as Worker, Resolver, IdxDB as IndexedDB };

View File

@@ -1,10 +1,11 @@
import Index from "./index.js"; import Index from "./index.js";
import Document from "./document.js"; import Document from "./document.js";
import { SearchOptions, DocumentSearchOptions } from "./type.js";
/** /**
* @param {string|Object} query * @param {string|SearchOptions|DocumentSearchOptions} query
* @param {number|Object=} limit * @param {number|SearchOptions|DocumentSearchOptions=} limit
* @param {Object=} options * @param {SearchOptions|DocumentSearchOptions=} options
* @this {Index|Document} * @this {Index|Document}
* @returns {Array<number|string>|Promise} * @returns {Array<number|string>|Promise}
*/ */

View File

@@ -1,6 +1,6 @@
import { EncoderOptions } from "../../type.js"; import { EncoderOptions } from "../../type.js";
/** @type EncoderOptions */ /** @type {EncoderOptions} */
const options = { const options = {
normalize: !0, normalize: !0,
dedupe: !1, dedupe: !1,

View File

@@ -27,7 +27,7 @@ export default function IdxDB(name, config = {}) {
} }
if ("object" == typeof name) { if ("object" == typeof name) {
name = name.name; name = name.name;
config = name; config = /** @type PersistentOptions */name;
} }
if (!name) { if (!name) {
console.info("Default storage space was used, because a name was not passed."); console.info("Default storage space was used, because a name was not passed.");

View File

@@ -6,7 +6,7 @@
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
import { DocumentOptions, DocumentDescriptor, DocumentIndexOptions, StoreOptions } from "./type.js"; import { IndexOptions, DocumentOptions, DocumentDescriptor, FieldOptions, StoreOptions } from "./type.js";
import Index from "./index.js"; import Index from "./index.js";
import WorkerIndex from "./worker.js"; import WorkerIndex from "./worker.js";
import Cache, { searchCache } from "./cache.js"; import Cache, { searchCache } from "./cache.js";
@@ -29,8 +29,7 @@ export default function Document(options) {
return new Document(options); return new Document(options);
} }
/** @type DocumentDescriptor */ const document = /** @type DocumentDescriptor */options.document || options.doc || options;
const document = options.document || options.doc || options;
let tmp, keystore; let tmp, keystore;
this.tree = []; this.tree = [];
@@ -44,13 +43,14 @@ export default function Document(options) {
this.reg = this.fastupdate ? keystore && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ ? new KeystoreMap(keystore) : new Map() : keystore && !0 ? new KeystoreSet(keystore) : new Set(); this.reg = this.fastupdate ? keystore && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ ? new KeystoreMap(keystore) : new Map() : keystore && !0 ? new KeystoreSet(keystore) : new Set();
// todo support custom filter function // todo support custom filter function
this.storetree = (tmp = document.store || null) && !0 !== tmp && []; this.storetree = (tmp = document.store || null) && tmp && !0 !== tmp && [];
this.store = tmp && (keystore && !0 ? new KeystoreMap(keystore) : new Map()); this.store = tmp && (keystore && !0 ? new KeystoreMap(keystore) : new Map());
this.cache = (tmp = options.cache || null) && new Cache(tmp); this.cache = (tmp = options.cache || null) && new Cache(tmp);
// do not apply cache again for the indexes since .searchCache() // do not apply cache again for the indexes since .searchCache()
// is just a wrapper over .search() // is just a wrapper over .search()
options.cache = /* suggest */ /* append: */ /* enrich */!1; options.cache =
/* suggest */ /* append: */ /* enrich */!1;
this.worker = options.worker; this.worker = options.worker;
@@ -93,7 +93,6 @@ export default function Document(options) {
this.tagtree[i]._filter = params.filter; this.tagtree[i]._filter = params.filter;
} }
} }
// the tag fields needs to be hold by indices
this.tagfield[i] = field; this.tagfield[i] = field;
this.tag.set(field, new Map()); this.tag.set(field, new Map());
} }
@@ -136,7 +135,7 @@ Document.prototype.mount = function (db) {
let index; // = this.index.get(field); let index; // = this.index.get(field);
//if(!index){ //if(!index){
// create raw index when not exists // create raw index when not exists
this.index.set(field, index = new Index({}, this.reg)); this.index.set(field, index = new Index( /** @type IndexOptions */{}, this.reg));
// copy and push to the field selection // copy and push to the field selection
if (fields === this.field) { if (fields === this.field) {
fields = fields.slice(0); fields = fields.slice(0);
@@ -227,7 +226,7 @@ function parse_descriptor(options, document) {
key = key.field; key = key.field;
} }
opt = /** @type DocumentIndexOptions */is_object(opt) ? Object.assign({}, options, opt) : options; opt = /** @type IndexOptions */is_object(opt) ? Object.assign({}, options, opt) : options;
if (this.worker) { if (this.worker) {
const worker = new WorkerIndex(opt); const worker = new WorkerIndex(opt);
@@ -242,7 +241,7 @@ function parse_descriptor(options, document) {
} }
if (!this.worker) { if (!this.worker) {
index.set(key, new Index(opt, this.reg)); index.set(key, new Index( /** @type IndexOptions */opt, this.reg));
} }
if (opt.custom) { if (opt.custom) {

View File

@@ -1,6 +1,5 @@
import { DocumentSearchOptions, DocumentSearchResults, EnrichedDocumentSearchResults, MergedDocumentSearchResults } from "../type.js";
import { DocumentSearchOptions } from "../type.js";
import { create_object, is_array, is_object, is_string, parse_simple } from "../common.js"; import { create_object, is_array, is_object, is_string, parse_simple } from "../common.js";
import { intersect_union } from "../intersect.js"; import { intersect_union } from "../intersect.js";
import Document from "../document.js"; import Document from "../document.js";
@@ -12,7 +11,7 @@ let debug = /* suggest */ /* append: */ /* enrich */!1;
* @param {number|DocumentSearchOptions=} limit * @param {number|DocumentSearchOptions=} limit
* @param {DocumentSearchOptions=} options * @param {DocumentSearchOptions=} options
* @param {Array<Array>=} _promises For internal use only. * @param {Array<Array>=} _promises For internal use only.
* @returns {Promise|Array} * @returns {DocumentSearchResults|EnrichedDocumentSearchResults|MergedDocumentSearchResults|Promise<DocumentSearchResults|EnrichedDocumentSearchResults|MergedDocumentSearchResults>}
*/ */
Document.prototype.search = function (query, limit, options, _promises) { Document.prototype.search = function (query, limit, options, _promises) {
@@ -43,7 +42,7 @@ Document.prototype.search = function (query, limit, options, _promises) {
if (options) { if (options) {
if (is_array(options)) { if (is_array(options)) {
options = { options = /** @type DocumentSearchOptions */{
index: options index: options
}; };
} }
@@ -351,9 +350,7 @@ Document.prototype.search = function (query, limit, options, _promises) {
}; };
} }
if (enrich && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ if (enrich && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ && this.db && promises.length) {
/*await rows.hasNext()*/
&& this.db && promises.length) {
const self = this; const self = this;
return Promise.all(promises).then(function (promises) { return Promise.all(promises).then(function (promises) {
for (let j = 0; j < promises.length; j++) { for (let j = 0; j < promises.length; j++) {
@@ -378,6 +375,8 @@ function highlight_fields(result, query, index, field, tree, template) {
// if(typeof template === "string"){ // if(typeof template === "string"){
// template = new RegExp(template, "g"); // template = new RegExp(template, "g");
// }
let encoder, query_enc, tokenize; let encoder, query_enc, tokenize;

14
dist/module/index.js vendored
View File

@@ -6,7 +6,7 @@
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
import { IndexOptions, ContextOptions } from "./type.js"; import { IndexOptions, ContextOptions, EncoderOptions } from "./type.js";
import Encoder from "./encoder.js"; import Encoder from "./encoder.js";
import Cache, { searchCache } from "./cache.js"; import Cache, { searchCache } from "./cache.js";
import Charset from "./charset.js"; import Charset from "./charset.js";
@@ -33,19 +33,19 @@ export default function Index(options, _register) {
return new Index(options); return new Index(options);
} }
options = options ? apply_preset(options) : {}; options = /** @type IndexOptions */options ? apply_preset(options) : {};
let tmp = options.context;
/** @type ContextOptions */ /** @type ContextOptions */
const context = options.context || {}, const context = /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ === tmp ? { depth: 1 } : tmp || {},
encoder = is_string(options.encoder) ? Charset[options.encoder] : options.encode || options.encoder || default_encoder; encoder = is_string(options.encoder) ? Charset[options.encoder] : options.encode || options.encoder || default_encoder;
/** @type Encoder */ /** @type Encoder */
this.encoder = encoder.encode ? encoder : "object" == typeof encoder ? new Encoder(encoder) : { encode: encoder }; this.encoder = encoder.encode ? encoder : "object" == typeof encoder ? new Encoder( /** @type {EncoderOptions} */encoder) : { encode: encoder };
this.compress = options.compress || options.compression || /* suggest */ /* append: */ /* enrich */!1; this.compress = options.compress || options.compression || /* suggest */ /* append: */ /* enrich */!1;
let tmp;
this.resolution = options.resolution || 9; this.resolution = options.resolution || 9;
this.tokenize = tmp = options.tokenize || "strict"; this.tokenize = tmp = options.tokenize || "strict";
this.depth = "strict" === tmp && context.depth || 0; this.depth = "strict" === tmp && context.depth || 0;
@@ -56,10 +56,10 @@ export default function Index(options, _register) {
tmp = options.keystore || 0; tmp = options.keystore || 0;
tmp && (this.keystore = tmp); tmp && (this.keystore = tmp);
this.map = tmp && /* tag? */ /* stringify */ /* stringify */ /* single param */ /* skip update: */ /* append: */ /* skip update: */ /* skip_update: */ /* skip deletion */!0 /*await rows.hasNext()*/ /*await rows.hasNext()*/ /*await rows.hasNext()*/ ? new KeystoreMap(tmp) : new Map(); this.map = tmp && !0 ? new KeystoreMap(tmp) : new Map();
this.ctx = tmp && !0 ? new KeystoreMap(tmp) : new Map(); this.ctx = tmp && !0 ? new KeystoreMap(tmp) : new Map();
this.reg = _register || (this.fastupdate ? tmp && !0 ? new KeystoreMap(tmp) : new Map() : tmp && !0 ? new KeystoreSet(tmp) : new Set()); this.reg = _register || (this.fastupdate ? tmp && !0 ? new KeystoreMap(tmp) : new Map() : tmp && !0 ? new KeystoreSet(tmp) : new Set());
this.resolution_ctx = context.resolution || 1; this.resolution_ctx = context.resolution || 3;
this.rtl = encoder.rtl || options.rtl || !1; this.rtl = encoder.rtl || options.rtl || !1;
this.cache = (tmp = options.cache || null) && new Cache(tmp); this.cache = (tmp = options.cache || null) && new Cache(tmp);

View File

@@ -1,6 +1,6 @@
import { SearchOptions } from "../type.js"; import { SearchOptions, SearchResults, EnrichedSearchResults } from "../type.js";
import { create_object, is_object, sort_by_length_down } from "../common.js"; import { create_object, is_object, sort_by_length_down } from "../common.js";
import Index from "../index.js"; import Index from "../index.js";
import default_compress from "../compress.js"; import default_compress from "../compress.js";
@@ -17,7 +17,7 @@ export function set_resolve(resolve) {
* @param {string|SearchOptions} query * @param {string|SearchOptions} query
* @param {number|SearchOptions=} limit * @param {number|SearchOptions=} limit
* @param {SearchOptions=} options * @param {SearchOptions=} options
* @returns {Array|Resolver|Promise<Array|Resolver>} * @returns {SearchResults|EnrichedSearchResults|Resolver|Promise<SearchResults|EnrichedSearchResults|Resolver>}
*/ */
Index.prototype.search = function (query, limit, options) { Index.prototype.search = function (query, limit, options) {
@@ -40,7 +40,8 @@ Index.prototype.search = function (query, limit, options) {
resolve, resolve,
enrich, enrich,
tag, tag,
boost; boost,
resolution;
if (options) { if (options) {
@@ -53,6 +54,7 @@ Index.prototype.search = function (query, limit, options) {
resolve || (global_resolve = 0); resolve || (global_resolve = 0);
enrich = resolve && options.enrich; enrich = resolve && options.enrich;
boost = options.boost; boost = options.boost;
resolution = options.resolution;
tag = this.db && options.tag; tag = this.db && options.tag;
} else { } else {
resolve = this.resolve || global_resolve; resolve = this.resolve || global_resolve;
@@ -62,13 +64,14 @@ Index.prototype.search = function (query, limit, options) {
// do not force a string as input // do not force a string as input
// https://github.com/nextapps-de/flexsearch/issues/432 // https://github.com/nextapps-de/flexsearch/issues/432
query = /** @type {Array<string>} */this.encoder.encode(query); /** @type {Array<string>} */
length = query.length; let query_terms = this.encoder.encode(query);
length = query_terms.length;
limit || !resolve || (limit = 100); limit || !resolve || (limit = 100);
// fast path single term // fast path single term
if (1 === length) { if (1 === length) {
return single_term_query.call(this, query[0], // term return single_term_query.call(this, query_terms[0], // term
"", // ctx "", // ctx
limit, offset, resolve, enrich, tag); limit, offset, resolve, enrich, tag);
} }
@@ -80,8 +83,8 @@ Index.prototype.search = function (query, limit, options) {
// fast path single context // fast path single context
if (2 === length && context && !suggest) { if (2 === length && context && !suggest) {
return single_term_query.call(this, query[0], // term return single_term_query.call(this, query_terms[0], // term
query[1], // ctx query_terms[1], // ctx
limit, offset, resolve, enrich, tag); limit, offset, resolve, enrich, tag);
} }
@@ -98,7 +101,7 @@ Index.prototype.search = function (query, limit, options) {
// if(context){ // if(context){
// keyword = query[0]; // keyword = query_terms[0];
// dupes[keyword] = 1; // dupes[keyword] = 1;
// query_new.push(keyword); // query_new.push(keyword);
// maxlength = minlength = keyword.length; // maxlength = minlength = keyword.length;
@@ -107,7 +110,7 @@ Index.prototype.search = function (query, limit, options) {
for (let i = 0, term; i < length; i++) { for (let i = 0, term; i < length; i++) {
term = query[i]; term = query_terms[i];
if (term && !dupes[term]) { if (term && !dupes[term]) {
@@ -132,7 +135,7 @@ Index.prototype.search = function (query, limit, options) {
// } // }
} }
query = query_new; query_terms = query_new;
length = query.length; length = query.length;
} }
@@ -147,22 +150,22 @@ Index.prototype.search = function (query, limit, options) {
// fast path single term // fast path single term
if (1 === length) { if (1 === length) {
return single_term_query.call(this, query[0], // term return single_term_query.call(this, query_terms[0], // term
"", // ctx "", // ctx
limit, offset, resolve, enrich, tag); limit, offset, resolve, enrich, tag);
} }
// fast path single context // fast path single context
if (2 === length && context && !suggest) { if (2 === length && context && !suggest) {
return single_term_query.call(this, query[0], // term return single_term_query.call(this, query_terms[0], // term
query[1], // ctx query_terms[1], // ctx
limit, offset, resolve, enrich, tag); limit, offset, resolve, enrich, tag);
} }
if (1 < length) { if (1 < length) {
if (context) { if (context) {
// start with context right away // start with context right away
keyword = query[0]; keyword = query_terms[0];
index = 1; index = 1;
} }
// todo // todo
@@ -171,17 +174,21 @@ Index.prototype.search = function (query, limit, options) {
// bigger terms has less occurrence // bigger terms has less occurrence
// this might also reduce the intersection task // this might also reduce the intersection task
// todo check intersection order // todo check intersection order
query.sort(sort_by_length_down); query_terms.sort(sort_by_length_down);
} }
} }
if (!resolution && 0 !== resolution) {
resolution = this.resolution;
}
// from this point there are just multi-term queries // from this point there are just multi-term queries
if (this.db) { if (this.db) {
if (this.db.search) { if (this.db.search) {
// when the configuration is not supported it returns false // when the configuration is not supported it returns false
const result = this.db.search(this, query, limit, offset, suggest, resolve, enrich, tag); const result = this.db.search(this, query_terms, limit, offset, suggest, resolve, enrich, tag);
if (!1 !== result) return result; if (!1 !== result) return result;
} }
@@ -190,7 +197,7 @@ Index.prototype.search = function (query, limit, options) {
for (let arr, term; index < length; index++) { for (let arr, term; index < length; index++) {
term = query[index]; term = query_terms[index];
if (keyword) { if (keyword) {
@@ -211,7 +218,7 @@ Index.prototype.search = function (query, limit, options) {
} else { } else {
arr = await self.get_array(term, "", 0, 0, !1, !1); arr = await self.get_array(term, "", 0, 0, !1, !1);
arr = add_result(arr, result, suggest, self.resolution arr = add_result(arr, result, suggest, resolution
// 0, // /** @type {!number} */ (limit), // 0, // /** @type {!number} */ (limit),
// 0, // offset, // 0, // offset,
// length === 1 // length === 1
@@ -241,13 +248,13 @@ Index.prototype.search = function (query, limit, options) {
} }
} }
return resolve ? intersect(result, self.resolution, /** @type {number} */limit, offset, suggest, boost, resolve) : new Resolver(result[0]); return resolve ? intersect(result, resolution, /** @type {number} */limit, offset, suggest, boost, resolve) : new Resolver(result[0]);
}(); }();
} }
for (let arr, term; index < length; index++) { for (let arr, term; index < length; index++) {
term = query[index]; term = query_terms[index];
if (keyword) { if (keyword) {
@@ -267,7 +274,7 @@ Index.prototype.search = function (query, limit, options) {
} else { } else {
arr = this.get_array(term, "", 0, 0, !1, !1); arr = this.get_array(term, "", 0, 0, !1, !1);
arr = /*this.*/add_result(arr, result, suggest, this.resolution arr = /*this.*/add_result(arr, result, suggest, resolution
// 0, // /** @type {!number} */ (limit), // 0, // /** @type {!number} */ (limit),
// 0, // offset, // 0, // offset,
// length === 1 // length === 1
@@ -293,12 +300,12 @@ Index.prototype.search = function (query, limit, options) {
} }
return result; return result;
} else if (1 === length) { } else if (1 === length) {
return resolve ? resolve_default(result[0], limit, offset) : new Resolver(result[0]); return resolve ? resolve_default(result[0], /** @type {number} */limit, offset) : new Resolver(result[0]);
} }
} }
} }
result = intersect(result, this.resolution, limit, offset, suggest, boost, resolve); result = intersect(result, resolution, limit, offset, suggest, boost, resolve);
return resolve ? result : new Resolver(result); return resolve ? result : new Resolver(result);
}; };
@@ -337,8 +344,8 @@ function single_term_query(term, keyword, limit, offset, resolve, enrich, tag) {
* @private * @private
* @param {Array} arr * @param {Array} arr
* @param {Array} result * @param {Array} result
* @param {Array} suggest * @param {boolean|null=} suggest
* @param {number} resolution * @param {number=} resolution
* @return {Array|boolean|undefined} * @return {Array|boolean|undefined}
*/ */

View File

@@ -14,7 +14,7 @@ export const filter = new Set(["aber", "als", "am", "an", "auch", "auf", "aus",
* Example: The word "correct" and "correctness" could be the same word, so you can define {"ness": ""} to normalize the ending. * Example: The word "correct" and "correctness" could be the same word, so you can define {"ness": ""} to normalize the ending.
* Object Definition: the key represents the word ending, the value contains the replacement (or empty string for removal). * Object Definition: the key represents the word ending, the value contains the replacement (or empty string for removal).
* http://snowball.tartarus.org/algorithms/german/stemmer.html * http://snowball.tartarus.org/algorithms/german/stemmer.html
* @type {Map<string>} * @type {Map<string, string>}
*/ */
export const stemmer = new Map([["niss", ""], ["isch", ""], ["lich", ""], ["heit", ""], ["keit", ""], ["ell", ""], ["bar", ""], ["end", ""], ["ung", ""], ["est", ""], ["ern", ""], ["em", ""], ["er", ""], ["en", ""], ["es", ""], ["st", ""], ["ig", ""], ["ik", ""], ["e", ""], ["s", ""]]); export const stemmer = new Map([["niss", ""], ["isch", ""], ["lich", ""], ["heit", ""], ["keit", ""], ["ell", ""], ["bar", ""], ["end", ""], ["ung", ""], ["est", ""], ["ern", ""], ["em", ""], ["er", ""], ["en", ""], ["es", ""], ["st", ""], ["ig", ""], ["ik", ""], ["e", ""], ["s", ""]]);
@@ -22,7 +22,7 @@ export const stemmer = new Map([["niss", ""], ["isch", ""], ["lich", ""], ["heit
/** /**
* Matcher replaces all occurrences of a given string regardless of its position and is also a kind of "partial normalization". * Matcher replaces all occurrences of a given string regardless of its position and is also a kind of "partial normalization".
* Object Definition: the key represents the target term, the value contains the search string which should be replaced (could also be an array of multiple terms). * Object Definition: the key represents the target term, the value contains the search string which should be replaced (could also be an array of multiple terms).
* @type {Map<string>} * @type {Map<string, string>}
*/ */
const map = new Map([["_", " "], ["ä", "ae"], ["ö", "oe"], ["ü", "ue"], ["ß", "ss"], ["&", " und "], ["€", " EUR "]]), const map = new Map([["_", " "], ["ä", "ae"], ["ö", "oe"], ["ü", "ue"], ["ß", "ss"], ["&", " und "], ["€", " EUR "]]),
options = { options = {

View File

@@ -9,7 +9,7 @@ import { EncoderOptions } from "../type.js";
export const filter = new Set(["au", "aux", "avec", "ce", "ces", "dans", "de", "des", "du", "elle", "en", "et", "eux", "il", "je", "la", "le", "leur", "lui", "ma", "mais", "me", "meme", "mes", "moi", "mon", "ne", "nos", "notre", "nous", "on", "ou", "par", "pas", "pour", "qu", "que", "qui", "sa", "se", "ses", "son", "sur", "ta", "te", "tes", "toi", "ton", "tu", "un", "une", "vos", "votre", "vous", "c", "d", "j", "l", "m", "n", "s", "t", "a", "y", "ete", "etee", "etees", "etes", "etant", "suis", "es", "est", "sommes", "etes", "sont", "serai", "seras", "sera", "serons", "serez", "seront", "serais", "serait", "serions", "seriez", "seraient", "etais", "etait", "etions", "etiez", "etaient", "fus", "fut", "fumes", "futes", "furent", "sois", "soit", "soyons", "soyez", "soient", "fusse", "fusses", "fut", "fussions", "fussiez", "fussent", "ayant", "eu", "eue", "eues", "eus", "ai", "as", "avons", "avez", "ont", "aurai", "auras", "aura", "aurons", "aurez", "auront", "aurais", "aurait", "aurions", "auriez", "auraient", "avais", "avait", "avions", "aviez", "avaient", "eut", "eumes", "eutes", "eurent", "aie", "aies", "ait", "ayons", "ayez", "aient", "eusse", "eusses", "eut", "eussions", "eussiez", "eussent", "ceci", "cela", "cela", "cet", "cette", "ici", "ils", "les", "leurs", "quel", "quels", "quelle", "quelles", "sans", "soi"]); export const filter = new Set(["au", "aux", "avec", "ce", "ces", "dans", "de", "des", "du", "elle", "en", "et", "eux", "il", "je", "la", "le", "leur", "lui", "ma", "mais", "me", "meme", "mes", "moi", "mon", "ne", "nos", "notre", "nous", "on", "ou", "par", "pas", "pour", "qu", "que", "qui", "sa", "se", "ses", "son", "sur", "ta", "te", "tes", "toi", "ton", "tu", "un", "une", "vos", "votre", "vous", "c", "d", "j", "l", "m", "n", "s", "t", "a", "y", "ete", "etee", "etees", "etes", "etant", "suis", "es", "est", "sommes", "etes", "sont", "serai", "seras", "sera", "serons", "serez", "seront", "serais", "serait", "serions", "seriez", "seraient", "etais", "etait", "etions", "etiez", "etaient", "fus", "fut", "fumes", "futes", "furent", "sois", "soit", "soyons", "soyez", "soient", "fusse", "fusses", "fut", "fussions", "fussiez", "fussent", "ayant", "eu", "eue", "eues", "eus", "ai", "as", "avons", "avez", "ont", "aurai", "auras", "aura", "aurons", "aurez", "auront", "aurais", "aurait", "aurions", "auriez", "auraient", "avais", "avait", "avions", "aviez", "avaient", "eut", "eumes", "eutes", "eurent", "aie", "aies", "ait", "ayons", "ayez", "aient", "eusse", "eusses", "eut", "eussions", "eussiez", "eussent", "ceci", "cela", "cela", "cet", "cette", "ici", "ils", "les", "leurs", "quel", "quels", "quelle", "quelles", "sans", "soi"]);
/** /**
* @type {Object<string, string>} * @type {Map<string, string>}
*/ */
export const stemmer = new Map([["lement", ""], ["ient", ""], ["nera", ""], ["ment", ""], ["ais", ""], ["ait", ""], ["ant", ""], ["ent", ""], ["iez", ""], ["ion", ""], ["nez", ""], ["ai", ""], ["es", ""], ["er", ""], ["ez", ""], ["le", ""], ["na", ""], ["ne", ""], ["a", ""], ["e", ""]]); export const stemmer = new Map([["lement", ""], ["ient", ""], ["nera", ""], ["ment", ""], ["ais", ""], ["ait", ""], ["ant", ""], ["ent", ""], ["iez", ""], ["ion", ""], ["nez", ""], ["ai", ""], ["es", ""], ["er", ""], ["ez", ""], ["le", ""], ["na", ""], ["ne", ""], ["a", ""], ["e", ""]]);

11
dist/module/preset.js vendored
View File

@@ -3,7 +3,7 @@ import { is_string } from "./common.js";
import { IndexOptions } from "./type.js"; import { IndexOptions } from "./type.js";
/** /**
* @enum {Object} * @type {Object<string, IndexOptions>}
* @const * @const
*/ */
@@ -38,17 +38,18 @@ const presets = {
/** /**
* *
* @param {!IndexOptions|string} options * @param {IndexOptions|string} options
* @return {IndexOptions} * @return {IndexOptions}
*/ */
export default function apply_preset(options) { export default function apply_preset(options) {
const preset = is_string(options) ? options : options.preset; const preset = /** @type string */is_string(options) ? options : options.preset;
if (preset) { if (preset) {
options = Object.assign({}, presets[preset], /** @type {Object} */options); options = /** @type IndexOptions */Object.assign({}, presets[preset], /** @type {Object} */options);
} }
return options; return (/** @type IndexOptions */options
);
} }

339
dist/module/type.js vendored
View File

@@ -5,230 +5,243 @@ import Encoder from "./encoder.js";
import StorageInterface from "./db/interface.js"; import StorageInterface from "./db/interface.js";
/** /**
* @typedef IndexOptions {{ * @typedef {{
* preset: string|undefined, * preset: (string|undefined),
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (function():number|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|boolean|undefined),
* resolve: [boolean=true], * resolve: (boolean|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* commit: boolean=true, * commit: (boolean|undefined),
* worker: boolean|string|undefined, * worker: (string|undefined),
* config: string|undefined * config: (string|undefined)
* }} * }}
*/ */
export const IndexOptions = {}; export let IndexOptions = {};
/** /**
* @typedef DocumentIndexOptions {{ * @typedef {{
* preset: string|undefined, * preset: (string|undefined),
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (Function|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* commit: boolean=true, * commit: (boolean|undefined),
* config: string|undefined, * config: (string|undefined),
* field: string, * field: (string|undefined),
* filter: Function|undefined, * filter: (Function|undefined),
* custom: Function|undefined * custom: (Function|undefined)
* }} * }}
*/ */
export const DocumentIndexOptions = {}; export let FieldOptions = {};
/** /**
* @typedef DocumentOptions {{ * @typedef {{
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (Function|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|boolean|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* doc: DocumentDescriptor|Array<DocumentDescriptor>|undefined, * doc: (DocumentDescriptor|Array<DocumentDescriptor>|undefined),
* document: DocumentDescriptor|Array<DocumentDescriptor>|undefined, * document: (DocumentDescriptor|Array<DocumentDescriptor>|undefined),
* worker: boolean|string|undefined * worker: (boolean|string|undefined),
* }} * }}
*/ */
export const DocumentOptions = {}; export let DocumentOptions = {};
/** /**
* @typedef ContextOptions {{ * @typedef {{
* depth: number, * depth: (number|undefined),
* bidirectional: boolean|undefined, * bidirectional: (boolean|undefined),
* resolution: number|undefined * resolution: (number|undefined),
* }} * }}
*/ */
export const ContextOptions = {}; export let ContextOptions = {};
/** /**
* @typedef DocumentDescriptor {{ * @typedef {{
* id: string="id", * id: (string|undefined),
* field: FieldOptions|Array<FieldOptions>|undefined, * field: (string|Array<string>|FieldOptions|Array<FieldOptions>|undefined),
* index: FieldOptions|Array<FieldOptions>|undefined, * index: (string|Array<string>|FieldOptions|Array<FieldOptions>|undefined),
* tag: TagOptions|Array<TagOptions>|undefined, * tag: (string|Array<string>|TagOptions|Array<TagOptions>|undefined),
* store: StoreOptions|Array<StoreOptions>|undefined * store: (string|Array<string>|StoreOptions|Array<StoreOptions>|boolean|undefined),
* }} * }}
*/ */
export const DocumentDescriptor = {}; export let DocumentDescriptor = {};
/** /**
* @typedef TagOptions {{ * @typedef {{
* field: string, * field: string,
* tag: Object<string, string|Array<string>>|Array<string>|string, * filter: ((function(string):boolean)|undefined),
* filter: Function|undefined, * custom: ((function(string):string)|undefined),
* custom: Function|undefined, * db: (StorageInterface|undefined),
* keystore: [number=0],
* db: StorageInterface|undefined,
* config: string|undefined
* }} * }}
*/ */
export const TagOptions = {}; export let TagOptions = {};
/** /**
* @typedef StoreOptions {{ * @typedef {{
* field: string, * field: string,
* filter: Function|undefined, * filter: ((function(string):boolean)|undefined),
* custom: Function|undefined, * custom: ((function(string):string)|undefined)
* config: string|undefined
* }} * }}
*/ */
export const StoreOptions = {}; export let StoreOptions = {};
/** /**
* @typedef SearchOptions {{ * @typedef {{
* query: string=, * query: (string|undefined),
* limit: [number=100], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* context: boolean|undefined, * resolution: (number|undefined),
* suggest: [boolean=false], * context: (boolean|undefined),
* resolve: [boolean=true], * suggest: (boolean|undefined),
* enrich: [boolean=false] * resolve: (boolean|undefined),
* enrich: (boolean|undefined),
* }} * }}
*/ */
export const SearchOptions = {}; export let SearchOptions = {};
// tag: Array|undefined
/** /**
* @typedef DocumentSearchOptions {{ * @typedef {{
* query: string=, * query: (string|undefined),
* limit: [number=100], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* context: boolean|undefined, * context: (boolean|undefined),
* suggest: [boolean=false], * suggest: (boolean|undefined),
* enrich: [boolean=false], * enrich: (boolean|undefined),
* tag: Object|Array<Object>|undefined, * tag: (Object|Array<Object>|undefined),
* field: Array<DocumentSearchOptions>|undefined, * field: (Array<string>|Array<DocumentSearchOptions>|string|undefined),
* index: Array<DocumentSearchOptions>|undefined, * index: (Array<string>|Array<DocumentSearchOptions>|undefined),
* pluck: boolean|undefined, * pluck: (string|undefined),
* merge: [boolean=false], * merge: (boolean|undefined),
* highlight: string|undefined * highlight: (string|undefined),
* }} * }}
*/ */
export const DocumentSearchOptions = {}; export let DocumentSearchOptions = {};
/** /**
* @typedef DocumentSearchResults Array<{{ * @typedef Array<number|string>
* field: string|undefined,
* tag: string|undefined,
* result: Array<number|string>,
* highlight: string|undefined
* }}>
*/ */
export const DocumentSearchResults = {}; export let SearchResults = {};
/** /**
* @typedef EnrichedDocumentSearchResults Array<{{ * @typedef Array<{
* field: string|undefined, * id: (number|string),
* tag: string|undefined, * res: number
* result: Array<{{ * }>
* id: number|string,
* doc: Object
* }}>,
* highlight: string|undefined
* }}>
*/ */
export const EnrichedDocumentSearchResults = {}; export let EnrichedSearchResults = {};
/** /**
* @typedef MergedDocumentSearchResults Array<{{ * @typedef Array<{
* id: number|string, * field: (string|undefined),
* doc: Object|undefined, * tag: (string|undefined),
* field: Array<string>, * result: SearchResults
* highlight: string|undefined * }>
* }}>
*/ */
export const MergedDocumentSearchResults = {}; export let DocumentSearchResults = {};
/** /**
* @typedef EncoderOptions {{ * @typedef Array<{
* rtl: boolean=false, * field: (string|undefined),
* dedupe: boolean=true, * tag: (string|undefined),
* split: string|undefined, * highlight: (string|undefined),
* include: EncoderSplitOptions|undefined, * result: Array<{
* exclude: EncoderSplitOptions|undefined, * id: (number|string),
* prepare: function(string):string|undefined, * doc: (Object|null)
* finalize: function(Array<>string>):Array<string>|undefined, * }>
* filter: Set|undefined, * }>
* matcher: Map|undefined, */
* mapper: Map|undefined, export let EnrichedDocumentSearchResults = {};
* stemmer: Map|undefined,
* replacer: Array<string|RegExp>|undefined, /**
* minlength: number=1, * @typedef Array<{
* maxlength: number|undefined, * id: (number|string),
* cache: boolean=true, * doc: (Object|null),
* field: (Array<string>|undefined),
* tag: (Array<string>|undefined)
* }>
*/
export let MergedDocumentSearchResults = {};
/**
* @typedef {{
* letter: (boolean|undefined),
* number: (boolean|undefined),
* symbol: (boolean|undefined),
* punctuation: (boolean|undefined),
* control: (boolean|undefined),
* char: (string|Array<string>|undefined)
* }} * }}
*/ */
export const EncoderOptions = {}; export let EncoderSplitOptions = {};
/** /**
* @typedef EncoderSplitOptions {{ * @typedef {{
* letter: boolean=false, * rtl: (boolean|undefined),
* number: boolean=false, * dedupe: (boolean|undefined),
* symbol: boolean=false, * include: (EncoderSplitOptions|undefined),
* punctuation: boolean=false, * exclude: (EncoderSplitOptions|undefined),
* control: boolean=false, * split: (string|boolean|undefined),
* char: string|Array<string>|undefined, * normalize: (boolean|(function(string):string)|undefined),
* prepare: ((function(string):string)|undefined),
* finalize: ((function(Array<string>):(Array<string>|void))|undefined),
* filter: (Set<string>|undefined),
* matcher: (Map<string, string>|undefined),
* mapper: (Map<string, string>|undefined),
* stemmer: (Map<string, string>|undefined),
* replacer: (Array<string|RegExp, string>|undefined),
* minlength: (number|undefined),
* maxlength: (number|undefined),
* cache: (boolean|undefined)
* }} * }}
*/ */
export const EncoderSplitOptions = {}; export let EncoderOptions = {};
/** /**
* @typedef PersistentOptions {{ * @typedef {{
* name: string="flexsearch", * name: (string|undefined),
* field: string|undefined, * field: (string|undefined),
* type: string|undefined, * type: (string|undefined),
* db: *|undefined * db: (StorageInterface|undefined)
* }} * }}
*/ */
export const PersistentOptions = {}; export let PersistentOptions = {};
/** /**
* @typedef ResolverOptions {{ * @typedef {{
* index: Index|undefined, * index: (Index|undefined),
* query: string, * query: (string|undefined),
* limit: [number=0], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* enrich: boolean=false, * enrich: (boolean|undefined),
* resolve: boolean=false, * resolve: (boolean|undefined),
* suggest: boolean=false * suggest: (boolean|undefined),
* and: (ResolverOptions|Array<ResolverOptions>|undefined),
* or: (ResolverOptions|Array<ResolverOptions>|undefined),
* xor: (ResolverOptions|Array<ResolverOptions>|undefined),
* not: (ResolverOptions|Array<ResolverOptions>|undefined)
* }} * }}
*/ */
export const ResolverOptions = {}; export let ResolverOptions = {};

View File

@@ -9,7 +9,7 @@ let pid = 0;
* @constructor * @constructor
*/ */
export default function WorkerIndex(options = {}) { export default function WorkerIndex(options = /** @type IndexOptions */{}) {
if (!this || this.constructor !== WorkerIndex) { if (!this || this.constructor !== WorkerIndex) {
return new WorkerIndex(options); return new WorkerIndex(options);

View File

@@ -15,12 +15,12 @@ export default (async function (data) {
case "init": case "init":
/** @type IndexOptions */ /** @type {IndexOptions} */
let options = data.options || {}, let options = data.options || {},
filepath = options.config; filepath = options.config;
if (filepath) { if (filepath) {
options = filepath; options = options;
// will be replaced after build with the line below because // will be replaced after build with the line below because
// there is an issue with closure compiler dynamic import // there is an issue with closure compiler dynamic import
options = (await import(filepath))["default"]; options = (await import(filepath))["default"];

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-basic-persistent</title> <title>Example: browser-legacy-basic-persistent</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.min.js"></script>
<script> <script>
(async function(){ (async function(){

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-basic-resolver</title> <title>Example: browser-legacy-basic-resolver</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.min.js"></script>
<script> <script>
// create a simple index which can store id-content-pairs // create a simple index which can store id-content-pairs

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-basic-suggestion</title> <title>Example: browser-legacy-basic-suggestion</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.light.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.light.min.js"></script>
<script> <script>
// create a simple index which can store id-content-pairs // create a simple index which can store id-content-pairs

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-basic-worker</title> <title>Example: browser-legacy-basic-worker</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.min.js"></script>
<script> <script>
(async function(){ (async function(){

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-basic</title> <title>Example: browser-legacy-basic</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.light.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.light.min.js"></script>
<script> <script>
// create a simple index which can store id-content-pairs // create a simple index which can store id-content-pairs

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-document-highlighting</title> <title>Example: browser-legacy-document-highlighting</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.compact.min.js"></script>
<script type="module"> <script type="module">
// some test data // some test data

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-document-persistent</title> <title>Example: browser-legacy-document-persistent</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.min.js"></script>
<script> <script>
(async function(){ (async function(){

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-document-worker</title> <title>Example: browser-legacy-document-worker</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.min.js"></script>
<script> <script>
(async function(){ (async function(){

View File

@@ -6,7 +6,7 @@
<title>Example: browser-legacy-document</title> <title>Example: browser-legacy-document</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.compact.min.js"></script>
<script> <script>
// some test data // some test data

View File

@@ -6,9 +6,9 @@
<title>Example: browser-legacy-language-packs</title> <title>Example: browser-legacy-language-packs</title>
</head> </head>
<body style="white-space: pre"> <body style="white-space: pre">
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.compact.min.js"></script>
<!-- Load language pack after loading the library --> <!-- Load language pack after loading the library -->
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/lang/en.min.js"></script> <script src="https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/lang/en.min.js"></script>
<script> <script>
const encoder = new FlexSearch.Encoder( const encoder = new FlexSearch.Encoder(

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre"> <body style="white-space: pre">
<script type="module"> <script type="module">
import { Index, IndexedDB } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js"; import { Index, IndexedDB } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.module.min.js";
// create DB instance with namespace // create DB instance with namespace
const db = new IndexedDB("my-store"); const db = new IndexedDB("my-store");

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre"> <body style="white-space: pre">
<script type="module"> <script type="module">
import { Index, Resolver } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js"; import { Index, Resolver } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.module.min.js";
// create a simple index which can store id-content-pairs // create a simple index which can store id-content-pairs
const index = new Index({ const index = new Index({

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre"> <body style="white-space: pre">
<script type="module"> <script type="module">
import { Index } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.light.module.min.js"; import { Index } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.light.module.min.js";
// create a simple index which can store id-content-pairs // create a simple index which can store id-content-pairs
const index = new Index({ const index = new Index({

View File

@@ -1,4 +1,4 @@
import { Encoder } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js"; import { Encoder } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.module.min.js";
export default { export default {
tokenize: "forward", tokenize: "forward",

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre"> <body style="white-space: pre">
<script type="module"> <script type="module">
import { Index } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.light.module.min.js"; import { Index } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.light.module.min.js";
// create a simple index which can store id-content-pairs // create a simple index which can store id-content-pairs
const index = new Index({ const index = new Index({

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre"> <body style="white-space: pre">
<script type="module"> <script type="module">
import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.module.min.js"; import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.compact.module.min.js";
// some test data // some test data
const data = [{ const data = [{

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre"> <body style="white-space: pre">
<script type="module"> <script type="module">
import { Document, Charset, IndexedDB } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js"; import { Document, Charset, IndexedDB } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.module.min.js";
// some test data // some test data
const data = [{ const data = [{

View File

@@ -1,5 +1,5 @@
import { Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js"; import { Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/module/lang/en.js"; import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/module/lang/en.js";
export default { export default {
tokenize: "forward", tokenize: "forward",

View File

@@ -1,5 +1,5 @@
import { Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js"; import { Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.bundle.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/module/lang/en.js"; import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/module/lang/en.js";
export default { export default {
tokenize: "forward", tokenize: "forward",

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre"> <body style="white-space: pre">
<script type="module"> <script type="module">
import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.module.min.js"; import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.compact.module.min.js";
// some test data // some test data
const data = [{ const data = [{

View File

@@ -8,8 +8,8 @@
<body style="white-space: pre"> <body style="white-space: pre">
<script type="module"> <script type="module">
import { Index, Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.module.min.js"; import { Index, Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/flexsearch.compact.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/module/lang/en.js"; import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/a006c24bbb6f77ad491fa81c1c30481efa2431de/dist/module/lang/en.js";
const encoder = new Encoder( const encoder = new Encoder(
Charset.LatinSimple, Charset.LatinSimple,

698
index.d.ts vendored
View File

@@ -1,5 +1,6 @@
declare module "flexsearch" { declare module "flexsearch" {
// Type definitions for flexsearch 0.7
// Type definitions for flexsearch 0.8
// Project: https://github.com/nextapps-de/flexsearch/ // Project: https://github.com/nextapps-de/flexsearch/
// Definitions by: LOSSES Don <https://github.com/Losses> // Definitions by: LOSSES Don <https://github.com/Losses>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -7,16 +8,11 @@ declare module "flexsearch" {
/************************************/ /************************************/
/* Utils */ /* Utils */
/************************************/ /************************************/
export type Id = number | string; type Id = number | string;
export type Limit = number; type Limit = number;
export type ExportHandler<T> = (id: string | number, value: T) => void; type ExportHandler = (key: string, data: string) => void;
export type AsyncCallback<T = undefined> = T extends undefined type ExportHandlerAsync = (key: string, data: string) => Promise<void>;
? () => void type AsyncCallback<T> = (result?: T) => Promise<void>;
: (result: T) => void;
export type UnknownFunction = (...x: unknown[]) => unknown;
export type StoreOption = boolean | string | string[];
export type EnrichStoreOption = true | string | string[];
/************************************/ /************************************/
/* Common Options */ /* Common Options */
@@ -26,140 +22,196 @@ declare module "flexsearch" {
* **Document:** * **Document:**
* * Presets: https://github.com/nextapps-de/flexsearch#presets * * Presets: https://github.com/nextapps-de/flexsearch#presets
*/ */
export type Preset = "memory" | "performance" | "match" | "score" | "default"; type Preset =
| "memory"
| "performance"
| "match"
| "score"
| "default";
/** /**
* **Document:** * **Document:**
* * Tokenizer: https://github.com/nextapps-de/flexsearch#tokenizer-prefix-search * * Tokenizer: https://github.com/nextapps-de/flexsearch#tokenizer-prefix-search
* * Add custom tokenizer: https://github.com/nextapps-de/flexsearch#add-custom-tokenizer * * Add custom tokenizer: https://github.com/nextapps-de/flexsearch#add-custom-tokenizer
*/ */
export type Tokenizer = type Tokenizer =
| "strict" | "strict"
| "forward" | "forward"
| "reverse" | "reverse"
| "full" | "full";
| ((x: string) => string[]);
/** /**
* **Document:** * **Document:**
* * Encoders: https://github.com/nextapps-de/flexsearch#encoders * * Encoders: https://github.com/nextapps-de/flexsearch#encoders
*/ */
export type Encoders = type Encoders =
| false | "LatinExact"
| "default" | "LatinDefault"
| "simple" | "LatinSimple"
| "balance" | "LatinBalance"
| "advanced" | "LatinAdvanced"
| "extra" | "LatinExtra"
| "LatinSoundex"
| "ArabicDefault"
| "CjkDefault"
| "CryllicDefault"
| ((x: string) => string[]); | ((x: string) => string[]);
/** /**
* **Document:** * **Document:**
* * Context Options: https://github.com/nextapps-de/flexsearch#context-options
* * Contextual search: https://github.com/nextapps-de/flexsearch#contextual * * Contextual search: https://github.com/nextapps-de/flexsearch#contextual
*/ */
export interface ContextOptions {
type ContextOptions = {
resolution: number; resolution: number;
depth: false | number; depth: number;
bidirectional: boolean; bidirectional: boolean;
} };
/** /**
* **Document:** * **Document:**
* * Search options: https://github.com/nextapps-de/flexsearch#search-options * * Search options: https://github.com/nextapps-de/flexsearch#search-options
*/ */
export interface SearchOptions { type SearchOptions = {
query?: string; query?: string;
limit?: number; limit?: number;
offset?: number; offset?: number;
suggest?: boolean; suggest?: boolean;
} resolution?: number;
context?: boolean;
resolve?: boolean;
enrich?: boolean;
};
/** /**
* **Document:** * **Document:**
* * The document descriptor: https://github.com/nextapps-de/flexsearch#the-document-descriptor * * The document descriptor: https://github.com/nextapps-de/flexsearch#the-document-descriptor
*/ */
export interface Descriptor<T, Store extends StoreOption = false> { type DocumentDescriptor = {
id: string | number; id?: string | "id";
field: string[] | Array<IndexOptions<T, Store>>; field?: FieldName | FieldName[] | FieldOptions | Array<FieldOptions>;
} index?: FieldName | FieldName[] | FieldOptions | Array<FieldOptions>;
tag?: FieldName | FieldName[] | TagOptions | Array<TagOptions>;
store?: FieldName | FieldName[] | StoreOptions | Array<StoreOptions>;
};
/** type WorkerURL = string;
* **Document:** type WorkerPath = string;
* * Context Options: https://github.com/nextapps-de/flexsearch#context-options type WorkerConfigURL = string;
*/ type WorkerConfigPath = string;
export interface ContextOptions { type SerializedFunctionString = string;
resolution: number; type FieldName = string;
depth: false | number; type TemplateResultHighlighting = string;
bidirectional: boolean;
}
/**
* **Document:**
* * Charset options: https://github.com/nextapps-de/flexsearch#charset-options
*/
export interface CharsetOptions {
split: false | string | RegExp;
rtl: boolean;
encode: (x: string) => string[];
}
export interface Stemmer {
[key: string]: string;
}
export interface Matcher {
[key: string]: string;
}
export type FilterFunction = (x: string) => boolean;
export type FilterArray = string[];
/** /**
* **Document:** * **Document:**
* * Language Options: https://github.com/nextapps-de/flexsearch#language-options * * Language Options: https://github.com/nextapps-de/flexsearch#language-options
* * Language: https://github.com/nextapps-de/flexsearch#languages * * Language: https://github.com/nextapps-de/flexsearch#languages
*/ */
export interface LanguageOptions {
stemmer: false | string | Stemmer | UnknownFunction; type EncoderOptions = {
filter: false | string | FilterArray | FilterFunction; rtl?: boolean;
matcher: false | string | Matcher | UnknownFunction; dedupe?: boolean;
} include?: EncoderSplitOptions;
exclude?: EncoderSplitOptions;
split?: string|RegExp|""|false;
prepare?: (str: string) => string;
finalize?: (terms: string[]) => string[];
filter?: Set<string>;
matcher?: Map<string, string>;
mapper?: Map<string, string>;
stemmer?: Map<string, string>;
replacer?: [string|RegExp, string|""];
minlength?: number;
maxlength?: number;
cache?: boolean|number;
};
type EncoderSplitOptions = {
letter?: boolean;
number?: boolean;
symbol?: boolean;
punctuation?: boolean;
control?: boolean;
char?: string|string[];
};
export type Charset = {
LatinExact: EncoderOptions;
LatinDefault: EncoderOptions;
LatinSimple: EncoderOptions;
LatinBalance: EncoderOptions;
LatinAdvanced: EncoderOptions;
LatinExtra: EncoderOptions;
LatinSoundex: EncoderOptions;
ArabicDefault: EncoderOptions;
CjkDefault: EncoderOptions;
CyrillicDefault: EncoderOptions;
};
/** /**
* These options will determine how the documents be indexed. * These options will determine how the contents will be indexed.
*
* **Generic type parameters:**
*
* @template T The type of the document.
* @template Store If store is enabled.
* *
* **Document:** * **Document:**
* * Index options: https://github.com/nextapps-de/flexsearch#index-options * * Index options: https://github.com/nextapps-de/flexsearch#index-options
* * Tokenizer: https://github.com/nextapps-de/flexsearch#tokenizer
* * Encoder: https://github.com/nextapps-de/flexsearch#encoder
* * Context: https://github.com/nextapps-de/flexsearch#context
* * Resolver: https://github.com/nextapps-de/flexsearch#resolver
* * Keystore: https://github.com/nextapps-de/flexsearch#keystore
* * Persistent: https://github.com/nextapps-de/flexsearch#persistent
* * Right-To-Left: https://github.com/nextapps-de/flexsearch#rtl
* * Language: https://github.com/nextapps-de/flexsearch#languages * * Language: https://github.com/nextapps-de/flexsearch#languages
*/ */
export interface IndexOptions<T, Store extends StoreOption = false> { type IndexOptions = {
preset?: Preset; preset?: Preset;
tokenize?: Tokenizer; tokenize?: Tokenizer;
cache?: boolean | number; cache?: boolean | number;
resolution?: number; resolution?: number;
context?: boolean | IndexOptions<T, Store> | ContextOptions; context?: ContextOptions | boolean;
optimize?: boolean; keystore?: number;
boost?: (words: string[], term: string, index: number) => number; resolve?: boolean;
fastupdate?: boolean;
score?: (
content: string[],
term: string,
term_index: number,
partial: string,
partial_index: number
) => number;
// Persistent-specific options
db?: StorageInterface;
commit?: boolean;
// Language-specific Options and Encoding // Language-specific Options and Encoding
charset?: CharsetOptions | string; encoder?: Charset | Encoders | EncoderOptions;
language?: LanguageOptions | string; encode?: ((x: string) => string[]),
encode?: Encoders; rtl?: boolean;
stemmer?: LanguageOptions["stemmer"]; };
filter?: LanguageOptions["filter"];
matcher?: LanguageOptions["matcher"]; type WorkerIndexOptions = IndexOptions & {
} config?: WorkerConfigURL | WorkerConfigPath,
db: null,
commit: null
};
/************************************/ /************************************/
/* Index Search */ /* Index Search */
/************************************/ /************************************/
export type IndexSearchResult = Id[]; type DefaultSearchResults = Id[];
type IntermediateSearchResults = Array<Id[]>;
type EnrichedSearchResults = Array<{
id: Id;
score: number;
}>;
type SearchResults =
DefaultSearchResults |
IntermediateSearchResults |
EnrichedSearchResults |
Promise<SearchResults>;
/** /**
* **Document:** * **Document:**
@@ -169,53 +221,78 @@ declare module "flexsearch" {
*/ */
export class Index { export class Index {
constructor(x?: Preset | IndexOptions<string>); constructor(options?: Preset | IndexOptions);
add(id: Id, item: string): this; add(id: Id, content: string): this | Promise<this>;
append(id: Id, item: string): this; /**
update(id: Id, item: string): this; * @deprecated The method "append" will be removed in an upcoming release, just use "add" instead
remove(target: Id): this; */
search(query: string, options?: Limit | SearchOptions): IndexSearchResult; append(id: Id, content: string): this | Promise<this>;
search( update(id: Id, content: string): this | Promise<this>;
query: string, remove(id: Id): this | Promise<this>;
limit: number, search(query: string, options?: Limit | SearchOptions): SearchResults;
options: SearchOptions search(query: string, limit: number, options: SearchOptions): SearchResults;
): IndexSearchResult; search(options: SearchOptions): SearchResults;
search(options: SearchOptions): IndexSearchResult; searchCache(query: string, options?: Limit | SearchOptions): SearchResults;
searchCache(query: string, limit: number, options: SearchOptions): SearchResults;
searchCache(options: SearchOptions): SearchResults;
// https://github.com/nextapps-de/flexsearch#check-existence-of-already-indexed-ids // https://github.com/nextapps-de/flexsearch#check-existence-of-already-indexed-ids
contain(id: Id): boolean; contain(id: Id): boolean | Promise<boolean>;
clear(): void | Promise<void>;
cleanup(): void | Promise<void>;
export(handler: ExportHandler<string>): Promise<void>; // Export and Import
import(id: Id, item: string): Promise<void>; export(handler: ExportHandler): void;
export(handler: ExportHandlerAsync): Promise<void>;
import(key: string, data: string): void;
serialize(with_function_wrapper?: boolean): SerializedFunctionString;
// Persistent Index
mount(db: StorageInterface): Promise<void>;
commit(replace_all_contents?: boolean): Promise<void>;
destroy(): Promise<void>;
// Async Methods // Async Methods
/** @deprecated The "async" variants are deprecated, instead use the default variant */
addAsync( addAsync(
id: Id, id: Id,
item: string, content: string,
callback?: AsyncCallback<this> callback?: AsyncCallback<void>
): Promise<this>; ): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
appendAsync( appendAsync(
id: Id, id: Id,
item: string, content: string,
callback?: AsyncCallback<this> callback?: AsyncCallback<void>
): Promise<this>; ): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
updateAsync( updateAsync(
id: Id, id: Id,
item: string, content: string,
callback?: AsyncCallback<this> callback?: AsyncCallback<void>
): Promise<this>; ): Promise<this>;
removeAsync(target: Id, callback?: AsyncCallback<this>): Promise<this>; /** @deprecated The "async" variants are deprecated, instead use the default variant */
removeAsync(
id: Id,
callback?: AsyncCallback<void>
): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
searchAsync( searchAsync(
query: string, query: string,
options?: Limit | SearchOptions, options?: Limit | SearchOptions,
callback?: AsyncCallback<IndexSearchResult> callback?: AsyncCallback<SearchResults>
): Promise<IndexSearchResult>; ): Promise<SearchResults>
/** @deprecated The "async" variants are deprecated, instead use the default variant */
searchAsync( searchAsync(
query: string, query: string,
limit: number, limit: Limit,
options?: Limit | SearchOptions options?: SearchOptions,
): IndexSearchResult; callback?: AsyncCallback<SearchResults>
searchAsync(options: SearchOptions): Promise<IndexSearchResult>; ): Promise<SearchResults>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
searchAsync(
options: SearchOptions,
callback?: AsyncCallback<SearchResults>
): Promise<SearchResults>;
} }
/** /**
@@ -224,100 +301,79 @@ declare module "flexsearch" {
* * API overview: https://github.com/nextapps-de/flexsearch#api-overview * * API overview: https://github.com/nextapps-de/flexsearch#api-overview
* * Worker index: https://github.com/nextapps-de/flexsearch#worker-index * * Worker index: https://github.com/nextapps-de/flexsearch#worker-index
*/ */
export class Worker {
constructor(x?: Preset | IndexOptions<string>);
add(id: Id, item: string, callback?: AsyncCallback<Worker>): Promise<this>; export class Worker extends Index {
append(id: Id, item: string, callback?: AsyncCallback<this>): Promise<this>; constructor(options?: Preset | WorkerIndexOptions);
update(id: Id, item: string, callback?: AsyncCallback<this>): Promise<this>;
remove(target: Id, callback?: AsyncCallback<this>): Promise<this>;
search(
query: string,
options?: Limit | SearchOptions,
callback?: AsyncCallback<IndexSearchResult>
): Promise<IndexSearchResult>;
search(
query: string,
limit: number,
options?: Limit | SearchOptions
): IndexSearchResult;
search(options: SearchOptions): Promise<IndexSearchResult>;
// Async Methods
addAsync(
id: Id,
item: string,
callback?: AsyncCallback<this>
): Promise<this>;
appendAsync(
id: Id,
item: string,
callback?: AsyncCallback<this>
): Promise<this>;
updateAsync(
id: Id,
item: string,
callback?: AsyncCallback<this>
): Promise<this>;
removeAsync(target: Id, callback?: AsyncCallback<this>): Promise<this>;
searchAsync(
query: string,
options?: Limit | SearchOptions,
callback?: AsyncCallback<IndexSearchResult>
): Promise<IndexSearchResult>;
searchAsync(
query: string,
limit: number,
options?: Limit | SearchOptions
): IndexSearchResult;
searchAsync(options: SearchOptions): Promise<IndexSearchResult>;
} }
/************************************/ /************************************/
/* Document Search */ /* Document Search */
/************************************/ /************************************/
type FieldOptions = IndexOptions & {
field: FieldName,
filter?: (content: string) => boolean;
custom?: (content: string) => string;
config?: WorkerConfigURL | WorkerConfigPath;
resolve: true;
};
type TagOptions = {
field: FieldName;
filter?: (content: string) => boolean;
custom?: (content: string) => string;
db?: StorageInterface;
resolve: true;
};
type StoreOptions = {
field: FieldName;
filter?: (content: string) => boolean;
custom?: (content: string) => string;
db?: StorageInterface;
resolve: true;
};
/* /*
* **Document:** * **Document:**
* * Document options: https://github.com/nextapps-de/flexsearch#document-options * * Document options: https://github.com/nextapps-de/flexsearch#document-options
*/ */
export interface DocumentOptions<T, Store extends StoreOption = false> {
id: string;
tag?: false | string;
index:
| string
| string[]
| Array<IndexOptions<T, Store> & { field: string }>;
store?: Store;
}
/* type DocumentOptions = IndexOptions & {
* **Document:** worker?: boolean | WorkerURL | WorkerPath;
* * Index options: https://github.com/nextapps-de/flexsearch#index-options doc?: DocumentDescriptor | DocumentDescriptor[];
*/ document?: DocumentDescriptor | DocumentDescriptor[];
export interface IndexOptionsForDocumentSearch< resolve: true;
T, };
Store extends StoreOption = false
> extends IndexOptions<T, Store> {
// Additional Options for Document Indexes
worker?: boolean;
document?: DocumentOptions<T, Store> | Descriptor<T, Store>;
}
export interface SimpleDocumentSearchResultSetUnit { type DefaultDocumentSearchResults = Array<{
field: string; field?: FieldName;
result: Id[]; tag?: FieldName;
} result: DefaultSearchResults;
}>;
export interface EnrichedDocumentSearchResultSetUnitResultUnit<T> { type EnrichedDocumentSearchResults = Array<{
id: Id[]; field?: FieldName;
doc: T; tag?: FieldName;
} highlight?: TemplateResultHighlighting;
result: Array<{
id: Id;
doc: Object | null;
}>;
}>;
export interface EnrichedDocumentSearchResultSetUnit<T> { type MergedDocumentSearchResults = Array<{
field: string; id: Id;
result: Array<EnrichedDocumentSearchResultSetUnitResultUnit<T>>; doc: Object | null;
} field?: FieldName[];
tag?: FieldName[];
}>;
type DocumentSearchResults =
DefaultDocumentSearchResults |
EnrichedDocumentSearchResults |
MergedDocumentSearchResults |
Promise<DocumentSearchResults>;
/** /**
* # Document Search Result * # Document Search Result
@@ -328,24 +384,32 @@ declare module "flexsearch" {
* *
* If neither of these conditions is met, then the returned result will be a `ISimpleDocumentSearchResult`. * If neither of these conditions is met, then the returned result will be a `ISimpleDocumentSearchResult`.
*/ */
export type DocumentSearchResult<
T,
Store extends StoreOption = false,
Enrich extends boolean = false
> = [Store, Enrich] extends [EnrichStoreOption, true]
? Array<EnrichedDocumentSearchResultSetUnit<T>>
: SimpleDocumentSearchResultSetUnit[];
/** /**
* **Document:** * **Document:**
* * Document search options: https://github.com/nextapps-de/flexsearch#document-search-options * * Document search options: https://github.com/nextapps-de/flexsearch#document-search-options
*/ */
export interface DocumentSearchOptions<T extends boolean> extends SearchOptions {
index?: string | string[] | SearchOptions[]; type DocumentSearchOptions = SearchOptions & {
tag?: string | string[]; tag?: Object | Array<Object>;
enrich?: T; field?: Array<DocumentSearchOptions> | Array<string> | string;
bool?: "and" | "or"; index?: Array<DocumentSearchOptions> | Array<string>;
} pluck?: FieldName;
merge?: boolean;
hightlight?: TemplateResultHighlighting;
};
type DocumentValue =
| string
| number
| boolean
| null
| DocumentValue[]
| {[key: string]: DocumentValue};
type DocumentData = {
[k: string]: DocumentValue;
};
/** /**
* **Document:** * **Document:**
@@ -353,76 +417,178 @@ declare module "flexsearch" {
* * API overview: https://github.com/nextapps-de/flexsearch#api-overview * * API overview: https://github.com/nextapps-de/flexsearch#api-overview
* * Document store: https://github.com/nextapps-de/flexsearch#document-store * * Document store: https://github.com/nextapps-de/flexsearch#document-store
*/ */
export class Document<T, Store extends StoreOption = false> { export class Document {
constructor( constructor(options: DocumentOptions);
options: IndexOptionsForDocumentSearch<T, Store>,
typeHack?: T
);
add(document: T): this;
add(id: Id, document: T): this;
append(document: T): this;
append(id: Id, document: T): this;
update(document: T): this;
update(id: Id, document: T): this;
remove(target: Id | T): this;
search(query: string, limit?: number): SimpleDocumentSearchResultSetUnit[];
add(id: Id, document: DocumentData): this | Promise<this>;
add(document: DocumentData): this | Promise<this>;
/** @deprecated The method "append" will be removed in an upcoming release, just use "add" instead */
append(id: Id, document: DocumentData): this | Promise<this>;
/** @deprecated The method "append" will be removed in an upcoming release, just use "add" instead */
append(document: DocumentData): this | Promise<this>;
update(id: Id, document: DocumentData): this | Promise<this>;
update(document: DocumentData): this | Promise<this>;
remove(id: Id): this | Promise<this>;
remove(document: DocumentData): this | Promise<this>;
// https://github.com/nextapps-de/flexsearch#field-search // https://github.com/nextapps-de/flexsearch#field-search
search( search(query: string, options?: Limit | DocumentSearchOptions): DocumentSearchResults;
query: string, search(query: string, limit: number, options: DocumentSearchOptions): DocumentSearchResults;
options: string[] | Partial<DocumentSearchOptions<boolean>> search(options: DocumentSearchOptions): DocumentSearchResults;
): SimpleDocumentSearchResultSetUnit[]; searchCache(query: string, options?: Limit | DocumentSearchOptions): DocumentSearchResults;
searchCache(query: string, limit: number, options: DocumentSearchOptions): DocumentSearchResults;
searchCache(options: DocumentSearchOptions): DocumentSearchResults;
// https://github.com/nextapps-de/flexsearch#check-existence-of-already-indexed-ids
contain(id: Id): boolean | Promise<boolean>;
clear(): void | Promise<void>;
cleanup(): void | Promise<void>;
search<Enrich extends boolean = false>( // Export and Import
query: string, export(handler: ExportHandler): void;
limit?: number, export(handler: ExportHandlerAsync): Promise<void>;
options?: Partial<DocumentSearchOptions<Enrich>> import(key: string, data: string): void;
): DocumentSearchResult<T, Store, Enrich>;
search( // Persistent Index
options: Partial<DocumentSearchOptions<boolean>> mount(db: StorageInterface): Promise<void>;
): SimpleDocumentSearchResultSetUnit[]; commit(replace_all_contents?: boolean): Promise<void>;
export(handler: ExportHandler<T>): Promise<void>; destroy(): Promise<void>;
import(id: Id, document: T): Promise<void>;
// Async Methods // Async Methods
addAsync(id: Id, document: T, callback?: AsyncCallback): Promise<this>; /** @deprecated The "async" variants are deprecated, instead use the default variant */
appendAsync(id: Id, document: T, callback?: AsyncCallback): Promise<this>; addAsync(
updateAsync(id: Id, document: T, callback?: AsyncCallback): Promise<this>; id: Id,
removeAsync(target: Id | T, callback?: AsyncCallback): Promise<this>; document: DocumentData,
searchAsync<Enrich extends boolean = false>( callback?: AsyncCallback<void>
query: string, ): Promise<this>;
options: string[] | Partial<DocumentSearchOptions<Enrich>> /** @deprecated The "async" variants are deprecated, instead use the default variant */
): Promise<DocumentSearchResult<T, Store, Enrich>>; addAsync(
document: DocumentData,
callback?: AsyncCallback<void>
): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
appendAsync(
id: Id,
document: DocumentData,
callback?: AsyncCallback<void>
): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
appendAsync(
document: DocumentData,
callback?: AsyncCallback<void>
): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
updateAsync(
id: Id,
document: DocumentData,
callback?: AsyncCallback<void>
): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
updateAsync(
document: DocumentData,
callback?: AsyncCallback<void>
): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
removeAsync(
id: Id,
callback?: AsyncCallback<void>
): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
removeAsync(
document: DocumentData,
callback?: AsyncCallback<void>
): Promise<this>;
/** @deprecated The "async" variants are deprecated, instead use the default variant */
searchAsync( searchAsync(
query: string, query: string,
limit?: number options?: Limit | DocumentSearchOptions,
): Promise<SimpleDocumentSearchResultSetUnit[]>; callback?: AsyncCallback<DocumentSearchResults>
): Promise<DocumentSearchResults>
/** @deprecated The "async" variants are deprecated, instead use the default variant */
searchAsync( searchAsync(
query: string, query: string,
limit: number, limit: number,
callback: AsyncCallback<SimpleDocumentSearchResultSetUnit[]> options?: DocumentSearchOptions,
): Promise<this>; callback?: AsyncCallback<DocumentSearchResults>
searchAsync<Enrich extends boolean = false>( ): Promise<DocumentSearchResults>;
query: string, /** @deprecated The "async" variants are deprecated, instead use the default variant */
options: Partial<DocumentSearchOptions<Enrich>>, searchAsync(
callback: AsyncCallback<DocumentSearchResult<T, Store, Enrich>> options: DocumentSearchOptions,
): Promise<this>; callback?: AsyncCallback<DocumentSearchResults>
searchAsync<Enrich extends boolean = false>( ): Promise<DocumentSearchResults>;
options: Partial<DocumentSearchOptions<Enrich>>
): Promise<DocumentSearchResult<T, Store, Enrich>>;
searchAsync<Enrich extends boolean = false>(
options: Partial<DocumentSearchOptions<Enrich>>,
callback: AsyncCallback<DocumentSearchResult<T, Store, Enrich>>
): Promise<this>;
} }
/************************************/ type IdType =
/* Miscellaneous */ "text" |
/************************************/ "char" |
export function create(options: IndexOptions<string>): Index; "varchar" |
export function registerCharset(name: string, charset: CharsetOptions): void; "string" |
export function registerLanguage( "number" |
name: string, "numeric" |
language: LanguageOptions "integer" |
): void; "smallint" |
} "tinyint" |
"mediumint" |
"int" |
"int8" |
"uint8" |
"int16" |
"uint16" |
"int32" |
"uint32" |
"int64" |
"uint64" |
"bigint";
type PersistentOptions = {
name?: string;
type?: IdType;
db?: StorageInterface;
};
type DefaultResolve = {
query?: string;
limit?: number;
offset?: number;
enrich?: boolean;
};
type ResolverOptions = DefaultResolve & {
index?: Index;
resolve?: boolean;
suggest?: boolean;
and?: ResolverOptions | Array<ResolverOptions>;
or?: ResolverOptions | Array<ResolverOptions>;
xor?: ResolverOptions | Array<ResolverOptions>;
not?: ResolverOptions | Array<ResolverOptions>;
};
export class Encoder {
constructor(options?: EncoderOptions);
assign(options: EncoderOptions): this;
encode(content: string): string[];
addMapper(char_match: string, char_replace: string): this;
addMatcher(match: string, replace: string): this;
addStemmer(match: string, replace: string): this;
addFilter(term: string): this;
addReplacer(match: string | RegExp, replace: string): this;
}
export class Resolver {
constructor(options?: ResolverOptions | IntermediateSearchResults);
limit(limit: number): this;
offset(offset: number): this;
boost(boost: number): this;
resolve(options?: DefaultResolve): SearchResults;
result: IntermediateSearchResults
}
export class StorageInterface {
constructor(name: string, config: PersistentOptions);
constructor(config: string | PersistentOptions);
mount(index: Index | Document) : Promise<void>;
open() : Promise<void>;
close() : Promise<void>;
destroy() : Promise<void>;
clear() : Promise<void>;
db: any;
}
}

View File

@@ -15,7 +15,7 @@ import {
ContextOptions, ContextOptions,
DocumentDescriptor, DocumentDescriptor,
DocumentSearchOptions, DocumentSearchOptions,
DocumentIndexOptions, FieldOptions,
IndexOptions, IndexOptions,
DocumentOptions, DocumentOptions,
TagOptions, TagOptions,
@@ -75,6 +75,14 @@ if(SUPPORT_PERSISTENT){
/** @export */ Index.prototype.encoder; /** @export */ Index.prototype.encoder;
} }
/** @export */ Encoder.prototype.assign;
/** @export */ Encoder.prototype.encode;
/** @export */ Encoder.prototype.addMatcher;
/** @export */ Encoder.prototype.addStemmer;
/** @export */ Encoder.prototype.addFilter;
/** @export */ Encoder.prototype.addMapper;
/** @export */ Encoder.prototype.addReplacer;
/** @export */ Document.prototype.add; /** @export */ Document.prototype.add;
/** @export */ Document.prototype.append; /** @export */ Document.prototype.append;
/** @export */ Document.prototype.search; /** @export */ Document.prototype.search;
@@ -105,6 +113,7 @@ if(SUPPORT_PERSISTENT){
/** @export */ Resolver.prototype.and; /** @export */ Resolver.prototype.and;
/** @export */ Resolver.prototype.xor; /** @export */ Resolver.prototype.xor;
/** @export */ Resolver.prototype.not; /** @export */ Resolver.prototype.not;
/** @export */ Resolver.prototype.result;
/** @export */ StorageInterface.db; /** @export */ StorageInterface.db;
/** @export */ StorageInterface.id; /** @export */ StorageInterface.id;
@@ -147,25 +156,27 @@ if(SUPPORT_PERSISTENT){
/** @export */ IndexOptions.cache; /** @export */ IndexOptions.cache;
/** @export */ IndexOptions.resolve; /** @export */ IndexOptions.resolve;
/** @export */ IndexOptions.db; /** @export */ IndexOptions.db;
/** @export */ IndexOptions.config; /** @export */ IndexOptions.worker; // worker url
/** @export */ IndexOptions.config; // config url
/** @export */ DocumentIndexOptions.preset; /** @export */ FieldOptions.preset;
/** @export */ DocumentIndexOptions.context; /** @export */ FieldOptions.context;
/** @export */ DocumentIndexOptions.encoder; /** @export */ FieldOptions.encoder;
/** @export */ DocumentIndexOptions.encode; /** @export */ FieldOptions.encode;
/** @export */ DocumentIndexOptions.resolution; /** @export */ FieldOptions.resolution;
/** @export */ DocumentIndexOptions.tokenize; /** @export */ FieldOptions.tokenize;
/** @export */ DocumentIndexOptions.fastupdate; /** @export */ FieldOptions.fastupdate;
/** @export */ DocumentIndexOptions.score; /** @export */ FieldOptions.score;
/** @export */ DocumentIndexOptions.keystore; /** @export */ FieldOptions.keystore;
/** @export */ DocumentIndexOptions.rtl; /** @export */ FieldOptions.rtl;
/** @export */ DocumentIndexOptions.cache; /** @export */ FieldOptions.cache;
/** @export */ DocumentIndexOptions.db; /** @export */ FieldOptions.db;
/** @export */ DocumentIndexOptions.config; /** @export */ FieldOptions.config;
// /** @export */ DocumentIndexOptions.resolve; /** @export */ FieldOptions.resolve;
/** @export */ DocumentIndexOptions.field; /** @export */ FieldOptions.field;
/** @export */ DocumentIndexOptions.filter; /** @export */ FieldOptions.filter;
/** @export */ DocumentIndexOptions.custom; /** @export */ FieldOptions.custom;
/** @export */ FieldOptions.worker;
/** @export */ DocumentOptions.context; /** @export */ DocumentOptions.context;
/** @export */ DocumentOptions.encoder; /** @export */ DocumentOptions.encoder;
@@ -211,6 +222,7 @@ if(SUPPORT_PERSISTENT){
/** @export */ SearchOptions.suggest; /** @export */ SearchOptions.suggest;
/** @export */ SearchOptions.resolve; /** @export */ SearchOptions.resolve;
/** @export */ SearchOptions.enrich; /** @export */ SearchOptions.enrich;
/** @export */ SearchOptions.resolution;
/** @export */ DocumentSearchOptions.query; /** @export */ DocumentSearchOptions.query;
/** @export */ DocumentSearchOptions.limit; /** @export */ DocumentSearchOptions.limit;
@@ -260,6 +272,10 @@ if(SUPPORT_PERSISTENT){
/** @export */ ResolverOptions.enrich; /** @export */ ResolverOptions.enrich;
/** @export */ ResolverOptions.resolve; /** @export */ ResolverOptions.resolve;
/** @export */ ResolverOptions.suggest; /** @export */ ResolverOptions.suggest;
/** @export */ ResolverOptions.and;
/** @export */ ResolverOptions.or;
/** @export */ ResolverOptions.xor;
/** @export */ ResolverOptions.not;
const FlexSearch = { const FlexSearch = {
"Index": Index, "Index": Index,
@@ -302,6 +318,18 @@ if(RELEASE !== "bundle.module" &&
} }
} }
else{ else{
/** @export */ /** @export */
window.FlexSearch = FlexSearch; window.FlexSearch = FlexSearch;
} }
export default FlexSearch;
export {
Index,
Document,
Encoder,
Charset,
WorkerIndex as Worker,
Resolver,
IdxDB as IndexedDB
};

View File

@@ -1,10 +1,11 @@
import Index from "./index.js"; import Index from "./index.js";
import Document from "./document.js"; import Document from "./document.js";
import { SearchOptions, DocumentSearchOptions } from "./type.js";
/** /**
* @param {string|Object} query * @param {string|SearchOptions|DocumentSearchOptions} query
* @param {number|Object=} limit * @param {number|SearchOptions|DocumentSearchOptions=} limit
* @param {Object=} options * @param {SearchOptions|DocumentSearchOptions=} options
* @this {Index|Document} * @this {Index|Document}
* @returns {Array<number|string>|Promise} * @returns {Array<number|string>|Promise}
*/ */

View File

@@ -1,6 +1,6 @@
import { EncoderOptions } from "../../type.js"; import { EncoderOptions } from "../../type.js";
/** @type EncoderOptions */ /** @type {EncoderOptions} */
const options = { const options = {
normalize: true, normalize: true,
dedupe: false, dedupe: false,

View File

@@ -45,7 +45,7 @@ export default function IdxDB(name, config = {}){
} }
if(typeof name === "object"){ if(typeof name === "object"){
name = name.name; name = name.name;
config = name; config = /** @type PersistentOptions */ (name);
} }
if(!name){ if(!name){
console.info("Default storage space was used, because a name was not passed."); console.info("Default storage space was used, because a name was not passed.");

1348
src/db/sqlite/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@ import {
} from "./config.js"; } from "./config.js";
// <-- COMPILER BLOCK // <-- COMPILER BLOCK
import { DocumentOptions, DocumentDescriptor, DocumentIndexOptions, StoreOptions } from "./type.js"; import { IndexOptions, DocumentOptions, DocumentDescriptor, FieldOptions, StoreOptions } from "./type.js";
import Index from "./index.js"; import Index from "./index.js";
import WorkerIndex from "./worker.js"; import WorkerIndex from "./worker.js";
import Cache, { searchCache } from "./cache.js"; import Cache, { searchCache } from "./cache.js";
@@ -43,8 +43,9 @@ export default function Document(options){
return new Document(options); return new Document(options);
} }
/** @type DocumentDescriptor */ const document = /** @type DocumentDescriptor */ (
const document = options.document || options.doc || options; options.document || options.doc || options
);
let tmp, keystore; let tmp, keystore;
this.tree = []; this.tree = [];
@@ -61,7 +62,7 @@ export default function Document(options){
if(SUPPORT_STORE){ if(SUPPORT_STORE){
// todo support custom filter function // todo support custom filter function
this.storetree = (tmp = document.store || null) && tmp !== true && []; this.storetree = (tmp = document.store || null) && tmp && tmp !== true && [];
this.store = tmp && ( this.store = tmp && (
keystore && SUPPORT_KEYSTORE keystore && SUPPORT_KEYSTORE
? new KeystoreMap(keystore) ? new KeystoreMap(keystore)
@@ -167,7 +168,7 @@ if(SUPPORT_PERSISTENT){
let index;// = this.index.get(field); let index;// = this.index.get(field);
//if(!index){ //if(!index){
// create raw index when not exists // create raw index when not exists
this.index.set(field, index = new Index({}, this.reg)); this.index.set(field, index = new Index(/** @type IndexOptions */ ({}), this.reg));
// copy and push to the field selection // copy and push to the field selection
if(fields === this.field){ if(fields === this.field){
fields = fields.slice(0); fields = fields.slice(0);
@@ -259,7 +260,7 @@ function parse_descriptor(options, document){
key = key.field; key = key.field;
} }
opt = /** @type DocumentIndexOptions */ ( opt = /** @type IndexOptions */ (
is_object(opt) is_object(opt)
? Object.assign({}, options, opt) ? Object.assign({}, options, opt)
: options : options
@@ -279,7 +280,7 @@ function parse_descriptor(options, document){
} }
if(!SUPPORT_WORKER || !this.worker){ if(!SUPPORT_WORKER || !this.worker){
index.set(key, new Index(opt, this.reg)); index.set(key, new Index(/** @type IndexOptions */ (opt), this.reg));
} }
if(opt.custom){ if(opt.custom){

View File

@@ -1,14 +1,19 @@
// COMPILER BLOCK --> // COMPILER BLOCK -->
import { import {
DEBUG, DEBUG,
SUPPORT_PERSISTENT, SUPPORT_RESOLVER, SUPPORT_PERSISTENT,
SUPPORT_RESOLVER,
SUPPORT_STORE, SUPPORT_STORE,
SUPPORT_SUGGESTION, SUPPORT_SUGGESTION,
SUPPORT_TAGS SUPPORT_TAGS
} from "../config.js"; } from "../config.js";
// <-- COMPILER BLOCK // <-- COMPILER BLOCK
import {
import { DocumentSearchOptions } from "../type.js"; DocumentSearchOptions,
DocumentSearchResults,
EnrichedDocumentSearchResults,
MergedDocumentSearchResults
} from "../type.js";
import { create_object, is_array, is_object, is_string, parse_simple } from "../common.js"; import { create_object, is_array, is_object, is_string, parse_simple } from "../common.js";
import { intersect_union } from "../intersect.js"; import { intersect_union } from "../intersect.js";
import Document from "../document.js"; import Document from "../document.js";
@@ -20,7 +25,7 @@ let debug = false;
* @param {number|DocumentSearchOptions=} limit * @param {number|DocumentSearchOptions=} limit
* @param {DocumentSearchOptions=} options * @param {DocumentSearchOptions=} options
* @param {Array<Array>=} _promises For internal use only. * @param {Array<Array>=} _promises For internal use only.
* @returns {Promise|Array} * @returns {DocumentSearchResults|EnrichedDocumentSearchResults|MergedDocumentSearchResults|Promise<DocumentSearchResults|EnrichedDocumentSearchResults|MergedDocumentSearchResults>}
*/ */
Document.prototype.search = function(query, limit, options, _promises){ Document.prototype.search = function(query, limit, options, _promises){
@@ -38,16 +43,17 @@ Document.prototype.search = function(query, limit, options, _promises){
} }
} }
let result = [], result_field = []; let result = [];
let result_field = [];
let pluck, enrich, merge, suggest; let pluck, enrich, merge, suggest;
let field, tag, offset, count = 0, resolve, highlight; let field, tag, offset, count = 0, resolve, highlight;
if(options){ if(options){
if(is_array(options)){ if(is_array(options)){
options = { options = /** @type DocumentSearchOptions */ ({
index: options index: options
}; });
} }
query = options.query || query; query = options.query || query;

View File

@@ -8,7 +8,6 @@
// COMPILER BLOCK --> // COMPILER BLOCK -->
import { import {
DEBUG, DEBUG,
PROFILER, PROFILER,
SUPPORT_ENCODER, SUPPORT_ENCODER,
@@ -20,11 +19,10 @@ import {
SUPPORT_KEYSTORE, SUPPORT_KEYSTORE,
SUPPORT_RESOLVER, SUPPORT_RESOLVER,
SUPPORT_CHARSET SUPPORT_CHARSET
} from "./config.js"; } from "./config.js";
// <-- COMPILER BLOCK // <-- COMPILER BLOCK
import { IndexOptions, ContextOptions } from "./type.js"; import { IndexOptions, ContextOptions, EncoderOptions } from "./type.js";
import Encoder from "./encoder.js"; import Encoder from "./encoder.js";
import Cache, { searchCache } from "./cache.js"; import Cache, { searchCache } from "./cache.js";
import Charset from "./charset.js"; import Charset from "./charset.js";
@@ -53,12 +51,16 @@ export default function Index(options, _register){
PROFILER && tick("Index.create"); PROFILER && tick("Index.create");
options = options options = /** @type IndexOptions */ (
? apply_preset(options) options
: {}; ? apply_preset(options)
: {}
);
let tmp = options.context;
/** @type ContextOptions */ /** @type ContextOptions */
const context = options.context || {}; const context = tmp === true
? { depth: 1 } : tmp || {};
const encoder = SUPPORT_CHARSET && is_string(options.encoder) const encoder = SUPPORT_CHARSET && is_string(options.encoder)
? Charset[options.encoder] ? Charset[options.encoder]
: options.encode || options.encoder || ( : options.encode || options.encoder || (
@@ -71,7 +73,7 @@ export default function Index(options, _register){
? encoder ? encoder
: typeof encoder === "object" : typeof encoder === "object"
? (SUPPORT_ENCODER ? (SUPPORT_ENCODER
? new Encoder(encoder) ? new Encoder(/** @type {EncoderOptions} */ (encoder))
: encoder : encoder
) )
: { encode: encoder }; : { encode: encoder };
@@ -80,7 +82,6 @@ export default function Index(options, _register){
this.compress = options.compress || options.compression || false; this.compress = options.compress || options.compression || false;
} }
let tmp;
this.resolution = options.resolution || 9; this.resolution = options.resolution || 9;
this.tokenize = tmp = options.tokenize || "strict"; this.tokenize = tmp = options.tokenize || "strict";
this.depth = (tmp === "strict" && context.depth) || 0; this.depth = (tmp === "strict" && context.depth) || 0;
@@ -98,7 +99,7 @@ export default function Index(options, _register){
? (tmp && SUPPORT_KEYSTORE ? new KeystoreMap(tmp) : new Map()) ? (tmp && SUPPORT_KEYSTORE ? new KeystoreMap(tmp) : new Map())
: (tmp && SUPPORT_KEYSTORE ? new KeystoreSet(tmp) : new Set()) : (tmp && SUPPORT_KEYSTORE ? new KeystoreSet(tmp) : new Set())
); );
this.resolution_ctx = context.resolution || 1; this.resolution_ctx = context.resolution || 3;
this.rtl = (encoder.rtl) || options.rtl || false; this.rtl = (encoder.rtl) || options.rtl || false;
if(SUPPORT_CACHE){ if(SUPPORT_CACHE){

View File

@@ -10,7 +10,7 @@ import {
} from "../config.js"; } from "../config.js";
// <-- COMPILER BLOCK // <-- COMPILER BLOCK
import { SearchOptions } from "../type.js"; import { SearchOptions, SearchResults, EnrichedSearchResults } from "../type.js";
import { create_object, is_object, sort_by_length_down } from "../common.js"; import { create_object, is_object, sort_by_length_down } from "../common.js";
import Index from "../index.js"; import Index from "../index.js";
import default_compress from "../compress.js"; import default_compress from "../compress.js";
@@ -27,7 +27,7 @@ export function set_resolve(resolve){
* @param {string|SearchOptions} query * @param {string|SearchOptions} query
* @param {number|SearchOptions=} limit * @param {number|SearchOptions=} limit
* @param {SearchOptions=} options * @param {SearchOptions=} options
* @returns {Array|Resolver|Promise<Array|Resolver>} * @returns {SearchResults|EnrichedSearchResults|Resolver|Promise<SearchResults|EnrichedSearchResults|Resolver>}
*/ */
Index.prototype.search = function(query, limit, options){ Index.prototype.search = function(query, limit, options){
@@ -45,7 +45,7 @@ Index.prototype.search = function(query, limit, options){
let result = []; let result = [];
let length; let length;
let context, suggest, offset = 0, resolve, enrich, tag, cache, boost; let context, suggest, offset = 0, resolve, enrich, tag, cache, boost, resolution;
if(options){ if(options){
query = options.query || query; query = options.query || query;
@@ -57,6 +57,7 @@ Index.prototype.search = function(query, limit, options){
resolve || (global_resolve = 0); resolve || (global_resolve = 0);
enrich = resolve && options.enrich; enrich = resolve && options.enrich;
boost = options.boost; boost = options.boost;
resolution = options.resolution;
tag = SUPPORT_PERSISTENT && SUPPORT_DOCUMENT && SUPPORT_TAGS && this.db && options.tag; tag = SUPPORT_PERSISTENT && SUPPORT_DOCUMENT && SUPPORT_TAGS && this.db && options.tag;
} }
else{ else{
@@ -67,15 +68,16 @@ Index.prototype.search = function(query, limit, options){
// do not force a string as input // do not force a string as input
// https://github.com/nextapps-de/flexsearch/issues/432 // https://github.com/nextapps-de/flexsearch/issues/432
query = /** @type {Array<string>} */ (this.encoder.encode(query)); /** @type {Array<string>} */
length = query.length; let query_terms = this.encoder.encode(query);
length = query_terms.length;
limit || !resolve || (limit = 100); limit || !resolve || (limit = 100);
// fast path single term // fast path single term
if(length === 1){ if(length === 1){
return single_term_query.call( return single_term_query.call(
this, this,
query[0], // term query_terms[0], // term
"", // ctx "", // ctx
limit, limit,
offset, offset,
@@ -94,8 +96,8 @@ Index.prototype.search = function(query, limit, options){
if(length === 2 && context && !suggest){ if(length === 2 && context && !suggest){
return single_term_query.call( return single_term_query.call(
this, this,
query[0], // term query_terms[0], // term
query[1], // ctx query_terms[1], // ctx
limit, limit,
offset, offset,
resolve, resolve,
@@ -115,7 +117,7 @@ Index.prototype.search = function(query, limit, options){
const query_new = []; const query_new = [];
// if(context){ // if(context){
// keyword = query[0]; // keyword = query_terms[0];
// dupes[keyword] = 1; // dupes[keyword] = 1;
// query_new.push(keyword); // query_new.push(keyword);
// maxlength = minlength = keyword.length; // maxlength = minlength = keyword.length;
@@ -124,7 +126,7 @@ Index.prototype.search = function(query, limit, options){
for(let i = 0, term; i < length; i++){ for(let i = 0, term; i < length; i++){
term = query[i]; term = query_terms[i];
if(term && !dupes[term]){ if(term && !dupes[term]){
@@ -152,7 +154,7 @@ Index.prototype.search = function(query, limit, options){
// } // }
} }
query = query_new; query_terms = query_new;
length = query.length; length = query.length;
} }
@@ -170,7 +172,7 @@ Index.prototype.search = function(query, limit, options){
if(length === 1){ if(length === 1){
return single_term_query.call( return single_term_query.call(
this, this,
query[0], // term query_terms[0], // term
"", // ctx "", // ctx
limit, limit,
offset, offset,
@@ -184,8 +186,8 @@ Index.prototype.search = function(query, limit, options){
if(length === 2 && context && !suggest){ if(length === 2 && context && !suggest){
return single_term_query.call( return single_term_query.call(
this, this,
query[0], // term query_terms[0], // term
query[1], // ctx query_terms[1], // ctx
limit, limit,
offset, offset,
resolve, resolve,
@@ -197,7 +199,7 @@ Index.prototype.search = function(query, limit, options){
if(length > 1){ if(length > 1){
if(context){ if(context){
// start with context right away // start with context right away
keyword = query[0]; keyword = query_terms[0];
index = 1; index = 1;
} }
// todo // todo
@@ -206,17 +208,21 @@ Index.prototype.search = function(query, limit, options){
// bigger terms has less occurrence // bigger terms has less occurrence
// this might also reduce the intersection task // this might also reduce the intersection task
// todo check intersection order // todo check intersection order
query.sort(sort_by_length_down); query_terms.sort(sort_by_length_down);
} }
} }
if(!resolution && resolution !== 0){
resolution = this.resolution;
}
// from this point there are just multi-term queries // from this point there are just multi-term queries
if(SUPPORT_PERSISTENT && this.db){ if(SUPPORT_PERSISTENT && this.db){
if(this.db.search){ if(this.db.search){
// when the configuration is not supported it returns false // when the configuration is not supported it returns false
const result = this.db.search(this, query, limit, offset, suggest, resolve, enrich, tag); const result = this.db.search(this, query_terms, limit, offset, suggest, resolve, enrich, tag);
if(result !== false) return result; if(result !== false) return result;
} }
@@ -225,7 +231,7 @@ Index.prototype.search = function(query, limit, options){
for(let arr, term; index < length; index++){ for(let arr, term; index < length; index++){
term = query[index]; term = query_terms[index];
if(keyword){ if(keyword){
@@ -255,7 +261,7 @@ Index.prototype.search = function(query, limit, options){
arr, arr,
result, result,
suggest, suggest,
self.resolution, resolution,
// 0, // /** @type {!number} */ (limit), // 0, // /** @type {!number} */ (limit),
// 0, // offset, // 0, // offset,
// length === 1 // length === 1
@@ -289,14 +295,14 @@ Index.prototype.search = function(query, limit, options){
} }
return !SUPPORT_RESOLVER || resolve return !SUPPORT_RESOLVER || resolve
? intersect(result, self.resolution, /** @type {number} */ (limit), offset, suggest, boost, resolve) ? intersect(result, resolution, /** @type {number} */ (limit), offset, suggest, boost, resolve)
: new Resolver(result[0]) : new Resolver(result[0])
}()); }());
} }
for(let arr, term; index < length; index++){ for(let arr, term; index < length; index++){
term = query[index]; term = query_terms[index];
if(keyword){ if(keyword){
@@ -325,7 +331,7 @@ Index.prototype.search = function(query, limit, options){
arr, arr,
result, result,
suggest, suggest,
this.resolution, resolution,
// 0, // /** @type {!number} */ (limit), // 0, // /** @type {!number} */ (limit),
// 0, // offset, // 0, // offset,
// length === 1 // length === 1
@@ -352,13 +358,13 @@ Index.prototype.search = function(query, limit, options){
} }
else if(length === 1){ else if(length === 1){
return !SUPPORT_RESOLVER || resolve return !SUPPORT_RESOLVER || resolve
? resolve_default(result[0], limit, offset) ? resolve_default(result[0], /** @type {number} */ (limit), offset)
: new Resolver(result[0]); : new Resolver(result[0]);
} }
} }
} }
result = intersect(result, this.resolution, limit, offset, suggest, boost, resolve); result = intersect(result, resolution, limit, offset, suggest, boost, resolve);
return !SUPPORT_RESOLVER || resolve return !SUPPORT_RESOLVER || resolve
? result ? result
@@ -403,8 +409,8 @@ function single_term_query(term, keyword, limit, offset, resolve, enrich, tag){
* @private * @private
* @param {Array} arr * @param {Array} arr
* @param {Array} result * @param {Array} result
* @param {Array} suggest * @param {boolean|null=} suggest
* @param {number} resolution * @param {number=} resolution
* @return {Array|boolean|undefined} * @return {Array|boolean|undefined}
*/ */

View File

@@ -148,7 +148,7 @@ export const filter = new Set([
* Example: The word "correct" and "correctness" could be the same word, so you can define {"ness": ""} to normalize the ending. * Example: The word "correct" and "correctness" could be the same word, so you can define {"ness": ""} to normalize the ending.
* Object Definition: the key represents the word ending, the value contains the replacement (or empty string for removal). * Object Definition: the key represents the word ending, the value contains the replacement (or empty string for removal).
* http://snowball.tartarus.org/algorithms/german/stemmer.html * http://snowball.tartarus.org/algorithms/german/stemmer.html
* @type {Map<string>} * @type {Map<string, string>}
*/ */
export const stemmer = new Map([ export const stemmer = new Map([
@@ -177,7 +177,7 @@ export const stemmer = new Map([
/** /**
* Matcher replaces all occurrences of a given string regardless of its position and is also a kind of "partial normalization". * Matcher replaces all occurrences of a given string regardless of its position and is also a kind of "partial normalization".
* Object Definition: the key represents the target term, the value contains the search string which should be replaced (could also be an array of multiple terms). * Object Definition: the key represents the target term, the value contains the search string which should be replaced (could also be an array of multiple terms).
* @type {Map<string>} * @type {Map<string, string>}
*/ */
const map = new Map([ const map = new Map([
["_", " "], ["_", " "],

View File

@@ -178,7 +178,7 @@ export const filter = new Set([
]); ]);
/** /**
* @type {Object<string, string>} * @type {Map<string, string>}
*/ */
export const stemmer = new Map([ export const stemmer = new Map([

View File

@@ -5,7 +5,7 @@ import { is_string } from "./common.js";
import { IndexOptions } from "./type.js"; import { IndexOptions } from "./type.js";
/** /**
* @enum {Object} * @type {Object<string, IndexOptions>}
* @const * @const
*/ */
@@ -39,22 +39,26 @@ const presets = {
/** /**
* *
* @param {!IndexOptions|string} options * @param {IndexOptions|string} options
* @return {IndexOptions} * @return {IndexOptions}
*/ */
export default function apply_preset(options){ export default function apply_preset(options){
const preset = is_string(options) const preset = /** @type string */ (
? options is_string(options)
: options["preset"]; ? options
: options.preset
);
if(preset){ if(preset){
if(DEBUG && !presets[preset]){ if(DEBUG && !presets[preset]){
console.warn("Preset not found: " + preset); console.warn("Preset not found: " + preset);
} }
options = Object.assign({}, presets[preset], /** @type {Object} */ (options)); options = /** @type IndexOptions */ (
Object.assign({}, presets[preset], /** @type {Object} */ (options))
);
} }
return options; return /** @type IndexOptions */ (options);
} }

View File

@@ -106,8 +106,8 @@ export default function(result, limit, offset, enrich){
function enrich_result(ids){ function enrich_result(ids){
for(let i = 0; i < ids.length; i++){ for(let i = 0; i < ids.length; i++){
ids[i] = { ids[i] = {
score: i, "score": i,
id: ids[i] "id": ids[i]
}; };
} }
return ids; return ids;

View File

@@ -5,230 +5,243 @@ import Encoder from "./encoder.js";
import StorageInterface from "./db/interface.js"; import StorageInterface from "./db/interface.js";
/** /**
* @typedef IndexOptions {{ * @typedef {{
* preset: string|undefined, * preset: (string|undefined),
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (function():number|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|boolean|undefined),
* resolve: [boolean=true], * resolve: (boolean|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* commit: boolean=true, * commit: (boolean|undefined),
* worker: boolean|string|undefined, * worker: (string|undefined),
* config: string|undefined * config: (string|undefined)
* }} * }}
*/ */
export const IndexOptions = {}; export let IndexOptions = {};
/** /**
* @typedef DocumentIndexOptions {{ * @typedef {{
* preset: string|undefined, * preset: (string|undefined),
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (Function|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* commit: boolean=true, * commit: (boolean|undefined),
* config: string|undefined, * config: (string|undefined),
* field: string, * field: (string|undefined),
* filter: Function|undefined, * filter: (Function|undefined),
* custom: Function|undefined * custom: (Function|undefined)
* }} * }}
*/ */
export const DocumentIndexOptions = {}; export let FieldOptions = {};
/** /**
* @typedef DocumentOptions {{ * @typedef {{
* context: (IndexOptions|undefined), * context: (IndexOptions|undefined),
* encoder: Encoder|Function|Object|undefined, * encoder: (Encoder|Function|Object|undefined),
* encode: Function|undefined, * encode: (Function|undefined),
* resolution: [number=9], * resolution: (number|undefined),
* tokenize: [string="strict"], * tokenize: (string|undefined),
* fastupdate: [boolean:false], * fastupdate: (boolean|undefined),
* score: Function]|undefined, * score: (Function|undefined),
* keystore: [number=0], * keystore: (number|undefined),
* rtl: [boolean=false], * rtl: (boolean|undefined),
* cache: [number=null], * cache: (number|boolean|undefined),
* db: StorageInterface|undefined, * db: (StorageInterface|undefined),
* doc: DocumentDescriptor|Array<DocumentDescriptor>|undefined, * doc: (DocumentDescriptor|Array<DocumentDescriptor>|undefined),
* document: DocumentDescriptor|Array<DocumentDescriptor>|undefined, * document: (DocumentDescriptor|Array<DocumentDescriptor>|undefined),
* worker: boolean|string|undefined * worker: (boolean|string|undefined),
* }} * }}
*/ */
export const DocumentOptions = {}; export let DocumentOptions = {};
/** /**
* @typedef ContextOptions {{ * @typedef {{
* depth: number, * depth: (number|undefined),
* bidirectional: boolean|undefined, * bidirectional: (boolean|undefined),
* resolution: number|undefined * resolution: (number|undefined),
* }} * }}
*/ */
export const ContextOptions = {}; export let ContextOptions = {};
/** /**
* @typedef DocumentDescriptor {{ * @typedef {{
* id: string="id", * id: (string|undefined),
* field: FieldOptions|Array<FieldOptions>|undefined, * field: (string|Array<string>|FieldOptions|Array<FieldOptions>|undefined),
* index: FieldOptions|Array<FieldOptions>|undefined, * index: (string|Array<string>|FieldOptions|Array<FieldOptions>|undefined),
* tag: TagOptions|Array<TagOptions>|undefined, * tag: (string|Array<string>|TagOptions|Array<TagOptions>|undefined),
* store: StoreOptions|Array<StoreOptions>|undefined * store: (string|Array<string>|StoreOptions|Array<StoreOptions>|boolean|undefined),
* }} * }}
*/ */
export const DocumentDescriptor = {}; export let DocumentDescriptor = {};
/** /**
* @typedef TagOptions {{ * @typedef {{
* field: string, * field: string,
* tag: Object<string, string|Array<string>>|Array<string>|string, * filter: ((function(string):boolean)|undefined),
* filter: Function|undefined, * custom: ((function(string):string)|undefined),
* custom: Function|undefined, * db: (StorageInterface|undefined),
* keystore: [number=0],
* db: StorageInterface|undefined,
* config: string|undefined
* }} * }}
*/ */
export const TagOptions = {}; export let TagOptions = {};
/** /**
* @typedef StoreOptions {{ * @typedef {{
* field: string, * field: string,
* filter: Function|undefined, * filter: ((function(string):boolean)|undefined),
* custom: Function|undefined, * custom: ((function(string):string)|undefined)
* config: string|undefined
* }} * }}
*/ */
export const StoreOptions = {}; export let StoreOptions = {};
/** /**
* @typedef SearchOptions {{ * @typedef {{
* query: string=, * query: (string|undefined),
* limit: [number=100], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* context: boolean|undefined, * resolution: (number|undefined),
* suggest: [boolean=false], * context: (boolean|undefined),
* resolve: [boolean=true], * suggest: (boolean|undefined),
* enrich: [boolean=false] * resolve: (boolean|undefined),
* enrich: (boolean|undefined),
* }} * }}
*/ */
export const SearchOptions = {}; export let SearchOptions = {};
// tag: Array|undefined
/** /**
* @typedef DocumentSearchOptions {{ * @typedef {{
* query: string=, * query: (string|undefined),
* limit: [number=100], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* context: boolean|undefined, * context: (boolean|undefined),
* suggest: [boolean=false], * suggest: (boolean|undefined),
* enrich: [boolean=false], * enrich: (boolean|undefined),
* tag: Object|Array<Object>|undefined, * tag: (Object|Array<Object>|undefined),
* field: Array<DocumentSearchOptions>|undefined, * field: (Array<string>|Array<DocumentSearchOptions>|string|undefined),
* index: Array<DocumentSearchOptions>|undefined, * index: (Array<string>|Array<DocumentSearchOptions>|undefined),
* pluck: boolean|undefined, * pluck: (string|undefined),
* merge: [boolean=false], * merge: (boolean|undefined),
* highlight: string|undefined * highlight: (string|undefined),
* }} * }}
*/ */
export const DocumentSearchOptions = {}; export let DocumentSearchOptions = {};
/** /**
* @typedef DocumentSearchResults Array<{{ * @typedef Array<number|string>
* field: string|undefined,
* tag: string|undefined,
* result: Array<number|string>,
* highlight: string|undefined
* }}>
*/ */
export const DocumentSearchResults = {}; export let SearchResults = {};
/** /**
* @typedef EnrichedDocumentSearchResults Array<{{ * @typedef Array<{
* field: string|undefined, * id: (number|string),
* tag: string|undefined, * res: number
* result: Array<{{ * }>
* id: number|string,
* doc: Object
* }}>,
* highlight: string|undefined
* }}>
*/ */
export const EnrichedDocumentSearchResults = {}; export let EnrichedSearchResults = {};
/** /**
* @typedef MergedDocumentSearchResults Array<{{ * @typedef Array<{
* id: number|string, * field: (string|undefined),
* doc: Object|undefined, * tag: (string|undefined),
* field: Array<string>, * result: SearchResults
* highlight: string|undefined * }>
* }}>
*/ */
export const MergedDocumentSearchResults = {}; export let DocumentSearchResults = {};
/** /**
* @typedef EncoderOptions {{ * @typedef Array<{
* rtl: boolean=false, * field: (string|undefined),
* dedupe: boolean=true, * tag: (string|undefined),
* split: string|undefined, * highlight: (string|undefined),
* include: EncoderSplitOptions|undefined, * result: Array<{
* exclude: EncoderSplitOptions|undefined, * id: (number|string),
* prepare: function(string):string|undefined, * doc: (Object|null)
* finalize: function(Array<>string>):Array<string>|undefined, * }>
* filter: Set|undefined, * }>
* matcher: Map|undefined, */
* mapper: Map|undefined, export let EnrichedDocumentSearchResults = {};
* stemmer: Map|undefined,
* replacer: Array<string|RegExp>|undefined, /**
* minlength: number=1, * @typedef Array<{
* maxlength: number|undefined, * id: (number|string),
* cache: boolean=true, * doc: (Object|null),
* field: (Array<string>|undefined),
* tag: (Array<string>|undefined)
* }>
*/
export let MergedDocumentSearchResults = {};
/**
* @typedef {{
* letter: (boolean|undefined),
* number: (boolean|undefined),
* symbol: (boolean|undefined),
* punctuation: (boolean|undefined),
* control: (boolean|undefined),
* char: (string|Array<string>|undefined)
* }} * }}
*/ */
export const EncoderOptions = {}; export let EncoderSplitOptions = {};
/** /**
* @typedef EncoderSplitOptions {{ * @typedef {{
* letter: boolean=false, * rtl: (boolean|undefined),
* number: boolean=false, * dedupe: (boolean|undefined),
* symbol: boolean=false, * include: (EncoderSplitOptions|undefined),
* punctuation: boolean=false, * exclude: (EncoderSplitOptions|undefined),
* control: boolean=false, * split: (string|boolean|undefined),
* char: string|Array<string>|undefined, * normalize: (boolean|(function(string):string)|undefined),
* prepare: ((function(string):string)|undefined),
* finalize: ((function(Array<string>):(Array<string>|void))|undefined),
* filter: (Set<string>|undefined),
* matcher: (Map<string, string>|undefined),
* mapper: (Map<string, string>|undefined),
* stemmer: (Map<string, string>|undefined),
* replacer: (Array<string|RegExp, string>|undefined),
* minlength: (number|undefined),
* maxlength: (number|undefined),
* cache: (boolean|undefined)
* }} * }}
*/ */
export const EncoderSplitOptions = {}; export let EncoderOptions = {};
/** /**
* @typedef PersistentOptions {{ * @typedef {{
* name: string="flexsearch", * name: (string|undefined),
* field: string|undefined, * field: (string|undefined),
* type: string|undefined, * type: (string|undefined),
* db: *|undefined * db: (StorageInterface|undefined)
* }} * }}
*/ */
export const PersistentOptions = {}; export let PersistentOptions = {};
/** /**
* @typedef ResolverOptions {{ * @typedef {{
* index: Index|undefined, * index: (Index|undefined),
* query: string, * query: (string|undefined),
* limit: [number=0], * limit: (number|undefined),
* offset: [number=0], * offset: (number|undefined),
* enrich: boolean=false, * enrich: (boolean|undefined),
* resolve: boolean=false, * resolve: (boolean|undefined),
* suggest: boolean=false * suggest: (boolean|undefined),
* and: (ResolverOptions|Array<ResolverOptions>|undefined),
* or: (ResolverOptions|Array<ResolverOptions>|undefined),
* xor: (ResolverOptions|Array<ResolverOptions>|undefined),
* not: (ResolverOptions|Array<ResolverOptions>|undefined)
* }} * }}
*/ */
export const ResolverOptions = {}; export let ResolverOptions = {};

View File

@@ -9,7 +9,7 @@ let pid = 0;
* @constructor * @constructor
*/ */
export default function WorkerIndex(options = {}){ export default function WorkerIndex(options = /** @type IndexOptions */ ({})){
if(!this || this.constructor !== WorkerIndex) { if(!this || this.constructor !== WorkerIndex) {
return new WorkerIndex(options); return new WorkerIndex(options);

View File

@@ -14,11 +14,11 @@ export default async function(data) {
case "init": case "init":
/** @type IndexOptions */ /** @type {IndexOptions} */
let options = data["options"] || {}; let options = data["options"] || {};
let filepath = options.config; let filepath = options.config;
if(filepath){ if(filepath){
options = filepath; options = options;
// will be replaced after build with the line below because // will be replaced after build with the line below because
// there is an issue with closure compiler dynamic import // there is an issue with closure compiler dynamic import
options = (await import(filepath))["default"]; options = (await import(filepath))["default"];

View File

@@ -101,7 +101,7 @@ let parameter = (function(opt){
module_resolution: "BROWSER", module_resolution: "BROWSER",
//dependency_mode: "SORT_ONLY", //dependency_mode: "SORT_ONLY",
//js_module_root: "./", //js_module_root: "./",
entry_point: release === "lang" ? "./tmp/lang.js" : "./tmp/webpack.js", entry_point: release === "lang" ? "./tmp/lang.js" : "./tmp/bundle.js",
//manage_closure_dependencies: true, //manage_closure_dependencies: true,
dependency_mode: "PRUNE", // PRUNE_LEGACY dependency_mode: "PRUNE", // PRUNE_LEGACY
rewrite_polyfills: use_polyfill || false, rewrite_polyfills: use_polyfill || false,
@@ -250,7 +250,7 @@ else (async function(){
// "resolver.js", // "resolver.js",
// "serialize.js", // "serialize.js",
// "type.js", // "type.js",
// "webpack.js" // "bundle.js"
// ]; // ];
files.forEach(function(file){ files.forEach(function(file){
@@ -372,6 +372,7 @@ else (async function(){
part = part.split(","); part = part.split(",");
part = part.map(entry => "export const " + entry.replace(":", "=")); part = part.map(entry => "export const " + entry.replace(":", "="));
part = part.join(";") + ";"; part = part.join(";") + ";";
// part = "export const Index=FlexSearch.Index;" + // part = "export const Index=FlexSearch.Index;" +
// "export const Charset=FlexSearch.Charset;" + // "export const Charset=FlexSearch.Charset;" +
// "export const Encoder=FlexSearch.Encoder;" + // "export const Encoder=FlexSearch.Encoder;" +
@@ -407,7 +408,6 @@ else (async function(){
// replace the eval wrapper // replace the eval wrapper
build = build.replace(/\(0,eval\)\('([^']+)'\)/g, "$1"); build = build.replace(/\(0,eval\)\('([^']+)'\)/g, "$1");
fs.writeFileSync(filename, build); fs.writeFileSync(filename, build);
fs.existsSync("dist/node/") || fs.mkdirSync("dist/node/"); fs.existsSync("dist/node/") || fs.mkdirSync("dist/node/");
fs.copyFileSync("src/worker/node.js", "dist/node/node.js"); fs.copyFileSync("src/worker/node.js", "dist/node/node.js");