flexsearch
Advanced tools
Comparing version 0.6.2 to 0.6.21
/* | ||
FlexSearch v0.6.2 | ||
FlexSearch v0.6.21 | ||
Copyright 2019 Nextapps GmbH | ||
@@ -8,25 +8,25 @@ Author: Thomas Wilkerling | ||
*/ | ||
'use strict';(function(n,y,G){let z;(z=G.define)&&z.amd?z([],function(){return y}):(z=G.modules)?z[n.toLowerCase()]=y:"object"===typeof exports?module.exports=y:G[n]=y})("FlexSearch",function(){function n(a,b){const c=b?b.id:a&&a.id;this.id=c||0===c?c:aa++;this.init(a,b);z(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].f):Object.keys(this.f)});z(this,"length",function(){return this.index.length})}function y(a,b){const c=a.length,d=J(b),f=[];for(let k=0,g=0;k<c;k++){const c= | ||
a[k];if(d&&b(c)||!d&&!b[c])f[g++]=c}return f}function G(a,b,c,d,f,k,g,p,q,l){c=V(c,g?0:f,!1,!1,b,q,l);let e;p&&(p=c.page,e=c.next,c=c.result);if(g)a=this.where(g,null,f,c);else{a=c;b=this.g;c=a.length;f=Array(c);for(k=0;k<c;k++)f[k]=b[a[k]];a=f}c=a;d&&(J(d)||(x=d.split(":"),1<x.length?d=ba:(x=x[0],d=ca)),c.sort(d));return c=K(p,e,c)}function z(a,b,c){Object.defineProperty(a,b,{get:c})}function e(a){return new RegExp(a,"g")}function H(a,b){for(let c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a} | ||
function Q(a,b,c,d,f,k,g,p){if(b[c])return b[c];f=f?(p-(g||p/1.5))*k+(g||p/1.5)*f:k;b[c]=f;f>=g&&(a=a[p-(f+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=d);return f}function S(a,b){if(a){const c=Object.keys(a);for(let d=0,f=c.length;d<f;d++){const f=c[d],g=a[f];if(g)for(let c=0,d=g.length;c<d;c++)if(g[c]===b){1===d?delete a[f]:g.splice(c,1);break}else I(g[c])&&S(g[c],b)}}}function T(a){let b="",c="";var d="";for(let f=0;f<a.length;f++){const k=a[f];if(k!==c)if(f&&"h"===k){if(d="a"===d||"e"===d||"i"===d|| | ||
"o"===d||"u"===d||"y"===d,("a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c)&&d||" "===c)b+=k}else b+=k;d=f===a.length-1?"":a[f+1];c=k}return b}function da(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function ca(a,b){a=a[x];b=b[x];return a<b?-1:a>b?1:0}function ba(a,b){const c=x.length;for(let d=0;d<c;d++)a=a[x[d]],b=b[x[d]];return a<b?-1:a>b?1:0}function K(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}function V(a,b,c,d,f,k,g){let p,q=[];if(!0===c){c="0";var l=""}else l=c&&c.split(":"); | ||
const e=a.length;if(1<e){const r=A();let B=[],M,E;var m=0,h;let O;var R=!0;let C,D=0,u,x,w,z;l&&(2===l.length?(w=l,l=!1):l=z=parseInt(l[0],10));if(g){for(M=A();m<e;m++)if("not"===f[m])for(E=a[m],O=E.length,h=0;h<O;h++)M["@"+E[h]]=1;else x=m+1;if(N(x))return K(c,p,q);m=0}else u=F(f)&&f;let y;for(;m<e;m++){const L=m===(x||e)-1;if(!u||!m)if((h=u||f&&f[m])&&"and"!==h)if("or"===h)y=!1;else continue;else y=k=!0;E=a[m];if(O=E.length){if(R)if(C){var t=C.length;for(h=0;h<t;h++){R=C[h];var n="@"+R;g&&M[n]|| | ||
(r[n]=1,k||(q[D++]=R))}C=null;R=!1}else{C=E;continue}n=!1;for(h=0;h<O;h++){t=E[h];var v="@"+t;const a=k?r[v]||0:m;if(!(!a&&!d||g&&M[v]||!k&&r[v]))if(a===m){if(L){if(!z||--z<D)if(q[D++]=t,b&&D===b)return K(c,D+(l||0),q)}else r[v]=m+1;n=!0}else d&&(v=B[a]||(B[a]=[]),v[v.length]=t)}if(y&&!n&&!d)break}else if(y&&!d)return K(c,p,E)}if(C)if(m=C.length,g)for(h=l?parseInt(l,10):0;h<m;h++)a=C[h],M["@"+a]||(q[D++]=a);else q=C;if(d)for(D=q.length,w?(m=parseInt(w[0],10)+1,h=parseInt(w[1],10)+1):(m=B.length,h= | ||
0);m--;)if(t=B[m]){for(O=t.length;h<O;h++)if(d=t[h],!g||!M["@"+d])if(q[D++]=d,b&&D===b)return K(c,m+":"+h,q);h=0}}else!e||f&&"not"===f[0]||(q=a[0],l&&(l=parseInt(l[0],10)));b&&(g=q.length,l&&l>g&&(l=0),l=l||0,p=l+b,p<g?q=q.slice(l,p):(p=0,l&&(q=q.slice(l))));return K(c,p,q)}function F(a){return"string"===typeof a}function w(a){return a.constructor===Array}function J(a){return"function"===typeof a}function I(a){return"object"===typeof a}function N(a){return"undefined"===typeof a}function W(a){const b= | ||
Array(a);for(let c=0;c<a;c++)b[c]=A();return b}function A(){return Object.create(null)}const u={encode:"icase",c:"forward",split:/\W+/,cache:!1,async:!1,u:!1,m:!1,a:!1,b:9,threshold:0,depth:0},X={memory:{encode:"extra",c:"strict",threshold:0,b:1},speed:{encode:"icase",c:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",c:"full",threshold:1,b:3},score:{encode:"extra",c:"strict",threshold:1,b:9,depth:4},balance:{encode:"balance",c:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase",c:"strict", | ||
threshold:8,b:9,depth:1}},U=[];let aa=0;const Y={},Z={};n.create=function(a,b){return new n(a,b)};n.registerMatcher=function(a){for(const b in a)a.hasOwnProperty(b)&&U.push(e(b),a[b]);return this};n.registerEncoder=function(a,b){P[a]=b.bind(P);return this};n.registerLanguage=function(a,b){Y[a]=b.filter;Z[a]=b.stemmer;return this};n.encode=function(a,b){return P[a](b)};n.prototype.init=function(a,b){this.o=[];if(b){var c=b.preset;a=b}else a||(a=u),c=a.preset;b={};F(a)?(b=X[a],a={}):c&&(b=X[c]);this.c= | ||
a.tokenize||b.c||this.c||u.c;this.split=a.split||this.split||u.split;this.m=a.rtl||this.m||u.m;this.async="undefined"===typeof Promise||N(c=a.async)?this.async||u.async:c;this.threshold=N(c=a.threshold)?b.threshold||this.threshold||u.threshold:c;this.b=N(c=a.resolution)?c=b.b||this.b||u.b:c;c<=this.threshold&&(this.b=this.threshold+1);this.depth="strict"!==this.c||N(c=a.depth)?b.depth||this.depth||u.depth:c;this.i=(c=N(c=a.encode)?b.encode||u.encode:c)&&P[c]&&P[c].bind(P)||(J(c)?c:this.i||!1);(c= | ||
a.matcher)&&this.addMatcher(c);if(c=(b=a.lang)||a.filter){F(c)&&(c=Y[c]);if(w(c)){var d=this.i,f=A();for(var k=0;k<c.length;k++){const a=d?d(c[k]):c[k];f[a]=1}c=f}this.filter=c}if(c=b||a.stemmer){var g;b=F(c)?Z[c]:c;d=this.i;f=[];for(g in b)b.hasOwnProperty(g)&&(k=d?d(g):g,f.push(e(k+"($|\\W)"),d?d(b[g]):b[g]));this.stemmer=g=f}this.a=d=(c=a.doc)?c:this.a||u.a;this.l=W(this.b-(this.threshold||0));this.h=A();this.f=A();if(d&&(this.g=A(),a.doc=null,g=d.index={},c=d.keys=[],b=d.field,w(d.id)||(d.id= | ||
d.id.split(":")),b)){let k;w(b)||(I(b)?(k=b,d.field=b=Object.keys(b)):d.field=b=[b]);for(d=0;d<b.length;d++)f=b[d],w(f)||(k&&(a=k[f]),c[d]=f,b[d]=f.split(":")),g[f]=new n(a),g[f].g=this.g}return this};n.prototype.encode=function(a){a&&U.length&&(a=H(a,U));a&&this.o.length&&(a=H(a,this.o));a&&this.i&&(a=this.i(a));a&&this.stemmer&&(a=H(a,this.stemmer));return a};n.prototype.addMatcher=function(a){const b=this.o;for(const c in a)a.hasOwnProperty(c)&&b.push(e(c),a[c]);return this};n.prototype.add=function(a, | ||
b,c,d,f){if(this.a&&I(a))return this.j("add",a,b);if(b&&F(b)&&(a||0===a)){var k="@"+a;if(this.f[k]&&!d)return this.update(a,b);if(!f){if(this.async){let f=this;k=new Promise(function(c){setTimeout(function(){f.add(a,b,null,d,!0);f=null;c()})});if(c)k.then(c);else return k;return this}if(c)return this.add(a,b,null,d,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.c;f=J(c)?c(b):b.split(this.split);this.filter&&(f=y(f,this.filter));const m=A();m._ctx=A();const h=f.length,p=this.threshold, | ||
t=this.depth,n=this.b,v=this.l,L=this.m;for(let b=0;b<h;b++){var g=f[b];if(g){var e=g.length,q=(L?b+1:h-b)/h,l="";switch(c){case "reverse":case "both":for(var r=e;--r;)l=g[r]+l,Q(v,m,l,a,L?1:(e-r)/e,q,p,n-1);l="";case "forward":for(r=0;r<e;r++)l+=g[r],Q(v,m,l,a,L?(r+1)/e:1,q,p,n-1);break;case "full":for(r=0;r<e;r++){const b=(L?r+1:e-r)/e;for(let c=e;c>r;c--)l=g.substring(r,c),Q(v,m,l,a,b,q,p,n-1)}break;default:if(e=Q(v,m,g,a,1,q,p,n-1),t&&1<h&&e>=p)for(e=m._ctx[g]||(m._ctx[g]=A()),g=this.h[g]||(this.h[g]= | ||
W(n-(p||0))),q=b-t,l=b+t+1,0>q&&(q=0),l>h&&(l=h);q<l;q++)q!==b&&Q(g,e,f[q],a,0,n-(q<b?b-q:q-b),p,n-1)}}}this.f[k]=1}return this};n.prototype.j=function(a,b,c){if(w(b))for(let d=0,f=b.length;d<f;d++){if(d===f-1)return this.j(a,b[d],c);this.j(a,b[d])}else{const k=this.a.index,l=this.a.keys;var d=this.a.tag,f=this.a.id;let r;let m;for(var e=0;e<f.length;e++)r=(r||b)[f[e]];if(d){for(f=0;f<d.length;f++){var g=d[f];var p=g.split(":");for(e=0;e<p.length;e++)m=(m||b)[p[e]];m="@"+m}p=this.s[g];p=p[m]||(p[m]= | ||
[])}if("remove"===a){delete this.g[r];for(let b=0,a=l.length;b<a;b++){if(b===a-1)return k[l[b]].remove(r,c),this;k[l[b]].remove(r)}}f=this.a.field;p&&(p[p.length]=b);this.g[r]=b;for(let e=0,m=f.length;e<m;e++){d=f[e];let h;for(g=0;g<d.length;g++)h=(h||b)[d[g]];d=k[l[e]];g="add"===a?d.add:d.update;e===m-1?g.call(d,r,h,c):g.call(d,r,h)}}return this};n.prototype.update=function(a,b,c){if(this.a&&I(a))return this.j("update",a,b);this.f["@"+a]&&F(b)&&(this.remove(a),this.add(a,b,c,!0));return this};n.prototype.remove= | ||
function(a,b,c){if(this.a&&I(a))return this.j("remove",a,b);var d="@"+a;if(this.f[d]){if(!c){if(this.async&&"function"!==typeof importScripts){let c=this;d=new Promise(function(b){setTimeout(function(){c.remove(a,null,!0);c=null;b()})});if(b)d.then(b);else return d;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.b-(this.threshold||0);b++)S(this.l[b],a);this.depth&&S(this.h,a);delete this.f[d]}return this};let x;n.prototype.search=function(a,b,c,d){if(I(b)){if(w(b))for(var f= | ||
0;f<b.length;f++)b[f].query=a;else b.query=a;a=b;b=1E3}else b&&J(b)?(c=b,b=1E3):b||0===b||(b=1E3);let e=[],g=a;let p,q,l;if(I(a)&&!w(a)){c||(c=a.callback)&&(g.callback=null);q=a.sort;p=!1;b=a.limit;var r=a.threshold;l=!1;a=a.query}if(this.a){r=this.a.index;var m=g.bool||"or",h=g.field;let k=m;let B,u;if(h)w(h)||(h=[h]);else if(w(g)){var n=g;h=[];k=[];for(var t=0;t<g.length;t++)d=g[t],f=d.bool||m,h[t]=d.field,k[t]=f,"not"===f?B=!0:"and"===f&&(u=!0)}else h=this.a.keys;m=h.length;for(t=0;t<m;t++)n&& | ||
(g=n[t]),p&&!F(g)&&(g.page=null,g.limit=0),e[t]=r[h[t]].search(g,0);if(c)return c(G.call(this,a,k,e,q,b,l,!1,p,u,B));if(this.async){const c=this;return new Promise(function(d){Promise.all(e).then(function(e){d(G.call(c,a,k,e,q,b,l,!1,p,u,B))})})}return G.call(this,a,k,e,q,b,l,!1,p,u,B)}r||(r=this.threshold||0);if(!d){if(this.async&&"function"!==typeof importScripts){let a=this;r=new Promise(function(c){setTimeout(function(){c(a.search(g,b,null,!0));a=null})});if(c)r.then(c);else return r;return this}if(c)return c(this.search(g, | ||
b,null,!0)),this}if(!a||!F(a))return e;g=a;g=this.encode(g);if(!g.length)return e;c=this.c;c=J(c)?c(g):g.split(this.split);this.filter&&(c=y(c,this.filter));n=c.length;d=!0;f=[];const u=A();let v=0;1<n&&(this.depth&&"strict"===this.c?h=!0:c.sort(da));if(!h||(m=this.h)){const b=this.b;for(;v<n;v++){let a=c[v];if(a){if(h){if(!t)if(m[a])t=a,u[a]=1;else if(!l)return e;if(l&&v===n-1&&!f.length)h=!1,a=t||a,u[a]=0;else if(!t)continue}if(!u[a]){const c=[];let e=!1,g=0;if(t=h?m[t]:this.l){let d;for(let f= | ||
0;f<b-r;f++)if(d=t[f][a])c[g++]=d,e=!0}if(e)t=a,f[f.length]=1<g?c.concat.apply([],c):c[0];else{d=!1;break}u[a]=1}}}}else d=!1;d&&(e=V(f,b,p,!1));return e};n.prototype.clear=function(){return this.destroy().init()};n.prototype.destroy=function(){this.l=this.h=this.f=null;if(this.a){const a=this.a.keys;for(let b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.g=null}return this};const P={icase:function(a){return a.toLowerCase()},simple:function(){const a=[e("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), | ||
"a",e("[\u00e8\u00e9\u00ea\u00eb]"),"e",e("[\u00ec\u00ed\u00ee\u00ef]"),"i",e("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",e("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",e("[\u00fd\u0177\u00ff]"),"y",e("\u00f1"),"n",e("\u00e7"),"c",e("\u00df"),"s",e(" & ")," and ",e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s+")," "];return function(b){b=H(b.toLowerCase(),a);return" "===b?"":b}}(),advanced:function(){const a=[e("ae"),"a",e("ai"),"ei",e("ay"),"ei",e("ey"),"ei",e("oe"),"o",e("ue"),"u",e("ie"),"i",e("sz"),"s", | ||
e("zs"),"s",e("sh"),"s",e("ck"),"k",e("cc"),"k",e("dt"),"t",e("ph"),"f",e("pf"),"f",e("ou"),"o",e("uo"),"u"];return function(b,c){if(!b)return b;b=this.simple(b);2<b.length&&(b=H(b,a));c||1<b.length&&(b=T(b));return b}}(),extra:function(){const a=[e("p"),"b",e("z"),"s",e("[cgq]"),"k",e("n"),"m",e("d"),"t",e("[vw]"),"f",e("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let c=0;c<b.length;c++){const d=b[c];1<d.length&&(b[c]=d[0]+H(d.substring(1), | ||
a))}b=b.join(" ");b=T(b)}return b}}(),balance:function(){const a=[e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s+")," "];return function(b){return T(H(b.toLowerCase(),a))}}()};return n}(!1),this); | ||
'use strict';(function(n,G,I){let w;(w=I.define)&&w.amd?w([],function(){return G}):(w=I.modules)?w[n.toLowerCase()]=G:"object"===typeof exports?module.exports=G:I[n]=G})("FlexSearch",function(){function n(a,b){const c=b?b.id:a&&a.id;this.id=c||0===c?c:ba++;this.init(a,b);V(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].f):Object.keys(this.f)});V(this,"length",function(){return this.index.length})}function G(a){const b=A();for(const c in a)if(a.hasOwnProperty(c)){const d= | ||
a[c];b[c]=x(d)?d.slice(0):y(d)?G(d):d}return b}function I(a,b){const c=a.length,d=J(b),f=[];for(let k=0,g=0;k<c;k++){const c=a[k];if(d&&b(c)||!d&&!b[c])f[g++]=c}return f}function w(a,b,c,d,f,k,g,p,q,l){c=W(c,g?0:f,!1,!1,b,q,l);let e;p&&(p=c.page,e=c.next,c=c.result);if(g)a=this.where(g,null,f,c);else{a=c;b=this.g;c=a.length;f=Array(c);for(k=0;k<c;k++)f[k]=b[a[k]];a=f}c=a;d&&(J(d)||(z=d.split(":"),1<z.length?d=ca:(z=z[0],d=da)),c.sort(d));return c=K(p,e,c)}function V(a,b,c){Object.defineProperty(a, | ||
b,{get:c})}function e(a){return new RegExp(a,"g")}function H(a,b){for(let c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}function Q(a,b,c,d,f,k,g,p){if(b[c])return b[c];f=f?(p-(g||p/1.5))*k+(g||p/1.5)*f:k;b[c]=f;f>=g&&(a=a[p-(f+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=d);return f}function S(a,b){if(a){const c=Object.keys(a);for(let d=0,f=c.length;d<f;d++){const f=c[d],g=a[f];if(g)for(let c=0,d=g.length;c<d;c++)if(g[c]===b){1===d?delete a[f]:g.splice(c,1);break}else y(g[c])&&S(g[c],b)}}}function T(a){let b= | ||
"",c="";var d="";for(let f=0;f<a.length;f++){const k=a[f];if(k!==c)if(f&&"h"===k){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c)&&d||" "===c)b+=k}else b+=k;d=f===a.length-1?"":a[f+1];c=k}return b}function ea(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function da(a,b){a=a[z];b=b[z];return a<b?-1:a>b?1:0}function ca(a,b){const c=z.length;for(let d=0;d<c;d++)a=a[z[d]],b=b[z[d]];return a<b?-1:a>b?1:0}function K(a,b,c){return a?{page:a, | ||
next:b?""+b:null,result:c}:c}function W(a,b,c,d,f,k,g){let p,q=[];if(!0===c){c="0";var l=""}else l=c&&c.split(":");const e=a.length;if(1<e){const r=A(),B=[];let M,E;var m=0,h;let O;var R=!0;let C,D=0,x,u,w,z;l&&(2===l.length?(w=l,l=!1):l=z=parseInt(l[0],10));if(g){for(M=A();m<e;m++)if("not"===f[m])for(E=a[m],O=E.length,h=0;h<O;h++)M["@"+E[h]]=1;else u=m+1;if(N(u))return K(c,p,q);m=0}else x=F(f)&&f;let y;for(;m<e;m++){const L=m===(u||e)-1;if(!x||!m)if((h=x||f&&f[m])&&"and"!==h)if("or"===h)y=!1;else continue; | ||
else y=k=!0;E=a[m];if(O=E.length){if(R)if(C){var t=C.length;for(h=0;h<t;h++){R=C[h];var n="@"+R;g&&M[n]||(r[n]=1,k||(q[D++]=R))}C=null;R=!1}else{C=E;continue}n=!1;for(h=0;h<O;h++){t=E[h];var v="@"+t;const a=k?r[v]||0:m;if(!(!a&&!d||g&&M[v]||!k&&r[v]))if(a===m){if(L){if(!z||--z<D)if(q[D++]=t,b&&D===b)return K(c,D+(l||0),q)}else r[v]=m+1;n=!0}else d&&(v=B[a]||(B[a]=[]),v[v.length]=t)}if(y&&!n&&!d)break}else if(y&&!d)return K(c,p,E)}if(C)if(m=C.length,g)for(h=l?parseInt(l,10):0;h<m;h++)a=C[h],M["@"+ | ||
a]||(q[D++]=a);else q=C;if(d)for(D=q.length,w?(m=parseInt(w[0],10)+1,h=parseInt(w[1],10)+1):(m=B.length,h=0);m--;)if(t=B[m]){for(O=t.length;h<O;h++)if(d=t[h],!g||!M["@"+d])if(q[D++]=d,b&&D===b)return K(c,m+":"+h,q);h=0}}else!e||f&&"not"===f[0]||(q=a[0],l&&(l=parseInt(l[0],10)));b&&(g=q.length,l&&l>g&&(l=0),l=l||0,p=l+b,p<g?q=q.slice(l,p):(p=0,l&&(q=q.slice(l))));return K(c,p,q)}function F(a){return"string"===typeof a}function x(a){return a.constructor===Array}function J(a){return"function"===typeof a} | ||
function y(a){return"object"===typeof a}function N(a){return"undefined"===typeof a}function X(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=A();return b}function A(){return Object.create(null)}const u={encode:"icase",c:"forward",split:/\W+/,cache:!1,async:!1,u:!1,m:!1,a:!1,b:9,threshold:0,depth:0},Y={memory:{encode:"extra",c:"strict",threshold:0,b:1},speed:{encode:"icase",c:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",c:"full",threshold:1,b:3},score:{encode:"extra",c:"strict",threshold:1, | ||
b:9,depth:4},balance:{encode:"balance",c:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase",c:"strict",threshold:8,b:9,depth:1}},U=[];let ba=0;const Z={},aa={};n.create=function(a,b){return new n(a,b)};n.registerMatcher=function(a){for(const b in a)a.hasOwnProperty(b)&&U.push(e(b),a[b]);return this};n.registerEncoder=function(a,b){P[a]=b.bind(P);return this};n.registerLanguage=function(a,b){Z[a]=b.filter;aa[a]=b.stemmer;return this};n.encode=function(a,b){return P[a](b)};n.prototype.init=function(a, | ||
b){this.o=[];if(b){var c=b.preset;a=b}else a||(a=u),c=a.preset;b={};F(a)?(b=Y[a],a={}):c&&(b=Y[c]);this.c=a.tokenize||b.c||this.c||u.c;this.split=a.split||this.split||u.split;this.m=a.rtl||this.m||u.m;this.async="undefined"===typeof Promise||N(c=a.async)?this.async||u.async:c;this.threshold=N(c=a.threshold)?b.threshold||this.threshold||u.threshold:c;this.b=N(c=a.resolution)?c=b.b||this.b||u.b:c;c<=this.threshold&&(this.b=this.threshold+1);this.depth="strict"!==this.c||N(c=a.depth)?b.depth||this.depth|| | ||
u.depth:c;this.i=(c=N(c=a.encode)?b.encode||u.encode:c)&&P[c]&&P[c].bind(P)||(J(c)?c:this.i||!1);(c=a.matcher)&&this.addMatcher(c);if(c=(b=a.lang)||a.filter){F(c)&&(c=Z[c]);if(x(c)){var d=this.i,f=A();for(var k=0;k<c.length;k++){const a=d?d(c[k]):c[k];f[a]=1}c=f}this.filter=c}if(c=b||a.stemmer){var g;b=F(c)?aa[c]:c;d=this.i;f=[];for(g in b)b.hasOwnProperty(g)&&(k=d?d(g):g,f.push(e(k+"($|\\W)"),d?d(b[g]):b[g]));this.stemmer=g=f}this.a=d=(c=a.doc)?G(c):this.a||u.a;this.l=X(this.b-(this.threshold||0)); | ||
this.h=A();this.f=A();if(d&&(this.g=A(),a.doc=null,g=d.index={},c=d.keys=[],b=d.field,x(d.id)||(d.id=d.id.split(":")),b)){let k;x(b)||(y(b)?(k=b,d.field=b=Object.keys(b)):d.field=b=[b]);for(d=0;d<b.length;d++)f=b[d],x(f)||(k&&(a=k[f]),c[d]=f,b[d]=f.split(":")),g[f]=new n(a),g[f].g=this.g}return this};n.prototype.encode=function(a){a&&U.length&&(a=H(a,U));a&&this.o.length&&(a=H(a,this.o));a&&this.i&&(a=this.i(a));a&&this.stemmer&&(a=H(a,this.stemmer));return a};n.prototype.addMatcher=function(a){const b= | ||
this.o;for(const c in a)a.hasOwnProperty(c)&&b.push(e(c),a[c]);return this};n.prototype.add=function(a,b,c,d,f){if(this.a&&y(a))return this.j("add",a,b);if(b&&F(b)&&(a||0===a)){var k="@"+a;if(this.f[k]&&!d)return this.update(a,b);if(!f){if(this.async){let f=this;k=new Promise(function(c){setTimeout(function(){f.add(a,b,null,d,!0);f=null;c()})});if(c)k.then(c);else return k;return this}if(c)return this.add(a,b,null,d,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.c;f=J(c)?c(b):b.split(this.split); | ||
this.filter&&(f=I(f,this.filter));const m=A();m._ctx=A();const h=f.length,p=this.threshold,t=this.depth,n=this.b,v=this.l,L=this.m;for(let b=0;b<h;b++){var g=f[b];if(g){var e=g.length,q=(L?b+1:h-b)/h,l="";switch(c){case "reverse":case "both":for(var r=e;--r;)l=g[r]+l,Q(v,m,l,a,L?1:(e-r)/e,q,p,n-1);l="";case "forward":for(r=0;r<e;r++)l+=g[r],Q(v,m,l,a,L?(r+1)/e:1,q,p,n-1);break;case "full":for(r=0;r<e;r++){const b=(L?r+1:e-r)/e;for(let c=e;c>r;c--)l=g.substring(r,c),Q(v,m,l,a,b,q,p,n-1)}break;default:if(e= | ||
Q(v,m,g,a,1,q,p,n-1),t&&1<h&&e>=p)for(e=m._ctx[g]||(m._ctx[g]=A()),g=this.h[g]||(this.h[g]=X(n-(p||0))),q=b-t,l=b+t+1,0>q&&(q=0),l>h&&(l=h);q<l;q++)q!==b&&Q(g,e,f[q],a,0,n-(q<b?b-q:q-b),p,n-1)}}}this.f[k]=1}return this};n.prototype.j=function(a,b,c){if(x(b))for(let d=0,f=b.length;d<f;d++){if(d===f-1)return this.j(a,b[d],c);this.j(a,b[d])}else{const k=this.a.index,l=this.a.keys;var d=this.a.tag,f=this.a.id;let r;let m;for(var e=0;e<f.length;e++)r=(r||b)[f[e]];if(d){for(f=0;f<d.length;f++){var g=d[f]; | ||
var p=g.split(":");for(e=0;e<p.length;e++)m=(m||b)[p[e]];m="@"+m}p=this.s[g];p=p[m]||(p[m]=[])}if("remove"===a){delete this.g[r];for(let b=0,a=l.length;b<a;b++){if(b===a-1)return k[l[b]].remove(r,c),this;k[l[b]].remove(r)}}f=this.a.field;p&&(p[p.length]=b);this.g[r]=b;for(let e=0,m=f.length;e<m;e++){d=f[e];let h;for(g=0;g<d.length;g++)h=(h||b)[d[g]];d=k[l[e]];g="add"===a?d.add:d.update;e===m-1?g.call(d,r,h,c):g.call(d,r,h)}}return this};n.prototype.update=function(a,b,c){if(this.a&&y(a))return this.j("update", | ||
a,b);this.f["@"+a]&&F(b)&&(this.remove(a),this.add(a,b,c,!0));return this};n.prototype.remove=function(a,b,c){if(this.a&&y(a))return this.j("remove",a,b);var d="@"+a;if(this.f[d]){if(!c){if(this.async&&"function"!==typeof importScripts){let c=this;d=new Promise(function(b){setTimeout(function(){c.remove(a,null,!0);c=null;b()})});if(b)d.then(b);else return d;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.b-(this.threshold||0);b++)S(this.l[b],a);this.depth&&S(this.h,a);delete this.f[d]}return this}; | ||
let z;n.prototype.search=function(a,b,c,d){if(y(b)){if(x(b))for(var f=0;f<b.length;f++)b[f].query=a;else b.query=a;a=b;b=1E3}else b&&J(b)?(c=b,b=1E3):b||0===b||(b=1E3);let e=[],g=a;let p,q,l;if(y(a)&&!x(a)){c||(c=a.callback)&&(g.callback=null);q=a.sort;p=!1;b=a.limit;var r=a.threshold;l=!1;a=a.query}if(this.a){r=this.a.index;var m=g.bool||"or",h=g.field;let k=m;let B,u;if(h)x(h)||(h=[h]);else if(x(g)){var n=g;h=[];k=[];for(var t=0;t<g.length;t++)d=g[t],f=d.bool||m,h[t]=d.field,k[t]=f,"not"===f?B= | ||
!0:"and"===f&&(u=!0)}else h=this.a.keys;m=h.length;for(t=0;t<m;t++)n&&(g=n[t]),p&&!F(g)&&(g.page=null,g.limit=0),e[t]=r[h[t]].search(g,0);if(c)return c(w.call(this,a,k,e,q,b,l,!1,p,u,B));if(this.async){const c=this;return new Promise(function(d){Promise.all(e).then(function(e){d(w.call(c,a,k,e,q,b,l,!1,p,u,B))})})}return w.call(this,a,k,e,q,b,l,!1,p,u,B)}r||(r=this.threshold||0);if(!d){if(this.async&&"function"!==typeof importScripts){let a=this;r=new Promise(function(c){setTimeout(function(){c(a.search(g, | ||
b,null,!0));a=null})});if(c)r.then(c);else return r;return this}if(c)return c(this.search(g,b,null,!0)),this}if(!a||!F(a))return e;g=a;g=this.encode(g);if(!g.length)return e;c=this.c;c=J(c)?c(g):g.split(this.split);this.filter&&(c=I(c,this.filter));n=c.length;d=!0;f=[];const u=A();let v=0;1<n&&(this.depth&&"strict"===this.c?h=!0:c.sort(ea));if(!h||(m=this.h)){const b=this.b;for(;v<n;v++){let a=c[v];if(a){if(h){if(!t)if(m[a])t=a,u[a]=1;else if(!l)return e;if(l&&v===n-1&&!f.length)h=!1,a=t||a,u[a]= | ||
0;else if(!t)continue}if(!u[a]){const c=[];let e=!1,g=0;if(t=h?m[t]:this.l){let d;for(let f=0;f<b-r;f++)if(d=t[f]&&t[f][a])c[g++]=d,e=!0}if(e)t=a,f[f.length]=1<g?c.concat.apply([],c):c[0];else{d=!1;break}u[a]=1}}}}else d=!1;d&&(e=W(f,b,p,!1));return e};n.prototype.clear=function(){return this.destroy().init()};n.prototype.destroy=function(){this.l=this.h=this.f=null;if(this.a){const a=this.a.keys;for(let b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.g=null}return this};const P={icase:function(a){return a.toLowerCase()}, | ||
simple:function(){const a=[e("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",e("[\u00e8\u00e9\u00ea\u00eb]"),"e",e("[\u00ec\u00ed\u00ee\u00ef]"),"i",e("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",e("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",e("[\u00fd\u0177\u00ff]"),"y",e("\u00f1"),"n",e("\u00e7"),"c",e("\u00df"),"s",e(" & ")," and ",e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s+")," "];return function(b){b=H(b.toLowerCase(),a);return" "===b?"":b}}(),advanced:function(){const a=[e("ae"),"a",e("ai"),"ei",e("ay"), | ||
"ei",e("ey"),"ei",e("oe"),"o",e("ue"),"u",e("ie"),"i",e("sz"),"s",e("zs"),"s",e("sh"),"s",e("ck"),"k",e("cc"),"k",e("dt"),"t",e("ph"),"f",e("pf"),"f",e("ou"),"o",e("uo"),"u"];return function(b,c){if(!b)return b;b=this.simple(b);2<b.length&&(b=H(b,a));c||1<b.length&&(b=T(b));return b}}(),extra:function(){const a=[e("p"),"b",e("z"),"s",e("[cgq]"),"k",e("n"),"m",e("d"),"t",e("[vw]"),"f",e("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let c= | ||
0;c<b.length;c++){const d=b[c];1<d.length&&(b[c]=d[0]+H(d.substring(1),a))}b=b.join(" ");b=T(b)}return b}}(),balance:function(){const a=[e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s+")," "];return function(b){return T(H(b.toLowerCase(),a))}}()};return n}(!1),this); |
/* | ||
FlexSearch v0.6.2 | ||
FlexSearch v0.6.21 | ||
Copyright 2019 Nextapps GmbH | ||
@@ -8,43 +8,44 @@ Author: Thomas Wilkerling | ||
*/ | ||
'use strict';function ca(d){var l=0;return function(){return l<d.length?{done:!1,value:d[l++]}:{done:!0}}}var da="function"==typeof Object.defineProperties?Object.defineProperty:function(d,l,f){d!=Array.prototype&&d!=Object.prototype&&(d[l]=f.value)},S="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function ea(){ea=function(){};S.Symbol||(S.Symbol=fa)}var fa=function(){var d=0;return function(l){return"jscomp_symbol_"+(l||"")+d++}}(); | ||
function Y(){ea();var d=S.Symbol.iterator;d||(d=S.Symbol.iterator=S.Symbol("iterator"));"function"!=typeof Array.prototype[d]&&da(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return ha(ca(this))}});Y=function(){}}function ha(d){Y();d={next:d};d[S.Symbol.iterator]=function(){return this};return d} | ||
function na(d,l){Y();d instanceof String&&(d+="");var f=0,k={next:function(){if(f<d.length){var n=f++;return{value:l(n,d[n]),done:!1}}k.next=function(){return{done:!0,value:void 0}};return k.next()}};k[Symbol.iterator]=function(){return k};return k}function oa(d,l){if(l){var f=S;d=d.split(".");for(var k=0;k<d.length-1;k++){var n=d[k];n in f||(f[n]={});f=f[n]}d=d[d.length-1];k=f[d];l=l(k);l!=k&&null!=l&&da(f,d,{configurable:!0,writable:!0,value:l})}} | ||
oa("Array.prototype.keys",function(d){return d?d:function(){return na(this,function(d){return d})}});function pa(d){var l="undefined"!=typeof Symbol&&Symbol.iterator&&d[Symbol.iterator];return l?l.call(d):{next:ca(d)}} | ||
oa("Promise",function(d){function l(g){this.h=0;this.o=void 0;this.b=[];var e=this.j();try{g(e.resolve,e.reject)}catch(w){e.reject(w)}}function f(){this.b=null}function k(g){return g instanceof l?g:new l(function(e){e(g)})}if(d)return d;f.prototype.h=function(g){if(null==this.b){this.b=[];var e=this;this.j(function(){e.o()})}this.b.push(g)};var n=S.setTimeout;f.prototype.j=function(g){n(g,0)};f.prototype.o=function(){for(;this.b&&this.b.length;){var g=this.b;this.b=[];for(var e=0;e<g.length;++e){var d= | ||
g[e];g[e]=null;try{d()}catch(G){this.l(G)}}}this.b=null};f.prototype.l=function(g){this.j(function(){throw g;})};l.prototype.j=function(){function g(g){return function(f){d||(d=!0,g.call(e,f))}}var e=this,d=!1;return{resolve:g(this.L),reject:g(this.l)}};l.prototype.L=function(g){if(g===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof l)this.M(g);else{a:switch(typeof g){case "object":var e=null!=g;break a;case "function":e=!0;break a;default:e=!1}e?this.K(g):this.w(g)}}; | ||
l.prototype.K=function(g){var e=void 0;try{e=g.then}catch(w){this.l(w);return}"function"==typeof e?this.N(e,g):this.w(g)};l.prototype.l=function(g){this.B(2,g)};l.prototype.w=function(g){this.B(1,g)};l.prototype.B=function(g,e){if(0!=this.h)throw Error("Cannot settle("+g+", "+e+"): Promise already settled in state"+this.h);this.h=g;this.o=e;this.I()};l.prototype.I=function(){if(null!=this.b){for(var g=0;g<this.b.length;++g)T.h(this.b[g]);this.b=null}};var T=new f;l.prototype.M=function(g){var e=this.j(); | ||
g.F(e.resolve,e.reject)};l.prototype.N=function(g,e){var d=this.j();try{g.call(e,d.resolve,d.reject)}catch(G){d.reject(G)}};l.prototype.then=function(g,e){function d(e,d){return"function"==typeof e?function(d){try{f(e(d))}catch(L){k(L)}}:d}var f,k,n=new l(function(e,d){f=e;k=d});this.F(d(g,f),d(e,k));return n};l.prototype.catch=function(d){return this.then(void 0,d)};l.prototype.F=function(d,e){function g(){switch(f.h){case 1:d(f.o);break;case 2:e(f.o);break;default:throw Error("Unexpected state: "+ | ||
f.h);}}var f=this;null==this.b?T.h(g):this.b.push(g)};l.resolve=k;l.reject=function(d){return new l(function(e,f){f(d)})};l.race=function(d){return new l(function(e,f){for(var g=pa(d),l=g.next();!l.done;l=g.next())k(l.value).F(e,f)})};l.all=function(d){var e=pa(d),f=e.next();return f.done?k([]):new l(function(d,g){function l(e){return function(f){n[e]=f;w--;0==w&&d(n)}}var n=[],w=0;do n.push(void 0),w++,k(f.value).F(l(n.length-1),g),f=e.next();while(!f.done)})};return l}); | ||
(function(d,l,f){var k;(k=f.define)&&k.amd?k([],function(){return l}):(k=f.modules)?k[d.toLowerCase()]=l:"object"===typeof exports?module.exports=l:f[d]=l})("FlexSearch",function ta(d){function f(a,b){var c=b?b.id:a&&a.id;this.id=c||0===c?c:ua++;this.init(a,b);g(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].f):Object.keys(this.f)});g(this,"length",function(){return this.index.length})}function k(a,b,c,h){this.D!==this.i&&(this.A=this.A.concat(c),this.D++,h&&this.A.length>= | ||
h&&(this.D=this.i),this.D===this.i&&(this.cache&&this.v.set(b,this.A),this.H&&this.H(this.A)));return this}function n(a,b){for(var c=a.length,h=V(b),t=[],q=0,e=0;q<c;q++){var d=a[q];if(h&&b(d)||!h&&!b[d])t[e++]=d}return t}function T(a,b,c,h,t,q,e,d,f,g){c=ia(c,e?0:t,d,q,b,f,g);if(d){d=c.page;var W=c.next;c=c.result}if(e)b=this.where(e,null,t,c);else{b=c;c=this.m;t=b.length;q=Array(t);for(e=0;e<t;e++)q[e]=c[b[e]];b=q}c=b;h&&(V(h)||(F=h.split(":"),1<F.length?h=sa:(F=F[0],h=ra)),c.sort(h));c=L(d,W,c); | ||
this.cache&&this.v.set(a,c);return c}function g(a,b,c){Object.defineProperty(a,b,{get:c})}function e(a){return new RegExp(a,"g")}function w(a,b){for(var c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}function G(a,b,c,h,t,q,e,d){if(b[c])return b[c];t=t?(d-(e||d/1.5))*q+(e||d/1.5)*t:q;b[c]=t;t>=e&&(a=a[d-(t+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=h);return t}function Z(a,b){if(a)for(var c=Object.keys(a),h=0,t=c.length;h<t;h++){var q=c[h],e=a[q];if(e)for(var d=0,f=e.length;d<f;d++)if(e[d]===b){1=== | ||
f?delete a[q]:e.splice(d,1);break}else P(e[d])&&Z(e[d],b)}}function aa(a){for(var b="",c="",h="",t=0;t<a.length;t++){var q=a[t];if(q!==c)if(t&&"h"===q){if(h="a"===h||"e"===h||"i"===h||"o"===h||"u"===h||"y"===h,("a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c)&&h||" "===c)b+=q}else b+=q;h=t===a.length-1?"":a[t+1];c=q}return b}function qa(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function ra(a,b){a=a[F];b=b[F];return a<b?-1:a>b?1:0}function sa(a,b){for(var c=F.length,h=0;h<c;h++)a=a[F[h]],b= | ||
b[F[h]];return a<b?-1:a>b?1:0}function L(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}function ia(a,b,c,h,t,q,e){var d=[];if(!0===c){c="0";var f=""}else f=c&&c.split(":");var g=a.length;if(1<g){var W=H(),r=[],k,m=0,p,z=!0,v=0,y;if(f)if(2===f.length){var u=f;f=!1}else f=y=parseInt(f[0],10);if(e){for(k=H();m<g;m++)if("not"===t[m]){var x=a[m];var n=x.length;for(p=0;p<n;p++)k["@"+x[p]]=1}else var w=m+1;if(I(w))return L(c,N,d);m=0}else var D=Q(t)&&t;for(var B;m<g;m++){var J=m===(w||g)-1;if(!D|| | ||
!m)if((p=D||t&&t[m])&&"and"!==p)if("or"===p)B=!1;else continue;else B=q=!0;x=a[m];if(n=x.length){if(z)if(M){var K=M.length;for(p=0;p<K;p++){z=M[p];var G="@"+z;e&&k[G]||(W[G]=1,q||(d[v++]=z))}var M=null;z=!1}else{M=x;continue}G=!1;for(p=0;p<n;p++){K=x[p];var O="@"+K,F=q?W[O]||0:m;if(!(!F&&!h||e&&k[O]||!q&&W[O]))if(F===m){if(J){if(!y||--y<v)if(d[v++]=K,b&&v===b)return L(c,v+(f||0),d)}else W[O]=m+1;G=!0}else h&&(O=r[F]||(r[F]=[]),O[O.length]=K)}if(B&&!G&&!h)break}else if(B&&!h)return L(c,N,x)}if(M)if(m= | ||
M.length,e)for(p=f?parseInt(f,10):0;p<m;p++)a=M[p],k["@"+a]||(d[v++]=a);else d=M;if(h)for(v=d.length,u?(m=parseInt(u[0],10)+1,p=parseInt(u[1],10)+1):(m=r.length,p=0);m--;)if(K=r[m]){for(n=K.length;p<n;p++)if(h=K[p],!e||!k["@"+h])if(d[v++]=h,b&&v===b)return L(c,m+":"+p,d);p=0}}else!g||t&&"not"===t[0]||(d=a[0],f&&(f=parseInt(f[0],10)));if(b){e=d.length;f&&f>e&&(f=0);f=f||0;var N=f+b;N<e?d=d.slice(f,N):(N=0,f&&(d=d.slice(f)))}return L(c,N,d)}function Q(a){return"string"===typeof a}function B(a){return a.constructor=== | ||
Array}function V(a){return"function"===typeof a}function P(a){return"object"===typeof a}function I(a){return"undefined"===typeof a}function ja(a){for(var b=Array(a),c=0;c<a;c++)b[c]=H();return b}function H(){return Object.create(null)}function va(){var a,b;self.onmessage=function(c){if(c=c.data)if(c.search){var h=b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold,where:c.where}:c.limit);self.postMessage({id:a,content:c.content,limit:c.limit,result:h})}else c.add?b.add(c.id,c.content): | ||
c.update?b.update(c.id,c.content):c.remove?b.remove(c.id):c.clear?b.clear():c.info?(c=b.info(),c.worker=a,console.log(c)):c.register&&(a=c.id,c.options.cache=!1,c.options.async=!1,c.options.worker=!1,b=(new Function(c.register.substring(c.register.indexOf("{")+1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}}function wa(a,b,c,h){a=d("flexsearch","id"+a,va,function(a){(a=a.data)&&a.result&&h(a.id,a.content,a.result,a.limit,a.where,a.cursor,a.suggest)},b);var e=ta.toString();c.id=b;a.postMessage({register:e, | ||
options:c,id:b});return a}var D={encode:"icase",g:"forward",split:/\W+/,cache:!1,async:!1,i:!1,G:!1,a:!1,c:9,threshold:0,depth:0},ka={memory:{encode:"extra",g:"strict",threshold:0,c:1},speed:{encode:"icase",g:"strict",threshold:1,c:3,depth:2},match:{encode:"extra",g:"full",threshold:1,c:3},score:{encode:"extra",g:"strict",threshold:1,c:9,depth:4},balance:{encode:"balance",g:"strict",threshold:0,c:3,depth:3},fast:{encode:"icase",g:"strict",threshold:8,c:9,depth:1}},X=[],ua=0,la={},ma={};f.create=function(a, | ||
b){return new f(a,b)};f.registerMatcher=function(a){for(var b in a)a.hasOwnProperty(b)&&X.push(e(b),a[b]);return this};f.registerEncoder=function(a,b){R[a]=b.bind(R);return this};f.registerLanguage=function(a,b){la[a]=b.filter;ma[a]=b.stemmer;return this};f.encode=function(a,b){return R[a](b)};f.prototype.init=function(a,b){this.h=[];if(b){var c=b.preset;a=b}else a||(a=D),c=a.preset;b={};Q(a)?((b=ka[a])||console.warn("Preset not found: "+a),a={}):c&&((b=ka[c])||console.warn("Preset not found: "+c)); | ||
if(c=a.worker)if("undefined"===typeof Worker)a.worker=!1,this.b=null;else{var h=parseInt(c,10)||4;this.w=-1;this.D=0;this.A=[];this.H=null;this.b=Array(h);for(var d=0;d<h;d++)this.b[d]=wa(this.id,d,a,k.bind(this))}this.g=a.tokenize||b.g||this.g||D.g;this.split=a.split||this.split||D.split;this.G=a.rtl||this.G||D.G;this.async="undefined"===typeof Promise||I(c=a.async)?this.async||D.async:c;this.i=I(c=a.worker)?this.i||D.i:c;this.threshold=I(c=a.threshold)?b.threshold||this.threshold||D.threshold:c; | ||
this.c=I(c=a.resolution)?c=b.c||this.c||D.c:c;c<=this.threshold&&(this.c=this.threshold+1);this.depth="strict"!==this.g||I(c=a.depth)?b.depth||this.depth||D.depth:c;this.j=(c=I(c=a.encode)?b.encode||D.encode:c)&&R[c]&&R[c].bind(R)||(V(c)?c:this.j||!1);(c=a.matcher)&&this.addMatcher(c);if(c=(b=a.lang)||a.filter){Q(c)&&(c=la[c]);if(B(c)){h=this.j;d=H();for(var q=0;q<c.length;q++){var g=h?h(c[q]):c[q];d[g]=1}c=d}this.filter=c}if(c=b||a.stemmer){b=Q(c)?ma[c]:c;h=this.j;d=[];for(var U in b)b.hasOwnProperty(U)&& | ||
(q=h?h(U):U,d.push(e(q+"($|\\W)"),h?h(b[U]):b[U]));this.stemmer=d}this.a=d=(c=a.doc)?c:this.a||D.a;this.u=ja(this.c-(this.threshold||0));this.s=H();this.f=H();if(d){this.m=H();a.doc=null;U=d.index={};b=d.keys=[];h=d.field;q=d.tag;B(d.id)||(d.id=d.id.split(":"));if(q){this.B=H();g=H();if(h)if(Q(h))g[h]=a;else if(B(h))for(var C=0;C<h.length;C++)g[h[C]]=a;else P(h)&&(g=h);B(q)||(d.tag=q=[q]);for(h=0;h<q.length;h++)this.B[q[h]]=H();this.I=q;h=g}if(h){if(!B(h))if(P(h)){var E=h;d.field=h=Object.keys(h)}else d.field= | ||
h=[h];for(d=0;d<h.length;d++)q=h[d],B(q)||(E&&(a=E[q]),b[d]=q,h[d]=q.split(":")),U[q]=new f(a),U[q].m=this.m}}this.o=!0;this.v=(this.cache=c=I(c=a.cache)?this.cache||D.cache:c)?new xa(c):!1;return this};f.prototype.encode=function(a){a&&X.length&&(a=w(a,X));a&&this.h.length&&(a=w(a,this.h));a&&this.j&&(a=this.j(a));a&&this.stemmer&&(a=w(a,this.stemmer));return a};f.prototype.addMatcher=function(a){var b=this.h,c;for(c in a)a.hasOwnProperty(c)&&b.push(e(c),a[c]);return this};f.prototype.add=function(a, | ||
b,c,d,e){if(this.a&&P(a))return this.l("add",a,b);if(b&&Q(b)&&(a||0===a)){var h="@"+a;if(this.f[h]&&!d)return this.update(a,b);if(this.i)return++this.w>=this.b.length&&(this.w=0),this.b[this.w].postMessage({add:!0,id:a,content:b}),this.f[h]=""+this.w,c&&c(),this;if(!e){if(this.async&&"function"!==typeof importScripts){var f=this;h=new Promise(function(c){setTimeout(function(){f.add(a,b,null,d,!0);f=null;c()})});if(c)h.then(c);else return h;return this}if(c)return this.add(a,b,null,d,!0),c(),this}b= | ||
this.encode(b);if(!b.length)return this;c=this.g;e=V(c)?c(b):b.split(this.split);this.filter&&(e=n(e,this.filter));var t=H();t._ctx=H();for(var g=e.length,k=this.threshold,ba=this.depth,r=this.c,A=this.u,m=this.G,p=0;p<g;p++){var z=e[p];if(z){var v=z.length,y=(m?p+1:g-p)/g,u="";switch(c){case "reverse":case "both":for(var x=v;--x;)u=z[x]+u,G(A,t,u,a,m?1:(v-x)/v,y,k,r-1);u="";case "forward":for(x=0;x<v;x++)u+=z[x],G(A,t,u,a,m?(x+1)/v:1,y,k,r-1);break;case "full":for(x=0;x<v;x++)for(var w=(m?x+1:v- | ||
x)/v,B=v;B>x;B--)u=z.substring(x,B),G(A,t,u,a,w,y,k,r-1);break;default:if(v=G(A,t,z,a,1,y,k,r-1),ba&&1<g&&v>=k)for(v=t._ctx[z]||(t._ctx[z]=H()),z=this.s[z]||(this.s[z]=ja(r-(k||0))),y=p-ba,u=p+ba+1,0>y&&(y=0),u>g&&(u=g);y<u;y++)y!==p&&G(z,v,e[y],a,0,r-(y<p?p-y:y-p),k,r-1)}}}this.f[h]=1;this.o=!1}return this};f.prototype.l=function(a,b,c){if(B(b))for(var d=0,e=b.length;d<e;d++){if(d===e-1)return this.l(a,b[d],c);this.l(a,b[d])}else{d=this.a.index;e=this.a.keys;for(var f=this.a.tag,g=this.a.id,k,C, | ||
E,n,r=0;r<g.length;r++)k=(k||b)[g[r]];if(f){for(g=0;g<f.length;g++){E=f[g];C=E.split(":");for(r=0;r<C.length;r++)n=(n||b)[C[r]];n="@"+n}C=this.B[E];C=C[n]||(C[n]=[])}if("remove"===a)for(delete this.m[k],g=0,f=e.length;g<f;g++){if(g===f-1)return d[e[g]].remove(k,c),this;d[e[g]].remove(k)}g=this.a.field;C&&(C[C.length]=b);this.m[k]=b;f=0;for(E=g.length;f<E;f++){C=g[f];n=void 0;for(r=0;r<C.length;r++)n=(n||b)[C[r]];C=d[e[f]];r="add"===a?C.add:C.update;f===E-1?r.call(C,k,n,c):r.call(C,k,n)}}return this}; | ||
f.prototype.update=function(a,b,c){if(this.a&&P(a))return this.l("update",a,b);this.f["@"+a]&&Q(b)&&(this.remove(a),this.add(a,b,c,!0));return this};f.prototype.remove=function(a,b,c){if(this.a&&P(a))return this.l("remove",a,b);var d="@"+a;if(this.f[d]){if(this.i)return this.b[this.f[d]].postMessage({remove:!0,id:a}),delete this.f[d],b&&b(),this;if(!c){if(this.async&&"function"!==typeof importScripts){var e=this;d=new Promise(function(b){setTimeout(function(){e.remove(a,null,!0);e=null;b()})});if(b)d.then(b); | ||
else return d;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.c-(this.threshold||0);b++)Z(this.u[b],a);this.depth&&Z(this.s,a);delete this.f[d];this.o=!1}return this};var F;f.prototype.search=function(a,b,c,d){if(P(b)){if(B(b))for(var e=0;e<b.length;e++)b[e].query=a;else b.query=a;a=b;b=1E3}else b&&V(b)?(c=b,b=1E3):b||0===b||(b=1E3);var h=[],f=a;if(P(a)&&!B(a)){c||(c=a.callback)&&(f.callback=null);var g=a.sort;var k=a.page;b=a.limit;var E=a.threshold;var w=a.suggest;a=a.query}if(this.a){E= | ||
this.a.index;var r=f.where,A=f.bool||"or",m=f.field,p=A,z,v;if(m)B(m)||(m=[m]);else if(B(f)){var y=f;m=[];p=[];for(var u=0;u<f.length;u++)d=f[u],e=d.bool||A,m[u]=d.field,p[u]=e,"not"===e?z=!0:"and"===e&&(v=!0)}else m=this.a.keys;A=m.length;for(u=0;u<A;u++)y&&(f=y[u]),k&&!Q(f)&&(f.page=null,f.limit=0),h[u]=E[m[u]].search(f,0);if(c)return c(T.call(this,a,p,h,g,b,w,r,k,v,z));if(this.async){var x=this;return new Promise(function(c){Promise.all(h).then(function(d){c(T.call(x,a,p,d,g,b,w,r,k,v,z))})})}return T.call(this, | ||
a,p,h,g,b,w,r,k,v,z)}E||(E=this.threshold||0);if(this.i)for(this.H=c,this.D=0,this.A=[],m=0;m<this.i;m++)this.b[m].postMessage({search:!0,limit:b,cursor:k,threshold:E,content:a});else{if(!d){if(this.async&&"function"!==typeof importScripts){var G=this;E=new Promise(function(a){setTimeout(function(){a(G.search(f,b,null,!0));G=null})});if(c)E.then(c);else return E;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!Q(a))return h;f=a;if(this.cache)if(this.o){if(c=this.v.get(a))return c}else this.v.clear(), | ||
this.o=!0;f=this.encode(f);if(!f.length)return h;c=this.g;c=V(c)?c(f):f.split(this.split);this.filter&&(c=n(c,this.filter));y=c.length;d=!0;e=[];var D=H(),F=0;1<y&&(this.depth&&"strict"===this.g?A=!0:c.sort(qa));if(!A||(u=this.s))for(var I=this.c;F<y;F++){var J=c[F];if(J){if(A){if(!m)if(u[J])m=J,D[J]=1;else if(!w)return h;if(w&&F===y-1&&!e.length)A=!1,J=m||J,D[J]=0;else if(!m)continue}if(!D[J]){var K=[],L=!1,M=0,O=A?u[m]:this.u;if(O)for(var R=void 0,N=0;N<I-E;N++)if(R=O[N][J])K[M++]=R,L=!0;if(L)m= | ||
J,e[e.length]=1<M?K.concat.apply([],K):K[0];else if(!w){d=!1;break}D[J]=1}}}else d=!1;d&&(h=ia(e,b,k,w));this.cache&&this.v.set(a,h);return h}};f.prototype.find=function(a,b){return this.where(a,b,1)[0]||null};f.prototype.where=function(a,b,c,d){var e=this.m,f=[],h=0,g;if(P(a)){c||(c=b);var k=Object.keys(a);var n=k.length;var w=!1;if(1===n&&"id"===k[0])return[e[a.id]];if((g=this.I)&&!d)for(var r=0;r<g.length;r++){var A=g[r],m=a[A];if(!I(m)){var p=this.B[A]["@"+m];if(0===--n)return p;k.splice(k.indexOf(A), | ||
1);delete a[A];break}}g=Array(n);for(r=0;r<n;r++)g[r]=k[r].split(":")}else{if(V(a)){b=d||Object.keys(e);c=b.length;for(k=0;k<c;k++)n=e[b[k]],a(n)&&(f[h++]=n);return f}if(I(b))return[e[a]];if("id"===a)return[e[b]];k=[a];n=1;g=[a.split(":")];w=!0}d=p||d||Object.keys(e);r=d.length;for(A=0;A<r;A++){m=p?d[A]:e[d[A]];for(var z=!0,v=0;v<n;v++){w||(b=a[k[v]]);var y=g[v],u=y.length,x=m;if(1<u)for(var B=0;B<u;B++)x=x[y[B]];else x=x[y[0]];if(x!==b){z=!1;break}}if(z&&(f[h++]=m,c&&h===c))break}return f};f.prototype.info= | ||
function(){if(this.i)for(var a=0;a<this.i;a++)this.b[a].postMessage({info:!0,id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.C?this.cache.C.length:!1,matcher:X.length+(this.h?this.h.length:0),worker:this.i,threshold:this.threshold,depth:this.depth,resolution:this.c,contextual:this.depth&&"strict"===this.g}};f.prototype.clear=function(){return this.destroy().init()};f.prototype.destroy=function(){this.cache&&(this.v.clear(),this.v=null);this.u=this.s=this.f=null; | ||
if(this.a){for(var a=this.a.keys,b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.m=null}return this};f.prototype.export=function(){if(this.a){var a=this.a.keys;var b=Array(a.length+1);for(var c=0;c<a.length;c++){var d=this.a.index[a[c]];b[c]=[d.u,d.s,Object.keys(d.f)]}b[c]=this.m}else b=[this.u,this.s,Object.keys(this.f)];return JSON.stringify(b)};f.prototype.import=function(a){a=JSON.parse(a);var b=H();if(this.a){for(var c=this.a.keys,d=c.length,e=a[0][2],f=0;f<e.length;f++)b[e[f]]=1; | ||
for(e=0;e<d;e++)f=this.a.index[c[e]],f.u=a[e][0],f.s=a[e][1],f.f=b,f.m=a[d];this.m=a[d]}else{c=a[2];for(d=0;d<c.length;d++)b[c[d]]=1;this.u=a[0];this.s=a[1];this.f=b}};var R={icase:function(a){return a.toLowerCase()},simple:function(){var a=[e("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",e("[\u00e8\u00e9\u00ea\u00eb]"),"e",e("[\u00ec\u00ed\u00ee\u00ef]"),"i",e("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",e("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",e("[\u00fd\u0177\u00ff]"),"y",e("\u00f1"),"n",e("\u00e7"), | ||
"c",e("\u00df"),"s",e(" & ")," and ",e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s+")," "];return function(b){b=w(b.toLowerCase(),a);return" "===b?"":b}}(),advanced:function(){var a=[e("ae"),"a",e("ai"),"ei",e("ay"),"ei",e("ey"),"ei",e("oe"),"o",e("ue"),"u",e("ie"),"i",e("sz"),"s",e("zs"),"s",e("sh"),"s",e("ck"),"k",e("cc"),"k",e("dt"),"t",e("ph"),"f",e("pf"),"f",e("ou"),"o",e("uo"),"u"];return function(b,c){if(!b)return b;b=this.simple(b);2<b.length&&(b=w(b,a));c||1<b.length&&(b=aa(b));return b}}(),extra:function(){var a= | ||
[e("p"),"b",e("z"),"s",e("[cgq]"),"k",e("n"),"m",e("d"),"t",e("[vw]"),"f",e("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(var c=0;c<b.length;c++){var d=b[c];1<d.length&&(b[c]=d[0]+w(d.substring(1),a))}b=b.join(" ");b=aa(b)}return b}}(),balance:function(){var a=[e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s+")," "];return function(b){return aa(w(b.toLowerCase(),a))}}()},xa=function(){function a(a){this.clear();this.J=!0!==a&&a}a.prototype.clear= | ||
function(){this.cache=H();this.count=H();this.index=H();this.C=[]};a.prototype.set=function(a,c){if(this.J&&I(this.cache[a])){var b=this.C.length;if(b===this.J){b--;var d=this.C[b];delete this.cache[d];delete this.count[d];delete this.index[d]}this.index[a]=b;this.C[b]=a;this.count[a]=-1;this.cache[a]=c;this.get(a)}else this.cache[a]=c};a.prototype.get=function(a){var b=this.cache[a];if(this.J&&b){var d=++this.count[a],e=this.index,f=e[a];if(0<f){for(var g=this.C,k=f;this.count[g[--f]]<=d&&-1!==f;); | ||
f++;if(f!==k){for(d=k;d>f;d--)k=g[d-1],g[d]=k,e[k]=d;g[f]=a;e[a]=f}}}return b};return a}();return f}(function(){var d={},l="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(f,k,n,T,g){n=l?URL.createObjectURL(new Blob(["("+n.toString()+")()"],{type:"text/javascript"})):f+".es5.js";f+="-"+k;d[f]||(d[f]=[]);d[f][g]=new Worker(n);d[f][g].onmessage=T;console.log("Register Worker: "+f+"@"+g);return d[f][g]}}()),this); | ||
'use strict';function ca(b){var m=0;return function(){return m<b.length?{done:!1,value:b[m++]}:{done:!0}}}var R="function"==typeof Object.defineProperties?Object.defineProperty:function(b,m,e){b!=Array.prototype&&b!=Object.prototype&&(b[m]=e.value)},X="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function da(){da=function(){};X.Symbol||(X.Symbol=ea)}function fa(b,m){this.b=b;R(this,"description",{configurable:!0,writable:!0,value:m})} | ||
fa.prototype.toString=function(){return this.b};var ea=function(){function b(e){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new fa("jscomp_symbol_"+(e||"")+"_"+m++,e)}var m=0;return b}();function Y(){da();var b=X.Symbol.iterator;b||(b=X.Symbol.iterator=X.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[b]&&R(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return ha(ca(this))}});Y=function(){}} | ||
function ha(b){Y();b={next:b};b[X.Symbol.iterator]=function(){return this};return b}function oa(b,m){Y();b instanceof String&&(b+="");var e=0,h={next:function(){if(e<b.length){var l=e++;return{value:m(l,b[l]),done:!1}}h.next=function(){return{done:!0,value:void 0}};return h.next()}};h[Symbol.iterator]=function(){return h};return h} | ||
function pa(b,m){if(m){var e=X;b=b.split(".");for(var h=0;h<b.length-1;h++){var l=b[h];l in e||(e[l]={});e=e[l]}b=b[b.length-1];h=e[b];m=m(h);m!=h&&null!=m&&R(e,b,{configurable:!0,writable:!0,value:m})}}pa("Array.prototype.keys",function(b){return b?b:function(){return oa(this,function(b){return b})}});function qa(b){var m="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return m?m.call(b):{next:ca(b)}} | ||
pa("Promise",function(b){function m(q){this.h=0;this.o=void 0;this.b=[];var b=this.j();try{q(b.resolve,b.reject)}catch(f){b.reject(f)}}function e(){this.b=null}function h(q){return q instanceof m?q:new m(function(b){b(q)})}if(b)return b;e.prototype.h=function(q){if(null==this.b){this.b=[];var b=this;this.j(function(){b.o()})}this.b.push(q)};var l=X.setTimeout;e.prototype.j=function(b){l(b,0)};e.prototype.o=function(){for(;this.b&&this.b.length;){var b=this.b;this.b=[];for(var e=0;e<b.length;++e){var f= | ||
b[e];b[e]=null;try{f()}catch(B){this.l(B)}}}this.b=null};e.prototype.l=function(b){this.j(function(){throw b;})};m.prototype.j=function(){function b(b){return function(q){f||(f=!0,b.call(e,q))}}var e=this,f=!1;return{resolve:b(this.L),reject:b(this.l)}};m.prototype.L=function(b){if(b===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(b instanceof m)this.M(b);else{a:switch(typeof b){case "object":var e=null!=b;break a;case "function":e=!0;break a;default:e=!1}e?this.K(b):this.w(b)}}; | ||
m.prototype.K=function(b){var e=void 0;try{e=b.then}catch(f){this.l(f);return}"function"==typeof e?this.N(e,b):this.w(b)};m.prototype.l=function(b){this.B(2,b)};m.prototype.w=function(b){this.B(1,b)};m.prototype.B=function(b,e){if(0!=this.h)throw Error("Cannot settle("+b+", "+e+"): Promise already settled in state"+this.h);this.h=b;this.o=e;this.I()};m.prototype.I=function(){if(null!=this.b){for(var b=0;b<this.b.length;++b)U.h(this.b[b]);this.b=null}};var U=new e;m.prototype.M=function(b){var e=this.j(); | ||
b.F(e.resolve,e.reject)};m.prototype.N=function(b,e){var f=this.j();try{b.call(e,f.resolve,f.reject)}catch(B){f.reject(B)}};m.prototype.then=function(b,e){function f(b,e){return"function"==typeof b?function(e){try{q(b(e))}catch(aa){h(aa)}}:e}var q,h,l=new m(function(b,e){q=b;h=e});this.F(f(b,q),f(e,h));return l};m.prototype.catch=function(b){return this.then(void 0,b)};m.prototype.F=function(b,e){function f(){switch(m.h){case 1:b(m.o);break;case 2:e(m.o);break;default:throw Error("Unexpected state: "+ | ||
m.h);}}var m=this;null==this.b?U.h(f):this.b.push(f)};m.resolve=h;m.reject=function(b){return new m(function(e,f){f(b)})};m.race=function(b){return new m(function(e,f){for(var m=qa(b),q=m.next();!q.done;q=m.next())h(q.value).F(e,f)})};m.all=function(b){var e=qa(b),f=e.next();return f.done?h([]):new m(function(b,m){function q(e){return function(f){l[e]=f;B--;0==B&&b(l)}}var l=[],B=0;do l.push(void 0),B++,h(f.value).F(q(l.length-1),m),f=e.next();while(!f.done)})};return m}); | ||
(function(b,m,e){var h;(h=e.define)&&h.amd?h([],function(){return m}):(h=e.modules)?h[b.toLowerCase()]=m:"object"===typeof exports?module.exports=m:e[b]=m})("FlexSearch",function ta(b){function e(a,c){var d=c?c.id:a&&a.id;this.id=d||0===d?d:ua++;this.init(a,c);ia(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].f):Object.keys(this.f)});ia(this,"length",function(){return this.index.length})}function h(a,c,d,g){this.D!==this.i&&(this.A=this.A.concat(d),this.D++,g&&this.A.length>= | ||
g&&(this.D=this.i),this.D===this.i&&(this.cache&&this.v.set(c,this.A),this.H&&this.H(this.A)));return this}function l(a){var c=D(),d;for(d in a)if(a.hasOwnProperty(d)){var g=a[d];c[d]=H(g)?g.slice(0):F(g)?l(g):g}return c}function U(a,c){for(var d=a.length,g=V(c),b=[],k=0,e=0;k<d;k++){var t=a[k];if(g&&c(t)||!g&&!c[t])b[e++]=t}return b}function q(a,c,d,g,b,k,e,t,v,f){d=ja(d,e?0:b,t,k,c,v,f);if(t){t=d.page;var n=d.next;d=d.result}if(e)c=this.where(e,null,b,d);else{c=d;d=this.m;b=c.length;k=Array(b); | ||
for(e=0;e<b;e++)k[e]=d[c[e]];c=k}d=c;g&&(V(g)||(E=g.split(":"),1<E.length?g=aa:(E=E[0],g=sa)),d.sort(g));d=T(t,n,d);this.cache&&this.v.set(a,d);return d}function ia(a,c,d){Object.defineProperty(a,c,{get:d})}function f(a){return new RegExp(a,"g")}function B(a,c){for(var d=0;d<c.length;d+=2)a=a.replace(c[d],c[d+1]);return a}function S(a,c,d,g,b,k,e,t){if(c[d])return c[d];b=b?(t-(e||t/1.5))*k+(e||t/1.5)*b:k;c[d]=b;b>=e&&(a=a[t-(b+.5>>0)],a=a[d]||(a[d]=[]),a[a.length]=g);return b}function ba(a,c){if(a)for(var d= | ||
Object.keys(a),g=0,b=d.length;g<b;g++){var k=d[g],e=a[k];if(e)for(var t=0,v=e.length;t<v;t++)if(e[t]===c){1===v?delete a[k]:e.splice(t,1);break}else F(e[t])&&ba(e[t],c)}}function Z(a){for(var c="",d="",g="",b=0;b<a.length;b++){var e=a[b];if(e!==d)if(b&&"h"===e){if(g="a"===g||"e"===g||"i"===g||"o"===g||"u"===g||"y"===g,("a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d)&&g||" "===d)c+=e}else c+=e;g=b===a.length-1?"":a[b+1];d=e}return c}function ra(a,c){a=a.length-c.length;return 0>a?1:a?-1:0}function sa(a, | ||
c){a=a[E];c=c[E];return a<c?-1:a>c?1:0}function aa(a,c){for(var d=E.length,g=0;g<d;g++)a=a[E[g]],c=c[E[g]];return a<c?-1:a>c?1:0}function T(a,c,d){return a?{page:a,next:c?""+c:null,result:d}:d}function ja(a,c,d,g,b,e,f){var k=[];if(!0===d){d="0";var n=""}else n=d&&d.split(":");var K=a.length;if(1<K){var h=D(),u=[],C,p=0,r,q=!0,x=0,z;if(n)if(2===n.length){var w=n;n=!1}else n=z=parseInt(n[0],10);if(f){for(C=D();p<K;p++)if("not"===b[p]){var y=a[p];var l=y.length;for(r=0;r<l;r++)C["@"+y[r]]=1}else var B= | ||
p+1;if(G(B))return T(d,L,k);p=0}else var H=P(b)&&b;for(var A;p<K;p++){var I=p===(B||K)-1;if(!H||!p)if((r=H||b&&b[p])&&"and"!==r)if("or"===r)A=!1;else continue;else A=e=!0;y=a[p];if(l=y.length){if(q)if(M){var J=M.length;for(r=0;r<J;r++){q=M[r];var F="@"+q;f&&C[F]||(h[F]=1,e||(k[x++]=q))}var M=null;q=!1}else{M=y;continue}F=!1;for(r=0;r<l;r++){J=y[r];var N="@"+J,E=e?h[N]||0:p;if(!(!E&&!g||f&&C[N]||!e&&h[N]))if(E===p){if(I){if(!z||--z<x)if(k[x++]=J,c&&x===c)return T(d,x+(n||0),k)}else h[N]=p+1;F=!0}else g&& | ||
(N=u[E]||(u[E]=[]),N[N.length]=J)}if(A&&!F&&!g)break}else if(A&&!g)return T(d,L,y)}if(M)if(p=M.length,f)for(r=n?parseInt(n,10):0;r<p;r++)a=M[r],C["@"+a]||(k[x++]=a);else k=M;if(g)for(x=k.length,w?(p=parseInt(w[0],10)+1,r=parseInt(w[1],10)+1):(p=u.length,r=0);p--;)if(J=u[p]){for(l=J.length;r<l;r++)if(g=J[r],!f||!C["@"+g])if(k[x++]=g,c&&x===c)return T(d,p+":"+r,k);r=0}}else!K||b&&"not"===b[0]||(k=a[0],n&&(n=parseInt(n[0],10)));if(c){f=k.length;n&&n>f&&(n=0);n=n||0;var L=n+c;L<f?k=k.slice(n,L):(L=0, | ||
n&&(k=k.slice(n)))}return T(d,L,k)}function P(a){return"string"===typeof a}function H(a){return a.constructor===Array}function V(a){return"function"===typeof a}function F(a){return"object"===typeof a}function G(a){return"undefined"===typeof a}function ka(a){for(var c=Array(a),d=0;d<a;d++)c[d]=D();return c}function D(){return Object.create(null)}function va(){var a,c;self.onmessage=function(d){if(d=d.data)if(d.search){var b=c.search(d.content,d.threshold?{limit:d.limit,threshold:d.threshold,where:d.where}: | ||
d.limit);self.postMessage({id:a,content:d.content,limit:d.limit,result:b})}else d.add?c.add(d.id,d.content):d.update?c.update(d.id,d.content):d.remove?c.remove(d.id):d.clear?c.clear():d.info?(d=c.info(),d.worker=a,console.log(d)):d.register&&(a=d.id,d.options.cache=!1,d.options.async=!1,d.options.worker=!1,c=(new Function(d.register.substring(d.register.indexOf("{")+1,d.register.lastIndexOf("}"))))(),c=new c(d.options))}}function wa(a,c,d,g){a=b("flexsearch","id"+a,va,function(a){(a=a.data)&&a.result&& | ||
g(a.id,a.content,a.result,a.limit,a.where,a.cursor,a.suggest)},c);var e=ta.toString();d.id=c;a.postMessage({register:e,options:d,id:c});return a}var A={encode:"icase",g:"forward",split:/\W+/,cache:!1,async:!1,i:!1,G:!1,a:!1,c:9,threshold:0,depth:0},la={memory:{encode:"extra",g:"strict",threshold:0,c:1},speed:{encode:"icase",g:"strict",threshold:1,c:3,depth:2},match:{encode:"extra",g:"full",threshold:1,c:3},score:{encode:"extra",g:"strict",threshold:1,c:9,depth:4},balance:{encode:"balance",g:"strict", | ||
threshold:0,c:3,depth:3},fast:{encode:"icase",g:"strict",threshold:8,c:9,depth:1}},W=[],ua=0,ma={},na={};e.create=function(a,c){return new e(a,c)};e.registerMatcher=function(a){for(var c in a)a.hasOwnProperty(c)&&W.push(f(c),a[c]);return this};e.registerEncoder=function(a,c){Q[a]=c.bind(Q);return this};e.registerLanguage=function(a,c){ma[a]=c.filter;na[a]=c.stemmer;return this};e.encode=function(a,c){return Q[a](c)};e.prototype.init=function(a,c){this.h=[];if(c){var d=c.preset;a=c}else a||(a=A),d= | ||
a.preset;c={};P(a)?((c=la[a])||console.warn("Preset not found: "+a),a={}):d&&((c=la[d])||console.warn("Preset not found: "+d));if(d=a.worker)if("undefined"===typeof Worker)a.worker=!1,this.b=null;else{var b=parseInt(d,10)||4;this.w=-1;this.D=0;this.A=[];this.H=null;this.b=Array(b);for(var n=0;n<b;n++)this.b[n]=wa(this.id,n,a,h.bind(this))}this.g=a.tokenize||c.g||this.g||A.g;this.split=a.split||this.split||A.split;this.G=a.rtl||this.G||A.G;this.async="undefined"===typeof Promise||G(d=a.async)?this.async|| | ||
A.async:d;this.i=G(d=a.worker)?this.i||A.i:d;this.threshold=G(d=a.threshold)?c.threshold||this.threshold||A.threshold:d;this.c=G(d=a.resolution)?d=c.c||this.c||A.c:d;d<=this.threshold&&(this.c=this.threshold+1);this.depth="strict"!==this.g||G(d=a.depth)?c.depth||this.depth||A.depth:d;this.j=(d=G(d=a.encode)?c.encode||A.encode:d)&&Q[d]&&Q[d].bind(Q)||(V(d)?d:this.j||!1);(d=a.matcher)&&this.addMatcher(d);if(d=(c=a.lang)||a.filter){P(d)&&(d=ma[d]);if(H(d)){b=this.j;n=D();for(var k=0;k<d.length;k++){var K= | ||
b?b(d[k]):d[k];n[K]=1}d=n}this.filter=d}if(d=c||a.stemmer){c=P(d)?na[d]:d;b=this.j;n=[];for(var t in c)c.hasOwnProperty(t)&&(k=b?b(t):t,n.push(f(k+"($|\\W)"),b?b(c[t]):c[t]));this.stemmer=n}this.a=n=(d=a.doc)?l(d):this.a||A.a;this.u=ka(this.c-(this.threshold||0));this.s=D();this.f=D();if(n){this.m=D();a.doc=null;t=n.index={};c=n.keys=[];b=n.field;k=n.tag;H(n.id)||(n.id=n.id.split(":"));if(k){this.B=D();K=D();if(b)if(P(b))K[b]=a;else if(H(b))for(var v=0;v<b.length;v++)K[b[v]]=a;else F(b)&&(K=b);H(k)|| | ||
(n.tag=k=[k]);for(b=0;b<k.length;b++)this.B[k[b]]=D();this.I=k;b=K}if(b){if(!H(b))if(F(b)){var O=b;n.field=b=Object.keys(b)}else n.field=b=[b];for(n=0;n<b.length;n++)k=b[n],H(k)||(O&&(a=O[k]),c[n]=k,b[n]=k.split(":")),t[k]=new e(a),t[k].m=this.m}}this.o=!0;this.v=(this.cache=d=G(d=a.cache)?this.cache||A.cache:d)?new xa(d):!1;return this};e.prototype.encode=function(a){a&&W.length&&(a=B(a,W));a&&this.h.length&&(a=B(a,this.h));a&&this.j&&(a=this.j(a));a&&this.stemmer&&(a=B(a,this.stemmer));return a}; | ||
e.prototype.addMatcher=function(a){var c=this.h,d;for(d in a)a.hasOwnProperty(d)&&c.push(f(d),a[d]);return this};e.prototype.add=function(a,c,d,b,e){if(this.a&&F(a))return this.l("add",a,c);if(c&&P(c)&&(a||0===a)){var g="@"+a;if(this.f[g]&&!b)return this.update(a,c);if(this.i)return++this.w>=this.b.length&&(this.w=0),this.b[this.w].postMessage({add:!0,id:a,content:c}),this.f[g]=""+this.w,d&&d(),this;if(!e){if(this.async&&"function"!==typeof importScripts){var n=this;g=new Promise(function(d){setTimeout(function(){n.add(a, | ||
c,null,b,!0);n=null;d()})});if(d)g.then(d);else return g;return this}if(d)return this.add(a,c,null,b,!0),d(),this}c=this.encode(c);if(!c.length)return this;d=this.g;e=V(d)?d(c):c.split(this.split);this.filter&&(e=U(e,this.filter));var f=D();f._ctx=D();for(var v=e.length,O=this.threshold,h=this.depth,u=this.c,q=this.u,p=this.G,r=0;r<v;r++){var l=e[r];if(l){var x=l.length,z=(p?r+1:v-r)/v,w="";switch(d){case "reverse":case "both":for(var y=x;--y;)w=l[y]+w,S(q,f,w,a,p?1:(x-y)/x,z,O,u-1);w="";case "forward":for(y= | ||
0;y<x;y++)w+=l[y],S(q,f,w,a,p?(y+1)/x:1,z,O,u-1);break;case "full":for(y=0;y<x;y++)for(var B=(p?y+1:x-y)/x,A=x;A>y;A--)w=l.substring(y,A),S(q,f,w,a,B,z,O,u-1);break;default:if(x=S(q,f,l,a,1,z,O,u-1),h&&1<v&&x>=O)for(x=f._ctx[l]||(f._ctx[l]=D()),l=this.s[l]||(this.s[l]=ka(u-(O||0))),z=r-h,w=r+h+1,0>z&&(z=0),w>v&&(w=v);z<w;z++)z!==r&&S(l,x,e[z],a,0,u-(z<r?r-z:z-r),O,u-1)}}}this.f[g]=1;this.o=!1}return this};e.prototype.l=function(a,c,d){if(H(c))for(var b=0,e=c.length;b<e;b++){if(b===e-1)return this.l(a, | ||
c[b],d);this.l(a,c[b])}else{b=this.a.index;e=this.a.keys;for(var k=this.a.tag,f=this.a.id,t,v,l,h,u=0;u<f.length;u++)t=(t||c)[f[u]];if(k){for(f=0;f<k.length;f++){l=k[f];v=l.split(":");for(u=0;u<v.length;u++)h=(h||c)[v[u]];h="@"+h}v=this.B[l];v=v[h]||(v[h]=[])}if("remove"===a)for(delete this.m[t],f=0,k=e.length;f<k;f++){if(f===k-1)return b[e[f]].remove(t,d),this;b[e[f]].remove(t)}f=this.a.field;v&&(v[v.length]=c);this.m[t]=c;k=0;for(l=f.length;k<l;k++){v=f[k];h=void 0;for(u=0;u<v.length;u++)h=(h|| | ||
c)[v[u]];v=b[e[k]];u="add"===a?v.add:v.update;k===l-1?u.call(v,t,h,d):u.call(v,t,h)}}return this};e.prototype.update=function(a,c,d){if(this.a&&F(a))return this.l("update",a,c);this.f["@"+a]&&P(c)&&(this.remove(a),this.add(a,c,d,!0));return this};e.prototype.remove=function(a,c,d){if(this.a&&F(a))return this.l("remove",a,c);var b="@"+a;if(this.f[b]){if(this.i)return this.b[this.f[b]].postMessage({remove:!0,id:a}),delete this.f[b],c&&c(),this;if(!d){if(this.async&&"function"!==typeof importScripts){var e= | ||
this;b=new Promise(function(c){setTimeout(function(){e.remove(a,null,!0);e=null;c()})});if(c)b.then(c);else return b;return this}if(c)return this.remove(a,null,!0),c(),this}for(c=0;c<this.c-(this.threshold||0);c++)ba(this.u[c],a);this.depth&&ba(this.s,a);delete this.f[b];this.o=!1}return this};var E;e.prototype.search=function(a,c,d,b){if(F(c)){if(H(c))for(var e=0;e<c.length;e++)c[e].query=a;else c.query=a;a=c;c=1E3}else c&&V(c)?(d=c,c=1E3):c||0===c||(c=1E3);var f=[],g=a;if(F(a)&&!H(a)){d||(d=a.callback)&& | ||
(g.callback=null);var t=a.sort;var v=a.page;c=a.limit;var h=a.threshold;var l=a.suggest;a=a.query}if(this.a){h=this.a.index;var u=g.where,C=g.bool||"or",p=g.field,r=C,A,x;if(p)H(p)||(p=[p]);else if(H(g)){var z=g;p=[];r=[];for(var w=0;w<g.length;w++)b=g[w],e=b.bool||C,p[w]=b.field,r[w]=e,"not"===e?A=!0:"and"===e&&(x=!0)}else p=this.a.keys;C=p.length;for(w=0;w<C;w++)z&&(g=z[w]),v&&!P(g)&&(g.page=null,g.limit=0),f[w]=h[p[w]].search(g,0);if(d)return d(q.call(this,a,r,f,t,c,l,u,v,x,A));if(this.async){var y= | ||
this;return new Promise(function(d){Promise.all(f).then(function(b){d(q.call(y,a,r,b,t,c,l,u,v,x,A))})})}return q.call(this,a,r,f,t,c,l,u,v,x,A)}h||(h=this.threshold||0);if(this.i)for(this.H=d,this.D=0,this.A=[],p=0;p<this.i;p++)this.b[p].postMessage({search:!0,limit:c,cursor:v,threshold:h,content:a});else{if(!b){if(this.async&&"function"!==typeof importScripts){var B=this;h=new Promise(function(a){setTimeout(function(){a(B.search(g,c,null,!0));B=null})});if(d)h.then(d);else return h;return this}if(d)return d(this.search(g, | ||
c,null,!0)),this}if(!a||!P(a))return f;g=a;if(this.cache)if(this.o){if(d=this.v.get(a))return d}else this.v.clear(),this.o=!0;g=this.encode(g);if(!g.length)return f;d=this.g;d=V(d)?d(g):g.split(this.split);this.filter&&(d=U(d,this.filter));z=d.length;b=!0;e=[];var E=D(),G=0;1<z&&(this.depth&&"strict"===this.g?C=!0:d.sort(ra));if(!C||(w=this.s))for(var T=this.c;G<z;G++){var I=d[G];if(I){if(C){if(!p)if(w[I])p=I,E[I]=1;else if(!l)return f;if(l&&G===z-1&&!e.length)C=!1,I=p||I,E[I]=0;else if(!p)continue}if(!E[I]){var J= | ||
[],Q=!1,M=0,N=C?w[p]:this.u;if(N)for(var S=void 0,L=0;L<T-h;L++)if(S=N[L]&&N[L][I])J[M++]=S,Q=!0;if(Q)p=I,e[e.length]=1<M?J.concat.apply([],J):J[0];else if(!l){b=!1;break}E[I]=1}}}else b=!1;b&&(f=ja(e,c,v,l));this.cache&&this.v.set(a,f);return f}};e.prototype.find=function(a,c){return this.where(a,c,1)[0]||null};e.prototype.where=function(a,c,d,b){var e=this.m,f=[],g=0,h;if(F(a)){d||(d=c);var l=Object.keys(a);var q=l.length;var A=!1;if(1===q&&"id"===l[0])return[e[a.id]];if((h=this.I)&&!b)for(var u= | ||
0;u<h.length;u++){var C=h[u],p=a[C];if(!G(p)){var r=this.B[C]["@"+p];if(0===--q)return r;l.splice(l.indexOf(C),1);delete a[C];break}}h=Array(q);for(u=0;u<q;u++)h[u]=l[u].split(":")}else{if(V(a)){c=b||Object.keys(e);d=c.length;for(l=0;l<d;l++)q=e[c[l]],a(q)&&(f[g++]=q);return f}if(G(c))return[e[a]];if("id"===a)return[e[c]];l=[a];q=1;h=[a.split(":")];A=!0}b=r||b||Object.keys(e);u=b.length;for(C=0;C<u;C++){p=r?b[C]:e[b[C]];for(var B=!0,x=0;x<q;x++){A||(c=a[l[x]]);var z=h[x],w=z.length,y=p;if(1<w)for(var D= | ||
0;D<w;D++)y=y[z[D]];else y=y[z[0]];if(y!==c){B=!1;break}}if(B&&(f[g++]=p,d&&g===d))break}return f};e.prototype.info=function(){if(this.i)for(var a=0;a<this.i;a++)this.b[a].postMessage({info:!0,id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.C?this.cache.C.length:!1,matcher:W.length+(this.h?this.h.length:0),worker:this.i,threshold:this.threshold,depth:this.depth,resolution:this.c,contextual:this.depth&&"strict"===this.g}};e.prototype.clear=function(){return this.destroy().init()}; | ||
e.prototype.destroy=function(){this.cache&&(this.v.clear(),this.v=null);this.u=this.s=this.f=null;if(this.a){for(var a=this.a.keys,c=0;c<a.length;c++)this.a.index[a[c]].destroy();this.a=this.m=null}return this};e.prototype.export=function(){if(this.a){var a=this.a.keys;var c=Array(a.length+1);for(var d=0;d<a.length;d++){var b=this.a.index[a[d]];c[d]=[b.u,b.s,Object.keys(b.f)]}c[d]=this.m}else c=[this.u,this.s,Object.keys(this.f)];return JSON.stringify(c)};e.prototype.import=function(a){a=JSON.parse(a); | ||
var c=D();if(this.a){for(var b=this.a.keys,e=b.length,f=a[0][2],k=0;k<f.length;k++)c[f[k]]=1;for(f=0;f<e;f++)k=this.a.index[b[f]],k.u=a[f][0],k.s=a[f][1],k.f=c,k.m=a[e];this.m=a[e]}else{b=a[2];for(e=0;e<b.length;e++)c[b[e]]=1;this.u=a[0];this.s=a[1];this.f=c}};var Q={icase:function(a){return a.toLowerCase()},simple:function(){var a=[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("\u00e7"),"c",f("\u00df"),"s",f(" & ")," and ",f("[-/]")," ",f("[^a-z0-9 ]"),"",f("\\s+")," "];return function(c){c=B(c.toLowerCase(),a);return" "===c?"":c}}(),advanced:function(){var a=[f("ae"),"a",f("ai"),"ei",f("ay"),"ei",f("ey"),"ei",f("oe"),"o",f("ue"),"u",f("ie"),"i",f("sz"),"s",f("zs"),"s",f("sh"),"s",f("ck"),"k",f("cc"),"k",f("dt"),"t",f("ph"),"f",f("pf"),"f",f("ou"),"o",f("uo"),"u"];return function(c, | ||
b){if(!c)return c;c=this.simple(c);2<c.length&&(c=B(c,a));b||1<c.length&&(c=Z(c));return c}}(),extra:function(){var a=[f("p"),"b",f("z"),"s",f("[cgq]"),"k",f("n"),"m",f("d"),"t",f("[vw]"),"f",f("[aeiouy]"),""];return function(c){if(!c)return c;c=this.advanced(c,!0);if(1<c.length){c=c.split(" ");for(var b=0;b<c.length;b++){var e=c[b];1<e.length&&(c[b]=e[0]+B(e.substring(1),a))}c=c.join(" ");c=Z(c)}return c}}(),balance:function(){var a=[f("[-/]")," ",f("[^a-z0-9 ]"),"",f("\\s+")," "];return function(b){return Z(B(b.toLowerCase(), | ||
a))}}()},xa=function(){function a(a){this.clear();this.J=!0!==a&&a}a.prototype.clear=function(){this.cache=D();this.count=D();this.index=D();this.C=[]};a.prototype.set=function(a,b){if(this.J&&G(this.cache[a])){var c=this.C.length;if(c===this.J){c--;var d=this.C[c];delete this.cache[d];delete this.count[d];delete this.index[d]}this.index[a]=c;this.C[c]=a;this.count[a]=-1;this.cache[a]=b;this.get(a)}else this.cache[a]=b};a.prototype.get=function(a){var b=this.cache[a];if(this.J&&b){var c=++this.count[a], | ||
e=this.index,f=e[a];if(0<f){for(var h=this.C,l=f;this.count[h[--f]]<=c&&-1!==f;);f++;if(f!==l){for(c=l;c>f;c--)l=h[c-1],h[c]=l,e[l]=c;h[f]=a;e[a]=f}}}return b};return a}();return e}(function(){var b={},m="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(e,h,l,U,q){l=m?URL.createObjectURL(new Blob(["("+l.toString()+")()"],{type:"text/javascript"})):e+".es5.js";e+="-"+h;b[e]||(b[e]=[]);b[e][q]=new Worker(l);b[e][q].onmessage=U;console.log("Register Worker: "+e+ | ||
"@"+q);return b[e][q]}}()),this); |
/* | ||
FlexSearch v0.6.2 | ||
FlexSearch v0.6.21 | ||
Copyright 2019 Nextapps GmbH | ||
@@ -8,13 +8,13 @@ Author: Thomas Wilkerling | ||
*/ | ||
'use strict';(function(e,A,w){let n;(n=w.define)&&n.amd?n([],function(){return A}):(n=w.modules)?n[e.toLowerCase()]=A:"object"===typeof exports?module.exports=A:w[e]=A})("FlexSearch",function(){function e(a,b){const c=b?b.id:a&&a.id;this.id=c||0===c?c:M++;this.init(a,b);w(this,"index",function(){return Object.keys(this.c)});w(this,"length",function(){return this.index.length})}function A(a,b){const c=a.length,f=C(b),d=[];for(let k=0,h=0;k<c;k++){const c=a[k];if(f&&b(c)||!f&&!b[c])d[h++]=c}return d} | ||
function w(a,b,c){Object.defineProperty(a,b,{get:c})}function n(a,b){for(let c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}function D(a,b,c,f,d,k,h,g){if(b[c])return b[c];d=d?(g-(h||g/1.5))*k+(h||g/1.5)*d:k;b[c]=d;d>=h&&(a=a[g-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=f);return d}function G(a,b){if(a){const c=Object.keys(a);for(let f=0,d=c.length;f<d;f++){const d=c[f],h=a[d];if(h)for(let c=0,f=h.length;c<f;c++)if(h[c]===b){1===f?delete a[d]:h.splice(c,1);break}else"object"===typeof h[c]&&G(h[c], | ||
'use strict';(function(e,A,w){let p;(p=w.define)&&p.amd?p([],function(){return A}):(p=w.modules)?p[e.toLowerCase()]=A:"object"===typeof exports?module.exports=A:w[e]=A})("FlexSearch",function(){function e(a,b){const c=b?b.id:a&&a.id;this.id=c||0===c?c:M++;this.init(a,b);w(this,"index",function(){return Object.keys(this.c)});w(this,"length",function(){return this.index.length})}function A(a,b){const c=a.length,f=C(b),d=[];for(let k=0,h=0;k<c;k++){const c=a[k];if(f&&b(c)||!f&&!b[c])d[h++]=c}return d} | ||
function w(a,b,c){Object.defineProperty(a,b,{get:c})}function p(a,b){for(let c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}function D(a,b,c,f,d,k,h,g){if(b[c])return b[c];d=d?(g-(h||g/1.5))*k+(h||g/1.5)*d:k;b[c]=d;d>=h&&(a=a[g-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=f);return d}function G(a,b){if(a){const c=Object.keys(a);for(let f=0,d=c.length;f<d;f++){const d=c[f],h=a[d];if(h)for(let c=0,f=h.length;c<f;c++)if(h[c]===b){1===f?delete a[d]:h.splice(c,1);break}else"object"===typeof h[c]&&G(h[c], | ||
b)}}}function N(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function H(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}function E(a){return"string"===typeof a}function C(a){return"function"===typeof a}function F(a){return"undefined"===typeof a}function J(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=x();return b}function x(){return Object.create(null)}const t={encode:"icase",b:"forward",split:/\W+/,cache:!1,async:!1,m:!1,i:!1,l:!1,a:9,threshold:0,depth:0},I=[];let M=0;const K={},L={};e.create= | ||
function(a,b){return new e(a,b)};e.registerMatcher=function(a){for(const b in a)a.hasOwnProperty(b)&&I.push(new RegExp(b,"g"),a[b]);return this};e.registerEncoder=function(a,b){B[a]=b.bind(B);return this};e.registerLanguage=function(a,b){K[a]=b.filter;L[a]=b.stemmer;return this};e.encode=function(a,b){return B[a](b)};e.prototype.init=function(a,b){this.j=[];if(b){var c=b.preset;a=b}else a||(a=t),c=a.preset;b={};this.b=a.tokenize||b.b||this.b||t.b;this.split=a.split||this.split||t.split;this.i=a.rtl|| | ||
this.i||t.i;this.threshold=F(c=a.threshold)?b.threshold||this.threshold||t.threshold:c;this.a=F(c=a.resolution)?c=b.a||this.a||t.a:c;c<=this.threshold&&(this.a=this.threshold+1);this.depth="strict"!==this.b||F(c=a.depth)?b.depth||this.depth||t.depth:c;this.g=(c=F(c=a.encode)?b.encode||t.encode:c)&&B[c]&&B[c].bind(B)||(C(c)?c:this.g||!1);(c=a.matcher)&&this.addMatcher(c);if(c=(b=a.lang)||a.filter){E(c)&&(c=K[c]);if(c.constructor===Array){{var f=this.g;const a=x();for(let b=0;b<c.length;b++){const d= | ||
f?f(c[b]):c[b];a[d]=1}c=a}}this.filter=c}if(c=b||a.stemmer){var d;a=E(c)?L[c]:c;b=this.g;c=[];for(d in a)a.hasOwnProperty(d)&&(f=b?b(d):d,c.push(new RegExp(f+"($|\\W)","g"),b?b(a[d]):a[d]));this.stemmer=d=c}this.h=J(this.a-(this.threshold||0));this.f=x();this.c=x();return this};e.prototype.encode=function(a){a&&I.length&&(a=n(a,I));a&&this.j.length&&(a=n(a,this.j));a&&this.g&&(a=this.g(a));a&&this.stemmer&&(a=n(a,this.stemmer));return a};e.prototype.addMatcher=function(a){const b=this.j;for(const c in a)a.hasOwnProperty(c)&& | ||
b.push(new RegExp(c,"g"),a[c]);return this};e.prototype.add=function(a,b,c,f,d){if(b&&E(b)&&(a||0===a)){const e="@"+a;if(this.c[e]&&!f)return this.update(a,b);if(!d&&c)return this.add(a,b,null,f,!0),c(),this;b=this.encode(b);if(!b.length)return this;c=this.b;b=C(c)?c(b):b.split(this.split);this.filter&&(b=A(b,this.filter));f=x();f._ctx=x();d=b.length;const r=this.threshold,u=this.depth,v=this.a,p=this.h,q=this.i;for(let e=0;e<d;e++){var k=b[e];if(k){var h=k.length,g=(q?e+1:d-e)/d,m="";switch(c){case "reverse":case "both":for(var l= | ||
h;--l;)m=k[l]+m,D(p,f,m,a,q?1:(h-l)/h,g,r,v-1);m="";case "forward":for(l=0;l<h;l++)m+=k[l],D(p,f,m,a,q?(l+1)/h:1,g,r,v-1);break;case "full":for(l=0;l<h;l++){const b=(q?l+1:h-l)/h;for(let c=h;c>l;c--)m=k.substring(l,c),D(p,f,m,a,b,g,r,v-1)}break;default:if(h=D(p,f,k,a,1,g,r,v-1),u&&1<d&&h>=r)for(h=f._ctx[k]||(f._ctx[k]=x()),k=this.f[k]||(this.f[k]=J(v-(r||0))),g=e-u,m=e+u+1,0>g&&(g=0),m>d&&(m=d);g<m;g++)g!==e&&D(k,h,b[g],a,0,v-(g<e?e-g:g-e),r,v-1)}}}this.c[e]=1}return this};e.prototype.update=function(a, | ||
f?f(c[b]):c[b];a[d]=1}c=a}}this.filter=c}if(c=b||a.stemmer){var d;a=E(c)?L[c]:c;b=this.g;c=[];for(d in a)a.hasOwnProperty(d)&&(f=b?b(d):d,c.push(new RegExp(f+"($|\\W)","g"),b?b(a[d]):a[d]));this.stemmer=d=c}this.h=J(this.a-(this.threshold||0));this.f=x();this.c=x();return this};e.prototype.encode=function(a){a&&I.length&&(a=p(a,I));a&&this.j.length&&(a=p(a,this.j));a&&this.g&&(a=this.g(a));a&&this.stemmer&&(a=p(a,this.stemmer));return a};e.prototype.addMatcher=function(a){const b=this.j;for(const c in a)a.hasOwnProperty(c)&& | ||
b.push(new RegExp(c,"g"),a[c]);return this};e.prototype.add=function(a,b,c,f,d){if(b&&E(b)&&(a||0===a)){const e="@"+a;if(this.c[e]&&!f)return this.update(a,b);if(!d&&c)return this.add(a,b,null,f,!0),c(),this;b=this.encode(b);if(!b.length)return this;c=this.b;b=C(c)?c(b):b.split(this.split);this.filter&&(b=A(b,this.filter));f=x();f._ctx=x();d=b.length;const r=this.threshold,u=this.depth,v=this.a,q=this.h,n=this.i;for(let e=0;e<d;e++){var k=b[e];if(k){var h=k.length,g=(n?e+1:d-e)/d,m="";switch(c){case "reverse":case "both":for(var l= | ||
h;--l;)m=k[l]+m,D(q,f,m,a,n?1:(h-l)/h,g,r,v-1);m="";case "forward":for(l=0;l<h;l++)m+=k[l],D(q,f,m,a,n?(l+1)/h:1,g,r,v-1);break;case "full":for(l=0;l<h;l++){const b=(n?l+1:h-l)/h;for(let c=h;c>l;c--)m=k.substring(l,c),D(q,f,m,a,b,g,r,v-1)}break;default:if(h=D(q,f,k,a,1,g,r,v-1),u&&1<d&&h>=r)for(h=f._ctx[k]||(f._ctx[k]=x()),k=this.f[k]||(this.f[k]=J(v-(r||0))),g=e-u,m=e+u+1,0>g&&(g=0),m>d&&(m=d);g<m;g++)g!==e&&D(k,h,b[g],a,0,v-(g<e?e-g:g-e),r,v-1)}}}this.c[e]=1}return this};e.prototype.update=function(a, | ||
b,c){this.c["@"+a]&&E(b)&&(this.remove(a),this.add(a,b,c,!0));return this};e.prototype.remove=function(a,b,c){const f="@"+a;if(this.c[f]){if(!c&&b)return this.remove(a,null,!0),b(),this;for(b=0;b<this.a-(this.threshold||0);b++)G(this.h[b],a);this.depth&&G(this.f,a);delete this.c[f]}return this};e.prototype.search=function(a,b,c,f){b&&C(b)?(c=b,b=1E3):b||0===b||(b=1E3);var d=[],e=a;if("object"===typeof a){var h=!1;b=a.limit;var g=a.threshold;var m=!1;a=a.query}g||(g=this.threshold||0);if(!f&&c)return c(this.search(e, | ||
b,null,!0)),this;if(!a||!E(a))return d;e=this.encode(a);if(!e.length)return d;a=this.b;a=C(a)?a(e):e.split(this.split);this.filter&&(a=A(a,this.filter));c=a.length;f=!0;e=[];var l=x(),n,r=0;1<c&&(this.depth&&"strict"===this.b?n=!0:a.sort(N));var u;if(!n||(u=this.f))for(var v=this.a;r<c;r++){var p=a[r];if(p){if(n){if(!q)if(u[p]){var q=p;l[p]=1}else if(!m)return d;if(m&&r===c-1&&!e.length)n=!1,p=q||p,l[p]=0;else if(!q)continue}if(!l[p]){var t=[],w=!1;let a=0;if(q=n?u[q]:this.h){let b;for(let c=0;c< | ||
v-g;c++)if(b=q[c][p])t[a++]=b,w=!0}if(w)q=p,e[e.length]=1<a?t.concat.apply([],t):t[0];else{f=!1;break}l[p]=1}}}else f=!1;if(f)a:{let k;d=[];!0===h?(h="0",g=""):g=h&&h.split(":");m=e.length;if(1<m){n=x();q=0;v=!0;f=0;var z;for(g&&(2===g.length?g=!1:g=z=parseInt(g[0],10));q<m;q++){l=q===m-1;u=e[q];c=u.length;if(!c){d=H(h,k,u);break a}if(v)if(y){r=y.length;for(a=0;a<r;a++)n["@"+y[a]]=1;var y=null;v=!1}else{y=u;continue}p=!1;for(a=0;a<c;a++)if(r=u[a],t="@"+r,(w=n[t]||0)&&w===q){if(l){if(!z||--z<f)if(d[f++]= | ||
r,b&&f===b){d=H(h,f+(g||0),d);break a}}else n[t]=q+1;p=!0}if(!p)break}y&&(d=y)}else m&&(d=e[0],g&&(g=parseInt(g[0],10)));b&&(y=d.length,g&&g>y&&(g=0),z=g||0,k=z+b,k<y?d=d.slice(z,k):(k=0,z&&(d=d.slice(z))));d=H(h,k,d)}return d};e.prototype.clear=function(){return this.destroy().init()};e.prototype.destroy=function(){this.h=this.f=this.c=null;return this};const B={icase:function(a){return a.toLowerCase()}};return e}(!1),this); | ||
b,null,!0)),this;if(!a||!E(a))return d;e=this.encode(a);if(!e.length)return d;a=this.b;a=C(a)?a(e):e.split(this.split);this.filter&&(a=A(a,this.filter));c=a.length;f=!0;e=[];var l=x(),p,r=0;1<c&&(this.depth&&"strict"===this.b?p=!0:a.sort(N));var u;if(!p||(u=this.f))for(var v=this.a;r<c;r++){var q=a[r];if(q){if(p){if(!n)if(u[q]){var n=q;l[q]=1}else if(!m)return d;if(m&&r===c-1&&!e.length)p=!1,q=n||q,l[q]=0;else if(!n)continue}if(!l[q]){var t=[],w=!1;let a=0;if(n=p?u[n]:this.h){let b;for(let c=0;c< | ||
v-g;c++)if(b=n[c]&&n[c][q])t[a++]=b,w=!0}if(w)n=q,e[e.length]=1<a?t.concat.apply([],t):t[0];else{f=!1;break}l[q]=1}}}else f=!1;if(f)a:{let k;d=[];!0===h?(h="0",g=""):g=h&&h.split(":");m=e.length;if(1<m){p=x();n=0;v=!0;f=0;var z;for(g&&(2===g.length?g=!1:g=z=parseInt(g[0],10));n<m;n++){l=n===m-1;u=e[n];c=u.length;if(!c){d=H(h,k,u);break a}if(v)if(y){r=y.length;for(a=0;a<r;a++)p["@"+y[a]]=1;var y=null;v=!1}else{y=u;continue}q=!1;for(a=0;a<c;a++)if(r=u[a],t="@"+r,(w=p[t]||0)&&w===n){if(l){if(!z||--z< | ||
f)if(d[f++]=r,b&&f===b){d=H(h,f+(g||0),d);break a}}else p[t]=n+1;q=!0}if(!q)break}y&&(d=y)}else m&&(d=e[0],g&&(g=parseInt(g[0],10)));b&&(y=d.length,g&&g>y&&(g=0),z=g||0,k=z+b,k<y?d=d.slice(z,k):(k=0,z&&(d=d.slice(z))));d=H(h,k,d)}return d};e.prototype.clear=function(){return this.destroy().init()};e.prototype.destroy=function(){this.h=this.f=this.c=null;return this};const B={icase:function(a){return a.toLowerCase()}};return e}(!1),this); |
/* | ||
FlexSearch v0.6.2 | ||
FlexSearch v0.6.21 | ||
Copyright 2019 Nextapps GmbH | ||
@@ -8,35 +8,35 @@ Author: Thomas Wilkerling | ||
*/ | ||
'use strict';(function(y,L,m){let B;(B=m.define)&&B.amd?B([],function(){return L}):(B=m.modules)?B[y.toLowerCase()]=L:"object"===typeof exports?module.exports=L:m[y]=L})("FlexSearch",function da(y){function m(a,b){const c=b?b.id:a&&a.id;this.id=c||0===c?c:ea++;this.init(a,b);M(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)});M(this,"length",function(){return this.index.length})}function B(a,b,c,d){this.u!==this.g&&(this.o=this.o.concat(c),this.u++, | ||
d&&this.o.length>=d&&(this.u=this.g),this.u===this.g&&(this.cache&&this.l.set(b,this.o),this.F&&this.F(this.o)));return this}function N(a,b){const c=a.length,d=J(b),e=[];for(let g=0,f=0;g<c;g++){const c=a[g];if(d&&b(c)||!d&&!b[c])e[f++]=c}return e}function R(a,b,c,d,e,g,f,l,r,p){c=Y(c,f?0:e,l,g,b,r,p);let q;l&&(l=c.page,q=c.next,c=c.result);if(f)b=this.where(f,null,e,c);else{b=c;c=this.h;e=b.length;g=Array(e);for(f=0;f<e;f++)g[f]=c[b[f]];b=g}c=b;d&&(J(d)||(A=d.split(":"),1<A.length?d=fa:(A=A[0],d= | ||
ha)),c.sort(d));c=O(l,q,c);this.cache&&this.l.set(a,c);return c}function M(a,b,c){Object.defineProperty(a,b,{get:c})}function h(a){return new RegExp(a,"g")}function K(a,b){for(let c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}function S(a,b,c,d,e,g,f,l){if(b[c])return b[c];e=e?(l-(f||l/1.5))*g+(f||l/1.5)*e:g;b[c]=e;e>=f&&(a=a[l-(e+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=d);return e}function W(a,b){if(a){const c=Object.keys(a);for(let d=0,e=c.length;d<e;d++){const e=c[d],f=a[e];if(f)for(let c= | ||
0,d=f.length;c<d;c++)if(f[c]===b){1===d?delete a[e]:f.splice(c,1);break}else E(f[c])&&W(f[c],b)}}}function X(a){let b="",c="";var d="";for(let e=0;e<a.length;e++){const g=a[e];if(g!==c)if(e&&"h"===g){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c)&&d||" "===c)b+=g}else b+=g;d=e===a.length-1?"":a[e+1];c=g}return b}function ia(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function ha(a,b){a=a[A];b=b[A];return a<b?-1:a>b?1:0}function fa(a, | ||
b){const c=A.length;for(let d=0;d<c;d++)a=a[A[d]],b=b[A[d]];return a<b?-1:a>b?1:0}function O(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}function Y(a,b,c,d,e,g,f){let l,r=[];if(!0===c){c="0";var p=""}else p=c&&c.split(":");const q=a.length;if(1<q){const U=w();let D=[],P,I;var n=0,k;let u;var h=!0;let F,G=0,x,z,y,B;p&&(2===p.length?(y=p,p=!1):p=B=parseInt(p[0],10));if(f){for(P=w();n<q;n++)if("not"===e[n])for(I=a[n],u=I.length,k=0;k<u;k++)P["@"+I[k]]=1;else z=n+1;if(C(z))return O(c,l,r);n= | ||
0}else x=H(e)&&e;let A;for(;n<q;n++){const w=n===(z||q)-1;if(!x||!n)if((k=x||e&&e[n])&&"and"!==k)if("or"===k)A=!1;else continue;else A=g=!0;I=a[n];if(u=I.length){if(h)if(F){var t=F.length;for(k=0;k<t;k++){h=F[k];var m="@"+h;f&&P[m]||(U[m]=1,g||(r[G++]=h))}F=null;h=!1}else{F=I;continue}m=!1;for(k=0;k<u;k++){t=I[k];var v="@"+t;const a=g?U[v]||0:n;if(!(!a&&!d||f&&P[v]||!g&&U[v]))if(a===n){if(w){if(!B||--B<G)if(r[G++]=t,b&&G===b)return O(c,G+(p||0),r)}else U[v]=n+1;m=!0}else d&&(v=D[a]||(D[a]=[]),v[v.length]= | ||
t)}if(A&&!m&&!d)break}else if(A&&!d)return O(c,l,I)}if(F)if(n=F.length,f)for(k=p?parseInt(p,10):0;k<n;k++)a=F[k],P["@"+a]||(r[G++]=a);else r=F;if(d)for(G=r.length,y?(n=parseInt(y[0],10)+1,k=parseInt(y[1],10)+1):(n=D.length,k=0);n--;)if(t=D[n]){for(u=t.length;k<u;k++)if(d=t[k],!f||!P["@"+d])if(r[G++]=d,b&&G===b)return O(c,n+":"+k,r);k=0}}else!q||e&&"not"===e[0]||(r=a[0],p&&(p=parseInt(p[0],10)));b&&(f=r.length,p&&p>f&&(p=0),p=p||0,l=p+b,l<f?r=r.slice(p,l):(l=0,p&&(r=r.slice(p))));return O(c,l,r)}function H(a){return"string"=== | ||
typeof a}function z(a){return a.constructor===Array}function J(a){return"function"===typeof a}function E(a){return"object"===typeof a}function C(a){return"undefined"===typeof a}function Z(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=w();return b}function w(){return Object.create(null)}function ja(){let a,b;self.onmessage=function(c){if(c=c.data)if(c.search){const d=b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold,where:c.where}:c.limit);self.postMessage({id:a,content:c.content, | ||
limit:c.limit,result:d})}else c.add?b.add(c.id,c.content):c.update?b.update(c.id,c.content):c.remove?b.remove(c.id):c.clear?b.clear():c.info?(c=b.info(),c.worker=a,console.log(c)):c.register&&(a=c.id,c.options.cache=!1,c.options.async=!1,c.options.worker=!1,b=(new Function(c.register.substring(c.register.indexOf("{")+1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}}function ka(a,b,c,d){a=y("flexsearch","id"+a,ja,function(a){(a=a.data)&&a.result&&d(a.id,a.content,a.result,a.limit,a.where,a.cursor, | ||
a.suggest)},b);const e=da.toString();c.id=b;a.postMessage({register:e,options:c,id:b});return a}const x={encode:"icase",f:"forward",split:/\W+/,cache:!1,async:!1,g:!1,D:!1,a:!1,b:9,threshold:0,depth:0},aa={memory:{encode:"extra",f:"strict",threshold:0,b:1},speed:{encode:"icase",f:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",f:"full",threshold:1,b:3},score:{encode:"extra",f:"strict",threshold:1,b:9,depth:4},balance:{encode:"balance",f:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase", | ||
f:"strict",threshold:8,b:9,depth:1}},V=[];let ea=0;const ba={},ca={};m.create=function(a,b){return new m(a,b)};m.registerMatcher=function(a){for(const b in a)a.hasOwnProperty(b)&&V.push(h(b),a[b]);return this};m.registerEncoder=function(a,b){Q[a]=b.bind(Q);return this};m.registerLanguage=function(a,b){ba[a]=b.filter;ca[a]=b.stemmer;return this};m.encode=function(a,b){return Q[a](b)};m.prototype.init=function(a,b){this.v=[];if(b){var c=b.preset;a=b}else a||(a=x),c=a.preset;b={};H(a)?(b=aa[a],a={}): | ||
c&&(b=aa[c]);if(c=a.worker)if("undefined"===typeof Worker)a.worker=!1,this.m=null;else{var d=parseInt(c,10)||4;this.C=-1;this.u=0;this.o=[];this.F=null;this.m=Array(d);for(var e=0;e<d;e++)this.m[e]=ka(this.id,e,a,B.bind(this))}this.f=a.tokenize||b.f||this.f||x.f;this.split=a.split||this.split||x.split;this.D=a.rtl||this.D||x.D;this.async="undefined"===typeof Promise||C(c=a.async)?this.async||x.async:c;this.g=C(c=a.worker)?this.g||x.g:c;this.threshold=C(c=a.threshold)?b.threshold||this.threshold|| | ||
x.threshold:c;this.b=C(c=a.resolution)?c=b.b||this.b||x.b:c;c<=this.threshold&&(this.b=this.threshold+1);this.depth="strict"!==this.f||C(c=a.depth)?b.depth||this.depth||x.depth:c;this.w=(c=C(c=a.encode)?b.encode||x.encode:c)&&Q[c]&&Q[c].bind(Q)||(J(c)?c:this.w||!1);(c=a.matcher)&&this.addMatcher(c);if(c=(b=a.lang)||a.filter){H(c)&&(c=ba[c]);if(z(c)){d=this.w;e=w();for(var g=0;g<c.length;g++){var f=d?d(c[g]):c[g];e[f]=1}c=e}this.filter=c}if(c=b||a.stemmer){var l;b=H(c)?ca[c]:c;d=this.w;e=[];for(l in b)b.hasOwnProperty(l)&& | ||
(g=d?d(l):l,e.push(h(g+"($|\\W)"),d?d(b[l]):b[l]));this.stemmer=l=e}this.a=e=(c=a.doc)?c:this.a||x.a;this.j=Z(this.b-(this.threshold||0));this.i=w();this.c=w();if(e){this.h=w();a.doc=null;l=e.index={};b=e.keys=[];d=e.field;g=e.tag;z(e.id)||(e.id=e.id.split(":"));if(g){this.G=w();f=w();if(d)if(H(d))f[d]=a;else if(z(d))for(let b=0;b<d.length;b++)f[d[b]]=a;else E(d)&&(f=d);z(g)||(e.tag=g=[g]);for(d=0;d<g.length;d++)this.G[g[d]]=w();this.I=g;d=f}if(d){let c;z(d)||(E(d)?(c=d,e.field=d=Object.keys(d)): | ||
e.field=d=[d]);for(e=0;e<d.length;e++)g=d[e],z(g)||(c&&(a=c[g]),b[e]=g,d[e]=g.split(":")),l[g]=new m(a),l[g].h=this.h}}this.B=!0;this.l=(this.cache=c=C(c=a.cache)?this.cache||x.cache:c)?new la(c):!1;return this};m.prototype.encode=function(a){a&&V.length&&(a=K(a,V));a&&this.v.length&&(a=K(a,this.v));a&&this.w&&(a=this.w(a));a&&this.stemmer&&(a=K(a,this.stemmer));return a};m.prototype.addMatcher=function(a){const b=this.v;for(const c in a)a.hasOwnProperty(c)&&b.push(h(c),a[c]);return this};m.prototype.add= | ||
function(a,b,c,d,e){if(this.a&&E(a))return this.A("add",a,b);if(b&&H(b)&&(a||0===a)){var g="@"+a;if(this.c[g]&&!d)return this.update(a,b);if(this.g)return++this.C>=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:a,content:b}),this.c[g]=""+this.C,c&&c(),this;if(!e){if(this.async&&"function"!==typeof importScripts){let e=this;g=new Promise(function(c){setTimeout(function(){e.add(a,b,null,d,!0);e=null;c()})});if(c)g.then(c);else return g;return this}if(c)return this.add(a,b,null,d,!0), | ||
c(),this}b=this.encode(b);if(!b.length)return this;c=this.f;e=J(c)?c(b):b.split(this.split);this.filter&&(e=N(e,this.filter));const n=w();n._ctx=w();const k=e.length,h=this.threshold,m=this.depth,u=this.b,v=this.j,T=this.D;for(let b=0;b<k;b++){var f=e[b];if(f){var l=f.length,r=(T?b+1:k-b)/k,p="";switch(c){case "reverse":case "both":for(var q=l;--q;)p=f[q]+p,S(v,n,p,a,T?1:(l-q)/l,r,h,u-1);p="";case "forward":for(q=0;q<l;q++)p+=f[q],S(v,n,p,a,T?(q+1)/l:1,r,h,u-1);break;case "full":for(q=0;q<l;q++){const b= | ||
(T?q+1:l-q)/l;for(let c=l;c>q;c--)p=f.substring(q,c),S(v,n,p,a,b,r,h,u-1)}break;default:if(l=S(v,n,f,a,1,r,h,u-1),m&&1<k&&l>=h)for(l=n._ctx[f]||(n._ctx[f]=w()),f=this.i[f]||(this.i[f]=Z(u-(h||0))),r=b-m,p=b+m+1,0>r&&(r=0),p>k&&(p=k);r<p;r++)r!==b&&S(f,l,e[r],a,0,u-(r<b?b-r:r-b),h,u-1)}}}this.c[g]=1;this.B=!1}return this};m.prototype.A=function(a,b,c){if(z(b))for(let d=0,e=b.length;d<e;d++){if(d===e-1)return this.A(a,b[d],c);this.A(a,b[d])}else{const h=this.a.index,p=this.a.keys;var d=this.a.tag,e= | ||
this.a.id;let q;let n;for(var g=0;g<e.length;g++)q=(q||b)[e[g]];if(d){for(e=0;e<d.length;e++){var f=d[e];var l=f.split(":");for(g=0;g<l.length;g++)n=(n||b)[l[g]];n="@"+n}l=this.G[f];l=l[n]||(l[n]=[])}if("remove"===a){delete this.h[q];for(let a=0,b=p.length;a<b;a++){if(a===b-1)return h[p[a]].remove(q,c),this;h[p[a]].remove(q)}}e=this.a.field;l&&(l[l.length]=b);this.h[q]=b;for(let g=0,l=e.length;g<l;g++){d=e[g];let k;for(f=0;f<d.length;f++)k=(k||b)[d[f]];d=h[p[g]];f="add"===a?d.add:d.update;g===l-1? | ||
f.call(d,q,k,c):f.call(d,q,k)}}return this};m.prototype.update=function(a,b,c){if(this.a&&E(a))return this.A("update",a,b);this.c["@"+a]&&H(b)&&(this.remove(a),this.add(a,b,c,!0));return this};m.prototype.remove=function(a,b,c){if(this.a&&E(a))return this.A("remove",a,b);var d="@"+a;if(this.c[d]){if(this.g)return this.m[this.c[d]].postMessage({remove:!0,id:a}),delete this.c[d],b&&b(),this;if(!c){if(this.async&&"function"!==typeof importScripts){let c=this;d=new Promise(function(b){setTimeout(function(){c.remove(a, | ||
null,!0);c=null;b()})});if(b)d.then(b);else return d;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.b-(this.threshold||0);b++)W(this.j[b],a);this.depth&&W(this.i,a);delete this.c[d];this.B=!1}return this};let A;m.prototype.search=function(a,b,c,d){if(E(b)){if(z(b))for(var e=0;e<b.length;e++)b[e].query=a;else b.query=a;a=b;b=1E3}else b&&J(b)?(c=b,b=1E3):b||0===b||(b=1E3);let g=[],f=a;let l,h,p;if(E(a)&&!z(a)){c||(c=a.callback)&&(f.callback=null);h=a.sort;l=a.page;b=a.limit; | ||
var q=a.threshold;p=a.suggest;a=a.query}if(this.a){q=this.a.index;const r=f.where;var n=f.bool||"or",k=f.field;let D=n;let u,v;if(k)z(k)||(k=[k]);else if(z(f)){var m=f;k=[];D=[];for(var t=0;t<f.length;t++)d=f[t],e=d.bool||n,k[t]=d.field,D[t]=e,"not"===e?u=!0:"and"===e&&(v=!0)}else k=this.a.keys;n=k.length;for(t=0;t<n;t++)m&&(f=m[t]),l&&!H(f)&&(f.page=null,f.limit=0),g[t]=q[k[t]].search(f,0);if(c)return c(R.call(this,a,D,g,h,b,p,r,l,v,u));if(this.async){const c=this;return new Promise(function(d){Promise.all(g).then(function(e){d(R.call(c, | ||
a,D,e,h,b,p,r,l,v,u))})})}return R.call(this,a,D,g,h,b,p,r,l,v,u)}q||(q=this.threshold||0);if(this.g)for(this.F=c,this.u=0,this.o=[],k=0;k<this.g;k++)this.m[k].postMessage({search:!0,limit:b,cursor:l,threshold:q,content:a});else{if(!d){if(this.async&&"function"!==typeof importScripts){let a=this;q=new Promise(function(c){setTimeout(function(){c(a.search(f,b,null,!0));a=null})});if(c)q.then(c);else return q;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!H(a))return g;f=a;if(this.cache)if(this.B){if(c= | ||
this.l.get(a))return c}else this.l.clear(),this.B=!0;f=this.encode(f);if(!f.length)return g;c=this.f;c=J(c)?c(f):f.split(this.split);this.filter&&(c=N(c,this.filter));m=c.length;d=!0;e=[];var u=w(),v=0;1<m&&(this.depth&&"strict"===this.f?n=!0:c.sort(ia));if(!n||(t=this.i)){const a=this.b;for(;v<m;v++){let b=c[v];if(b){if(n){if(!k)if(t[b])k=b,u[b]=1;else if(!p)return g;if(p&&v===m-1&&!e.length)n=!1,b=k||b,u[b]=0;else if(!k)continue}if(!u[b]){const c=[];let f=!1,g=0;const l=n?t[k]:this.j;if(l){let d; | ||
for(let e=0;e<a-q;e++)if(d=l[e][b])c[g++]=d,f=!0}if(f)k=b,e[e.length]=1<g?c.concat.apply([],c):c[0];else if(!p){d=!1;break}u[b]=1}}}}else d=!1;d&&(g=Y(e,b,l,p));this.cache&&this.l.set(a,g);return g}};m.prototype.find=function(a,b){return this.where(a,b,1)[0]||null};m.prototype.where=function(a,b,c,d){const e=this.h,g=[];let f=0;let l;var h;let p;if(E(a)){c||(c=b);var q=Object.keys(a);var n=q.length;l=!1;if(1===n&&"id"===q[0])return[e[a.id]];if((h=this.I)&&!d)for(var k=0;k<h.length;k++){var m=h[k], | ||
t=a[m];if(!C(t)){p=this.G[m]["@"+t];if(0===--n)return p;q.splice(q.indexOf(m),1);delete a[m];break}}h=Array(n);for(k=0;k<n;k++)h[k]=q[k].split(":")}else{if(J(a)){b=d||Object.keys(e);c=b.length;for(q=0;q<c;q++)n=e[b[q]],a(n)&&(g[f++]=n);return g}if(C(b))return[e[a]];if("id"===a)return[e[b]];q=[a];n=1;h=[a.split(":")];l=!0}d=p||d||Object.keys(e);k=d.length;for(m=0;m<k;m++){t=p?d[m]:e[d[m]];let k=!0;for(let c=0;c<n;c++){l||(b=a[q[c]]);const d=h[c],e=d.length;let f=t;if(1<e)for(let a=0;a<e;a++)f=f[d[a]]; | ||
else f=f[d[0]];if(f!==b){k=!1;break}}if(k&&(g[f++]=t,c&&f===c))break}return g};m.prototype.info=function(){if(this.g)for(let a=0;a<this.g;a++)this.m[a].postMessage({info:!0,id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.s?this.cache.s.length:!1,matcher:V.length+(this.v?this.v.length:0),worker:this.g,threshold:this.threshold,depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.f}};m.prototype.clear=function(){return this.destroy().init()};m.prototype.destroy= | ||
function(){this.cache&&(this.l.clear(),this.l=null);this.j=this.i=this.c=null;if(this.a){const a=this.a.keys;for(let b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.h=null}return this};m.prototype.export=function(){let a;if(this.a){const b=this.a.keys;a=Array(b.length+1);let c=0;for(;c<b.length;c++){const d=this.a.index[b[c]];a[c]=[d.j,d.i,Object.keys(d.c)]}a[c]=this.h}else a=[this.j,this.i,Object.keys(this.c)];return JSON.stringify(a)};m.prototype.import=function(a){a=JSON.parse(a);const b= | ||
w();if(this.a){var c=this.a.keys,d=c.length,e=a[0][2];for(var g=0;g<e.length;g++)b[e[g]]=1;for(e=0;e<d;e++)g=this.a.index[c[e]],g.j=a[e][0],g.i=a[e][1],g.c=b,g.h=a[d];this.h=a[d]}else{c=a[2];for(d=0;d<c.length;d++)b[c[d]]=1;this.j=a[0];this.i=a[1];this.c=b}};const Q={icase:function(a){return a.toLowerCase()},simple:function(){const a=[h("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",h("[\u00e8\u00e9\u00ea\u00eb]"),"e",h("[\u00ec\u00ed\u00ee\u00ef]"),"i",h("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), | ||
"o",h("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",h("[\u00fd\u0177\u00ff]"),"y",h("\u00f1"),"n",h("\u00e7"),"c",h("\u00df"),"s",h(" & ")," and ",h("[-/]")," ",h("[^a-z0-9 ]"),"",h("\\s+")," "];return function(b){b=K(b.toLowerCase(),a);return" "===b?"":b}}(),advanced:function(){const a=[h("ae"),"a",h("ai"),"ei",h("ay"),"ei",h("ey"),"ei",h("oe"),"o",h("ue"),"u",h("ie"),"i",h("sz"),"s",h("zs"),"s",h("sh"),"s",h("ck"),"k",h("cc"),"k",h("dt"),"t",h("ph"),"f",h("pf"),"f",h("ou"),"o",h("uo"),"u"];return function(b, | ||
c){if(!b)return b;b=this.simple(b);2<b.length&&(b=K(b,a));c||1<b.length&&(b=X(b));return b}}(),extra:function(){const a=[h("p"),"b",h("z"),"s",h("[cgq]"),"k",h("n"),"m",h("d"),"t",h("[vw]"),"f",h("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let c=0;c<b.length;c++){const d=b[c];1<d.length&&(b[c]=d[0]+K(d.substring(1),a))}b=b.join(" ");b=X(b)}return b}}(),balance:function(){const a=[h("[-/]")," ",h("[^a-z0-9 ]"),"",h("\\s+")," "];return function(b){return X(K(b.toLowerCase(), | ||
a))}}()},la=function(){function a(a){this.clear();this.H=!0!==a&&a}a.prototype.clear=function(){this.cache=w();this.count=w();this.index=w();this.s=[]};a.prototype.set=function(a,c){if(this.H&&C(this.cache[a])){let b=this.s.length;if(b===this.H){b--;const a=this.s[b];delete this.cache[a];delete this.count[a];delete this.index[a]}this.index[a]=b;this.s[b]=a;this.count[a]=-1;this.cache[a]=c;this.get(a)}else this.cache[a]=c};a.prototype.get=function(a){const b=this.cache[a];if(this.H&&b){var d=++this.count[a]; | ||
const b=this.index;let c=b[a];if(0<c){const f=this.s;for(var e=c;this.count[f[--c]]<=d&&-1!==c;);c++;if(c!==e){for(d=e;d>c;d--)e=f[d-1],f[d]=e,b[e]=d;f[c]=a;b[a]=c}}}return b};return a}();return m}(function(){const y={},L="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(m,B,N,R,M){N=L?URL.createObjectURL(new Blob(["("+N.toString()+")()"],{type:"text/javascript"})):m+".min.js";m+="-"+B;y[m]||(y[m]=[]);y[m][M]=new Worker(N);y[m][M].onmessage=R;return y[m][M]}}()), | ||
this); | ||
'use strict';(function(z,M,m){let A;(A=m.define)&&A.amd?A([],function(){return M}):(A=m.modules)?A[z.toLowerCase()]=M:"object"===typeof exports?module.exports=M:m[z]=M})("FlexSearch",function ea(z){function m(a,b){const c=b?b.id:a&&a.id;this.id=c||0===c?c:fa++;this.init(a,b);Y(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)});Y(this,"length",function(){return this.index.length})}function A(a,b,c,d){this.u!==this.g&&(this.o=this.o.concat(c),this.u++, | ||
d&&this.o.length>=d&&(this.u=this.g),this.u===this.g&&(this.cache&&this.l.set(b,this.o),this.F&&this.F(this.o)));return this}function N(a){const b=w();for(const c in a)if(a.hasOwnProperty(c)){const d=a[c];b[c]=x(d)?d.slice(0):B(d)?N(d):d}return b}function S(a,b){const c=a.length,d=J(b),e=[];for(let g=0,f=0;g<c;g++){const c=a[g];if(d&&b(c)||!d&&!b[c])e[f++]=c}return e}function K(a,b,c,d,e,g,f,l,r,p){c=Z(c,f?0:e,l,g,b,r,p);let q;l&&(l=c.page,q=c.next,c=c.result);if(f)b=this.where(f,null,e,c);else{b= | ||
c;c=this.h;e=b.length;g=Array(e);for(f=0;f<e;f++)g[f]=c[b[f]];b=g}c=b;d&&(J(d)||(E=d.split(":"),1<E.length?d=ha:(E=E[0],d=ia)),c.sort(d));c=O(l,q,c);this.cache&&this.l.set(a,c);return c}function Y(a,b,c){Object.defineProperty(a,b,{get:c})}function h(a){return new RegExp(a,"g")}function L(a,b){for(let c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}function R(a,b,c,d,e,g,f,l){if(b[c])return b[c];e=e?(l-(f||l/1.5))*g+(f||l/1.5)*e:g;b[c]=e;e>=f&&(a=a[l-(e+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]= | ||
d);return e}function W(a,b){if(a){const c=Object.keys(a);for(let d=0,e=c.length;d<e;d++){const e=c[d],f=a[e];if(f)for(let c=0,d=f.length;c<d;c++)if(f[c]===b){1===d?delete a[e]:f.splice(c,1);break}else B(f[c])&&W(f[c],b)}}}function X(a){let b="",c="";var d="";for(let e=0;e<a.length;e++){const g=a[e];if(g!==c)if(e&&"h"===g){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c)&&d||" "===c)b+=g}else b+=g;d=e===a.length-1?"":a[e+1];c=g}return b} | ||
function ja(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function ia(a,b){a=a[E];b=b[E];return a<b?-1:a>b?1:0}function ha(a,b){const c=E.length;for(let d=0;d<c;d++)a=a[E[d]],b=b[E[d]];return a<b?-1:a>b?1:0}function O(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}function Z(a,b,c,d,e,g,f){let l,r=[];if(!0===c){c="0";var p=""}else p=c&&c.split(":");const q=a.length;if(1<q){const U=w(),D=[];let P,I;var n=0,k;let u;var h=!0;let F,G=0,x,y,z,B;p&&(2===p.length?(z=p,p=!1):p=B=parseInt(p[0],10));if(f){for(P= | ||
w();n<q;n++)if("not"===e[n])for(I=a[n],u=I.length,k=0;k<u;k++)P["@"+I[k]]=1;else y=n+1;if(C(y))return O(c,l,r);n=0}else x=H(e)&&e;let A;for(;n<q;n++){const w=n===(y||q)-1;if(!x||!n)if((k=x||e&&e[n])&&"and"!==k)if("or"===k)A=!1;else continue;else A=g=!0;I=a[n];if(u=I.length){if(h)if(F){var t=F.length;for(k=0;k<t;k++){h=F[k];var m="@"+h;f&&P[m]||(U[m]=1,g||(r[G++]=h))}F=null;h=!1}else{F=I;continue}m=!1;for(k=0;k<u;k++){t=I[k];var v="@"+t;const a=g?U[v]||0:n;if(!(!a&&!d||f&&P[v]||!g&&U[v]))if(a===n){if(w){if(!B|| | ||
--B<G)if(r[G++]=t,b&&G===b)return O(c,G+(p||0),r)}else U[v]=n+1;m=!0}else d&&(v=D[a]||(D[a]=[]),v[v.length]=t)}if(A&&!m&&!d)break}else if(A&&!d)return O(c,l,I)}if(F)if(n=F.length,f)for(k=p?parseInt(p,10):0;k<n;k++)a=F[k],P["@"+a]||(r[G++]=a);else r=F;if(d)for(G=r.length,z?(n=parseInt(z[0],10)+1,k=parseInt(z[1],10)+1):(n=D.length,k=0);n--;)if(t=D[n]){for(u=t.length;k<u;k++)if(d=t[k],!f||!P["@"+d])if(r[G++]=d,b&&G===b)return O(c,n+":"+k,r);k=0}}else!q||e&&"not"===e[0]||(r=a[0],p&&(p=parseInt(p[0],10))); | ||
b&&(f=r.length,p&&p>f&&(p=0),p=p||0,l=p+b,l<f?r=r.slice(p,l):(l=0,p&&(r=r.slice(p))));return O(c,l,r)}function H(a){return"string"===typeof a}function x(a){return a.constructor===Array}function J(a){return"function"===typeof a}function B(a){return"object"===typeof a}function C(a){return"undefined"===typeof a}function aa(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=w();return b}function w(){return Object.create(null)}function ka(){let a,b;self.onmessage=function(c){if(c=c.data)if(c.search){const d= | ||
b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold,where:c.where}:c.limit);self.postMessage({id:a,content:c.content,limit:c.limit,result:d})}else c.add?b.add(c.id,c.content):c.update?b.update(c.id,c.content):c.remove?b.remove(c.id):c.clear?b.clear():c.info?(c=b.info(),c.worker=a,console.log(c)):c.register&&(a=c.id,c.options.cache=!1,c.options.async=!1,c.options.worker=!1,b=(new Function(c.register.substring(c.register.indexOf("{")+1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}} | ||
function la(a,b,c,d){a=z("flexsearch","id"+a,ka,function(a){(a=a.data)&&a.result&&d(a.id,a.content,a.result,a.limit,a.where,a.cursor,a.suggest)},b);const e=ea.toString();c.id=b;a.postMessage({register:e,options:c,id:b});return a}const y={encode:"icase",f:"forward",split:/\W+/,cache:!1,async:!1,g:!1,D:!1,a:!1,b:9,threshold:0,depth:0},ba={memory:{encode:"extra",f:"strict",threshold:0,b:1},speed:{encode:"icase",f:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",f:"full",threshold:1,b:3},score:{encode:"extra", | ||
f:"strict",threshold:1,b:9,depth:4},balance:{encode:"balance",f:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase",f:"strict",threshold:8,b:9,depth:1}},V=[];let fa=0;const ca={},da={};m.create=function(a,b){return new m(a,b)};m.registerMatcher=function(a){for(const b in a)a.hasOwnProperty(b)&&V.push(h(b),a[b]);return this};m.registerEncoder=function(a,b){Q[a]=b.bind(Q);return this};m.registerLanguage=function(a,b){ca[a]=b.filter;da[a]=b.stemmer;return this};m.encode=function(a,b){return Q[a](b)}; | ||
m.prototype.init=function(a,b){this.v=[];if(b){var c=b.preset;a=b}else a||(a=y),c=a.preset;b={};H(a)?(b=ba[a],a={}):c&&(b=ba[c]);if(c=a.worker)if("undefined"===typeof Worker)a.worker=!1,this.m=null;else{var d=parseInt(c,10)||4;this.C=-1;this.u=0;this.o=[];this.F=null;this.m=Array(d);for(var e=0;e<d;e++)this.m[e]=la(this.id,e,a,A.bind(this))}this.f=a.tokenize||b.f||this.f||y.f;this.split=a.split||this.split||y.split;this.D=a.rtl||this.D||y.D;this.async="undefined"===typeof Promise||C(c=a.async)?this.async|| | ||
y.async:c;this.g=C(c=a.worker)?this.g||y.g:c;this.threshold=C(c=a.threshold)?b.threshold||this.threshold||y.threshold:c;this.b=C(c=a.resolution)?c=b.b||this.b||y.b:c;c<=this.threshold&&(this.b=this.threshold+1);this.depth="strict"!==this.f||C(c=a.depth)?b.depth||this.depth||y.depth:c;this.w=(c=C(c=a.encode)?b.encode||y.encode:c)&&Q[c]&&Q[c].bind(Q)||(J(c)?c:this.w||!1);(c=a.matcher)&&this.addMatcher(c);if(c=(b=a.lang)||a.filter){H(c)&&(c=ca[c]);if(x(c)){d=this.w;e=w();for(var g=0;g<c.length;g++){var f= | ||
d?d(c[g]):c[g];e[f]=1}c=e}this.filter=c}if(c=b||a.stemmer){var l;b=H(c)?da[c]:c;d=this.w;e=[];for(l in b)b.hasOwnProperty(l)&&(g=d?d(l):l,e.push(h(g+"($|\\W)"),d?d(b[l]):b[l]));this.stemmer=l=e}this.a=e=(c=a.doc)?N(c):this.a||y.a;this.j=aa(this.b-(this.threshold||0));this.i=w();this.c=w();if(e){this.h=w();a.doc=null;l=e.index={};b=e.keys=[];d=e.field;g=e.tag;x(e.id)||(e.id=e.id.split(":"));if(g){this.G=w();f=w();if(d)if(H(d))f[d]=a;else if(x(d))for(let b=0;b<d.length;b++)f[d[b]]=a;else B(d)&&(f=d); | ||
x(g)||(e.tag=g=[g]);for(d=0;d<g.length;d++)this.G[g[d]]=w();this.I=g;d=f}if(d){let c;x(d)||(B(d)?(c=d,e.field=d=Object.keys(d)):e.field=d=[d]);for(e=0;e<d.length;e++)g=d[e],x(g)||(c&&(a=c[g]),b[e]=g,d[e]=g.split(":")),l[g]=new m(a),l[g].h=this.h}}this.B=!0;this.l=(this.cache=c=C(c=a.cache)?this.cache||y.cache:c)?new ma(c):!1;return this};m.prototype.encode=function(a){a&&V.length&&(a=L(a,V));a&&this.v.length&&(a=L(a,this.v));a&&this.w&&(a=this.w(a));a&&this.stemmer&&(a=L(a,this.stemmer));return a}; | ||
m.prototype.addMatcher=function(a){const b=this.v;for(const c in a)a.hasOwnProperty(c)&&b.push(h(c),a[c]);return this};m.prototype.add=function(a,b,c,d,e){if(this.a&&B(a))return this.A("add",a,b);if(b&&H(b)&&(a||0===a)){var g="@"+a;if(this.c[g]&&!d)return this.update(a,b);if(this.g)return++this.C>=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:a,content:b}),this.c[g]=""+this.C,c&&c(),this;if(!e){if(this.async&&"function"!==typeof importScripts){let e=this;g=new Promise(function(c){setTimeout(function(){e.add(a, | ||
b,null,d,!0);e=null;c()})});if(c)g.then(c);else return g;return this}if(c)return this.add(a,b,null,d,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.f;e=J(c)?c(b):b.split(this.split);this.filter&&(e=S(e,this.filter));const n=w();n._ctx=w();const k=e.length,h=this.threshold,m=this.depth,u=this.b,v=this.j,T=this.D;for(let b=0;b<k;b++){var f=e[b];if(f){var l=f.length,r=(T?b+1:k-b)/k,p="";switch(c){case "reverse":case "both":for(var q=l;--q;)p=f[q]+p,R(v,n,p,a,T?1:(l-q)/l,r,h,u-1);p=""; | ||
case "forward":for(q=0;q<l;q++)p+=f[q],R(v,n,p,a,T?(q+1)/l:1,r,h,u-1);break;case "full":for(q=0;q<l;q++){const b=(T?q+1:l-q)/l;for(let c=l;c>q;c--)p=f.substring(q,c),R(v,n,p,a,b,r,h,u-1)}break;default:if(l=R(v,n,f,a,1,r,h,u-1),m&&1<k&&l>=h)for(l=n._ctx[f]||(n._ctx[f]=w()),f=this.i[f]||(this.i[f]=aa(u-(h||0))),r=b-m,p=b+m+1,0>r&&(r=0),p>k&&(p=k);r<p;r++)r!==b&&R(f,l,e[r],a,0,u-(r<b?b-r:r-b),h,u-1)}}}this.c[g]=1;this.B=!1}return this};m.prototype.A=function(a,b,c){if(x(b))for(let d=0,e=b.length;d<e;d++){if(d=== | ||
e-1)return this.A(a,b[d],c);this.A(a,b[d])}else{const h=this.a.index,p=this.a.keys;var d=this.a.tag,e=this.a.id;let q;let n;for(var g=0;g<e.length;g++)q=(q||b)[e[g]];if(d){for(e=0;e<d.length;e++){var f=d[e];var l=f.split(":");for(g=0;g<l.length;g++)n=(n||b)[l[g]];n="@"+n}l=this.G[f];l=l[n]||(l[n]=[])}if("remove"===a){delete this.h[q];for(let a=0,b=p.length;a<b;a++){if(a===b-1)return h[p[a]].remove(q,c),this;h[p[a]].remove(q)}}e=this.a.field;l&&(l[l.length]=b);this.h[q]=b;for(let g=0,l=e.length;g< | ||
l;g++){d=e[g];let k;for(f=0;f<d.length;f++)k=(k||b)[d[f]];d=h[p[g]];f="add"===a?d.add:d.update;g===l-1?f.call(d,q,k,c):f.call(d,q,k)}}return this};m.prototype.update=function(a,b,c){if(this.a&&B(a))return this.A("update",a,b);this.c["@"+a]&&H(b)&&(this.remove(a),this.add(a,b,c,!0));return this};m.prototype.remove=function(a,b,c){if(this.a&&B(a))return this.A("remove",a,b);var d="@"+a;if(this.c[d]){if(this.g)return this.m[this.c[d]].postMessage({remove:!0,id:a}),delete this.c[d],b&&b(),this;if(!c){if(this.async&& | ||
"function"!==typeof importScripts){let c=this;d=new Promise(function(b){setTimeout(function(){c.remove(a,null,!0);c=null;b()})});if(b)d.then(b);else return d;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.b-(this.threshold||0);b++)W(this.j[b],a);this.depth&&W(this.i,a);delete this.c[d];this.B=!1}return this};let E;m.prototype.search=function(a,b,c,d){if(B(b)){if(x(b))for(var e=0;e<b.length;e++)b[e].query=a;else b.query=a;a=b;b=1E3}else b&&J(b)?(c=b,b=1E3):b||0===b||(b=1E3); | ||
let g=[],f=a;let l,h,p;if(B(a)&&!x(a)){c||(c=a.callback)&&(f.callback=null);h=a.sort;l=a.page;b=a.limit;var q=a.threshold;p=a.suggest;a=a.query}if(this.a){q=this.a.index;const r=f.where;var n=f.bool||"or",k=f.field;let D=n;let u,v;if(k)x(k)||(k=[k]);else if(x(f)){var m=f;k=[];D=[];for(var t=0;t<f.length;t++)d=f[t],e=d.bool||n,k[t]=d.field,D[t]=e,"not"===e?u=!0:"and"===e&&(v=!0)}else k=this.a.keys;n=k.length;for(t=0;t<n;t++)m&&(f=m[t]),l&&!H(f)&&(f.page=null,f.limit=0),g[t]=q[k[t]].search(f,0);if(c)return c(K.call(this, | ||
a,D,g,h,b,p,r,l,v,u));if(this.async){const c=this;return new Promise(function(d){Promise.all(g).then(function(e){d(K.call(c,a,D,e,h,b,p,r,l,v,u))})})}return K.call(this,a,D,g,h,b,p,r,l,v,u)}q||(q=this.threshold||0);if(this.g)for(this.F=c,this.u=0,this.o=[],k=0;k<this.g;k++)this.m[k].postMessage({search:!0,limit:b,cursor:l,threshold:q,content:a});else{if(!d){if(this.async&&"function"!==typeof importScripts){let a=this;q=new Promise(function(c){setTimeout(function(){c(a.search(f,b,null,!0));a=null})}); | ||
if(c)q.then(c);else return q;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!H(a))return g;f=a;if(this.cache)if(this.B){if(c=this.l.get(a))return c}else this.l.clear(),this.B=!0;f=this.encode(f);if(!f.length)return g;c=this.f;c=J(c)?c(f):f.split(this.split);this.filter&&(c=S(c,this.filter));m=c.length;d=!0;e=[];var u=w(),v=0;1<m&&(this.depth&&"strict"===this.f?n=!0:c.sort(ja));if(!n||(t=this.i)){const a=this.b;for(;v<m;v++){let b=c[v];if(b){if(n){if(!k)if(t[b])k=b,u[b]=1;else if(!p)return g; | ||
if(p&&v===m-1&&!e.length)n=!1,b=k||b,u[b]=0;else if(!k)continue}if(!u[b]){const c=[];let f=!1,g=0;const l=n?t[k]:this.j;if(l){let d;for(let e=0;e<a-q;e++)if(d=l[e]&&l[e][b])c[g++]=d,f=!0}if(f)k=b,e[e.length]=1<g?c.concat.apply([],c):c[0];else if(!p){d=!1;break}u[b]=1}}}}else d=!1;d&&(g=Z(e,b,l,p));this.cache&&this.l.set(a,g);return g}};m.prototype.find=function(a,b){return this.where(a,b,1)[0]||null};m.prototype.where=function(a,b,c,d){const e=this.h,g=[];let f=0;let l;var h;let p;if(B(a)){c||(c= | ||
b);var q=Object.keys(a);var n=q.length;l=!1;if(1===n&&"id"===q[0])return[e[a.id]];if((h=this.I)&&!d)for(var k=0;k<h.length;k++){var m=h[k],t=a[m];if(!C(t)){p=this.G[m]["@"+t];if(0===--n)return p;q.splice(q.indexOf(m),1);delete a[m];break}}h=Array(n);for(k=0;k<n;k++)h[k]=q[k].split(":")}else{if(J(a)){b=d||Object.keys(e);c=b.length;for(q=0;q<c;q++)n=e[b[q]],a(n)&&(g[f++]=n);return g}if(C(b))return[e[a]];if("id"===a)return[e[b]];q=[a];n=1;h=[a.split(":")];l=!0}d=p||d||Object.keys(e);k=d.length;for(m= | ||
0;m<k;m++){t=p?d[m]:e[d[m]];let k=!0;for(let c=0;c<n;c++){l||(b=a[q[c]]);const d=h[c],e=d.length;let f=t;if(1<e)for(let a=0;a<e;a++)f=f[d[a]];else f=f[d[0]];if(f!==b){k=!1;break}}if(k&&(g[f++]=t,c&&f===c))break}return g};m.prototype.info=function(){if(this.g)for(let a=0;a<this.g;a++)this.m[a].postMessage({info:!0,id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.s?this.cache.s.length:!1,matcher:V.length+(this.v?this.v.length:0),worker:this.g,threshold:this.threshold, | ||
depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.f}};m.prototype.clear=function(){return this.destroy().init()};m.prototype.destroy=function(){this.cache&&(this.l.clear(),this.l=null);this.j=this.i=this.c=null;if(this.a){const a=this.a.keys;for(let b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.h=null}return this};m.prototype.export=function(){let a;if(this.a){const b=this.a.keys;a=Array(b.length+1);let c=0;for(;c<b.length;c++){const d=this.a.index[b[c]];a[c]= | ||
[d.j,d.i,Object.keys(d.c)]}a[c]=this.h}else a=[this.j,this.i,Object.keys(this.c)];return JSON.stringify(a)};m.prototype.import=function(a){a=JSON.parse(a);const b=w();if(this.a){var c=this.a.keys,d=c.length,e=a[0][2];for(var g=0;g<e.length;g++)b[e[g]]=1;for(e=0;e<d;e++)g=this.a.index[c[e]],g.j=a[e][0],g.i=a[e][1],g.c=b,g.h=a[d];this.h=a[d]}else{c=a[2];for(d=0;d<c.length;d++)b[c[d]]=1;this.j=a[0];this.i=a[1];this.c=b}};const Q={icase:function(a){return a.toLowerCase()},simple:function(){const a=[h("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), | ||
"a",h("[\u00e8\u00e9\u00ea\u00eb]"),"e",h("[\u00ec\u00ed\u00ee\u00ef]"),"i",h("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",h("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",h("[\u00fd\u0177\u00ff]"),"y",h("\u00f1"),"n",h("\u00e7"),"c",h("\u00df"),"s",h(" & ")," and ",h("[-/]")," ",h("[^a-z0-9 ]"),"",h("\\s+")," "];return function(b){b=L(b.toLowerCase(),a);return" "===b?"":b}}(),advanced:function(){const a=[h("ae"),"a",h("ai"),"ei",h("ay"),"ei",h("ey"),"ei",h("oe"),"o",h("ue"),"u",h("ie"),"i",h("sz"),"s", | ||
h("zs"),"s",h("sh"),"s",h("ck"),"k",h("cc"),"k",h("dt"),"t",h("ph"),"f",h("pf"),"f",h("ou"),"o",h("uo"),"u"];return function(b,c){if(!b)return b;b=this.simple(b);2<b.length&&(b=L(b,a));c||1<b.length&&(b=X(b));return b}}(),extra:function(){const a=[h("p"),"b",h("z"),"s",h("[cgq]"),"k",h("n"),"m",h("d"),"t",h("[vw]"),"f",h("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let c=0;c<b.length;c++){const d=b[c];1<d.length&&(b[c]=d[0]+L(d.substring(1), | ||
a))}b=b.join(" ");b=X(b)}return b}}(),balance:function(){const a=[h("[-/]")," ",h("[^a-z0-9 ]"),"",h("\\s+")," "];return function(b){return X(L(b.toLowerCase(),a))}}()},ma=function(){function a(a){this.clear();this.H=!0!==a&&a}a.prototype.clear=function(){this.cache=w();this.count=w();this.index=w();this.s=[]};a.prototype.set=function(a,c){if(this.H&&C(this.cache[a])){let b=this.s.length;if(b===this.H){b--;const a=this.s[b];delete this.cache[a];delete this.count[a];delete this.index[a]}this.index[a]= | ||
b;this.s[b]=a;this.count[a]=-1;this.cache[a]=c;this.get(a)}else this.cache[a]=c};a.prototype.get=function(a){const b=this.cache[a];if(this.H&&b){var d=++this.count[a];const b=this.index;let c=b[a];if(0<c){const f=this.s;for(var e=c;this.count[f[--c]]<=d&&-1!==c;);c++;if(c!==e){for(d=e;d>c;d--)e=f[d-1],f[d]=e,b[e]=d;f[c]=a;b[a]=c}}}return b};return a}();return m}(function(){const z={},M="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(m,A,N,S,K){N=M?URL.createObjectURL(new Blob(["("+ | ||
N.toString()+")()"],{type:"text/javascript"})):m+".min.js";m+="-"+A;z[m]||(z[m]=[]);z[m][K]=new Worker(N);z[m][K].onmessage=S;return z[m][K]}}()),this); |
/* | ||
FlexSearch v0.6.2 | ||
FlexSearch v0.6.21 | ||
Copyright 2019 Nextapps GmbH | ||
@@ -8,30 +8,31 @@ Author: Thomas Wilkerling | ||
*/ | ||
'use strict';(function(m,H,I){let z;(z=I.define)&&z.amd?z([],function(){return H}):(z=I.modules)?z[m.toLowerCase()]=H:"object"===typeof exports?module.exports=H:I[m]=H})("FlexSearch",function(){function m(a,b){const c=b?b.id:a&&a.id;this.id=c||0===c?c:aa++;this.init(a,b);z(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].f):Object.keys(this.f)});z(this,"length",function(){return this.index.length})}function H(a,b){const c=a.length,d=J(b),e=[];for(let g=0,f=0;g<c;g++){const c= | ||
a[g];if(d&&b(c)||!d&&!b[c])e[f++]=c}return e}function I(a,b,c,d,e,g,f,k,r,p){c=V(c,f?0:e,k,g,b,r,p);let q;k&&(k=c.page,q=c.next,c=c.result);if(f)b=this.where(f,null,e,c);else{b=c;c=this.g;e=b.length;g=Array(e);for(f=0;f<e;f++)g[f]=c[b[f]];b=g}c=b;d&&(J(d)||(y=d.split(":"),1<y.length?d=ba:(y=y[0],d=ca)),c.sort(d));c=L(k,q,c);this.cache&&this.j.set(a,c);return c}function z(a,b,c){Object.defineProperty(a,b,{get:c})}function h(a){return new RegExp(a,"g")}function K(a,b){for(let c=0;c<b.length;c+=2)a= | ||
a.replace(b[c],b[c+1]);return a}function P(a,b,c,d,e,g,f,k){if(b[c])return b[c];e=e?(k-(f||k/1.5))*g+(f||k/1.5)*e:g;b[c]=e;e>=f&&(a=a[k-(e+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=d);return e}function T(a,b){if(a){const c=Object.keys(a);for(let d=0,e=c.length;d<e;d++){const e=c[d],f=a[e];if(f)for(let c=0,d=f.length;c<d;c++)if(f[c]===b){1===d?delete a[e]:f.splice(c,1);break}else A(f[c])&&T(f[c],b)}}}function U(a){let b="",c="";var d="";for(let e=0;e<a.length;e++){const g=a[e];if(g!==c)if(e&&"h"===g){if(d= | ||
"a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c)&&d||" "===c)b+=g}else b+=g;d=e===a.length-1?"":a[e+1];c=g}return b}function da(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function ca(a,b){a=a[y];b=b[y];return a<b?-1:a>b?1:0}function ba(a,b){const c=y.length;for(let d=0;d<c;d++)a=a[y[d]],b=b[y[d]];return a<b?-1:a>b?1:0}function L(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}function V(a,b,c,d,e,g,f){let k,r=[];if(!0===c){c="0";var p= | ||
""}else p=c&&c.split(":");const q=a.length;if(1<q){const R=u();let B=[],M,G;var n=0,l;let N;var h=!0;let D,E=0,x,w,y,A;p&&(2===p.length?(y=p,p=!1):p=A=parseInt(p[0],10));if(f){for(M=u();n<q;n++)if("not"===e[n])for(G=a[n],N=G.length,l=0;l<N;l++)M["@"+G[l]]=1;else w=n+1;if(C(w))return L(c,k,r);n=0}else x=F(e)&&e;let z;for(;n<q;n++){const u=n===(w||q)-1;if(!x||!n)if((l=x||e&&e[n])&&"and"!==l)if("or"===l)z=!1;else continue;else z=g=!0;G=a[n];if(N=G.length){if(h)if(D){var t=D.length;for(l=0;l<t;l++){h= | ||
D[l];var m="@"+h;f&&M[m]||(R[m]=1,g||(r[E++]=h))}D=null;h=!1}else{D=G;continue}m=!1;for(l=0;l<N;l++){t=G[l];var v="@"+t;const a=g?R[v]||0:n;if(!(!a&&!d||f&&M[v]||!g&&R[v]))if(a===n){if(u){if(!A||--A<E)if(r[E++]=t,b&&E===b)return L(c,E+(p||0),r)}else R[v]=n+1;m=!0}else d&&(v=B[a]||(B[a]=[]),v[v.length]=t)}if(z&&!m&&!d)break}else if(z&&!d)return L(c,k,G)}if(D)if(n=D.length,f)for(l=p?parseInt(p,10):0;l<n;l++)a=D[l],M["@"+a]||(r[E++]=a);else r=D;if(d)for(E=r.length,y?(n=parseInt(y[0],10)+1,l=parseInt(y[1], | ||
10)+1):(n=B.length,l=0);n--;)if(t=B[n]){for(N=t.length;l<N;l++)if(d=t[l],!f||!M["@"+d])if(r[E++]=d,b&&E===b)return L(c,n+":"+l,r);l=0}}else!q||e&&"not"===e[0]||(r=a[0],p&&(p=parseInt(p[0],10)));b&&(f=r.length,p&&p>f&&(p=0),p=p||0,k=p+b,k<f?r=r.slice(p,k):(k=0,p&&(r=r.slice(p))));return L(c,k,r)}function F(a){return"string"===typeof a}function x(a){return a.constructor===Array}function J(a){return"function"===typeof a}function A(a){return"object"===typeof a}function C(a){return"undefined"===typeof a} | ||
function W(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=u();return b}function u(){return Object.create(null)}const w={encode:"icase",c:"forward",split:/\W+/,cache:!1,async:!1,C:!1,v:!1,a:!1,b:9,threshold:0,depth:0},X={memory:{encode:"extra",c:"strict",threshold:0,b:1},speed:{encode:"icase",c:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",c:"full",threshold:1,b:3},score:{encode:"extra",c:"strict",threshold:1,b:9,depth:4},balance:{encode:"balance",c:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase", | ||
c:"strict",threshold:8,b:9,depth:1}},S=[];let aa=0;const Y={},Z={};m.create=function(a,b){return new m(a,b)};m.registerMatcher=function(a){for(const b in a)a.hasOwnProperty(b)&&S.push(h(b),a[b]);return this};m.registerEncoder=function(a,b){O[a]=b.bind(O);return this};m.registerLanguage=function(a,b){Y[a]=b.filter;Z[a]=b.stemmer;return this};m.encode=function(a,b){return O[a](b)};m.prototype.init=function(a,b){this.m=[];if(b){var c=b.preset;a=b}else a||(a=w),c=a.preset;b={};F(a)?(b=X[a],a={}):c&&(b= | ||
X[c]);this.c=a.tokenize||b.c||this.c||w.c;this.split=a.split||this.split||w.split;this.v=a.rtl||this.v||w.v;this.async="undefined"===typeof Promise||C(c=a.async)?this.async||w.async:c;this.threshold=C(c=a.threshold)?b.threshold||this.threshold||w.threshold:c;this.b=C(c=a.resolution)?c=b.b||this.b||w.b:c;c<=this.threshold&&(this.b=this.threshold+1);this.depth="strict"!==this.c||C(c=a.depth)?b.depth||this.depth||w.depth:c;this.o=(c=C(c=a.encode)?b.encode||w.encode:c)&&O[c]&&O[c].bind(O)||(J(c)?c:this.o|| | ||
!1);(c=a.matcher)&&this.addMatcher(c);if(c=(b=a.lang)||a.filter){F(c)&&(c=Y[c]);if(x(c)){var d=this.o,e=u();for(var g=0;g<c.length;g++){var f=d?d(c[g]):c[g];e[f]=1}c=e}this.filter=c}if(c=b||a.stemmer){var k;b=F(c)?Z[c]:c;d=this.o;e=[];for(k in b)b.hasOwnProperty(k)&&(g=d?d(k):k,e.push(h(g+"($|\\W)"),d?d(b[k]):b[k]));this.stemmer=k=e}this.a=e=(c=a.doc)?c:this.a||w.a;this.i=W(this.b-(this.threshold||0));this.h=u();this.f=u();if(e){this.g=u();a.doc=null;k=e.index={};b=e.keys=[];d=e.field;g=e.tag;x(e.id)|| | ||
(e.id=e.id.split(":"));if(g){this.w=u();f=u();if(d)if(F(d))f[d]=a;else if(x(d))for(let b=0;b<d.length;b++)f[d[b]]=a;else A(d)&&(f=d);x(g)||(e.tag=g=[g]);for(d=0;d<g.length;d++)this.w[g[d]]=u();this.B=g;d=f}if(d){let c;x(d)||(A(d)?(c=d,e.field=d=Object.keys(d)):e.field=d=[d]);for(e=0;e<d.length;e++)g=d[e],x(g)||(c&&(a=c[g]),b[e]=g,d[e]=g.split(":")),k[g]=new m(a),k[g].g=this.g}}this.u=!0;this.j=(this.cache=c=C(c=a.cache)?this.cache||w.cache:c)?new ea(c):!1;return this};m.prototype.encode=function(a){a&& | ||
S.length&&(a=K(a,S));a&&this.m.length&&(a=K(a,this.m));a&&this.o&&(a=this.o(a));a&&this.stemmer&&(a=K(a,this.stemmer));return a};m.prototype.addMatcher=function(a){const b=this.m;for(const c in a)a.hasOwnProperty(c)&&b.push(h(c),a[c]);return this};m.prototype.add=function(a,b,c,d,e){if(this.a&&A(a))return this.s("add",a,b);if(b&&F(b)&&(a||0===a)){var g="@"+a;if(this.f[g]&&!d)return this.update(a,b);if(!e){if(this.async){let e=this;g=new Promise(function(c){setTimeout(function(){e.add(a,b,null,d,!0); | ||
e=null;c()})});if(c)g.then(c);else return g;return this}if(c)return this.add(a,b,null,d,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.c;e=J(c)?c(b):b.split(this.split);this.filter&&(e=H(e,this.filter));const n=u();n._ctx=u();const l=e.length,h=this.threshold,t=this.depth,m=this.b,v=this.i,Q=this.v;for(let b=0;b<l;b++){var f=e[b];if(f){var k=f.length,r=(Q?b+1:l-b)/l,p="";switch(c){case "reverse":case "both":for(var q=k;--q;)p=f[q]+p,P(v,n,p,a,Q?1:(k-q)/k,r,h,m-1);p="";case "forward":for(q= | ||
0;q<k;q++)p+=f[q],P(v,n,p,a,Q?(q+1)/k:1,r,h,m-1);break;case "full":for(q=0;q<k;q++){const b=(Q?q+1:k-q)/k;for(let c=k;c>q;c--)p=f.substring(q,c),P(v,n,p,a,b,r,h,m-1)}break;default:if(k=P(v,n,f,a,1,r,h,m-1),t&&1<l&&k>=h)for(k=n._ctx[f]||(n._ctx[f]=u()),f=this.h[f]||(this.h[f]=W(m-(h||0))),r=b-t,p=b+t+1,0>r&&(r=0),p>l&&(p=l);r<p;r++)r!==b&&P(f,k,e[r],a,0,m-(r<b?b-r:r-b),h,m-1)}}}this.f[g]=1;this.u=!1}return this};m.prototype.s=function(a,b,c){if(x(b))for(let d=0,e=b.length;d<e;d++){if(d===e-1)return this.s(a, | ||
b[d],c);this.s(a,b[d])}else{const h=this.a.index,p=this.a.keys;var d=this.a.tag,e=this.a.id;let q;let n;for(var g=0;g<e.length;g++)q=(q||b)[e[g]];if(d){for(e=0;e<d.length;e++){var f=d[e];var k=f.split(":");for(g=0;g<k.length;g++)n=(n||b)[k[g]];n="@"+n}k=this.w[f];k=k[n]||(k[n]=[])}if("remove"===a){delete this.g[q];for(let b=0,a=p.length;b<a;b++){if(b===a-1)return h[p[b]].remove(q,c),this;h[p[b]].remove(q)}}e=this.a.field;k&&(k[k.length]=b);this.g[q]=b;for(let g=0,k=e.length;g<k;g++){d=e[g];let l; | ||
for(f=0;f<d.length;f++)l=(l||b)[d[f]];d=h[p[g]];f="add"===a?d.add:d.update;g===k-1?f.call(d,q,l,c):f.call(d,q,l)}}return this};m.prototype.update=function(a,b,c){if(this.a&&A(a))return this.s("update",a,b);this.f["@"+a]&&F(b)&&(this.remove(a),this.add(a,b,c,!0));return this};m.prototype.remove=function(a,b,c){if(this.a&&A(a))return this.s("remove",a,b);var d="@"+a;if(this.f[d]){if(!c){if(this.async&&"function"!==typeof importScripts){let c=this;d=new Promise(function(b){setTimeout(function(){c.remove(a, | ||
null,!0);c=null;b()})});if(b)d.then(b);else return d;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.b-(this.threshold||0);b++)T(this.i[b],a);this.depth&&T(this.h,a);delete this.f[d];this.u=!1}return this};let y;m.prototype.search=function(a,b,c,d){if(A(b)){if(x(b))for(var e=0;e<b.length;e++)b[e].query=a;else b.query=a;a=b;b=1E3}else b&&J(b)?(c=b,b=1E3):b||0===b||(b=1E3);let g=[],f=a;let k,h,p;if(A(a)&&!x(a)){c||(c=a.callback)&&(f.callback=null);h=a.sort;k=a.page;b=a.limit; | ||
var q=a.threshold;p=a.suggest;a=a.query}if(this.a){q=this.a.index;const r=f.where;var n=f.bool||"or",l=f.field;let B=n;let v,u;if(l)x(l)||(l=[l]);else if(x(f)){var m=f;l=[];B=[];for(var t=0;t<f.length;t++)d=f[t],e=d.bool||n,l[t]=d.field,B[t]=e,"not"===e?v=!0:"and"===e&&(u=!0)}else l=this.a.keys;n=l.length;for(t=0;t<n;t++)m&&(f=m[t]),k&&!F(f)&&(f.page=null,f.limit=0),g[t]=q[l[t]].search(f,0);if(c)return c(I.call(this,a,B,g,h,b,p,r,k,u,v));if(this.async){const c=this;return new Promise(function(d){Promise.all(g).then(function(e){d(I.call(c, | ||
a,B,e,h,b,p,r,k,u,v))})})}return I.call(this,a,B,g,h,b,p,r,k,u,v)}q||(q=this.threshold||0);if(!d){if(this.async&&"function"!==typeof importScripts){let a=this;q=new Promise(function(c){setTimeout(function(){c(a.search(f,b,null,!0));a=null})});if(c)q.then(c);else return q;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!F(a))return g;f=a;if(this.cache)if(this.u){if(c=this.j.get(a))return c}else this.j.clear(),this.u=!0;f=this.encode(f);if(!f.length)return g;c=this.c;c=J(c)?c(f):f.split(this.split); | ||
this.filter&&(c=H(c,this.filter));m=c.length;d=!0;e=[];const w=u();let v=0;1<m&&(this.depth&&"strict"===this.c?n=!0:c.sort(da));if(!n||(t=this.h)){const b=this.b;for(;v<m;v++){let a=c[v];if(a){if(n){if(!l)if(t[a])l=a,w[a]=1;else if(!p)return g;if(p&&v===m-1&&!e.length)n=!1,a=l||a,w[a]=0;else if(!l)continue}if(!w[a]){const c=[];let f=!1,g=0;const k=n?t[l]:this.i;if(k){let d;for(let e=0;e<b-q;e++)if(d=k[e][a])c[g++]=d,f=!0}if(f)l=a,e[e.length]=1<g?c.concat.apply([],c):c[0];else if(!p){d=!1;break}w[a]= | ||
1}}}}else d=!1;d&&(g=V(e,b,k,p));this.cache&&this.j.set(a,g);return g};m.prototype.find=function(a,b){return this.where(a,b,1)[0]||null};m.prototype.where=function(a,b,c,d){const e=this.g,g=[];let f=0;let k;var h;let p;if(A(a)){c||(c=b);var q=Object.keys(a);var n=q.length;k=!1;if(1===n&&"id"===q[0])return[e[a.id]];if((h=this.B)&&!d)for(var l=0;l<h.length;l++){var m=h[l],t=a[m];if(!C(t)){p=this.w[m]["@"+t];if(0===--n)return p;q.splice(q.indexOf(m),1);delete a[m];break}}h=Array(n);for(l=0;l<n;l++)h[l]= | ||
q[l].split(":")}else{if(J(a)){b=d||Object.keys(e);c=b.length;for(q=0;q<c;q++)n=e[b[q]],a(n)&&(g[f++]=n);return g}if(C(b))return[e[a]];if("id"===a)return[e[b]];q=[a];n=1;h=[a.split(":")];k=!0}d=p||d||Object.keys(e);l=d.length;for(m=0;m<l;m++){t=p?d[m]:e[d[m]];let l=!0;for(let c=0;c<n;c++){k||(b=a[q[c]]);const d=h[c],e=d.length;let f=t;if(1<e)for(let a=0;a<e;a++)f=f[d[a]];else f=f[d[0]];if(f!==b){l=!1;break}}if(l&&(g[f++]=t,c&&f===c))break}return g};m.prototype.info=function(){return{id:this.id,items:this.length, | ||
cache:this.cache&&this.cache.l?this.cache.l.length:!1,matcher:S.length+(this.m?this.m.length:0),worker:this.C,threshold:this.threshold,depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.c}};m.prototype.clear=function(){return this.destroy().init()};m.prototype.destroy=function(){this.cache&&(this.j.clear(),this.j=null);this.i=this.h=this.f=null;if(this.a){const a=this.a.keys;for(let b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.g=null}return this};m.prototype.export= | ||
function(){let a;if(this.a){const b=this.a.keys;a=Array(b.length+1);let c=0;for(;c<b.length;c++){const d=this.a.index[b[c]];a[c]=[d.i,d.h,Object.keys(d.f)]}a[c]=this.g}else a=[this.i,this.h,Object.keys(this.f)];return JSON.stringify(a)};m.prototype.import=function(a){a=JSON.parse(a);const b=u();if(this.a){var c=this.a.keys,d=c.length,e=a[0][2];for(var g=0;g<e.length;g++)b[e[g]]=1;for(e=0;e<d;e++)g=this.a.index[c[e]],g.i=a[e][0],g.h=a[e][1],g.f=b,g.g=a[d];this.g=a[d]}else{c=a[2];for(d=0;d<c.length;d++)b[c[d]]= | ||
1;this.i=a[0];this.h=a[1];this.f=b}};const O={icase:function(a){return a.toLowerCase()},simple:function(){const a=[h("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",h("[\u00e8\u00e9\u00ea\u00eb]"),"e",h("[\u00ec\u00ed\u00ee\u00ef]"),"i",h("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",h("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",h("[\u00fd\u0177\u00ff]"),"y",h("\u00f1"),"n",h("\u00e7"),"c",h("\u00df"),"s",h(" & ")," and ",h("[-/]")," ",h("[^a-z0-9 ]"),"",h("\\s+")," "];return function(b){b=K(b.toLowerCase(), | ||
a);return" "===b?"":b}}(),advanced:function(){const a=[h("ae"),"a",h("ai"),"ei",h("ay"),"ei",h("ey"),"ei",h("oe"),"o",h("ue"),"u",h("ie"),"i",h("sz"),"s",h("zs"),"s",h("sh"),"s",h("ck"),"k",h("cc"),"k",h("dt"),"t",h("ph"),"f",h("pf"),"f",h("ou"),"o",h("uo"),"u"];return function(b,c){if(!b)return b;b=this.simple(b);2<b.length&&(b=K(b,a));c||1<b.length&&(b=U(b));return b}}(),extra:function(){const a=[h("p"),"b",h("z"),"s",h("[cgq]"),"k",h("n"),"m",h("d"),"t",h("[vw]"),"f",h("[aeiouy]"),""];return function(b){if(!b)return b; | ||
b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let c=0;c<b.length;c++){const d=b[c];1<d.length&&(b[c]=d[0]+K(d.substring(1),a))}b=b.join(" ");b=U(b)}return b}}(),balance:function(){const a=[h("[-/]")," ",h("[^a-z0-9 ]"),"",h("\\s+")," "];return function(b){return U(K(b.toLowerCase(),a))}}()},ea=function(){function a(a){this.clear();this.A=!0!==a&&a}a.prototype.clear=function(){this.cache=u();this.count=u();this.index=u();this.l=[]};a.prototype.set=function(a,c){if(this.A&&C(this.cache[a])){let b= | ||
this.l.length;if(b===this.A){b--;const a=this.l[b];delete this.cache[a];delete this.count[a];delete this.index[a]}this.index[a]=b;this.l[b]=a;this.count[a]=-1;this.cache[a]=c;this.get(a)}else this.cache[a]=c};a.prototype.get=function(a){const b=this.cache[a];if(this.A&&b){var d=++this.count[a];const b=this.index;let c=b[a];if(0<c){const f=this.l;for(var e=c;this.count[f[--c]]<=d&&-1!==c;);c++;if(c!==e){for(d=e;d>c;d--)e=f[d-1],f[d]=e,b[e]=d;f[c]=a;b[a]=c}}}return b};return a}();return m}(!1),this); | ||
'use strict';(function(m,H,K){let A;(A=K.define)&&A.amd?A([],function(){return H}):(A=K.modules)?A[m.toLowerCase()]=H:"object"===typeof exports?module.exports=H:K[m]=H})("FlexSearch",function(){function m(a,b){const c=b?b.id:a&&a.id;this.id=c||0===c?c:ba++;this.init(a,b);V(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].f):Object.keys(this.f)});V(this,"length",function(){return this.index.length})}function H(a){const b=u();for(const c in a)if(a.hasOwnProperty(c)){const d= | ||
a[c];b[c]=x(d)?d.slice(0):y(d)?H(d):d}return b}function K(a,b){const c=a.length,d=I(b),e=[];for(let g=0,f=0;g<c;g++){const c=a[g];if(d&&b(c)||!d&&!b[c])e[f++]=c}return e}function A(a,b,c,d,e,g,f,k,r,p){c=W(c,f?0:e,k,g,b,r,p);let q;k&&(k=c.page,q=c.next,c=c.result);if(f)b=this.where(f,null,e,c);else{b=c;c=this.g;e=b.length;g=Array(e);for(f=0;f<e;f++)g[f]=c[b[f]];b=g}c=b;d&&(I(d)||(z=d.split(":"),1<z.length?d=ca:(z=z[0],d=da)),c.sort(d));c=L(k,q,c);this.cache&&this.j.set(a,c);return c}function V(a, | ||
b,c){Object.defineProperty(a,b,{get:c})}function h(a){return new RegExp(a,"g")}function J(a,b){for(let c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}function P(a,b,c,d,e,g,f,k){if(b[c])return b[c];e=e?(k-(f||k/1.5))*g+(f||k/1.5)*e:g;b[c]=e;e>=f&&(a=a[k-(e+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=d);return e}function T(a,b){if(a){const c=Object.keys(a);for(let d=0,e=c.length;d<e;d++){const e=c[d],f=a[e];if(f)for(let c=0,d=f.length;c<d;c++)if(f[c]===b){1===d?delete a[e]:f.splice(c,1);break}else y(f[c])&& | ||
T(f[c],b)}}}function U(a){let b="",c="";var d="";for(let e=0;e<a.length;e++){const g=a[e];if(g!==c)if(e&&"h"===g){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===c||"e"===c||"i"===c||"o"===c||"u"===c||"y"===c)&&d||" "===c)b+=g}else b+=g;d=e===a.length-1?"":a[e+1];c=g}return b}function ea(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function da(a,b){a=a[z];b=b[z];return a<b?-1:a>b?1:0}function ca(a,b){const c=z.length;for(let d=0;d<c;d++)a=a[z[d]],b=b[z[d]];return a<b?-1:a>b?1:0}function L(a, | ||
b,c){return a?{page:a,next:b?""+b:null,result:c}:c}function W(a,b,c,d,e,g,f){let k,r=[];if(!0===c){c="0";var p=""}else p=c&&c.split(":");const q=a.length;if(1<q){const R=u(),B=[];let M,G;var n=0,l;let N;var h=!0;let D,E=0,x,w,y,A;p&&(2===p.length?(y=p,p=!1):p=A=parseInt(p[0],10));if(f){for(M=u();n<q;n++)if("not"===e[n])for(G=a[n],N=G.length,l=0;l<N;l++)M["@"+G[l]]=1;else w=n+1;if(C(w))return L(c,k,r);n=0}else x=F(e)&&e;let z;for(;n<q;n++){const u=n===(w||q)-1;if(!x||!n)if((l=x||e&&e[n])&&"and"!== | ||
l)if("or"===l)z=!1;else continue;else z=g=!0;G=a[n];if(N=G.length){if(h)if(D){var t=D.length;for(l=0;l<t;l++){h=D[l];var m="@"+h;f&&M[m]||(R[m]=1,g||(r[E++]=h))}D=null;h=!1}else{D=G;continue}m=!1;for(l=0;l<N;l++){t=G[l];var v="@"+t;const a=g?R[v]||0:n;if(!(!a&&!d||f&&M[v]||!g&&R[v]))if(a===n){if(u){if(!A||--A<E)if(r[E++]=t,b&&E===b)return L(c,E+(p||0),r)}else R[v]=n+1;m=!0}else d&&(v=B[a]||(B[a]=[]),v[v.length]=t)}if(z&&!m&&!d)break}else if(z&&!d)return L(c,k,G)}if(D)if(n=D.length,f)for(l=p?parseInt(p, | ||
10):0;l<n;l++)a=D[l],M["@"+a]||(r[E++]=a);else r=D;if(d)for(E=r.length,y?(n=parseInt(y[0],10)+1,l=parseInt(y[1],10)+1):(n=B.length,l=0);n--;)if(t=B[n]){for(N=t.length;l<N;l++)if(d=t[l],!f||!M["@"+d])if(r[E++]=d,b&&E===b)return L(c,n+":"+l,r);l=0}}else!q||e&&"not"===e[0]||(r=a[0],p&&(p=parseInt(p[0],10)));b&&(f=r.length,p&&p>f&&(p=0),p=p||0,k=p+b,k<f?r=r.slice(p,k):(k=0,p&&(r=r.slice(p))));return L(c,k,r)}function F(a){return"string"===typeof a}function x(a){return a.constructor===Array}function I(a){return"function"=== | ||
typeof a}function y(a){return"object"===typeof a}function C(a){return"undefined"===typeof a}function X(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=u();return b}function u(){return Object.create(null)}const w={encode:"icase",c:"forward",split:/\W+/,cache:!1,async:!1,C:!1,v:!1,a:!1,b:9,threshold:0,depth:0},Y={memory:{encode:"extra",c:"strict",threshold:0,b:1},speed:{encode:"icase",c:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",c:"full",threshold:1,b:3},score:{encode:"extra",c:"strict",threshold:1, | ||
b:9,depth:4},balance:{encode:"balance",c:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase",c:"strict",threshold:8,b:9,depth:1}},S=[];let ba=0;const Z={},aa={};m.create=function(a,b){return new m(a,b)};m.registerMatcher=function(a){for(const b in a)a.hasOwnProperty(b)&&S.push(h(b),a[b]);return this};m.registerEncoder=function(a,b){O[a]=b.bind(O);return this};m.registerLanguage=function(a,b){Z[a]=b.filter;aa[a]=b.stemmer;return this};m.encode=function(a,b){return O[a](b)};m.prototype.init=function(a, | ||
b){this.m=[];if(b){var c=b.preset;a=b}else a||(a=w),c=a.preset;b={};F(a)?(b=Y[a],a={}):c&&(b=Y[c]);this.c=a.tokenize||b.c||this.c||w.c;this.split=a.split||this.split||w.split;this.v=a.rtl||this.v||w.v;this.async="undefined"===typeof Promise||C(c=a.async)?this.async||w.async:c;this.threshold=C(c=a.threshold)?b.threshold||this.threshold||w.threshold:c;this.b=C(c=a.resolution)?c=b.b||this.b||w.b:c;c<=this.threshold&&(this.b=this.threshold+1);this.depth="strict"!==this.c||C(c=a.depth)?b.depth||this.depth|| | ||
w.depth:c;this.o=(c=C(c=a.encode)?b.encode||w.encode:c)&&O[c]&&O[c].bind(O)||(I(c)?c:this.o||!1);(c=a.matcher)&&this.addMatcher(c);if(c=(b=a.lang)||a.filter){F(c)&&(c=Z[c]);if(x(c)){var d=this.o,e=u();for(var g=0;g<c.length;g++){var f=d?d(c[g]):c[g];e[f]=1}c=e}this.filter=c}if(c=b||a.stemmer){var k;b=F(c)?aa[c]:c;d=this.o;e=[];for(k in b)b.hasOwnProperty(k)&&(g=d?d(k):k,e.push(h(g+"($|\\W)"),d?d(b[k]):b[k]));this.stemmer=k=e}this.a=e=(c=a.doc)?H(c):this.a||w.a;this.i=X(this.b-(this.threshold||0)); | ||
this.h=u();this.f=u();if(e){this.g=u();a.doc=null;k=e.index={};b=e.keys=[];d=e.field;g=e.tag;x(e.id)||(e.id=e.id.split(":"));if(g){this.w=u();f=u();if(d)if(F(d))f[d]=a;else if(x(d))for(let b=0;b<d.length;b++)f[d[b]]=a;else y(d)&&(f=d);x(g)||(e.tag=g=[g]);for(d=0;d<g.length;d++)this.w[g[d]]=u();this.B=g;d=f}if(d){let c;x(d)||(y(d)?(c=d,e.field=d=Object.keys(d)):e.field=d=[d]);for(e=0;e<d.length;e++)g=d[e],x(g)||(c&&(a=c[g]),b[e]=g,d[e]=g.split(":")),k[g]=new m(a),k[g].g=this.g}}this.u=!0;this.j=(this.cache= | ||
c=C(c=a.cache)?this.cache||w.cache:c)?new fa(c):!1;return this};m.prototype.encode=function(a){a&&S.length&&(a=J(a,S));a&&this.m.length&&(a=J(a,this.m));a&&this.o&&(a=this.o(a));a&&this.stemmer&&(a=J(a,this.stemmer));return a};m.prototype.addMatcher=function(a){const b=this.m;for(const c in a)a.hasOwnProperty(c)&&b.push(h(c),a[c]);return this};m.prototype.add=function(a,b,c,d,e){if(this.a&&y(a))return this.s("add",a,b);if(b&&F(b)&&(a||0===a)){var g="@"+a;if(this.f[g]&&!d)return this.update(a,b);if(!e){if(this.async){let e= | ||
this;g=new Promise(function(c){setTimeout(function(){e.add(a,b,null,d,!0);e=null;c()})});if(c)g.then(c);else return g;return this}if(c)return this.add(a,b,null,d,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.c;e=I(c)?c(b):b.split(this.split);this.filter&&(e=K(e,this.filter));const n=u();n._ctx=u();const l=e.length,h=this.threshold,t=this.depth,m=this.b,v=this.i,Q=this.v;for(let b=0;b<l;b++){var f=e[b];if(f){var k=f.length,r=(Q?b+1:l-b)/l,p="";switch(c){case "reverse":case "both":for(var q= | ||
k;--q;)p=f[q]+p,P(v,n,p,a,Q?1:(k-q)/k,r,h,m-1);p="";case "forward":for(q=0;q<k;q++)p+=f[q],P(v,n,p,a,Q?(q+1)/k:1,r,h,m-1);break;case "full":for(q=0;q<k;q++){const b=(Q?q+1:k-q)/k;for(let c=k;c>q;c--)p=f.substring(q,c),P(v,n,p,a,b,r,h,m-1)}break;default:if(k=P(v,n,f,a,1,r,h,m-1),t&&1<l&&k>=h)for(k=n._ctx[f]||(n._ctx[f]=u()),f=this.h[f]||(this.h[f]=X(m-(h||0))),r=b-t,p=b+t+1,0>r&&(r=0),p>l&&(p=l);r<p;r++)r!==b&&P(f,k,e[r],a,0,m-(r<b?b-r:r-b),h,m-1)}}}this.f[g]=1;this.u=!1}return this};m.prototype.s= | ||
function(a,b,c){if(x(b))for(let d=0,e=b.length;d<e;d++){if(d===e-1)return this.s(a,b[d],c);this.s(a,b[d])}else{const h=this.a.index,p=this.a.keys;var d=this.a.tag,e=this.a.id;let q;let n;for(var g=0;g<e.length;g++)q=(q||b)[e[g]];if(d){for(e=0;e<d.length;e++){var f=d[e];var k=f.split(":");for(g=0;g<k.length;g++)n=(n||b)[k[g]];n="@"+n}k=this.w[f];k=k[n]||(k[n]=[])}if("remove"===a){delete this.g[q];for(let b=0,a=p.length;b<a;b++){if(b===a-1)return h[p[b]].remove(q,c),this;h[p[b]].remove(q)}}e=this.a.field; | ||
k&&(k[k.length]=b);this.g[q]=b;for(let g=0,k=e.length;g<k;g++){d=e[g];let l;for(f=0;f<d.length;f++)l=(l||b)[d[f]];d=h[p[g]];f="add"===a?d.add:d.update;g===k-1?f.call(d,q,l,c):f.call(d,q,l)}}return this};m.prototype.update=function(a,b,c){if(this.a&&y(a))return this.s("update",a,b);this.f["@"+a]&&F(b)&&(this.remove(a),this.add(a,b,c,!0));return this};m.prototype.remove=function(a,b,c){if(this.a&&y(a))return this.s("remove",a,b);var d="@"+a;if(this.f[d]){if(!c){if(this.async&&"function"!==typeof importScripts){let c= | ||
this;d=new Promise(function(b){setTimeout(function(){c.remove(a,null,!0);c=null;b()})});if(b)d.then(b);else return d;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.b-(this.threshold||0);b++)T(this.i[b],a);this.depth&&T(this.h,a);delete this.f[d];this.u=!1}return this};let z;m.prototype.search=function(a,b,c,d){if(y(b)){if(x(b))for(var e=0;e<b.length;e++)b[e].query=a;else b.query=a;a=b;b=1E3}else b&&I(b)?(c=b,b=1E3):b||0===b||(b=1E3);let g=[],f=a;let k,h,p;if(y(a)&&!x(a)){c|| | ||
(c=a.callback)&&(f.callback=null);h=a.sort;k=a.page;b=a.limit;var q=a.threshold;p=a.suggest;a=a.query}if(this.a){q=this.a.index;const r=f.where;var n=f.bool||"or",l=f.field;let B=n;let v,u;if(l)x(l)||(l=[l]);else if(x(f)){var m=f;l=[];B=[];for(var t=0;t<f.length;t++)d=f[t],e=d.bool||n,l[t]=d.field,B[t]=e,"not"===e?v=!0:"and"===e&&(u=!0)}else l=this.a.keys;n=l.length;for(t=0;t<n;t++)m&&(f=m[t]),k&&!F(f)&&(f.page=null,f.limit=0),g[t]=q[l[t]].search(f,0);if(c)return c(A.call(this,a,B,g,h,b,p,r,k,u,v)); | ||
if(this.async){const c=this;return new Promise(function(d){Promise.all(g).then(function(e){d(A.call(c,a,B,e,h,b,p,r,k,u,v))})})}return A.call(this,a,B,g,h,b,p,r,k,u,v)}q||(q=this.threshold||0);if(!d){if(this.async&&"function"!==typeof importScripts){let a=this;q=new Promise(function(c){setTimeout(function(){c(a.search(f,b,null,!0));a=null})});if(c)q.then(c);else return q;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!F(a))return g;f=a;if(this.cache)if(this.u){if(c=this.j.get(a))return c}else this.j.clear(), | ||
this.u=!0;f=this.encode(f);if(!f.length)return g;c=this.c;c=I(c)?c(f):f.split(this.split);this.filter&&(c=K(c,this.filter));m=c.length;d=!0;e=[];const w=u();let v=0;1<m&&(this.depth&&"strict"===this.c?n=!0:c.sort(ea));if(!n||(t=this.h)){const b=this.b;for(;v<m;v++){let a=c[v];if(a){if(n){if(!l)if(t[a])l=a,w[a]=1;else if(!p)return g;if(p&&v===m-1&&!e.length)n=!1,a=l||a,w[a]=0;else if(!l)continue}if(!w[a]){const c=[];let f=!1,g=0;const k=n?t[l]:this.i;if(k){let d;for(let e=0;e<b-q;e++)if(d=k[e]&&k[e][a])c[g++]= | ||
d,f=!0}if(f)l=a,e[e.length]=1<g?c.concat.apply([],c):c[0];else if(!p){d=!1;break}w[a]=1}}}}else d=!1;d&&(g=W(e,b,k,p));this.cache&&this.j.set(a,g);return g};m.prototype.find=function(a,b){return this.where(a,b,1)[0]||null};m.prototype.where=function(a,b,c,d){const e=this.g,g=[];let f=0;let k;var h;let p;if(y(a)){c||(c=b);var q=Object.keys(a);var n=q.length;k=!1;if(1===n&&"id"===q[0])return[e[a.id]];if((h=this.B)&&!d)for(var l=0;l<h.length;l++){var m=h[l],t=a[m];if(!C(t)){p=this.w[m]["@"+t];if(0=== | ||
--n)return p;q.splice(q.indexOf(m),1);delete a[m];break}}h=Array(n);for(l=0;l<n;l++)h[l]=q[l].split(":")}else{if(I(a)){b=d||Object.keys(e);c=b.length;for(q=0;q<c;q++)n=e[b[q]],a(n)&&(g[f++]=n);return g}if(C(b))return[e[a]];if("id"===a)return[e[b]];q=[a];n=1;h=[a.split(":")];k=!0}d=p||d||Object.keys(e);l=d.length;for(m=0;m<l;m++){t=p?d[m]:e[d[m]];let l=!0;for(let c=0;c<n;c++){k||(b=a[q[c]]);const d=h[c],e=d.length;let f=t;if(1<e)for(let a=0;a<e;a++)f=f[d[a]];else f=f[d[0]];if(f!==b){l=!1;break}}if(l&& | ||
(g[f++]=t,c&&f===c))break}return g};m.prototype.info=function(){return{id:this.id,items:this.length,cache:this.cache&&this.cache.l?this.cache.l.length:!1,matcher:S.length+(this.m?this.m.length:0),worker:this.C,threshold:this.threshold,depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.c}};m.prototype.clear=function(){return this.destroy().init()};m.prototype.destroy=function(){this.cache&&(this.j.clear(),this.j=null);this.i=this.h=this.f=null;if(this.a){const a=this.a.keys; | ||
for(let b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.g=null}return this};m.prototype.export=function(){let a;if(this.a){const b=this.a.keys;a=Array(b.length+1);let c=0;for(;c<b.length;c++){const d=this.a.index[b[c]];a[c]=[d.i,d.h,Object.keys(d.f)]}a[c]=this.g}else a=[this.i,this.h,Object.keys(this.f)];return JSON.stringify(a)};m.prototype.import=function(a){a=JSON.parse(a);const b=u();if(this.a){var c=this.a.keys,d=c.length,e=a[0][2];for(var g=0;g<e.length;g++)b[e[g]]=1;for(e=0;e<d;e++)g= | ||
this.a.index[c[e]],g.i=a[e][0],g.h=a[e][1],g.f=b,g.g=a[d];this.g=a[d]}else{c=a[2];for(d=0;d<c.length;d++)b[c[d]]=1;this.i=a[0];this.h=a[1];this.f=b}};const O={icase:function(a){return a.toLowerCase()},simple:function(){const a=[h("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",h("[\u00e8\u00e9\u00ea\u00eb]"),"e",h("[\u00ec\u00ed\u00ee\u00ef]"),"i",h("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",h("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",h("[\u00fd\u0177\u00ff]"),"y",h("\u00f1"),"n",h("\u00e7"),"c",h("\u00df"), | ||
"s",h(" & ")," and ",h("[-/]")," ",h("[^a-z0-9 ]"),"",h("\\s+")," "];return function(b){b=J(b.toLowerCase(),a);return" "===b?"":b}}(),advanced:function(){const a=[h("ae"),"a",h("ai"),"ei",h("ay"),"ei",h("ey"),"ei",h("oe"),"o",h("ue"),"u",h("ie"),"i",h("sz"),"s",h("zs"),"s",h("sh"),"s",h("ck"),"k",h("cc"),"k",h("dt"),"t",h("ph"),"f",h("pf"),"f",h("ou"),"o",h("uo"),"u"];return function(b,c){if(!b)return b;b=this.simple(b);2<b.length&&(b=J(b,a));c||1<b.length&&(b=U(b));return b}}(),extra:function(){const a= | ||
[h("p"),"b",h("z"),"s",h("[cgq]"),"k",h("n"),"m",h("d"),"t",h("[vw]"),"f",h("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let c=0;c<b.length;c++){const d=b[c];1<d.length&&(b[c]=d[0]+J(d.substring(1),a))}b=b.join(" ");b=U(b)}return b}}(),balance:function(){const a=[h("[-/]")," ",h("[^a-z0-9 ]"),"",h("\\s+")," "];return function(b){return U(J(b.toLowerCase(),a))}}()},fa=function(){function a(a){this.clear();this.A=!0!==a&&a}a.prototype.clear= | ||
function(){this.cache=u();this.count=u();this.index=u();this.l=[]};a.prototype.set=function(a,c){if(this.A&&C(this.cache[a])){let b=this.l.length;if(b===this.A){b--;const a=this.l[b];delete this.cache[a];delete this.count[a];delete this.index[a]}this.index[a]=b;this.l[b]=a;this.count[a]=-1;this.cache[a]=c;this.get(a)}else this.cache[a]=c};a.prototype.get=function(a){const b=this.cache[a];if(this.A&&b){var d=++this.count[a];const b=this.index;let c=b[a];if(0<c){const f=this.l;for(var e=c;this.count[f[--c]]<= | ||
d&&-1!==c;);c++;if(c!==e){for(d=e;d>c;d--)e=f[d-1],f[d]=e,b[e]=d;f[c]=a;b[a]=c}}}return b};return a}();return m}(!1),this); |
/* | ||
FlexSearch v0.6.2 | ||
FlexSearch v0.6.21 | ||
Copyright 2019 Nextapps GmbH | ||
@@ -9,21 +9,31 @@ Author: Thomas Wilkerling | ||
'use strict'; | ||
(function(m, H, I) { | ||
let z; | ||
(z = I.define) && z.amd ? z([], function() { | ||
(function(m, H, K) { | ||
let A; | ||
(A = K.define) && A.amd ? A([], function() { | ||
return H; | ||
}) : (z = I.modules) ? z[m.toLowerCase()] = H : "object" === typeof exports ? module.exports = H : I[m] = H; | ||
}) : (A = K.modules) ? A[m.toLowerCase()] = H : "object" === typeof exports ? module.exports = H : K[m] = H; | ||
})("FlexSearch", function() { | ||
function m(a, b) { | ||
const c = b ? b.id : a && a.id; | ||
this.id = c || 0 === c ? c : aa++; | ||
this.id = c || 0 === c ? c : ba++; | ||
this.init(a, b); | ||
z(this, "index", function() { | ||
V(this, "index", function() { | ||
return this.a ? Object.keys(this.a.index[this.a.keys[0]].f) : Object.keys(this.f); | ||
}); | ||
z(this, "length", function() { | ||
V(this, "length", function() { | ||
return this.index.length; | ||
}); | ||
} | ||
function H(a, b) { | ||
const c = a.length, d = J(b), e = []; | ||
function H(a) { | ||
const b = u(); | ||
for (const c in a) { | ||
if (a.hasOwnProperty(c)) { | ||
const d = a[c]; | ||
b[c] = x(d) ? d.slice(0) : y(d) ? H(d) : d; | ||
} | ||
} | ||
return b; | ||
} | ||
function K(a, b) { | ||
const c = a.length, d = I(b), e = []; | ||
for (let g = 0, f = 0; g < c; g++) { | ||
@@ -37,4 +47,4 @@ const c = a[g]; | ||
} | ||
function I(a, b, c, d, e, g, f, k, r, p) { | ||
c = V(c, f ? 0 : e, k, g, b, r, p); | ||
function A(a, b, c, d, e, g, f, k, r, p) { | ||
c = W(c, f ? 0 : e, k, g, b, r, p); | ||
let q; | ||
@@ -55,3 +65,3 @@ k && (k = c.page, q = c.next, c = c.result); | ||
c = b; | ||
d && (J(d) || (y = d.split(":"), 1 < y.length ? d = ba : (y = y[0], d = ca)), c.sort(d)); | ||
d && (I(d) || (z = d.split(":"), 1 < z.length ? d = ca : (z = z[0], d = da)), c.sort(d)); | ||
c = L(k, q, c); | ||
@@ -61,3 +71,3 @@ this.cache && this.j.set(a, c); | ||
} | ||
function z(a, b, c) { | ||
function V(a, b, c) { | ||
Object.defineProperty(a, b, {get:c}); | ||
@@ -68,3 +78,3 @@ } | ||
} | ||
function K(a, b) { | ||
function J(a, b) { | ||
for (let c = 0; c < b.length; c += 2) { | ||
@@ -95,3 +105,3 @@ a = a.replace(b[c], b[c + 1]); | ||
} else { | ||
A(f[c]) && T(f[c], b); | ||
y(f[c]) && T(f[c], b); | ||
} | ||
@@ -122,15 +132,15 @@ } | ||
} | ||
function da(a, b) { | ||
function ea(a, b) { | ||
a = a.length - b.length; | ||
return 0 > a ? 1 : a ? -1 : 0; | ||
} | ||
function ca(a, b) { | ||
a = a[y]; | ||
b = b[y]; | ||
function da(a, b) { | ||
a = a[z]; | ||
b = b[z]; | ||
return a < b ? -1 : a > b ? 1 : 0; | ||
} | ||
function ba(a, b) { | ||
const c = y.length; | ||
function ca(a, b) { | ||
const c = z.length; | ||
for (let d = 0; d < c; d++) { | ||
a = a[y[d]], b = b[y[d]]; | ||
a = a[z[d]], b = b[z[d]]; | ||
} | ||
@@ -142,3 +152,3 @@ return a < b ? -1 : a > b ? 1 : 0; | ||
} | ||
function V(a, b, c, d, e, g, f) { | ||
function W(a, b, c, d, e, g, f) { | ||
let k, r = []; | ||
@@ -153,4 +163,4 @@ if (!0 === c) { | ||
if (1 < q) { | ||
const R = u(); | ||
let B = [], M, G; | ||
const R = u(), B = []; | ||
let M, G; | ||
var n = 0, l; | ||
@@ -275,6 +285,6 @@ let N; | ||
} | ||
function J(a) { | ||
function I(a) { | ||
return "function" === typeof a; | ||
} | ||
function A(a) { | ||
function y(a) { | ||
return "object" === typeof a; | ||
@@ -285,3 +295,3 @@ } | ||
} | ||
function W(a) { | ||
function X(a) { | ||
const b = Array(a); | ||
@@ -296,5 +306,5 @@ for (let c = 0; c < a; c++) { | ||
} | ||
const w = {encode:"icase", c:"forward", split:/\W+/, cache:!1, async:!1, C:!1, v:!1, a:!1, b:9, threshold:0, depth:0}, X = {memory:{encode:"extra", c:"strict", threshold:0, b:1}, speed:{encode:"icase", c:"strict", threshold:1, b:3, depth:2}, match:{encode:"extra", c:"full", threshold:1, b:3}, score:{encode:"extra", c:"strict", threshold:1, b:9, depth:4}, balance:{encode:"balance", c:"strict", threshold:0, b:3, depth:3}, fast:{encode:"icase", c:"strict", threshold:8, b:9, depth:1}}, S = []; | ||
let aa = 0; | ||
const Y = {}, Z = {}; | ||
const w = {encode:"icase", c:"forward", split:/\W+/, cache:!1, async:!1, C:!1, v:!1, a:!1, b:9, threshold:0, depth:0}, Y = {memory:{encode:"extra", c:"strict", threshold:0, b:1}, speed:{encode:"icase", c:"strict", threshold:1, b:3, depth:2}, match:{encode:"extra", c:"full", threshold:1, b:3}, score:{encode:"extra", c:"strict", threshold:1, b:9, depth:4}, balance:{encode:"balance", c:"strict", threshold:0, b:3, depth:3}, fast:{encode:"icase", c:"strict", threshold:8, b:9, depth:1}}, S = []; | ||
let ba = 0; | ||
const Z = {}, aa = {}; | ||
m.create = function(a, b) { | ||
@@ -314,4 +324,4 @@ return new m(a, b); | ||
m.registerLanguage = function(a, b) { | ||
Y[a] = b.filter; | ||
Z[a] = b.stemmer; | ||
Z[a] = b.filter; | ||
aa[a] = b.stemmer; | ||
return this; | ||
@@ -331,3 +341,3 @@ }; | ||
b = {}; | ||
F(a) ? (b = X[a], a = {}) : c && (b = X[c]); | ||
F(a) ? (b = Y[a], a = {}) : c && (b = Y[c]); | ||
this.c = a.tokenize || b.c || this.c || w.c; | ||
@@ -341,6 +351,6 @@ this.split = a.split || this.split || w.split; | ||
this.depth = "strict" !== this.c || C(c = a.depth) ? b.depth || this.depth || w.depth : c; | ||
this.o = (c = C(c = a.encode) ? b.encode || w.encode : c) && O[c] && O[c].bind(O) || (J(c) ? c : this.o || !1); | ||
this.o = (c = C(c = a.encode) ? b.encode || w.encode : c) && O[c] && O[c].bind(O) || (I(c) ? c : this.o || !1); | ||
(c = a.matcher) && this.addMatcher(c); | ||
if (c = (b = a.lang) || a.filter) { | ||
F(c) && (c = Y[c]); | ||
F(c) && (c = Z[c]); | ||
if (x(c)) { | ||
@@ -358,3 +368,3 @@ var d = this.o, e = u(); | ||
var k; | ||
b = F(c) ? Z[c] : c; | ||
b = F(c) ? aa[c] : c; | ||
d = this.o; | ||
@@ -367,4 +377,4 @@ e = []; | ||
} | ||
this.a = e = (c = a.doc) ? c : this.a || w.a; | ||
this.i = W(this.b - (this.threshold || 0)); | ||
this.a = e = (c = a.doc) ? H(c) : this.a || w.a; | ||
this.i = X(this.b - (this.threshold || 0)); | ||
this.h = u(); | ||
@@ -392,3 +402,3 @@ this.f = u(); | ||
} else { | ||
A(d) && (f = d); | ||
y(d) && (f = d); | ||
} | ||
@@ -406,3 +416,3 @@ } | ||
let c; | ||
x(d) || (A(d) ? (c = d, e.field = d = Object.keys(d)) : e.field = d = [d]); | ||
x(d) || (y(d) ? (c = d, e.field = d = Object.keys(d)) : e.field = d = [d]); | ||
for (e = 0; e < d.length; e++) { | ||
@@ -414,10 +424,10 @@ g = d[e], x(g) || (c && (a = c[g]), b[e] = g, d[e] = g.split(":")), k[g] = new m(a), k[g].g = this.g; | ||
this.u = !0; | ||
this.j = (this.cache = c = C(c = a.cache) ? this.cache || w.cache : c) ? new ea(c) : !1; | ||
this.j = (this.cache = c = C(c = a.cache) ? this.cache || w.cache : c) ? new fa(c) : !1; | ||
return this; | ||
}; | ||
m.prototype.encode = function(a) { | ||
a && S.length && (a = K(a, S)); | ||
a && this.m.length && (a = K(a, this.m)); | ||
a && S.length && (a = J(a, S)); | ||
a && this.m.length && (a = J(a, this.m)); | ||
a && this.o && (a = this.o(a)); | ||
a && this.stemmer && (a = K(a, this.stemmer)); | ||
a && this.stemmer && (a = J(a, this.stemmer)); | ||
return a; | ||
@@ -433,3 +443,3 @@ }; | ||
m.prototype.add = function(a, b, c, d, e) { | ||
if (this.a && A(a)) { | ||
if (this.a && y(a)) { | ||
return this.s("add", a, b); | ||
@@ -468,4 +478,4 @@ } | ||
c = this.c; | ||
e = J(c) ? c(b) : b.split(this.split); | ||
this.filter && (e = H(e, this.filter)); | ||
e = I(c) ? c(b) : b.split(this.split); | ||
this.filter && (e = K(e, this.filter)); | ||
const n = u(); | ||
@@ -500,3 +510,3 @@ n._ctx = u(); | ||
if (k = P(v, n, f, a, 1, r, h, m - 1), t && 1 < l && k >= h) { | ||
for (k = n._ctx[f] || (n._ctx[f] = u()), f = this.h[f] || (this.h[f] = W(m - (h || 0))), r = b - t, p = b + t + 1, 0 > r && (r = 0), p > l && (p = l); r < p; r++) { | ||
for (k = n._ctx[f] || (n._ctx[f] = u()), f = this.h[f] || (this.h[f] = X(m - (h || 0))), r = b - t, p = b + t + 1, 0 > r && (r = 0), p > l && (p = l); r < p; r++) { | ||
r !== b && P(f, k, e[r], a, 0, m - (r < b ? b - r : r - b), h, m - 1); | ||
@@ -567,3 +577,3 @@ } | ||
m.prototype.update = function(a, b, c) { | ||
if (this.a && A(a)) { | ||
if (this.a && y(a)) { | ||
return this.s("update", a, b); | ||
@@ -575,3 +585,3 @@ } | ||
m.prototype.remove = function(a, b, c) { | ||
if (this.a && A(a)) { | ||
if (this.a && y(a)) { | ||
return this.s("remove", a, b); | ||
@@ -611,5 +621,5 @@ } | ||
}; | ||
let y; | ||
let z; | ||
m.prototype.search = function(a, b, c, d) { | ||
if (A(b)) { | ||
if (y(b)) { | ||
if (x(b)) { | ||
@@ -625,7 +635,7 @@ for (var e = 0; e < b.length; e++) { | ||
} else { | ||
b && J(b) ? (c = b, b = 1000) : b || 0 === b || (b = 1000); | ||
b && I(b) ? (c = b, b = 1000) : b || 0 === b || (b = 1000); | ||
} | ||
let g = [], f = a; | ||
let k, h, p; | ||
if (A(a) && !x(a)) { | ||
if (y(a) && !x(a)) { | ||
c || (c = a.callback) && (f.callback = null); | ||
@@ -664,3 +674,3 @@ h = a.sort; | ||
if (c) { | ||
return c(I.call(this, a, B, g, h, b, p, r, k, u, v)); | ||
return c(A.call(this, a, B, g, h, b, p, r, k, u, v)); | ||
} | ||
@@ -671,7 +681,7 @@ if (this.async) { | ||
Promise.all(g).then(function(e) { | ||
d(I.call(c, a, B, e, h, b, p, r, k, u, v)); | ||
d(A.call(c, a, B, e, h, b, p, r, k, u, v)); | ||
}); | ||
}); | ||
} | ||
return I.call(this, a, B, g, h, b, p, r, k, u, v); | ||
return A.call(this, a, B, g, h, b, p, r, k, u, v); | ||
} | ||
@@ -717,4 +727,4 @@ q || (q = this.threshold || 0); | ||
c = this.c; | ||
c = J(c) ? c(f) : f.split(this.split); | ||
this.filter && (c = H(c, this.filter)); | ||
c = I(c) ? c(f) : f.split(this.split); | ||
this.filter && (c = K(c, this.filter)); | ||
m = c.length; | ||
@@ -725,3 +735,3 @@ d = !0; | ||
let v = 0; | ||
1 < m && (this.depth && "strict" === this.c ? n = !0 : c.sort(da)); | ||
1 < m && (this.depth && "strict" === this.c ? n = !0 : c.sort(ea)); | ||
if (!n || (t = this.h)) { | ||
@@ -757,3 +767,3 @@ const b = this.b; | ||
for (let e = 0; e < b - q; e++) { | ||
if (d = k[e][a]) { | ||
if (d = k[e] && k[e][a]) { | ||
c[g++] = d, f = !0; | ||
@@ -778,3 +788,3 @@ } | ||
} | ||
d && (g = V(e, b, k, p)); | ||
d && (g = W(e, b, k, p)); | ||
this.cache && this.j.set(a, g); | ||
@@ -792,3 +802,3 @@ return g; | ||
let p; | ||
if (A(a)) { | ||
if (y(a)) { | ||
c || (c = b); | ||
@@ -820,3 +830,3 @@ var q = Object.keys(a); | ||
} else { | ||
if (J(a)) { | ||
if (I(a)) { | ||
b = d || Object.keys(e); | ||
@@ -928,3 +938,3 @@ c = b.length; | ||
return function(b) { | ||
b = K(b.toLowerCase(), a); | ||
b = J(b.toLowerCase(), a); | ||
return " " === b ? "" : b; | ||
@@ -939,3 +949,3 @@ }; | ||
b = this.simple(b); | ||
2 < b.length && (b = K(b, a)); | ||
2 < b.length && (b = J(b, a)); | ||
c || 1 < b.length && (b = U(b)); | ||
@@ -955,3 +965,3 @@ return b; | ||
const d = b[c]; | ||
1 < d.length && (b[c] = d[0] + K(d.substring(1), a)); | ||
1 < d.length && (b[c] = d[0] + J(d.substring(1), a)); | ||
} | ||
@@ -966,5 +976,5 @@ b = b.join(" "); | ||
return function(b) { | ||
return U(K(b.toLowerCase(), a)); | ||
return U(J(b.toLowerCase(), a)); | ||
}; | ||
}()}, ea = function() { | ||
}()}, fa = function() { | ||
function a(a) { | ||
@@ -971,0 +981,0 @@ this.clear(); |
{ | ||
"name": "flexsearch", | ||
"version": "0.6.2", | ||
"version": "0.6.21", | ||
"description": "Next-Generation full text search library with zero dependencies.", | ||
@@ -42,7 +42,14 @@ "homepage": "https://github.com/nextapps-de/flexsearch/", | ||
"test-browser": "mocha-phantomjs test/index.html", | ||
"test-coverage": "nyc --reporter=html --reporter=text mocha --timeout=3000 test/test.js --exit", | ||
"test-coverage": "nyc --reporter=html --reporter=text mocha --timeout=3000 mocha test/test.js", | ||
"test": "npm run test-develop && npm run test-production && npm run test-light && npm run test-browser && npm run test-coverage", | ||
"update": "node_modules/.bin/updtr --to non-breaking", | ||
"coverage": "nyc report --reporter=lcov --reporter=text-lcov | coveralls" | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"update": "node_modules/.bin/updtr --to non-breaking" | ||
}, | ||
"nyc": { | ||
"per-file": true, | ||
"all": true, | ||
"include": [ | ||
"dist/flexsearch.pre.js" | ||
] | ||
}, | ||
"files": [ | ||
@@ -63,8 +70,8 @@ "flexsearch.js", | ||
"codacy-coverage": "^3.4.0", | ||
"coveralls": "^3.0.2", | ||
"google-closure-compiler": "^20190215.0.0-nightly", | ||
"mocha": "^6.0.0", | ||
"coveralls": "^3.0.3", | ||
"google-closure-compiler": "^20190301.0.0", | ||
"mocha": "^6.0.1", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"mocha-phantomjs": "^4.1.0", | ||
"nyc": "^13.1.0", | ||
"nyc": "^13.3.0", | ||
"phantomjs-prebuilt": "^2.1.16", | ||
@@ -71,0 +78,0 @@ "updtr": "^3.0.0" |
@@ -1,5 +0,4 @@ | ||
var env = global.env; | ||
if(typeof module !== "undefined"){ | ||
var env = "pre"; | ||
var expect = require("chai").expect; | ||
@@ -6,0 +5,0 @@ var FlexSearch = require("../" + (env ? "dist/": "") + "flexsearch" + (env ? "." + env : "") + ".js"); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
496673
7064
2787