text: !function(e,t){"use strict";let i={throttle:100,scrollOffset:200,activeClass:"active",getActiveElement:function(e){return'a[href="#'+e+'"]'}};class s extends Component{constructor(t,i){super(s,t,i),this.el.M_ScrollSpy=this,this.options=e.extend({},s.defaults,i),s._elements.push(this),s._count++,s._increment++,this.tickId=-1,this.id=s._increment,this._setupEventHandlers(),this._handleWindowScroll()}static get defaults(){return i}static init(e,t){return super.init(this,e,t)}static getInstance(e){return(e.jquery?e[0]:e).M_ScrollSpy}destroy(){s._elements.splice(s._elements.indexOf(this),1),s._elementsInView.splice(s._elementsInView.indexOf(this),1),s._visibleElements.splice(s._visibleElements.indexOf(this.$el),1),s._count--,this._removeEventHandlers(),e(this.options.getActiveElement(this.$el.attr("id"))).removeClass(this.options.activeClass),this.el.M_ScrollSpy=void 0}_setupEventHandlers(){let e=M.throttle(this._handleWindowScroll,200);this._handleThrottledResizeBound=e.bind(this),this._handleWindowScrollBound=this._handleWindowScroll.bind(this),1===s._count&&(window.addEventListener("scroll",this._handleWindowScrollBound),window.addEventListener("resize",this._handleThrottledResizeBound),document.body.addEventListener("click",this._handleTriggerClick))}_removeEventHandlers(){0===s._count&&(window.removeEventListener("scroll",this._handleWindowScrollBound),window.removeEventListener("resize",this._handleThrottledResizeBound),document.body.removeEventListener("click",this._handleTriggerClick))}_handleTriggerClick(i){let l=e(i.target);for(let e=s._elements.length-1;e>=0;e--){let n=s._elements[e];if(l.is('a[href="#'+n.$el.attr("id")+'"]')){i.preventDefault();let e=n.$el.offset().top+1;t({targets:[document.documentElement,document.body],scrollTop:e-n.options.scrollOffset,duration:400,easing:"easeOutCubic"});break}}}_handleWindowScroll(){s._ticks++;let e=M.getDocumentScrollTop(),t=M.getDocumentScrollLeft(),i=t+window.innerWidth,l=e+window.innerHeight,n=s._findElements(e,i,l,t);for(let e=0;e<n.length;e++){let t=n[e];t.tickId<0&&t._enter(),t.tickId=s._ticks}for(let e=0;e<s._elementsInView.length;e++){let t=s._elementsInView[e],i=t.tickId;i>=0&&i!==s._ticks&&(t._exit(),t.tickId=-1)}s._elementsInView=n}static _findElements(e,t,i,l){let n=[];for(let o=0;o<s._elements.length;o++){let r=s._elements[o],d=e+r.options.scrollOffset||200;if(r.$el.height()>0){let e=r.$el.offset().top,s=r.$el.offset().left,o=s+r.$el.width(),c=e+r.$el.height();!(s>t||o<l||e>i||c<d)&&n.push(r)}}return n}_enter(){s._visibleElements=s._visibleElements.filter(function(e){return 0!=e.height()}),s._visibleElements[0]?(e(this.options.getActiveElement(s._visibleElements[0].attr("id"))).removeClass(this.options.activeClass),s._visibleElements[0][0].M_ScrollSpy&&this.id<s._visibleElements[0][0].M_ScrollSpy.id?s._visibleElements.unshift(this.$el):s._visibleElements.push(this.$el)):s._visibleElements.push(this.$el),e(this.options.getActiveElement(s._visibleElements[0].attr("id"))).addClass(this.options.activeClass)}_exit(){s._visibleElements=s._visibleElements.filter(function(e){return 0!=e.height()}),s._visibleElements[0]&&(e(this.options.getActiveElement(s._visibleElements[0].attr("id"))).removeClass(this.options.activeClass),s._visibleElements=s._visibleElements.filter(e=>e.attr("id")!=this.$el.attr("id")),s._visibleElements[0]&&e(this.options.getActiveElement(s._visibleElements[0].attr("id"))).addClass(this.options.activeClass))}}s._elements=[],s._elementsInView=[],s._visibleElements=[],s._count=0,s._increment=0,s._ticks=0,M.ScrollSpy=s,M.jQueryLoaded&&M.initializeJqueryWrapper(s,"scrollSpy","M_ScrollSpy")}(cash,M.anime);