/* MiniBar 0.5.1 http://mobius.ovh/ Released under the MIT license */ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(w){var n=0;return function(){return ng;g+=.01)f.push(g);g=function(h,l){h.forEach(function(k){var m=k.target,t=k.intersectionRatio;k=k.isIntersecting;var q=!k&&0>=t,v=k&&0t;e.classList.toggle(m,b.classes.itemVisible,k&&1<=t);e.classList.toggle(m,b.classes.itemPartial,v);e.classList.toggle(m,b.classes.itemHidden,q)})};this.intersectionObserver=new IntersectionObserver(g,{root:null,rootMargin:"0px",threshold:f});y(d,function(h,l){a.intersectionObserver.observe(l)})}}a.update(); e.on(a.content,"scroll",c.scroll);e.on(a.container,"mouseenter",c.mouseenter);if(b.horizontalMouseScroll)e.on(a.content,"wheel",c.wheel);e.on(n,"resize",c.debounce);e.on(p,"DOMContentLoaded",c.update);e.on(n,"load",c.update);"MutationObserver"in window&&(g=function(h,l){if(a.intersectionObserver)for(var k=$jscomp.makeIterator(h),m=k.next();!m.done;m=k.next())if(m=m.value,"childList"==m.type){for(var t=$jscomp.makeIterator(m.addedNodes),q=t.next();!q.done;q=t.next())q=q.value,a.intersectionObserver.observe(q); m=$jscomp.makeIterator(m.removedNodes);for(q=m.next();!q.done;q=m.next())q=q.value,a.intersectionObserver.unobserve(q)}a.intersectionObserver&&(a.items=a.getItems());a.update()},this.mutationObserver=new MutationObserver(g),this.mutationObserver.observe(this.content,this.config.mutationObserver));a.initialised=!0;setTimeout(function(){a.config.onInit.call(a,a.getData())},10)}};r.getItems=function(){var a=this.config,b;"string"===typeof a.observableItems&&(b=this.content.querySelectorAll(a.observableItems)); if(a.observableItems instanceof HTMLCollection||a.observableItems instanceof NodeList)b=[].slice.call(a.observableItems);return b};r.getData=function(a){a=this.content;return{scrollTop:a.scrollTop,scrollLeft:a.scrollLeft,scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth,offsetWidth:a.offsetWidth,offsetHeight:a.offsetHeight,containerRect:this.rect,barSize:this.size}};r.scrollTo=function(a,b){void 0===b&&(b="y");var c=this.getData(),d;"string"===typeof a?"start"===a?d=-c[u[b]]:"end"===a&&(d=c[z[b]]- c[K[b]]-c[u[b]]):d=a-c[u[b]];this.scrollBy(d,b)};r.scrollBy=function(a,b,c,d){void 0===b&&(b="y");if(0===c)this.content[u[b]]+=a;else{void 0===c&&(c=250);d=d||function(k,m,t,q){k/=q;return-t*k*(k-2)+m};var f=this,g=Date.now(),h=f.content[u[b]],l=function(){var k=Date.now()-g;k>c?(F(f.frame),f.content[u[b]]=Math.ceil(h+a)):(f.content[u[b]]=Math.ceil(d(k,h,a,c)),f.frame=D(l))};f.frame=l()}};r.scrollToTop=function(){this.scrollTo(0)};r.scrollToBottom=function(){var a=this.getData();this.scrollTo(a.scrollHeight- a.offsetHeight)};r.update=function(){var a=this,b=a.config,c=a.content,d=a.size;a.rect=e.rect(a.container);a.scrollTop=c.scrollTop;a.scrollLeft=c.scrollLeft;a.scrollHeight=c.scrollHeight;a.scrollWidth=c.scrollWidth;a.offsetWidth=c.offsetWidth;a.offsetHeight=c.offsetHeight;a.clientWidth=c.clientWidth;a.clientHeight=c.clientHeight;var f=a.scrollWidth>a.offsetWidth&&!a.textarea,g=a.scrollHeight>a.offsetHeight;e.classList.toggle(a.container,"mb-scroll-x",f&&b.scrollX&&!b.hideBars);e.classList.toggle(a.container, "mb-scroll-y",g&&b.scrollY&&!b.hideBars);e.css(c,{overflowX:f?"auto":"",overflowY:g?"auto":"",marginBottom:f?-d:"",paddingBottom:f?d:"",marginRight:g?-d:"",paddingRight:g&&!b.hideBars?d:""});a.scrollX=f;a.scrollY=g;y(a.tracks,function(h,l){C(l,e.rect(l.node));C(a.bars[h],e.rect(a.bars[h].node))});a.updateBars();a.wrapperPadding=0;a.textarea&&(b=e.css(a.wrapper),a.wrapperPadding=parseInt(b.paddingTop,10)+parseInt(b.paddingBottom,10),!a.down&&a.content.selectionStart>=a.content.value.length&&(a.content.scrollTop= a.scrollToBottom()));this.config.onUpdate.call(this,this.getData())};r.updateBar=function(a){var b=this,c={},d=b.config,f=b.tracks[a][x[a]],g=b.rect[x[a]]-b.wrapperPadding,h=f/b[z[a]],l=b.content[u[a]]/(b[z[a]]-g);"progress"===d.barType?c[x[a]]=Math.floor(f*l):(c[x[a]]=Math.max(Math.floor(h*g),d.minBarSize),c[J[a]]=Math.floor((f-c[x[a]])*l));D(function(){e.css(b.bars[a].node,c)})};r.updateBars=function(){y(this.bars,function(a,b){this.updateBar(a)},this)};r.destroy=function(){var a=this.config,b= this.container;if(this.initialised){e.off(b,"mouseenter",this.events.mouseenter);e.off(n,"resize",this.events.debounce);e.classList.remove(b,a.classes.visible);e.classList.remove(b,a.classes.container);e.classList.remove(b,a.classes.nav);for(y(this.tracks,function(c,d){b.removeChild(a.navButtons?d.node.parentNode:d.node);e.classList.remove(b,"mb-scroll-"+c)});this.content.firstChild;)b.appendChild(this.content.firstChild);b.removeChild(this.content);this.manualPosition&&(b.style.position="");this.bars= {x:{},y:{}};this.tracks={x:{},y:{}};this.content=null;this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=!1);a.observableItems&&(this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=!1),y(this.items,function(c,d){var f=d.node||d;e.classList.remove(f,a.classes.item);e.classList.remove(f,a.classes.itemVisible);e.classList.remove(f,a.classes.itemPartial);e.classList.remove(f,a.classes.itemHidden)}));this.initialised=!1}};r._scroll= function(a){a=this.getData(!0);a.scrollLeft>this.lastX?this.scrollDirection.x=1:a.scrollLeftthis.lastY?this.scrollDirection.y=1:a.scrollTop