(function(d,a,c){var f=d.requestAnimationFrame||d.webkitRequestAnimationFrame||d.mozRequestAnimationFrame||d.oRequestAnimationFrame||d.msRequestAnimationFrame||function(g){d.setTimeout(g,1000/60)};var b=(function(){var k={};var l=a.createElement("div").style;var i=(function(){var p=["t","webkitT","MozT","msT","OT"],n,o=0,m=p.length;for(;o0){v=t?t/2.5*(q/8):0;n=c.abs(s)+v;r=n/q}}return{destination:c.round(v),duration:r}};var h=j("transform");k.extend(k,{hasTransform:h!==false,hasPerspective:j("perspective") in l,hasTouch:"ontouchstart" in d,hasPointer:d.PointerEvent||d.MSPointerEvent,hasTransition:j("transition") in l});k.isBadAndroid=/Android /.test(d.navigator.appVersion)&&!(/Chrome\/\d/.test(d.navigator.appVersion));k.extend(k.style={},{transform:h,transitionTimingFunction:j("transitionTimingFunction"),transitionDuration:j("transitionDuration"),transitionDelay:j("transitionDelay"),transformOrigin:j("transformOrigin")});k.hasClass=function(n,o){var m=new RegExp("(^|\\s)"+o+"(\\s|$)");return m.test(n.className)};k.addClass=function(n,o){if(k.hasClass(n,o)){return}var m=n.className.split(" ");m.push(o);n.className=m.join(" ")};k.removeClass=function(n,o){if(!k.hasClass(n,o)){return}var m=new RegExp("(^|\\s)"+o+"(\\s|$)","g");n.className=n.className.replace(m," ")};k.offset=function(m){var o=-m.offsetLeft,n=-m.offsetTop;while(m=m.offsetParent){o-=m.offsetLeft;n-=m.offsetTop}return{left:o,top:n}};k.preventDefaultException=function(o,n){for(var m in n){if(n[m].test(o[m])){return true}}return false};k.extend(k.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,pointerdown:3,pointermove:3,pointerup:3,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3});k.extend(k.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(m){return m*(2-m)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(m){return c.sqrt(1-(--m*m))}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(n){var m=4;return(n=n-1)*n*((m+1)*n+m)+1}},bounce:{style:"",fn:function(m){if((m/=1)<(1/2.75)){return 7.5625*m*m}else{if(m<(2/2.75)){return 7.5625*(m-=(1.5/2.75))*m+0.75}else{if(m<(2.5/2.75)){return 7.5625*(m-=(2.25/2.75))*m+0.9375}else{return 7.5625*(m-=(2.625/2.75))*m+0.984375}}}}},elastic:{style:"",fn:function(m){var n=0.22,o=0.4;if(m===0){return 0}if(m==1){return 1}return(o*c.pow(2,-10*m)*c.sin((m-n/4)*(2*c.PI)/n)+1)}}});k.tap=function(o,m){var n=a.createEvent("Event");n.initEvent(m,true,true);n.pageX=o.pageX;n.pageY=o.pageY;o.target.dispatchEvent(n)};k.click=function(o){var n=o.target,m;if(!(/(SELECT|INPUT|TEXTAREA)/i).test(n.tagName)){m=a.createEvent("MouseEvents");m.initMouseEvent("click",true,true,o.view,1,n.screenX,n.screenY,n.clientX,n.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,0,null);m._constructed=true;n.dispatchEvent(m)}};return k})();function e(j,g){this.wrapper=typeof j=="string"?a.querySelector(j):j;this.scroller=this.wrapper.children[0];this.scrollerStyle=this.scroller.style;this.options={startX:0,startY:0,scrollY:true,directionLockThreshold:5,momentum:true,bounce:true,bounceTime:600,bounceEasing:"",preventDefault:true,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:true,useTransition:true,useTransform:true};for(var h in g){this.options[h]=g[h]}this.translateZ=this.options.HWCompositing&&b.hasPerspective?" translateZ(0)":"";this.options.useTransition=b.hasTransition&&this.options.useTransition;this.options.useTransform=b.hasTransform&&this.options.useTransform;this.options.eventPassthrough=this.options.eventPassthrough===true?"vertical":this.options.eventPassthrough;this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault;this.options.scrollY=this.options.eventPassthrough=="vertical"?false:this.options.scrollY;this.options.scrollX=this.options.eventPassthrough=="horizontal"?false:this.options.scrollX;this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough;this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold;this.options.bounceEasing=typeof this.options.bounceEasing=="string"?b.ease[this.options.bounceEasing]||b.ease.circular:this.options.bounceEasing;this.options.resizePolling=this.options.resizePolling===undefined?60:this.options.resizePolling;if(this.options.tap===true){this.options.tap="tap"}this.x=0;this.y=0;this.directionX=0;this.directionY=0;this._events={};this._init();this.refresh();this.scrollTo(this.options.startX,this.options.startY);this.enable()}e.prototype={version:"5.1.3",_init:function(){this._initEvents()},destroy:function(){this._initEvents(true);this._execEvent("destroy")},_transitionEnd:function(g){if(g.target!=this.scroller||!this.isInTransition){return}this._transitionTime();if(!this.resetPosition(this.options.bounceTime)){this.isInTransition=false;this._execEvent("scrollEnd")}},_start:function(h){if(b.eventType[h.type]!=1){if(h.button!==0){return}}if(!this.enabled||(this.initiated&&b.eventType[h.type]!==this.initiated)){return}if(this.options.preventDefault&&!b.isBadAndroid&&!b.preventDefaultException(h.target,this.options.preventDefaultException)){h.preventDefault()}var g=h.touches?h.touches[0]:h,i;this.initiated=b.eventType[h.type];this.moved=false;this.distX=0;this.distY=0;this.directionX=0;this.directionY=0;this.directionLocked=0;this._transitionTime();this.startTime=b.getTime();if(this.options.useTransition&&this.isInTransition){this.isInTransition=false;i=this.getComputedPosition();this._translate(c.round(i.x),c.round(i.y));this._execEvent("scrollEnd")}else{if(!this.options.useTransition&&this.isAnimating){this.isAnimating=false;this._execEvent("scrollEnd")}}this.startX=this.x;this.startY=this.y;this.absStartX=this.x;this.absStartY=this.y;this.pointX=g.pageX;this.pointY=g.pageY;this._execEvent("beforeScrollStart")},_move:function(l){if(!this.enabled||b.eventType[l.type]!==this.initiated){return}if(this.options.preventDefault){l.preventDefault()}var n=l.touches?l.touches[0]:l,i=n.pageX-this.pointX,h=n.pageY-this.pointY,m=b.getTime(),g,o,k,j;this.pointX=n.pageX;this.pointY=n.pageY;this.distX+=i;this.distY+=h;k=c.abs(this.distX);j=c.abs(this.distY);if(m-this.endTime>300&&(k<10&&j<10)){return}if(!this.directionLocked&&!this.options.freeScroll){if(k>j+this.options.directionLockThreshold){this.directionLocked="h"}else{if(j>=k+this.options.directionLockThreshold){this.directionLocked="v"}else{this.directionLocked="n"}}}if(this.directionLocked=="h"){if(this.options.eventPassthrough=="vertical"){l.preventDefault()}else{if(this.options.eventPassthrough=="horizontal"){this.initiated=false;return}}h=0}else{if(this.directionLocked=="v"){if(this.options.eventPassthrough=="horizontal"){l.preventDefault()}else{if(this.options.eventPassthrough=="vertical"){this.initiated=false;return}}i=0}}i=this.hasHorizontalScroll?i:0;h=this.hasVerticalScroll?h:0;g=this.x+i;o=this.y+h;if(g>0||g0?0:this.maxScrollX}if(o>0||o0?0:this.maxScrollY}this.directionX=i>0?-1:i<0?1:0;this.directionY=h>0?-1:h<0?1:0;if(!this.moved){this._execEvent("scrollStart")}this.moved=true;this._translate(g,o);if(m-this.startTime>300){this.startTime=m;this.startX=this.x;this.startY=this.y}},_end:function(l){if(!this.enabled||b.eventType[l.type]!==this.initiated){return}if(this.options.preventDefault&&!b.preventDefaultException(l.target,this.options.preventDefaultException)){l.preventDefault()}var n=l.changedTouches?l.changedTouches[0]:l,i,h,k=b.getTime()-this.startTime,g=c.round(this.x),q=c.round(this.y),p=c.abs(g-this.startX),o=c.abs(q-this.startY),j=0,m="";this.isInTransition=0;this.initiated=0;this.endTime=b.getTime();if(this.resetPosition(this.options.bounceTime)){return}this.scrollTo(g,q);if(!this.moved){if(this.options.tap){b.tap(l,this.options.tap)}if(this.options.click){b.click(l)}this._execEvent("scrollCancel");return}if(this._events.flick&&k<200&&p<100&&o<100){this._execEvent("flick");return}if(this.options.momentum&&k<300){i=this.hasHorizontalScroll?b.momentum(this.x,this.startX,k,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:g,duration:0};h=this.hasVerticalScroll?b.momentum(this.y,this.startY,k,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:q,duration:0};g=i.destination;q=h.destination;j=c.max(i.duration,h.duration);this.isInTransition=1}if(g!=this.x||q!=this.y){if(g>0||g0||q0){g=0}else{if(this.x0){i=0}else{if(this.y-1){this._events[i].splice(g,1)}},_execEvent:function(j){if(!this._events[j]){return}var h=0,g=this._events[j].length;if(!g){return}for(;h0;if(!h||(this.options.useTransition&&i.style)){this._transitionTimingFunction(i.style);this._transitionTime(h);this._translate(g,j)}else{this._animate(g,j,h,i.fn)}},scrollToElement:function(h,i,g,l,k){h=h.nodeType?h:this.scroller.querySelector(h);if(!h){return}var j=b.offset(h);j.left-=this.wrapperOffset.left;j.top-=this.wrapperOffset.top;if(g===true){g=c.round(h.offsetWidth/2-this.wrapper.offsetWidth/2)}if(l===true){l=c.round(h.offsetHeight/2-this.wrapper.offsetHeight/2)}j.left-=g||0;j.top-=l||0;j.left=j.left>0?0:j.left0?0:j.top=n){m.isAnimating=false;m._translate(p,o);if(!m.resetPosition(m.options.bounceTime)){m._execEvent("scrollEnd")}return}q=(q-h)/j;t=g(q);s=(p-l)*t+l;r=(o-k)*t+k;m._translate(s,r);if(m.isAnimating){f(i)}}this.isAnimating=true;i()},handleEvent:function(g){switch(g.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(g);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(g);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(g);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(g);break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._wheel(g);break;case"keydown":this._key(g);break;case"click":if(!g._constructed){g.preventDefault();g.stopPropagation()}break}}};e.utils=b;if(typeof module!="undefined"&&module.exports){module.exports=e}else{d.IScroll=e}})(window,document,Math); (function(a,b,c){if(typeof module!=="undefined"&&module.exports){module.exports=b(a,c)}else{if(typeof define==="function"&&define.amd){define(b(a,c))}else{a.TagNav=b.call(a,a,c)}}})(this,function(a,e){var b=(function(){var d={};return{subscribe:function(g,h){if(!d[g]){d[g]={queue:[]}}var f=d[g].queue.push(h)-1;return(function(j,i){return{remove:function(){delete d[j].queue[i]}}})(g,f)},publish:function(h,k){if(!d[h]||!d[h].queue.length){return}var g=d[h].queue;for(var j=0,f=g.length;jf,l=d.$items.eq(k.index)[j?"next":"prev"](),m=l.offset()||d.$items.eq(k.index).offset(),i=$(d.el).offset(),h;if(j?m.left+m.width>i.left+i.width:m.left