mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-09-01 09:53:56 +02:00
fix esm export (build)
This commit is contained in:
383
dist/flexsearch.bundle.debug.js
vendored
383
dist/flexsearch.bundle.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Bundle)
|
||||
* FlexSearch.js v0.7.40 (Bundle)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -10,31 +10,31 @@ var t;
|
||||
function u(a) {
|
||||
return "undefined" !== typeof a ? a : !0;
|
||||
}
|
||||
function aa(a) {
|
||||
function v(a) {
|
||||
const b = Array(a);
|
||||
for (let c = 0; c < a; c++) {
|
||||
b[c] = v();
|
||||
b[c] = x();
|
||||
}
|
||||
return b;
|
||||
}
|
||||
function v() {
|
||||
function x() {
|
||||
return Object.create(null);
|
||||
}
|
||||
function ba(a, b) {
|
||||
function aa(a, b) {
|
||||
return b.length - a.length;
|
||||
}
|
||||
function x(a) {
|
||||
function C(a) {
|
||||
return "string" === typeof a;
|
||||
}
|
||||
function C(a) {
|
||||
function D(a) {
|
||||
return "object" === typeof a;
|
||||
}
|
||||
function D(a) {
|
||||
function E(a) {
|
||||
return "function" === typeof a;
|
||||
}
|
||||
;function ca(a, b) {
|
||||
var c = da;
|
||||
if (a && (b && (a = E(a, b)), this.H && (a = E(a, this.H)), this.J && 1 < a.length && (a = E(a, this.J)), c || "" === c)) {
|
||||
;function ba(a, b) {
|
||||
var c = ca;
|
||||
if (a && (b && (a = F(a, b)), this.H && (a = F(a, this.H)), this.J && 1 < a.length && (a = F(a, this.J)), c || "" === c)) {
|
||||
b = a.split(c);
|
||||
if (this.filter) {
|
||||
a = this.filter;
|
||||
@@ -52,49 +52,49 @@ function D(a) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
const da = /[\p{Z}\p{S}\p{P}\p{C}]+/u, ea = /[\u0300-\u036f]/g;
|
||||
function fa(a, b) {
|
||||
const ca = /[\p{Z}\p{S}\p{P}\p{C}]+/u, da = /[\u0300-\u036f]/g;
|
||||
function ea(a, b) {
|
||||
const c = Object.keys(a), d = c.length, e = [];
|
||||
let f = "", h = 0;
|
||||
for (let g = 0, k, m; g < d; g++) {
|
||||
k = c[g], (m = a[k]) ? (e[h++] = F(b ? "(?!\\b)" + k + "(\\b|_)" : k), e[h++] = m) : f += (f ? "|" : "") + k;
|
||||
k = c[g], (m = a[k]) ? (e[h++] = G(b ? "(?!\\b)" + k + "(\\b|_)" : k), e[h++] = m) : f += (f ? "|" : "") + k;
|
||||
}
|
||||
f && (e[h++] = F(b ? "(?!\\b)(" + f + ")(\\b|_)" : "(" + f + ")"), e[h] = "");
|
||||
f && (e[h++] = G(b ? "(?!\\b)(" + f + ")(\\b|_)" : "(" + f + ")"), e[h] = "");
|
||||
return e;
|
||||
}
|
||||
function E(a, b) {
|
||||
function F(a, b) {
|
||||
for (let c = 0, d = b.length; c < d && (a = a.replace(b[c], b[c + 1]), a); c += 2) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
function F(a) {
|
||||
function G(a) {
|
||||
return new RegExp(a, "g");
|
||||
}
|
||||
function ha(a) {
|
||||
function fa(a) {
|
||||
let b = "", c = "";
|
||||
for (let d = 0, e = a.length, f; d < e; d++) {
|
||||
(f = a[d]) !== c && (b += c = f);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
;var ja = {encode:ia, F:!1, G:""};
|
||||
function ia(a) {
|
||||
return ca.call(this, ("" + a).toLowerCase(), !1);
|
||||
;var ia = {encode:ha, F:!1, G:""};
|
||||
function ha(a) {
|
||||
return ba.call(this, ("" + a).toLowerCase(), !1);
|
||||
}
|
||||
;const ka = {}, G = {};
|
||||
function la(a) {
|
||||
I(a, "add");
|
||||
I(a, "append");
|
||||
I(a, "search");
|
||||
I(a, "update");
|
||||
I(a, "remove");
|
||||
;const ja = {}, I = {};
|
||||
function ka(a) {
|
||||
J(a, "add");
|
||||
J(a, "append");
|
||||
J(a, "search");
|
||||
J(a, "update");
|
||||
J(a, "remove");
|
||||
}
|
||||
function I(a, b) {
|
||||
function J(a, b) {
|
||||
a[b + "Async"] = function() {
|
||||
const c = this, d = arguments;
|
||||
var e = d[d.length - 1];
|
||||
let f;
|
||||
D(e) && (f = e, delete d[d.length - 1]);
|
||||
E(e) && (f = e, delete d[d.length - 1]);
|
||||
e = new Promise(function(h) {
|
||||
setTimeout(function() {
|
||||
c.async = !0;
|
||||
@@ -106,12 +106,12 @@ function I(a, b) {
|
||||
return f ? (e.then(f), this) : e;
|
||||
};
|
||||
}
|
||||
;function ma(a, b, c, d) {
|
||||
;function la(a, b, c, d) {
|
||||
const e = a.length;
|
||||
let f = [], h, g, k = 0;
|
||||
d && (d = []);
|
||||
for (let m = e - 1; 0 <= m; m--) {
|
||||
const n = a[m], w = n.length, q = v();
|
||||
const n = a[m], w = n.length, q = x();
|
||||
let r = !h;
|
||||
for (let l = 0; l < w; l++) {
|
||||
const p = n[l], A = p.length;
|
||||
@@ -170,8 +170,8 @@ function I(a, b) {
|
||||
}
|
||||
return f;
|
||||
}
|
||||
function na(a, b) {
|
||||
const c = v(), d = v(), e = [];
|
||||
function ma(a, b) {
|
||||
const c = x(), d = x(), e = [];
|
||||
for (let f = 0; f < a.length; f++) {
|
||||
c[a[f]] = 1;
|
||||
}
|
||||
@@ -183,18 +183,18 @@ function na(a, b) {
|
||||
}
|
||||
return e;
|
||||
}
|
||||
;function J(a) {
|
||||
;function K(a) {
|
||||
this.l = !0 !== a && a;
|
||||
this.cache = v();
|
||||
this.cache = x();
|
||||
this.h = [];
|
||||
}
|
||||
function oa(a, b, c) {
|
||||
C(a) && (a = a.query);
|
||||
function na(a, b, c) {
|
||||
D(a) && (a = a.query);
|
||||
let d = this.cache.get(a);
|
||||
d || (d = this.search(a, b, c), this.cache.set(a, d));
|
||||
return d;
|
||||
}
|
||||
J.prototype.set = function(a, b) {
|
||||
K.prototype.set = function(a, b) {
|
||||
if (!this.cache[a]) {
|
||||
var c = this.h.length;
|
||||
c === this.l ? delete this.cache[this.h[c - 1]] : c++;
|
||||
@@ -205,7 +205,7 @@ J.prototype.set = function(a, b) {
|
||||
}
|
||||
this.cache[a] = b;
|
||||
};
|
||||
J.prototype.get = function(a) {
|
||||
K.prototype.get = function(a) {
|
||||
const b = this.cache[a];
|
||||
if (this.l && b && (a = this.h.indexOf(a))) {
|
||||
const c = this.h[a - 1];
|
||||
@@ -214,8 +214,8 @@ J.prototype.get = function(a) {
|
||||
}
|
||||
return b;
|
||||
};
|
||||
const pa = {memory:{charset:"latin:extra", D:3, B:4, m:!1}, performance:{D:3, B:3, s:!1, context:{depth:2, D:1}}, match:{charset:"latin:extra", G:"reverse"}, score:{charset:"latin:advanced", D:20, B:3, context:{depth:3, D:9}}, "default":{}};
|
||||
function ra(a, b, c, d, e, f, h, g) {
|
||||
const oa = {memory:{charset:"latin:extra", D:3, B:4, m:!1}, performance:{D:3, B:3, s:!1, context:{depth:2, D:1}}, match:{charset:"latin:extra", G:"reverse"}, score:{charset:"latin:advanced", D:20, B:3, context:{depth:3, D:9}}, "default":{}};
|
||||
function qa(a, b, c, d, e, f, h, g) {
|
||||
setTimeout(function() {
|
||||
const k = a(c ? c + "." + d : d, JSON.stringify(h));
|
||||
k && k.then ? k.then(function() {
|
||||
@@ -223,14 +223,14 @@ function ra(a, b, c, d, e, f, h, g) {
|
||||
}) : b.export(a, b, c, e, f + 1, g);
|
||||
});
|
||||
}
|
||||
;function K(a, b) {
|
||||
if (!(this instanceof K)) {
|
||||
return new K(a);
|
||||
;function L(a, b) {
|
||||
if (!(this instanceof L)) {
|
||||
return new L(a);
|
||||
}
|
||||
var c;
|
||||
if (a) {
|
||||
if (x(a)) {
|
||||
pa[a] || console.warn("Preset not found: " + a), a = pa[a];
|
||||
if (C(a)) {
|
||||
oa[a] || console.warn("Preset not found: " + a), a = oa[a];
|
||||
} else {
|
||||
if (c = a.preset) {
|
||||
c[c] || console.warn("Preset not found: " + c), a = Object.assign({}, c[c], a);
|
||||
@@ -238,14 +238,14 @@ function ra(a, b, c, d, e, f, h, g) {
|
||||
}
|
||||
c = a.charset;
|
||||
var d = a.lang;
|
||||
x(c) && (-1 === c.indexOf(":") && (c += ":default"), c = G[c]);
|
||||
x(d) && (d = ka[d]);
|
||||
C(c) && (-1 === c.indexOf(":") && (c += ":default"), c = I[c]);
|
||||
C(d) && (d = ja[d]);
|
||||
} else {
|
||||
a = {};
|
||||
}
|
||||
let e, f, h = a.context || {};
|
||||
this.encode = a.encode || c && c.encode || ia;
|
||||
this.register = b || v();
|
||||
this.encode = a.encode || c && c.encode || ha;
|
||||
this.register = b || x();
|
||||
this.D = e = a.resolution || 9;
|
||||
this.G = b = c && c.G || a.tokenize || "strict";
|
||||
this.depth = "strict" === b && h.depth;
|
||||
@@ -254,24 +254,24 @@ function ra(a, b, c, d, e, f, h, g) {
|
||||
this.m = u(a.fastupdate);
|
||||
this.B = a.minlength || 1;
|
||||
this.C = a.boost;
|
||||
this.map = f ? aa(e) : v();
|
||||
this.map = f ? v(e) : x();
|
||||
this.A = e = h.resolution || 1;
|
||||
this.h = f ? aa(e) : v();
|
||||
this.h = f ? v(e) : x();
|
||||
this.F = c && c.F || a.rtl;
|
||||
this.H = (b = a.matcher || d && d.H) && fa(b, !1);
|
||||
this.J = (b = a.stemmer || d && d.J) && fa(b, !0);
|
||||
this.H = (b = a.matcher || d && d.H) && ea(b, !1);
|
||||
this.J = (b = a.stemmer || d && d.J) && ea(b, !0);
|
||||
if (c = b = a.filter || d && d.filter) {
|
||||
c = b;
|
||||
d = v();
|
||||
d = x();
|
||||
for (let g = 0, k = c.length; g < k; g++) {
|
||||
d[c[g]] = 1;
|
||||
}
|
||||
c = d;
|
||||
}
|
||||
this.filter = c;
|
||||
this.cache = (b = a.cache) && new J(b);
|
||||
this.cache = (b = a.cache) && new K(b);
|
||||
}
|
||||
t = K.prototype;
|
||||
t = L.prototype;
|
||||
t.append = function(a, b) {
|
||||
return this.add(a, b, !0);
|
||||
};
|
||||
@@ -282,21 +282,21 @@ t.add = function(a, b, c, d) {
|
||||
}
|
||||
b = this.encode(b);
|
||||
if (d = b.length) {
|
||||
const m = v(), n = v(), w = this.depth, q = this.D;
|
||||
const m = x(), n = x(), w = this.depth, q = this.D;
|
||||
for (let r = 0; r < d; r++) {
|
||||
let l = b[this.F ? d - 1 - r : r];
|
||||
var e = l.length;
|
||||
if (l && e >= this.B && (w || !n[l])) {
|
||||
var f = L(q, d, r), h = "";
|
||||
var f = M(q, d, r), h = "";
|
||||
switch(this.G) {
|
||||
case "full":
|
||||
if (2 < e) {
|
||||
for (f = 0; f < e; f++) {
|
||||
for (var g = e; g > f; g--) {
|
||||
if (g - f >= this.B) {
|
||||
var k = L(q, d, r, e, f);
|
||||
var k = M(q, d, r, e, f);
|
||||
h = l.substring(f, g);
|
||||
M(this, n, h, k, a, c);
|
||||
N(this, n, h, k, a, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -305,24 +305,24 @@ t.add = function(a, b, c, d) {
|
||||
case "reverse":
|
||||
if (1 < e) {
|
||||
for (g = e - 1; 0 < g; g--) {
|
||||
h = l[g] + h, h.length >= this.B && M(this, n, h, L(q, d, r, e, g), a, c);
|
||||
h = l[g] + h, h.length >= this.B && N(this, n, h, M(q, d, r, e, g), a, c);
|
||||
}
|
||||
h = "";
|
||||
}
|
||||
case "forward":
|
||||
if (1 < e) {
|
||||
for (g = 0; g < e; g++) {
|
||||
h += l[g], h.length >= this.B && M(this, n, h, f, a, c);
|
||||
h += l[g], h.length >= this.B && N(this, n, h, f, a, c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (this.C && (f = Math.min(f / this.C(b, l, r) | 0, q - 1)), M(this, n, l, f, a, c), w && 1 < d && r < d - 1) {
|
||||
for (e = v(), h = this.A, f = l, g = Math.min(w + 1, d - r), e[f] = 1, k = 1; k < g; k++) {
|
||||
if (this.C && (f = Math.min(f / this.C(b, l, r) | 0, q - 1)), N(this, n, l, f, a, c), w && 1 < d && r < d - 1) {
|
||||
for (e = x(), h = this.A, f = l, g = Math.min(w + 1, d - r), e[f] = 1, k = 1; k < g; k++) {
|
||||
if ((l = b[this.F ? d - 1 - r - k : r + k]) && l.length >= this.B && !e[l]) {
|
||||
e[l] = 1;
|
||||
const p = this.l && l > f;
|
||||
M(this, m, p ? f : l, L(h + (d / 2 > h ? 0 : 1), d, r, g - 1, k - 1), a, c, p ? l : f);
|
||||
N(this, m, p ? f : l, M(h + (d / 2 > h ? 0 : 1), d, r, g - 1, k - 1), a, c, p ? l : f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,17 +334,17 @@ t.add = function(a, b, c, d) {
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function L(a, b, c, d, e) {
|
||||
function M(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 M(a, b, c, d, e, f, h) {
|
||||
function N(a, b, c, d, e, f, h) {
|
||||
let g = h ? a.h : a.map;
|
||||
if (!b[c] || h && !b[c][h]) {
|
||||
a.s && (g = g[d]), h ? (b = b[c] || (b[c] = v()), b[h] = 1, g = g[h] || (g[h] = v())) : b[c] = 1, g = g[c] || (g[c] = []), a.s || (g = g[d] || (g[d] = [])), f && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g));
|
||||
a.s && (g = g[d]), h ? (b = b[c] || (b[c] = x()), b[h] = 1, g = g[h] || (g[h] = x())) : b[c] = 1, g = g[c] || (g[c] = []), a.s || (g = g[d] || (g[d] = [])), f && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g));
|
||||
}
|
||||
}
|
||||
t.search = function(a, b, c) {
|
||||
c || (!b && C(a) ? (c = a, a = c.query) : C(b) && (c = b));
|
||||
c || (!b && D(a) ? (c = a, a = c.query) : D(b) && (c = b));
|
||||
let d = [], e;
|
||||
let f, h = 0;
|
||||
if (c) {
|
||||
@@ -355,7 +355,7 @@ t.search = function(a, b, c) {
|
||||
f = c.suggest;
|
||||
}
|
||||
if (a && (a = this.encode("" + a), e = a.length, 1 < e)) {
|
||||
c = v();
|
||||
c = x();
|
||||
var k = [];
|
||||
for (let n = 0, w = 0, q; n < e; n++) {
|
||||
if ((q = a[n]) && q.length >= this.B && !c[q]) {
|
||||
@@ -376,10 +376,10 @@ t.search = function(a, b, c) {
|
||||
g = this.depth && 1 < e && !1 !== g;
|
||||
c = 0;
|
||||
let m;
|
||||
g ? (m = a[0], c = 1) : 1 < e && a.sort(ba);
|
||||
g ? (m = a[0], c = 1) : 1 < e && a.sort(aa);
|
||||
for (let n, w; c < e; c++) {
|
||||
w = a[c];
|
||||
g ? (n = sa(this, d, f, b, h, 2 === e, w, m), f && !1 === n && d.length || (m = w)) : n = sa(this, d, f, b, h, 1 === e, w);
|
||||
g ? (n = ra(this, d, f, b, h, 2 === e, w, m), f && !1 === n && d.length || (m = w)) : n = ra(this, d, f, b, h, 1 === e, w);
|
||||
if (n) {
|
||||
return n;
|
||||
}
|
||||
@@ -394,28 +394,28 @@ t.search = function(a, b, c) {
|
||||
return d;
|
||||
}
|
||||
if (1 === k) {
|
||||
return ta(d[0], b, h);
|
||||
return sa(d[0], b, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ma(d, b, h, f);
|
||||
return la(d, b, h, f);
|
||||
};
|
||||
function sa(a, b, c, d, e, f, h, g) {
|
||||
function ra(a, b, c, d, e, f, h, g) {
|
||||
let k = [], m = g ? a.h : a.map;
|
||||
a.s || (m = ua(m, h, g, a.l));
|
||||
a.s || (m = ta(m, h, g, a.l));
|
||||
if (m) {
|
||||
let n = 0;
|
||||
const w = Math.min(m.length, g ? a.A : a.D);
|
||||
for (let q = 0, r = 0, l, p; q < w; q++) {
|
||||
if (l = m[q]) {
|
||||
if (a.s && (l = ua(l, h, g, a.l)), e && l && f && (p = l.length, p <= e ? (e -= p, l = null) : (l = l.slice(e), e = 0)), l && (k[n++] = l, f && (r += l.length, r >= d))) {
|
||||
if (a.s && (l = ta(l, h, g, a.l)), e && l && f && (p = l.length, p <= e ? (e -= p, l = null) : (l = l.slice(e), e = 0)), l && (k[n++] = l, f && (r += l.length, r >= d))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (n) {
|
||||
if (f) {
|
||||
return ta(k, d, 0);
|
||||
return sa(k, d, 0);
|
||||
}
|
||||
b[b.length] = k;
|
||||
return;
|
||||
@@ -423,11 +423,11 @@ function sa(a, b, c, d, e, f, h, g) {
|
||||
}
|
||||
return !c && k;
|
||||
}
|
||||
function ta(a, b, c) {
|
||||
function sa(a, b, c) {
|
||||
a = 1 === a.length ? a[0] : [].concat.apply([], a);
|
||||
return c || a.length > b ? a.slice(c, c + b) : a;
|
||||
}
|
||||
function ua(a, b, c, d) {
|
||||
function ta(a, b, c, d) {
|
||||
c ? (d = d && b > c, a = (a = a[d ? b : c]) && a[d ? c : b]) : a = a[b];
|
||||
return a;
|
||||
}
|
||||
@@ -445,7 +445,7 @@ t.remove = function(a, b) {
|
||||
e = c[d], e.splice(e.indexOf(a), 1);
|
||||
}
|
||||
} else {
|
||||
N(this.map, a, this.D, this.s), this.depth && N(this.h, a, this.A, this.s);
|
||||
O(this.map, a, this.D, this.s), this.depth && O(this.h, a, this.A, this.s);
|
||||
}
|
||||
b || delete this.register[a];
|
||||
if (this.cache) {
|
||||
@@ -457,7 +457,7 @@ t.remove = function(a, b) {
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function N(a, b, c, d, e) {
|
||||
function O(a, b, c, d, e) {
|
||||
let f = 0;
|
||||
if (a.constructor === Array) {
|
||||
if (e) {
|
||||
@@ -466,18 +466,18 @@ function N(a, b, c, d, e) {
|
||||
e = Math.min(a.length, c);
|
||||
for (let h = 0, g; h < e; h++) {
|
||||
if (g = a[h]) {
|
||||
f = N(g, b, c, d, e), d || f || delete a[h];
|
||||
f = O(g, b, c, d, e), d || f || delete a[h];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let h in a) {
|
||||
(f = N(a[h], b, c, d, e)) || delete a[h];
|
||||
(f = O(a[h], b, c, d, e)) || delete a[h];
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
t.searchCache = oa;
|
||||
t.searchCache = na;
|
||||
t.export = function(a, b, c, d, e, f) {
|
||||
let h = !0;
|
||||
"undefined" === typeof f && (h = new Promise(m => {
|
||||
@@ -488,7 +488,7 @@ t.export = function(a, b, c, d, e, f) {
|
||||
case 0:
|
||||
g = "reg";
|
||||
if (this.m) {
|
||||
k = v();
|
||||
k = x();
|
||||
for (let m in this.register) {
|
||||
k[m] = 1;
|
||||
}
|
||||
@@ -512,12 +512,12 @@ t.export = function(a, b, c, d, e, f) {
|
||||
"undefined" === typeof c && f && f();
|
||||
return;
|
||||
}
|
||||
ra(a, b || this, c, g, d, e, k, f);
|
||||
qa(a, b || this, c, g, d, e, k, f);
|
||||
return h;
|
||||
};
|
||||
t.import = function(a, b) {
|
||||
if (b) {
|
||||
switch(x(b) && (b = JSON.parse(b)), a) {
|
||||
switch(C(b) && (b = JSON.parse(b)), a) {
|
||||
case "cfg":
|
||||
this.s = !!b.opt;
|
||||
break;
|
||||
@@ -533,8 +533,8 @@ t.import = function(a, b) {
|
||||
}
|
||||
}
|
||||
};
|
||||
la(K.prototype);
|
||||
function va(a) {
|
||||
ka(L.prototype);
|
||||
function ua(a) {
|
||||
a = a.data;
|
||||
var b = self._index;
|
||||
const c = a.args;
|
||||
@@ -546,23 +546,23 @@ function va(a) {
|
||||
b = d.encode;
|
||||
d.cache = !1;
|
||||
b && 0 === b.indexOf("function") && (d.encode = Function("return " + b)());
|
||||
a ? (Function("return " + a)()(self), self._index = new self.FlexSearch.Index(d), delete self.FlexSearch) : self._index = new K(d);
|
||||
a ? (Function("return " + a)()(self), self._index = new self.FlexSearch.Index(d), delete self.FlexSearch) : self._index = new L(d);
|
||||
break;
|
||||
default:
|
||||
a = a.id, b = b[d].apply(b, c), postMessage("search" === d ? {id:a, msg:b} : {id:a});
|
||||
}
|
||||
}
|
||||
;let wa = 0;
|
||||
function O(a) {
|
||||
if (!(this instanceof O)) {
|
||||
return new O(a);
|
||||
;let va = 0;
|
||||
function P(a) {
|
||||
if (!(this instanceof P)) {
|
||||
return new P(a);
|
||||
}
|
||||
var b;
|
||||
a ? D(b = a.encode) && (a.encode = b.toString()) : a = {};
|
||||
a ? E(b = a.encode) && (a.encode = b.toString()) : a = {};
|
||||
(b = (self || window)._factory) && (b = b.toString());
|
||||
const c = "undefined" === typeof window && self.exports, d = this;
|
||||
this.o = xa(b, c, a.worker);
|
||||
this.h = v();
|
||||
this.o = wa(b, c, a.worker);
|
||||
this.h = x();
|
||||
if (this.o) {
|
||||
if (c) {
|
||||
this.o.on("message", function(e) {
|
||||
@@ -579,67 +579,67 @@ function O(a) {
|
||||
this.o.postMessage({task:"init", factory:b, options:a});
|
||||
}
|
||||
}
|
||||
P("add");
|
||||
P("append");
|
||||
P("search");
|
||||
P("update");
|
||||
P("remove");
|
||||
function P(a) {
|
||||
O.prototype[a] = O.prototype[a + "Async"] = function() {
|
||||
Q("add");
|
||||
Q("append");
|
||||
Q("search");
|
||||
Q("update");
|
||||
Q("remove");
|
||||
function Q(a) {
|
||||
P.prototype[a] = P.prototype[a + "Async"] = function() {
|
||||
const b = this, c = [].slice.call(arguments);
|
||||
var d = c[c.length - 1];
|
||||
let e;
|
||||
D(d) && (e = d, c.splice(c.length - 1, 1));
|
||||
E(d) && (e = d, c.splice(c.length - 1, 1));
|
||||
d = new Promise(function(f) {
|
||||
setTimeout(function() {
|
||||
b.h[++wa] = f;
|
||||
b.o.postMessage({task:a, id:wa, args:c});
|
||||
b.h[++va] = f;
|
||||
b.o.postMessage({task:a, id:va, args:c});
|
||||
});
|
||||
});
|
||||
return e ? (d.then(e), this) : d;
|
||||
};
|
||||
}
|
||||
function xa(a, b, c) {
|
||||
function wa(a, b, c) {
|
||||
let d;
|
||||
try {
|
||||
d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + va.toString()], {type:"text/javascript"}))) : new Worker(x(c) ? c : "worker/worker.js", {type:"module"});
|
||||
d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + ua.toString()], {type:"text/javascript"}))) : new Worker(C(c) ? c : "worker/worker.js", {type:"module"});
|
||||
} catch (e) {
|
||||
}
|
||||
return d;
|
||||
}
|
||||
;function Q(a) {
|
||||
if (!(this instanceof Q)) {
|
||||
return new Q(a);
|
||||
;function S(a) {
|
||||
if (!(this instanceof S)) {
|
||||
return new S(a);
|
||||
}
|
||||
var b = a.document || a.doc || a, c;
|
||||
this.K = [];
|
||||
this.h = [];
|
||||
this.A = [];
|
||||
this.register = v();
|
||||
this.key = (c = b.key || b.id) && S(c, this.A) || "id";
|
||||
this.register = x();
|
||||
this.key = (c = b.key || b.id) && T(c, this.A) || "id";
|
||||
this.m = u(a.fastupdate);
|
||||
this.C = (c = b.store) && !0 !== c && [];
|
||||
this.store = c && v();
|
||||
this.I = (c = b.tag) && S(c, this.A);
|
||||
this.l = c && v();
|
||||
this.cache = (c = a.cache) && new J(c);
|
||||
this.store = c && x();
|
||||
this.I = (c = b.tag) && T(c, this.A);
|
||||
this.l = c && x();
|
||||
this.cache = (c = a.cache) && new K(c);
|
||||
a.cache = !1;
|
||||
this.o = a.worker;
|
||||
this.async = !1;
|
||||
c = v();
|
||||
c = x();
|
||||
let d = b.index || b.field || b;
|
||||
x(d) && (d = [d]);
|
||||
C(d) && (d = [d]);
|
||||
for (let e = 0, f, h; e < d.length; e++) {
|
||||
f = d[e], x(f) || (h = f, f = f.field), h = C(h) ? Object.assign({}, a, h) : a, this.o && (c[f] = new O(h), c[f].o || (this.o = !1)), this.o || (c[f] = new K(h, this.register)), this.K[e] = S(f, this.A), this.h[e] = f;
|
||||
f = d[e], C(f) || (h = f, f = f.field), h = D(h) ? Object.assign({}, a, h) : a, this.o && (c[f] = new P(h), c[f].o || (this.o = !1)), this.o || (c[f] = new L(h, this.register)), this.K[e] = T(f, this.A), this.h[e] = f;
|
||||
}
|
||||
if (this.C) {
|
||||
for (a = b.store, x(a) && (a = [a]), b = 0; b < a.length; b++) {
|
||||
this.C[b] = S(a[b], this.A);
|
||||
for (a = b.store, C(a) && (a = [a]), b = 0; b < a.length; b++) {
|
||||
this.C[b] = T(a[b], this.A);
|
||||
}
|
||||
}
|
||||
this.index = c;
|
||||
}
|
||||
function S(a, b) {
|
||||
function T(a, b) {
|
||||
const c = a.split(":");
|
||||
let d = 0;
|
||||
for (let e = 0; e < c.length; e++) {
|
||||
@@ -648,8 +648,8 @@ function S(a, b) {
|
||||
d < c.length && (c.length = d);
|
||||
return 1 < d ? c : c[0];
|
||||
}
|
||||
function T(a, b) {
|
||||
if (x(b)) {
|
||||
function U(a, b) {
|
||||
if (C(b)) {
|
||||
a = a[b];
|
||||
} else {
|
||||
for (let c = 0; a && c < b.length; c++) {
|
||||
@@ -658,21 +658,21 @@ function T(a, b) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
function U(a, b, c, d, e) {
|
||||
function V(a, b, c, d, e) {
|
||||
a = a[e];
|
||||
if (d === c.length - 1) {
|
||||
b[e] = a;
|
||||
} else if (a) {
|
||||
if (a.constructor === Array) {
|
||||
for (b = b[e] = Array(a.length), e = 0; e < a.length; e++) {
|
||||
U(a, b, c, d, e);
|
||||
V(a, b, c, d, e);
|
||||
}
|
||||
} else {
|
||||
b = b[e] || (b[e] = v()), e = c[++d], U(a, b, c, d, e);
|
||||
b = b[e] || (b[e] = x()), e = c[++d], V(a, b, c, d, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
function V(a, b, c, d, e, f, h, g) {
|
||||
function X(a, b, c, d, e, f, h, g) {
|
||||
if (a = a[h]) {
|
||||
if (d === b.length - 1) {
|
||||
if (a.constructor === Array) {
|
||||
@@ -688,27 +688,27 @@ function V(a, b, c, d, e, f, h, g) {
|
||||
} else {
|
||||
if (a.constructor === Array) {
|
||||
for (h = 0; h < a.length; h++) {
|
||||
V(a, b, c, d, e, f, h, g);
|
||||
X(a, b, c, d, e, f, h, g);
|
||||
}
|
||||
} else {
|
||||
h = b[++d], V(a, b, c, d, e, f, h, g);
|
||||
h = b[++d], X(a, b, c, d, e, f, h, g);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
t = Q.prototype;
|
||||
t = S.prototype;
|
||||
t.add = function(a, b, c) {
|
||||
C(a) && (b = a, a = T(b, this.key));
|
||||
D(a) && (b = a, a = U(b, this.key));
|
||||
if (b && (a || 0 === a)) {
|
||||
if (!c && this.register[a]) {
|
||||
return this.update(a, b);
|
||||
}
|
||||
for (let d = 0, e, f; d < this.h.length; d++) {
|
||||
f = this.h[d], e = this.K[d], x(e) && (e = [e]), V(b, e, this.A, 0, this.index[f], a, e[0], c);
|
||||
f = this.h[d], e = this.K[d], C(e) && (e = [e]), X(b, e, this.A, 0, this.index[f], a, e[0], c);
|
||||
}
|
||||
if (this.I) {
|
||||
let d = T(b, this.I), e = v();
|
||||
x(d) && (d = [d]);
|
||||
let d = U(b, this.I), e = x();
|
||||
C(d) && (d = [d]);
|
||||
for (let f = 0, h, g; f < d.length; f++) {
|
||||
if (h = d[f], !e[h] && (e[h] = 1, g = this.l[h] || (this.l[h] = []), !c || !g.includes(a))) {
|
||||
if (g[g.length] = a, this.m) {
|
||||
@@ -721,9 +721,9 @@ t.add = function(a, b, c) {
|
||||
if (this.store && (!c || !this.store[a])) {
|
||||
let d;
|
||||
if (this.C) {
|
||||
d = v();
|
||||
d = x();
|
||||
for (let e = 0, f; e < this.C.length; e++) {
|
||||
f = this.C[e], x(f) ? d[f] = b[f] : U(b, d, f, 0, f[0]);
|
||||
f = this.C[e], C(f) ? d[f] = b[f] : V(b, d, f, 0, f[0]);
|
||||
}
|
||||
}
|
||||
this.store[a] = d || b;
|
||||
@@ -738,7 +738,7 @@ t.update = function(a, b) {
|
||||
return this.remove(a).add(a, b);
|
||||
};
|
||||
t.remove = function(a) {
|
||||
C(a) && (a = T(a, this.key));
|
||||
D(a) && (a = U(a, this.key));
|
||||
if (this.register[a]) {
|
||||
for (var b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.o), !this.m); b++) {
|
||||
}
|
||||
@@ -755,7 +755,7 @@ t.remove = function(a) {
|
||||
return this;
|
||||
};
|
||||
t.search = function(a, b, c, d) {
|
||||
c || (!b && C(a) ? (c = a, a = "") : C(b) && (c = b, b = 0));
|
||||
c || (!b && D(a) ? (c = a, a = "") : D(b) && (c = b, b = 0));
|
||||
let e = [], f = [], h, g, k, m, n, w, q = 0;
|
||||
if (c) {
|
||||
if (c.constructor === Array) {
|
||||
@@ -768,15 +768,15 @@ t.search = function(a, b, c, d) {
|
||||
n = "and" === c.bool;
|
||||
b = c.limit || b || 100;
|
||||
w = c.offset || 0;
|
||||
if (m && (x(m) && (m = [m]), !a)) {
|
||||
if (m && (C(m) && (m = [m]), !a)) {
|
||||
for (let l = 0, p; l < m.length; l++) {
|
||||
if (p = ya.call(this, m[l], b, w, g)) {
|
||||
if (p = xa.call(this, m[l], b, w, g)) {
|
||||
e[e.length] = p, q++;
|
||||
}
|
||||
}
|
||||
return q ? e : [];
|
||||
}
|
||||
x(k) && (k = [k]);
|
||||
C(k) && (k = [k]);
|
||||
}
|
||||
}
|
||||
k || (k = this.h);
|
||||
@@ -785,7 +785,7 @@ t.search = function(a, b, c, d) {
|
||||
for (let l = 0, p, A, B; l < k.length; l++) {
|
||||
let z;
|
||||
A = k[l];
|
||||
x(A) || (z = A, A = z.field, a = z.query || a, b = z.limit || b, g = z.enrich || g);
|
||||
C(A) || (z = A, A = z.field, a = z.query || a, b = z.limit || b, g = z.enrich || g);
|
||||
if (r) {
|
||||
r[l] = this.index[A].searchAsync(a, b, z || c);
|
||||
} else {
|
||||
@@ -795,12 +795,12 @@ t.search = function(a, b, c, d) {
|
||||
const y = [];
|
||||
let H = 0;
|
||||
n && (y[0] = [p]);
|
||||
for (let X = 0, qa, R; X < m.length; X++) {
|
||||
if (qa = m[X], B = (R = this.l[qa]) && R.length) {
|
||||
for (let W = 0, pa, R; W < m.length; W++) {
|
||||
if (pa = m[W], B = (R = this.l[pa]) && R.length) {
|
||||
H++, y[y.length] = n ? [R] : R;
|
||||
}
|
||||
}
|
||||
H && (p = n ? ma(y, b || 100, w || 0) : na(p, y), B = p.length);
|
||||
H && (p = n ? la(y, b || 100, w || 0) : ma(p, y), B = p.length);
|
||||
}
|
||||
if (B) {
|
||||
f[q] = A, e[q++] = p;
|
||||
@@ -825,7 +825,7 @@ t.search = function(a, b, c, d) {
|
||||
}
|
||||
for (let l = 0, p; l < f.length; l++) {
|
||||
p = e[l];
|
||||
p.length && g && (p = za.call(this, p));
|
||||
p.length && g && (p = ya.call(this, p));
|
||||
if (h) {
|
||||
return p;
|
||||
}
|
||||
@@ -833,17 +833,17 @@ t.search = function(a, b, c, d) {
|
||||
}
|
||||
return e;
|
||||
};
|
||||
function ya(a, b, c, d) {
|
||||
function xa(a, b, c, d) {
|
||||
let e = this.l[a], f = e && e.length - c;
|
||||
if (f && 0 < f) {
|
||||
if (f > b || c) {
|
||||
e = e.slice(c, c + b);
|
||||
}
|
||||
d && (e = za.call(this, e));
|
||||
d && (e = ya.call(this, e));
|
||||
return {tag:a, result:e};
|
||||
}
|
||||
}
|
||||
function za(a) {
|
||||
function ya(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[d]};
|
||||
@@ -860,7 +860,7 @@ t.set = function(a, b) {
|
||||
this.store[a] = b;
|
||||
return this;
|
||||
};
|
||||
t.searchCache = oa;
|
||||
t.searchCache = na;
|
||||
t.export = function(a, b, c, d, e, f) {
|
||||
let h;
|
||||
"undefined" === typeof f && (h = new Promise(g => {
|
||||
@@ -891,13 +891,13 @@ t.export = function(a, b, c, d, e, f) {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
ra(a, this, c, g, d, e, k, f);
|
||||
qa(a, this, c, g, d, e, k, f);
|
||||
}
|
||||
return h;
|
||||
};
|
||||
t.import = function(a, b) {
|
||||
if (b) {
|
||||
switch(x(b) && (b = JSON.parse(b)), a) {
|
||||
switch(C(b) && (b = JSON.parse(b)), a) {
|
||||
case "tag":
|
||||
this.l = b;
|
||||
break;
|
||||
@@ -919,28 +919,28 @@ t.import = function(a, b) {
|
||||
}
|
||||
}
|
||||
};
|
||||
la(Q.prototype);
|
||||
var Ba = {encode:Aa, F:!1, G:""};
|
||||
const Ca = [F("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", F("[\u00e8\u00e9\u00ea\u00eb]"), "e", F("[\u00ec\u00ed\u00ee\u00ef]"), "i", F("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", F("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", F("[\u00fd\u0177\u00ff]"), "y", F("\u00f1"), "n", F("[\u00e7c]"), "k", F("\u00df"), "s", F(" & "), " and "];
|
||||
function Aa(a) {
|
||||
ka(S.prototype);
|
||||
var Aa = {encode:za, F:!1, G:""};
|
||||
const Ba = [G("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", G("[\u00e8\u00e9\u00ea\u00eb]"), "e", G("[\u00ec\u00ed\u00ee\u00ef]"), "i", G("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", G("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", G("[\u00fd\u0177\u00ff]"), "y", G("\u00f1"), "n", G("[\u00e7c]"), "k", G("\u00df"), "s", G(" & "), " and "];
|
||||
function za(a) {
|
||||
var b = a = "" + a;
|
||||
b.normalize && (b = b.normalize("NFD").replace(ea, ""));
|
||||
return ca.call(this, b.toLowerCase(), !a.normalize && Ca);
|
||||
b.normalize && (b = b.normalize("NFD").replace(da, ""));
|
||||
return ba.call(this, b.toLowerCase(), !a.normalize && Ba);
|
||||
}
|
||||
;var Ea = {encode:Da, F:!1, G:"strict"};
|
||||
const Fa = /[^a-z0-9]+/, Ga = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function Da(a) {
|
||||
a = Aa.call(this, a).join(" ");
|
||||
;var Da = {encode:Ca, F:!1, G:"strict"};
|
||||
const Ea = /[^a-z0-9]+/, Fa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function Ca(a) {
|
||||
a = za.call(this, a).join(" ");
|
||||
const b = [];
|
||||
if (a) {
|
||||
const c = a.split(Fa), d = c.length;
|
||||
const c = a.split(Ea), d = c.length;
|
||||
for (let e = 0, f, h = 0; e < d; e++) {
|
||||
if ((a = c[e]) && (!this.filter || !this.filter[a])) {
|
||||
f = a[0];
|
||||
let g = Ga[f] || f, k = g;
|
||||
let g = Fa[f] || f, k = g;
|
||||
for (let m = 1; m < a.length; m++) {
|
||||
f = a[m];
|
||||
const n = Ga[f] || f;
|
||||
const n = Fa[f] || f;
|
||||
n && n !== k && (g += n, k = n);
|
||||
}
|
||||
b[h++] = g;
|
||||
@@ -949,31 +949,30 @@ function Da(a) {
|
||||
}
|
||||
return b;
|
||||
}
|
||||
;var Ia = {encode:Ha, F:!1, G:""};
|
||||
const Ja = [F("ae"), "a", F("oe"), "o", F("sh"), "s", F("th"), "t", F("ph"), "f", F("pf"), "f", F("(?![aeo])h(?![aeo])"), "", F("(?!^[aeo])h(?!^[aeo])"), ""];
|
||||
function Ha(a, b) {
|
||||
a && (a = Da.call(this, a).join(" "), 2 < a.length && (a = E(a, Ja)), b || (1 < a.length && (a = ha(a)), a && (a = a.split(" "))));
|
||||
;var Ha = {encode:Ga, F:!1, G:""};
|
||||
const Ia = [G("ae"), "a", G("oe"), "o", G("sh"), "s", G("th"), "t", G("ph"), "f", G("pf"), "f", G("(?![aeo])h(?![aeo])"), "", G("(?!^[aeo])h(?!^[aeo])"), ""];
|
||||
function Ga(a, b) {
|
||||
a && (a = Ca.call(this, a).join(" "), 2 < a.length && (a = F(a, Ia)), b || (1 < a.length && (a = fa(a)), a && (a = a.split(" "))));
|
||||
return a || [];
|
||||
}
|
||||
;var La = {encode:Ka, F:!1, G:""};
|
||||
const Ma = F("(?!\\b)[aeo]");
|
||||
function Ka(a) {
|
||||
a && (a = Ha.call(this, a, !0), 1 < a.length && (a = a.replace(Ma, "")), 1 < a.length && (a = ha(a)), a && (a = a.split(" ")));
|
||||
;var Ka = {encode:Ja, F:!1, G:""};
|
||||
const La = G("(?!\\b)[aeo]");
|
||||
function Ja(a) {
|
||||
a && (a = Ga.call(this, a, !0), 1 < a.length && (a = a.replace(La, "")), 1 < a.length && (a = fa(a)), a && (a = a.split(" ")));
|
||||
return a || [];
|
||||
}
|
||||
;G["latin:default"] = ja;
|
||||
G["latin:simple"] = Ba;
|
||||
G["latin:balance"] = Ea;
|
||||
G["latin:advanced"] = Ia;
|
||||
G["latin:extra"] = La;
|
||||
const W = self;
|
||||
let Y;
|
||||
const Z = {Index:K, Document:Q, Worker:O, registerCharset:function(a, b) {
|
||||
G[a] = b;
|
||||
;I["latin:default"] = ia;
|
||||
I["latin:simple"] = Aa;
|
||||
I["latin:balance"] = Da;
|
||||
I["latin:advanced"] = Ha;
|
||||
I["latin:extra"] = Ka;
|
||||
const Y = {Index:L, Document:S, Worker:P, registerCharset:function(a, b) {
|
||||
I[a] = b;
|
||||
}, registerLanguage:function(a, b) {
|
||||
ka[a] = b;
|
||||
ja[a] = b;
|
||||
}};
|
||||
(Y = W.define) && Y.amd ? Y([], function() {
|
||||
return Z;
|
||||
}) : W.exports ? W.exports = Z : W.FlexSearch = Z;
|
||||
let Z;
|
||||
(Z = self.define) && Z.amd ? Z([], function() {
|
||||
return Y;
|
||||
}) : self.exports ? self.exports = Y : self.FlexSearch = Y;
|
||||
}(this));
|
||||
|
56
dist/flexsearch.bundle.min.js
vendored
56
dist/flexsearch.bundle.min.js
vendored
@@ -1,34 +1,34 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Bundle)
|
||||
* FlexSearch.js v0.7.40 (Bundle)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
(function _factory(self){'use strict';var t;function u(a){return"undefined"!==typeof a?a:!0}function aa(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=v();return b}function v(){return Object.create(null)}function ba(a,b){return b.length-a.length}function x(a){return"string"===typeof a}function C(a){return"object"===typeof a}function D(a){return"function"===typeof a};function ca(a,b){var c=da;if(a&&(b&&(a=E(a,b)),this.H&&(a=E(a,this.H)),this.J&&1<a.length&&(a=E(a,this.J)),c||""===c)){b=a.split(c);if(this.filter){a=this.filter;c=b.length;const d=[];for(let e=0,f=0;e<c;e++){const h=b[e];h&&!a[h]&&(d[f++]=h)}a=d}else a=b;return a}return a}const da=/[\p{Z}\p{S}\p{P}\p{C}]+/u,ea=/[\u0300-\u036f]/g;
|
||||
function fa(a,b){const c=Object.keys(a),d=c.length,e=[];let f="",h=0;for(let g=0,k,m;g<d;g++)k=c[g],(m=a[k])?(e[h++]=F(b?"(?!\\b)"+k+"(\\b|_)":k),e[h++]=m):f+=(f?"|":"")+k;f&&(e[h++]=F(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),e[h]="");return e}function E(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function F(a){return new RegExp(a,"g")}function ha(a){let b="",c="";for(let d=0,e=a.length,f;d<e;d++)(f=a[d])!==c&&(b+=c=f);return b};var ja={encode:ia,F:!1,G:""};function ia(a){return ca.call(this,(""+a).toLowerCase(),!1)};const ka={},G={};function la(a){I(a,"add");I(a,"append");I(a,"search");I(a,"update");I(a,"remove")}function I(a,b){a[b+"Async"]=function(){const c=this,d=arguments;var e=d[d.length-1];let f;D(e)&&(f=e,delete d[d.length-1]);e=new Promise(function(h){setTimeout(function(){c.async=!0;const g=c[b].apply(c,d);c.async=!1;h(g)})});return f?(e.then(f),this):e}};function ma(a,b,c,d){const e=a.length;let f=[],h,g,k=0;d&&(d=[]);for(let m=e-1;0<=m;m--){const n=a[m],w=n.length,q=v();let r=!h;for(let l=0;l<w;l++){const p=n[l],A=p.length;if(A)for(let B=0,z,y;B<A;B++)if(y=p[B],h){if(h[y]){if(!m)if(c)c--;else if(f[k++]=y,k===b)return f;if(m||d)q[y]=1;r=!0}if(d&&(z=(g[y]||0)+1,g[y]=z,z<e)){const H=d[z-2]||(d[z-2]=[]);H[H.length]=y}}else q[y]=1}if(d)h||(g=q);else if(!r)return[];h=q}if(d)for(let m=d.length-1,n,w;0<=m;m--){n=d[m];w=n.length;for(let q=0,r;q<w;q++)if(r=
|
||||
n[q],!h[r]){if(c)c--;else if(f[k++]=r,k===b)return f;h[r]=1}}return f}function na(a,b){const c=v(),d=v(),e=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,h;f<b.length;f++){h=b[f];for(let g=0,k;g<h.length;g++)k=h[g],c[k]&&!d[k]&&(d[k]=1,e[e.length]=k)}return e};function J(a){this.l=!0!==a&&a;this.cache=v();this.h=[]}function oa(a,b,c){C(a)&&(a=a.query);let d=this.cache.get(a);d||(d=this.search(a,b,c),this.cache.set(a,d));return d}J.prototype.set=function(a,b){if(!this.cache[a]){var c=this.h.length;c===this.l?delete this.cache[this.h[c-1]]:c++;for(--c;0<c;c--)this.h[c]=this.h[c-1];this.h[0]=a}this.cache[a]=b};J.prototype.get=function(a){const b=this.cache[a];if(this.l&&b&&(a=this.h.indexOf(a))){const c=this.h[a-1];this.h[a-1]=this.h[a];this.h[a]=c}return b};const qa={memory:{charset:"latin:extra",D:3,B:4,m:!1},performance:{D:3,B:3,s:!1,context:{depth:2,D:1}},match:{charset:"latin:extra",G:"reverse"},score:{charset:"latin:advanced",D:20,B:3,context:{depth:3,D:9}},"default":{}};function ra(a,b,c,d,e,f,h,g){setTimeout(function(){const k=a(c?c+"."+d:d,JSON.stringify(h));k&&k.then?k.then(function(){b.export(a,b,c,e,f+1,g)}):b.export(a,b,c,e,f+1,g)})};function K(a,b){if(!(this instanceof K))return new K(a);var c;if(a){x(a)?a=qa[a]:(c=a.preset)&&(a=Object.assign({},c[c],a));c=a.charset;var d=a.lang;x(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=G[c]);x(d)&&(d=ka[d])}else a={};let e,f,h=a.context||{};this.encode=a.encode||c&&c.encode||ia;this.register=b||v();this.D=e=a.resolution||9;this.G=b=c&&c.G||a.tokenize||"strict";this.depth="strict"===b&&h.depth;this.l=u(h.bidirectional);this.s=f=u(a.optimize);this.m=u(a.fastupdate);this.B=a.minlength||1;this.C=
|
||||
a.boost;this.map=f?aa(e):v();this.A=e=h.resolution||1;this.h=f?aa(e):v();this.F=c&&c.F||a.rtl;this.H=(b=a.matcher||d&&d.H)&&fa(b,!1);this.J=(b=a.stemmer||d&&d.J)&&fa(b,!0);if(c=b=a.filter||d&&d.filter){c=b;d=v();for(let g=0,k=c.length;g<k;g++)d[c[g]]=1;c=d}this.filter=c;this.cache=(b=a.cache)&&new J(b)}t=K.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(d=b.length){const m=v(),n=v(),w=this.depth,q=this.D;for(let r=0;r<d;r++){let l=b[this.F?d-1-r:r];var e=l.length;if(l&&e>=this.B&&(w||!n[l])){var f=L(q,d,r),h="";switch(this.G){case "full":if(2<e){for(f=0;f<e;f++)for(var g=e;g>f;g--)if(g-f>=this.B){var k=L(q,d,r,e,f);h=l.substring(f,g);M(this,n,h,k,a,c)}break}case "reverse":if(1<e){for(g=e-1;0<g;g--)h=l[g]+h,h.length>=this.B&&M(this,n,
|
||||
h,L(q,d,r,e,g),a,c);h=""}case "forward":if(1<e){for(g=0;g<e;g++)h+=l[g],h.length>=this.B&&M(this,n,h,f,a,c);break}default:if(this.C&&(f=Math.min(f/this.C(b,l,r)|0,q-1)),M(this,n,l,f,a,c),w&&1<d&&r<d-1)for(e=v(),h=this.A,f=l,g=Math.min(w+1,d-r),e[f]=1,k=1;k<g;k++)if((l=b[this.F?d-1-r-k:r+k])&&l.length>=this.B&&!e[l]){e[l]=1;const p=this.l&&l>f;M(this,m,p?f:l,L(h+(d/2>h?0:1),d,r,g-1,k-1),a,c,p?l:f)}}}}this.m||(this.register[a]=1)}}return this};
|
||||
function L(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 M(a,b,c,d,e,f,h){let g=h?a.h:a.map;if(!b[c]||h&&!b[c][h])a.s&&(g=g[d]),h?(b=b[c]||(b[c]=v()),b[h]=1,g=g[h]||(g[h]=v())):b[c]=1,g=g[c]||(g[c]=[]),a.s||(g=g[d]||(g[d]=[])),f&&g.includes(e)||(g[g.length]=e,a.m&&(a=a.register[e]||(a.register[e]=[]),a[a.length]=g))}
|
||||
t.search=function(a,b,c){c||(!b&&C(a)?(c=a,a=c.query):C(b)&&(c=b));let d=[],e;let f,h=0;if(c){a=c.query||a;b=c.limit;h=c.offset||0;var g=c.context;f=c.suggest}if(a&&(a=this.encode(""+a),e=a.length,1<e)){c=v();var k=[];for(let n=0,w=0,q;n<e;n++)if((q=a[n])&&q.length>=this.B&&!c[q])if(this.s||f||this.map[q])k[w++]=q,c[q]=1;else return d;a=k;e=a.length}if(!e)return d;b||(b=100);g=this.depth&&1<e&&!1!==g;c=0;let m;g?(m=a[0],c=1):1<e&&a.sort(ba);for(let n,w;c<e;c++){w=a[c];g?(n=sa(this,d,f,b,h,2===e,w,
|
||||
m),f&&!1===n&&d.length||(m=w)):n=sa(this,d,f,b,h,1===e,w);if(n)return n;if(f&&c===e-1){k=d.length;if(!k){if(g){g=0;c=-1;continue}return d}if(1===k)return ta(d[0],b,h)}}return ma(d,b,h,f)};
|
||||
function sa(a,b,c,d,e,f,h,g){let k=[],m=g?a.h:a.map;a.s||(m=ua(m,h,g,a.l));if(m){let n=0;const w=Math.min(m.length,g?a.A:a.D);for(let q=0,r=0,l,p;q<w;q++)if(l=m[q])if(a.s&&(l=ua(l,h,g,a.l)),e&&l&&f&&(p=l.length,p<=e?(e-=p,l=null):(l=l.slice(e),e=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=d)))break;if(n){if(f)return ta(k,d,0);b[b.length]=k;return}}return!c&&k}function ta(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function ua(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d<c.length;d++)e=c[d],e.splice(e.indexOf(a),1);else N(this.map,a,this.D,this.s),this.depth&&N(this.h,a,this.A,this.s);b||delete this.register[a];if(this.cache){b=this.cache;for(let d=0,e,f;d<b.h.length;d++)f=b.h[d],e=b.cache[f],e.includes(a)&&(b.h.splice(d--,1),delete b.cache[f])}}return this};
|
||||
function N(a,b,c,d,e){let f=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{e=Math.min(a.length,c);for(let h=0,g;h<e;h++)if(g=a[h])f=N(g,b,c,d,e),d||f||delete a[h]}else for(let h in a)(f=N(a[h],b,c,d,e))||delete a[h];return f}t.searchCache=oa;
|
||||
t.export=function(a,b,c,d,e,f){let h=!0;"undefined"===typeof f&&(h=new Promise(m=>{f=m}));let g,k;switch(e||(e=0)){case 0:g="reg";if(this.m){k=v();for(let m in this.register)k[m]=1}else k=this.register;break;case 1:g="cfg";k={doc:0,opt:this.s?1:0};break;case 2:g="map";k=this.map;break;case 3:g="ctx";k=this.h;break;default:"undefined"===typeof c&&f&&f();return}ra(a,b||this,c,g,d,e,k,f);return h};
|
||||
t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};la(K.prototype);function va(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new K(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let wa=0;function O(a){if(!(this instanceof O))return new O(a);var b;a?D(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c="undefined"===typeof window&&self.exports,d=this;this.o=xa(b,c,a.worker);this.h=v();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}P("add");P("append");P("search");
|
||||
P("update");P("remove");function P(a){O.prototype[a]=O.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;D(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++wa]=f;b.o.postMessage({task:a,id:wa,args:c})})});return e?(d.then(e),this):d}}
|
||||
function xa(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+va.toString()],{type:"text/javascript"}))):new Worker(x(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function Q(a){if(!(this instanceof Q))return new Q(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=v();this.key=(c=b.key||b.id)&&S(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&v();this.I=(c=b.tag)&&S(c,this.A);this.l=c&&v();this.cache=(c=a.cache)&&new J(c);a.cache=!1;this.o=a.worker;this.async=!1;c=v();let d=b.index||b.field||b;x(d)&&(d=[d]);for(let e=0,f,h;e<d.length;e++)f=d[e],x(f)||(h=f,f=f.field),h=C(h)?Object.assign({},a,h):a,
|
||||
this.o&&(c[f]=new O(h),c[f].o||(this.o=!1)),this.o||(c[f]=new K(h,this.register)),this.K[e]=S(f,this.A),this.h[e]=f;if(this.C)for(a=b.store,x(a)&&(a=[a]),b=0;b<a.length;b++)this.C[b]=S(a[b],this.A);this.index=c}function S(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],0<=a.indexOf("[]")&&(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]}function T(a,b){if(x(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function U(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)U(a,b,c,d,e);else b=b[e]||(b[e]=v()),e=c[++d],U(a,b,c,d,e)}function V(a,b,c,d,e,f,h,g){if(a=a[h])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,g,!0)}else if(a.constructor===Array)for(h=0;h<a.length;h++)V(a,b,c,d,e,f,h,g);else h=b[++d],V(a,b,c,d,e,f,h,g)}t=Q.prototype;
|
||||
t.add=function(a,b,c){C(a)&&(b=a,a=T(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let d=0,e,f;d<this.h.length;d++)f=this.h[d],e=this.K[d],x(e)&&(e=[e]),V(b,e,this.A,0,this.index[f],a,e[0],c);if(this.I){let d=T(b,this.I),e=v();x(d)&&(d=[d]);for(let f=0,h,g;f<d.length;f++)if(h=d[f],!e[h]&&(e[h]=1,g=this.l[h]||(this.l[h]=[]),!c||!g.includes(a)))if(g[g.length]=a,this.m){const k=this.register[a]||(this.register[a]=[]);k[k.length]=g}}if(this.store&&(!c||!this.store[a])){let d;
|
||||
if(this.C){d=v();for(let e=0,f;e<this.C.length;e++)f=this.C[e],x(f)?d[f]=b[f]:U(b,d,f,0,f[0])}this.store[a]=d||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){C(a)&&(a=T(a,this.key));if(this.register[a]){for(var b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.o),!this.m);b++);if(this.I&&!this.m)for(let c in this.l){b=this.l[c];const d=b.indexOf(a);-1!==d&&(1<b.length?b.splice(d,1):delete this.l[c])}this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,d){c||(!b&&C(a)?(c=a,a=""):C(b)&&(c=b,b=0));let e=[],f=[],h,g,k,m,n,w,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{a=c.query||a;k=(h=c.pluck)||c.index||c.field;m=c.tag;g=this.store&&c.enrich;n="and"===c.bool;b=c.limit||b||100;w=c.offset||0;if(m&&(x(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=ya.call(this,m[l],b,w,g))e[e.length]=p,q++;return q?e:[]}x(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!d&&(this.o||this.async)&&[];for(let l=0,p,A,B;l<
|
||||
k.length;l++){let z;A=k[l];x(A)||(z=A,A=z.field,a=z.query||a,b=z.limit||b,g=z.enrich||g);if(r)r[l]=this.index[A].searchAsync(a,b,z||c);else{d?p=d[l]:p=this.index[A].search(a,b,z||c);B=p&&p.length;if(m&&B){const y=[];let H=0;n&&(y[0]=[p]);for(let X=0,pa,R;X<m.length;X++)if(pa=m[X],B=(R=this.l[pa])&&R.length)H++,y[y.length]=n?[R]:R;H&&(p=n?ma(y,b||100,w||0):na(p,y),B=p.length)}if(B)f[q]=A,e[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(A){p(l.search(a,
|
||||
b,c,A))})})}if(!q)return[];if(h&&(!g||!this.store))return e[0];for(let l=0,p;l<f.length;l++){p=e[l];p.length&&g&&(p=za.call(this,p));if(h)return p;e[l]={field:f[l],result:p}}return e};function ya(a,b,c,d){let e=this.l[a],f=e&&e.length-c;if(f&&0<f){if(f>b||c)e=e.slice(c,c+b);d&&(e=za.call(this,e));return{tag:a,result:e}}}function za(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[d]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};t.searchCache=oa;t.export=function(a,b,c,d,e,f){let h;"undefined"===typeof f&&(h=new Promise(g=>{f=g}));e||(e=0);d||(d=0);if(d<this.h.length){const g=this.h[d],k=this.index[g];b=this;setTimeout(function(){k.export(a,b,e?g:"",d,e++,f)||(d++,e=1,b.export(a,b,g,d,e,f))})}else{let g,k;switch(e){case 1:g="tag";k=this.l;c=null;break;case 2:g="store";k=this.store;c=null;break;default:f();return}ra(a,this,c,g,d,e,k,f)}return h};
|
||||
t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "tag":this.l=b;break;case "reg":this.m=!1;this.register=b;for(let d=0,e;d<this.h.length;d++)e=this.index[this.h[d]],e.register=b,e.m=!1;break;case "store":this.store=b;break;default:a=a.split(".");const c=a[0];a=a[1];c&&a&&this.index[c].import(a,b)}};la(Q.prototype);var Ba={encode:Aa,F:!1,G:""};const Ca=[F("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",F("[\u00e8\u00e9\u00ea\u00eb]"),"e",F("[\u00ec\u00ed\u00ee\u00ef]"),"i",F("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",F("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",F("[\u00fd\u0177\u00ff]"),"y",F("\u00f1"),"n",F("[\u00e7c]"),"k",F("\u00df"),"s",F(" & ")," and "];function Aa(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(ea,""));return ca.call(this,b.toLowerCase(),!a.normalize&&Ca)};var Ea={encode:Da,F:!1,G:"strict"};const Fa=/[^a-z0-9]+/,Ga={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Da(a){a=Aa.call(this,a).join(" ");const b=[];if(a){const c=a.split(Fa),d=c.length;for(let e=0,f,h=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){f=a[0];let g=Ga[f]||f,k=g;for(let m=1;m<a.length;m++){f=a[m];const n=Ga[f]||f;n&&n!==k&&(g+=n,k=n)}b[h++]=g}}return b};var Ia={encode:Ha,F:!1,G:""};const Ja=[F("ae"),"a",F("oe"),"o",F("sh"),"s",F("th"),"t",F("ph"),"f",F("pf"),"f",F("(?![aeo])h(?![aeo])"),"",F("(?!^[aeo])h(?!^[aeo])"),""];function Ha(a,b){a&&(a=Da.call(this,a).join(" "),2<a.length&&(a=E(a,Ja)),b||(1<a.length&&(a=ha(a)),a&&(a=a.split(" "))));return a||[]};var La={encode:Ka,F:!1,G:""};const Ma=F("(?!\\b)[aeo]");function Ka(a){a&&(a=Ha.call(this,a,!0),1<a.length&&(a=a.replace(Ma,"")),1<a.length&&(a=ha(a)),a&&(a=a.split(" ")));return a||[]};G["latin:default"]=ja;G["latin:simple"]=Ba;G["latin:balance"]=Ea;G["latin:advanced"]=Ia;G["latin:extra"]=La;const W=self;let Y;const Z={Index:K,Document:Q,Worker:O,registerCharset:function(a,b){G[a]=b},registerLanguage:function(a,b){ka[a]=b}};(Y=W.define)&&Y.amd?Y([],function(){return Z}):W.exports?W.exports=Z:W.FlexSearch=Z;}(this));
|
||||
(function _factory(self){'use strict';var t;function u(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=x();return b}function x(){return Object.create(null)}function aa(a,b){return b.length-a.length}function C(a){return"string"===typeof a}function D(a){return"object"===typeof a}function E(a){return"function"===typeof a};function ba(a,b){var c=ca;if(a&&(b&&(a=F(a,b)),this.H&&(a=F(a,this.H)),this.J&&1<a.length&&(a=F(a,this.J)),c||""===c)){b=a.split(c);if(this.filter){a=this.filter;c=b.length;const d=[];for(let e=0,f=0;e<c;e++){const h=b[e];h&&!a[h]&&(d[f++]=h)}a=d}else a=b;return a}return a}const ca=/[\p{Z}\p{S}\p{P}\p{C}]+/u,da=/[\u0300-\u036f]/g;
|
||||
function ea(a,b){const c=Object.keys(a),d=c.length,e=[];let f="",h=0;for(let g=0,k,m;g<d;g++)k=c[g],(m=a[k])?(e[h++]=G(b?"(?!\\b)"+k+"(\\b|_)":k),e[h++]=m):f+=(f?"|":"")+k;f&&(e[h++]=G(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),e[h]="");return e}function F(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function G(a){return new RegExp(a,"g")}function fa(a){let b="",c="";for(let d=0,e=a.length,f;d<e;d++)(f=a[d])!==c&&(b+=c=f);return b};var ia={encode:ha,F:!1,G:""};function ha(a){return ba.call(this,(""+a).toLowerCase(),!1)};const ja={},I={};function ka(a){J(a,"add");J(a,"append");J(a,"search");J(a,"update");J(a,"remove")}function J(a,b){a[b+"Async"]=function(){const c=this,d=arguments;var e=d[d.length-1];let f;E(e)&&(f=e,delete d[d.length-1]);e=new Promise(function(h){setTimeout(function(){c.async=!0;const g=c[b].apply(c,d);c.async=!1;h(g)})});return f?(e.then(f),this):e}};function la(a,b,c,d){const e=a.length;let f=[],h,g,k=0;d&&(d=[]);for(let m=e-1;0<=m;m--){const n=a[m],w=n.length,q=x();let r=!h;for(let l=0;l<w;l++){const p=n[l],A=p.length;if(A)for(let B=0,z,y;B<A;B++)if(y=p[B],h){if(h[y]){if(!m)if(c)c--;else if(f[k++]=y,k===b)return f;if(m||d)q[y]=1;r=!0}if(d&&(z=(g[y]||0)+1,g[y]=z,z<e)){const H=d[z-2]||(d[z-2]=[]);H[H.length]=y}}else q[y]=1}if(d)h||(g=q);else if(!r)return[];h=q}if(d)for(let m=d.length-1,n,w;0<=m;m--){n=d[m];w=n.length;for(let q=0,r;q<w;q++)if(r=
|
||||
n[q],!h[r]){if(c)c--;else if(f[k++]=r,k===b)return f;h[r]=1}}return f}function ma(a,b){const c=x(),d=x(),e=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,h;f<b.length;f++){h=b[f];for(let g=0,k;g<h.length;g++)k=h[g],c[k]&&!d[k]&&(d[k]=1,e[e.length]=k)}return e};function K(a){this.l=!0!==a&&a;this.cache=x();this.h=[]}function na(a,b,c){D(a)&&(a=a.query);let d=this.cache.get(a);d||(d=this.search(a,b,c),this.cache.set(a,d));return d}K.prototype.set=function(a,b){if(!this.cache[a]){var c=this.h.length;c===this.l?delete this.cache[this.h[c-1]]:c++;for(--c;0<c;c--)this.h[c]=this.h[c-1];this.h[0]=a}this.cache[a]=b};K.prototype.get=function(a){const b=this.cache[a];if(this.l&&b&&(a=this.h.indexOf(a))){const c=this.h[a-1];this.h[a-1]=this.h[a];this.h[a]=c}return b};const pa={memory:{charset:"latin:extra",D:3,B:4,m:!1},performance:{D:3,B:3,s:!1,context:{depth:2,D:1}},match:{charset:"latin:extra",G:"reverse"},score:{charset:"latin:advanced",D:20,B:3,context:{depth:3,D:9}},"default":{}};function qa(a,b,c,d,e,f,h,g){setTimeout(function(){const k=a(c?c+"."+d:d,JSON.stringify(h));k&&k.then?k.then(function(){b.export(a,b,c,e,f+1,g)}):b.export(a,b,c,e,f+1,g)})};function L(a,b){if(!(this instanceof L))return new L(a);var c;if(a){C(a)?a=pa[a]:(c=a.preset)&&(a=Object.assign({},c[c],a));c=a.charset;var d=a.lang;C(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=I[c]);C(d)&&(d=ja[d])}else a={};let e,f,h=a.context||{};this.encode=a.encode||c&&c.encode||ha;this.register=b||x();this.D=e=a.resolution||9;this.G=b=c&&c.G||a.tokenize||"strict";this.depth="strict"===b&&h.depth;this.l=u(h.bidirectional);this.s=f=u(a.optimize);this.m=u(a.fastupdate);this.B=a.minlength||1;this.C=
|
||||
a.boost;this.map=f?v(e):x();this.A=e=h.resolution||1;this.h=f?v(e):x();this.F=c&&c.F||a.rtl;this.H=(b=a.matcher||d&&d.H)&&ea(b,!1);this.J=(b=a.stemmer||d&&d.J)&&ea(b,!0);if(c=b=a.filter||d&&d.filter){c=b;d=x();for(let g=0,k=c.length;g<k;g++)d[c[g]]=1;c=d}this.filter=c;this.cache=(b=a.cache)&&new K(b)}t=L.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(d=b.length){const m=x(),n=x(),w=this.depth,q=this.D;for(let r=0;r<d;r++){let l=b[this.F?d-1-r:r];var e=l.length;if(l&&e>=this.B&&(w||!n[l])){var f=M(q,d,r),h="";switch(this.G){case "full":if(2<e){for(f=0;f<e;f++)for(var g=e;g>f;g--)if(g-f>=this.B){var k=M(q,d,r,e,f);h=l.substring(f,g);N(this,n,h,k,a,c)}break}case "reverse":if(1<e){for(g=e-1;0<g;g--)h=l[g]+h,h.length>=this.B&&N(this,n,
|
||||
h,M(q,d,r,e,g),a,c);h=""}case "forward":if(1<e){for(g=0;g<e;g++)h+=l[g],h.length>=this.B&&N(this,n,h,f,a,c);break}default:if(this.C&&(f=Math.min(f/this.C(b,l,r)|0,q-1)),N(this,n,l,f,a,c),w&&1<d&&r<d-1)for(e=x(),h=this.A,f=l,g=Math.min(w+1,d-r),e[f]=1,k=1;k<g;k++)if((l=b[this.F?d-1-r-k:r+k])&&l.length>=this.B&&!e[l]){e[l]=1;const p=this.l&&l>f;N(this,m,p?f:l,M(h+(d/2>h?0:1),d,r,g-1,k-1),a,c,p?l:f)}}}}this.m||(this.register[a]=1)}}return this};
|
||||
function M(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 N(a,b,c,d,e,f,h){let g=h?a.h:a.map;if(!b[c]||h&&!b[c][h])a.s&&(g=g[d]),h?(b=b[c]||(b[c]=x()),b[h]=1,g=g[h]||(g[h]=x())):b[c]=1,g=g[c]||(g[c]=[]),a.s||(g=g[d]||(g[d]=[])),f&&g.includes(e)||(g[g.length]=e,a.m&&(a=a.register[e]||(a.register[e]=[]),a[a.length]=g))}
|
||||
t.search=function(a,b,c){c||(!b&&D(a)?(c=a,a=c.query):D(b)&&(c=b));let d=[],e;let f,h=0;if(c){a=c.query||a;b=c.limit;h=c.offset||0;var g=c.context;f=c.suggest}if(a&&(a=this.encode(""+a),e=a.length,1<e)){c=x();var k=[];for(let n=0,w=0,q;n<e;n++)if((q=a[n])&&q.length>=this.B&&!c[q])if(this.s||f||this.map[q])k[w++]=q,c[q]=1;else return d;a=k;e=a.length}if(!e)return d;b||(b=100);g=this.depth&&1<e&&!1!==g;c=0;let m;g?(m=a[0],c=1):1<e&&a.sort(aa);for(let n,w;c<e;c++){w=a[c];g?(n=ra(this,d,f,b,h,2===e,w,
|
||||
m),f&&!1===n&&d.length||(m=w)):n=ra(this,d,f,b,h,1===e,w);if(n)return n;if(f&&c===e-1){k=d.length;if(!k){if(g){g=0;c=-1;continue}return d}if(1===k)return sa(d[0],b,h)}}return la(d,b,h,f)};
|
||||
function ra(a,b,c,d,e,f,h,g){let k=[],m=g?a.h:a.map;a.s||(m=ta(m,h,g,a.l));if(m){let n=0;const w=Math.min(m.length,g?a.A:a.D);for(let q=0,r=0,l,p;q<w;q++)if(l=m[q])if(a.s&&(l=ta(l,h,g,a.l)),e&&l&&f&&(p=l.length,p<=e?(e-=p,l=null):(l=l.slice(e),e=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=d)))break;if(n){if(f)return sa(k,d,0);b[b.length]=k;return}}return!c&&k}function sa(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function ta(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d<c.length;d++)e=c[d],e.splice(e.indexOf(a),1);else O(this.map,a,this.D,this.s),this.depth&&O(this.h,a,this.A,this.s);b||delete this.register[a];if(this.cache){b=this.cache;for(let d=0,e,f;d<b.h.length;d++)f=b.h[d],e=b.cache[f],e.includes(a)&&(b.h.splice(d--,1),delete b.cache[f])}}return this};
|
||||
function O(a,b,c,d,e){let f=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{e=Math.min(a.length,c);for(let h=0,g;h<e;h++)if(g=a[h])f=O(g,b,c,d,e),d||f||delete a[h]}else for(let h in a)(f=O(a[h],b,c,d,e))||delete a[h];return f}t.searchCache=na;
|
||||
t.export=function(a,b,c,d,e,f){let h=!0;"undefined"===typeof f&&(h=new Promise(m=>{f=m}));let g,k;switch(e||(e=0)){case 0:g="reg";if(this.m){k=x();for(let m in this.register)k[m]=1}else k=this.register;break;case 1:g="cfg";k={doc:0,opt:this.s?1:0};break;case 2:g="map";k=this.map;break;case 3:g="ctx";k=this.h;break;default:"undefined"===typeof c&&f&&f();return}qa(a,b||this,c,g,d,e,k,f);return h};
|
||||
t.import=function(a,b){if(b)switch(C(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};ka(L.prototype);function ua(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new L(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let va=0;function P(a){if(!(this instanceof P))return new P(a);var b;a?E(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c="undefined"===typeof window&&self.exports,d=this;this.o=wa(b,c,a.worker);this.h=x();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}Q("add");Q("append");Q("search");
|
||||
Q("update");Q("remove");function Q(a){P.prototype[a]=P.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;E(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++va]=f;b.o.postMessage({task:a,id:va,args:c})})});return e?(d.then(e),this):d}}
|
||||
function wa(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+ua.toString()],{type:"text/javascript"}))):new Worker(C(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function S(a){if(!(this instanceof S))return new S(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=x();this.key=(c=b.key||b.id)&&T(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&x();this.I=(c=b.tag)&&T(c,this.A);this.l=c&&x();this.cache=(c=a.cache)&&new K(c);a.cache=!1;this.o=a.worker;this.async=!1;c=x();let d=b.index||b.field||b;C(d)&&(d=[d]);for(let e=0,f,h;e<d.length;e++)f=d[e],C(f)||(h=f,f=f.field),h=D(h)?Object.assign({},a,h):a,
|
||||
this.o&&(c[f]=new P(h),c[f].o||(this.o=!1)),this.o||(c[f]=new L(h,this.register)),this.K[e]=T(f,this.A),this.h[e]=f;if(this.C)for(a=b.store,C(a)&&(a=[a]),b=0;b<a.length;b++)this.C[b]=T(a[b],this.A);this.index=c}function T(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],0<=a.indexOf("[]")&&(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]}function U(a,b){if(C(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function V(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)V(a,b,c,d,e);else b=b[e]||(b[e]=x()),e=c[++d],V(a,b,c,d,e)}function X(a,b,c,d,e,f,h,g){if(a=a[h])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,g,!0)}else if(a.constructor===Array)for(h=0;h<a.length;h++)X(a,b,c,d,e,f,h,g);else h=b[++d],X(a,b,c,d,e,f,h,g)}t=S.prototype;
|
||||
t.add=function(a,b,c){D(a)&&(b=a,a=U(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let d=0,e,f;d<this.h.length;d++)f=this.h[d],e=this.K[d],C(e)&&(e=[e]),X(b,e,this.A,0,this.index[f],a,e[0],c);if(this.I){let d=U(b,this.I),e=x();C(d)&&(d=[d]);for(let f=0,h,g;f<d.length;f++)if(h=d[f],!e[h]&&(e[h]=1,g=this.l[h]||(this.l[h]=[]),!c||!g.includes(a)))if(g[g.length]=a,this.m){const k=this.register[a]||(this.register[a]=[]);k[k.length]=g}}if(this.store&&(!c||!this.store[a])){let d;
|
||||
if(this.C){d=x();for(let e=0,f;e<this.C.length;e++)f=this.C[e],C(f)?d[f]=b[f]:V(b,d,f,0,f[0])}this.store[a]=d||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){D(a)&&(a=U(a,this.key));if(this.register[a]){for(var b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.o),!this.m);b++);if(this.I&&!this.m)for(let c in this.l){b=this.l[c];const d=b.indexOf(a);-1!==d&&(1<b.length?b.splice(d,1):delete this.l[c])}this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,d){c||(!b&&D(a)?(c=a,a=""):D(b)&&(c=b,b=0));let e=[],f=[],h,g,k,m,n,w,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{a=c.query||a;k=(h=c.pluck)||c.index||c.field;m=c.tag;g=this.store&&c.enrich;n="and"===c.bool;b=c.limit||b||100;w=c.offset||0;if(m&&(C(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=xa.call(this,m[l],b,w,g))e[e.length]=p,q++;return q?e:[]}C(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!d&&(this.o||this.async)&&[];for(let l=0,p,A,B;l<
|
||||
k.length;l++){let z;A=k[l];C(A)||(z=A,A=z.field,a=z.query||a,b=z.limit||b,g=z.enrich||g);if(r)r[l]=this.index[A].searchAsync(a,b,z||c);else{d?p=d[l]:p=this.index[A].search(a,b,z||c);B=p&&p.length;if(m&&B){const y=[];let H=0;n&&(y[0]=[p]);for(let W=0,oa,R;W<m.length;W++)if(oa=m[W],B=(R=this.l[oa])&&R.length)H++,y[y.length]=n?[R]:R;H&&(p=n?la(y,b||100,w||0):ma(p,y),B=p.length)}if(B)f[q]=A,e[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(A){p(l.search(a,
|
||||
b,c,A))})})}if(!q)return[];if(h&&(!g||!this.store))return e[0];for(let l=0,p;l<f.length;l++){p=e[l];p.length&&g&&(p=ya.call(this,p));if(h)return p;e[l]={field:f[l],result:p}}return e};function xa(a,b,c,d){let e=this.l[a],f=e&&e.length-c;if(f&&0<f){if(f>b||c)e=e.slice(c,c+b);d&&(e=ya.call(this,e));return{tag:a,result:e}}}function ya(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[d]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};t.searchCache=na;t.export=function(a,b,c,d,e,f){let h;"undefined"===typeof f&&(h=new Promise(g=>{f=g}));e||(e=0);d||(d=0);if(d<this.h.length){const g=this.h[d],k=this.index[g];b=this;setTimeout(function(){k.export(a,b,e?g:"",d,e++,f)||(d++,e=1,b.export(a,b,g,d,e,f))})}else{let g,k;switch(e){case 1:g="tag";k=this.l;c=null;break;case 2:g="store";k=this.store;c=null;break;default:f();return}qa(a,this,c,g,d,e,k,f)}return h};
|
||||
t.import=function(a,b){if(b)switch(C(b)&&(b=JSON.parse(b)),a){case "tag":this.l=b;break;case "reg":this.m=!1;this.register=b;for(let d=0,e;d<this.h.length;d++)e=this.index[this.h[d]],e.register=b,e.m=!1;break;case "store":this.store=b;break;default:a=a.split(".");const c=a[0];a=a[1];c&&a&&this.index[c].import(a,b)}};ka(S.prototype);var Aa={encode:za,F:!1,G:""};const Ba=[G("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",G("[\u00e8\u00e9\u00ea\u00eb]"),"e",G("[\u00ec\u00ed\u00ee\u00ef]"),"i",G("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",G("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",G("[\u00fd\u0177\u00ff]"),"y",G("\u00f1"),"n",G("[\u00e7c]"),"k",G("\u00df"),"s",G(" & ")," and "];function za(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(da,""));return ba.call(this,b.toLowerCase(),!a.normalize&&Ba)};var Da={encode:Ca,F:!1,G:"strict"};const Ea=/[^a-z0-9]+/,Fa={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Ca(a){a=za.call(this,a).join(" ");const b=[];if(a){const c=a.split(Ea),d=c.length;for(let e=0,f,h=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){f=a[0];let g=Fa[f]||f,k=g;for(let m=1;m<a.length;m++){f=a[m];const n=Fa[f]||f;n&&n!==k&&(g+=n,k=n)}b[h++]=g}}return b};var Ha={encode:Ga,F:!1,G:""};const Ia=[G("ae"),"a",G("oe"),"o",G("sh"),"s",G("th"),"t",G("ph"),"f",G("pf"),"f",G("(?![aeo])h(?![aeo])"),"",G("(?!^[aeo])h(?!^[aeo])"),""];function Ga(a,b){a&&(a=Ca.call(this,a).join(" "),2<a.length&&(a=F(a,Ia)),b||(1<a.length&&(a=fa(a)),a&&(a=a.split(" "))));return a||[]};var Ka={encode:Ja,F:!1,G:""};const La=G("(?!\\b)[aeo]");function Ja(a){a&&(a=Ga.call(this,a,!0),1<a.length&&(a=a.replace(La,"")),1<a.length&&(a=fa(a)),a&&(a=a.split(" ")));return a||[]};I["latin:default"]=ia;I["latin:simple"]=Aa;I["latin:balance"]=Da;I["latin:advanced"]=Ha;I["latin:extra"]=Ka;const Y={Index:L,Document:S,Worker:P,registerCharset:function(a,b){I[a]=b},registerLanguage:function(a,b){ja[a]=b}};let Z;(Z=self.define)&&Z.amd?Z([],function(){return Y}):self.exports?self.exports=Y:self.FlexSearch=Y;}(this));
|
||||
|
381
dist/flexsearch.bundle.module.debug.js
vendored
381
dist/flexsearch.bundle.module.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Bundle.module)
|
||||
* FlexSearch.js v0.7.40 (Bundle.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -9,31 +9,31 @@ var t;
|
||||
function u(a) {
|
||||
return "undefined" !== typeof a ? a : !0;
|
||||
}
|
||||
function aa(a) {
|
||||
function v(a) {
|
||||
const b = Array(a);
|
||||
for (let c = 0; c < a; c++) {
|
||||
b[c] = v();
|
||||
b[c] = x();
|
||||
}
|
||||
return b;
|
||||
}
|
||||
function v() {
|
||||
function x() {
|
||||
return Object.create(null);
|
||||
}
|
||||
function ba(a, b) {
|
||||
function aa(a, b) {
|
||||
return b.length - a.length;
|
||||
}
|
||||
function x(a) {
|
||||
function C(a) {
|
||||
return "string" === typeof a;
|
||||
}
|
||||
function C(a) {
|
||||
function D(a) {
|
||||
return "object" === typeof a;
|
||||
}
|
||||
function D(a) {
|
||||
function E(a) {
|
||||
return "function" === typeof a;
|
||||
}
|
||||
;function ca(a, b) {
|
||||
var c = da;
|
||||
if (a && (b && (a = E(a, b)), this.H && (a = E(a, this.H)), this.J && 1 < a.length && (a = E(a, this.J)), c || "" === c)) {
|
||||
;function F(a, b) {
|
||||
var c = ba;
|
||||
if (a && (b && (a = G(a, b)), this.H && (a = G(a, this.H)), this.J && 1 < a.length && (a = G(a, this.J)), c || "" === c)) {
|
||||
b = a.split(c);
|
||||
if (this.filter) {
|
||||
a = this.filter;
|
||||
@@ -51,49 +51,49 @@ function D(a) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
const da = /[\p{Z}\p{S}\p{P}\p{C}]+/u, ea = /[\u0300-\u036f]/g;
|
||||
function fa(a, b) {
|
||||
const ba = /[\p{Z}\p{S}\p{P}\p{C}]+/u, ca = /[\u0300-\u036f]/g;
|
||||
function I(a, b) {
|
||||
const c = Object.keys(a), d = c.length, e = [];
|
||||
let f = "", h = 0;
|
||||
for (let g = 0, k, m; g < d; g++) {
|
||||
k = c[g], (m = a[k]) ? (e[h++] = F(b ? "(?!\\b)" + k + "(\\b|_)" : k), e[h++] = m) : f += (f ? "|" : "") + k;
|
||||
k = c[g], (m = a[k]) ? (e[h++] = J(b ? "(?!\\b)" + k + "(\\b|_)" : k), e[h++] = m) : f += (f ? "|" : "") + k;
|
||||
}
|
||||
f && (e[h++] = F(b ? "(?!\\b)(" + f + ")(\\b|_)" : "(" + f + ")"), e[h] = "");
|
||||
f && (e[h++] = J(b ? "(?!\\b)(" + f + ")(\\b|_)" : "(" + f + ")"), e[h] = "");
|
||||
return e;
|
||||
}
|
||||
function E(a, b) {
|
||||
function G(a, b) {
|
||||
for (let c = 0, d = b.length; c < d && (a = a.replace(b[c], b[c + 1]), a); c += 2) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
function F(a) {
|
||||
function J(a) {
|
||||
return new RegExp(a, "g");
|
||||
}
|
||||
function ha(a) {
|
||||
function da(a) {
|
||||
let b = "", c = "";
|
||||
for (let d = 0, e = a.length, f; d < e; d++) {
|
||||
(f = a[d]) !== c && (b += c = f);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
;var ja = {encode:ia, F:!1, G:""};
|
||||
;var fa = {encode:ea, F:!1, G:""};
|
||||
function ea(a) {
|
||||
return F.call(this, ("" + a).toLowerCase(), !1);
|
||||
}
|
||||
;const ha = {}, K = {};
|
||||
function ia(a) {
|
||||
return ca.call(this, ("" + a).toLowerCase(), !1);
|
||||
L(a, "add");
|
||||
L(a, "append");
|
||||
L(a, "search");
|
||||
L(a, "update");
|
||||
L(a, "remove");
|
||||
}
|
||||
;const ka = {}, G = {};
|
||||
function la(a) {
|
||||
I(a, "add");
|
||||
I(a, "append");
|
||||
I(a, "search");
|
||||
I(a, "update");
|
||||
I(a, "remove");
|
||||
}
|
||||
function I(a, b) {
|
||||
function L(a, b) {
|
||||
a[b + "Async"] = function() {
|
||||
const c = this, d = arguments;
|
||||
var e = d[d.length - 1];
|
||||
let f;
|
||||
D(e) && (f = e, delete d[d.length - 1]);
|
||||
E(e) && (f = e, delete d[d.length - 1]);
|
||||
e = new Promise(function(h) {
|
||||
setTimeout(function() {
|
||||
c.async = !0;
|
||||
@@ -105,12 +105,12 @@ function I(a, b) {
|
||||
return f ? (e.then(f), this) : e;
|
||||
};
|
||||
}
|
||||
;function ma(a, b, c, d) {
|
||||
;function ja(a, b, c, d) {
|
||||
const e = a.length;
|
||||
let f = [], h, g, k = 0;
|
||||
d && (d = []);
|
||||
for (let m = e - 1; 0 <= m; m--) {
|
||||
const n = a[m], w = n.length, q = v();
|
||||
const n = a[m], w = n.length, q = x();
|
||||
let r = !h;
|
||||
for (let l = 0; l < w; l++) {
|
||||
const p = n[l], A = p.length;
|
||||
@@ -169,8 +169,8 @@ function I(a, b) {
|
||||
}
|
||||
return f;
|
||||
}
|
||||
function na(a, b) {
|
||||
const c = v(), d = v(), e = [];
|
||||
function ka(a, b) {
|
||||
const c = x(), d = x(), e = [];
|
||||
for (let f = 0; f < a.length; f++) {
|
||||
c[a[f]] = 1;
|
||||
}
|
||||
@@ -182,18 +182,18 @@ function na(a, b) {
|
||||
}
|
||||
return e;
|
||||
}
|
||||
;function J(a) {
|
||||
;function M(a) {
|
||||
this.l = !0 !== a && a;
|
||||
this.cache = v();
|
||||
this.cache = x();
|
||||
this.h = [];
|
||||
}
|
||||
function oa(a, b, c) {
|
||||
C(a) && (a = a.query);
|
||||
function la(a, b, c) {
|
||||
D(a) && (a = a.query);
|
||||
let d = this.cache.get(a);
|
||||
d || (d = this.search(a, b, c), this.cache.set(a, d));
|
||||
return d;
|
||||
}
|
||||
J.prototype.set = function(a, b) {
|
||||
M.prototype.set = function(a, b) {
|
||||
if (!this.cache[a]) {
|
||||
var c = this.h.length;
|
||||
c === this.l ? delete this.cache[this.h[c - 1]] : c++;
|
||||
@@ -204,7 +204,7 @@ J.prototype.set = function(a, b) {
|
||||
}
|
||||
this.cache[a] = b;
|
||||
};
|
||||
J.prototype.get = function(a) {
|
||||
M.prototype.get = function(a) {
|
||||
const b = this.cache[a];
|
||||
if (this.l && b && (a = this.h.indexOf(a))) {
|
||||
const c = this.h[a - 1];
|
||||
@@ -213,8 +213,8 @@ J.prototype.get = function(a) {
|
||||
}
|
||||
return b;
|
||||
};
|
||||
const pa = {memory:{charset:"latin:extra", D:3, B:4, m:!1}, performance:{D:3, B:3, s:!1, context:{depth:2, D:1}}, match:{charset:"latin:extra", G:"reverse"}, score:{charset:"latin:advanced", D:20, B:3, context:{depth:3, D:9}}, "default":{}};
|
||||
function ra(a, b, c, d, e, f, h, g) {
|
||||
const ma = {memory:{charset:"latin:extra", D:3, B:4, m:!1}, performance:{D:3, B:3, s:!1, context:{depth:2, D:1}}, match:{charset:"latin:extra", G:"reverse"}, score:{charset:"latin:advanced", D:20, B:3, context:{depth:3, D:9}}, "default":{}};
|
||||
function oa(a, b, c, d, e, f, h, g) {
|
||||
setTimeout(function() {
|
||||
const k = a(c ? c + "." + d : d, JSON.stringify(h));
|
||||
k && k.then ? k.then(function() {
|
||||
@@ -222,14 +222,14 @@ function ra(a, b, c, d, e, f, h, g) {
|
||||
}) : b.export(a, b, c, e, f + 1, g);
|
||||
});
|
||||
}
|
||||
;function K(a, b) {
|
||||
if (!(this instanceof K)) {
|
||||
return new K(a);
|
||||
;function N(a, b) {
|
||||
if (!(this instanceof N)) {
|
||||
return new N(a);
|
||||
}
|
||||
var c;
|
||||
if (a) {
|
||||
if (x(a)) {
|
||||
pa[a] || console.warn("Preset not found: " + a), a = pa[a];
|
||||
if (C(a)) {
|
||||
ma[a] || console.warn("Preset not found: " + a), a = ma[a];
|
||||
} else {
|
||||
if (c = a.preset) {
|
||||
c[c] || console.warn("Preset not found: " + c), a = Object.assign({}, c[c], a);
|
||||
@@ -237,14 +237,14 @@ function ra(a, b, c, d, e, f, h, g) {
|
||||
}
|
||||
c = a.charset;
|
||||
var d = a.lang;
|
||||
x(c) && (-1 === c.indexOf(":") && (c += ":default"), c = G[c]);
|
||||
x(d) && (d = ka[d]);
|
||||
C(c) && (-1 === c.indexOf(":") && (c += ":default"), c = K[c]);
|
||||
C(d) && (d = ha[d]);
|
||||
} else {
|
||||
a = {};
|
||||
}
|
||||
let e, f, h = a.context || {};
|
||||
this.encode = a.encode || c && c.encode || ia;
|
||||
this.register = b || v();
|
||||
this.encode = a.encode || c && c.encode || ea;
|
||||
this.register = b || x();
|
||||
this.D = e = a.resolution || 9;
|
||||
this.G = b = c && c.G || a.tokenize || "strict";
|
||||
this.depth = "strict" === b && h.depth;
|
||||
@@ -253,24 +253,24 @@ function ra(a, b, c, d, e, f, h, g) {
|
||||
this.m = u(a.fastupdate);
|
||||
this.B = a.minlength || 1;
|
||||
this.C = a.boost;
|
||||
this.map = f ? aa(e) : v();
|
||||
this.map = f ? v(e) : x();
|
||||
this.A = e = h.resolution || 1;
|
||||
this.h = f ? aa(e) : v();
|
||||
this.h = f ? v(e) : x();
|
||||
this.F = c && c.F || a.rtl;
|
||||
this.H = (b = a.matcher || d && d.H) && fa(b, !1);
|
||||
this.J = (b = a.stemmer || d && d.J) && fa(b, !0);
|
||||
this.H = (b = a.matcher || d && d.H) && I(b, !1);
|
||||
this.J = (b = a.stemmer || d && d.J) && I(b, !0);
|
||||
if (c = b = a.filter || d && d.filter) {
|
||||
c = b;
|
||||
d = v();
|
||||
d = x();
|
||||
for (let g = 0, k = c.length; g < k; g++) {
|
||||
d[c[g]] = 1;
|
||||
}
|
||||
c = d;
|
||||
}
|
||||
this.filter = c;
|
||||
this.cache = (b = a.cache) && new J(b);
|
||||
this.cache = (b = a.cache) && new M(b);
|
||||
}
|
||||
t = K.prototype;
|
||||
t = N.prototype;
|
||||
t.append = function(a, b) {
|
||||
return this.add(a, b, !0);
|
||||
};
|
||||
@@ -281,21 +281,21 @@ t.add = function(a, b, c, d) {
|
||||
}
|
||||
b = this.encode(b);
|
||||
if (d = b.length) {
|
||||
const m = v(), n = v(), w = this.depth, q = this.D;
|
||||
const m = x(), n = x(), w = this.depth, q = this.D;
|
||||
for (let r = 0; r < d; r++) {
|
||||
let l = b[this.F ? d - 1 - r : r];
|
||||
var e = l.length;
|
||||
if (l && e >= this.B && (w || !n[l])) {
|
||||
var f = L(q, d, r), h = "";
|
||||
var f = O(q, d, r), h = "";
|
||||
switch(this.G) {
|
||||
case "full":
|
||||
if (2 < e) {
|
||||
for (f = 0; f < e; f++) {
|
||||
for (var g = e; g > f; g--) {
|
||||
if (g - f >= this.B) {
|
||||
var k = L(q, d, r, e, f);
|
||||
var k = O(q, d, r, e, f);
|
||||
h = l.substring(f, g);
|
||||
M(this, n, h, k, a, c);
|
||||
P(this, n, h, k, a, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -304,24 +304,24 @@ t.add = function(a, b, c, d) {
|
||||
case "reverse":
|
||||
if (1 < e) {
|
||||
for (g = e - 1; 0 < g; g--) {
|
||||
h = l[g] + h, h.length >= this.B && M(this, n, h, L(q, d, r, e, g), a, c);
|
||||
h = l[g] + h, h.length >= this.B && P(this, n, h, O(q, d, r, e, g), a, c);
|
||||
}
|
||||
h = "";
|
||||
}
|
||||
case "forward":
|
||||
if (1 < e) {
|
||||
for (g = 0; g < e; g++) {
|
||||
h += l[g], h.length >= this.B && M(this, n, h, f, a, c);
|
||||
h += l[g], h.length >= this.B && P(this, n, h, f, a, c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (this.C && (f = Math.min(f / this.C(b, l, r) | 0, q - 1)), M(this, n, l, f, a, c), w && 1 < d && r < d - 1) {
|
||||
for (e = v(), h = this.A, f = l, g = Math.min(w + 1, d - r), e[f] = 1, k = 1; k < g; k++) {
|
||||
if (this.C && (f = Math.min(f / this.C(b, l, r) | 0, q - 1)), P(this, n, l, f, a, c), w && 1 < d && r < d - 1) {
|
||||
for (e = x(), h = this.A, f = l, g = Math.min(w + 1, d - r), e[f] = 1, k = 1; k < g; k++) {
|
||||
if ((l = b[this.F ? d - 1 - r - k : r + k]) && l.length >= this.B && !e[l]) {
|
||||
e[l] = 1;
|
||||
const p = this.l && l > f;
|
||||
M(this, m, p ? f : l, L(h + (d / 2 > h ? 0 : 1), d, r, g - 1, k - 1), a, c, p ? l : f);
|
||||
P(this, m, p ? f : l, O(h + (d / 2 > h ? 0 : 1), d, r, g - 1, k - 1), a, c, p ? l : f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -333,17 +333,17 @@ t.add = function(a, b, c, d) {
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function L(a, b, c, d, e) {
|
||||
function O(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 M(a, b, c, d, e, f, h) {
|
||||
function P(a, b, c, d, e, f, h) {
|
||||
let g = h ? a.h : a.map;
|
||||
if (!b[c] || h && !b[c][h]) {
|
||||
a.s && (g = g[d]), h ? (b = b[c] || (b[c] = v()), b[h] = 1, g = g[h] || (g[h] = v())) : b[c] = 1, g = g[c] || (g[c] = []), a.s || (g = g[d] || (g[d] = [])), f && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g));
|
||||
a.s && (g = g[d]), h ? (b = b[c] || (b[c] = x()), b[h] = 1, g = g[h] || (g[h] = x())) : b[c] = 1, g = g[c] || (g[c] = []), a.s || (g = g[d] || (g[d] = [])), f && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g));
|
||||
}
|
||||
}
|
||||
t.search = function(a, b, c) {
|
||||
c || (!b && C(a) ? (c = a, a = c.query) : C(b) && (c = b));
|
||||
c || (!b && D(a) ? (c = a, a = c.query) : D(b) && (c = b));
|
||||
let d = [], e;
|
||||
let f, h = 0;
|
||||
if (c) {
|
||||
@@ -354,7 +354,7 @@ t.search = function(a, b, c) {
|
||||
f = c.suggest;
|
||||
}
|
||||
if (a && (a = this.encode("" + a), e = a.length, 1 < e)) {
|
||||
c = v();
|
||||
c = x();
|
||||
var k = [];
|
||||
for (let n = 0, w = 0, q; n < e; n++) {
|
||||
if ((q = a[n]) && q.length >= this.B && !c[q]) {
|
||||
@@ -375,10 +375,10 @@ t.search = function(a, b, c) {
|
||||
g = this.depth && 1 < e && !1 !== g;
|
||||
c = 0;
|
||||
let m;
|
||||
g ? (m = a[0], c = 1) : 1 < e && a.sort(ba);
|
||||
g ? (m = a[0], c = 1) : 1 < e && a.sort(aa);
|
||||
for (let n, w; c < e; c++) {
|
||||
w = a[c];
|
||||
g ? (n = sa(this, d, f, b, h, 2 === e, w, m), f && !1 === n && d.length || (m = w)) : n = sa(this, d, f, b, h, 1 === e, w);
|
||||
g ? (n = pa(this, d, f, b, h, 2 === e, w, m), f && !1 === n && d.length || (m = w)) : n = pa(this, d, f, b, h, 1 === e, w);
|
||||
if (n) {
|
||||
return n;
|
||||
}
|
||||
@@ -393,28 +393,28 @@ t.search = function(a, b, c) {
|
||||
return d;
|
||||
}
|
||||
if (1 === k) {
|
||||
return ta(d[0], b, h);
|
||||
return qa(d[0], b, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ma(d, b, h, f);
|
||||
return ja(d, b, h, f);
|
||||
};
|
||||
function sa(a, b, c, d, e, f, h, g) {
|
||||
function pa(a, b, c, d, e, f, h, g) {
|
||||
let k = [], m = g ? a.h : a.map;
|
||||
a.s || (m = ua(m, h, g, a.l));
|
||||
a.s || (m = ra(m, h, g, a.l));
|
||||
if (m) {
|
||||
let n = 0;
|
||||
const w = Math.min(m.length, g ? a.A : a.D);
|
||||
for (let q = 0, r = 0, l, p; q < w; q++) {
|
||||
if (l = m[q]) {
|
||||
if (a.s && (l = ua(l, h, g, a.l)), e && l && f && (p = l.length, p <= e ? (e -= p, l = null) : (l = l.slice(e), e = 0)), l && (k[n++] = l, f && (r += l.length, r >= d))) {
|
||||
if (a.s && (l = ra(l, h, g, a.l)), e && l && f && (p = l.length, p <= e ? (e -= p, l = null) : (l = l.slice(e), e = 0)), l && (k[n++] = l, f && (r += l.length, r >= d))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (n) {
|
||||
if (f) {
|
||||
return ta(k, d, 0);
|
||||
return qa(k, d, 0);
|
||||
}
|
||||
b[b.length] = k;
|
||||
return;
|
||||
@@ -422,11 +422,11 @@ function sa(a, b, c, d, e, f, h, g) {
|
||||
}
|
||||
return !c && k;
|
||||
}
|
||||
function ta(a, b, c) {
|
||||
function qa(a, b, c) {
|
||||
a = 1 === a.length ? a[0] : [].concat.apply([], a);
|
||||
return c || a.length > b ? a.slice(c, c + b) : a;
|
||||
}
|
||||
function ua(a, b, c, d) {
|
||||
function ra(a, b, c, d) {
|
||||
c ? (d = d && b > c, a = (a = a[d ? b : c]) && a[d ? c : b]) : a = a[b];
|
||||
return a;
|
||||
}
|
||||
@@ -444,7 +444,7 @@ t.remove = function(a, b) {
|
||||
e = c[d], e.splice(e.indexOf(a), 1);
|
||||
}
|
||||
} else {
|
||||
N(this.map, a, this.D, this.s), this.depth && N(this.h, a, this.A, this.s);
|
||||
Q(this.map, a, this.D, this.s), this.depth && Q(this.h, a, this.A, this.s);
|
||||
}
|
||||
b || delete this.register[a];
|
||||
if (this.cache) {
|
||||
@@ -456,7 +456,7 @@ t.remove = function(a, b) {
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function N(a, b, c, d, e) {
|
||||
function Q(a, b, c, d, e) {
|
||||
let f = 0;
|
||||
if (a.constructor === Array) {
|
||||
if (e) {
|
||||
@@ -465,18 +465,18 @@ function N(a, b, c, d, e) {
|
||||
e = Math.min(a.length, c);
|
||||
for (let h = 0, g; h < e; h++) {
|
||||
if (g = a[h]) {
|
||||
f = N(g, b, c, d, e), d || f || delete a[h];
|
||||
f = Q(g, b, c, d, e), d || f || delete a[h];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let h in a) {
|
||||
(f = N(a[h], b, c, d, e)) || delete a[h];
|
||||
(f = Q(a[h], b, c, d, e)) || delete a[h];
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
t.searchCache = oa;
|
||||
t.searchCache = la;
|
||||
t.export = function(a, b, c, d, e, f) {
|
||||
let h = !0;
|
||||
"undefined" === typeof f && (h = new Promise(m => {
|
||||
@@ -487,7 +487,7 @@ t.export = function(a, b, c, d, e, f) {
|
||||
case 0:
|
||||
g = "reg";
|
||||
if (this.m) {
|
||||
k = v();
|
||||
k = x();
|
||||
for (let m in this.register) {
|
||||
k[m] = 1;
|
||||
}
|
||||
@@ -511,12 +511,12 @@ t.export = function(a, b, c, d, e, f) {
|
||||
"undefined" === typeof c && f && f();
|
||||
return;
|
||||
}
|
||||
ra(a, b || this, c, g, d, e, k, f);
|
||||
oa(a, b || this, c, g, d, e, k, f);
|
||||
return h;
|
||||
};
|
||||
t.import = function(a, b) {
|
||||
if (b) {
|
||||
switch(x(b) && (b = JSON.parse(b)), a) {
|
||||
switch(C(b) && (b = JSON.parse(b)), a) {
|
||||
case "cfg":
|
||||
this.s = !!b.opt;
|
||||
break;
|
||||
@@ -532,8 +532,8 @@ t.import = function(a, b) {
|
||||
}
|
||||
}
|
||||
};
|
||||
la(K.prototype);
|
||||
function va(a) {
|
||||
ia(N.prototype);
|
||||
function sa(a) {
|
||||
a = a.data;
|
||||
var b = self._index;
|
||||
const c = a.args;
|
||||
@@ -545,23 +545,23 @@ function va(a) {
|
||||
b = d.encode;
|
||||
d.cache = !1;
|
||||
b && 0 === b.indexOf("function") && (d.encode = Function("return " + b)());
|
||||
a ? (Function("return " + a)()(self), self._index = new self.FlexSearch.Index(d), delete self.FlexSearch) : self._index = new K(d);
|
||||
a ? (Function("return " + a)()(self), self._index = new self.FlexSearch.Index(d), delete self.FlexSearch) : self._index = new N(d);
|
||||
break;
|
||||
default:
|
||||
a = a.id, b = b[d].apply(b, c), postMessage("search" === d ? {id:a, msg:b} : {id:a});
|
||||
}
|
||||
}
|
||||
;let wa = 0;
|
||||
function O(a) {
|
||||
if (!(this instanceof O)) {
|
||||
return new O(a);
|
||||
;let ta = 0;
|
||||
function S(a) {
|
||||
if (!(this instanceof S)) {
|
||||
return new S(a);
|
||||
}
|
||||
var b;
|
||||
a ? D(b = a.encode) && (a.encode = b.toString()) : a = {};
|
||||
a ? E(b = a.encode) && (a.encode = b.toString()) : a = {};
|
||||
(b = (self || window)._factory) && (b = b.toString());
|
||||
const c = "undefined" === typeof window && self.exports, d = this;
|
||||
this.o = xa(b, c, a.worker);
|
||||
this.h = v();
|
||||
this.o = ua(b, c, a.worker);
|
||||
this.h = x();
|
||||
if (this.o) {
|
||||
if (c) {
|
||||
this.o.on("message", function(e) {
|
||||
@@ -578,67 +578,67 @@ function O(a) {
|
||||
this.o.postMessage({task:"init", factory:b, options:a});
|
||||
}
|
||||
}
|
||||
P("add");
|
||||
P("append");
|
||||
P("search");
|
||||
P("update");
|
||||
P("remove");
|
||||
function P(a) {
|
||||
O.prototype[a] = O.prototype[a + "Async"] = function() {
|
||||
T("add");
|
||||
T("append");
|
||||
T("search");
|
||||
T("update");
|
||||
T("remove");
|
||||
function T(a) {
|
||||
S.prototype[a] = S.prototype[a + "Async"] = function() {
|
||||
const b = this, c = [].slice.call(arguments);
|
||||
var d = c[c.length - 1];
|
||||
let e;
|
||||
D(d) && (e = d, c.splice(c.length - 1, 1));
|
||||
E(d) && (e = d, c.splice(c.length - 1, 1));
|
||||
d = new Promise(function(f) {
|
||||
setTimeout(function() {
|
||||
b.h[++wa] = f;
|
||||
b.o.postMessage({task:a, id:wa, args:c});
|
||||
b.h[++ta] = f;
|
||||
b.o.postMessage({task:a, id:ta, args:c});
|
||||
});
|
||||
});
|
||||
return e ? (d.then(e), this) : d;
|
||||
};
|
||||
}
|
||||
function xa(a, b, c) {
|
||||
function ua(a, b, c) {
|
||||
let d;
|
||||
try {
|
||||
d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + va.toString()], {type:"text/javascript"}))) : new Worker(x(c) ? c : "worker/worker.js", {type:"module"});
|
||||
d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + sa.toString()], {type:"text/javascript"}))) : new Worker(C(c) ? c : "worker/worker.js", {type:"module"});
|
||||
} catch (e) {
|
||||
}
|
||||
return d;
|
||||
}
|
||||
;function Q(a) {
|
||||
if (!(this instanceof Q)) {
|
||||
return new Q(a);
|
||||
;function U(a) {
|
||||
if (!(this instanceof U)) {
|
||||
return new U(a);
|
||||
}
|
||||
var b = a.document || a.doc || a, c;
|
||||
this.K = [];
|
||||
this.h = [];
|
||||
this.A = [];
|
||||
this.register = v();
|
||||
this.key = (c = b.key || b.id) && S(c, this.A) || "id";
|
||||
this.register = x();
|
||||
this.key = (c = b.key || b.id) && V(c, this.A) || "id";
|
||||
this.m = u(a.fastupdate);
|
||||
this.C = (c = b.store) && !0 !== c && [];
|
||||
this.store = c && v();
|
||||
this.I = (c = b.tag) && S(c, this.A);
|
||||
this.l = c && v();
|
||||
this.cache = (c = a.cache) && new J(c);
|
||||
this.store = c && x();
|
||||
this.I = (c = b.tag) && V(c, this.A);
|
||||
this.l = c && x();
|
||||
this.cache = (c = a.cache) && new M(c);
|
||||
a.cache = !1;
|
||||
this.o = a.worker;
|
||||
this.async = !1;
|
||||
c = v();
|
||||
c = x();
|
||||
let d = b.index || b.field || b;
|
||||
x(d) && (d = [d]);
|
||||
C(d) && (d = [d]);
|
||||
for (let e = 0, f, h; e < d.length; e++) {
|
||||
f = d[e], x(f) || (h = f, f = f.field), h = C(h) ? Object.assign({}, a, h) : a, this.o && (c[f] = new O(h), c[f].o || (this.o = !1)), this.o || (c[f] = new K(h, this.register)), this.K[e] = S(f, this.A), this.h[e] = f;
|
||||
f = d[e], C(f) || (h = f, f = f.field), h = D(h) ? Object.assign({}, a, h) : a, this.o && (c[f] = new S(h), c[f].o || (this.o = !1)), this.o || (c[f] = new N(h, this.register)), this.K[e] = V(f, this.A), this.h[e] = f;
|
||||
}
|
||||
if (this.C) {
|
||||
for (a = b.store, x(a) && (a = [a]), b = 0; b < a.length; b++) {
|
||||
this.C[b] = S(a[b], this.A);
|
||||
for (a = b.store, C(a) && (a = [a]), b = 0; b < a.length; b++) {
|
||||
this.C[b] = V(a[b], this.A);
|
||||
}
|
||||
}
|
||||
this.index = c;
|
||||
}
|
||||
function S(a, b) {
|
||||
function V(a, b) {
|
||||
const c = a.split(":");
|
||||
let d = 0;
|
||||
for (let e = 0; e < c.length; e++) {
|
||||
@@ -647,8 +647,8 @@ function S(a, b) {
|
||||
d < c.length && (c.length = d);
|
||||
return 1 < d ? c : c[0];
|
||||
}
|
||||
function T(a, b) {
|
||||
if (x(b)) {
|
||||
function X(a, b) {
|
||||
if (C(b)) {
|
||||
a = a[b];
|
||||
} else {
|
||||
for (let c = 0; a && c < b.length; c++) {
|
||||
@@ -657,21 +657,21 @@ function T(a, b) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
function U(a, b, c, d, e) {
|
||||
function Y(a, b, c, d, e) {
|
||||
a = a[e];
|
||||
if (d === c.length - 1) {
|
||||
b[e] = a;
|
||||
} else if (a) {
|
||||
if (a.constructor === Array) {
|
||||
for (b = b[e] = Array(a.length), e = 0; e < a.length; e++) {
|
||||
U(a, b, c, d, e);
|
||||
Y(a, b, c, d, e);
|
||||
}
|
||||
} else {
|
||||
b = b[e] || (b[e] = v()), e = c[++d], U(a, b, c, d, e);
|
||||
b = b[e] || (b[e] = x()), e = c[++d], Y(a, b, c, d, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
function V(a, b, c, d, e, f, h, g) {
|
||||
function Z(a, b, c, d, e, f, h, g) {
|
||||
if (a = a[h]) {
|
||||
if (d === b.length - 1) {
|
||||
if (a.constructor === Array) {
|
||||
@@ -687,27 +687,27 @@ function V(a, b, c, d, e, f, h, g) {
|
||||
} else {
|
||||
if (a.constructor === Array) {
|
||||
for (h = 0; h < a.length; h++) {
|
||||
V(a, b, c, d, e, f, h, g);
|
||||
Z(a, b, c, d, e, f, h, g);
|
||||
}
|
||||
} else {
|
||||
h = b[++d], V(a, b, c, d, e, f, h, g);
|
||||
h = b[++d], Z(a, b, c, d, e, f, h, g);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
t = Q.prototype;
|
||||
t = U.prototype;
|
||||
t.add = function(a, b, c) {
|
||||
C(a) && (b = a, a = T(b, this.key));
|
||||
D(a) && (b = a, a = X(b, this.key));
|
||||
if (b && (a || 0 === a)) {
|
||||
if (!c && this.register[a]) {
|
||||
return this.update(a, b);
|
||||
}
|
||||
for (let d = 0, e, f; d < this.h.length; d++) {
|
||||
f = this.h[d], e = this.K[d], x(e) && (e = [e]), V(b, e, this.A, 0, this.index[f], a, e[0], c);
|
||||
f = this.h[d], e = this.K[d], C(e) && (e = [e]), Z(b, e, this.A, 0, this.index[f], a, e[0], c);
|
||||
}
|
||||
if (this.I) {
|
||||
let d = T(b, this.I), e = v();
|
||||
x(d) && (d = [d]);
|
||||
let d = X(b, this.I), e = x();
|
||||
C(d) && (d = [d]);
|
||||
for (let f = 0, h, g; f < d.length; f++) {
|
||||
if (h = d[f], !e[h] && (e[h] = 1, g = this.l[h] || (this.l[h] = []), !c || !g.includes(a))) {
|
||||
if (g[g.length] = a, this.m) {
|
||||
@@ -720,9 +720,9 @@ t.add = function(a, b, c) {
|
||||
if (this.store && (!c || !this.store[a])) {
|
||||
let d;
|
||||
if (this.C) {
|
||||
d = v();
|
||||
d = x();
|
||||
for (let e = 0, f; e < this.C.length; e++) {
|
||||
f = this.C[e], x(f) ? d[f] = b[f] : U(b, d, f, 0, f[0]);
|
||||
f = this.C[e], C(f) ? d[f] = b[f] : Y(b, d, f, 0, f[0]);
|
||||
}
|
||||
}
|
||||
this.store[a] = d || b;
|
||||
@@ -737,7 +737,7 @@ t.update = function(a, b) {
|
||||
return this.remove(a).add(a, b);
|
||||
};
|
||||
t.remove = function(a) {
|
||||
C(a) && (a = T(a, this.key));
|
||||
D(a) && (a = X(a, this.key));
|
||||
if (this.register[a]) {
|
||||
for (var b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.o), !this.m); b++) {
|
||||
}
|
||||
@@ -754,7 +754,7 @@ t.remove = function(a) {
|
||||
return this;
|
||||
};
|
||||
t.search = function(a, b, c, d) {
|
||||
c || (!b && C(a) ? (c = a, a = "") : C(b) && (c = b, b = 0));
|
||||
c || (!b && D(a) ? (c = a, a = "") : D(b) && (c = b, b = 0));
|
||||
let e = [], f = [], h, g, k, m, n, w, q = 0;
|
||||
if (c) {
|
||||
if (c.constructor === Array) {
|
||||
@@ -767,15 +767,15 @@ t.search = function(a, b, c, d) {
|
||||
n = "and" === c.bool;
|
||||
b = c.limit || b || 100;
|
||||
w = c.offset || 0;
|
||||
if (m && (x(m) && (m = [m]), !a)) {
|
||||
if (m && (C(m) && (m = [m]), !a)) {
|
||||
for (let l = 0, p; l < m.length; l++) {
|
||||
if (p = ya.call(this, m[l], b, w, g)) {
|
||||
if (p = va.call(this, m[l], b, w, g)) {
|
||||
e[e.length] = p, q++;
|
||||
}
|
||||
}
|
||||
return q ? e : [];
|
||||
}
|
||||
x(k) && (k = [k]);
|
||||
C(k) && (k = [k]);
|
||||
}
|
||||
}
|
||||
k || (k = this.h);
|
||||
@@ -784,7 +784,7 @@ t.search = function(a, b, c, d) {
|
||||
for (let l = 0, p, A, B; l < k.length; l++) {
|
||||
let z;
|
||||
A = k[l];
|
||||
x(A) || (z = A, A = z.field, a = z.query || a, b = z.limit || b, g = z.enrich || g);
|
||||
C(A) || (z = A, A = z.field, a = z.query || a, b = z.limit || b, g = z.enrich || g);
|
||||
if (r) {
|
||||
r[l] = this.index[A].searchAsync(a, b, z || c);
|
||||
} else {
|
||||
@@ -794,12 +794,12 @@ t.search = function(a, b, c, d) {
|
||||
const y = [];
|
||||
let H = 0;
|
||||
n && (y[0] = [p]);
|
||||
for (let X = 0, qa, R; X < m.length; X++) {
|
||||
if (qa = m[X], B = (R = this.l[qa]) && R.length) {
|
||||
for (let W = 0, na, R; W < m.length; W++) {
|
||||
if (na = m[W], B = (R = this.l[na]) && R.length) {
|
||||
H++, y[y.length] = n ? [R] : R;
|
||||
}
|
||||
}
|
||||
H && (p = n ? ma(y, b || 100, w || 0) : na(p, y), B = p.length);
|
||||
H && (p = n ? ja(y, b || 100, w || 0) : ka(p, y), B = p.length);
|
||||
}
|
||||
if (B) {
|
||||
f[q] = A, e[q++] = p;
|
||||
@@ -824,7 +824,7 @@ t.search = function(a, b, c, d) {
|
||||
}
|
||||
for (let l = 0, p; l < f.length; l++) {
|
||||
p = e[l];
|
||||
p.length && g && (p = za.call(this, p));
|
||||
p.length && g && (p = wa.call(this, p));
|
||||
if (h) {
|
||||
return p;
|
||||
}
|
||||
@@ -832,17 +832,17 @@ t.search = function(a, b, c, d) {
|
||||
}
|
||||
return e;
|
||||
};
|
||||
function ya(a, b, c, d) {
|
||||
function va(a, b, c, d) {
|
||||
let e = this.l[a], f = e && e.length - c;
|
||||
if (f && 0 < f) {
|
||||
if (f > b || c) {
|
||||
e = e.slice(c, c + b);
|
||||
}
|
||||
d && (e = za.call(this, e));
|
||||
d && (e = wa.call(this, e));
|
||||
return {tag:a, result:e};
|
||||
}
|
||||
}
|
||||
function za(a) {
|
||||
function wa(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[d]};
|
||||
@@ -859,7 +859,7 @@ t.set = function(a, b) {
|
||||
this.store[a] = b;
|
||||
return this;
|
||||
};
|
||||
t.searchCache = oa;
|
||||
t.searchCache = la;
|
||||
t.export = function(a, b, c, d, e, f) {
|
||||
let h;
|
||||
"undefined" === typeof f && (h = new Promise(g => {
|
||||
@@ -890,13 +890,13 @@ t.export = function(a, b, c, d, e, f) {
|
||||
f();
|
||||
return;
|
||||
}
|
||||
ra(a, this, c, g, d, e, k, f);
|
||||
oa(a, this, c, g, d, e, k, f);
|
||||
}
|
||||
return h;
|
||||
};
|
||||
t.import = function(a, b) {
|
||||
if (b) {
|
||||
switch(x(b) && (b = JSON.parse(b)), a) {
|
||||
switch(C(b) && (b = JSON.parse(b)), a) {
|
||||
case "tag":
|
||||
this.l = b;
|
||||
break;
|
||||
@@ -918,28 +918,28 @@ t.import = function(a, b) {
|
||||
}
|
||||
}
|
||||
};
|
||||
la(Q.prototype);
|
||||
var Ba = {encode:Aa, F:!1, G:""};
|
||||
const Ca = [F("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", F("[\u00e8\u00e9\u00ea\u00eb]"), "e", F("[\u00ec\u00ed\u00ee\u00ef]"), "i", F("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", F("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", F("[\u00fd\u0177\u00ff]"), "y", F("\u00f1"), "n", F("[\u00e7c]"), "k", F("\u00df"), "s", F(" & "), " and "];
|
||||
function Aa(a) {
|
||||
ia(U.prototype);
|
||||
var ya = {encode:xa, F:!1, G:""};
|
||||
const za = [J("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", J("[\u00e8\u00e9\u00ea\u00eb]"), "e", J("[\u00ec\u00ed\u00ee\u00ef]"), "i", J("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", J("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", J("[\u00fd\u0177\u00ff]"), "y", J("\u00f1"), "n", J("[\u00e7c]"), "k", J("\u00df"), "s", J(" & "), " and "];
|
||||
function xa(a) {
|
||||
var b = a = "" + a;
|
||||
b.normalize && (b = b.normalize("NFD").replace(ea, ""));
|
||||
return ca.call(this, b.toLowerCase(), !a.normalize && Ca);
|
||||
b.normalize && (b = b.normalize("NFD").replace(ca, ""));
|
||||
return F.call(this, b.toLowerCase(), !a.normalize && za);
|
||||
}
|
||||
;var Ea = {encode:Da, F:!1, G:"strict"};
|
||||
const Fa = /[^a-z0-9]+/, Ga = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function Da(a) {
|
||||
a = Aa.call(this, a).join(" ");
|
||||
;var Ba = {encode:Aa, F:!1, G:"strict"};
|
||||
const Ca = /[^a-z0-9]+/, Da = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function Aa(a) {
|
||||
a = xa.call(this, a).join(" ");
|
||||
const b = [];
|
||||
if (a) {
|
||||
const c = a.split(Fa), d = c.length;
|
||||
const c = a.split(Ca), d = c.length;
|
||||
for (let e = 0, f, h = 0; e < d; e++) {
|
||||
if ((a = c[e]) && (!this.filter || !this.filter[a])) {
|
||||
f = a[0];
|
||||
let g = Ga[f] || f, k = g;
|
||||
let g = Da[f] || f, k = g;
|
||||
for (let m = 1; m < a.length; m++) {
|
||||
f = a[m];
|
||||
const n = Ga[f] || f;
|
||||
const n = Da[f] || f;
|
||||
n && n !== k && (g += n, k = n);
|
||||
}
|
||||
b[h++] = g;
|
||||
@@ -948,31 +948,26 @@ function Da(a) {
|
||||
}
|
||||
return b;
|
||||
}
|
||||
;var Fa = {encode:Ea, F:!1, G:""};
|
||||
const Ga = [J("ae"), "a", J("oe"), "o", J("sh"), "s", J("th"), "t", J("ph"), "f", J("pf"), "f", J("(?![aeo])h(?![aeo])"), "", J("(?!^[aeo])h(?!^[aeo])"), ""];
|
||||
function Ea(a, b) {
|
||||
a && (a = Aa.call(this, a).join(" "), 2 < a.length && (a = G(a, Ga)), b || (1 < a.length && (a = da(a)), a && (a = a.split(" "))));
|
||||
return a || [];
|
||||
}
|
||||
;var Ia = {encode:Ha, F:!1, G:""};
|
||||
const Ja = [F("ae"), "a", F("oe"), "o", F("sh"), "s", F("th"), "t", F("ph"), "f", F("pf"), "f", F("(?![aeo])h(?![aeo])"), "", F("(?!^[aeo])h(?!^[aeo])"), ""];
|
||||
function Ha(a, b) {
|
||||
a && (a = Da.call(this, a).join(" "), 2 < a.length && (a = E(a, Ja)), b || (1 < a.length && (a = ha(a)), a && (a = a.split(" "))));
|
||||
const Ja = J("(?!\\b)[aeo]");
|
||||
function Ha(a) {
|
||||
a && (a = Ea.call(this, a, !0), 1 < a.length && (a = a.replace(Ja, "")), 1 < a.length && (a = da(a)), a && (a = a.split(" ")));
|
||||
return a || [];
|
||||
}
|
||||
;var La = {encode:Ka, F:!1, G:""};
|
||||
const Ma = F("(?!\\b)[aeo]");
|
||||
function Ka(a) {
|
||||
a && (a = Ha.call(this, a, !0), 1 < a.length && (a = a.replace(Ma, "")), 1 < a.length && (a = ha(a)), a && (a = a.split(" ")));
|
||||
return a || [];
|
||||
}
|
||||
;G["latin:default"] = ja;
|
||||
G["latin:simple"] = Ba;
|
||||
G["latin:balance"] = Ea;
|
||||
G["latin:advanced"] = Ia;
|
||||
G["latin:extra"] = La;
|
||||
const W = self;
|
||||
let Y;
|
||||
const Z = {Index:K, Document:Q, Worker:O, registerCharset:function(a, b) {
|
||||
G[a] = b;
|
||||
;K["latin:default"] = fa;
|
||||
K["latin:simple"] = ya;
|
||||
K["latin:balance"] = Ba;
|
||||
K["latin:advanced"] = Fa;
|
||||
K["latin:extra"] = Ia;
|
||||
export default {Index:N, Document:U, Worker:S, registerCharset:function(a, b) {
|
||||
K[a] = b;
|
||||
}, registerLanguage:function(a, b) {
|
||||
ka[a] = b;
|
||||
ha[a] = b;
|
||||
}};
|
||||
(Y = W.define) && Y.amd ? Y([], function() {
|
||||
return Z;
|
||||
}) : W.exports ? W.exports = Z : W.FlexSearch = Z;
|
||||
|
||||
|
56
dist/flexsearch.bundle.module.min.js
vendored
56
dist/flexsearch.bundle.module.min.js
vendored
@@ -1,34 +1,34 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Bundle.module)
|
||||
* FlexSearch.js v0.7.40 (Bundle.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
var t;function u(a){return"undefined"!==typeof a?a:!0}function aa(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=v();return b}function v(){return Object.create(null)}function ba(a,b){return b.length-a.length}function x(a){return"string"===typeof a}function C(a){return"object"===typeof a}function D(a){return"function"===typeof a};function ca(a,b){var c=da;if(a&&(b&&(a=E(a,b)),this.H&&(a=E(a,this.H)),this.J&&1<a.length&&(a=E(a,this.J)),c||""===c)){b=a.split(c);if(this.filter){a=this.filter;c=b.length;const d=[];for(let e=0,f=0;e<c;e++){const h=b[e];h&&!a[h]&&(d[f++]=h)}a=d}else a=b;return a}return a}const da=/[\p{Z}\p{S}\p{P}\p{C}]+/u,ea=/[\u0300-\u036f]/g;
|
||||
function fa(a,b){const c=Object.keys(a),d=c.length,e=[];let f="",h=0;for(let g=0,k,m;g<d;g++)k=c[g],(m=a[k])?(e[h++]=F(b?"(?!\\b)"+k+"(\\b|_)":k),e[h++]=m):f+=(f?"|":"")+k;f&&(e[h++]=F(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),e[h]="");return e}function E(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function F(a){return new RegExp(a,"g")}function ha(a){let b="",c="";for(let d=0,e=a.length,f;d<e;d++)(f=a[d])!==c&&(b+=c=f);return b};var ja={encode:ia,F:!1,G:""};function ia(a){return ca.call(this,(""+a).toLowerCase(),!1)};const ka={},G={};function la(a){I(a,"add");I(a,"append");I(a,"search");I(a,"update");I(a,"remove")}function I(a,b){a[b+"Async"]=function(){const c=this,d=arguments;var e=d[d.length-1];let f;D(e)&&(f=e,delete d[d.length-1]);e=new Promise(function(h){setTimeout(function(){c.async=!0;const g=c[b].apply(c,d);c.async=!1;h(g)})});return f?(e.then(f),this):e}};function ma(a,b,c,d){const e=a.length;let f=[],h,g,k=0;d&&(d=[]);for(let m=e-1;0<=m;m--){const n=a[m],w=n.length,q=v();let r=!h;for(let l=0;l<w;l++){const p=n[l],A=p.length;if(A)for(let B=0,z,y;B<A;B++)if(y=p[B],h){if(h[y]){if(!m)if(c)c--;else if(f[k++]=y,k===b)return f;if(m||d)q[y]=1;r=!0}if(d&&(z=(g[y]||0)+1,g[y]=z,z<e)){const H=d[z-2]||(d[z-2]=[]);H[H.length]=y}}else q[y]=1}if(d)h||(g=q);else if(!r)return[];h=q}if(d)for(let m=d.length-1,n,w;0<=m;m--){n=d[m];w=n.length;for(let q=0,r;q<w;q++)if(r=
|
||||
n[q],!h[r]){if(c)c--;else if(f[k++]=r,k===b)return f;h[r]=1}}return f}function na(a,b){const c=v(),d=v(),e=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,h;f<b.length;f++){h=b[f];for(let g=0,k;g<h.length;g++)k=h[g],c[k]&&!d[k]&&(d[k]=1,e[e.length]=k)}return e};function J(a){this.l=!0!==a&&a;this.cache=v();this.h=[]}function oa(a,b,c){C(a)&&(a=a.query);let d=this.cache.get(a);d||(d=this.search(a,b,c),this.cache.set(a,d));return d}J.prototype.set=function(a,b){if(!this.cache[a]){var c=this.h.length;c===this.l?delete this.cache[this.h[c-1]]:c++;for(--c;0<c;c--)this.h[c]=this.h[c-1];this.h[0]=a}this.cache[a]=b};J.prototype.get=function(a){const b=this.cache[a];if(this.l&&b&&(a=this.h.indexOf(a))){const c=this.h[a-1];this.h[a-1]=this.h[a];this.h[a]=c}return b};const qa={memory:{charset:"latin:extra",D:3,B:4,m:!1},performance:{D:3,B:3,s:!1,context:{depth:2,D:1}},match:{charset:"latin:extra",G:"reverse"},score:{charset:"latin:advanced",D:20,B:3,context:{depth:3,D:9}},"default":{}};function ra(a,b,c,d,e,f,h,g){setTimeout(function(){const k=a(c?c+"."+d:d,JSON.stringify(h));k&&k.then?k.then(function(){b.export(a,b,c,e,f+1,g)}):b.export(a,b,c,e,f+1,g)})};function K(a,b){if(!(this instanceof K))return new K(a);var c;if(a){x(a)?a=qa[a]:(c=a.preset)&&(a=Object.assign({},c[c],a));c=a.charset;var d=a.lang;x(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=G[c]);x(d)&&(d=ka[d])}else a={};let e,f,h=a.context||{};this.encode=a.encode||c&&c.encode||ia;this.register=b||v();this.D=e=a.resolution||9;this.G=b=c&&c.G||a.tokenize||"strict";this.depth="strict"===b&&h.depth;this.l=u(h.bidirectional);this.s=f=u(a.optimize);this.m=u(a.fastupdate);this.B=a.minlength||1;this.C=
|
||||
a.boost;this.map=f?aa(e):v();this.A=e=h.resolution||1;this.h=f?aa(e):v();this.F=c&&c.F||a.rtl;this.H=(b=a.matcher||d&&d.H)&&fa(b,!1);this.J=(b=a.stemmer||d&&d.J)&&fa(b,!0);if(c=b=a.filter||d&&d.filter){c=b;d=v();for(let g=0,k=c.length;g<k;g++)d[c[g]]=1;c=d}this.filter=c;this.cache=(b=a.cache)&&new J(b)}t=K.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(d=b.length){const m=v(),n=v(),w=this.depth,q=this.D;for(let r=0;r<d;r++){let l=b[this.F?d-1-r:r];var e=l.length;if(l&&e>=this.B&&(w||!n[l])){var f=L(q,d,r),h="";switch(this.G){case "full":if(2<e){for(f=0;f<e;f++)for(var g=e;g>f;g--)if(g-f>=this.B){var k=L(q,d,r,e,f);h=l.substring(f,g);M(this,n,h,k,a,c)}break}case "reverse":if(1<e){for(g=e-1;0<g;g--)h=l[g]+h,h.length>=this.B&&M(this,n,
|
||||
h,L(q,d,r,e,g),a,c);h=""}case "forward":if(1<e){for(g=0;g<e;g++)h+=l[g],h.length>=this.B&&M(this,n,h,f,a,c);break}default:if(this.C&&(f=Math.min(f/this.C(b,l,r)|0,q-1)),M(this,n,l,f,a,c),w&&1<d&&r<d-1)for(e=v(),h=this.A,f=l,g=Math.min(w+1,d-r),e[f]=1,k=1;k<g;k++)if((l=b[this.F?d-1-r-k:r+k])&&l.length>=this.B&&!e[l]){e[l]=1;const p=this.l&&l>f;M(this,m,p?f:l,L(h+(d/2>h?0:1),d,r,g-1,k-1),a,c,p?l:f)}}}}this.m||(this.register[a]=1)}}return this};
|
||||
function L(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 M(a,b,c,d,e,f,h){let g=h?a.h:a.map;if(!b[c]||h&&!b[c][h])a.s&&(g=g[d]),h?(b=b[c]||(b[c]=v()),b[h]=1,g=g[h]||(g[h]=v())):b[c]=1,g=g[c]||(g[c]=[]),a.s||(g=g[d]||(g[d]=[])),f&&g.includes(e)||(g[g.length]=e,a.m&&(a=a.register[e]||(a.register[e]=[]),a[a.length]=g))}
|
||||
t.search=function(a,b,c){c||(!b&&C(a)?(c=a,a=c.query):C(b)&&(c=b));let d=[],e;let f,h=0;if(c){a=c.query||a;b=c.limit;h=c.offset||0;var g=c.context;f=c.suggest}if(a&&(a=this.encode(""+a),e=a.length,1<e)){c=v();var k=[];for(let n=0,w=0,q;n<e;n++)if((q=a[n])&&q.length>=this.B&&!c[q])if(this.s||f||this.map[q])k[w++]=q,c[q]=1;else return d;a=k;e=a.length}if(!e)return d;b||(b=100);g=this.depth&&1<e&&!1!==g;c=0;let m;g?(m=a[0],c=1):1<e&&a.sort(ba);for(let n,w;c<e;c++){w=a[c];g?(n=sa(this,d,f,b,h,2===e,w,
|
||||
m),f&&!1===n&&d.length||(m=w)):n=sa(this,d,f,b,h,1===e,w);if(n)return n;if(f&&c===e-1){k=d.length;if(!k){if(g){g=0;c=-1;continue}return d}if(1===k)return ta(d[0],b,h)}}return ma(d,b,h,f)};
|
||||
function sa(a,b,c,d,e,f,h,g){let k=[],m=g?a.h:a.map;a.s||(m=ua(m,h,g,a.l));if(m){let n=0;const w=Math.min(m.length,g?a.A:a.D);for(let q=0,r=0,l,p;q<w;q++)if(l=m[q])if(a.s&&(l=ua(l,h,g,a.l)),e&&l&&f&&(p=l.length,p<=e?(e-=p,l=null):(l=l.slice(e),e=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=d)))break;if(n){if(f)return ta(k,d,0);b[b.length]=k;return}}return!c&&k}function ta(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function ua(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d<c.length;d++)e=c[d],e.splice(e.indexOf(a),1);else N(this.map,a,this.D,this.s),this.depth&&N(this.h,a,this.A,this.s);b||delete this.register[a];if(this.cache){b=this.cache;for(let d=0,e,f;d<b.h.length;d++)f=b.h[d],e=b.cache[f],e.includes(a)&&(b.h.splice(d--,1),delete b.cache[f])}}return this};
|
||||
function N(a,b,c,d,e){let f=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{e=Math.min(a.length,c);for(let h=0,g;h<e;h++)if(g=a[h])f=N(g,b,c,d,e),d||f||delete a[h]}else for(let h in a)(f=N(a[h],b,c,d,e))||delete a[h];return f}t.searchCache=oa;
|
||||
t.export=function(a,b,c,d,e,f){let h=!0;"undefined"===typeof f&&(h=new Promise(m=>{f=m}));let g,k;switch(e||(e=0)){case 0:g="reg";if(this.m){k=v();for(let m in this.register)k[m]=1}else k=this.register;break;case 1:g="cfg";k={doc:0,opt:this.s?1:0};break;case 2:g="map";k=this.map;break;case 3:g="ctx";k=this.h;break;default:"undefined"===typeof c&&f&&f();return}ra(a,b||this,c,g,d,e,k,f);return h};
|
||||
t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};la(K.prototype);function va(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new K(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let wa=0;function O(a){if(!(this instanceof O))return new O(a);var b;a?D(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c="undefined"===typeof window&&self.exports,d=this;this.o=xa(b,c,a.worker);this.h=v();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}P("add");P("append");P("search");
|
||||
P("update");P("remove");function P(a){O.prototype[a]=O.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;D(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++wa]=f;b.o.postMessage({task:a,id:wa,args:c})})});return e?(d.then(e),this):d}}
|
||||
function xa(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+va.toString()],{type:"text/javascript"}))):new Worker(x(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function Q(a){if(!(this instanceof Q))return new Q(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=v();this.key=(c=b.key||b.id)&&S(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&v();this.I=(c=b.tag)&&S(c,this.A);this.l=c&&v();this.cache=(c=a.cache)&&new J(c);a.cache=!1;this.o=a.worker;this.async=!1;c=v();let d=b.index||b.field||b;x(d)&&(d=[d]);for(let e=0,f,h;e<d.length;e++)f=d[e],x(f)||(h=f,f=f.field),h=C(h)?Object.assign({},a,h):a,
|
||||
this.o&&(c[f]=new O(h),c[f].o||(this.o=!1)),this.o||(c[f]=new K(h,this.register)),this.K[e]=S(f,this.A),this.h[e]=f;if(this.C)for(a=b.store,x(a)&&(a=[a]),b=0;b<a.length;b++)this.C[b]=S(a[b],this.A);this.index=c}function S(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],0<=a.indexOf("[]")&&(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]}function T(a,b){if(x(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function U(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)U(a,b,c,d,e);else b=b[e]||(b[e]=v()),e=c[++d],U(a,b,c,d,e)}function V(a,b,c,d,e,f,h,g){if(a=a[h])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,g,!0)}else if(a.constructor===Array)for(h=0;h<a.length;h++)V(a,b,c,d,e,f,h,g);else h=b[++d],V(a,b,c,d,e,f,h,g)}t=Q.prototype;
|
||||
t.add=function(a,b,c){C(a)&&(b=a,a=T(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let d=0,e,f;d<this.h.length;d++)f=this.h[d],e=this.K[d],x(e)&&(e=[e]),V(b,e,this.A,0,this.index[f],a,e[0],c);if(this.I){let d=T(b,this.I),e=v();x(d)&&(d=[d]);for(let f=0,h,g;f<d.length;f++)if(h=d[f],!e[h]&&(e[h]=1,g=this.l[h]||(this.l[h]=[]),!c||!g.includes(a)))if(g[g.length]=a,this.m){const k=this.register[a]||(this.register[a]=[]);k[k.length]=g}}if(this.store&&(!c||!this.store[a])){let d;
|
||||
if(this.C){d=v();for(let e=0,f;e<this.C.length;e++)f=this.C[e],x(f)?d[f]=b[f]:U(b,d,f,0,f[0])}this.store[a]=d||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){C(a)&&(a=T(a,this.key));if(this.register[a]){for(var b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.o),!this.m);b++);if(this.I&&!this.m)for(let c in this.l){b=this.l[c];const d=b.indexOf(a);-1!==d&&(1<b.length?b.splice(d,1):delete this.l[c])}this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,d){c||(!b&&C(a)?(c=a,a=""):C(b)&&(c=b,b=0));let e=[],f=[],h,g,k,m,n,w,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{a=c.query||a;k=(h=c.pluck)||c.index||c.field;m=c.tag;g=this.store&&c.enrich;n="and"===c.bool;b=c.limit||b||100;w=c.offset||0;if(m&&(x(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=ya.call(this,m[l],b,w,g))e[e.length]=p,q++;return q?e:[]}x(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!d&&(this.o||this.async)&&[];for(let l=0,p,A,B;l<
|
||||
k.length;l++){let z;A=k[l];x(A)||(z=A,A=z.field,a=z.query||a,b=z.limit||b,g=z.enrich||g);if(r)r[l]=this.index[A].searchAsync(a,b,z||c);else{d?p=d[l]:p=this.index[A].search(a,b,z||c);B=p&&p.length;if(m&&B){const y=[];let H=0;n&&(y[0]=[p]);for(let X=0,pa,R;X<m.length;X++)if(pa=m[X],B=(R=this.l[pa])&&R.length)H++,y[y.length]=n?[R]:R;H&&(p=n?ma(y,b||100,w||0):na(p,y),B=p.length)}if(B)f[q]=A,e[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(A){p(l.search(a,
|
||||
b,c,A))})})}if(!q)return[];if(h&&(!g||!this.store))return e[0];for(let l=0,p;l<f.length;l++){p=e[l];p.length&&g&&(p=za.call(this,p));if(h)return p;e[l]={field:f[l],result:p}}return e};function ya(a,b,c,d){let e=this.l[a],f=e&&e.length-c;if(f&&0<f){if(f>b||c)e=e.slice(c,c+b);d&&(e=za.call(this,e));return{tag:a,result:e}}}function za(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[d]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};t.searchCache=oa;t.export=function(a,b,c,d,e,f){let h;"undefined"===typeof f&&(h=new Promise(g=>{f=g}));e||(e=0);d||(d=0);if(d<this.h.length){const g=this.h[d],k=this.index[g];b=this;setTimeout(function(){k.export(a,b,e?g:"",d,e++,f)||(d++,e=1,b.export(a,b,g,d,e,f))})}else{let g,k;switch(e){case 1:g="tag";k=this.l;c=null;break;case 2:g="store";k=this.store;c=null;break;default:f();return}ra(a,this,c,g,d,e,k,f)}return h};
|
||||
t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "tag":this.l=b;break;case "reg":this.m=!1;this.register=b;for(let d=0,e;d<this.h.length;d++)e=this.index[this.h[d]],e.register=b,e.m=!1;break;case "store":this.store=b;break;default:a=a.split(".");const c=a[0];a=a[1];c&&a&&this.index[c].import(a,b)}};la(Q.prototype);var Ba={encode:Aa,F:!1,G:""};const Ca=[F("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",F("[\u00e8\u00e9\u00ea\u00eb]"),"e",F("[\u00ec\u00ed\u00ee\u00ef]"),"i",F("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",F("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",F("[\u00fd\u0177\u00ff]"),"y",F("\u00f1"),"n",F("[\u00e7c]"),"k",F("\u00df"),"s",F(" & ")," and "];function Aa(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(ea,""));return ca.call(this,b.toLowerCase(),!a.normalize&&Ca)};var Ea={encode:Da,F:!1,G:"strict"};const Fa=/[^a-z0-9]+/,Ga={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Da(a){a=Aa.call(this,a).join(" ");const b=[];if(a){const c=a.split(Fa),d=c.length;for(let e=0,f,h=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){f=a[0];let g=Ga[f]||f,k=g;for(let m=1;m<a.length;m++){f=a[m];const n=Ga[f]||f;n&&n!==k&&(g+=n,k=n)}b[h++]=g}}return b};var Ia={encode:Ha,F:!1,G:""};const Ja=[F("ae"),"a",F("oe"),"o",F("sh"),"s",F("th"),"t",F("ph"),"f",F("pf"),"f",F("(?![aeo])h(?![aeo])"),"",F("(?!^[aeo])h(?!^[aeo])"),""];function Ha(a,b){a&&(a=Da.call(this,a).join(" "),2<a.length&&(a=E(a,Ja)),b||(1<a.length&&(a=ha(a)),a&&(a=a.split(" "))));return a||[]};var La={encode:Ka,F:!1,G:""};const Ma=F("(?!\\b)[aeo]");function Ka(a){a&&(a=Ha.call(this,a,!0),1<a.length&&(a=a.replace(Ma,"")),1<a.length&&(a=ha(a)),a&&(a=a.split(" ")));return a||[]};G["latin:default"]=ja;G["latin:simple"]=Ba;G["latin:balance"]=Ea;G["latin:advanced"]=Ia;G["latin:extra"]=La;const W=self;let Y;const Z={Index:K,Document:Q,Worker:O,registerCharset:function(a,b){G[a]=b},registerLanguage:function(a,b){ka[a]=b}};(Y=W.define)&&Y.amd?Y([],function(){return Z}):W.exports?W.exports=Z:W.FlexSearch=Z;
|
||||
var t;function u(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=x();return b}function x(){return Object.create(null)}function aa(a,b){return b.length-a.length}function C(a){return"string"===typeof a}function D(a){return"object"===typeof a}function E(a){return"function"===typeof a};function F(a,b){var c=ba;if(a&&(b&&(a=G(a,b)),this.H&&(a=G(a,this.H)),this.J&&1<a.length&&(a=G(a,this.J)),c||""===c)){b=a.split(c);if(this.filter){a=this.filter;c=b.length;const d=[];for(let e=0,f=0;e<c;e++){const h=b[e];h&&!a[h]&&(d[f++]=h)}a=d}else a=b;return a}return a}const ba=/[\p{Z}\p{S}\p{P}\p{C}]+/u,ca=/[\u0300-\u036f]/g;
|
||||
function I(a,b){const c=Object.keys(a),d=c.length,e=[];let f="",h=0;for(let g=0,k,m;g<d;g++)k=c[g],(m=a[k])?(e[h++]=J(b?"(?!\\b)"+k+"(\\b|_)":k),e[h++]=m):f+=(f?"|":"")+k;f&&(e[h++]=J(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),e[h]="");return e}function G(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function J(a){return new RegExp(a,"g")}function da(a){let b="",c="";for(let d=0,e=a.length,f;d<e;d++)(f=a[d])!==c&&(b+=c=f);return b};var fa={encode:ea,F:!1,G:""};function ea(a){return F.call(this,(""+a).toLowerCase(),!1)};const ha={},K={};function ia(a){L(a,"add");L(a,"append");L(a,"search");L(a,"update");L(a,"remove")}function L(a,b){a[b+"Async"]=function(){const c=this,d=arguments;var e=d[d.length-1];let f;E(e)&&(f=e,delete d[d.length-1]);e=new Promise(function(h){setTimeout(function(){c.async=!0;const g=c[b].apply(c,d);c.async=!1;h(g)})});return f?(e.then(f),this):e}};function ja(a,b,c,d){const e=a.length;let f=[],h,g,k=0;d&&(d=[]);for(let m=e-1;0<=m;m--){const n=a[m],w=n.length,q=x();let r=!h;for(let l=0;l<w;l++){const p=n[l],A=p.length;if(A)for(let B=0,z,y;B<A;B++)if(y=p[B],h){if(h[y]){if(!m)if(c)c--;else if(f[k++]=y,k===b)return f;if(m||d)q[y]=1;r=!0}if(d&&(z=(g[y]||0)+1,g[y]=z,z<e)){const H=d[z-2]||(d[z-2]=[]);H[H.length]=y}}else q[y]=1}if(d)h||(g=q);else if(!r)return[];h=q}if(d)for(let m=d.length-1,n,w;0<=m;m--){n=d[m];w=n.length;for(let q=0,r;q<w;q++)if(r=
|
||||
n[q],!h[r]){if(c)c--;else if(f[k++]=r,k===b)return f;h[r]=1}}return f}function ka(a,b){const c=x(),d=x(),e=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,h;f<b.length;f++){h=b[f];for(let g=0,k;g<h.length;g++)k=h[g],c[k]&&!d[k]&&(d[k]=1,e[e.length]=k)}return e};function M(a){this.l=!0!==a&&a;this.cache=x();this.h=[]}function la(a,b,c){D(a)&&(a=a.query);let d=this.cache.get(a);d||(d=this.search(a,b,c),this.cache.set(a,d));return d}M.prototype.set=function(a,b){if(!this.cache[a]){var c=this.h.length;c===this.l?delete this.cache[this.h[c-1]]:c++;for(--c;0<c;c--)this.h[c]=this.h[c-1];this.h[0]=a}this.cache[a]=b};M.prototype.get=function(a){const b=this.cache[a];if(this.l&&b&&(a=this.h.indexOf(a))){const c=this.h[a-1];this.h[a-1]=this.h[a];this.h[a]=c}return b};const na={memory:{charset:"latin:extra",D:3,B:4,m:!1},performance:{D:3,B:3,s:!1,context:{depth:2,D:1}},match:{charset:"latin:extra",G:"reverse"},score:{charset:"latin:advanced",D:20,B:3,context:{depth:3,D:9}},"default":{}};function oa(a,b,c,d,e,f,h,g){setTimeout(function(){const k=a(c?c+"."+d:d,JSON.stringify(h));k&&k.then?k.then(function(){b.export(a,b,c,e,f+1,g)}):b.export(a,b,c,e,f+1,g)})};function N(a,b){if(!(this instanceof N))return new N(a);var c;if(a){C(a)?a=na[a]:(c=a.preset)&&(a=Object.assign({},c[c],a));c=a.charset;var d=a.lang;C(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=K[c]);C(d)&&(d=ha[d])}else a={};let e,f,h=a.context||{};this.encode=a.encode||c&&c.encode||ea;this.register=b||x();this.D=e=a.resolution||9;this.G=b=c&&c.G||a.tokenize||"strict";this.depth="strict"===b&&h.depth;this.l=u(h.bidirectional);this.s=f=u(a.optimize);this.m=u(a.fastupdate);this.B=a.minlength||1;this.C=
|
||||
a.boost;this.map=f?v(e):x();this.A=e=h.resolution||1;this.h=f?v(e):x();this.F=c&&c.F||a.rtl;this.H=(b=a.matcher||d&&d.H)&&I(b,!1);this.J=(b=a.stemmer||d&&d.J)&&I(b,!0);if(c=b=a.filter||d&&d.filter){c=b;d=x();for(let g=0,k=c.length;g<k;g++)d[c[g]]=1;c=d}this.filter=c;this.cache=(b=a.cache)&&new M(b)}t=N.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(d=b.length){const m=x(),n=x(),w=this.depth,q=this.D;for(let r=0;r<d;r++){let l=b[this.F?d-1-r:r];var e=l.length;if(l&&e>=this.B&&(w||!n[l])){var f=O(q,d,r),h="";switch(this.G){case "full":if(2<e){for(f=0;f<e;f++)for(var g=e;g>f;g--)if(g-f>=this.B){var k=O(q,d,r,e,f);h=l.substring(f,g);P(this,n,h,k,a,c)}break}case "reverse":if(1<e){for(g=e-1;0<g;g--)h=l[g]+h,h.length>=this.B&&P(this,n,
|
||||
h,O(q,d,r,e,g),a,c);h=""}case "forward":if(1<e){for(g=0;g<e;g++)h+=l[g],h.length>=this.B&&P(this,n,h,f,a,c);break}default:if(this.C&&(f=Math.min(f/this.C(b,l,r)|0,q-1)),P(this,n,l,f,a,c),w&&1<d&&r<d-1)for(e=x(),h=this.A,f=l,g=Math.min(w+1,d-r),e[f]=1,k=1;k<g;k++)if((l=b[this.F?d-1-r-k:r+k])&&l.length>=this.B&&!e[l]){e[l]=1;const p=this.l&&l>f;P(this,m,p?f:l,O(h+(d/2>h?0:1),d,r,g-1,k-1),a,c,p?l:f)}}}}this.m||(this.register[a]=1)}}return this};
|
||||
function O(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 P(a,b,c,d,e,f,h){let g=h?a.h:a.map;if(!b[c]||h&&!b[c][h])a.s&&(g=g[d]),h?(b=b[c]||(b[c]=x()),b[h]=1,g=g[h]||(g[h]=x())):b[c]=1,g=g[c]||(g[c]=[]),a.s||(g=g[d]||(g[d]=[])),f&&g.includes(e)||(g[g.length]=e,a.m&&(a=a.register[e]||(a.register[e]=[]),a[a.length]=g))}
|
||||
t.search=function(a,b,c){c||(!b&&D(a)?(c=a,a=c.query):D(b)&&(c=b));let d=[],e;let f,h=0;if(c){a=c.query||a;b=c.limit;h=c.offset||0;var g=c.context;f=c.suggest}if(a&&(a=this.encode(""+a),e=a.length,1<e)){c=x();var k=[];for(let n=0,w=0,q;n<e;n++)if((q=a[n])&&q.length>=this.B&&!c[q])if(this.s||f||this.map[q])k[w++]=q,c[q]=1;else return d;a=k;e=a.length}if(!e)return d;b||(b=100);g=this.depth&&1<e&&!1!==g;c=0;let m;g?(m=a[0],c=1):1<e&&a.sort(aa);for(let n,w;c<e;c++){w=a[c];g?(n=pa(this,d,f,b,h,2===e,w,
|
||||
m),f&&!1===n&&d.length||(m=w)):n=pa(this,d,f,b,h,1===e,w);if(n)return n;if(f&&c===e-1){k=d.length;if(!k){if(g){g=0;c=-1;continue}return d}if(1===k)return qa(d[0],b,h)}}return ja(d,b,h,f)};
|
||||
function pa(a,b,c,d,e,f,h,g){let k=[],m=g?a.h:a.map;a.s||(m=ra(m,h,g,a.l));if(m){let n=0;const w=Math.min(m.length,g?a.A:a.D);for(let q=0,r=0,l,p;q<w;q++)if(l=m[q])if(a.s&&(l=ra(l,h,g,a.l)),e&&l&&f&&(p=l.length,p<=e?(e-=p,l=null):(l=l.slice(e),e=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=d)))break;if(n){if(f)return qa(k,d,0);b[b.length]=k;return}}return!c&&k}function qa(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function ra(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d<c.length;d++)e=c[d],e.splice(e.indexOf(a),1);else Q(this.map,a,this.D,this.s),this.depth&&Q(this.h,a,this.A,this.s);b||delete this.register[a];if(this.cache){b=this.cache;for(let d=0,e,f;d<b.h.length;d++)f=b.h[d],e=b.cache[f],e.includes(a)&&(b.h.splice(d--,1),delete b.cache[f])}}return this};
|
||||
function Q(a,b,c,d,e){let f=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{e=Math.min(a.length,c);for(let h=0,g;h<e;h++)if(g=a[h])f=Q(g,b,c,d,e),d||f||delete a[h]}else for(let h in a)(f=Q(a[h],b,c,d,e))||delete a[h];return f}t.searchCache=la;
|
||||
t.export=function(a,b,c,d,e,f){let h=!0;"undefined"===typeof f&&(h=new Promise(m=>{f=m}));let g,k;switch(e||(e=0)){case 0:g="reg";if(this.m){k=x();for(let m in this.register)k[m]=1}else k=this.register;break;case 1:g="cfg";k={doc:0,opt:this.s?1:0};break;case 2:g="map";k=this.map;break;case 3:g="ctx";k=this.h;break;default:"undefined"===typeof c&&f&&f();return}oa(a,b||this,c,g,d,e,k,f);return h};
|
||||
t.import=function(a,b){if(b)switch(C(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};ia(N.prototype);function sa(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new N(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let ta=0;function S(a){if(!(this instanceof S))return new S(a);var b;a?E(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c="undefined"===typeof window&&self.exports,d=this;this.o=ua(b,c,a.worker);this.h=x();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}T("add");T("append");T("search");
|
||||
T("update");T("remove");function T(a){S.prototype[a]=S.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;E(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++ta]=f;b.o.postMessage({task:a,id:ta,args:c})})});return e?(d.then(e),this):d}}
|
||||
function ua(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+sa.toString()],{type:"text/javascript"}))):new Worker(C(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function U(a){if(!(this instanceof U))return new U(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=x();this.key=(c=b.key||b.id)&&V(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&x();this.I=(c=b.tag)&&V(c,this.A);this.l=c&&x();this.cache=(c=a.cache)&&new M(c);a.cache=!1;this.o=a.worker;this.async=!1;c=x();let d=b.index||b.field||b;C(d)&&(d=[d]);for(let e=0,f,h;e<d.length;e++)f=d[e],C(f)||(h=f,f=f.field),h=D(h)?Object.assign({},a,h):a,
|
||||
this.o&&(c[f]=new S(h),c[f].o||(this.o=!1)),this.o||(c[f]=new N(h,this.register)),this.K[e]=V(f,this.A),this.h[e]=f;if(this.C)for(a=b.store,C(a)&&(a=[a]),b=0;b<a.length;b++)this.C[b]=V(a[b],this.A);this.index=c}function V(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],0<=a.indexOf("[]")&&(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]}function X(a,b){if(C(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function Y(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)Y(a,b,c,d,e);else b=b[e]||(b[e]=x()),e=c[++d],Y(a,b,c,d,e)}function Z(a,b,c,d,e,f,h,g){if(a=a[h])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,g,!0)}else if(a.constructor===Array)for(h=0;h<a.length;h++)Z(a,b,c,d,e,f,h,g);else h=b[++d],Z(a,b,c,d,e,f,h,g)}t=U.prototype;
|
||||
t.add=function(a,b,c){D(a)&&(b=a,a=X(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let d=0,e,f;d<this.h.length;d++)f=this.h[d],e=this.K[d],C(e)&&(e=[e]),Z(b,e,this.A,0,this.index[f],a,e[0],c);if(this.I){let d=X(b,this.I),e=x();C(d)&&(d=[d]);for(let f=0,h,g;f<d.length;f++)if(h=d[f],!e[h]&&(e[h]=1,g=this.l[h]||(this.l[h]=[]),!c||!g.includes(a)))if(g[g.length]=a,this.m){const k=this.register[a]||(this.register[a]=[]);k[k.length]=g}}if(this.store&&(!c||!this.store[a])){let d;
|
||||
if(this.C){d=x();for(let e=0,f;e<this.C.length;e++)f=this.C[e],C(f)?d[f]=b[f]:Y(b,d,f,0,f[0])}this.store[a]=d||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){D(a)&&(a=X(a,this.key));if(this.register[a]){for(var b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.o),!this.m);b++);if(this.I&&!this.m)for(let c in this.l){b=this.l[c];const d=b.indexOf(a);-1!==d&&(1<b.length?b.splice(d,1):delete this.l[c])}this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,d){c||(!b&&D(a)?(c=a,a=""):D(b)&&(c=b,b=0));let e=[],f=[],h,g,k,m,n,w,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{a=c.query||a;k=(h=c.pluck)||c.index||c.field;m=c.tag;g=this.store&&c.enrich;n="and"===c.bool;b=c.limit||b||100;w=c.offset||0;if(m&&(C(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=va.call(this,m[l],b,w,g))e[e.length]=p,q++;return q?e:[]}C(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!d&&(this.o||this.async)&&[];for(let l=0,p,A,B;l<
|
||||
k.length;l++){let z;A=k[l];C(A)||(z=A,A=z.field,a=z.query||a,b=z.limit||b,g=z.enrich||g);if(r)r[l]=this.index[A].searchAsync(a,b,z||c);else{d?p=d[l]:p=this.index[A].search(a,b,z||c);B=p&&p.length;if(m&&B){const y=[];let H=0;n&&(y[0]=[p]);for(let W=0,ma,R;W<m.length;W++)if(ma=m[W],B=(R=this.l[ma])&&R.length)H++,y[y.length]=n?[R]:R;H&&(p=n?ja(y,b||100,w||0):ka(p,y),B=p.length)}if(B)f[q]=A,e[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(A){p(l.search(a,
|
||||
b,c,A))})})}if(!q)return[];if(h&&(!g||!this.store))return e[0];for(let l=0,p;l<f.length;l++){p=e[l];p.length&&g&&(p=wa.call(this,p));if(h)return p;e[l]={field:f[l],result:p}}return e};function va(a,b,c,d){let e=this.l[a],f=e&&e.length-c;if(f&&0<f){if(f>b||c)e=e.slice(c,c+b);d&&(e=wa.call(this,e));return{tag:a,result:e}}}function wa(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[d]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};t.searchCache=la;t.export=function(a,b,c,d,e,f){let h;"undefined"===typeof f&&(h=new Promise(g=>{f=g}));e||(e=0);d||(d=0);if(d<this.h.length){const g=this.h[d],k=this.index[g];b=this;setTimeout(function(){k.export(a,b,e?g:"",d,e++,f)||(d++,e=1,b.export(a,b,g,d,e,f))})}else{let g,k;switch(e){case 1:g="tag";k=this.l;c=null;break;case 2:g="store";k=this.store;c=null;break;default:f();return}oa(a,this,c,g,d,e,k,f)}return h};
|
||||
t.import=function(a,b){if(b)switch(C(b)&&(b=JSON.parse(b)),a){case "tag":this.l=b;break;case "reg":this.m=!1;this.register=b;for(let d=0,e;d<this.h.length;d++)e=this.index[this.h[d]],e.register=b,e.m=!1;break;case "store":this.store=b;break;default:a=a.split(".");const c=a[0];a=a[1];c&&a&&this.index[c].import(a,b)}};ia(U.prototype);var ya={encode:xa,F:!1,G:""};const za=[J("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",J("[\u00e8\u00e9\u00ea\u00eb]"),"e",J("[\u00ec\u00ed\u00ee\u00ef]"),"i",J("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",J("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",J("[\u00fd\u0177\u00ff]"),"y",J("\u00f1"),"n",J("[\u00e7c]"),"k",J("\u00df"),"s",J(" & ")," and "];function xa(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(ca,""));return F.call(this,b.toLowerCase(),!a.normalize&&za)};var Ba={encode:Aa,F:!1,G:"strict"};const Ca=/[^a-z0-9]+/,Da={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Aa(a){a=xa.call(this,a).join(" ");const b=[];if(a){const c=a.split(Ca),d=c.length;for(let e=0,f,h=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){f=a[0];let g=Da[f]||f,k=g;for(let m=1;m<a.length;m++){f=a[m];const n=Da[f]||f;n&&n!==k&&(g+=n,k=n)}b[h++]=g}}return b};var Fa={encode:Ea,F:!1,G:""};const Ga=[J("ae"),"a",J("oe"),"o",J("sh"),"s",J("th"),"t",J("ph"),"f",J("pf"),"f",J("(?![aeo])h(?![aeo])"),"",J("(?!^[aeo])h(?!^[aeo])"),""];function Ea(a,b){a&&(a=Aa.call(this,a).join(" "),2<a.length&&(a=G(a,Ga)),b||(1<a.length&&(a=da(a)),a&&(a=a.split(" "))));return a||[]};var Ia={encode:Ha,F:!1,G:""};const Ja=J("(?!\\b)[aeo]");function Ha(a){a&&(a=Ea.call(this,a,!0),1<a.length&&(a=a.replace(Ja,"")),1<a.length&&(a=da(a)),a&&(a=a.split(" ")));return a||[]};K["latin:default"]=fa;K["latin:simple"]=ya;K["latin:balance"]=Ba;K["latin:advanced"]=Fa;K["latin:extra"]=Ia;export default {Index:N,Document:U,Worker:S,registerCharset:function(a,b){K[a]=b},registerLanguage:function(a,b){ha[a]=b}};
|
||||
|
203
dist/flexsearch.compact.debug.js
vendored
203
dist/flexsearch.compact.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Compact)
|
||||
* FlexSearch.js v0.7.40 (Compact)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -78,15 +78,15 @@ function J(a) {
|
||||
function K(a) {
|
||||
return E.call(this, ("" + a).toLowerCase(), !1);
|
||||
}
|
||||
;const ea = {}, L = {};
|
||||
function fa(a) {
|
||||
M(a, "add");
|
||||
M(a, "append");
|
||||
M(a, "search");
|
||||
M(a, "update");
|
||||
M(a, "remove");
|
||||
;const L = {}, M = {};
|
||||
function ea(a) {
|
||||
O(a, "add");
|
||||
O(a, "append");
|
||||
O(a, "search");
|
||||
O(a, "update");
|
||||
O(a, "remove");
|
||||
}
|
||||
function M(a, b) {
|
||||
function O(a, b) {
|
||||
a[b + "Async"] = function() {
|
||||
const c = this, e = arguments;
|
||||
var d = e[e.length - 1];
|
||||
@@ -103,7 +103,7 @@ function M(a, b) {
|
||||
return f ? (d.then(f), this) : d;
|
||||
};
|
||||
}
|
||||
;function ha(a, b, c, e) {
|
||||
;function fa(a, b, c, e) {
|
||||
const d = a.length;
|
||||
let f = [], g, h, k = 0;
|
||||
e && (e = []);
|
||||
@@ -167,7 +167,7 @@ function M(a, b) {
|
||||
}
|
||||
return f;
|
||||
}
|
||||
function ia(a, b) {
|
||||
function ha(a, b) {
|
||||
const c = z(), e = z(), d = [];
|
||||
for (let f = 0; f < a.length; f++) {
|
||||
c[a[f]] = 1;
|
||||
@@ -180,16 +180,16 @@ function ia(a, b) {
|
||||
}
|
||||
return d;
|
||||
}
|
||||
;const ka = {memory:{charset:"latin:extra", A:3, m:4, D:!1}, performance:{A:3, m:3, s:!1, context:{depth:2, A:1}}, match:{charset:"latin:extra", C:"reverse"}, score:{charset:"latin:advanced", A:20, m:3, context:{depth:3, A:9}}, "default":{}};
|
||||
function O(a, b) {
|
||||
if (!(this instanceof O)) {
|
||||
return new O(a);
|
||||
;const ja = {memory:{charset:"latin:extra", A:3, m:4, D:!1}, performance:{A:3, m:3, s:!1, context:{depth:2, A:1}}, match:{charset:"latin:extra", C:"reverse"}, score:{charset:"latin:advanced", A:20, m:3, context:{depth:3, A:9}}, "default":{}};
|
||||
function P(a, b) {
|
||||
if (!(this instanceof P)) {
|
||||
return new P(a);
|
||||
}
|
||||
var c;
|
||||
let e;
|
||||
if (a) {
|
||||
if (C(a)) {
|
||||
ka[a] || console.warn("Preset not found: " + a), a = ka[a];
|
||||
ja[a] || console.warn("Preset not found: " + a), a = ja[a];
|
||||
} else {
|
||||
if (c = a.preset) {
|
||||
c[c] || console.warn("Preset not found: " + c), a = Object.assign({}, c[c], a);
|
||||
@@ -197,8 +197,8 @@ function O(a, b) {
|
||||
}
|
||||
c = a.charset;
|
||||
e = a.lang;
|
||||
C(c) && (-1 === c.indexOf(":") && (c += ":default"), c = L[c]);
|
||||
C(e) && (e = ea[e]);
|
||||
C(c) && (-1 === c.indexOf(":") && (c += ":default"), c = M[c]);
|
||||
C(e) && (e = L[e]);
|
||||
} else {
|
||||
a = {};
|
||||
}
|
||||
@@ -229,7 +229,7 @@ function O(a, b) {
|
||||
}
|
||||
this.filter = a;
|
||||
}
|
||||
t = O.prototype;
|
||||
t = P.prototype;
|
||||
t.append = function(a, b) {
|
||||
return this.add(a, b, !0);
|
||||
};
|
||||
@@ -245,16 +245,16 @@ t.add = function(a, b, c, e) {
|
||||
let l = b[this.B ? e - 1 - r : r];
|
||||
var d = l.length;
|
||||
if (l && d >= this.m && (u || !n[l])) {
|
||||
var f = P(q, e, r), g = "";
|
||||
var f = Q(q, e, r), g = "";
|
||||
switch(this.C) {
|
||||
case "full":
|
||||
if (2 < d) {
|
||||
for (f = 0; f < d; f++) {
|
||||
for (var h = d; h > f; h--) {
|
||||
if (h - f >= this.m) {
|
||||
var k = P(q, e, r, d, f);
|
||||
var k = Q(q, e, r, d, f);
|
||||
g = l.substring(f, h);
|
||||
Q(this, n, g, k, a, c);
|
||||
S(this, n, g, k, a, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,24 +263,24 @@ t.add = function(a, b, c, e) {
|
||||
case "reverse":
|
||||
if (1 < d) {
|
||||
for (h = d - 1; 0 < h; h--) {
|
||||
g = l[h] + g, g.length >= this.m && Q(this, n, g, P(q, e, r, d, h), a, c);
|
||||
g = l[h] + g, g.length >= this.m && S(this, n, g, Q(q, e, r, d, h), a, c);
|
||||
}
|
||||
g = "";
|
||||
}
|
||||
case "forward":
|
||||
if (1 < d) {
|
||||
for (h = 0; h < d; h++) {
|
||||
g += l[h], g.length >= this.m && Q(this, n, g, f, a, c);
|
||||
g += l[h], g.length >= this.m && S(this, n, g, f, a, c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (this.F && (f = Math.min(f / this.F(b, l, r) | 0, q - 1)), Q(this, n, l, f, a, c), u && 1 < e && r < e - 1) {
|
||||
if (this.F && (f = Math.min(f / this.F(b, l, r) | 0, q - 1)), S(this, n, l, f, a, c), u && 1 < e && r < e - 1) {
|
||||
for (d = z(), g = this.o, f = l, h = Math.min(u + 1, e - r), d[f] = 1, k = 1; k < h; k++) {
|
||||
if ((l = b[this.B ? e - 1 - r - k : r + k]) && l.length >= this.m && !d[l]) {
|
||||
d[l] = 1;
|
||||
const p = this.h && l > f;
|
||||
Q(this, m, p ? f : l, P(g + (e / 2 > g ? 0 : 1), e, r, h - 1, k - 1), a, c, p ? l : f);
|
||||
S(this, m, p ? f : l, Q(g + (e / 2 > g ? 0 : 1), e, r, h - 1, k - 1), a, c, p ? l : f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,10 +292,10 @@ t.add = function(a, b, c, e) {
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function P(a, b, c, e, d) {
|
||||
function Q(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 Q(a, b, c, e, d, f, g) {
|
||||
function S(a, b, c, e, d, f, g) {
|
||||
let h = g ? a.l : a.map;
|
||||
if (!b[c] || g && !b[c][g]) {
|
||||
a.s && (h = h[e]), g ? (b = b[c] || (b[c] = z()), b[g] = 1, h = h[g] || (h[g] = z())) : b[c] = 1, h = h[c] || (h[c] = []), a.s || (h = h[e] || (h[e] = [])), f && h.includes(d) || (h[h.length] = d, a.D && (a = a.register[d] || (a.register[d] = []), a[a.length] = h));
|
||||
@@ -337,7 +337,7 @@ t.search = function(a, b, c) {
|
||||
h ? (m = a[0], c = 1) : 1 < d && a.sort(aa);
|
||||
for (let n, u; c < d; c++) {
|
||||
u = a[c];
|
||||
h ? (n = la(this, e, f, b, g, 2 === d, u, m), f && !1 === n && e.length || (m = u)) : n = la(this, e, f, b, g, 1 === d, u);
|
||||
h ? (n = ka(this, e, f, b, g, 2 === d, u, m), f && !1 === n && e.length || (m = u)) : n = ka(this, e, f, b, g, 1 === d, u);
|
||||
if (n) {
|
||||
return n;
|
||||
}
|
||||
@@ -352,28 +352,28 @@ t.search = function(a, b, c) {
|
||||
return e;
|
||||
}
|
||||
if (1 === k) {
|
||||
return ma(e[0], b, g);
|
||||
return la(e[0], b, g);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ha(e, b, g, f);
|
||||
return fa(e, b, g, f);
|
||||
};
|
||||
function la(a, b, c, e, d, f, g, h) {
|
||||
function ka(a, b, c, e, d, f, g, h) {
|
||||
let k = [], m = h ? a.l : a.map;
|
||||
a.s || (m = na(m, g, h, a.h));
|
||||
a.s || (m = ma(m, g, h, a.h));
|
||||
if (m) {
|
||||
let n = 0;
|
||||
const u = Math.min(m.length, h ? a.o : a.A);
|
||||
for (let q = 0, r = 0, l, p; q < u; q++) {
|
||||
if (l = m[q]) {
|
||||
if (a.s && (l = na(l, g, h, a.h)), d && l && f && (p = l.length, p <= d ? (d -= p, l = null) : (l = l.slice(d), d = 0)), l && (k[n++] = l, f && (r += l.length, r >= e))) {
|
||||
if (a.s && (l = ma(l, g, h, a.h)), d && l && f && (p = l.length, p <= d ? (d -= p, l = null) : (l = l.slice(d), d = 0)), l && (k[n++] = l, f && (r += l.length, r >= e))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (n) {
|
||||
if (f) {
|
||||
return ma(k, e, 0);
|
||||
return la(k, e, 0);
|
||||
}
|
||||
b[b.length] = k;
|
||||
return;
|
||||
@@ -381,11 +381,11 @@ function la(a, b, c, e, d, f, g, h) {
|
||||
}
|
||||
return !c && k;
|
||||
}
|
||||
function ma(a, b, c) {
|
||||
function la(a, b, c) {
|
||||
a = 1 === a.length ? a[0] : [].concat.apply([], a);
|
||||
return c || a.length > b ? a.slice(c, c + b) : a;
|
||||
}
|
||||
function na(a, b, c, e) {
|
||||
function ma(a, b, c, e) {
|
||||
c ? (e = e && b > c, a = (a = a[e ? b : c]) && a[e ? c : b]) : a = a[b];
|
||||
return a;
|
||||
}
|
||||
@@ -403,13 +403,13 @@ t.remove = function(a, b) {
|
||||
d = c[e], d.splice(d.indexOf(a), 1);
|
||||
}
|
||||
} else {
|
||||
R(this.map, a, this.A, this.s), this.depth && R(this.l, a, this.o, this.s);
|
||||
T(this.map, a, this.A, this.s), this.depth && T(this.l, a, this.o, this.s);
|
||||
}
|
||||
b || delete this.register[a];
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function R(a, b, c, e, d) {
|
||||
function T(a, b, c, e, d) {
|
||||
let f = 0;
|
||||
if (a.constructor === Array) {
|
||||
if (d) {
|
||||
@@ -418,28 +418,28 @@ function R(a, b, c, e, d) {
|
||||
d = Math.min(a.length, c);
|
||||
for (let g = 0, h; g < d; g++) {
|
||||
if (h = a[g]) {
|
||||
f = R(h, b, c, e, d), e || f || delete a[g];
|
||||
f = T(h, b, c, e, d), e || f || delete a[g];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let g in a) {
|
||||
(f = R(a[g], b, c, e, d)) || delete a[g];
|
||||
(f = T(a[g], b, c, e, d)) || delete a[g];
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
fa(O.prototype);
|
||||
function T(a) {
|
||||
if (!(this instanceof T)) {
|
||||
return new T(a);
|
||||
ea(P.prototype);
|
||||
function U(a) {
|
||||
if (!(this instanceof U)) {
|
||||
return new U(a);
|
||||
}
|
||||
var b = a.document || a.doc || a, c;
|
||||
this.F = [];
|
||||
this.h = [];
|
||||
this.o = [];
|
||||
this.register = z();
|
||||
this.key = (c = b.key || b.id) && U(c, this.o) || "id";
|
||||
this.key = (c = b.key || b.id) && V(c, this.o) || "id";
|
||||
this.D = v(a.fastupdate);
|
||||
this.l = (c = b.store) && !0 !== c && [];
|
||||
this.store = c && z();
|
||||
@@ -448,16 +448,16 @@ function T(a) {
|
||||
let e = b.index || b.field || b;
|
||||
C(e) && (e = [e]);
|
||||
for (let d = 0, f, g; d < e.length; d++) {
|
||||
f = e[d], C(f) || (g = f, f = f.field), g = D(g) ? Object.assign({}, a, g) : a, this.I || (c[f] = new O(g, this.register)), this.F[d] = U(f, this.o), this.h[d] = f;
|
||||
f = e[d], C(f) || (g = f, f = f.field), g = D(g) ? Object.assign({}, a, g) : a, this.I || (c[f] = new P(g, this.register)), this.F[d] = V(f, this.o), this.h[d] = f;
|
||||
}
|
||||
if (this.l) {
|
||||
for (a = b.store, C(a) && (a = [a]), b = 0; b < a.length; b++) {
|
||||
this.l[b] = U(a[b], this.o);
|
||||
this.l[b] = V(a[b], this.o);
|
||||
}
|
||||
}
|
||||
this.index = c;
|
||||
}
|
||||
function U(a, b) {
|
||||
function V(a, b) {
|
||||
const c = a.split(":");
|
||||
let e = 0;
|
||||
for (let d = 0; d < c.length; d++) {
|
||||
@@ -466,7 +466,7 @@ function U(a, b) {
|
||||
e < c.length && (c.length = e);
|
||||
return 1 < e ? c : c[0];
|
||||
}
|
||||
function oa(a, b) {
|
||||
function na(a, b) {
|
||||
if (C(b)) {
|
||||
a = a[b];
|
||||
} else {
|
||||
@@ -476,21 +476,21 @@ function oa(a, b) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
function V(a, b, c, e, d) {
|
||||
function W(a, b, c, e, d) {
|
||||
a = a[d];
|
||||
if (e === c.length - 1) {
|
||||
b[d] = a;
|
||||
} else if (a) {
|
||||
if (a.constructor === Array) {
|
||||
for (b = b[d] = Array(a.length), d = 0; d < a.length; d++) {
|
||||
V(a, b, c, e, d);
|
||||
W(a, b, c, e, d);
|
||||
}
|
||||
} else {
|
||||
b = b[d] || (b[d] = z()), d = c[++e], V(a, b, c, e, d);
|
||||
b = b[d] || (b[d] = z()), d = c[++e], W(a, b, c, e, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
function W(a, b, c, e, d, f, g, h) {
|
||||
function X(a, b, c, e, d, f, g, h) {
|
||||
if (a = a[g]) {
|
||||
if (e === b.length - 1) {
|
||||
if (a.constructor === Array) {
|
||||
@@ -506,30 +506,30 @@ function W(a, b, c, e, d, f, g, h) {
|
||||
} else {
|
||||
if (a.constructor === Array) {
|
||||
for (g = 0; g < a.length; g++) {
|
||||
W(a, b, c, e, d, f, g, h);
|
||||
X(a, b, c, e, d, f, g, h);
|
||||
}
|
||||
} else {
|
||||
g = b[++e], W(a, b, c, e, d, f, g, h);
|
||||
g = b[++e], X(a, b, c, e, d, f, g, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
t = T.prototype;
|
||||
t = U.prototype;
|
||||
t.add = function(a, b, c) {
|
||||
D(a) && (b = a, a = oa(b, this.key));
|
||||
D(a) && (b = a, a = na(b, this.key));
|
||||
if (b && (a || 0 === a)) {
|
||||
if (!c && this.register[a]) {
|
||||
return this.update(a, b);
|
||||
}
|
||||
for (let e = 0, d, f; e < this.h.length; e++) {
|
||||
f = this.h[e], d = this.F[e], C(d) && (d = [d]), W(b, d, this.o, 0, this.index[f], a, d[0], c);
|
||||
f = this.h[e], d = this.F[e], C(d) && (d = [d]), X(b, d, this.o, 0, this.index[f], a, d[0], c);
|
||||
}
|
||||
if (this.store && (!c || !this.store[a])) {
|
||||
let e;
|
||||
if (this.l) {
|
||||
e = z();
|
||||
for (let d = 0, f; d < this.l.length; d++) {
|
||||
f = this.l[d], C(f) ? e[f] = b[f] : V(b, e, f, 0, f[0]);
|
||||
f = this.l[d], C(f) ? e[f] = b[f] : W(b, e, f, 0, f[0]);
|
||||
}
|
||||
}
|
||||
this.store[a] = e || b;
|
||||
@@ -544,7 +544,7 @@ t.update = function(a, b) {
|
||||
return this.remove(a).add(a, b);
|
||||
};
|
||||
t.remove = function(a) {
|
||||
D(a) && (a = oa(a, this.key));
|
||||
D(a) && (a = na(a, this.key));
|
||||
if (this.register[a]) {
|
||||
for (let b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.I), !this.D); b++) {
|
||||
}
|
||||
@@ -569,7 +569,7 @@ t.search = function(a, b, c, e) {
|
||||
u = c.offset || 0;
|
||||
if (m && (C(m) && (m = [m]), !a)) {
|
||||
for (let l = 0, p; l < m.length; l++) {
|
||||
if (p = pa.call(this, m[l], b, u, h)) {
|
||||
if (p = oa.call(this, m[l], b, u, h)) {
|
||||
d[d.length] = p, q++;
|
||||
}
|
||||
}
|
||||
@@ -594,12 +594,12 @@ t.search = function(a, b, c, e) {
|
||||
const x = [];
|
||||
let G = 0;
|
||||
n && (x[0] = [p]);
|
||||
for (let S = 0, ja, N; S < m.length; S++) {
|
||||
if (ja = m[S], B = (N = this.J[ja]) && N.length) {
|
||||
for (let R = 0, ia, N; R < m.length; R++) {
|
||||
if (ia = m[R], B = (N = this.J[ia]) && N.length) {
|
||||
G++, x[x.length] = n ? [N] : N;
|
||||
}
|
||||
}
|
||||
G && (p = n ? ha(x, b || 100, u || 0) : ia(p, x), B = p.length);
|
||||
G && (p = n ? fa(x, b || 100, u || 0) : ha(p, x), B = p.length);
|
||||
}
|
||||
if (B) {
|
||||
f[q] = A, d[q++] = p;
|
||||
@@ -624,7 +624,7 @@ t.search = function(a, b, c, e) {
|
||||
}
|
||||
for (let l = 0, p; l < f.length; l++) {
|
||||
p = d[l];
|
||||
p.length && h && (p = qa.call(this, p));
|
||||
p.length && h && (p = pa.call(this, p));
|
||||
if (g) {
|
||||
return p;
|
||||
}
|
||||
@@ -632,17 +632,17 @@ t.search = function(a, b, c, e) {
|
||||
}
|
||||
return d;
|
||||
};
|
||||
function pa(a, b, c, e) {
|
||||
function oa(a, b, c, e) {
|
||||
let d = this.J[a], f = d && d.length - c;
|
||||
if (f && 0 < f) {
|
||||
if (f > b || c) {
|
||||
d = d.slice(c, c + b);
|
||||
}
|
||||
e && (d = qa.call(this, d));
|
||||
e && (d = pa.call(this, d));
|
||||
return {tag:a, result:d};
|
||||
}
|
||||
}
|
||||
function qa(a) {
|
||||
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[e]};
|
||||
@@ -659,28 +659,28 @@ t.set = function(a, b) {
|
||||
this.store[a] = b;
|
||||
return this;
|
||||
};
|
||||
fa(T.prototype);
|
||||
var sa = {encode:ra, B:!1, C:""};
|
||||
const ta = [I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", I("[\u00e8\u00e9\u00ea\u00eb]"), "e", I("[\u00ec\u00ed\u00ee\u00ef]"), "i", I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", I("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", I("[\u00fd\u0177\u00ff]"), "y", I("\u00f1"), "n", I("[\u00e7c]"), "k", I("\u00df"), "s", I(" & "), " and "];
|
||||
function ra(a) {
|
||||
ea(U.prototype);
|
||||
var ra = {encode:qa, B:!1, C:""};
|
||||
const sa = [I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", I("[\u00e8\u00e9\u00ea\u00eb]"), "e", I("[\u00ec\u00ed\u00ee\u00ef]"), "i", I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", I("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", I("[\u00fd\u0177\u00ff]"), "y", I("\u00f1"), "n", I("[\u00e7c]"), "k", I("\u00df"), "s", I(" & "), " and "];
|
||||
function qa(a) {
|
||||
var b = a = "" + a;
|
||||
b.normalize && (b = b.normalize("NFD").replace(ca, ""));
|
||||
return E.call(this, b.toLowerCase(), !a.normalize && ta);
|
||||
return E.call(this, b.toLowerCase(), !a.normalize && sa);
|
||||
}
|
||||
;var va = {encode:ua, B:!1, C:"strict"};
|
||||
const wa = /[^a-z0-9]+/, xa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function ua(a) {
|
||||
a = ra.call(this, a).join(" ");
|
||||
;var ua = {encode:ta, B:!1, C:"strict"};
|
||||
const va = /[^a-z0-9]+/, wa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function ta(a) {
|
||||
a = qa.call(this, a).join(" ");
|
||||
const b = [];
|
||||
if (a) {
|
||||
const c = a.split(wa), e = c.length;
|
||||
const c = a.split(va), e = c.length;
|
||||
for (let d = 0, f, g = 0; d < e; d++) {
|
||||
if ((a = c[d]) && (!this.filter || !this.filter[a])) {
|
||||
f = a[0];
|
||||
let h = xa[f] || f, k = h;
|
||||
let h = wa[f] || f, k = h;
|
||||
for (let m = 1; m < a.length; m++) {
|
||||
f = a[m];
|
||||
const n = xa[f] || f;
|
||||
const n = wa[f] || f;
|
||||
n && n !== k && (h += n, k = n);
|
||||
}
|
||||
b[g++] = h;
|
||||
@@ -689,31 +689,30 @@ function ua(a) {
|
||||
}
|
||||
return b;
|
||||
}
|
||||
;var za = {encode:ya, B:!1, C:""};
|
||||
const Aa = [I("ae"), "a", I("oe"), "o", I("sh"), "s", I("th"), "t", I("ph"), "f", I("pf"), "f", I("(?![aeo])h(?![aeo])"), "", I("(?!^[aeo])h(?!^[aeo])"), ""];
|
||||
function ya(a, b) {
|
||||
a && (a = ua.call(this, a).join(" "), 2 < a.length && (a = F(a, Aa)), b || (1 < a.length && (a = J(a)), a && (a = a.split(" "))));
|
||||
;var ya = {encode:xa, B:!1, C:""};
|
||||
const za = [I("ae"), "a", I("oe"), "o", I("sh"), "s", I("th"), "t", I("ph"), "f", I("pf"), "f", I("(?![aeo])h(?![aeo])"), "", I("(?!^[aeo])h(?!^[aeo])"), ""];
|
||||
function xa(a, b) {
|
||||
a && (a = ta.call(this, a).join(" "), 2 < a.length && (a = F(a, za)), b || (1 < a.length && (a = J(a)), a && (a = a.split(" "))));
|
||||
return a || [];
|
||||
}
|
||||
;var Ca = {encode:Ba, B:!1, C:""};
|
||||
const Da = I("(?!\\b)[aeo]");
|
||||
function Ba(a) {
|
||||
a && (a = ya.call(this, a, !0), 1 < a.length && (a = a.replace(Da, "")), 1 < a.length && (a = J(a)), a && (a = a.split(" ")));
|
||||
;var Ba = {encode:Aa, B:!1, C:""};
|
||||
const Ca = I("(?!\\b)[aeo]");
|
||||
function Aa(a) {
|
||||
a && (a = xa.call(this, a, !0), 1 < a.length && (a = a.replace(Ca, "")), 1 < a.length && (a = J(a)), a && (a = a.split(" ")));
|
||||
return a || [];
|
||||
}
|
||||
;L["latin:default"] = da;
|
||||
L["latin:simple"] = sa;
|
||||
L["latin:balance"] = va;
|
||||
L["latin:advanced"] = za;
|
||||
L["latin:extra"] = Ca;
|
||||
const X = self;
|
||||
let Y;
|
||||
const Z = {Index:O, Document:T, Worker:null, registerCharset:function(a, b) {
|
||||
L[a] = b;
|
||||
;M["latin:default"] = da;
|
||||
M["latin:simple"] = ra;
|
||||
M["latin:balance"] = ua;
|
||||
M["latin:advanced"] = ya;
|
||||
M["latin:extra"] = Ba;
|
||||
const Y = {Index:P, Document:U, Worker:null, registerCharset:function(a, b) {
|
||||
M[a] = b;
|
||||
}, registerLanguage:function(a, b) {
|
||||
ea[a] = b;
|
||||
L[a] = b;
|
||||
}};
|
||||
(Y = X.define) && Y.amd ? Y([], function() {
|
||||
return Z;
|
||||
}) : X.exports ? X.exports = Z : X.FlexSearch = Z;
|
||||
let Z;
|
||||
(Z = self.define) && Z.amd ? Z([], function() {
|
||||
return Y;
|
||||
}) : self.exports ? self.exports = Y : self.FlexSearch = Y;
|
||||
}(this));
|
||||
|
40
dist/flexsearch.compact.min.js
vendored
40
dist/flexsearch.compact.min.js
vendored
@@ -1,27 +1,27 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Compact)
|
||||
* FlexSearch.js v0.7.40 (Compact)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
(function(self){'use strict';var t;function v(a){return"undefined"!==typeof a?a:!0}function w(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=z();return b}function z(){return Object.create(null)}function aa(a,b){return b.length-a.length}function C(a){return"string"===typeof a}function D(a){return"object"===typeof a};function E(a,b){var c=ba;if(a&&(b&&(a=F(a,b)),this.G&&(a=F(a,this.G)),this.H&&1<a.length&&(a=F(a,this.H)),c||""===c)){b=a.split(c);if(this.filter){a=this.filter;c=b.length;const e=[];for(let d=0,f=0;d<c;d++){const g=b[d];g&&!a[g]&&(e[f++]=g)}a=e}else a=b;return a}return a}const ba=/[\p{Z}\p{S}\p{P}\p{C}]+/u,ca=/[\u0300-\u036f]/g;
|
||||
function H(a,b){const c=Object.keys(a),e=c.length,d=[];let f="",g=0;for(let h=0,k,m;h<e;h++)k=c[h],(m=a[k])?(d[g++]=I(b?"(?!\\b)"+k+"(\\b|_)":k),d[g++]=m):f+=(f?"|":"")+k;f&&(d[g++]=I(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),d[g]="");return d}function F(a,b){for(let c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function I(a){return new RegExp(a,"g")}function J(a){let b="",c="";for(let e=0,d=a.length,f;e<d;e++)(f=a[e])!==c&&(b+=c=f);return b};var da={encode:K,B:!1,C:""};function K(a){return E.call(this,(""+a).toLowerCase(),!1)};const ea={},L={};function fa(a){M(a,"add");M(a,"append");M(a,"search");M(a,"update");M(a,"remove")}function M(a,b){a[b+"Async"]=function(){const c=this,e=arguments;var d=e[e.length-1];let f;"function"===typeof d&&(f=d,delete e[e.length-1]);d=new Promise(function(g){setTimeout(function(){c.async=!0;const h=c[b].apply(c,e);c.async=!1;g(h)})});return f?(d.then(f),this):d}};function ha(a,b,c,e){const d=a.length;let f=[],g,h,k=0;e&&(e=[]);for(let m=d-1;0<=m;m--){const n=a[m],u=n.length,q=z();let r=!g;for(let l=0;l<u;l++){const p=n[l],A=p.length;if(A)for(let B=0,y,x;B<A;B++)if(x=p[B],g){if(g[x]){if(!m)if(c)c--;else if(f[k++]=x,k===b)return f;if(m||e)q[x]=1;r=!0}if(e&&(y=(h[x]||0)+1,h[x]=y,y<d)){const G=e[y-2]||(e[y-2]=[]);G[G.length]=x}}else q[x]=1}if(e)g||(h=q);else if(!r)return[];g=q}if(e)for(let m=e.length-1,n,u;0<=m;m--){n=e[m];u=n.length;for(let q=0,r;q<u;q++)if(r=
|
||||
n[q],!g[r]){if(c)c--;else if(f[k++]=r,k===b)return f;g[r]=1}}return f}function ja(a,b){const c=z(),e=z(),d=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,g;f<b.length;f++){g=b[f];for(let h=0,k;h<g.length;h++)k=g[h],c[k]&&!e[k]&&(e[k]=1,d[d.length]=k)}return d};const ka={memory:{charset:"latin:extra",A:3,m:4,D:!1},performance:{A:3,m:3,s:!1,context:{depth:2,A:1}},match:{charset:"latin:extra",C:"reverse"},score:{charset:"latin:advanced",A:20,m:3,context:{depth:3,A:9}},"default":{}};function O(a,b){if(!(this instanceof O))return new O(a);var c;let e;a?(C(a)?a=ka[a]:(c=a.preset)&&(a=Object.assign({},c[c],a)),c=a.charset,e=a.lang,C(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=L[c]),C(e)&&(e=ea[e])):a={};let d,f,g=a.context||{};this.encode=a.encode||c&&c.encode||K;this.register=b||z();this.A=d=a.resolution||9;this.C=b=c&&c.C||a.tokenize||"strict";this.depth="strict"===b&&g.depth;this.h=v(g.bidirectional);this.s=f=v(a.optimize);this.D=v(a.fastupdate);this.m=a.minlength||1;this.F=
|
||||
a.boost;this.map=f?w(d):z();this.o=d=g.resolution||1;this.l=f?w(d):z();this.B=c&&c.B||a.rtl;this.G=(b=a.matcher||e&&e.G)&&H(b,!1);this.H=(b=a.stemmer||e&&e.H)&&H(b,!0);if(a=b=a.filter||e&&e.filter){a=b;c=z();for(let h=0,k=a.length;h<k;h++)c[a[h]]=1;a=c}this.filter=a}t=O.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,e){if(b&&(a||0===a)){if(!e&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(e=b.length){const m=z(),n=z(),u=this.depth,q=this.A;for(let r=0;r<e;r++){let l=b[this.B?e-1-r:r];var d=l.length;if(l&&d>=this.m&&(u||!n[l])){var f=P(q,e,r),g="";switch(this.C){case "full":if(2<d){for(f=0;f<d;f++)for(var h=d;h>f;h--)if(h-f>=this.m){var k=P(q,e,r,d,f);g=l.substring(f,h);Q(this,n,g,k,a,c)}break}case "reverse":if(1<d){for(h=d-1;0<h;h--)g=l[h]+g,g.length>=this.m&&Q(this,n,
|
||||
g,P(q,e,r,d,h),a,c);g=""}case "forward":if(1<d){for(h=0;h<d;h++)g+=l[h],g.length>=this.m&&Q(this,n,g,f,a,c);break}default:if(this.F&&(f=Math.min(f/this.F(b,l,r)|0,q-1)),Q(this,n,l,f,a,c),u&&1<e&&r<e-1)for(d=z(),g=this.o,f=l,h=Math.min(u+1,e-r),d[f]=1,k=1;k<h;k++)if((l=b[this.B?e-1-r-k:r+k])&&l.length>=this.m&&!d[l]){d[l]=1;const p=this.h&&l>f;Q(this,m,p?f:l,P(g+(e/2>g?0:1),e,r,h-1,k-1),a,c,p?l:f)}}}}this.D||(this.register[a]=1)}}return this};
|
||||
function P(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 Q(a,b,c,e,d,f,g){let h=g?a.l:a.map;if(!b[c]||g&&!b[c][g])a.s&&(h=h[e]),g?(b=b[c]||(b[c]=z()),b[g]=1,h=h[g]||(h[g]=z())):b[c]=1,h=h[c]||(h[c]=[]),a.s||(h=h[e]||(h[e]=[])),f&&h.includes(d)||(h[h.length]=d,a.D&&(a=a.register[d]||(a.register[d]=[]),a[a.length]=h))}
|
||||
t.search=function(a,b,c){c||(!b&&D(a)?(c=a,a=c.query):D(b)&&(c=b));let e=[],d;let f,g=0;if(c){a=c.query||a;b=c.limit;g=c.offset||0;var h=c.context;f=c.suggest}if(a&&(a=this.encode(""+a),d=a.length,1<d)){c=z();var k=[];for(let n=0,u=0,q;n<d;n++)if((q=a[n])&&q.length>=this.m&&!c[q])if(this.s||f||this.map[q])k[u++]=q,c[q]=1;else return e;a=k;d=a.length}if(!d)return e;b||(b=100);h=this.depth&&1<d&&!1!==h;c=0;let m;h?(m=a[0],c=1):1<d&&a.sort(aa);for(let n,u;c<d;c++){u=a[c];h?(n=la(this,e,f,b,g,2===d,u,
|
||||
m),f&&!1===n&&e.length||(m=u)):n=la(this,e,f,b,g,1===d,u);if(n)return n;if(f&&c===d-1){k=e.length;if(!k){if(h){h=0;c=-1;continue}return e}if(1===k)return ma(e[0],b,g)}}return ha(e,b,g,f)};
|
||||
function la(a,b,c,e,d,f,g,h){let k=[],m=h?a.l:a.map;a.s||(m=na(m,g,h,a.h));if(m){let n=0;const u=Math.min(m.length,h?a.o:a.A);for(let q=0,r=0,l,p;q<u;q++)if(l=m[q])if(a.s&&(l=na(l,g,h,a.h)),d&&l&&f&&(p=l.length,p<=d?(d-=p,l=null):(l=l.slice(d),d=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=e)))break;if(n){if(f)return ma(k,e,0);b[b.length]=k;return}}return!c&&k}function ma(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function na(a,b,c,e){c?(e=e&&b>c,a=(a=a[e?b:c])&&a[e?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};t.remove=function(a,b){const c=this.register[a];if(c){if(this.D)for(let e=0,d;e<c.length;e++)d=c[e],d.splice(d.indexOf(a),1);else R(this.map,a,this.A,this.s),this.depth&&R(this.l,a,this.o,this.s);b||delete this.register[a]}return this};
|
||||
function R(a,b,c,e,d){let f=0;if(a.constructor===Array)if(d)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{d=Math.min(a.length,c);for(let g=0,h;g<d;g++)if(h=a[g])f=R(h,b,c,e,d),e||f||delete a[g]}else for(let g in a)(f=R(a[g],b,c,e,d))||delete a[g];return f}fa(O.prototype);function T(a){if(!(this instanceof T))return new T(a);var b=a.document||a.doc||a,c;this.F=[];this.h=[];this.o=[];this.register=z();this.key=(c=b.key||b.id)&&U(c,this.o)||"id";this.D=v(a.fastupdate);this.l=(c=b.store)&&!0!==c&&[];this.store=c&&z();this.async=!1;c=z();let e=b.index||b.field||b;C(e)&&(e=[e]);for(let d=0,f,g;d<e.length;d++)f=e[d],C(f)||(g=f,f=f.field),g=D(g)?Object.assign({},a,g):a,this.I||(c[f]=new O(g,this.register)),this.F[d]=U(f,this.o),this.h[d]=f;if(this.l)for(a=b.store,C(a)&&(a=
|
||||
[a]),b=0;b<a.length;b++)this.l[b]=U(a[b],this.o);this.index=c}function U(a,b){const c=a.split(":");let e=0;for(let d=0;d<c.length;d++)a=c[d],0<=a.indexOf("[]")&&(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]}function oa(a,b){if(C(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function V(a,b,c,e,d){a=a[d];if(e===c.length-1)b[d]=a;else if(a)if(a.constructor===Array)for(b=b[d]=Array(a.length),d=0;d<a.length;d++)V(a,b,c,e,d);else b=b[d]||(b[d]=z()),d=c[++e],V(a,b,c,e,d)}function W(a,b,c,e,d,f,g,h){if(a=a[g])if(e===b.length-1){if(a.constructor===Array){if(c[e]){for(b=0;b<a.length;b++)d.add(f,a[b],!0,!0);return}a=a.join(" ")}d.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)W(a,b,c,e,d,f,g,h);else g=b[++e],W(a,b,c,e,d,f,g,h)}t=T.prototype;
|
||||
t.add=function(a,b,c){D(a)&&(b=a,a=oa(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let e=0,d,f;e<this.h.length;e++)f=this.h[e],d=this.F[e],C(d)&&(d=[d]),W(b,d,this.o,0,this.index[f],a,d[0],c);if(this.store&&(!c||!this.store[a])){let e;if(this.l){e=z();for(let d=0,f;d<this.l.length;d++)f=this.l[d],C(f)?e[f]=b[f]:V(b,e,f,0,f[0])}this.store[a]=e||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){D(a)&&(a=oa(a,this.key));if(this.register[a]){for(let b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.I),!this.D);b++);this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,e){c||(!b&&D(a)?(c=a,a=""):D(b)&&(c=b,b=0));let d=[],f=[],g,h,k,m,n,u,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{a=c.query||a;k=(g=c.pluck)||c.index||c.field;m=!1;h=this.store&&c.enrich;n="and"===c.bool;b=c.limit||b||100;u=c.offset||0;if(m&&(C(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=pa.call(this,m[l],b,u,h))d[d.length]=p,q++;return q?d:[]}C(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!e&&(this.I||this.async)&&[];for(let l=0,p,A,B;l<
|
||||
k.length;l++){let y;A=k[l];C(A)||(y=A,A=y.field,a=y.query||a,b=y.limit||b,h=y.enrich||h);if(r)r[l]=this.index[A].searchAsync(a,b,y||c);else{e?p=e[l]:p=this.index[A].search(a,b,y||c);B=p&&p.length;if(m&&B){const x=[];let G=0;n&&(x[0]=[p]);for(let S=0,ia,N;S<m.length;S++)if(ia=m[S],B=(N=this.J[ia])&&N.length)G++,x[x.length]=n?[N]:N;G&&(p=n?ha(x,b||100,u||0):ja(p,x),B=p.length)}if(B)f[q]=A,d[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(A){p(l.search(a,
|
||||
b,c,A))})})}if(!q)return[];if(g&&(!h||!this.store))return d[0];for(let l=0,p;l<f.length;l++){p=d[l];p.length&&h&&(p=qa.call(this,p));if(g)return p;d[l]={field:f[l],result:p}}return d};function pa(a,b,c,e){let d=this.J[a],f=d&&d.length-c;if(f&&0<f){if(f>b||c)d=d.slice(c,c+b);e&&(d=qa.call(this,d));return{tag:a,result: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[e]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};fa(T.prototype);var sa={encode:ra,B:!1,C:""};const ta=[I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",I("[\u00e8\u00e9\u00ea\u00eb]"),"e",I("[\u00ec\u00ed\u00ee\u00ef]"),"i",I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",I("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",I("[\u00fd\u0177\u00ff]"),"y",I("\u00f1"),"n",I("[\u00e7c]"),"k",I("\u00df"),"s",I(" & ")," and "];function ra(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(ca,""));return E.call(this,b.toLowerCase(),!a.normalize&&ta)};var va={encode:ua,B:!1,C:"strict"};const wa=/[^a-z0-9]+/,xa={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function ua(a){a=ra.call(this,a).join(" ");const b=[];if(a){const c=a.split(wa),e=c.length;for(let d=0,f,g=0;d<e;d++)if((a=c[d])&&(!this.filter||!this.filter[a])){f=a[0];let h=xa[f]||f,k=h;for(let m=1;m<a.length;m++){f=a[m];const n=xa[f]||f;n&&n!==k&&(h+=n,k=n)}b[g++]=h}}return b};var za={encode:ya,B:!1,C:""};const Aa=[I("ae"),"a",I("oe"),"o",I("sh"),"s",I("th"),"t",I("ph"),"f",I("pf"),"f",I("(?![aeo])h(?![aeo])"),"",I("(?!^[aeo])h(?!^[aeo])"),""];function ya(a,b){a&&(a=ua.call(this,a).join(" "),2<a.length&&(a=F(a,Aa)),b||(1<a.length&&(a=J(a)),a&&(a=a.split(" "))));return a||[]};var Ca={encode:Ba,B:!1,C:""};const Da=I("(?!\\b)[aeo]");function Ba(a){a&&(a=ya.call(this,a,!0),1<a.length&&(a=a.replace(Da,"")),1<a.length&&(a=J(a)),a&&(a=a.split(" ")));return a||[]};L["latin:default"]=da;L["latin:simple"]=sa;L["latin:balance"]=va;L["latin:advanced"]=za;L["latin:extra"]=Ca;const X=self;let Y;const Z={Index:O,Document:T,Worker:null,registerCharset:function(a,b){L[a]=b},registerLanguage:function(a,b){ea[a]=b}};(Y=X.define)&&Y.amd?Y([],function(){return Z}):X.exports?X.exports=Z:X.FlexSearch=Z;}(this));
|
||||
function H(a,b){const c=Object.keys(a),e=c.length,d=[];let f="",g=0;for(let h=0,k,m;h<e;h++)k=c[h],(m=a[k])?(d[g++]=I(b?"(?!\\b)"+k+"(\\b|_)":k),d[g++]=m):f+=(f?"|":"")+k;f&&(d[g++]=I(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),d[g]="");return d}function F(a,b){for(let c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function I(a){return new RegExp(a,"g")}function J(a){let b="",c="";for(let e=0,d=a.length,f;e<d;e++)(f=a[e])!==c&&(b+=c=f);return b};var da={encode:K,B:!1,C:""};function K(a){return E.call(this,(""+a).toLowerCase(),!1)};const L={},M={};function ea(a){O(a,"add");O(a,"append");O(a,"search");O(a,"update");O(a,"remove")}function O(a,b){a[b+"Async"]=function(){const c=this,e=arguments;var d=e[e.length-1];let f;"function"===typeof d&&(f=d,delete e[e.length-1]);d=new Promise(function(g){setTimeout(function(){c.async=!0;const h=c[b].apply(c,e);c.async=!1;g(h)})});return f?(d.then(f),this):d}};function fa(a,b,c,e){const d=a.length;let f=[],g,h,k=0;e&&(e=[]);for(let m=d-1;0<=m;m--){const n=a[m],u=n.length,q=z();let r=!g;for(let l=0;l<u;l++){const p=n[l],A=p.length;if(A)for(let B=0,y,x;B<A;B++)if(x=p[B],g){if(g[x]){if(!m)if(c)c--;else if(f[k++]=x,k===b)return f;if(m||e)q[x]=1;r=!0}if(e&&(y=(h[x]||0)+1,h[x]=y,y<d)){const G=e[y-2]||(e[y-2]=[]);G[G.length]=x}}else q[x]=1}if(e)g||(h=q);else if(!r)return[];g=q}if(e)for(let m=e.length-1,n,u;0<=m;m--){n=e[m];u=n.length;for(let q=0,r;q<u;q++)if(r=
|
||||
n[q],!g[r]){if(c)c--;else if(f[k++]=r,k===b)return f;g[r]=1}}return f}function ia(a,b){const c=z(),e=z(),d=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,g;f<b.length;f++){g=b[f];for(let h=0,k;h<g.length;h++)k=g[h],c[k]&&!e[k]&&(e[k]=1,d[d.length]=k)}return d};const ja={memory:{charset:"latin:extra",A:3,m:4,D:!1},performance:{A:3,m:3,s:!1,context:{depth:2,A:1}},match:{charset:"latin:extra",C:"reverse"},score:{charset:"latin:advanced",A:20,m:3,context:{depth:3,A:9}},"default":{}};function P(a,b){if(!(this instanceof P))return new P(a);var c;let e;a?(C(a)?a=ja[a]:(c=a.preset)&&(a=Object.assign({},c[c],a)),c=a.charset,e=a.lang,C(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=M[c]),C(e)&&(e=L[e])):a={};let d,f,g=a.context||{};this.encode=a.encode||c&&c.encode||K;this.register=b||z();this.A=d=a.resolution||9;this.C=b=c&&c.C||a.tokenize||"strict";this.depth="strict"===b&&g.depth;this.h=v(g.bidirectional);this.s=f=v(a.optimize);this.D=v(a.fastupdate);this.m=a.minlength||1;this.F=a.boost;
|
||||
this.map=f?w(d):z();this.o=d=g.resolution||1;this.l=f?w(d):z();this.B=c&&c.B||a.rtl;this.G=(b=a.matcher||e&&e.G)&&H(b,!1);this.H=(b=a.stemmer||e&&e.H)&&H(b,!0);if(a=b=a.filter||e&&e.filter){a=b;c=z();for(let h=0,k=a.length;h<k;h++)c[a[h]]=1;a=c}this.filter=a}t=P.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,e){if(b&&(a||0===a)){if(!e&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(e=b.length){const m=z(),n=z(),u=this.depth,q=this.A;for(let r=0;r<e;r++){let l=b[this.B?e-1-r:r];var d=l.length;if(l&&d>=this.m&&(u||!n[l])){var f=Q(q,e,r),g="";switch(this.C){case "full":if(2<d){for(f=0;f<d;f++)for(var h=d;h>f;h--)if(h-f>=this.m){var k=Q(q,e,r,d,f);g=l.substring(f,h);S(this,n,g,k,a,c)}break}case "reverse":if(1<d){for(h=d-1;0<h;h--)g=l[h]+g,g.length>=this.m&&S(this,n,
|
||||
g,Q(q,e,r,d,h),a,c);g=""}case "forward":if(1<d){for(h=0;h<d;h++)g+=l[h],g.length>=this.m&&S(this,n,g,f,a,c);break}default:if(this.F&&(f=Math.min(f/this.F(b,l,r)|0,q-1)),S(this,n,l,f,a,c),u&&1<e&&r<e-1)for(d=z(),g=this.o,f=l,h=Math.min(u+1,e-r),d[f]=1,k=1;k<h;k++)if((l=b[this.B?e-1-r-k:r+k])&&l.length>=this.m&&!d[l]){d[l]=1;const p=this.h&&l>f;S(this,m,p?f:l,Q(g+(e/2>g?0:1),e,r,h-1,k-1),a,c,p?l:f)}}}}this.D||(this.register[a]=1)}}return this};
|
||||
function Q(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 S(a,b,c,e,d,f,g){let h=g?a.l:a.map;if(!b[c]||g&&!b[c][g])a.s&&(h=h[e]),g?(b=b[c]||(b[c]=z()),b[g]=1,h=h[g]||(h[g]=z())):b[c]=1,h=h[c]||(h[c]=[]),a.s||(h=h[e]||(h[e]=[])),f&&h.includes(d)||(h[h.length]=d,a.D&&(a=a.register[d]||(a.register[d]=[]),a[a.length]=h))}
|
||||
t.search=function(a,b,c){c||(!b&&D(a)?(c=a,a=c.query):D(b)&&(c=b));let e=[],d;let f,g=0;if(c){a=c.query||a;b=c.limit;g=c.offset||0;var h=c.context;f=c.suggest}if(a&&(a=this.encode(""+a),d=a.length,1<d)){c=z();var k=[];for(let n=0,u=0,q;n<d;n++)if((q=a[n])&&q.length>=this.m&&!c[q])if(this.s||f||this.map[q])k[u++]=q,c[q]=1;else return e;a=k;d=a.length}if(!d)return e;b||(b=100);h=this.depth&&1<d&&!1!==h;c=0;let m;h?(m=a[0],c=1):1<d&&a.sort(aa);for(let n,u;c<d;c++){u=a[c];h?(n=ka(this,e,f,b,g,2===d,u,
|
||||
m),f&&!1===n&&e.length||(m=u)):n=ka(this,e,f,b,g,1===d,u);if(n)return n;if(f&&c===d-1){k=e.length;if(!k){if(h){h=0;c=-1;continue}return e}if(1===k)return la(e[0],b,g)}}return fa(e,b,g,f)};
|
||||
function ka(a,b,c,e,d,f,g,h){let k=[],m=h?a.l:a.map;a.s||(m=ma(m,g,h,a.h));if(m){let n=0;const u=Math.min(m.length,h?a.o:a.A);for(let q=0,r=0,l,p;q<u;q++)if(l=m[q])if(a.s&&(l=ma(l,g,h,a.h)),d&&l&&f&&(p=l.length,p<=d?(d-=p,l=null):(l=l.slice(d),d=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=e)))break;if(n){if(f)return la(k,e,0);b[b.length]=k;return}}return!c&&k}function la(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function ma(a,b,c,e){c?(e=e&&b>c,a=(a=a[e?b:c])&&a[e?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};t.remove=function(a,b){const c=this.register[a];if(c){if(this.D)for(let e=0,d;e<c.length;e++)d=c[e],d.splice(d.indexOf(a),1);else T(this.map,a,this.A,this.s),this.depth&&T(this.l,a,this.o,this.s);b||delete this.register[a]}return this};
|
||||
function T(a,b,c,e,d){let f=0;if(a.constructor===Array)if(d)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{d=Math.min(a.length,c);for(let g=0,h;g<d;g++)if(h=a[g])f=T(h,b,c,e,d),e||f||delete a[g]}else for(let g in a)(f=T(a[g],b,c,e,d))||delete a[g];return f}ea(P.prototype);function U(a){if(!(this instanceof U))return new U(a);var b=a.document||a.doc||a,c;this.F=[];this.h=[];this.o=[];this.register=z();this.key=(c=b.key||b.id)&&V(c,this.o)||"id";this.D=v(a.fastupdate);this.l=(c=b.store)&&!0!==c&&[];this.store=c&&z();this.async=!1;c=z();let e=b.index||b.field||b;C(e)&&(e=[e]);for(let d=0,f,g;d<e.length;d++)f=e[d],C(f)||(g=f,f=f.field),g=D(g)?Object.assign({},a,g):a,this.I||(c[f]=new P(g,this.register)),this.F[d]=V(f,this.o),this.h[d]=f;if(this.l)for(a=b.store,C(a)&&(a=
|
||||
[a]),b=0;b<a.length;b++)this.l[b]=V(a[b],this.o);this.index=c}function V(a,b){const c=a.split(":");let e=0;for(let d=0;d<c.length;d++)a=c[d],0<=a.indexOf("[]")&&(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]}function na(a,b){if(C(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function W(a,b,c,e,d){a=a[d];if(e===c.length-1)b[d]=a;else if(a)if(a.constructor===Array)for(b=b[d]=Array(a.length),d=0;d<a.length;d++)W(a,b,c,e,d);else b=b[d]||(b[d]=z()),d=c[++e],W(a,b,c,e,d)}function X(a,b,c,e,d,f,g,h){if(a=a[g])if(e===b.length-1){if(a.constructor===Array){if(c[e]){for(b=0;b<a.length;b++)d.add(f,a[b],!0,!0);return}a=a.join(" ")}d.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)X(a,b,c,e,d,f,g,h);else g=b[++e],X(a,b,c,e,d,f,g,h)}t=U.prototype;
|
||||
t.add=function(a,b,c){D(a)&&(b=a,a=na(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let e=0,d,f;e<this.h.length;e++)f=this.h[e],d=this.F[e],C(d)&&(d=[d]),X(b,d,this.o,0,this.index[f],a,d[0],c);if(this.store&&(!c||!this.store[a])){let e;if(this.l){e=z();for(let d=0,f;d<this.l.length;d++)f=this.l[d],C(f)?e[f]=b[f]:W(b,e,f,0,f[0])}this.store[a]=e||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){D(a)&&(a=na(a,this.key));if(this.register[a]){for(let b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.I),!this.D);b++);this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,e){c||(!b&&D(a)?(c=a,a=""):D(b)&&(c=b,b=0));let d=[],f=[],g,h,k,m,n,u,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{a=c.query||a;k=(g=c.pluck)||c.index||c.field;m=!1;h=this.store&&c.enrich;n="and"===c.bool;b=c.limit||b||100;u=c.offset||0;if(m&&(C(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=oa.call(this,m[l],b,u,h))d[d.length]=p,q++;return q?d:[]}C(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!e&&(this.I||this.async)&&[];for(let l=0,p,A,B;l<
|
||||
k.length;l++){let y;A=k[l];C(A)||(y=A,A=y.field,a=y.query||a,b=y.limit||b,h=y.enrich||h);if(r)r[l]=this.index[A].searchAsync(a,b,y||c);else{e?p=e[l]:p=this.index[A].search(a,b,y||c);B=p&&p.length;if(m&&B){const x=[];let G=0;n&&(x[0]=[p]);for(let R=0,ha,N;R<m.length;R++)if(ha=m[R],B=(N=this.J[ha])&&N.length)G++,x[x.length]=n?[N]:N;G&&(p=n?fa(x,b||100,u||0):ia(p,x),B=p.length)}if(B)f[q]=A,d[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(A){p(l.search(a,
|
||||
b,c,A))})})}if(!q)return[];if(g&&(!h||!this.store))return d[0];for(let l=0,p;l<f.length;l++){p=d[l];p.length&&h&&(p=pa.call(this,p));if(g)return p;d[l]={field:f[l],result:p}}return d};function oa(a,b,c,e){let d=this.J[a],f=d&&d.length-c;if(f&&0<f){if(f>b||c)d=d.slice(c,c+b);e&&(d=pa.call(this,d));return{tag:a,result: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[e]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};ea(U.prototype);var ra={encode:qa,B:!1,C:""};const sa=[I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",I("[\u00e8\u00e9\u00ea\u00eb]"),"e",I("[\u00ec\u00ed\u00ee\u00ef]"),"i",I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",I("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",I("[\u00fd\u0177\u00ff]"),"y",I("\u00f1"),"n",I("[\u00e7c]"),"k",I("\u00df"),"s",I(" & ")," and "];function qa(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(ca,""));return E.call(this,b.toLowerCase(),!a.normalize&&sa)};var ua={encode:ta,B:!1,C:"strict"};const va=/[^a-z0-9]+/,wa={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function ta(a){a=qa.call(this,a).join(" ");const b=[];if(a){const c=a.split(va),e=c.length;for(let d=0,f,g=0;d<e;d++)if((a=c[d])&&(!this.filter||!this.filter[a])){f=a[0];let h=wa[f]||f,k=h;for(let m=1;m<a.length;m++){f=a[m];const n=wa[f]||f;n&&n!==k&&(h+=n,k=n)}b[g++]=h}}return b};var ya={encode:xa,B:!1,C:""};const za=[I("ae"),"a",I("oe"),"o",I("sh"),"s",I("th"),"t",I("ph"),"f",I("pf"),"f",I("(?![aeo])h(?![aeo])"),"",I("(?!^[aeo])h(?!^[aeo])"),""];function xa(a,b){a&&(a=ta.call(this,a).join(" "),2<a.length&&(a=F(a,za)),b||(1<a.length&&(a=J(a)),a&&(a=a.split(" "))));return a||[]};var Ba={encode:Aa,B:!1,C:""};const Ca=I("(?!\\b)[aeo]");function Aa(a){a&&(a=xa.call(this,a,!0),1<a.length&&(a=a.replace(Ca,"")),1<a.length&&(a=J(a)),a&&(a=a.split(" ")));return a||[]};M["latin:default"]=da;M["latin:simple"]=ra;M["latin:balance"]=ua;M["latin:advanced"]=ya;M["latin:extra"]=Ba;const Y={Index:P,Document:U,Worker:null,registerCharset:function(a,b){M[a]=b},registerLanguage:function(a,b){L[a]=b}};let Z;(Z=self.define)&&Z.amd?Z([],function(){return Y}):self.exports?self.exports=Y:self.FlexSearch=Y;}(this));
|
||||
|
201
dist/flexsearch.compact.module.debug.js
vendored
201
dist/flexsearch.compact.module.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Compact.module)
|
||||
* FlexSearch.js v0.7.40 (Compact.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -78,15 +78,15 @@ function J(a) {
|
||||
function K(a) {
|
||||
return E.call(this, ("" + a).toLowerCase(), !1);
|
||||
}
|
||||
;const ea = {}, L = {};
|
||||
function fa(a) {
|
||||
M(a, "add");
|
||||
M(a, "append");
|
||||
M(a, "search");
|
||||
M(a, "update");
|
||||
M(a, "remove");
|
||||
;const L = {}, M = {};
|
||||
function O(a) {
|
||||
P(a, "add");
|
||||
P(a, "append");
|
||||
P(a, "search");
|
||||
P(a, "update");
|
||||
P(a, "remove");
|
||||
}
|
||||
function M(a, b) {
|
||||
function P(a, b) {
|
||||
a[b + "Async"] = function() {
|
||||
const c = this, e = arguments;
|
||||
var d = e[e.length - 1];
|
||||
@@ -103,7 +103,7 @@ function M(a, b) {
|
||||
return f ? (d.then(f), this) : d;
|
||||
};
|
||||
}
|
||||
;function ha(a, b, c, e) {
|
||||
;function Q(a, b, c, e) {
|
||||
const d = a.length;
|
||||
let f = [], g, h, k = 0;
|
||||
e && (e = []);
|
||||
@@ -167,7 +167,7 @@ function M(a, b) {
|
||||
}
|
||||
return f;
|
||||
}
|
||||
function ia(a, b) {
|
||||
function ea(a, b) {
|
||||
const c = z(), e = z(), d = [];
|
||||
for (let f = 0; f < a.length; f++) {
|
||||
c[a[f]] = 1;
|
||||
@@ -180,16 +180,16 @@ function ia(a, b) {
|
||||
}
|
||||
return d;
|
||||
}
|
||||
;const ka = {memory:{charset:"latin:extra", A:3, m:4, D:!1}, performance:{A:3, m:3, s:!1, context:{depth:2, A:1}}, match:{charset:"latin:extra", C:"reverse"}, score:{charset:"latin:advanced", A:20, m:3, context:{depth:3, A:9}}, "default":{}};
|
||||
function O(a, b) {
|
||||
if (!(this instanceof O)) {
|
||||
return new O(a);
|
||||
;const ha = {memory:{charset:"latin:extra", A:3, m:4, D:!1}, performance:{A:3, m:3, s:!1, context:{depth:2, A:1}}, match:{charset:"latin:extra", C:"reverse"}, score:{charset:"latin:advanced", A:20, m:3, context:{depth:3, A:9}}, "default":{}};
|
||||
function S(a, b) {
|
||||
if (!(this instanceof S)) {
|
||||
return new S(a);
|
||||
}
|
||||
var c;
|
||||
let e;
|
||||
if (a) {
|
||||
if (C(a)) {
|
||||
ka[a] || console.warn("Preset not found: " + a), a = ka[a];
|
||||
ha[a] || console.warn("Preset not found: " + a), a = ha[a];
|
||||
} else {
|
||||
if (c = a.preset) {
|
||||
c[c] || console.warn("Preset not found: " + c), a = Object.assign({}, c[c], a);
|
||||
@@ -197,8 +197,8 @@ function O(a, b) {
|
||||
}
|
||||
c = a.charset;
|
||||
e = a.lang;
|
||||
C(c) && (-1 === c.indexOf(":") && (c += ":default"), c = L[c]);
|
||||
C(e) && (e = ea[e]);
|
||||
C(c) && (-1 === c.indexOf(":") && (c += ":default"), c = M[c]);
|
||||
C(e) && (e = L[e]);
|
||||
} else {
|
||||
a = {};
|
||||
}
|
||||
@@ -229,7 +229,7 @@ function O(a, b) {
|
||||
}
|
||||
this.filter = a;
|
||||
}
|
||||
t = O.prototype;
|
||||
t = S.prototype;
|
||||
t.append = function(a, b) {
|
||||
return this.add(a, b, !0);
|
||||
};
|
||||
@@ -245,16 +245,16 @@ t.add = function(a, b, c, e) {
|
||||
let l = b[this.B ? e - 1 - r : r];
|
||||
var d = l.length;
|
||||
if (l && d >= this.m && (u || !n[l])) {
|
||||
var f = P(q, e, r), g = "";
|
||||
var f = T(q, e, r), g = "";
|
||||
switch(this.C) {
|
||||
case "full":
|
||||
if (2 < d) {
|
||||
for (f = 0; f < d; f++) {
|
||||
for (var h = d; h > f; h--) {
|
||||
if (h - f >= this.m) {
|
||||
var k = P(q, e, r, d, f);
|
||||
var k = T(q, e, r, d, f);
|
||||
g = l.substring(f, h);
|
||||
Q(this, n, g, k, a, c);
|
||||
U(this, n, g, k, a, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,24 +263,24 @@ t.add = function(a, b, c, e) {
|
||||
case "reverse":
|
||||
if (1 < d) {
|
||||
for (h = d - 1; 0 < h; h--) {
|
||||
g = l[h] + g, g.length >= this.m && Q(this, n, g, P(q, e, r, d, h), a, c);
|
||||
g = l[h] + g, g.length >= this.m && U(this, n, g, T(q, e, r, d, h), a, c);
|
||||
}
|
||||
g = "";
|
||||
}
|
||||
case "forward":
|
||||
if (1 < d) {
|
||||
for (h = 0; h < d; h++) {
|
||||
g += l[h], g.length >= this.m && Q(this, n, g, f, a, c);
|
||||
g += l[h], g.length >= this.m && U(this, n, g, f, a, c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (this.F && (f = Math.min(f / this.F(b, l, r) | 0, q - 1)), Q(this, n, l, f, a, c), u && 1 < e && r < e - 1) {
|
||||
if (this.F && (f = Math.min(f / this.F(b, l, r) | 0, q - 1)), U(this, n, l, f, a, c), u && 1 < e && r < e - 1) {
|
||||
for (d = z(), g = this.o, f = l, h = Math.min(u + 1, e - r), d[f] = 1, k = 1; k < h; k++) {
|
||||
if ((l = b[this.B ? e - 1 - r - k : r + k]) && l.length >= this.m && !d[l]) {
|
||||
d[l] = 1;
|
||||
const p = this.h && l > f;
|
||||
Q(this, m, p ? f : l, P(g + (e / 2 > g ? 0 : 1), e, r, h - 1, k - 1), a, c, p ? l : f);
|
||||
U(this, m, p ? f : l, T(g + (e / 2 > g ? 0 : 1), e, r, h - 1, k - 1), a, c, p ? l : f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,10 +292,10 @@ t.add = function(a, b, c, e) {
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function P(a, b, c, e, d) {
|
||||
function T(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 Q(a, b, c, e, d, f, g) {
|
||||
function U(a, b, c, e, d, f, g) {
|
||||
let h = g ? a.l : a.map;
|
||||
if (!b[c] || g && !b[c][g]) {
|
||||
a.s && (h = h[e]), g ? (b = b[c] || (b[c] = z()), b[g] = 1, h = h[g] || (h[g] = z())) : b[c] = 1, h = h[c] || (h[c] = []), a.s || (h = h[e] || (h[e] = [])), f && h.includes(d) || (h[h.length] = d, a.D && (a = a.register[d] || (a.register[d] = []), a[a.length] = h));
|
||||
@@ -337,7 +337,7 @@ t.search = function(a, b, c) {
|
||||
h ? (m = a[0], c = 1) : 1 < d && a.sort(aa);
|
||||
for (let n, u; c < d; c++) {
|
||||
u = a[c];
|
||||
h ? (n = la(this, e, f, b, g, 2 === d, u, m), f && !1 === n && e.length || (m = u)) : n = la(this, e, f, b, g, 1 === d, u);
|
||||
h ? (n = ia(this, e, f, b, g, 2 === d, u, m), f && !1 === n && e.length || (m = u)) : n = ia(this, e, f, b, g, 1 === d, u);
|
||||
if (n) {
|
||||
return n;
|
||||
}
|
||||
@@ -352,28 +352,28 @@ t.search = function(a, b, c) {
|
||||
return e;
|
||||
}
|
||||
if (1 === k) {
|
||||
return ma(e[0], b, g);
|
||||
return ja(e[0], b, g);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ha(e, b, g, f);
|
||||
return Q(e, b, g, f);
|
||||
};
|
||||
function la(a, b, c, e, d, f, g, h) {
|
||||
function ia(a, b, c, e, d, f, g, h) {
|
||||
let k = [], m = h ? a.l : a.map;
|
||||
a.s || (m = na(m, g, h, a.h));
|
||||
a.s || (m = ka(m, g, h, a.h));
|
||||
if (m) {
|
||||
let n = 0;
|
||||
const u = Math.min(m.length, h ? a.o : a.A);
|
||||
for (let q = 0, r = 0, l, p; q < u; q++) {
|
||||
if (l = m[q]) {
|
||||
if (a.s && (l = na(l, g, h, a.h)), d && l && f && (p = l.length, p <= d ? (d -= p, l = null) : (l = l.slice(d), d = 0)), l && (k[n++] = l, f && (r += l.length, r >= e))) {
|
||||
if (a.s && (l = ka(l, g, h, a.h)), d && l && f && (p = l.length, p <= d ? (d -= p, l = null) : (l = l.slice(d), d = 0)), l && (k[n++] = l, f && (r += l.length, r >= e))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (n) {
|
||||
if (f) {
|
||||
return ma(k, e, 0);
|
||||
return ja(k, e, 0);
|
||||
}
|
||||
b[b.length] = k;
|
||||
return;
|
||||
@@ -381,11 +381,11 @@ function la(a, b, c, e, d, f, g, h) {
|
||||
}
|
||||
return !c && k;
|
||||
}
|
||||
function ma(a, b, c) {
|
||||
function ja(a, b, c) {
|
||||
a = 1 === a.length ? a[0] : [].concat.apply([], a);
|
||||
return c || a.length > b ? a.slice(c, c + b) : a;
|
||||
}
|
||||
function na(a, b, c, e) {
|
||||
function ka(a, b, c, e) {
|
||||
c ? (e = e && b > c, a = (a = a[e ? b : c]) && a[e ? c : b]) : a = a[b];
|
||||
return a;
|
||||
}
|
||||
@@ -403,13 +403,13 @@ t.remove = function(a, b) {
|
||||
d = c[e], d.splice(d.indexOf(a), 1);
|
||||
}
|
||||
} else {
|
||||
R(this.map, a, this.A, this.s), this.depth && R(this.l, a, this.o, this.s);
|
||||
V(this.map, a, this.A, this.s), this.depth && V(this.l, a, this.o, this.s);
|
||||
}
|
||||
b || delete this.register[a];
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function R(a, b, c, e, d) {
|
||||
function V(a, b, c, e, d) {
|
||||
let f = 0;
|
||||
if (a.constructor === Array) {
|
||||
if (d) {
|
||||
@@ -418,28 +418,28 @@ function R(a, b, c, e, d) {
|
||||
d = Math.min(a.length, c);
|
||||
for (let g = 0, h; g < d; g++) {
|
||||
if (h = a[g]) {
|
||||
f = R(h, b, c, e, d), e || f || delete a[g];
|
||||
f = V(h, b, c, e, d), e || f || delete a[g];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let g in a) {
|
||||
(f = R(a[g], b, c, e, d)) || delete a[g];
|
||||
(f = V(a[g], b, c, e, d)) || delete a[g];
|
||||
}
|
||||
}
|
||||
return f;
|
||||
}
|
||||
fa(O.prototype);
|
||||
function T(a) {
|
||||
if (!(this instanceof T)) {
|
||||
return new T(a);
|
||||
O(S.prototype);
|
||||
function W(a) {
|
||||
if (!(this instanceof W)) {
|
||||
return new W(a);
|
||||
}
|
||||
var b = a.document || a.doc || a, c;
|
||||
this.F = [];
|
||||
this.h = [];
|
||||
this.o = [];
|
||||
this.register = z();
|
||||
this.key = (c = b.key || b.id) && U(c, this.o) || "id";
|
||||
this.key = (c = b.key || b.id) && X(c, this.o) || "id";
|
||||
this.D = v(a.fastupdate);
|
||||
this.l = (c = b.store) && !0 !== c && [];
|
||||
this.store = c && z();
|
||||
@@ -448,16 +448,16 @@ function T(a) {
|
||||
let e = b.index || b.field || b;
|
||||
C(e) && (e = [e]);
|
||||
for (let d = 0, f, g; d < e.length; d++) {
|
||||
f = e[d], C(f) || (g = f, f = f.field), g = D(g) ? Object.assign({}, a, g) : a, this.I || (c[f] = new O(g, this.register)), this.F[d] = U(f, this.o), this.h[d] = f;
|
||||
f = e[d], C(f) || (g = f, f = f.field), g = D(g) ? Object.assign({}, a, g) : a, this.I || (c[f] = new S(g, this.register)), this.F[d] = X(f, this.o), this.h[d] = f;
|
||||
}
|
||||
if (this.l) {
|
||||
for (a = b.store, C(a) && (a = [a]), b = 0; b < a.length; b++) {
|
||||
this.l[b] = U(a[b], this.o);
|
||||
this.l[b] = X(a[b], this.o);
|
||||
}
|
||||
}
|
||||
this.index = c;
|
||||
}
|
||||
function U(a, b) {
|
||||
function X(a, b) {
|
||||
const c = a.split(":");
|
||||
let e = 0;
|
||||
for (let d = 0; d < c.length; d++) {
|
||||
@@ -466,7 +466,7 @@ function U(a, b) {
|
||||
e < c.length && (c.length = e);
|
||||
return 1 < e ? c : c[0];
|
||||
}
|
||||
function oa(a, b) {
|
||||
function la(a, b) {
|
||||
if (C(b)) {
|
||||
a = a[b];
|
||||
} else {
|
||||
@@ -476,21 +476,21 @@ function oa(a, b) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
function V(a, b, c, e, d) {
|
||||
function Y(a, b, c, e, d) {
|
||||
a = a[d];
|
||||
if (e === c.length - 1) {
|
||||
b[d] = a;
|
||||
} else if (a) {
|
||||
if (a.constructor === Array) {
|
||||
for (b = b[d] = Array(a.length), d = 0; d < a.length; d++) {
|
||||
V(a, b, c, e, d);
|
||||
Y(a, b, c, e, d);
|
||||
}
|
||||
} else {
|
||||
b = b[d] || (b[d] = z()), d = c[++e], V(a, b, c, e, d);
|
||||
b = b[d] || (b[d] = z()), d = c[++e], Y(a, b, c, e, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
function W(a, b, c, e, d, f, g, h) {
|
||||
function Z(a, b, c, e, d, f, g, h) {
|
||||
if (a = a[g]) {
|
||||
if (e === b.length - 1) {
|
||||
if (a.constructor === Array) {
|
||||
@@ -506,30 +506,30 @@ function W(a, b, c, e, d, f, g, h) {
|
||||
} else {
|
||||
if (a.constructor === Array) {
|
||||
for (g = 0; g < a.length; g++) {
|
||||
W(a, b, c, e, d, f, g, h);
|
||||
Z(a, b, c, e, d, f, g, h);
|
||||
}
|
||||
} else {
|
||||
g = b[++e], W(a, b, c, e, d, f, g, h);
|
||||
g = b[++e], Z(a, b, c, e, d, f, g, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
t = T.prototype;
|
||||
t = W.prototype;
|
||||
t.add = function(a, b, c) {
|
||||
D(a) && (b = a, a = oa(b, this.key));
|
||||
D(a) && (b = a, a = la(b, this.key));
|
||||
if (b && (a || 0 === a)) {
|
||||
if (!c && this.register[a]) {
|
||||
return this.update(a, b);
|
||||
}
|
||||
for (let e = 0, d, f; e < this.h.length; e++) {
|
||||
f = this.h[e], d = this.F[e], C(d) && (d = [d]), W(b, d, this.o, 0, this.index[f], a, d[0], c);
|
||||
f = this.h[e], d = this.F[e], C(d) && (d = [d]), Z(b, d, this.o, 0, this.index[f], a, d[0], c);
|
||||
}
|
||||
if (this.store && (!c || !this.store[a])) {
|
||||
let e;
|
||||
if (this.l) {
|
||||
e = z();
|
||||
for (let d = 0, f; d < this.l.length; d++) {
|
||||
f = this.l[d], C(f) ? e[f] = b[f] : V(b, e, f, 0, f[0]);
|
||||
f = this.l[d], C(f) ? e[f] = b[f] : Y(b, e, f, 0, f[0]);
|
||||
}
|
||||
}
|
||||
this.store[a] = e || b;
|
||||
@@ -544,7 +544,7 @@ t.update = function(a, b) {
|
||||
return this.remove(a).add(a, b);
|
||||
};
|
||||
t.remove = function(a) {
|
||||
D(a) && (a = oa(a, this.key));
|
||||
D(a) && (a = la(a, this.key));
|
||||
if (this.register[a]) {
|
||||
for (let b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.I), !this.D); b++) {
|
||||
}
|
||||
@@ -569,7 +569,7 @@ t.search = function(a, b, c, e) {
|
||||
u = c.offset || 0;
|
||||
if (m && (C(m) && (m = [m]), !a)) {
|
||||
for (let l = 0, p; l < m.length; l++) {
|
||||
if (p = pa.call(this, m[l], b, u, h)) {
|
||||
if (p = ma.call(this, m[l], b, u, h)) {
|
||||
d[d.length] = p, q++;
|
||||
}
|
||||
}
|
||||
@@ -594,12 +594,12 @@ t.search = function(a, b, c, e) {
|
||||
const x = [];
|
||||
let G = 0;
|
||||
n && (x[0] = [p]);
|
||||
for (let S = 0, ja, N; S < m.length; S++) {
|
||||
if (ja = m[S], B = (N = this.J[ja]) && N.length) {
|
||||
for (let R = 0, fa, N; R < m.length; R++) {
|
||||
if (fa = m[R], B = (N = this.J[fa]) && N.length) {
|
||||
G++, x[x.length] = n ? [N] : N;
|
||||
}
|
||||
}
|
||||
G && (p = n ? ha(x, b || 100, u || 0) : ia(p, x), B = p.length);
|
||||
G && (p = n ? Q(x, b || 100, u || 0) : ea(p, x), B = p.length);
|
||||
}
|
||||
if (B) {
|
||||
f[q] = A, d[q++] = p;
|
||||
@@ -624,7 +624,7 @@ t.search = function(a, b, c, e) {
|
||||
}
|
||||
for (let l = 0, p; l < f.length; l++) {
|
||||
p = d[l];
|
||||
p.length && h && (p = qa.call(this, p));
|
||||
p.length && h && (p = na.call(this, p));
|
||||
if (g) {
|
||||
return p;
|
||||
}
|
||||
@@ -632,17 +632,17 @@ t.search = function(a, b, c, e) {
|
||||
}
|
||||
return d;
|
||||
};
|
||||
function pa(a, b, c, e) {
|
||||
function ma(a, b, c, e) {
|
||||
let d = this.J[a], f = d && d.length - c;
|
||||
if (f && 0 < f) {
|
||||
if (f > b || c) {
|
||||
d = d.slice(c, c + b);
|
||||
}
|
||||
e && (d = qa.call(this, d));
|
||||
e && (d = na.call(this, d));
|
||||
return {tag:a, result:d};
|
||||
}
|
||||
}
|
||||
function qa(a) {
|
||||
function na(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[e]};
|
||||
@@ -659,28 +659,28 @@ t.set = function(a, b) {
|
||||
this.store[a] = b;
|
||||
return this;
|
||||
};
|
||||
fa(T.prototype);
|
||||
var sa = {encode:ra, B:!1, C:""};
|
||||
const ta = [I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", I("[\u00e8\u00e9\u00ea\u00eb]"), "e", I("[\u00ec\u00ed\u00ee\u00ef]"), "i", I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", I("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", I("[\u00fd\u0177\u00ff]"), "y", I("\u00f1"), "n", I("[\u00e7c]"), "k", I("\u00df"), "s", I(" & "), " and "];
|
||||
function ra(a) {
|
||||
O(W.prototype);
|
||||
var pa = {encode:oa, B:!1, C:""};
|
||||
const qa = [I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", I("[\u00e8\u00e9\u00ea\u00eb]"), "e", I("[\u00ec\u00ed\u00ee\u00ef]"), "i", I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", I("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", I("[\u00fd\u0177\u00ff]"), "y", I("\u00f1"), "n", I("[\u00e7c]"), "k", I("\u00df"), "s", I(" & "), " and "];
|
||||
function oa(a) {
|
||||
var b = a = "" + a;
|
||||
b.normalize && (b = b.normalize("NFD").replace(ca, ""));
|
||||
return E.call(this, b.toLowerCase(), !a.normalize && ta);
|
||||
return E.call(this, b.toLowerCase(), !a.normalize && qa);
|
||||
}
|
||||
;var va = {encode:ua, B:!1, C:"strict"};
|
||||
const wa = /[^a-z0-9]+/, xa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function ua(a) {
|
||||
a = ra.call(this, a).join(" ");
|
||||
;var sa = {encode:ra, B:!1, C:"strict"};
|
||||
const ta = /[^a-z0-9]+/, ua = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function ra(a) {
|
||||
a = oa.call(this, a).join(" ");
|
||||
const b = [];
|
||||
if (a) {
|
||||
const c = a.split(wa), e = c.length;
|
||||
const c = a.split(ta), e = c.length;
|
||||
for (let d = 0, f, g = 0; d < e; d++) {
|
||||
if ((a = c[d]) && (!this.filter || !this.filter[a])) {
|
||||
f = a[0];
|
||||
let h = xa[f] || f, k = h;
|
||||
let h = ua[f] || f, k = h;
|
||||
for (let m = 1; m < a.length; m++) {
|
||||
f = a[m];
|
||||
const n = xa[f] || f;
|
||||
const n = ua[f] || f;
|
||||
n && n !== k && (h += n, k = n);
|
||||
}
|
||||
b[g++] = h;
|
||||
@@ -689,31 +689,26 @@ function ua(a) {
|
||||
}
|
||||
return b;
|
||||
}
|
||||
;var wa = {encode:va, B:!1, C:""};
|
||||
const xa = [I("ae"), "a", I("oe"), "o", I("sh"), "s", I("th"), "t", I("ph"), "f", I("pf"), "f", I("(?![aeo])h(?![aeo])"), "", I("(?!^[aeo])h(?!^[aeo])"), ""];
|
||||
function va(a, b) {
|
||||
a && (a = ra.call(this, a).join(" "), 2 < a.length && (a = F(a, xa)), b || (1 < a.length && (a = J(a)), a && (a = a.split(" "))));
|
||||
return a || [];
|
||||
}
|
||||
;var za = {encode:ya, B:!1, C:""};
|
||||
const Aa = [I("ae"), "a", I("oe"), "o", I("sh"), "s", I("th"), "t", I("ph"), "f", I("pf"), "f", I("(?![aeo])h(?![aeo])"), "", I("(?!^[aeo])h(?!^[aeo])"), ""];
|
||||
function ya(a, b) {
|
||||
a && (a = ua.call(this, a).join(" "), 2 < a.length && (a = F(a, Aa)), b || (1 < a.length && (a = J(a)), a && (a = a.split(" "))));
|
||||
const Aa = I("(?!\\b)[aeo]");
|
||||
function ya(a) {
|
||||
a && (a = va.call(this, a, !0), 1 < a.length && (a = a.replace(Aa, "")), 1 < a.length && (a = J(a)), a && (a = a.split(" ")));
|
||||
return a || [];
|
||||
}
|
||||
;var Ca = {encode:Ba, B:!1, C:""};
|
||||
const Da = I("(?!\\b)[aeo]");
|
||||
function Ba(a) {
|
||||
a && (a = ya.call(this, a, !0), 1 < a.length && (a = a.replace(Da, "")), 1 < a.length && (a = J(a)), a && (a = a.split(" ")));
|
||||
return a || [];
|
||||
}
|
||||
;L["latin:default"] = da;
|
||||
L["latin:simple"] = sa;
|
||||
L["latin:balance"] = va;
|
||||
L["latin:advanced"] = za;
|
||||
L["latin:extra"] = Ca;
|
||||
const X = self;
|
||||
let Y;
|
||||
const Z = {Index:O, Document:T, Worker:null, registerCharset:function(a, b) {
|
||||
L[a] = b;
|
||||
;M["latin:default"] = da;
|
||||
M["latin:simple"] = pa;
|
||||
M["latin:balance"] = sa;
|
||||
M["latin:advanced"] = wa;
|
||||
M["latin:extra"] = za;
|
||||
export default {Index:S, Document:W, Worker:null, registerCharset:function(a, b) {
|
||||
M[a] = b;
|
||||
}, registerLanguage:function(a, b) {
|
||||
ea[a] = b;
|
||||
L[a] = b;
|
||||
}};
|
||||
(Y = X.define) && Y.amd ? Y([], function() {
|
||||
return Z;
|
||||
}) : X.exports ? X.exports = Z : X.FlexSearch = Z;
|
||||
}(this));
|
||||
|
40
dist/flexsearch.compact.module.min.js
vendored
40
dist/flexsearch.compact.module.min.js
vendored
@@ -1,27 +1,27 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Compact.module)
|
||||
* FlexSearch.js v0.7.40 (Compact.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
(function(self){'use strict';var t;function v(a){return"undefined"!==typeof a?a:!0}function w(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=z();return b}function z(){return Object.create(null)}function aa(a,b){return b.length-a.length}function C(a){return"string"===typeof a}function D(a){return"object"===typeof a};function E(a,b){var c=ba;if(a&&(b&&(a=F(a,b)),this.G&&(a=F(a,this.G)),this.H&&1<a.length&&(a=F(a,this.H)),c||""===c)){b=a.split(c);if(this.filter){a=this.filter;c=b.length;const e=[];for(let d=0,f=0;d<c;d++){const g=b[d];g&&!a[g]&&(e[f++]=g)}a=e}else a=b;return a}return a}const ba=/[\p{Z}\p{S}\p{P}\p{C}]+/u,ca=/[\u0300-\u036f]/g;
|
||||
function H(a,b){const c=Object.keys(a),e=c.length,d=[];let f="",g=0;for(let h=0,k,m;h<e;h++)k=c[h],(m=a[k])?(d[g++]=I(b?"(?!\\b)"+k+"(\\b|_)":k),d[g++]=m):f+=(f?"|":"")+k;f&&(d[g++]=I(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),d[g]="");return d}function F(a,b){for(let c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function I(a){return new RegExp(a,"g")}function J(a){let b="",c="";for(let e=0,d=a.length,f;e<d;e++)(f=a[e])!==c&&(b+=c=f);return b};var da={encode:K,B:!1,C:""};function K(a){return E.call(this,(""+a).toLowerCase(),!1)};const ea={},L={};function fa(a){M(a,"add");M(a,"append");M(a,"search");M(a,"update");M(a,"remove")}function M(a,b){a[b+"Async"]=function(){const c=this,e=arguments;var d=e[e.length-1];let f;"function"===typeof d&&(f=d,delete e[e.length-1]);d=new Promise(function(g){setTimeout(function(){c.async=!0;const h=c[b].apply(c,e);c.async=!1;g(h)})});return f?(d.then(f),this):d}};function ha(a,b,c,e){const d=a.length;let f=[],g,h,k=0;e&&(e=[]);for(let m=d-1;0<=m;m--){const n=a[m],u=n.length,q=z();let r=!g;for(let l=0;l<u;l++){const p=n[l],A=p.length;if(A)for(let B=0,y,x;B<A;B++)if(x=p[B],g){if(g[x]){if(!m)if(c)c--;else if(f[k++]=x,k===b)return f;if(m||e)q[x]=1;r=!0}if(e&&(y=(h[x]||0)+1,h[x]=y,y<d)){const G=e[y-2]||(e[y-2]=[]);G[G.length]=x}}else q[x]=1}if(e)g||(h=q);else if(!r)return[];g=q}if(e)for(let m=e.length-1,n,u;0<=m;m--){n=e[m];u=n.length;for(let q=0,r;q<u;q++)if(r=
|
||||
n[q],!g[r]){if(c)c--;else if(f[k++]=r,k===b)return f;g[r]=1}}return f}function ja(a,b){const c=z(),e=z(),d=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,g;f<b.length;f++){g=b[f];for(let h=0,k;h<g.length;h++)k=g[h],c[k]&&!e[k]&&(e[k]=1,d[d.length]=k)}return d};const ka={memory:{charset:"latin:extra",A:3,m:4,D:!1},performance:{A:3,m:3,s:!1,context:{depth:2,A:1}},match:{charset:"latin:extra",C:"reverse"},score:{charset:"latin:advanced",A:20,m:3,context:{depth:3,A:9}},"default":{}};function O(a,b){if(!(this instanceof O))return new O(a);var c;let e;a?(C(a)?a=ka[a]:(c=a.preset)&&(a=Object.assign({},c[c],a)),c=a.charset,e=a.lang,C(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=L[c]),C(e)&&(e=ea[e])):a={};let d,f,g=a.context||{};this.encode=a.encode||c&&c.encode||K;this.register=b||z();this.A=d=a.resolution||9;this.C=b=c&&c.C||a.tokenize||"strict";this.depth="strict"===b&&g.depth;this.h=v(g.bidirectional);this.s=f=v(a.optimize);this.D=v(a.fastupdate);this.m=a.minlength||1;this.F=
|
||||
a.boost;this.map=f?w(d):z();this.o=d=g.resolution||1;this.l=f?w(d):z();this.B=c&&c.B||a.rtl;this.G=(b=a.matcher||e&&e.G)&&H(b,!1);this.H=(b=a.stemmer||e&&e.H)&&H(b,!0);if(a=b=a.filter||e&&e.filter){a=b;c=z();for(let h=0,k=a.length;h<k;h++)c[a[h]]=1;a=c}this.filter=a}t=O.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,e){if(b&&(a||0===a)){if(!e&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(e=b.length){const m=z(),n=z(),u=this.depth,q=this.A;for(let r=0;r<e;r++){let l=b[this.B?e-1-r:r];var d=l.length;if(l&&d>=this.m&&(u||!n[l])){var f=P(q,e,r),g="";switch(this.C){case "full":if(2<d){for(f=0;f<d;f++)for(var h=d;h>f;h--)if(h-f>=this.m){var k=P(q,e,r,d,f);g=l.substring(f,h);Q(this,n,g,k,a,c)}break}case "reverse":if(1<d){for(h=d-1;0<h;h--)g=l[h]+g,g.length>=this.m&&Q(this,n,
|
||||
g,P(q,e,r,d,h),a,c);g=""}case "forward":if(1<d){for(h=0;h<d;h++)g+=l[h],g.length>=this.m&&Q(this,n,g,f,a,c);break}default:if(this.F&&(f=Math.min(f/this.F(b,l,r)|0,q-1)),Q(this,n,l,f,a,c),u&&1<e&&r<e-1)for(d=z(),g=this.o,f=l,h=Math.min(u+1,e-r),d[f]=1,k=1;k<h;k++)if((l=b[this.B?e-1-r-k:r+k])&&l.length>=this.m&&!d[l]){d[l]=1;const p=this.h&&l>f;Q(this,m,p?f:l,P(g+(e/2>g?0:1),e,r,h-1,k-1),a,c,p?l:f)}}}}this.D||(this.register[a]=1)}}return this};
|
||||
function P(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 Q(a,b,c,e,d,f,g){let h=g?a.l:a.map;if(!b[c]||g&&!b[c][g])a.s&&(h=h[e]),g?(b=b[c]||(b[c]=z()),b[g]=1,h=h[g]||(h[g]=z())):b[c]=1,h=h[c]||(h[c]=[]),a.s||(h=h[e]||(h[e]=[])),f&&h.includes(d)||(h[h.length]=d,a.D&&(a=a.register[d]||(a.register[d]=[]),a[a.length]=h))}
|
||||
t.search=function(a,b,c){c||(!b&&D(a)?(c=a,a=c.query):D(b)&&(c=b));let e=[],d;let f,g=0;if(c){a=c.query||a;b=c.limit;g=c.offset||0;var h=c.context;f=c.suggest}if(a&&(a=this.encode(""+a),d=a.length,1<d)){c=z();var k=[];for(let n=0,u=0,q;n<d;n++)if((q=a[n])&&q.length>=this.m&&!c[q])if(this.s||f||this.map[q])k[u++]=q,c[q]=1;else return e;a=k;d=a.length}if(!d)return e;b||(b=100);h=this.depth&&1<d&&!1!==h;c=0;let m;h?(m=a[0],c=1):1<d&&a.sort(aa);for(let n,u;c<d;c++){u=a[c];h?(n=la(this,e,f,b,g,2===d,u,
|
||||
m),f&&!1===n&&e.length||(m=u)):n=la(this,e,f,b,g,1===d,u);if(n)return n;if(f&&c===d-1){k=e.length;if(!k){if(h){h=0;c=-1;continue}return e}if(1===k)return ma(e[0],b,g)}}return ha(e,b,g,f)};
|
||||
function la(a,b,c,e,d,f,g,h){let k=[],m=h?a.l:a.map;a.s||(m=na(m,g,h,a.h));if(m){let n=0;const u=Math.min(m.length,h?a.o:a.A);for(let q=0,r=0,l,p;q<u;q++)if(l=m[q])if(a.s&&(l=na(l,g,h,a.h)),d&&l&&f&&(p=l.length,p<=d?(d-=p,l=null):(l=l.slice(d),d=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=e)))break;if(n){if(f)return ma(k,e,0);b[b.length]=k;return}}return!c&&k}function ma(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function na(a,b,c,e){c?(e=e&&b>c,a=(a=a[e?b:c])&&a[e?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};t.remove=function(a,b){const c=this.register[a];if(c){if(this.D)for(let e=0,d;e<c.length;e++)d=c[e],d.splice(d.indexOf(a),1);else R(this.map,a,this.A,this.s),this.depth&&R(this.l,a,this.o,this.s);b||delete this.register[a]}return this};
|
||||
function R(a,b,c,e,d){let f=0;if(a.constructor===Array)if(d)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{d=Math.min(a.length,c);for(let g=0,h;g<d;g++)if(h=a[g])f=R(h,b,c,e,d),e||f||delete a[g]}else for(let g in a)(f=R(a[g],b,c,e,d))||delete a[g];return f}fa(O.prototype);function T(a){if(!(this instanceof T))return new T(a);var b=a.document||a.doc||a,c;this.F=[];this.h=[];this.o=[];this.register=z();this.key=(c=b.key||b.id)&&U(c,this.o)||"id";this.D=v(a.fastupdate);this.l=(c=b.store)&&!0!==c&&[];this.store=c&&z();this.async=!1;c=z();let e=b.index||b.field||b;C(e)&&(e=[e]);for(let d=0,f,g;d<e.length;d++)f=e[d],C(f)||(g=f,f=f.field),g=D(g)?Object.assign({},a,g):a,this.I||(c[f]=new O(g,this.register)),this.F[d]=U(f,this.o),this.h[d]=f;if(this.l)for(a=b.store,C(a)&&(a=
|
||||
[a]),b=0;b<a.length;b++)this.l[b]=U(a[b],this.o);this.index=c}function U(a,b){const c=a.split(":");let e=0;for(let d=0;d<c.length;d++)a=c[d],0<=a.indexOf("[]")&&(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]}function oa(a,b){if(C(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function V(a,b,c,e,d){a=a[d];if(e===c.length-1)b[d]=a;else if(a)if(a.constructor===Array)for(b=b[d]=Array(a.length),d=0;d<a.length;d++)V(a,b,c,e,d);else b=b[d]||(b[d]=z()),d=c[++e],V(a,b,c,e,d)}function W(a,b,c,e,d,f,g,h){if(a=a[g])if(e===b.length-1){if(a.constructor===Array){if(c[e]){for(b=0;b<a.length;b++)d.add(f,a[b],!0,!0);return}a=a.join(" ")}d.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)W(a,b,c,e,d,f,g,h);else g=b[++e],W(a,b,c,e,d,f,g,h)}t=T.prototype;
|
||||
t.add=function(a,b,c){D(a)&&(b=a,a=oa(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let e=0,d,f;e<this.h.length;e++)f=this.h[e],d=this.F[e],C(d)&&(d=[d]),W(b,d,this.o,0,this.index[f],a,d[0],c);if(this.store&&(!c||!this.store[a])){let e;if(this.l){e=z();for(let d=0,f;d<this.l.length;d++)f=this.l[d],C(f)?e[f]=b[f]:V(b,e,f,0,f[0])}this.store[a]=e||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){D(a)&&(a=oa(a,this.key));if(this.register[a]){for(let b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.I),!this.D);b++);this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,e){c||(!b&&D(a)?(c=a,a=""):D(b)&&(c=b,b=0));let d=[],f=[],g,h,k,m,n,u,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{a=c.query||a;k=(g=c.pluck)||c.index||c.field;m=!1;h=this.store&&c.enrich;n="and"===c.bool;b=c.limit||b||100;u=c.offset||0;if(m&&(C(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=pa.call(this,m[l],b,u,h))d[d.length]=p,q++;return q?d:[]}C(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!e&&(this.I||this.async)&&[];for(let l=0,p,A,B;l<
|
||||
k.length;l++){let y;A=k[l];C(A)||(y=A,A=y.field,a=y.query||a,b=y.limit||b,h=y.enrich||h);if(r)r[l]=this.index[A].searchAsync(a,b,y||c);else{e?p=e[l]:p=this.index[A].search(a,b,y||c);B=p&&p.length;if(m&&B){const x=[];let G=0;n&&(x[0]=[p]);for(let S=0,ia,N;S<m.length;S++)if(ia=m[S],B=(N=this.J[ia])&&N.length)G++,x[x.length]=n?[N]:N;G&&(p=n?ha(x,b||100,u||0):ja(p,x),B=p.length)}if(B)f[q]=A,d[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(A){p(l.search(a,
|
||||
b,c,A))})})}if(!q)return[];if(g&&(!h||!this.store))return d[0];for(let l=0,p;l<f.length;l++){p=d[l];p.length&&h&&(p=qa.call(this,p));if(g)return p;d[l]={field:f[l],result:p}}return d};function pa(a,b,c,e){let d=this.J[a],f=d&&d.length-c;if(f&&0<f){if(f>b||c)d=d.slice(c,c+b);e&&(d=qa.call(this,d));return{tag:a,result: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[e]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};fa(T.prototype);var sa={encode:ra,B:!1,C:""};const ta=[I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",I("[\u00e8\u00e9\u00ea\u00eb]"),"e",I("[\u00ec\u00ed\u00ee\u00ef]"),"i",I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",I("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",I("[\u00fd\u0177\u00ff]"),"y",I("\u00f1"),"n",I("[\u00e7c]"),"k",I("\u00df"),"s",I(" & ")," and "];function ra(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(ca,""));return E.call(this,b.toLowerCase(),!a.normalize&&ta)};var va={encode:ua,B:!1,C:"strict"};const wa=/[^a-z0-9]+/,xa={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function ua(a){a=ra.call(this,a).join(" ");const b=[];if(a){const c=a.split(wa),e=c.length;for(let d=0,f,g=0;d<e;d++)if((a=c[d])&&(!this.filter||!this.filter[a])){f=a[0];let h=xa[f]||f,k=h;for(let m=1;m<a.length;m++){f=a[m];const n=xa[f]||f;n&&n!==k&&(h+=n,k=n)}b[g++]=h}}return b};var za={encode:ya,B:!1,C:""};const Aa=[I("ae"),"a",I("oe"),"o",I("sh"),"s",I("th"),"t",I("ph"),"f",I("pf"),"f",I("(?![aeo])h(?![aeo])"),"",I("(?!^[aeo])h(?!^[aeo])"),""];function ya(a,b){a&&(a=ua.call(this,a).join(" "),2<a.length&&(a=F(a,Aa)),b||(1<a.length&&(a=J(a)),a&&(a=a.split(" "))));return a||[]};var Ca={encode:Ba,B:!1,C:""};const Da=I("(?!\\b)[aeo]");function Ba(a){a&&(a=ya.call(this,a,!0),1<a.length&&(a=a.replace(Da,"")),1<a.length&&(a=J(a)),a&&(a=a.split(" ")));return a||[]};L["latin:default"]=da;L["latin:simple"]=sa;L["latin:balance"]=va;L["latin:advanced"]=za;L["latin:extra"]=Ca;const X=self;let Y;const Z={Index:O,Document:T,Worker:null,registerCharset:function(a,b){L[a]=b},registerLanguage:function(a,b){ea[a]=b}};(Y=X.define)&&Y.amd?Y([],function(){return Z}):X.exports?X.exports=Z:X.FlexSearch=Z;}(this));
|
||||
function H(a,b){const c=Object.keys(a),e=c.length,d=[];let f="",g=0;for(let h=0,k,m;h<e;h++)k=c[h],(m=a[k])?(d[g++]=I(b?"(?!\\b)"+k+"(\\b|_)":k),d[g++]=m):f+=(f?"|":"")+k;f&&(d[g++]=I(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),d[g]="");return d}function F(a,b){for(let c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function I(a){return new RegExp(a,"g")}function J(a){let b="",c="";for(let e=0,d=a.length,f;e<d;e++)(f=a[e])!==c&&(b+=c=f);return b};var da={encode:K,B:!1,C:""};function K(a){return E.call(this,(""+a).toLowerCase(),!1)};const L={},M={};function O(a){P(a,"add");P(a,"append");P(a,"search");P(a,"update");P(a,"remove")}function P(a,b){a[b+"Async"]=function(){const c=this,e=arguments;var d=e[e.length-1];let f;"function"===typeof d&&(f=d,delete e[e.length-1]);d=new Promise(function(g){setTimeout(function(){c.async=!0;const h=c[b].apply(c,e);c.async=!1;g(h)})});return f?(d.then(f),this):d}};function Q(a,b,c,e){const d=a.length;let f=[],g,h,k=0;e&&(e=[]);for(let m=d-1;0<=m;m--){const n=a[m],u=n.length,q=z();let r=!g;for(let l=0;l<u;l++){const p=n[l],A=p.length;if(A)for(let B=0,y,x;B<A;B++)if(x=p[B],g){if(g[x]){if(!m)if(c)c--;else if(f[k++]=x,k===b)return f;if(m||e)q[x]=1;r=!0}if(e&&(y=(h[x]||0)+1,h[x]=y,y<d)){const G=e[y-2]||(e[y-2]=[]);G[G.length]=x}}else q[x]=1}if(e)g||(h=q);else if(!r)return[];g=q}if(e)for(let m=e.length-1,n,u;0<=m;m--){n=e[m];u=n.length;for(let q=0,r;q<u;q++)if(r=
|
||||
n[q],!g[r]){if(c)c--;else if(f[k++]=r,k===b)return f;g[r]=1}}return f}function fa(a,b){const c=z(),e=z(),d=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,g;f<b.length;f++){g=b[f];for(let h=0,k;h<g.length;h++)k=g[h],c[k]&&!e[k]&&(e[k]=1,d[d.length]=k)}return d};const ha={memory:{charset:"latin:extra",A:3,m:4,D:!1},performance:{A:3,m:3,s:!1,context:{depth:2,A:1}},match:{charset:"latin:extra",C:"reverse"},score:{charset:"latin:advanced",A:20,m:3,context:{depth:3,A:9}},"default":{}};function S(a,b){if(!(this instanceof S))return new S(a);var c;let e;a?(C(a)?a=ha[a]:(c=a.preset)&&(a=Object.assign({},c[c],a)),c=a.charset,e=a.lang,C(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=M[c]),C(e)&&(e=L[e])):a={};let d,f,g=a.context||{};this.encode=a.encode||c&&c.encode||K;this.register=b||z();this.A=d=a.resolution||9;this.C=b=c&&c.C||a.tokenize||"strict";this.depth="strict"===b&&g.depth;this.h=v(g.bidirectional);this.s=f=v(a.optimize);this.D=v(a.fastupdate);this.m=a.minlength||1;this.F=a.boost;
|
||||
this.map=f?w(d):z();this.o=d=g.resolution||1;this.l=f?w(d):z();this.B=c&&c.B||a.rtl;this.G=(b=a.matcher||e&&e.G)&&H(b,!1);this.H=(b=a.stemmer||e&&e.H)&&H(b,!0);if(a=b=a.filter||e&&e.filter){a=b;c=z();for(let h=0,k=a.length;h<k;h++)c[a[h]]=1;a=c}this.filter=a}t=S.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,e){if(b&&(a||0===a)){if(!e&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(e=b.length){const m=z(),n=z(),u=this.depth,q=this.A;for(let r=0;r<e;r++){let l=b[this.B?e-1-r:r];var d=l.length;if(l&&d>=this.m&&(u||!n[l])){var f=T(q,e,r),g="";switch(this.C){case "full":if(2<d){for(f=0;f<d;f++)for(var h=d;h>f;h--)if(h-f>=this.m){var k=T(q,e,r,d,f);g=l.substring(f,h);U(this,n,g,k,a,c)}break}case "reverse":if(1<d){for(h=d-1;0<h;h--)g=l[h]+g,g.length>=this.m&&U(this,n,
|
||||
g,T(q,e,r,d,h),a,c);g=""}case "forward":if(1<d){for(h=0;h<d;h++)g+=l[h],g.length>=this.m&&U(this,n,g,f,a,c);break}default:if(this.F&&(f=Math.min(f/this.F(b,l,r)|0,q-1)),U(this,n,l,f,a,c),u&&1<e&&r<e-1)for(d=z(),g=this.o,f=l,h=Math.min(u+1,e-r),d[f]=1,k=1;k<h;k++)if((l=b[this.B?e-1-r-k:r+k])&&l.length>=this.m&&!d[l]){d[l]=1;const p=this.h&&l>f;U(this,m,p?f:l,T(g+(e/2>g?0:1),e,r,h-1,k-1),a,c,p?l:f)}}}}this.D||(this.register[a]=1)}}return this};
|
||||
function T(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 U(a,b,c,e,d,f,g){let h=g?a.l:a.map;if(!b[c]||g&&!b[c][g])a.s&&(h=h[e]),g?(b=b[c]||(b[c]=z()),b[g]=1,h=h[g]||(h[g]=z())):b[c]=1,h=h[c]||(h[c]=[]),a.s||(h=h[e]||(h[e]=[])),f&&h.includes(d)||(h[h.length]=d,a.D&&(a=a.register[d]||(a.register[d]=[]),a[a.length]=h))}
|
||||
t.search=function(a,b,c){c||(!b&&D(a)?(c=a,a=c.query):D(b)&&(c=b));let e=[],d;let f,g=0;if(c){a=c.query||a;b=c.limit;g=c.offset||0;var h=c.context;f=c.suggest}if(a&&(a=this.encode(""+a),d=a.length,1<d)){c=z();var k=[];for(let n=0,u=0,q;n<d;n++)if((q=a[n])&&q.length>=this.m&&!c[q])if(this.s||f||this.map[q])k[u++]=q,c[q]=1;else return e;a=k;d=a.length}if(!d)return e;b||(b=100);h=this.depth&&1<d&&!1!==h;c=0;let m;h?(m=a[0],c=1):1<d&&a.sort(aa);for(let n,u;c<d;c++){u=a[c];h?(n=ia(this,e,f,b,g,2===d,u,
|
||||
m),f&&!1===n&&e.length||(m=u)):n=ia(this,e,f,b,g,1===d,u);if(n)return n;if(f&&c===d-1){k=e.length;if(!k){if(h){h=0;c=-1;continue}return e}if(1===k)return ja(e[0],b,g)}}return Q(e,b,g,f)};
|
||||
function ia(a,b,c,e,d,f,g,h){let k=[],m=h?a.l:a.map;a.s||(m=ka(m,g,h,a.h));if(m){let n=0;const u=Math.min(m.length,h?a.o:a.A);for(let q=0,r=0,l,p;q<u;q++)if(l=m[q])if(a.s&&(l=ka(l,g,h,a.h)),d&&l&&f&&(p=l.length,p<=d?(d-=p,l=null):(l=l.slice(d),d=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=e)))break;if(n){if(f)return ja(k,e,0);b[b.length]=k;return}}return!c&&k}function ja(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function ka(a,b,c,e){c?(e=e&&b>c,a=(a=a[e?b:c])&&a[e?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};t.remove=function(a,b){const c=this.register[a];if(c){if(this.D)for(let e=0,d;e<c.length;e++)d=c[e],d.splice(d.indexOf(a),1);else V(this.map,a,this.A,this.s),this.depth&&V(this.l,a,this.o,this.s);b||delete this.register[a]}return this};
|
||||
function V(a,b,c,e,d){let f=0;if(a.constructor===Array)if(d)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{d=Math.min(a.length,c);for(let g=0,h;g<d;g++)if(h=a[g])f=V(h,b,c,e,d),e||f||delete a[g]}else for(let g in a)(f=V(a[g],b,c,e,d))||delete a[g];return f}O(S.prototype);function W(a){if(!(this instanceof W))return new W(a);var b=a.document||a.doc||a,c;this.F=[];this.h=[];this.o=[];this.register=z();this.key=(c=b.key||b.id)&&X(c,this.o)||"id";this.D=v(a.fastupdate);this.l=(c=b.store)&&!0!==c&&[];this.store=c&&z();this.async=!1;c=z();let e=b.index||b.field||b;C(e)&&(e=[e]);for(let d=0,f,g;d<e.length;d++)f=e[d],C(f)||(g=f,f=f.field),g=D(g)?Object.assign({},a,g):a,this.I||(c[f]=new S(g,this.register)),this.F[d]=X(f,this.o),this.h[d]=f;if(this.l)for(a=b.store,C(a)&&(a=
|
||||
[a]),b=0;b<a.length;b++)this.l[b]=X(a[b],this.o);this.index=c}function X(a,b){const c=a.split(":");let e=0;for(let d=0;d<c.length;d++)a=c[d],0<=a.indexOf("[]")&&(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]}function la(a,b){if(C(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function Y(a,b,c,e,d){a=a[d];if(e===c.length-1)b[d]=a;else if(a)if(a.constructor===Array)for(b=b[d]=Array(a.length),d=0;d<a.length;d++)Y(a,b,c,e,d);else b=b[d]||(b[d]=z()),d=c[++e],Y(a,b,c,e,d)}function Z(a,b,c,e,d,f,g,h){if(a=a[g])if(e===b.length-1){if(a.constructor===Array){if(c[e]){for(b=0;b<a.length;b++)d.add(f,a[b],!0,!0);return}a=a.join(" ")}d.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)Z(a,b,c,e,d,f,g,h);else g=b[++e],Z(a,b,c,e,d,f,g,h)}t=W.prototype;
|
||||
t.add=function(a,b,c){D(a)&&(b=a,a=la(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let e=0,d,f;e<this.h.length;e++)f=this.h[e],d=this.F[e],C(d)&&(d=[d]),Z(b,d,this.o,0,this.index[f],a,d[0],c);if(this.store&&(!c||!this.store[a])){let e;if(this.l){e=z();for(let d=0,f;d<this.l.length;d++)f=this.l[d],C(f)?e[f]=b[f]:Y(b,e,f,0,f[0])}this.store[a]=e||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){D(a)&&(a=la(a,this.key));if(this.register[a]){for(let b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.I),!this.D);b++);this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,e){c||(!b&&D(a)?(c=a,a=""):D(b)&&(c=b,b=0));let d=[],f=[],g,h,k,m,n,u,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{a=c.query||a;k=(g=c.pluck)||c.index||c.field;m=!1;h=this.store&&c.enrich;n="and"===c.bool;b=c.limit||b||100;u=c.offset||0;if(m&&(C(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=ma.call(this,m[l],b,u,h))d[d.length]=p,q++;return q?d:[]}C(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!e&&(this.I||this.async)&&[];for(let l=0,p,A,B;l<
|
||||
k.length;l++){let y;A=k[l];C(A)||(y=A,A=y.field,a=y.query||a,b=y.limit||b,h=y.enrich||h);if(r)r[l]=this.index[A].searchAsync(a,b,y||c);else{e?p=e[l]:p=this.index[A].search(a,b,y||c);B=p&&p.length;if(m&&B){const x=[];let G=0;n&&(x[0]=[p]);for(let R=0,ea,N;R<m.length;R++)if(ea=m[R],B=(N=this.J[ea])&&N.length)G++,x[x.length]=n?[N]:N;G&&(p=n?Q(x,b||100,u||0):fa(p,x),B=p.length)}if(B)f[q]=A,d[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(A){p(l.search(a,
|
||||
b,c,A))})})}if(!q)return[];if(g&&(!h||!this.store))return d[0];for(let l=0,p;l<f.length;l++){p=d[l];p.length&&h&&(p=na.call(this,p));if(g)return p;d[l]={field:f[l],result:p}}return d};function ma(a,b,c,e){let d=this.J[a],f=d&&d.length-c;if(f&&0<f){if(f>b||c)d=d.slice(c,c+b);e&&(d=na.call(this,d));return{tag:a,result:d}}}function na(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[e]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};O(W.prototype);var pa={encode:oa,B:!1,C:""};const qa=[I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",I("[\u00e8\u00e9\u00ea\u00eb]"),"e",I("[\u00ec\u00ed\u00ee\u00ef]"),"i",I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",I("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",I("[\u00fd\u0177\u00ff]"),"y",I("\u00f1"),"n",I("[\u00e7c]"),"k",I("\u00df"),"s",I(" & ")," and "];function oa(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(ca,""));return E.call(this,b.toLowerCase(),!a.normalize&&qa)};var sa={encode:ra,B:!1,C:"strict"};const ta=/[^a-z0-9]+/,ua={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function ra(a){a=oa.call(this,a).join(" ");const b=[];if(a){const c=a.split(ta),e=c.length;for(let d=0,f,g=0;d<e;d++)if((a=c[d])&&(!this.filter||!this.filter[a])){f=a[0];let h=ua[f]||f,k=h;for(let m=1;m<a.length;m++){f=a[m];const n=ua[f]||f;n&&n!==k&&(h+=n,k=n)}b[g++]=h}}return b};var wa={encode:va,B:!1,C:""};const xa=[I("ae"),"a",I("oe"),"o",I("sh"),"s",I("th"),"t",I("ph"),"f",I("pf"),"f",I("(?![aeo])h(?![aeo])"),"",I("(?!^[aeo])h(?!^[aeo])"),""];function va(a,b){a&&(a=ra.call(this,a).join(" "),2<a.length&&(a=F(a,xa)),b||(1<a.length&&(a=J(a)),a&&(a=a.split(" "))));return a||[]};var za={encode:ya,B:!1,C:""};const Aa=I("(?!\\b)[aeo]");function ya(a){a&&(a=va.call(this,a,!0),1<a.length&&(a=a.replace(Aa,"")),1<a.length&&(a=J(a)),a&&(a=a.split(" ")));return a||[]};M["latin:default"]=da;M["latin:simple"]=pa;M["latin:balance"]=sa;M["latin:advanced"]=wa;M["latin:extra"]=za;export default {Index:S,Document:W,Worker:null,registerCharset:function(a,b){M[a]=b},registerLanguage:function(a,b){L[a]=b}};}(this));
|
||||
|
30
dist/flexsearch.es5.debug.js
vendored
30
dist/flexsearch.es5.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Es5)
|
||||
* FlexSearch.js v0.7.40 (Es5)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -1162,9 +1162,9 @@ t.search = function(a, b, c, d) {
|
||||
if (l && w) {
|
||||
var z = [], B = 0;
|
||||
p && (z[0] = [u]);
|
||||
var Z = 0, H = void 0;
|
||||
for (H = void 0; Z < l.length; Z++) {
|
||||
if (H = l[Z], w = (H = this.l[H]) && H.length) {
|
||||
var Y = 0, H = void 0;
|
||||
for (H = void 0; Y < l.length; Y++) {
|
||||
if (H = l[Y], w = (H = this.l[H]) && H.length) {
|
||||
B++, z[z.length] = p ? [H] : H;
|
||||
}
|
||||
}
|
||||
@@ -1178,10 +1178,10 @@ t.search = function(a, b, c, d) {
|
||||
}
|
||||
}
|
||||
if (q) {
|
||||
var La = this;
|
||||
return new Promise(function(Ma) {
|
||||
Promise.all(q).then(function(Na) {
|
||||
Ma(La.search(a, b, c, Na));
|
||||
var Ka = this;
|
||||
return new Promise(function(La) {
|
||||
Promise.all(q).then(function(Ma) {
|
||||
La(Ka.search(a, b, c, Ma));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1291,12 +1291,12 @@ function Fa(a) {
|
||||
b.normalize && (b = b.normalize("NFD").replace(la, ""));
|
||||
return ja.call(this, b.toLowerCase(), !a.normalize && Ha);
|
||||
}
|
||||
;var Ja = {encode:Ia, G:!1, H:"strict"}, Ka = /[^a-z0-9]+/, Oa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
;var Ja = {encode:Ia, G:!1, H:"strict"}, Na = /[^a-z0-9]+/, Oa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"};
|
||||
function Ia(a) {
|
||||
a = Fa.call(this, a).join(" ");
|
||||
var b = [];
|
||||
if (a) {
|
||||
for (var c = a.split(Ka), d = c.length, e = 0, g, f = 0; e < d; e++) {
|
||||
for (var c = a.split(Na), d = c.length, e = 0, g, f = 0; e < d; e++) {
|
||||
if ((a = c[e]) && (!this.filter || !this.filter[a])) {
|
||||
g = a[0];
|
||||
for (var h = Oa[g] || g, k = h, l = 1; l < a.length; l++) {
|
||||
@@ -1323,12 +1323,12 @@ K["latin:simple"] = Ga;
|
||||
K["latin:balance"] = Ja;
|
||||
K["latin:advanced"] = Qa;
|
||||
K["latin:extra"] = Ta;
|
||||
var Y = self, Va, Wa = {Index:N, Document:T, Worker:R, registerCharset:function(a, b) {
|
||||
var Z = {Index:N, Document:T, Worker:R, registerCharset:function(a, b) {
|
||||
K[a] = b;
|
||||
}, registerLanguage:function(a, b) {
|
||||
qa[a] = b;
|
||||
}};
|
||||
(Va = Y.define) && Va.amd ? Va([], function() {
|
||||
return Wa;
|
||||
}) : Y.exports ? Y.exports = Wa : Y.FlexSearch = Wa;
|
||||
}}, Va;
|
||||
(Va = self.define) && Va.amd ? Va([], function() {
|
||||
return Z;
|
||||
}) : self.exports ? self.exports = Z : self.FlexSearch = Z;
|
||||
}(this));
|
||||
|
8
dist/flexsearch.es5.min.js
vendored
8
dist/flexsearch.es5.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Es5)
|
||||
* FlexSearch.js v0.7.40 (Es5)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -42,7 +42,7 @@ t.add=function(a,b,c){F(a)&&(b=a,a=V(b,this.key));if(b&&(a||0===a)){if(!c&&this.
|
||||
D();for(c=0;c<this.o.length;c++)d=this.o[c],E(d)?k[d]=b[d]:W(b,k,d,0,d[0])}this.store[a]=k||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){F(a)&&(a=V(a,this.key));if(this.register[a]){for(var b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.A),!this.s);b++);if(this.D&&!this.s)for(var c in this.l){b=this.l[c];var d=b.indexOf(a);-1!==d&&(1<b.length?b.splice(d,1):delete this.l[c])}this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,d){c||(!b&&F(a)?(c=a,a=""):F(b)&&(c=b,b=0));var e=[],g=[],f,h=0;if(c)if(c.constructor===Array){var k=c;c=null}else{a=c.query||a;k=(f=c.pluck)||c.index||c.field;var l=c.tag;var m=this.store&&c.enrich;var p="and"===c.bool;b=c.limit||b||100;var n=c.offset||0;if(l&&(E(l)&&(l=[l]),!a)){g=0;for(f=void 0;g<l.length;g++)if(f=Da.call(this,l[g],b,n,m))e[e.length]=f,h++;return h?e:[]}E(k)&&(k=[k])}k||(k=this.h);p=p&&(1<k.length||l&&1<l.length);for(var q=!d&&(this.A||this.async)&&[],r=
|
||||
0,u=void 0,A=void 0,w=void 0;r<k.length;r++)if(w=void 0,A=k[r],E(A)||(w=A,A=w.field,a=w.query||a,b=w.limit||b,m=w.enrich||m),q)q[r]=this.index[A].searchAsync(a,b,w||c);else{d?u=d[r]:u=this.index[A].search(a,b,w||c);w=u&&u.length;if(l&&w){var z=[],B=0;p&&(z[0]=[u]);var Z=0,H=void 0;for(H=void 0;Z<l.length;Z++)if(H=l[Z],w=(H=this.l[H])&&H.length)B++,z[z.length]=p?[H]:H;B&&(u=p?sa(z,b||100,n||0):ta(u,z),w=u.length)}if(w)g[h]=A,e[h++]=u;else if(p)return[]}if(q){var La=this;return new Promise(function(Ma){Promise.all(q).then(function(Na){Ma(La.search(a,
|
||||
b,c,Na))})})}if(!h)return[];if(f&&(!m||!this.store))return e[0];l=0;for(n=void 0;l<g.length;l++){n=e[l];n.length&&m&&(n=Ea.call(this,n));if(f)return n;e[l]={field:g[l],result:n}}return e};function Da(a,b,c,d){var e=this.l[a],g=e&&e.length-c;if(g&&0<g){if(g>b||c)e=e.slice(c,c+b);d&&(e=Ea.call(this,e));return{tag:a,result:e}}}function Ea(a){for(var b=Array(a.length),c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store[d]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
0,u=void 0,A=void 0,w=void 0;r<k.length;r++)if(w=void 0,A=k[r],E(A)||(w=A,A=w.field,a=w.query||a,b=w.limit||b,m=w.enrich||m),q)q[r]=this.index[A].searchAsync(a,b,w||c);else{d?u=d[r]:u=this.index[A].search(a,b,w||c);w=u&&u.length;if(l&&w){var z=[],B=0;p&&(z[0]=[u]);var Y=0,H=void 0;for(H=void 0;Y<l.length;Y++)if(H=l[Y],w=(H=this.l[H])&&H.length)B++,z[z.length]=p?[H]:H;B&&(u=p?sa(z,b||100,n||0):ta(u,z),w=u.length)}if(w)g[h]=A,e[h++]=u;else if(p)return[]}if(q){var Ka=this;return new Promise(function(La){Promise.all(q).then(function(Ma){La(Ka.search(a,
|
||||
b,c,Ma))})})}if(!h)return[];if(f&&(!m||!this.store))return e[0];l=0;for(n=void 0;l<g.length;l++){n=e[l];n.length&&m&&(n=Ea.call(this,n));if(f)return n;e[l]={field:g[l],result:n}}return e};function Da(a,b,c,d){var e=this.l[a],g=e&&e.length-c;if(g&&0<g){if(g>b||c)e=e.slice(c,c+b);d&&(e=Ea.call(this,e));return{tag:a,result:e}}}function Ea(a){for(var b=Array(a.length),c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store[d]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};
|
||||
t.set=function(a,b){this.store[a]=b;return this};t.searchCache=ua;t.export=function(a,b,c,d,e,g){var f;"undefined"===typeof g&&(f=new Promise(function(p){g=p}));e||(e=0);d||(d=0);if(d<this.h.length){var h=this.h[d],k=this.index[h];b=this;setTimeout(function(){k.export(a,b,e?h:"",d,e++,g)||(d++,e=1,b.export(a,b,h,d,e,g))})}else{switch(e){case 1:var l="tag";var m=this.l;c=null;break;case 2:l="store";m=this.store;c=null;break;default:g();return}wa(a,this,c,l,d,e,m,g)}return f};
|
||||
t.import=function(a,b){if(b)switch(E(b)&&(b=JSON.parse(b)),a){case "tag":this.l=b;break;case "reg":this.s=!1;this.register=b;a=0;for(var c;a<this.h.length;a++)c=this.index[this.h[a]],c.register=b,c.s=!1;break;case "store":this.store=b;break;default:a=a.split("."),c=a[0],a=a[1],c&&a&&this.index[c].import(a,b)}};ra(T.prototype);var Ga={encode:Fa,G:!1,H:""},Ha=[J("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",J("[\u00e8\u00e9\u00ea\u00eb]"),"e",J("[\u00ec\u00ed\u00ee\u00ef]"),"i",J("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",J("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",J("[\u00fd\u0177\u00ff]"),"y",J("\u00f1"),"n",J("[\u00e7c]"),"k",J("\u00df"),"s",J(" & ")," and "];function Fa(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(la,""));return ja.call(this,b.toLowerCase(),!a.normalize&&Ha)};var Ja={encode:Ia,G:!1,H:"strict"},Ka=/[^a-z0-9]+/,Oa={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Ia(a){a=Fa.call(this,a).join(" ");var b=[];if(a)for(var c=a.split(Ka),d=c.length,e=0,g,f=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){g=a[0];for(var h=Oa[g]||g,k=h,l=1;l<a.length;l++)g=a[l],(g=Oa[g]||g)&&g!==k&&(h+=g,k=g);b[f++]=h}return b};var Qa={encode:Pa,G:!1,H:""},Ra=[J("ae"),"a",J("oe"),"o",J("sh"),"s",J("th"),"t",J("ph"),"f",J("pf"),"f",J("(?![aeo])h(?![aeo])"),"",J("(?!^[aeo])h(?!^[aeo])"),""];function Pa(a,b){a&&(a=Ia.call(this,a).join(" "),2<a.length&&(a=I(a,Ra)),b||(1<a.length&&(a=na(a)),a&&(a=a.split(" "))));return a||[]};var Ta={encode:Sa,G:!1,H:""},Ua=J("(?!\\b)[aeo]");function Sa(a){a&&(a=Pa.call(this,a,!0),1<a.length&&(a=a.replace(Ua,"")),1<a.length&&(a=na(a)),a&&(a=a.split(" ")));return a||[]};K["latin:default"]=pa;K["latin:simple"]=Ga;K["latin:balance"]=Ja;K["latin:advanced"]=Qa;K["latin:extra"]=Ta;var Y=self,Va,Wa={Index:N,Document:T,Worker:R,registerCharset:function(a,b){K[a]=b},registerLanguage:function(a,b){qa[a]=b}};(Va=Y.define)&&Va.amd?Va([],function(){return Wa}):Y.exports?Y.exports=Wa:Y.FlexSearch=Wa;}(this));
|
||||
t.import=function(a,b){if(b)switch(E(b)&&(b=JSON.parse(b)),a){case "tag":this.l=b;break;case "reg":this.s=!1;this.register=b;a=0;for(var c;a<this.h.length;a++)c=this.index[this.h[a]],c.register=b,c.s=!1;break;case "store":this.store=b;break;default:a=a.split("."),c=a[0],a=a[1],c&&a&&this.index[c].import(a,b)}};ra(T.prototype);var Ga={encode:Fa,G:!1,H:""},Ha=[J("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",J("[\u00e8\u00e9\u00ea\u00eb]"),"e",J("[\u00ec\u00ed\u00ee\u00ef]"),"i",J("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",J("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",J("[\u00fd\u0177\u00ff]"),"y",J("\u00f1"),"n",J("[\u00e7c]"),"k",J("\u00df"),"s",J(" & ")," and "];function Fa(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(la,""));return ja.call(this,b.toLowerCase(),!a.normalize&&Ha)};var Ja={encode:Ia,G:!1,H:"strict"},Na=/[^a-z0-9]+/,Oa={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Ia(a){a=Fa.call(this,a).join(" ");var b=[];if(a)for(var c=a.split(Na),d=c.length,e=0,g,f=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){g=a[0];for(var h=Oa[g]||g,k=h,l=1;l<a.length;l++)g=a[l],(g=Oa[g]||g)&&g!==k&&(h+=g,k=g);b[f++]=h}return b};var Qa={encode:Pa,G:!1,H:""},Ra=[J("ae"),"a",J("oe"),"o",J("sh"),"s",J("th"),"t",J("ph"),"f",J("pf"),"f",J("(?![aeo])h(?![aeo])"),"",J("(?!^[aeo])h(?!^[aeo])"),""];function Pa(a,b){a&&(a=Ia.call(this,a).join(" "),2<a.length&&(a=I(a,Ra)),b||(1<a.length&&(a=na(a)),a&&(a=a.split(" "))));return a||[]};var Ta={encode:Sa,G:!1,H:""},Ua=J("(?!\\b)[aeo]");function Sa(a){a&&(a=Pa.call(this,a,!0),1<a.length&&(a=a.replace(Ua,"")),1<a.length&&(a=na(a)),a&&(a=a.split(" ")));return a||[]};K["latin:default"]=pa;K["latin:simple"]=Ga;K["latin:balance"]=Ja;K["latin:advanced"]=Qa;K["latin:extra"]=Ta;var Z={Index:N,Document:T,Worker:R,registerCharset:function(a,b){K[a]=b},registerLanguage:function(a,b){qa[a]=b}},Va;(Va=self.define)&&Va.amd?Va([],function(){return Z}):self.exports?self.exports=Z:self.FlexSearch=Z;}(this));
|
||||
|
33
dist/flexsearch.light.debug.js
vendored
33
dist/flexsearch.light.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Light)
|
||||
* FlexSearch.js v0.7.40 (Light)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -37,7 +37,7 @@ function C(a, b) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
;function D(a) {
|
||||
;function E(a) {
|
||||
if (a = ("" + a).toLowerCase()) {
|
||||
if (this.o && (a = C(a, this.o)), this.A && 1 < a.length && (a = C(a, this.A)), A || "" === A) {
|
||||
const b = a.split(A);
|
||||
@@ -65,10 +65,10 @@ function H(a, b, c, d) {
|
||||
const m = a[n], r = m.length, p = y();
|
||||
let q = !f;
|
||||
for (let k = 0; k < r; k++) {
|
||||
const u = m[k], M = u.length;
|
||||
if (M) {
|
||||
for (let E = 0, x, w; E < M; E++) {
|
||||
if (w = u[E], f) {
|
||||
const u = m[k], L = u.length;
|
||||
if (L) {
|
||||
for (let D = 0, x, w; D < L; D++) {
|
||||
if (w = u[D], f) {
|
||||
if (f[w]) {
|
||||
if (!n) {
|
||||
if (c) {
|
||||
@@ -85,8 +85,8 @@ function H(a, b, c, d) {
|
||||
q = !0;
|
||||
}
|
||||
if (d && (x = (g[w] || 0) + 1, g[w] = x, x < e)) {
|
||||
const N = d[x - 2] || (d[x - 2] = []);
|
||||
N[N.length] = w;
|
||||
const M = d[x - 2] || (d[x - 2] = []);
|
||||
M[M.length] = w;
|
||||
}
|
||||
} else {
|
||||
p[w] = 1;
|
||||
@@ -135,7 +135,7 @@ function H(a, b, c, d) {
|
||||
a = {};
|
||||
}
|
||||
let e, h, f = a.context || {};
|
||||
this.encode = a.encode || d && d.encode || D;
|
||||
this.encode = a.encode || d && d.encode || E;
|
||||
this.register = b || y();
|
||||
this.s = e = a.resolution || 9;
|
||||
this.B = b = d && d.B || a.tokenize || "strict";
|
||||
@@ -268,7 +268,7 @@ I.prototype.search = function(a, b, c) {
|
||||
g ? (n = a[0], c = 1) : 1 < e && a.sort(z);
|
||||
for (let m, r; c < e; c++) {
|
||||
r = a[c];
|
||||
g ? (m = L(this, d, h, b, f, 2 === e, r, n), h && !1 === m && d.length || (n = r)) : m = L(this, d, h, b, f, 1 === e, r);
|
||||
g ? (m = N(this, d, h, b, f, 2 === e, r, n), h && !1 === m && d.length || (n = r)) : m = N(this, d, h, b, f, 1 === e, r);
|
||||
if (m) {
|
||||
return m;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ I.prototype.search = function(a, b, c) {
|
||||
}
|
||||
return H(d, b, f, h);
|
||||
};
|
||||
function L(a, b, c, d, e, h, f, g) {
|
||||
function N(a, b, c, d, e, h, f, g) {
|
||||
let l = [], n = g ? a.l : a.map;
|
||||
a.g || (n = P(n, f, g, a.j));
|
||||
if (n) {
|
||||
@@ -360,14 +360,13 @@ function Q(a, b, c, d, e) {
|
||||
}
|
||||
return h;
|
||||
}
|
||||
;const R = self;
|
||||
let S;
|
||||
const T = {Index:I, Document:null, Worker:null, registerCharset:function(a, b) {
|
||||
;const R = {Index:I, Document:null, Worker:null, registerCharset:function(a, b) {
|
||||
G[a] = b;
|
||||
}, registerLanguage:function(a, b) {
|
||||
F[a] = b;
|
||||
}};
|
||||
(S = R.define) && S.amd ? S([], function() {
|
||||
return T;
|
||||
}) : R.exports ? R.exports = T : R.FlexSearch = T;
|
||||
let S;
|
||||
(S = self.define) && S.amd ? S([], function() {
|
||||
return R;
|
||||
}) : self.exports ? self.exports = R : self.FlexSearch = R;
|
||||
}(this));
|
||||
|
12
dist/flexsearch.light.min.js
vendored
12
dist/flexsearch.light.min.js
vendored
@@ -1,18 +1,18 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Light)
|
||||
* FlexSearch.js v0.7.40 (Light)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
(function(self){'use strict';function t(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=y();return b}function y(){return Object.create(null)}function z(a,b){return b.length-a.length};const A=/[\p{Z}\p{S}\p{P}\p{C}]+/u;function B(a,b){const c=Object.keys(a),d=c.length,e=[];let h="",f=0;for(let g=0,l,n;g<d;g++)l=c[g],(n=a[l])?(e[f++]=new RegExp(b?"(?!\\b)"+l+"(\\b|_)":l,"g"),e[f++]=n):h+=(h?"|":"")+l;h&&(e[f++]=new RegExp(b?"(?!\\b)("+h+")(\\b|_)":"("+h+")","g"),e[f]="");return e}function C(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a};function D(a){if(a=(""+a).toLowerCase())if(this.o&&(a=C(a,this.o)),this.A&&1<a.length&&(a=C(a,this.A)),A||""===A){const b=a.split(A);if(this.filter){a=this.filter;const c=b.length,d=[];for(let e=0,h=0;e<c;e++){const f=b[e];f&&!a[f]&&(d[h++]=f)}a=d}else a=b}return a};const F={},G={};function H(a,b,c,d){const e=a.length;let h=[],f,g,l=0;d&&(d=[]);for(let n=e-1;0<=n;n--){const m=a[n],r=m.length,p=y();let q=!f;for(let k=0;k<r;k++){const u=m[k],M=u.length;if(M)for(let E=0,x,w;E<M;E++)if(w=u[E],f){if(f[w]){if(!n)if(c)c--;else if(h[l++]=w,l===b)return h;if(n||d)p[w]=1;q=!0}if(d&&(x=(g[w]||0)+1,g[w]=x,x<e)){const N=d[x-2]||(d[x-2]=[]);N[N.length]=w}}else p[w]=1}if(d)f||(g=p);else if(!q)return[];f=p}if(d)for(let n=d.length-1,m,r;0<=n;n--){m=d[n];r=m.length;for(let p=0,q;p<r;p++)if(q=
|
||||
m[p],!f[q]){if(c)c--;else if(h[l++]=q,l===b)return h;f[q]=1}}return h};function I(a,b){if(!(this instanceof I))return new I(a);let c;if(a){var d=a.charset;c=a.lang;"string"===typeof d&&(-1===d.indexOf(":")&&(d+=":default"),d=G[d]);"string"===typeof c&&(c=F[c])}else a={};let e,h,f=a.context||{};this.encode=a.encode||d&&d.encode||D;this.register=b||y();this.s=e=a.resolution||9;this.B=b=d&&d.B||a.tokenize||"strict";this.i="strict"===b&&f.depth;this.j=t(f.bidirectional);this.g=h=t(a.optimize);this.m=t(a.fastupdate);this.h=a.minlength||1;this.C=a.boost;this.map=h?v(e):y();
|
||||
(function(self){'use strict';function t(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=y();return b}function y(){return Object.create(null)}function z(a,b){return b.length-a.length};const A=/[\p{Z}\p{S}\p{P}\p{C}]+/u;function B(a,b){const c=Object.keys(a),d=c.length,e=[];let h="",f=0;for(let g=0,l,n;g<d;g++)l=c[g],(n=a[l])?(e[f++]=new RegExp(b?"(?!\\b)"+l+"(\\b|_)":l,"g"),e[f++]=n):h+=(h?"|":"")+l;h&&(e[f++]=new RegExp(b?"(?!\\b)("+h+")(\\b|_)":"("+h+")","g"),e[f]="");return e}function C(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a};function E(a){if(a=(""+a).toLowerCase())if(this.o&&(a=C(a,this.o)),this.A&&1<a.length&&(a=C(a,this.A)),A||""===A){const b=a.split(A);if(this.filter){a=this.filter;const c=b.length,d=[];for(let e=0,h=0;e<c;e++){const f=b[e];f&&!a[f]&&(d[h++]=f)}a=d}else a=b}return a};const F={},G={};function H(a,b,c,d){const e=a.length;let h=[],f,g,l=0;d&&(d=[]);for(let n=e-1;0<=n;n--){const m=a[n],r=m.length,p=y();let q=!f;for(let k=0;k<r;k++){const u=m[k],L=u.length;if(L)for(let D=0,x,w;D<L;D++)if(w=u[D],f){if(f[w]){if(!n)if(c)c--;else if(h[l++]=w,l===b)return h;if(n||d)p[w]=1;q=!0}if(d&&(x=(g[w]||0)+1,g[w]=x,x<e)){const M=d[x-2]||(d[x-2]=[]);M[M.length]=w}}else p[w]=1}if(d)f||(g=p);else if(!q)return[];f=p}if(d)for(let n=d.length-1,m,r;0<=n;n--){m=d[n];r=m.length;for(let p=0,q;p<r;p++)if(q=
|
||||
m[p],!f[q]){if(c)c--;else if(h[l++]=q,l===b)return h;f[q]=1}}return h};function I(a,b){if(!(this instanceof I))return new I(a);let c;if(a){var d=a.charset;c=a.lang;"string"===typeof d&&(-1===d.indexOf(":")&&(d+=":default"),d=G[d]);"string"===typeof c&&(c=F[c])}else a={};let e,h,f=a.context||{};this.encode=a.encode||d&&d.encode||E;this.register=b||y();this.s=e=a.resolution||9;this.B=b=d&&d.B||a.tokenize||"strict";this.i="strict"===b&&f.depth;this.j=t(f.bidirectional);this.g=h=t(a.optimize);this.m=t(a.fastupdate);this.h=a.minlength||1;this.C=a.boost;this.map=h?v(e):y();
|
||||
this.v=e=f.resolution||1;this.l=h?v(e):y();this.u=d&&d.u||a.rtl;this.o=(b=a.matcher||c&&c.o)&&B(b,!1);this.A=(b=a.stemmer||c&&c.A)&&B(b,!0);if(a=b=a.filter||c&&c.filter){a=b;d=y();for(let g=0,l=a.length;g<l;g++)d[a[g]]=1;a=d}this.filter=a}I.prototype.append=function(a,b){return this.add(a,b,!0)};
|
||||
I.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(d=b.length){const n=y(),m=y(),r=this.i,p=this.s;for(let q=0;q<d;q++){let k=b[this.u?d-1-q:q];var e=k.length;if(k&&e>=this.h&&(r||!m[k])){var h=J(p,d,q),f="";switch(this.B){case "full":if(2<e){for(h=0;h<e;h++)for(var g=e;g>h;g--)if(g-h>=this.h){var l=J(p,d,q,e,h);f=k.substring(h,g);K(this,m,f,l,a,c)}break}case "reverse":if(1<e){for(g=e-1;0<g;g--)f=k[g]+f,f.length>=this.h&&K(this,
|
||||
m,f,J(p,d,q,e,g),a,c);f=""}case "forward":if(1<e){for(g=0;g<e;g++)f+=k[g],f.length>=this.h&&K(this,m,f,h,a,c);break}default:if(this.C&&(h=Math.min(h/this.C(b,k,q)|0,p-1)),K(this,m,k,h,a,c),r&&1<d&&q<d-1)for(e=y(),f=this.v,h=k,g=Math.min(r+1,d-q),e[h]=1,l=1;l<g;l++)if((k=b[this.u?d-1-q-l:q+l])&&k.length>=this.h&&!e[k]){e[k]=1;const u=this.j&&k>h;K(this,n,u?h:k,J(f+(d/2>f?0:1),d,q,g-1,l-1),a,c,u?k:h)}}}}this.m||(this.register[a]=1)}}return this};
|
||||
function J(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 K(a,b,c,d,e,h,f){let g=f?a.l:a.map;if(!b[c]||f&&!b[c][f])a.g&&(g=g[d]),f?(b=b[c]||(b[c]=y()),b[f]=1,g=g[f]||(g[f]=y())):b[c]=1,g=g[c]||(g[c]=[]),a.g||(g=g[d]||(g[d]=[])),h&&g.includes(e)||(g[g.length]=e,a.m&&(a=a.register[e]||(a.register[e]=[]),a[a.length]=g))}
|
||||
I.prototype.search=function(a,b,c){c||(b||"object"!==typeof a?"object"===typeof b&&(c=b):(c=a,a=c.query));let d=[],e;let h,f=0;if(c){a=c.query||a;b=c.limit;f=c.offset||0;var g=c.context;h=!1}if(a&&(a=this.encode(""+a),e=a.length,1<e)){c=y();var l=[];for(let m=0,r=0,p;m<e;m++)if((p=a[m])&&p.length>=this.h&&!c[p])if(this.g||h||this.map[p])l[r++]=p,c[p]=1;else return d;a=l;e=a.length}if(!e)return d;b||(b=100);g=this.i&&1<e&&!1!==g;c=0;let n;g?(n=a[0],c=1):1<e&&a.sort(z);for(let m,r;c<e;c++){r=a[c];g?
|
||||
(m=L(this,d,h,b,f,2===e,r,n),h&&!1===m&&d.length||(n=r)):m=L(this,d,h,b,f,1===e,r);if(m)return m;if(h&&c===e-1){l=d.length;if(!l){if(g){g=0;c=-1;continue}return d}if(1===l)return O(d[0],b,f)}}return H(d,b,f,h)};
|
||||
function L(a,b,c,d,e,h,f,g){let l=[],n=g?a.l:a.map;a.g||(n=P(n,f,g,a.j));if(n){let m=0;const r=Math.min(n.length,g?a.v:a.s);for(let p=0,q=0,k,u;p<r;p++)if(k=n[p])if(a.g&&(k=P(k,f,g,a.j)),e&&k&&h&&(u=k.length,u<=e?(e-=u,k=null):(k=k.slice(e),e=0)),k&&(l[m++]=k,h&&(q+=k.length,q>=d)))break;if(m){if(h)return O(l,d,0);b[b.length]=l;return}}return!c&&l}function O(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
(m=N(this,d,h,b,f,2===e,r,n),h&&!1===m&&d.length||(n=r)):m=N(this,d,h,b,f,1===e,r);if(m)return m;if(h&&c===e-1){l=d.length;if(!l){if(g){g=0;c=-1;continue}return d}if(1===l)return O(d[0],b,f)}}return H(d,b,f,h)};
|
||||
function N(a,b,c,d,e,h,f,g){let l=[],n=g?a.l:a.map;a.g||(n=P(n,f,g,a.j));if(n){let m=0;const r=Math.min(n.length,g?a.v:a.s);for(let p=0,q=0,k,u;p<r;p++)if(k=n[p])if(a.g&&(k=P(k,f,g,a.j)),e&&k&&h&&(u=k.length,u<=e?(e-=u,k=null):(k=k.slice(e),e=0)),k&&(l[m++]=k,h&&(q+=k.length,q>=d)))break;if(m){if(h)return O(l,d,0);b[b.length]=l;return}}return!c&&l}function O(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function P(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}I.prototype.contain=function(a){return!!this.register[a]};I.prototype.update=function(a,b){return this.remove(a).add(a,b)};I.prototype.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d<c.length;d++)e=c[d],e.splice(e.indexOf(a),1);else Q(this.map,a,this.s,this.g),this.i&&Q(this.l,a,this.v,this.g);b||delete this.register[a]}return this};
|
||||
function Q(a,b,c,d,e){let h=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),h++):h++;else{e=Math.min(a.length,c);for(let f=0,g;f<e;f++)if(g=a[f])h=Q(g,b,c,d,e),d||h||delete a[f]}else for(let f in a)(h=Q(a[f],b,c,d,e))||delete a[f];return h};const R=self;let S;const T={Index:I,Document:null,Worker:null,registerCharset:function(a,b){G[a]=b},registerLanguage:function(a,b){F[a]=b}};(S=R.define)&&S.amd?S([],function(){return T}):R.exports?R.exports=T:R.FlexSearch=T;}(this));
|
||||
function Q(a,b,c,d,e){let h=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),h++):h++;else{e=Math.min(a.length,c);for(let f=0,g;f<e;f++)if(g=a[f])h=Q(g,b,c,d,e),d||h||delete a[f]}else for(let f in a)(h=Q(a[f],b,c,d,e))||delete a[f];return h};const R={Index:I,Document:null,Worker:null,registerCharset:function(a,b){G[a]=b},registerLanguage:function(a,b){F[a]=b}};let S;(S=self.define)&&S.amd?S([],function(){return R}):self.exports?self.exports=R:self.FlexSearch=R;}(this));
|
||||
|
47
dist/flexsearch.light.module.debug.js
vendored
47
dist/flexsearch.light.module.debug.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Light.module)
|
||||
* FlexSearch.js v0.7.40 (Light.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
@@ -36,7 +36,7 @@ function C(a, b) {
|
||||
}
|
||||
return a;
|
||||
}
|
||||
;function D(a) {
|
||||
;function E(a) {
|
||||
if (a = ("" + a).toLowerCase()) {
|
||||
if (this.o && (a = C(a, this.o)), this.A && 1 < a.length && (a = C(a, this.A)), A || "" === A) {
|
||||
const b = a.split(A);
|
||||
@@ -64,10 +64,10 @@ function H(a, b, c, d) {
|
||||
const m = a[n], r = m.length, p = y();
|
||||
let q = !f;
|
||||
for (let k = 0; k < r; k++) {
|
||||
const u = m[k], M = u.length;
|
||||
if (M) {
|
||||
for (let E = 0, x, w; E < M; E++) {
|
||||
if (w = u[E], f) {
|
||||
const u = m[k], J = u.length;
|
||||
if (J) {
|
||||
for (let D = 0, x, w; D < J; D++) {
|
||||
if (w = u[D], f) {
|
||||
if (f[w]) {
|
||||
if (!n) {
|
||||
if (c) {
|
||||
@@ -84,8 +84,8 @@ function H(a, b, c, d) {
|
||||
q = !0;
|
||||
}
|
||||
if (d && (x = (g[w] || 0) + 1, g[w] = x, x < e)) {
|
||||
const N = d[x - 2] || (d[x - 2] = []);
|
||||
N[N.length] = w;
|
||||
const K = d[x - 2] || (d[x - 2] = []);
|
||||
K[K.length] = w;
|
||||
}
|
||||
} else {
|
||||
p[w] = 1;
|
||||
@@ -134,7 +134,7 @@ function H(a, b, c, d) {
|
||||
a = {};
|
||||
}
|
||||
let e, h, f = a.context || {};
|
||||
this.encode = a.encode || d && d.encode || D;
|
||||
this.encode = a.encode || d && d.encode || E;
|
||||
this.register = b || y();
|
||||
this.s = e = a.resolution || 9;
|
||||
this.B = b = d && d.B || a.tokenize || "strict";
|
||||
@@ -175,16 +175,16 @@ I.prototype.add = function(a, b, c, d) {
|
||||
let k = b[this.u ? d - 1 - q : q];
|
||||
var e = k.length;
|
||||
if (k && e >= this.h && (r || !m[k])) {
|
||||
var h = J(p, d, q), f = "";
|
||||
var h = L(p, d, q), f = "";
|
||||
switch(this.B) {
|
||||
case "full":
|
||||
if (2 < e) {
|
||||
for (h = 0; h < e; h++) {
|
||||
for (var g = e; g > h; g--) {
|
||||
if (g - h >= this.h) {
|
||||
var l = J(p, d, q, e, h);
|
||||
var l = L(p, d, q, e, h);
|
||||
f = k.substring(h, g);
|
||||
K(this, m, f, l, a, c);
|
||||
M(this, m, f, l, a, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,24 +193,24 @@ I.prototype.add = function(a, b, c, d) {
|
||||
case "reverse":
|
||||
if (1 < e) {
|
||||
for (g = e - 1; 0 < g; g--) {
|
||||
f = k[g] + f, f.length >= this.h && K(this, m, f, J(p, d, q, e, g), a, c);
|
||||
f = k[g] + f, f.length >= this.h && M(this, m, f, L(p, d, q, e, g), a, c);
|
||||
}
|
||||
f = "";
|
||||
}
|
||||
case "forward":
|
||||
if (1 < e) {
|
||||
for (g = 0; g < e; g++) {
|
||||
f += k[g], f.length >= this.h && K(this, m, f, h, a, c);
|
||||
f += k[g], f.length >= this.h && M(this, m, f, h, a, c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (this.C && (h = Math.min(h / this.C(b, k, q) | 0, p - 1)), K(this, m, k, h, a, c), r && 1 < d && q < d - 1) {
|
||||
if (this.C && (h = Math.min(h / this.C(b, k, q) | 0, p - 1)), M(this, m, k, h, a, c), r && 1 < d && q < d - 1) {
|
||||
for (e = y(), f = this.v, h = k, g = Math.min(r + 1, d - q), e[h] = 1, l = 1; l < g; l++) {
|
||||
if ((k = b[this.u ? d - 1 - q - l : q + l]) && k.length >= this.h && !e[k]) {
|
||||
e[k] = 1;
|
||||
const u = this.j && k > h;
|
||||
K(this, n, u ? h : k, J(f + (d / 2 > f ? 0 : 1), d, q, g - 1, l - 1), a, c, u ? k : h);
|
||||
M(this, n, u ? h : k, L(f + (d / 2 > f ? 0 : 1), d, q, g - 1, l - 1), a, c, u ? k : h);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,10 +222,10 @@ I.prototype.add = function(a, b, c, d) {
|
||||
}
|
||||
return this;
|
||||
};
|
||||
function J(a, b, c, d, e) {
|
||||
function L(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 K(a, b, c, d, e, h, f) {
|
||||
function M(a, b, c, d, e, h, f) {
|
||||
let g = f ? a.l : a.map;
|
||||
if (!b[c] || f && !b[c][f]) {
|
||||
a.g && (g = g[d]), f ? (b = b[c] || (b[c] = y()), b[f] = 1, g = g[f] || (g[f] = y())) : b[c] = 1, g = g[c] || (g[c] = []), a.g || (g = g[d] || (g[d] = [])), h && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g));
|
||||
@@ -267,7 +267,7 @@ I.prototype.search = function(a, b, c) {
|
||||
g ? (n = a[0], c = 1) : 1 < e && a.sort(z);
|
||||
for (let m, r; c < e; c++) {
|
||||
r = a[c];
|
||||
g ? (m = L(this, d, h, b, f, 2 === e, r, n), h && !1 === m && d.length || (n = r)) : m = L(this, d, h, b, f, 1 === e, r);
|
||||
g ? (m = N(this, d, h, b, f, 2 === e, r, n), h && !1 === m && d.length || (n = r)) : m = N(this, d, h, b, f, 1 === e, r);
|
||||
if (m) {
|
||||
return m;
|
||||
}
|
||||
@@ -288,7 +288,7 @@ I.prototype.search = function(a, b, c) {
|
||||
}
|
||||
return H(d, b, f, h);
|
||||
};
|
||||
function L(a, b, c, d, e, h, f, g) {
|
||||
function N(a, b, c, d, e, h, f, g) {
|
||||
let l = [], n = g ? a.l : a.map;
|
||||
a.g || (n = P(n, f, g, a.j));
|
||||
if (n) {
|
||||
@@ -359,14 +359,9 @@ function Q(a, b, c, d, e) {
|
||||
}
|
||||
return h;
|
||||
}
|
||||
;const R = self;
|
||||
let S;
|
||||
const T = {Index:I, Document:null, Worker:null, registerCharset:function(a, b) {
|
||||
;export default {Index:I, Document:null, Worker:null, registerCharset:function(a, b) {
|
||||
G[a] = b;
|
||||
}, registerLanguage:function(a, b) {
|
||||
F[a] = b;
|
||||
}};
|
||||
(S = R.define) && S.amd ? S([], function() {
|
||||
return T;
|
||||
}) : R.exports ? R.exports = T : R.FlexSearch = T;
|
||||
|
||||
|
18
dist/flexsearch.light.module.min.js
vendored
18
dist/flexsearch.light.module.min.js
vendored
@@ -1,18 +1,18 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.39 (Light.module)
|
||||
* FlexSearch.js v0.7.40 (Light.module)
|
||||
* Author and Copyright: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* Hosted by Nextapps GmbH
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
function t(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=y();return b}function y(){return Object.create(null)}function z(a,b){return b.length-a.length};const A=/[\p{Z}\p{S}\p{P}\p{C}]+/u;function B(a,b){const c=Object.keys(a),d=c.length,e=[];let h="",f=0;for(let g=0,l,n;g<d;g++)l=c[g],(n=a[l])?(e[f++]=new RegExp(b?"(?!\\b)"+l+"(\\b|_)":l,"g"),e[f++]=n):h+=(h?"|":"")+l;h&&(e[f++]=new RegExp(b?"(?!\\b)("+h+")(\\b|_)":"("+h+")","g"),e[f]="");return e}function C(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a};function D(a){if(a=(""+a).toLowerCase())if(this.o&&(a=C(a,this.o)),this.A&&1<a.length&&(a=C(a,this.A)),A||""===A){const b=a.split(A);if(this.filter){a=this.filter;const c=b.length,d=[];for(let e=0,h=0;e<c;e++){const f=b[e];f&&!a[f]&&(d[h++]=f)}a=d}else a=b}return a};const F={},G={};function H(a,b,c,d){const e=a.length;let h=[],f,g,l=0;d&&(d=[]);for(let n=e-1;0<=n;n--){const m=a[n],r=m.length,p=y();let q=!f;for(let k=0;k<r;k++){const u=m[k],M=u.length;if(M)for(let E=0,x,w;E<M;E++)if(w=u[E],f){if(f[w]){if(!n)if(c)c--;else if(h[l++]=w,l===b)return h;if(n||d)p[w]=1;q=!0}if(d&&(x=(g[w]||0)+1,g[w]=x,x<e)){const N=d[x-2]||(d[x-2]=[]);N[N.length]=w}}else p[w]=1}if(d)f||(g=p);else if(!q)return[];f=p}if(d)for(let n=d.length-1,m,r;0<=n;n--){m=d[n];r=m.length;for(let p=0,q;p<r;p++)if(q=
|
||||
m[p],!f[q]){if(c)c--;else if(h[l++]=q,l===b)return h;f[q]=1}}return h};function I(a,b){if(!(this instanceof I))return new I(a);let c;if(a){var d=a.charset;c=a.lang;"string"===typeof d&&(-1===d.indexOf(":")&&(d+=":default"),d=G[d]);"string"===typeof c&&(c=F[c])}else a={};let e,h,f=a.context||{};this.encode=a.encode||d&&d.encode||D;this.register=b||y();this.s=e=a.resolution||9;this.B=b=d&&d.B||a.tokenize||"strict";this.i="strict"===b&&f.depth;this.j=t(f.bidirectional);this.g=h=t(a.optimize);this.m=t(a.fastupdate);this.h=a.minlength||1;this.C=a.boost;this.map=h?v(e):y();
|
||||
function t(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=y();return b}function y(){return Object.create(null)}function z(a,b){return b.length-a.length};const A=/[\p{Z}\p{S}\p{P}\p{C}]+/u;function B(a,b){const c=Object.keys(a),d=c.length,e=[];let h="",f=0;for(let g=0,l,n;g<d;g++)l=c[g],(n=a[l])?(e[f++]=new RegExp(b?"(?!\\b)"+l+"(\\b|_)":l,"g"),e[f++]=n):h+=(h?"|":"")+l;h&&(e[f++]=new RegExp(b?"(?!\\b)("+h+")(\\b|_)":"("+h+")","g"),e[f]="");return e}function C(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a};function E(a){if(a=(""+a).toLowerCase())if(this.o&&(a=C(a,this.o)),this.A&&1<a.length&&(a=C(a,this.A)),A||""===A){const b=a.split(A);if(this.filter){a=this.filter;const c=b.length,d=[];for(let e=0,h=0;e<c;e++){const f=b[e];f&&!a[f]&&(d[h++]=f)}a=d}else a=b}return a};const F={},G={};function H(a,b,c,d){const e=a.length;let h=[],f,g,l=0;d&&(d=[]);for(let n=e-1;0<=n;n--){const m=a[n],r=m.length,p=y();let q=!f;for(let k=0;k<r;k++){const u=m[k],J=u.length;if(J)for(let D=0,x,w;D<J;D++)if(w=u[D],f){if(f[w]){if(!n)if(c)c--;else if(h[l++]=w,l===b)return h;if(n||d)p[w]=1;q=!0}if(d&&(x=(g[w]||0)+1,g[w]=x,x<e)){const K=d[x-2]||(d[x-2]=[]);K[K.length]=w}}else p[w]=1}if(d)f||(g=p);else if(!q)return[];f=p}if(d)for(let n=d.length-1,m,r;0<=n;n--){m=d[n];r=m.length;for(let p=0,q;p<r;p++)if(q=
|
||||
m[p],!f[q]){if(c)c--;else if(h[l++]=q,l===b)return h;f[q]=1}}return h};function I(a,b){if(!(this instanceof I))return new I(a);let c;if(a){var d=a.charset;c=a.lang;"string"===typeof d&&(-1===d.indexOf(":")&&(d+=":default"),d=G[d]);"string"===typeof c&&(c=F[c])}else a={};let e,h,f=a.context||{};this.encode=a.encode||d&&d.encode||E;this.register=b||y();this.s=e=a.resolution||9;this.B=b=d&&d.B||a.tokenize||"strict";this.i="strict"===b&&f.depth;this.j=t(f.bidirectional);this.g=h=t(a.optimize);this.m=t(a.fastupdate);this.h=a.minlength||1;this.C=a.boost;this.map=h?v(e):y();
|
||||
this.v=e=f.resolution||1;this.l=h?v(e):y();this.u=d&&d.u||a.rtl;this.o=(b=a.matcher||c&&c.o)&&B(b,!1);this.A=(b=a.stemmer||c&&c.A)&&B(b,!0);if(a=b=a.filter||c&&c.filter){a=b;d=y();for(let g=0,l=a.length;g<l;g++)d[a[g]]=1;a=d}this.filter=a}I.prototype.append=function(a,b){return this.add(a,b,!0)};
|
||||
I.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(d=b.length){const n=y(),m=y(),r=this.i,p=this.s;for(let q=0;q<d;q++){let k=b[this.u?d-1-q:q];var e=k.length;if(k&&e>=this.h&&(r||!m[k])){var h=J(p,d,q),f="";switch(this.B){case "full":if(2<e){for(h=0;h<e;h++)for(var g=e;g>h;g--)if(g-h>=this.h){var l=J(p,d,q,e,h);f=k.substring(h,g);K(this,m,f,l,a,c)}break}case "reverse":if(1<e){for(g=e-1;0<g;g--)f=k[g]+f,f.length>=this.h&&K(this,
|
||||
m,f,J(p,d,q,e,g),a,c);f=""}case "forward":if(1<e){for(g=0;g<e;g++)f+=k[g],f.length>=this.h&&K(this,m,f,h,a,c);break}default:if(this.C&&(h=Math.min(h/this.C(b,k,q)|0,p-1)),K(this,m,k,h,a,c),r&&1<d&&q<d-1)for(e=y(),f=this.v,h=k,g=Math.min(r+1,d-q),e[h]=1,l=1;l<g;l++)if((k=b[this.u?d-1-q-l:q+l])&&k.length>=this.h&&!e[k]){e[k]=1;const u=this.j&&k>h;K(this,n,u?h:k,J(f+(d/2>f?0:1),d,q,g-1,l-1),a,c,u?k:h)}}}}this.m||(this.register[a]=1)}}return this};
|
||||
function J(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 K(a,b,c,d,e,h,f){let g=f?a.l:a.map;if(!b[c]||f&&!b[c][f])a.g&&(g=g[d]),f?(b=b[c]||(b[c]=y()),b[f]=1,g=g[f]||(g[f]=y())):b[c]=1,g=g[c]||(g[c]=[]),a.g||(g=g[d]||(g[d]=[])),h&&g.includes(e)||(g[g.length]=e,a.m&&(a=a.register[e]||(a.register[e]=[]),a[a.length]=g))}
|
||||
I.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(d=b.length){const n=y(),m=y(),r=this.i,p=this.s;for(let q=0;q<d;q++){let k=b[this.u?d-1-q:q];var e=k.length;if(k&&e>=this.h&&(r||!m[k])){var h=L(p,d,q),f="";switch(this.B){case "full":if(2<e){for(h=0;h<e;h++)for(var g=e;g>h;g--)if(g-h>=this.h){var l=L(p,d,q,e,h);f=k.substring(h,g);M(this,m,f,l,a,c)}break}case "reverse":if(1<e){for(g=e-1;0<g;g--)f=k[g]+f,f.length>=this.h&&M(this,
|
||||
m,f,L(p,d,q,e,g),a,c);f=""}case "forward":if(1<e){for(g=0;g<e;g++)f+=k[g],f.length>=this.h&&M(this,m,f,h,a,c);break}default:if(this.C&&(h=Math.min(h/this.C(b,k,q)|0,p-1)),M(this,m,k,h,a,c),r&&1<d&&q<d-1)for(e=y(),f=this.v,h=k,g=Math.min(r+1,d-q),e[h]=1,l=1;l<g;l++)if((k=b[this.u?d-1-q-l:q+l])&&k.length>=this.h&&!e[k]){e[k]=1;const u=this.j&&k>h;M(this,n,u?h:k,L(f+(d/2>f?0:1),d,q,g-1,l-1),a,c,u?k:h)}}}}this.m||(this.register[a]=1)}}return this};
|
||||
function L(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 M(a,b,c,d,e,h,f){let g=f?a.l:a.map;if(!b[c]||f&&!b[c][f])a.g&&(g=g[d]),f?(b=b[c]||(b[c]=y()),b[f]=1,g=g[f]||(g[f]=y())):b[c]=1,g=g[c]||(g[c]=[]),a.g||(g=g[d]||(g[d]=[])),h&&g.includes(e)||(g[g.length]=e,a.m&&(a=a.register[e]||(a.register[e]=[]),a[a.length]=g))}
|
||||
I.prototype.search=function(a,b,c){c||(b||"object"!==typeof a?"object"===typeof b&&(c=b):(c=a,a=c.query));let d=[],e;let h,f=0;if(c){a=c.query||a;b=c.limit;f=c.offset||0;var g=c.context;h=!1}if(a&&(a=this.encode(""+a),e=a.length,1<e)){c=y();var l=[];for(let m=0,r=0,p;m<e;m++)if((p=a[m])&&p.length>=this.h&&!c[p])if(this.g||h||this.map[p])l[r++]=p,c[p]=1;else return d;a=l;e=a.length}if(!e)return d;b||(b=100);g=this.i&&1<e&&!1!==g;c=0;let n;g?(n=a[0],c=1):1<e&&a.sort(z);for(let m,r;c<e;c++){r=a[c];g?
|
||||
(m=L(this,d,h,b,f,2===e,r,n),h&&!1===m&&d.length||(n=r)):m=L(this,d,h,b,f,1===e,r);if(m)return m;if(h&&c===e-1){l=d.length;if(!l){if(g){g=0;c=-1;continue}return d}if(1===l)return O(d[0],b,f)}}return H(d,b,f,h)};
|
||||
function L(a,b,c,d,e,h,f,g){let l=[],n=g?a.l:a.map;a.g||(n=P(n,f,g,a.j));if(n){let m=0;const r=Math.min(n.length,g?a.v:a.s);for(let p=0,q=0,k,u;p<r;p++)if(k=n[p])if(a.g&&(k=P(k,f,g,a.j)),e&&k&&h&&(u=k.length,u<=e?(e-=u,k=null):(k=k.slice(e),e=0)),k&&(l[m++]=k,h&&(q+=k.length,q>=d)))break;if(m){if(h)return O(l,d,0);b[b.length]=l;return}}return!c&&l}function O(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
(m=N(this,d,h,b,f,2===e,r,n),h&&!1===m&&d.length||(n=r)):m=N(this,d,h,b,f,1===e,r);if(m)return m;if(h&&c===e-1){l=d.length;if(!l){if(g){g=0;c=-1;continue}return d}if(1===l)return O(d[0],b,f)}}return H(d,b,f,h)};
|
||||
function N(a,b,c,d,e,h,f,g){let l=[],n=g?a.l:a.map;a.g||(n=P(n,f,g,a.j));if(n){let m=0;const r=Math.min(n.length,g?a.v:a.s);for(let p=0,q=0,k,u;p<r;p++)if(k=n[p])if(a.g&&(k=P(k,f,g,a.j)),e&&k&&h&&(u=k.length,u<=e?(e-=u,k=null):(k=k.slice(e),e=0)),k&&(l[m++]=k,h&&(q+=k.length,q>=d)))break;if(m){if(h)return O(l,d,0);b[b.length]=l;return}}return!c&&l}function O(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function P(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}I.prototype.contain=function(a){return!!this.register[a]};I.prototype.update=function(a,b){return this.remove(a).add(a,b)};I.prototype.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d<c.length;d++)e=c[d],e.splice(e.indexOf(a),1);else Q(this.map,a,this.s,this.g),this.i&&Q(this.l,a,this.v,this.g);b||delete this.register[a]}return this};
|
||||
function Q(a,b,c,d,e){let h=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),h++):h++;else{e=Math.min(a.length,c);for(let f=0,g;f<e;f++)if(g=a[f])h=Q(g,b,c,d,e),d||h||delete a[f]}else for(let f in a)(h=Q(a[f],b,c,d,e))||delete a[f];return h};const R=self;let S;const T={Index:I,Document:null,Worker:null,registerCharset:function(a,b){G[a]=b},registerLanguage:function(a,b){F[a]=b}};(S=R.define)&&S.amd?S([],function(){return T}):R.exports?R.exports=T:R.FlexSearch=T;
|
||||
function Q(a,b,c,d,e){let h=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),h++):h++;else{e=Math.min(a.length,c);for(let f=0,g;f<e;f++)if(g=a[f])h=Q(g,b,c,d,e),d||h||delete a[f]}else for(let f in a)(h=Q(a[f],b,c,d,e))||delete a[f];return h};export default {Index:I,Document:null,Worker:null,registerCharset:function(a,b){G[a]=b},registerLanguage:function(a,b){F[a]=b}};
|
||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "flexsearch",
|
||||
"version": "0.7.39",
|
||||
"version": "0.7.40",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "flexsearch",
|
||||
"version": "0.7.39",
|
||||
"version": "0.7.40",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"public": true,
|
||||
"preferGlobal": false,
|
||||
"name": "flexsearch",
|
||||
"version": "0.7.39",
|
||||
"version": "0.7.40",
|
||||
"description": "Next-Generation full text search library with zero dependencies.",
|
||||
"homepage": "https://github.com/nextapps-de/flexsearch/",
|
||||
"author": "Thomas Wilkerling",
|
||||
|
@@ -1,3 +1,6 @@
|
||||
/** @define {string} */
|
||||
export const RELEASE = "custom";
|
||||
|
||||
/** @define {boolean} */
|
||||
export const DEBUG = false;
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { SUPPORT_ASYNC, SUPPORT_DOCUMENT, SUPPORT_CACHE, SUPPORT_SERIALIZE, SUPPORT_WORKER, SUPPORT_ENCODER } from "./config.js";
|
||||
import { RELEASE, SUPPORT_ASYNC, SUPPORT_DOCUMENT, SUPPORT_CACHE, SUPPORT_SERIALIZE, SUPPORT_WORKER, SUPPORT_ENCODER } from "./config.js";
|
||||
import Document from "./document.js";
|
||||
import Index from "./index.js";
|
||||
import WorkerIndex from "./worker/index.js";
|
||||
@@ -63,9 +63,6 @@ if(SUPPORT_ENCODER){
|
||||
registerCharset("latin:extra", charset_extra);
|
||||
}
|
||||
|
||||
const root = self;
|
||||
let tmp;
|
||||
|
||||
const FlexSearch = {
|
||||
|
||||
"Index": Index,
|
||||
@@ -75,18 +72,29 @@ const FlexSearch = {
|
||||
"registerLanguage": registerLanguage
|
||||
};
|
||||
|
||||
if((tmp = root["define"]) && tmp["amd"]){
|
||||
if(RELEASE !== "bundle.module" && RELEASE !== "light.module" && RELEASE !== "compact.module"){
|
||||
|
||||
tmp([], function(){
|
||||
let tmp;
|
||||
|
||||
return FlexSearch;
|
||||
});
|
||||
}
|
||||
else if(root["exports"]){
|
||||
if((tmp = self["define"]) && tmp["amd"]){
|
||||
|
||||
root["exports"] = FlexSearch;
|
||||
tmp([], function(){
|
||||
|
||||
return FlexSearch;
|
||||
});
|
||||
}
|
||||
else if(self["exports"]){
|
||||
|
||||
self["exports"] = FlexSearch;
|
||||
}
|
||||
else{
|
||||
|
||||
/** @export */
|
||||
self.FlexSearch = FlexSearch;
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
root["FlexSearch"] = FlexSearch;
|
||||
}
|
||||
/** @export */
|
||||
self.FlexSearch = FlexSearch;
|
||||
}
|
@@ -279,9 +279,9 @@ exec(executable + parameter + " --js='tmp/**.js' --js='!tmp/**/node.js'" + flag_
|
||||
build = build.replace("(function(self){'use strict';", "(function _factory(self){'use strict';");
|
||||
}
|
||||
|
||||
if(release === "bundle.module" || release === "light.module"){
|
||||
if(release === "bundle.module" || release === "light.module" || release === "compact.module"){
|
||||
|
||||
build = build.replace(/window\.FlexSearch(\s+)?=(\s+)?/, "export default ");
|
||||
build = build.replace(/self\.FlexSearch(\s+)?=(\s+)?/, "export default ");
|
||||
}
|
||||
|
||||
// if(release === "pre"){
|
||||
|
Reference in New Issue
Block a user