/**! * FlexSearch.js v0.8.200 (Bundle) * Author and Copyright: Thomas Wilkerling * Licence: Apache-2.0 * Hosted by Nextapps GmbH * https://github.com/nextapps-de/flexsearch */ (function(self){'use strict';var A;function I(a,c,b){const e=typeof b,d=typeof a;if("undefined"!==e){if("undefined"!==d){if(b){if("function"===d&&e===d)return function(h){return a(b(h))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var f=new Map(b);for(var g of a)f.set(g[0],g[1]);return f}if(c===Set){g=new Set(b);for(f of a.values())g.add(f);return g}}}return a}return b}return"undefined"===d?c:a}function J(a,c){return"undefined"===typeof a?c:a}function N(){return Object.create(null)} function P(a){return"string"===typeof a}function R(a){return"object"===typeof a}function S(a,c){if(P(c))a=a[c];else for(let b=0;a&&b"a1a".split(b).length; this.numeric=I(a.numeric,e)}else{try{this.split=I(this.split,aa)}catch(d){this.split=/\s+/}this.numeric=I(a.numeric,I(this.numeric,!0))}this.prepare=I(a.prepare,null,this.prepare);this.finalize=I(a.finalize,null,this.finalize);b=a.filter;this.filter="function"===typeof b?b:I(b&&new Set(b),null,this.filter);this.dedupe=I(a.dedupe,!0,this.dedupe);this.matcher=I((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=I((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=I((b=a.stemmer)&&new Map(b), null,this.stemmer);this.replacer=I(a.replacer,null,this.replacer);this.minlength=I(a.minlength,1,this.minlength);this.maxlength=I(a.maxlength,1024,this.maxlength);this.rtl=I(a.rtl,!1,this.rtl);if(this.cache=b=I(a.cache,!0,this.cache))this.H=null,this.O="number"===typeof b?b:2E5,this.F=new Map,this.G=new Map,this.L=this.K=128;this.h="";this.M=null;this.C="";this.N=null;if(this.matcher)for(const d of this.matcher.keys())this.h+=(this.h?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.C+= (this.C?"|":"")+d;return this};A.addStemmer=function(a,c){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,c);this.C+=(this.C?"|":"")+a;this.N=null;this.cache&&T(this);return this};A.addFilter=function(a){"function"===typeof a?this.filter=a:(this.filter||(this.filter=new Set),this.filter.add(a));this.cache&&T(this);return this}; A.addMapper=function(a,c){if("object"===typeof a)return this.addReplacer(a,c);if(1a.length&&(this.dedupe||this.mapper))return this.addMapper(a,c);this.matcher||(this.matcher=new Map);this.matcher.set(a,c);this.h+=(this.h?"|":"")+a;this.M=null;this.cache&&T(this);return this}; A.addReplacer=function(a,c){if("string"===typeof a)return this.addMatcher(a,c);this.replacer||(this.replacer=[]);this.replacer.push(a,c);this.cache&&T(this);return this}; A.encode=function(a,c){if(this.cache&&a.length<=this.K)if(this.H){if(this.F.has(a))return this.F.get(a)}else this.H=setTimeout(T,50,this);this.normalize&&("function"===typeof this.normalize?a=this.normalize(a):a=ha?a.normalize("NFKD").replace(ha,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&3this.maxlength)){if(c){if(d[l])continue;d[l]=1}else{if(f===l)continue;f=l}if(b)e.push(l);else if(!this.filter||("function"===typeof this.filter?this.filter(l):!this.filter.has(l))){if(this.cache&&l.length<=this.L)if(this.H){var k=this.G.get(l);if(k||""===k){k&&e.push(k);continue}}else this.H=setTimeout(T,50,this);if(this.stemmer){this.N||(this.N=new RegExp("(?!^)("+ this.C+")$"));let w;for(;w!==l&&2this.stemmer.get(t))}if(l&&(this.mapper||this.dedupe&&1this.matcher.get(w)));if(l&&this.replacer)for(k=0;l&&kthis.O&&(this.G.clear(),this.L=this.L/1.1|0));if(l){if(l!==C)if(c){if(d[l])continue;d[l]=1}else{if(g===l)continue;g=l}e.push(l)}}}this.finalize&&(e=this.finalize(e)||e);this.cache&&a.length<=this.K&&(this.F.set(a,e),this.F.size>this.O&&(this.F.clear(),this.K=this.K/1.1|0));return e};function T(a){a.H=null;a.F.clear();a.G.clear()};function la(a,c,b){b||(c||"object"!==typeof a?"object"===typeof c&&(b=c,c=0):b=a);b&&(a=b.query||a,c=b.limit||c);let e=""+(c||0);b&&(e+=(b.offset||0)+!!b.context+!!b.suggest+(!1!==b.resolve)+(b.resolution||this.resolution)+(b.boost||0));a=(""+a).toLowerCase();this.cache||(this.cache=new W);let d=this.cache.get(a+e);if(!d){const f=b&&b.cache;f&&(b.cache=!1);d=this.search(a,c,b);f&&(b.cache=f);this.cache.set(a+e,d)}return d}function W(a){this.limit=a&&!0!==a?a:1E3;this.cache=new Map;this.h=""} W.prototype.set=function(a,c){this.cache.set(this.h=a,c);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};W.prototype.get=function(a){const c=this.cache.get(a);c&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,c));return c};W.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b)}};W.prototype.clear=function(){this.cache.clear();this.h=""};const ma={normalize:!1,numeric:!1,dedupe:!1};const na={};const oa=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const pa=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),qa=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"];const ra={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};var sa={Exact:ma,Default:na,Normalize:na,LatinBalance:{mapper:oa},LatinAdvanced:{mapper:oa,matcher:pa,replacer:qa},LatinExtra:{mapper:oa,replacer:qa.concat([/(?!^)[aeo]/g,""]),matcher:pa},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(a){for(let b=0;b=this.priority*this.priority*3):(wa=setTimeout(za,0),xa=Date.now());if(ya){const f=this;return new Promise(g=>{setTimeout(function(){g(f[a+"Async"].apply(f,c))},0)})}const d=this[a].apply(this,c);b=d.then?d:new Promise(f=>f(d));e&&b.then(e);return b}};Y.prototype.add=function(a,c,b){R(a)&&(c=a,a=S(c,this.key));if(c&&(a||0===a)){if(!b&&this.reg.has(a))return this.update(a,c);for(let h=0,k;hc?a.slice(b,b+c):a;let e=[];for(let d=0,f,g;d=g){b-=g;continue}f=f.slice(b,b+c);g=f.length;b=0}g>c&&(f=f.slice(0,c),g=c);if(!e.length&&g>=c)return f;e.push(f);c-=g;if(!c)break}return e=1E&&(E=m.length+(m?1:0)),z=m.length+(m?1:0)+L.length,r+=F,ja.push(u.length),u.push({match:L})),m+=(m?" ":"")+L)}if(!q)D=v[y],m+=(m?" ":"")+D,k&&u.push({text:D});else if(k&&r>=k)break}r=ja.length*(f.length-2);if(t||p||k&&m.length-r>k)if(r=k+r-2*w,y=z-E,0v&&(v=0)),u=u.length-1){if(G>=u.length){y[q+1]= 1;G>=v.length&&(r[q+1]=1);continue}F-=w}m=u[G].text;if(H=p&&B[q])if(0H)if(y[q+1]=1,n)m=m.substring(0,H);else continue;(H-=m.length)||(H=-1);B[q]=H}else{y[q+1]=1;continue}if(F+m.length+1<=k)m=" "+m,z[q]+=m;else if(n)O=k-F-1,0=G){if(0>G){y[q]=1;r[q]=1;continue}F-=w}m=u[G].text;if(H=t&&D[q])if(0H)if(y[q]=1,n)m=m.substring(m.length- H);else continue;(H-=m.length)||(H=-1);D[q]=H}else{y[q]=1;continue}if(F+m.length+1<=k)m+=" ",z[q]=m+z[q];else if(n)O=m.length+1-(k-F),0<=O&&O=v.length-1?ua=1:Gb||e)a=a.slice(e,e+b);d&&(a=Ga.call(this,a))}return a}function Ga(a){if(!this||!this.store)return a;const c=Array(a.length);for(let b=0,e;bx;f--){g=p.substring(x,f);m=this.rtl?d-1-x:x;var h=this.score?this.score(c,p,t,g,m):Wa(w, n,t,d,m);Xa(this,C,g,h,a,b)}break}case "bidirectional":case "reverse":if(1g?0:1),n,t,h-1,k-1),m=this.bidirectional&&p>f;Xa(this,l,m?f:p,x,a,b,m?p:f)}}}}this.fastupdate||this.reg.add(a)}}return this};function Xa(a,c,b,e,d,f,g){let h=g?a.ctx:a.map,k;if(!c[b]||g&&!(k=c[b])[g])g?(c=k||(c[b]=N()),c[g]=1,(k=h.get(g))?h=k:h.set(g,h=new Map)):c[b]=1,(k=h.get(b))?h=k:h.set(b,h=[]),h=h[e]||(h[e]=[]),f&&h.includes(d)||(h.push(d),a.fastupdate&&((c=a.reg.get(d))?c.push(h):a.reg.set(d,[h])))} function Wa(a,c,b,e,d){return b&&1c||d?g.slice(d,c+d):g;g=b}else{if(b< l){l=[];break b}g=g[b-1];if(c||d)if(g.length>c||d)g=g.slice(d,c+d)}l=g}else if(1===e){c=Ca.call(null,b[0],c,d);break a}c=l}return c};function Ya(a,c,b){let e;b&&(e=a.bidirectional&&c>b)&&(e=b,b=c,c=e);a=b?(a=a.ctx.get(b))&&a.get(c):a.map.get(c);return a};function Z(a,c){if(!this||this.constructor!==Z)return new Z(a);if(a){var b=P(a)?a:a.preset;b&&(a=Object.assign({},Va[b],a))}else a={};b=a.context;const e=!0===b?{depth:1}:b||{},d=P(a.encoder)?sa[a.encoder]:a.encode||a.encoder||{};this.encoder=d.encode?d:"object"===typeof d?new ka(d):{encode:d};this.resolution=a.resolution||9;this.tokenize=b=(b=a.tokenize)&&"default"!==b&&"exact"!==b&&b||"strict";this.depth="strict"===b&&e.depth||0;this.bidirectional=!1!==e.bidirectional;this.fastupdate=!!a.fastupdate; this.score=a.score||null;b=!1;this.map=new Map;this.ctx=new Map;this.reg=c||(this.fastupdate?new Map:new Set);this.P=e.resolution||3;this.rtl=d.rtl||a.rtl||!1;this.cache=(b=a.cache||null)&&new W(b);this.priority=a.priority||4}A=Z.prototype;A.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this};A.append=function(a,c){return this.add(a,c,!0)};A.contain=function(a){return this.reg.has(a)}; A.update=function(a,c){const b=this,e=this.remove(a);return e&&e.then?e.then(()=>b.add(a,c)):this.add(a,c)};A.cleanup=function(){if(!this.fastupdate)return this;Ua(this.map);this.depth&&Ua(this.ctx);return this};A.searchCache=la;A.export=function(a,c,b=0,e=0){let d,f;switch(e){case 0:d="reg";f=Qa(this.reg);break;case 1:d="cfg";f=null;break;case 2:d="map";f=Ma(this.map,this.reg.size);break;case 3:d="ctx";f=Oa(this.ctx,this.reg.size);break;default:return}return Sa.call(this,a,c,d,f,b,e)}; A.import=function(a,c){if(c)switch("string"===typeof c&&(c=JSON.parse(c)),a=a.split("."),"json"===a[a.length-1]&&a.pop(),3===a.length&&a.shift(),a=1