/*!
 * gumshoejs v5.1.2
 * A simple, framework-agnostic scrollspy script.
 * (c) 2019 Chris Ferdinandi
 * MIT License
 * http://github.com/cferdinandi/gumshoe
 */(function(a,b){"function"==typeof define&&define.amd?define([],function(){return b(a)}):"object"==typeof exports?module.exports=b(a):a.Gumshoe=b(a)})("undefined"==typeof global?"undefined"==typeof window?this:window:global,function(a){"use strict";var b={navClass:"active",contentClass:"active",nested:!1,nestedClass:"active",offset:0,reflow:!1,events:!0},c=function(){var a={};return Array.prototype.forEach.call(arguments,function(b){for(var c in b){if(!b.hasOwnProperty(c))return;a[c]=b[c]}}),a},d=function(a,b,c){if(c.settings.events){var d=new CustomEvent(a,{bubbles:!0,cancelable:!0,detail:c});b.dispatchEvent(d)}},e=function(a){var b=0;if(a.offsetParent)for(;a;)b+=a.offsetTop,a=a.offsetParent;return 0<=b?b:0},f=function(a){a&&a.sort(function(a,b){var c=e(a.content),d=e(b.content);return c<d?-1:1})},g=function(a){return"function"==typeof a.offset?parseFloat(a.offset()):parseFloat(a.offset)},h=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},j=function(b,c,d){var e=b.getBoundingClientRect(),f=g(c);return d?parseInt(e.bottom,10)<(a.innerHeight||document.documentElement.clientHeight):parseInt(e.top,10)<=f},k=function(){return!!(a.innerHeight+a.pageYOffset>=h())},l=function(a,b){return!!(k()&&j(a.content,b,!0))},m=function(a,b){var c=a[a.length-1];if(l(c,b))return c;for(var d=a.length-1;0<=d;d--)if(j(a[d].content,b))return a[d]},n=function(a,b){if(b.nested&&a.parentNode){var c=a.parentNode.closest("li");c&&(c.classList.remove(b.nestedClass),n(c,b))}},o=function(a,b){if(a){var c=a.nav.closest("li");c&&(c.classList.remove(b.navClass),a.content.classList.remove(b.contentClass),n(c,b),d("gumshoeDeactivate",c,{link:a.nav,content:a.content,settings:b}))}},p=function(a,b){if(b.nested){var c=a.parentNode.closest("li");c&&(c.classList.add(b.nestedClass),p(c,b))}},q=function(a,b){if(a){var c=a.nav.closest("li");c&&(c.classList.add(b.navClass),a.content.classList.add(b.contentClass),p(c,b),d("gumshoeActivate",c,{link:a.nav,content:a.content,settings:b}))}};return function(d,e){var g,h,i,j,k,l={};l.setup=function(){g=document.querySelectorAll(d),h=[],Array.prototype.forEach.call(g,function(a){var b=document.getElementById(decodeURIComponent(a.hash.substr(1)));b&&h.push({nav:a,content:b})}),f(h)},l.detect=function(){var a=m(h,k);return a?void(i&&a.content===i.content||(o(i,k),q(a,k),i=a)):void(i&&(o(i,k),i=null))};var n=function(b){j&&a.cancelAnimationFrame(j),j=a.requestAnimationFrame(l.detect)},p=function(b){j&&a.cancelAnimationFrame(j),j=a.requestAnimationFrame(function(){f(h),l.detect()})};l.destroy=function(){i&&o(i,k),a.removeEventListener("scroll",n,!1),k.reflow&&a.removeEventListener("resize",p,!1),h=null,g=null,i=null,j=null,k=null};return function(){k=c(b,e||{}),l.setup(),l.detect(),a.addEventListener("scroll",n,!1),k.reflow&&a.addEventListener("resize",p,!1)}(),l}});