/* * Glide.js v3.4.1 * (c) 2013-2019 Jdrzej Chaubek (http://jedrzejchalubek.com/) * Released under the MIT License. */ (function(b,a){typeof exports==="object"&&typeof module!=="undefined"?module.exports=a():typeof define==="function"&&define.amd?define(a):(b.Glide=a())}(this,(function(){var n={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:false,hoverpause:true,keyboard:true,bound:false,swipeThreshold:80,dragThreshold:120,perTouch:false,touchRatio:0.5,touchAngle:45,animationDuration:400,rewind:true,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",throttle:10,direction:"ltr",peek:0,breakpoints:{},classes:{direction:{ltr:"glide--ltr",rtl:"glide--rtl"},slider:"glide--slider",carousel:"glide--carousel",swipeable:"glide--swipeable",dragging:"glide--dragging",cloneSlide:"glide__slide--clone",activeNav:"glide__bullet--active",activeSlide:"glide__slide--active",disabledArrow:"glide__arrow--disabled"}};function at(e){console.error("[Glide warn]: "+e)}var b=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var h=function(au,e){if(!(au instanceof e)){throw new TypeError("Cannot call a class as a function")}};var m=function(){function e(ax,aw){for(var av=0;av0&&arguments[0]!==undefined?arguments[0]:{};h(this,au);this.events=aw;this.hop=aw.hasOwnProperty}m(au,[{key:"on",value:function av(aw,ax){if(G(aw)){for(var ay=0;ay1&&arguments[1]!==undefined?arguments[1]:{};h(this,ax);this._c={};this._t=[];this._e=new t();this.disabled=false;this.selector=aJ;this.settings=O(n,aI);this.index=this.settings.startAt}m(ax,[{key:"mount",value:function aA(){var aI=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this._e.emit("mount.before");if(J(aI)){this._c=P(this,aI,this._e)}else{at("You need to provide a object on `mount()`")}this._e.emit("mount.after");return this}},{key:"mutate",value:function aC(){var aI=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(G(aI)){this._t=aI}else{at("You need to provide a array on `mutate()`")}return this}},{key:"update",value:function aH(){var aI=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.settings=O(this.settings,aI);if(aI.hasOwnProperty("startAt")){this.index=aI.startAt}this._e.emit("update");return this}},{key:"go",value:function ay(aI){this._c.Run.make(aI);return this}},{key:"move",value:function aB(aI){this._c.Transition.disable();this._c.Move.make(aI);return this}},{key:"destroy",value:function e(){this._e.emit("destroy");return this}},{key:"play",value:function aF(){var aI=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(aI){this.settings.autoplay=aI}this._e.emit("play");return this}},{key:"pause",value:function aE(){this._e.emit("pause");return this}},{key:"disable",value:function au(){this.disabled=true;return this}},{key:"enable",value:function av(){this.disabled=false;return this}},{key:"on",value:function aD(aI,aJ){this._e.on(aI,aJ);return this}},{key:"isType",value:function az(aI){return this.settings.type===aI}},{key:"settings",get:function aw(){return this._o},set:function aG(aI){if(J(aI)){this._o=aI}else{at("Options must be an `object` instance.")}}},{key:"index",get:function aw(){return this._i},set:function aG(aI){this._i=an(aI)}},{key:"type",get:function aw(){return this.settings.type}},{key:"disabled",get:function aw(){return this._d},set:function aG(aI){this._d=!!aI}}]);return ax}();function ac(ax,au,av){var aD={mount:function aC(){this._o=false},make:function aB(aG){var aF=this;if(!ax.disabled){ax.disable();this.move=aG;av.emit("run.before",this.move);this.calculate();av.emit("run",this.move);au.Transition.after(function(){if(aF.isStart()){av.emit("run.start",aF.move)}if(aF.isEnd()){av.emit("run.end",aF.move)}if(aF.isOffset("<")||aF.isOffset(">")){aF._o=false;av.emit("run.offset",aF.move)}av.emit("run.after",aF.move);ax.enable()})}},calculate:function e(){var aI=this.move,aH=this.length;var aJ=aI.steps,aG=aI.direction;var aF=I(an(aJ))&&an(aJ)!==0;switch(aG){case">":if(aJ===">"){ax.index=aH}else{if(this.isEnd()){if(!(ax.isType("slider")&&!ax.settings.rewind)){this._o=true;ax.index=0}}else{if(aF){ax.index+=Math.min(aH-ax.index,-an(aJ))}else{ax.index++}}}break;case"<":if(aJ==="<"){ax.index=0}else{if(this.isStart()){if(!(ax.isType("slider")&&!ax.settings.rewind)){this._o=true;ax.index=aH}}else{if(aF){ax.index-=Math.min(ax.index,an(aJ))}else{ax.index--}}}break;case"=":ax.index=aJ;break;default:at("Invalid direction pattern ["+aG+aJ+"] has been used");break}},isStart:function aA(){return ax.index===0},isEnd:function ay(){return ax.index===this.length},isOffset:function az(aF){return this._o&&this.move.direction===aF}};o(aD,"move",{get:function aw(){return this._m},set:function aE(aG){var aF=aG.substr(1);this._m={direction:aG.substr(0,1),steps:aF?an(aF)?an(aF):aF:0}}});o(aD,"length",{get:function aw(){var aG=ax.settings;var aF=au.Html.slides.length;if(ax.isType("slider")&&aG.focusAt!=="center"&&aG.bound){return aF-1-(an(aG.perView)-1)+an(aG.focusAt)}return aF-1}});o(aD,"offset",{get:function aw(){return this._o}});return aD}function V(){return new Date().getTime()}function al(av,aC,ax){var aB=void 0,au=void 0,e=void 0,az=void 0;var ay=0;if(!ax){ax={}}var aw=function aw(){ay=ax.leading===false?0:V();aB=null;az=av.apply(au,e);if(!aB){au=e=null}};var aA=function aA(){var aD=V();if(!ay&&ax.leading===false){ay=aD}var aE=aC-(aD-ay);au=this;e=arguments;if(aE<=0||aE>aC){if(aB){clearTimeout(aB);aB=null}ay=aD;az=av.apply(au,e);if(!aB){au=e=null}}else{if(!aB&&ax.trailing!==false){aB=setTimeout(aw,aE)}}return az};aA.cancel=function(){clearTimeout(aB);ay=0;aB=au=e=null};return aA}var N={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function y(ay,au,av){var aw={apply:function e(aD){for(var aB=0,aC=aD.length;aB0&&arguments[0]!==undefined?arguments[0]:0;this.offset=aC;au.emit("move",{movement:this.value});e.Transition.after(function(){au.emit("move.after",{movement:aB.value})})}};o(az,"offset",{get:function av(){return az._o},set:function aA(aB){az._o=!L(aB)?an(aB):0}});o(az,"translate",{get:function av(){return e.Sizes.slideWidth*aw.index}});o(az,"value",{get:function av(){var aB=this.offset;var aC=this.translate;if(e.Direction.is("rtl")){return aC+aB}return aC-aB}});au.on(["build.before","run"],function(){az.make()});return az}function ae(aw,e,au){var aA={setupSlides:function ay(){var aD=this.slideWidth+"px";var aC=e.Html.slides;for(var aB=0;aB0&&arguments[0]!==undefined?arguments[0]:[];var aO=aw.Html.slides;var aD=az.settings,aM=aD.perView,aF=aD.classes;var aL=+!!az.settings.peek;var aK=aM+aL;var aP=aO.slice(0,aK);var aH=aO.slice(-aK);for(var aN=0;aN0&&arguments[0]!==undefined?arguments[0]:{};h(this,au);this.listeners=ax}m(au,[{key:"on",value:function aw(aA,az,ay){var ax=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(K(aA)){aA=[aA]}for(var aB=0;aB2&&arguments[2]!==undefined?arguments[2]:false;if(K(az)){az=[az]}for(var aA=0;aA":"<","<":">","=":"="};function p(ay,au,aw){var av={mount:function aA(){this.value=ay.settings.direction},resolve:function aC(aE){var aF=aE.slice(0,1);if(this.is("rtl")){return aE.split(aF).join(v[aF])}return aE},is:function az(aE){return this.value===aE},addClass:function e(){au.Html.root.classList.add(ay.settings.classes.direction[this.value])},removeClass:function aB(){au.Html.root.classList.remove(ay.settings.classes.direction[this.value])}};o(av,"value",{get:function ax(){return av._v},set:function aD(aE){if(ar.indexOf(aE)>-1){av._v=aE}else{at("Direction value must be `ltr` or `rtl`")}}});aw.on(["destroy","update"],function(){av.removeClass()});aw.on("update",function(){av.mount()});aw.on(["build.before","update"],function(){av.addClass()});return av}function ab(au,e){return{modify:function av(aw){if(e.Direction.is("rtl")){return -aw}return aw}}}function x(au,e){return{modify:function av(aw){return aw+e.Gaps.value*au.index}}}function C(au,e){return{modify:function av(aw){return aw+e.Clones.grow/2}}}function Y(au,e){return{modify:function av(ax){if(au.settings.focusAt>=0){var aw=e.Peek.value;if(J(aw)){return ax-aw.before}return ax-aw}return ax}}}function w(au,e){return{modify:function av(az){var ax=e.Gaps.value;var aA=e.Sizes.width;var aw=au.settings.focusAt;var ay=e.Sizes.slideWidth;if(aw==="center"){return az-(aA/2-ay/2)}return az-ay*aw-ax*aw}}}function T(av,e,au){var ax=[x,C,Y,w].concat(av._t,[ab]);return{mutate:function aw(aA){for(var ay=0;ay")){e.Transition.after(function(){au.emit("translate.jump");ay.set(0)});return ay.set(aC*aB+aA*aB)}return ay.set(az.movement)});au.on("destroy",function(){ay.remove()});return ay}function ap(aB,au,az){var ax=false;var aE={compose:function av(aF){var aG=aB.settings;if(!ax){return aF+" "+this.duration+"ms "+aG.animationTimingFunc}return aF+" 0ms "+aG.animationTimingFunc},set:function aD(){var aF=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"transform";au.Html.wrapper.style.transition=this.compose(aF)},remove:function aC(){au.Html.wrapper.style.transition=""},after:function e(aF){setTimeout(function(){aF()},this.duration)},enable:function ay(){ax=false;this.set()},disable:function aw(){ax=true;this.set()}};o(aE,"duration",{get:function aA(){var aF=aB.settings;if(aB.isType("slider")&&au.Run.offset){return aF.rewindDuration}return aF.animationDuration}});az.on("move",function(){aE.set()});az.on(["build.before","resize","translate.jump"],function(){aE.disable()});az.on("run",function(){aE.enable()});az.on("destroy",function(){aE.remove()});return aE}var ai=false;try{var W=Object.defineProperty({},"passive",{get:function z(){ai=true}});window.addEventListener("testPassive",null,W);window.removeEventListener("testPassive",null,W)}catch(q){}var aj=ai;var ah=["touchstart","mousedown"];var S=["touchmove","mousemove"];var r=["touchend","touchcancel","mouseup","mouseleave"];var Q=["mousedown","mousemove","mouseup","mouseleave"];function ak(aE,ay,aD){var e=new s();var aJ=0;var aK=0;var aL=0;var aA=false;var ax=aj?{passive:true}:false;var aI={mount:function aF(){this.bindSwipeStart()},start:function aH(aR){if(!aA&&!aE.disabled){this.disable();var aS=this.touches(aR);aJ=null;aK=an(aS.pageX);aL=an(aS.pageY);this.bindSwipeMove();this.bindSwipeEnd();aD.emit("swipe.start")}},move:function aG(aT){if(!aE.disabled){var aR=aE.settings,a1=aR.touchAngle,a2=aR.touchRatio,aS=aR.classes;var aY=this.touches(aT);var aW=an(aY.pageX)-aK;var aX=an(aY.pageY)-aL;var aU=Math.abs(aW<<2);var aV=Math.abs(aX<<2);var a0=Math.sqrt(aU+aV);var aZ=Math.sqrt(aV);aJ=Math.asin(aZ/a0);if(aJ*180/Math.PIaX&&aV"+aT))}else{ay.Move.make()}}ay.Html.root.classList.remove(aS.classes.dragging);this.unbindSwipeMove();this.unbindSwipeEnd();aD.emit("swipe.end")}},bindSwipeStart:function aw(){var aR=this;var aS=aE.settings;if(aS.swipeThreshold){e.on(ah[0],ay.Html.wrapper,function(aT){aR.start(aT)},ax)}if(aS.dragThreshold){e.on(ah[1],ay.Html.wrapper,function(aT){aR.start(aT)},ax)}},unbindSwipeStart:function aQ(){e.off(ah[0],ay.Html.wrapper,ax);e.off(ah[1],ay.Html.wrapper,ax)},bindSwipeMove:function av(){var aR=this;e.on(S,ay.Html.wrapper,al(function(aS){aR.move(aS)},aE.settings.throttle),ax)},unbindSwipeMove:function aP(){e.off(S,ay.Html.wrapper,ax)},bindSwipeEnd:function au(){var aR=this;e.on(r,ay.Html.wrapper,function(aS){aR.end(aS)})},unbindSwipeEnd:function aO(){e.off(r,ay.Html.wrapper)},touches:function aN(aR){if(Q.indexOf(aR.type)>-1){return aR}return aR.touches[0]||aR.changedTouches[0]},threshold:function aM(aR){var aS=aE.settings;if(Q.indexOf(aR.type)>-1){return aS.dragThreshold}return aS.swipeThreshold},enable:function aB(){aA=false;ay.Transition.enable();return this},disable:function az(){aA=true;ay.Transition.disable();return this}};aD.on("build.after",function(){ay.Html.root.classList.add(aE.settings.classes.swipeable)});aD.on("destroy",function(){aI.unbindSwipeStart();aI.unbindSwipeMove();aI.unbindSwipeEnd();e.destroy()});return aI}function E(ay,av,ax){var au=new s();var az={mount:function aA(){this.bind()},bind:function e(){au.on("dragstart",av.Html.wrapper,this.dragstart)},unbind:function aB(){au.off("dragstart",av.Html.wrapper)},dragstart:function aw(aC){aC.preventDefault()}};ax.on("destroy",function(){az.unbind();au.destroy()});return az}function c(aD,ay,aB){var aw=new s();var aA=false;var aF=false;var e={mount:function aE(){this._a=ay.Html.wrapper.querySelectorAll("a");this.bind()},bind:function av(){aw.on("click",ay.Html.wrapper,this.click)},unbind:function aG(){aw.off("click",ay.Html.wrapper)},click:function ax(aH){if(aF){aH.stopPropagation();aH.preventDefault()}},detach:function az(){aF=true;if(!aA){for(var aH=0;aH"))}if(aC.keyCode===37){av.Run.make(av.Direction.resolve("<"))}}};aw.on(["destroy","update"],function(){ay.unbind()});aw.on("update",function(){ay.mount()});aw.on("destroy",function(){au.destroy()});return ay}function d(az,aw,ax){var av=new s();var e={mount:function aA(){this.start();if(az.settings.hoverpause){this.bind()}},start:function aB(){var aE=this;if(az.settings.autoplay){if(L(this._i)){this._i=setInterval(function(){aE.stop();aw.Run.make(">");aE.start()},this.time)}}},stop:function aC(){this._i=clearInterval(this._i)},bind:function au(){var aE=this;av.on("mouseover",aw.Html.root,function(){aE.stop()});av.on("mouseout",aw.Html.root,function(){aE.start()})},unbind:function aD(){av.off(["mouseover","mouseout"],aw.Html.root)}};o(e,"time",{get:function ay(){var aE=aw.Html.slides[az.index].getAttribute("data-glide-autoplay");if(aE){return an(aE)}return an(az.settings.autoplay)}});ax.on(["destroy","update"],function(){e.unbind()});ax.on(["run.before","pause","destroy","swipe.start","update"],function(){e.stop()});ax.on(["run.after","play","swipe.end"],function(){e.start()});ax.on("update",function(){e.mount()});ax.on("destroy",function(){av.destroy()});return e}function af(e){if(J(e)){return ag(e)}else{at("Breakpoints option must be an object")}return{}}function f(ay,av,ax){var e=new s();var aB=ay.settings;var aA=af(aB.breakpoints);var aw=a({},aB);var au={match:function az(aD){if(typeof window.matchMedia!=="undefined"){for(var aC in aD){if(aD.hasOwnProperty(aC)){if(window.matchMedia("(max-width: "+aC+"px)").matches){return aD[aC]}}}}return aw}};a(aB,au.match(aA));e.on("resize",window,al(function(){ay.settings=O(aB,au.match(aA))},ay.settings.throttle));ax.on("update",function(){aA=af(aA);aw=a({},aB)});ax.on("destroy",function(){e.off("resize",window)});return au}var j={Html:D,Translate:aq,Transition:ap,Direction:p,Peek:X,Sizes:ae,Gaps:y,Move:R,Clones:i,Resize:aa,Build:g,Run:ac,Swipe:ak,Images:E,Anchors:c,Controls:k,Keyboard:M,Autoplay:d,Breakpoints:f};var B=function(e){F(au,e);function au(){h(this,au);return Z(this,(au.__proto__||Object.getPrototypeOf(au)).apply(this,arguments))}m(au,[{key:"mount",value:function av(){var aw=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return z(au.prototype.__proto__||Object.getPrototypeOf(au.prototype),"mount",this).call(this,a({},j,aw))}}]);return au}(A);return B})));