i.EventEmitter=function(){this.events={}},i.EventEmitter.prototype.addListener=function(){vart=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeofe)thrownewTypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},i.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){varn=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||deletethis.events[t]}},i.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){vare=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void0,e)})}},i.EventEmitter.prototype.hasHandler=function(t){returntinthis.events},/*!
i.Pipeline=function(){this._stack=[]},i.Pipeline.registeredFunctions={},i.Pipeline.registerFunction=function(t,e){einthis.registeredFunctions&&i.utils.warn("Overwriting existing registered function: "+e),t.label=e,i.Pipeline.registeredFunctions[t.label]=t},i.Pipeline.warnIfFunctionNotRegistered=function(t){vare=t.label&&t.labelinthis.registeredFunctions;e||i.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},i.Pipeline.load=function(t){vare=newi.Pipeline;returnt.forEach(function(t){varn=i.Pipeline.registeredFunctions[t];if(!n)thrownewError("Cannot load un-registered function: "+t);e.add(n)}),e},i.Pipeline.prototype.add=function(){vart=Array.prototype.slice.call(arguments);t.forEach(function(t){i.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},i.Pipeline.prototype.after=function(t,e){i.Pipeline.warnIfFunctionNotRegistered(e);varn=this._stack.indexOf(t);if(n==-1)thrownewError("Cannot find existingFn");n+=1,this._stack.splice(n,0,e)},i.Pipeline.prototype.before=function(t,e){i.Pipeline.warnIfFunctionNotRegistered(e);varn=this._stack.indexOf(t);if(n==-1)thrownewError("Cannot find existingFn");this._stack.splice(n,0,e)},i.Pipeline.prototype.remove=function(t){vare=this._stack.indexOf(t);e!=-1&&this._stack.splice(e,1)},i.Pipeline.prototype.run=function(t){for(vare=[],n=t.length,r=this._stack.length,o=0;o<n;o++){for(vari=t[o],s=0;s<r&&(i=this._stack[s](i,o,t),void0!==i&&""!==i);s++);void0!==i&&""!==i&&e.push(i)}returne},i.Pipeline.prototype.reset=function(){this._stack=[]},i.Pipeline.prototype.toJSON=function(){returnthis._stack.map(function(t){returni.Pipeline.warnIfFunctionNotRegistered(t),t.label})},/*!
i.Index=function(){this._fields=[],this._ref="id",this.pipeline=newi.Pipeline,this.documentStore=newi.Store,this.tokenStore=newi.TokenStore,this.corpusTokens=newi.SortedSet,this.eventEmitter=newi.EventEmitter,this.tokenizerFn=i.tokenizer,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},i.Index.prototype.on=function(){vart=Array.prototype.slice.call(arguments);returnthis.eventEmitter.addListener.apply(this.eventEmitter,t)},i.Index.prototype.off=function(t,e){returnthis.eventEmitter.removeListener(t,e)},i.Index.load=function(t){t.version!==i.version&&i.utils.warn("version mismatch: current "+i.version+" importing "+t.version);vare=newthis;returne._fields=t.fields,e._ref=t.ref,e.tokenizer(i.tokenizer.load(t.tokenizer)),e.documentStore=i.Store.load(t.documentStore),e.tokenStore=i.TokenStore.load(t.tokenStore),e.corpusTokens=i.SortedSet.load(t.corpusTokens),e.pipeline=i.Pipeline.load(t.pipeline),e},i.Index.prototype.field=function(t,e){vare=e||{},n={name:t,boost:e.boost||1};returnthis._fields.push(n),this},i.Index.prototype.ref=function(t){returnthis._ref=t,this},i.Index.prototype.tokenizer=function(t){vare=t.label&&t.labelini.tokenizer.registeredFunctions;returne||i.utils.warn("Function is not a registered tokenizer. This may cause problems when serialising the index"),this.tokenizerFn=t,this},i.Index.prototype.add=function(t,e){varn={},r=newi.SortedSet,o=t[this._ref],e=void0===e||e;this._fields.forEach(function(e){varo=this.pipeline.run(this.tokenizerFn(t[e.name]));n[e.name]=o;for(vari=0;i<o.length;i++){vars=o[i];r.add(s),this.corpusTokens.add(s)}},this),this.documentStore.set(o,r);for(vars=0;s<r.length;s++){for(vara=r.elements[s],u=0,c=0;c<this._fields.length;c++){varl=this._fields[c],f=n[l.name],h=f.length;if(h){for(vard=0,p=0;p<h;p++)f[p]===a&&d++;u+=d/h*l.boost}}this.tokenStore.add(a,{ref:o,tf:u})}e&&this.eventEmitter.emit("add",t,this)},i.Index.prototype.remove=function(t,e){varn=t[this._ref],e=void0===e||e;if(this.documentStore.has(n)){varr=this.documentStore.get(n);this.documentStore.remove(n),r.forEach(function(t){this.tokenStore.remove(t,n)},this),e&&this.eventEmitter.emit("remove",t,this)}},i.Index.prototype.update=function(t,e){vare=void0===e||e;this.remove(t,!1),this.add(t,!1),e&&this.eventEmitter.emit("update",t,this)},i.Index.prototype.idf=function(t){vare="@"+t;if(Object.prototype.hasOwnProperty.call(this._idfCache,e))returnthis._idfCache[e];varn=this.tokenStore.count(t),r=1;returnn>0&&(r=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=r},i.Index.prototype.search=function(t){vare=this.pipeline.run(this.tokenizerFn(t)),n=newi.Vector,r=[],o=this._fields.reduce(function(t,e){returnt+e.boost},0),s=e.some(function(t){returnthis.tokenStore.has(t)},this);if(!s)return[];e.forEach(function(t,e,s){vara=1/s.length*this._fields.length*o,u=this,c=this.tokenStore.expand(t).reduce(function(e,r){varo=u.corpusTokens.indexOf(r),s=u.idf(r),c=1,l=newi.SortedSet;if(r!==t){varf=Math.max(3,r.length-t.length);c=1/Math.log(f)}o>-1&&n.insert(o,a*s*c);for(varh=u.tokenStore.get(r),d=Object.keys(h),p=d.length,v=0;v<p;v++)l.add(h[d[v]].ref);returne.union(l)},newi.SortedSet);r.push(c)},this);vara=r.reduce(function(t,e){returnt.intersect(e)});returna.map(function(t){return{ref:t,score:n.similarity(this.documentVector(t))}},this).sort(function(t,e){returne.score-t.score})},i.Index.prototype.documentVector=function(t){for(vare=this.documentStore.get(t),n=e.length,r=newi.Vector,o=0;o<n;o++){vars=e.elements[o],a=this.tokenStore.get(s)[t].tf,u=this.idf(s);r.insert(this.corpusTokens.indexOf(s),a*u)}returnr},i.Index.prototype.toJSON=function(){return{version:i.version,fields:this._fields,ref:this._ref,tokenizer:this.tokenizerFn.label,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},i.Index.prototype.use=function(t){vare=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},/*!
i.TokenStore=function(){this.root={docs:{}},this.length=0},i.TokenStore.load=function(t){vare=newthis;returne.root=t.root,e.length=t.length,e},i.TokenStore.prototype.add=function(t,e,n){varn=n||this.root,r=t.charAt(0),o=t.slice(1);returnrinn||(n[r]={docs:{}}),0===o.length?(n[r].docs[e.ref]=e,void(this.length+=1)):this.add(o,e,n[r])},i.TokenStore.prototype.has=function(t){if(!t)return!1;for(vare=this.root,n=0;n<t.length;n++){if(!e[t.charAt(n)])return!1;e=e[t.charAt(n)]}return!0},i.TokenStore.prototype.getNode=function(t){if(!t)return{};for(vare=this.root,n=0;n<t.length;n++){if(!e[t.charAt(n)])return{};e=e[t.charAt(n)]}returne},i.TokenStore.prototype.get=function(t,e){returnthis.getNode(t,e).docs||{}},i.TokenStore.prototype.count=function(t,e){returnObject.keys(this.get(t,e)).length},i.TokenStore.prototype.remove=function(t,e){if(t){for(varn=this.root,r=0;r<t.length;r++){if(!(t.charAt(r)inn))return;n=n[t.charAt(r)]}deleten.docs[e]}},i.TokenStore.prototype.expand=function(t,e){varn=this.getNode(t),r=n.docs||{},e=e||[];returnObject.keys(r).length&&e.push(t),Object.keys(n).forEach(function(n){"docs"!==n&&e.concat(this.expand(t+n,e))},this),e},i.TokenStore.prototype.toJSON=function(){return{root:this.root,length:this.length}},function(i,s){r=s,o="function"==typeofr?r.call(e,n,e,t):r,!(void0!==o&&(t.exports=o))}(this,function(){returni})}()},function(t,e,n){"use strict";functionr(t){returnt&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});varo=n(84),i=r(o);e.default={Position:i.default},t.exports=e.default},function(t,e){"use strict";functionn(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});varr=function(){functiont(t,e){for(varn=0;n<e.length;n++){varr=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}returnfunction(e,n,r){returnn&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){functiont(e){n(this,t),this.el_="string"==typeofe?document.querySelector(e):e,this.parent_=this.el_.parentNode,this.height_=0}returnr(t,[{key:"setup",value:function(){this.offset_=this.el_.offsetTop-this.parent_.offsetTop,this.update()}},{key:"update",value:function(){vart=window.pageYOffset,e=window.innerHeight;this.bounds_={top:this.parent_.offsetTop,bottom:this.parent_.offsetTop+this.parent_.offsetHeight};varn=e-this.bounds_.top-Math.max(0,this.offset_-t)-Math.max(0,t+e-this.bounds_.bottom);n!==this.height_&&(this.el_.style.height=(this.height_=n)+"px"),t>=this.offset_?"lock"!==this.el_.dataset.mdState&&(this.el_.dataset.mdState="lock"):"lock"===this.el_.dataset.mdState&&(this.el_.dataset.mdState="")}},{key:"reset",value:function(){this.el_.dataset.mdState="",this.el_.style.height="",this.height_=0}}]),t}();e.default=o,t.exports=e.default},function(t,e,n){"use strict";functionr(t){returnt&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});varo=n(86),i=r(o),s=n(90),a=r(s);e.default={Adapter:i.default,Repository:a.default},t.exports=e.default},function(t,e,n){"use strict";functionr(t){returnt&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});varo=n(87),i=r(o);e.default={GitHub:i.default},t.exports=e.default},function(t,e,n){"use strict";functionr(t){returnt&&t.__esModule?t:{default:t}}functiono(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functioni(t,e){if(!t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeofe&&"function"!=typeofe?t:e}functions(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function, not "+typeofe);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});vara=function(){functiont(t,e){for(varn=0;n<e.length;n++){varr=e[n];r.enumerable=r.enume