!function(){vare=function(t){varr=newe.Builder;returnr.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),r.searchPipeline.add(e.stemmer),t.call(r,r),r.build()};e.version="2.1.5",e.utils={},e.utils.warn=function(e){returnfunction(t){e.console&&console.warn&&console.warn(t)}}(this),e.utils.asString=function(e){returnvoid0===e||null===e?"":e.toString()},e.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},e.FieldRef.joiner="/",e.FieldRef.fromString=function(t){varr=t.indexOf(e.FieldRef.joiner);if(-1===r)throw"malformed field ref string";vari=t.slice(0,r),n=t.slice(r+1);returnnewe.FieldRef(n,i,t)},e.FieldRef.prototype.toString=function(){returnvoid0==this._stringValue&&(this._stringValue=this.fieldName+e.FieldRef.joiner+this.docRef),this._stringValue},e.idf=function(e,t){varr=0;for(variine)"_index"!=i&&(r+=Object.keys(e[i]).length);varn=(t-r+.5)/(r+.5);returnMath.log(1+Math.abs(n))},e.Token=function(e,t){this.str=e||"",this.metadata=t||{}},e.Token.prototype.toString=function(){returnthis.str},e.Token.prototype.update=function(e){returnthis.str=e(this.str,this.metadata),this},e.Token.prototype.clone=function(t){returnt=t||function(e){returne},newe.Token(t(this.str,this.metadata),this.metadata)},e.tokenizer=function(t){if(null==t||void0==t)return[];if(Array.isArray(t))returnt.map(function(t){returnnewe.Token(e.utils.asString(t).toLowerCase())});for(varr=t.toString().trim().toLowerCase(),i=r.length,n=[],s=0,o=0;i>=s;s++){vara=r.charAt(s),u=s-o;(a.match(e.tokenizer.separator)||s==i)&&(u>0&&n.push(newe.Token(r.slice(o,s),{position:[o,u],index:n.length})),o=s+1)}returnn},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){rinthis.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){varr=t.label&&t.labelinthis.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){varr=newe.Pipeline;returnt.forEach(function(t){vari=e.Pipeline.registeredFunctions[t];if(!i)thrownewError("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){vart=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);vari=this._stack.indexOf(t);if(-1==i)thrownewError("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);vari=this._stack.indexOf(t);if(-1==i)thrownewError("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){vart=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(vart=this._stack.length,r=0;t>r;r++){vari=this._stack[r];e=e.reduce(function(t,r,n){vars=i(r,n,e);returnvoid0===s||""===s?t:t.concat(s)},[])}returne},e.Pipeline.prototype.runString=function(t){varr=newe.Token(t);returnthis.run([r]).map(function(e){returne.toString()})},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){returnthis._stack.map(function(t){returne.Pipeline.warnIfFunctionNotRegistered(t),t.label})},e.Vector=function(e){this._magnitude=0,this.elements=e||[]},e.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return0;for(vart=0,r=this.elements.length/2,i=r-t,n=Math.floor(i/2),s=this.elements[2*n];i>1&&(e>s&&(t=n),s>e&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];returns==e?2*n:s>e?2*n:e>s?2*(n+1):void0},e.Vector.prototype.insert=function(e,t){this.upsert(e,t,function(){throw"duplicate index"})},e.Vector.prototype.upsert=function(e,t,r){this._magnitude=0;vari=this.positionForIndex(e);this.elements[i]==e?t