/*! lightgallery - v1.2.21 - 2016-06-28 * http://sachinchoolur.github.io/lightGallery/ * Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ (e=>{"use strict";var o={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"};e.fn.lightGallery.modules.autoplay=class{constructor(r){return this.core=e(r).data("lightGallery"),this.$el=e(r),!(this.core.$items.length<2)&&(this.core.s=e.extend({},o,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)}init(){var e=this;e.core.s.autoplayControls&&e.controls(),e.core.s.progressBar&&e.core.$outer.find(".lg").append('
'),e.progress(),e.core.s.autoplay&&e.startlAuto(),e.$el.on("onDragstart.lg.tm touchstart.lg.tm",()=>{e.interval&&(e.cancelAuto(),e.canceledOnTouch=!0)}),e.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",()=>{!e.interval&&e.canceledOnTouch&&(e.startlAuto(),e.canceledOnTouch=!1)})}progress(){var e,o,r=this;r.$el.on("onBeforeSlide.lg.tm",()=>{r.core.s.progressBar&&r.fromAuto&&(e=r.core.$outer.find(".lg-progress-bar"),o=r.core.$outer.find(".lg-progress"),r.interval&&(o.removeAttr("style"),e.removeClass("lg-start"),setTimeout(()=>{o.css("transition","width "+(r.core.s.speed+r.core.s.pause)+"ms ease 0s"),e.addClass("lg-start")},20))),r.fromAuto||r.core.s.fourceAutoplay||r.cancelAuto(),r.fromAuto=!1})}controls(){var o=this;e(this.core.s.appendAutoplayControlsTo).append(''),o.core.$outer.find(".lg-autoplay-button").on("click.lg",()=>{e(o.core.$outer).hasClass("lg-show-autoplay")?(o.cancelAuto(),o.core.s.fourceAutoplay=!1):o.interval||(o.startlAuto(),o.core.s.fourceAutoplay=o.fourceAutoplayTemp)})}startlAuto(){var e=this;e.core.$outer.find(".lg-progress").css("transition","width "+(e.core.s.speed+e.core.s.pause)+"ms ease 0s"),e.core.$outer.addClass("lg-show-autoplay"),e.core.$outer.find(".lg-progress-bar").addClass("lg-start"),e.interval=setInterval(()=>{e.core.index+1