!function(t){function e(){this.handleClick=this.handleClick.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleScrollEnd=this.handleScrollEnd.bind(this),this.activeLinkId,this.isBusy,this.isListening}function i(t){for(var e=0,i=0;t&&!isNaN(t.offsetLeft)&&!isNaN(t.offsetTop);)e+=t.offsetLeft-t.scrollLeft,i+=t.offsetTop-t.scrollTop,t=t.offsetParent;return{top:i,left:e}}function s(){return document.documentElement||document.body}t.affixer={affixables:[],affixable:function(){function e(t){this.el=t,this.initClasses(),this.parent=t.parentNode,this.topStyle=this.getTopStyle(),this.top=this.getTop(),this.maxY=this.getMaxY()}return e.prototype.initClasses=function(){this.el.classList.contains("affix-bottom")&&this.el.classList.remove("affix-bottom"),this.el.classList.contains("affix")&&this.el.classList.remove("affix")},e.prototype.getBottom=function(){return this.maxY-this.el.offsetHeight-this.topStyle},e.prototype.getMaxY=function(){return t.pageYOffset+this.parent.getBoundingClientRect().top+this.parent.offsetHeight-(parseInt(this.parent.style.paddingBottom)||0)},e.prototype.getTop=function(){return parseInt(t.pageYOffset+this.el.getBoundingClientRect().top-this.topStyle)},e.prototype.getTopStyle=function(){return parseInt(this.el.style.top)||0},e.prototype.refreshClasses=function(){var e=t.pageYOffset,i=e+t.innerHeight;e>=this.top?(this.el.classList.contains("affix")||this.el.classList.add("affix"),this.maxY&&(i>this.maxY&&e>this.getBottom()?this.el.classList.contains("affix-bottom")||this.el.classList.add("affix-bottom"):this.el.classList.contains("affix-bottom")&&this.el.classList.remove("affix-bottom"))):this.el.classList.contains("affix")&&this.el.classList.remove("affix")},e.prototype.setMaxY=function(){this.maxY=this.getMaxY()},e}(),init:function(){$("#scroll-nav").length&&$("body").scrollspy("refresh"),[].slice.call(document.querySelectorAll(".affixable")).forEach(function(t){var e=new this.affixable(t);e.refreshClasses(),this.affixables.push(e)}.bind(this)),this.registerListeners(),this.initialized=!0},initialized:!1,registerListeners:function(){t.addEventListener?t.addEventListener("scroll",this.refreshClasses.bind(this)):t.attachEvent("onscroll",this.refreshClasses.bind(this))},reInit:function(){this.affixables=this.affixables.map(function(t){return new this.affixable(t.el)}.bind(this)),this.refreshClasses()},refreshClasses:function(){this.affixables.forEach(function(t){t.refreshClasses()})}},e.prototype.init=function(t){var e=[].slice.call(document.querySelectorAll("#scroll-nav a"));this.sections=e.map(function(t){var e=document.querySelector(t.hash);if(e)return{id:e.id,offset:i(e).top-10}}).filter(function(t){return!!t}).sort(function(t,e){return t.offset-e.offset}),t&&(this.isBusy=!1,this.addScrollListener(),e.forEach(function(t){t.addEventListener("click",this.handleClick)}.bind(this))),this.handleScroll()},e.prototype.handleClick=function(e){if(this.isBusy)return void e.preventDefault();var i=e.currentTarget.hash.substring(1);null!==this.sections.reduce(function(t,e){return null!==t?t:e.id===i?e.offset:t},null)&&(e.preventDefault(),this.isBusy=!0,this.setActiveLink(i),this.removeScrollListener(),t.location.hash=i,this.handleScrollEnd())},e.prototype.handleScroll=function(){if(0!==this.sections.length){var t=s().scrollTop,e=this.sections.reduce(function(e,i){return i.offset<=t?i.id:e},this.sections[0].id);e!==this.activeLinkId&&this.setActiveLink(e)}},e.prototype.handleScrollEnd=function(){this.addScrollListener(),this.isBusy=!1},e.prototype.addScrollListener=function(){this.isListening||(t.addEventListener("scroll",this.handleScroll),this.isListening=!0)},e.prototype.removeScrollListener=function(){t.removeEventListener("scroll",this.handleScroll),this.isListening=!1},e.prototype.setActiveLink=function(t){this.activeLinkId=t,document.querySelector("#scroll-nav .active").classList.remove("active"),document.querySelector("#scroll-nav a[href$="+t+"]").parentElement.classList.add("active")},t.addEventListener("load",function(){if(document.getElementById("scroll-nav")){var t=new e;t.init(!0);var i=lodashDebounce(function(){t.init(!1)},300);$(".middle-column").resize(i)}})}(window);
//# sourceMappingURL=/assets/nav_affixed-eeb872a5a7df9168d3ea242477cb61e32d616436b730303f415d11c2a81edaea.js.map
