!function(){var e,t,r,i,n,s,o,a,u,l,d,h,c,f,p,y,m,g,x,v,w,k,Q,L,T,S,b,P,E=function(e){var t=new E.Builder;return t.pipeline.add(E.trimmer,E.stopWordFilter,E.stemmer),t.searchPipeline.add(E.stemmer),e.call(t,t),t.build()};E.version=“2.1.6”,E.utils={},E.utils.warn=(e=this,function(t){e.console&&console.warn&&console.warn(t)}),E.utils.asString=function(e){return 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(e){var t=e.indexOf(E.FieldRef.joiner);if(-1===t)throw“malformed field ref string”;var r=e.slice(0,t),i=e.slice(t+1);return new E.FieldRef(i,r,e)},E.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+E.FieldRef.joiner+this.docRef),this._stringValue},E.idf=function(e,t){var r=0;for(var i in e)“_index”!=i&&(r+=Object.keys(e).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},E.Token=function(e,t){this.str=e||“”,this.metadata=t||{}},E.Token.prototype.toString=function(){return this.str},E.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},E.Token.prototype.clone=function(e){return e=e||function(e){return e},new E.Token(e(this.str,this.metadata),this.metadata)},E.tokenizer=function(e){if(null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return new E.Token(E.utils.asString(e).toLowerCase())});for(var t=e.toString().trim().toLowerCase(),r=t.length,i=[],n=0,s=0;n<=r;n++){var o=n-s;(t.charAt(n).match(E.tokenizer.separator)||n==r)&&(o>0&&i.push(new E.Token(t.slice(s,n),{position:,index:i.length})),s=n+1)}return i},E.tokenizer.separator=/+/,E.Pipeline=function(){this._stack=[]},E.Pipeline.registeredFunctions=Object.create(null),E.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&E.utils.warn(“Overwriting existing registered function: ”+t),e.label=t,E.Pipeline.registeredFunctions=e},E.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||E.utils.warn(“Function is not registered with pipeline. This may cause problems when serialising the index.n”,e)},E.Pipeline.load=function(e){var t=new E.Pipeline;return e.forEach(function(e){var r=E.Pipeline.registeredFunctions;if(!r)throw new Error(“Cannot load unregistered function: ”+e);t.add®}),t},E.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){E.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},E.Pipeline.prototype.after=function(e,t){E.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error(“Cannot find existingFn”);r+=1,this._stack.splice(r,0,t)},E.Pipeline.prototype.before=function(e,t){E.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error(“Cannot find existingFn”);this._stack.splice(r,0,t)},E.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},E.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r<t;r++){for(var i=this._stack,n=[],s=0;s<e.length;s++){var o=i(e,s,e);if(void 0!==o&&“”!==o)if(o instanceof Array)for(var a=0;a);else n.push(o)}e=n}return e},E.Pipeline.prototype.runString=function(e){var t=new E.Token(e);return this.run().map(function(e){return e.toString()})},E.Pipeline.prototype.reset=function(){this._stack=[]},E.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return E.Pipeline.warnIfFunctionNotRegistered(e),e.label})},E.Vector=function(e){this._magnitude=0,this.elements=e||[]},E.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,r=this.elements.length/2,i=r-t,n=Math.floor(i/2),s=this.elements;i>1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements;return s==e?2*n:s>e?2*n:s<e?2*(n+1):void 0},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;var i=this.positionForIndex(e);this.elements==e?this.elements=r(this.elements,t):this.elements.splice(i,0,e,t)},E.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,r=1;r<t;r+=2){var i=this.elements;e+=i*i}return this._magnitude=Math.sqrt(e)},E.Vector.prototype.dot=function(e){for(var t=0,r=this.elements,i=e.elements,n=r.length,s=i.length,o=0,a=0,u=0,l=0;u)<(a=i)?u+=2:o>a?l+=2:o==a&&(t+=r*i,u+=2,l+=2);return t},E.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},E.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t=this.elements;return e},E.Vector.prototype.toJSON=function(){return this.elements},E.stemmer=(t={ational:“ate”,tional:“tion”,enci:“ence”,anci:“ance”,izer:“ize”,bli:“ble”,alli:“al”,entli:“ent”,eli:“e”,ousli:“ous”,ization:“ize”,ation:“ate”,ator:“ate”,alism:“al”,iveness:“ive”,fulness:“ful”,ousness:“ous”,aliti:“al”,iviti:“ive”,biliti:“ble”,logi:“log”},r={icate:“ic”,ative:“”,alize:“al”,iciti:“ic”,ical:“ic”,ful:“”,ness:“”},i=“”,n=“[^aeiouy]*”,s=new RegExp(“^([^aeiouy]*)?[aeiou]*[^aeiouy]*”),o=new RegExp(“^([^aeiouy]*)?[aeiou]*[^aeiouy][aeiouy][aeiou][^aeiou][^aeiouy]*”),a=new RegExp(“^([^aeiouy]*)?[aeiou]*[^aeiouy]*([aeiou]*)?$”),u=new RegExp(“^([^aeiouy]*)?”),l=/^(.+?)(ss|i)es$/,d=/^(.+?)()s$/,h=/^(.+?)eed$/,c=/^(.+?)(ed|ing)$/,f=/.$/,p=/(at|bl|iz)$/,y=new RegExp(“()\1$”),m=new RegExp(“^”+n+i+“$”),g=/^(.+?)y$/,x=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,v=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,w=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,Q=/^(.+?)e$/,L=/ll$/,T=new RegExp(“^”+n+i+“$”),S=function(e){var i,n,S,b,P,E,I;if(e.length<3)return e;if(“y”==(S=e.substr(0,1))&&(e=S.toUpperCase()+e.substr(1)),P=d,(b=l).test(e)?e=e.replace(b,“$1$2”):P.test(e)&&(e=e.replace(P,“$1$2”)),P=c,(b=h).test(e)){var O=b.exec(e);(b=s).test(O)&&(b=f,e=e.replace(b,“”))}else if(P.test(e)){i=(O=P.exec(e)),(P=u).test(i)&&(E=y,I=m,(P=p).test(e=i)?e+=“e”:E.test(e)?(b=f,e=e.replace(b,“”)):I.test(e)&&(e+=“e”))}(b=g).test(e)&&(e=(i=(O=b.exec(e)))+“i”);(b=x).test(e)&&(i=(O=b.exec(e)),n=O,(b=s).test(i)&&(e=i+t));(b=v).test(e)&&(i=(O=b.exec(e)),n=O,(b=s).test(i)&&(e=i+r));if(P=k,(b=w).test(e))i=(O=b.exec(e)),(b=o).test(i)&&(e=i);else if(P.test(e)){i=(O=P.exec(e))+O,(P=o).test(i)&&(e=i)}(b=Q).test(e)&&(i=(O=b.exec(e)),P=a,E=T,((b=o).test(i)||P.test(i)&&!E.test(i))&&(e=i));return P=o,(b=L).test(e)&&P.test(e)&&(b=f,e=e.replace(b,“”)),“y”==S&&(e=S.toLowerCase()+e.substr(1)),e},function(e){return e.update(S)}),E.Pipeline.registerFunction(E.stemmer,“stemmer”),E.generateStopWordFilter=function(e){var t=e.reduce(function(e,t){return e=t,e},{});return function(e){if(e&&t!==e.toString())return e}},E.stopWordFilter=E.generateStopWordFilter(),E.Pipeline.registerFunction(E.stopWordFilter,“stopWordFilter”),E.trimmer=function(e){return e.update(function(e){return e.replace(/^W+/,“”).replace(/W+$/,“”)})},E.Pipeline.registerFunction(E.trimmer,“trimmer”),E.TokenSet=function(){this.final=!1,this.edges={},this.id=E.TokenSet._nextId,E.TokenSet._nextId+=1},E.TokenSet._nextId=1,E.TokenSet.fromArray=function(e){for(var t=new E.TokenSet.Builder,r=0,i=e.length;r);return t.finish(),t.root},E.TokenSet.fromClause=function(e){return“editDistance”in e?E.TokenSet.fromFuzzyString(e.term,e.editDistance):E.TokenSet.fromString(e.term)},E.TokenSet.fromFuzzyString=function(e,t){for(var r=new E.TokenSet,i=;i.length;){var n,s,o,a=i.pop();if(a.str.length>0)(s=a.str.charAt(0))in a.node.edges?n=a.node.edges:(n=new E.TokenSet,a.node.edges=n),1==a.str.length?n.final=!0:i.push({node:n,editsRemaining:a.editsRemaining,str:a.str.slice(1)});if(a.editsRemaining>0&&a.str.length>1)(s=a.str.charAt(1))in a.node.edges?o=a.node.edges:(o=new E.TokenSet,a.node.edges=o),a.str.length<=2?o.final=!0:i.push({node:o,editsRemaining:a.editsRemaining-1,str:a.str.slice(2)});if(a.editsRemaining>0&&1==a.str.length&&(a.node.final=!0),a.editsRemaining>0&&a.str.length>=1){if(“*”in a.node.edges)var u=a.node.edges;else{u=new E.TokenSet;a.node.edges=u}1==a.str.length?u.final=!0:i.push({node:u,editsRemaining:a.editsRemaining-1,str:a.str.slice(1)})}if(a.editsRemaining>0){if(“*”in a.node.edges)var l=a.node.edges;else{l=new E.TokenSet;a.node.edges=l}0==a.str.length?l.final=!0:i.push({node:l,editsRemaining:a.editsRemaining-1,str:a.str})}if(a.editsRemaining>0&&a.str.length>1){var d,h=a.str.charAt(0),c=a.str.charAt(1);c in a.node.edges?d=a.node.edges:(d=new E.TokenSet,a.node.edges=d),1==a.str.length?d.final=!0:i.push({node:d,editsRemaining:a.editsRemaining-1,str:h+a.str.slice(2)})}}return r},E.TokenSet.fromString=function(e){for(var t=new E.TokenSet,r=t,i=!1,n=0,s=e.length;n<s;n++){var o=e,a=n==s-1;if(“*”==o)i=!0,t.edges=t,t.final=a;else{var u=new E.TokenSet;u.final=a,t.edges=u,t=u,i&&(t.edges=r)}}return r},E.TokenSet.prototype.toArray=function(){for(var e=[],t=;t.length;){var r=t.pop(),i=Object.keys(r.node.edges),n=i.length;r.node.final&&e.push(r.prefix);for(var s=0;s<n;s++){var o=i;t.push({prefix:r.prefix.concat(o),node:r.node.edges})}}return e},E.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?“1”:“0”,t=Object.keys(this.edges).sort(),r=t.length,i=0;i<r;i++){var n=t;e=e+n+this.edges.id}return e},E.TokenSet.prototype.intersect=function(e){for(var t=new E.TokenSet,r=void 0,i=;i.length;){r=i.pop();for(var n=Object.keys(r.qNode.edges),s=n.length,o=Object.keys(r.node.edges),a=o.length,u=0;u<s;u++)for(var l=n,d=0;d<a;d++){var h=o;if(h==l||“*”==l){var c=r.node.edges,f=r.qNode.edges,p=c.final&&f.final,y=void 0;h in r.output.edges?(y=r.output.edges).final=y.final||p:((y=new E.TokenSet).final=p,r.output.edges=y),i.push({qNode:f,output:y,node:c})}}}return t},E.TokenSet.Builder=function(){this.previousWord=“”,this.root=new E.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},E.TokenSet.Builder.prototype.insert=function(e){var t,r=0;if(e<this.previousWord)throw new Error(“Out of order word insertion”);for(var i=0;i==this.previousWord;i++)r++;this.minimize®,t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes.child;for(i=r;i<e.length;i++){var n=new E.TokenSet,s=e;t.edges=n,this.uncheckedNodes.push({parent:t,char:s,child:n}),t=n}t.final=!0,this.previousWord=e},E.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},E.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t–){var r=this.uncheckedNodes,i=r.child.toString();i in this.minimizedNodes?r.parent.edges=this.minimizedNodes:(r.child._str=i,this.minimizedNodes=r.child),this.uncheckedNodes.pop()}},E.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},E.Index.prototype.search=function(e){return this.query(function(t){new E.QueryParser(e,t).parse()})},E.Index.prototype.query=function(e){var t=new E.Query(this.fields),r=Object.create(null),i=Object.create(null),n=Object.create(null);e.call(t,t);for(var s=0;s<t.clauses.length;s++){var o=t.clauses,a=null;a=o.usePipeline?this.pipeline.runString(o.term):;for(var u=0;u<a.length;u++){var l=a;o.term=l;for(var d=E.TokenSet.fromClause(o),h=this.tokenSet.intersect(d).toArray(),c=0;c<h.length;c++)for(var f=h,p=this.invertedIndex,y=p._index,m=0;m<o.fields.length;m++){var g=o.fields,x=p,v=Object.keys(x),w=f+“/”+g;if(void 0===i&&(i=new E.Vector),i.upsert(y,1*o.boost,function(e,t){return e+t}),!n){for(var k=0;k<v.length;k++){var Q,L=v,T=new E.FieldRef(L,g),S=x;void 0===(Q=r)?r=new E.MatchData(f,g,S):Q.add(f,g,S)}n=!0}}}}var b=Object.keys®,P=[],I=Object.create(null);for(s=0;s<b.length;s++){var O,F=E.FieldRef.fromString(b),R=F.docRef,_=this.fieldVectors,N=i.similarity(_);if(void 0!==(O=I))O.score+=N,O.matchData.combine(r);else{var C={ref:R,score:N,matchData:r};I=C,P.push(C)}}return P.sort(function(e,t){return t.score-e.score})},E.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map(function(e){return[e,this.invertedIndex]},this),t=Object.keys(this.fieldVectors).map(function(e){return[e,this.fieldVectors.toJSON()]},this);return{version:E.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},E.Index.load=function(e){var t={},r={},i=e.fieldVectors,n={},s=e.invertedIndex,o=new E.TokenSet.Builder,a=E.Pipeline.load(e.pipeline);e.version!=E.version&&E.utils.warn(“Version mismatch when loading serialised index. Current version of lunr '”E.version“' does not match serialized index '”e.version“'”);for(var u=0;u<i.length;u++){var l=(h=i)[0],d=h;r=new E.Vector(d)}for(u=0;u<s.length;u++){var h,c=(h=s)[0],f=h;o.insert©,n=f}return o.finish(),t.fields=e.fields,t.fieldVectors=r,t.invertedIndex=n,t.tokenSet=o.root,t.pipeline=a,new E.Index(t)},E.Builder=function(){this._ref=“id”,this._fields=[],this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=E.tokenizer,this.pipeline=new E.Pipeline,this.searchPipeline=new E.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},E.Builder.prototype.ref=function(e){this._ref=e},E.Builder.prototype.field=function(e){this._fields.push(e)},E.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},E.Builder.prototype.k1=function(e){this._k1=e},E.Builder.prototype.add=function(e){var t=e;this.documentCount+=1;for(var r=0;r<this._fields.length;r++){var i=this._fields,n=e,s=this.tokenizer(n),o=this.pipeline.run(s),a=new E.FieldRef(t,i),u=Object.create(null);this.fieldTermFrequencies=u,this.fieldLengths=0,this.fieldLengths+=o.length;for(var l=0;l<o.length;l++){var d=o;if(null==u&&(u=0),u+=1,null==this.invertedIndex){var h=Object.create(null);h._index=this.termIndex,this.termIndex+=1;for(var c=0;c]=Object.create(null);this.invertedIndex=h}null==this.invertedIndex[i]&&(this.invertedIndex[i]=Object.create(null));for(var f=0;f<this.metadataWhitelist.length;f++){var p=this.metadataWhitelist,y=d.metadata;null==this.invertedIndex[i][p]&&(this.invertedIndex[i][p]=[]),this.invertedIndex[i][p].push(y)}}}},E.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,r={},i={},n=0;n<t;n++){var s=E.FieldRef.fromString(e);i||(i=0),i+=1,r||(r=0),r+=this.fieldLengths}for(n=0;n<this._fields.length;n++){var o;r[o=this._fields]=r/i}this.averageFieldLength=r},E.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),r=t.length,i=Object.create(null),n=0;n<r;n++){for(var s=E.FieldRef.fromString(t),o=s.fieldName,a=this.fieldLengths,u=new E.Vector,l=this.fieldTermFrequencies,d=Object.keys(l),h=d.length,c=0;c<h;c++){var f,p,y,m=d,g=l,x=this.invertedIndex._index;void 0===i?(f=E.idf(this.invertedIndex,this.documentCount),i=f):f=i,p=f*((this._k1+1)*g)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength))+g),y=Math.round(1e3*p)/1e3,u.insert(x,y)}e=u}this.fieldVectors=e},E.Builder.prototype.createTokenSet=function(){this.tokenSet=E.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},E.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new E.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:this._fields,pipeline:this.searchPipeline})},E.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},E.MatchData=function(e,t,r){for(var i=Object.create(null),n=Object.keys®,s=0;s<n.length;s++){var o=n;i=r.slice()}this.metadata=Object.create(null),this.metadata=Object.create(null),this.metadata[t]=i},E.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),r=0;r<t.length;r++){var i=t,n=Object.keys(e.metadata);null==this.metadata&&(this.metadata=Object.create(null));for(var s=0;s<n.length;s++){var o=n,a=Object.keys(e.metadata[o]);null==this.metadata[o]&&(this.metadata[o]=Object.create(null));for(var u=0;u<a.length;u++){var l=a;null==this.metadata[o]?this.metadata[o]=e.metadata[o]:this.metadata[o]=this.metadata[o].concat(e.metadata[o])}}}},E.MatchData.prototype.add=function(e,t,r){if(!(e in this.metadata))return this.metadata=Object.create(null),void(this.metadata[t]=r);if(t in this.metadata)for(var i=Object.keys®,n=0;n<i.length;n++){var s=i;s in this.metadata[t]?this.metadata[t]=this.metadata[t].concat(r):this.metadata[t]=r}else this.metadata[t]=r},E.Query=function(e){this.clauses=[],this.allFields=e},E.Query.wildcard=new String(“*”),E.Query.wildcard.NONE=0,E.Query.wildcard.LEADING=1,E.Query.wildcard.TRAILING=2,E.Query.prototype.clause=function(e){return“fields”in e||(e.fields=this.allFields),“boost”in e||(e.boost=1),“usePipeline”in e||(e.usePipeline=!0),“wildcard”in e||(e.wildcard=E.Query.wildcard.NONE),e.wildcard&E.Query.wildcard.LEADING&&e.term.charAt(0)!=E.Query.wildcard&&(e.term=“*”+e.term),e.wildcard&E.Query.wildcard.TRAILING&&e.term.slice(-1)!=E.Query.wildcard&&(e.term=e.term+“*”),this.clauses.push(e),this},E.Query.prototype.term=function(e,t){var r=t||{};return r.term=e,this.clause®,this},E.QueryParseError=function(e,t,r){this.name=“QueryParseError”,this.message=e,this.start=t,this.end=r},E.QueryParseError.prototype=new Error,E.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=},E.QueryLexer.prototype.run=function(){for(var e=E.QueryLexer.lexText;e;)e=e(this)},E.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,r=this.pos,i=0;i,e.push(this.str.slice(t,r)),t=r+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join(“”)},E.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},E.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},E.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return E.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},E.QueryLexer.prototype.width=function(){return this.pos-this.start},E.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},E.QueryLexer.prototype.backup=function(){this.pos-=1},E.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=E.QueryLexer.EOS&&this.backup()},E.QueryLexer.prototype.more=function(){return this.pos<this.length},E.QueryLexer.EOS=“EOS”,E.QueryLexer.FIELD=“FIELD”,E.QueryLexer.TERM=“TERM”,E.QueryLexer.EDIT_DISTANCE=“EDIT_DISTANCE”,E.QueryLexer.BOOST=“BOOST”,E.QueryLexer.lexField=function(e){return e.backup(),e.emit(E.QueryLexer.FIELD),e.ignore(),E.QueryLexer.lexText},E.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(E.QueryLexer.TERM)),e.ignore(),e.more())return E.QueryLexer.lexText},E.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(E.QueryLexer.EDIT_DISTANCE),E.QueryLexer.lexText},E.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(E.QueryLexer.BOOST),E.QueryLexer.lexText},E.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(E.QueryLexer.TERM)},E.QueryLexer.termSeparator=E.tokenizer.separator,E.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==E.QueryLexer.EOS)return E.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(“:”==t)return E.QueryLexer.lexField;if(“~”==t)return e.backup(),e.width()>0&&e.emit(E.QueryLexer.TERM),E.QueryLexer.lexEditDistance;if(“^”==t)return e.backup(),e.width()>0&&e.emit(E.QueryLexer.TERM),E.QueryLexer.lexBoost;if(t.match(E.QueryLexer.termSeparator))return E.QueryLexer.lexTerm}else e.escapeCharacter()}},E.QueryParser=function(e,t){this.lexer=new E.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},E.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=E.QueryParser.parseFieldOrTerm;e;)e=e(this);return this.query},E.QueryParser.prototype.peekLexeme=function(){return this.lexemes},E.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},E.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},E.QueryParser.parseFieldOrTerm=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case E.QueryLexer.FIELD:return E.QueryParser.parseField;case E.QueryLexer.TERM:return E.QueryParser.parseTerm;default:var r=“expected either a field or a term, found ”+t.type;throw t.str.length>=1&&(r+=“ with value '”t.str“'”),new E.QueryParseError(r,t.start,t.end)}},E.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map(function(e){return“'”e“'”}).join(“, ”),i=“unrecognised field '”t.str“', possible fields: ”+r;throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.fields=;var n=e.peekLexeme();if(null==n){i=“expecting term, found nothing”;throw new E.QueryParseError(i,t.start,t.end)}switch(n.type){case E.QueryLexer.TERM:return E.QueryParser.parseTerm;default:i=“expecting term, found '”n.type“'”;throw new E.QueryParseError(i,n.start,n.end)}}},E.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf(“*”)&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:var i=“Unexpected lexeme type '”r.type“'”;throw new E.QueryParseError(i,r.start,r.end)}else e.nextClause()}},E.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN®){var i=“edit distance must be numeric”;throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.editDistance=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:i=“Unexpected lexeme type '”n.type“'”;throw new E.QueryParseError(i,n.start,n.end)}else e.nextClause()}},E.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN®){var i=“boost must be numeric”;throw new E.QueryParseError(i,t.start,t.end)}e.currentClause.boost=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case E.QueryLexer.TERM:return e.nextClause(),E.QueryParser.parseTerm;case E.QueryLexer.FIELD:return e.nextClause(),E.QueryParser.parseField;case E.QueryLexer.EDIT_DISTANCE:return E.QueryParser.parseEditDistance;case E.QueryLexer.BOOST:return E.QueryParser.parseBoost;default:i=“Unexpected lexeme type '”n.type“'”;throw new E.QueryParseError(i,n.start,n.end)}else e.nextClause()}},b=this,P=function(){return E},“function”==typeof define&&define.amd?define(P):“object”==typeof exports?module.exports=P():b.lunr=P()}();