/*! lightgallery - v1.6.10 - 2018-05-01
* http://sachinchoolur.github.io/lightgallery/
* copyright (c) 2018 sachin n; licensed gplv3 */
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jquery)}(this,function(a){!function(){"use strict";function b(b,d){if(this.el=b,this.$el=a(b),this.s=a.extend({},c,d),this.s.dynamic&&"undefined"!==this.s.dynamicel&&this.s.dynamicel.constructor===array&&!this.s.dynamicel.length)throw"when using dynamic mode, you must also define dynamicel as an array.";return this.modules={},this.lgalleryon=!1,this.lgbusy=!1,this.hidebartimeout=!1,this.istouch="ontouchstart"in document.documentelement,this.s.slideendanimatoin&&(this.s.hidecontrolonend=!1),this.$slide="",this.$outer="",this.init(),this}var c={mode:"lg-slide",csseasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addclass:"",startclass:"lg-start-zoom",backdropduration:150,hidebarsdelay:6e3,useleft:!1,closable:!0,loop:!0,esckey:!0,keypress:!0,controls:!0,slideendanimatoin:!0,hidecontrolonend:!1,mousewheel:!0,getcaptionfromtitleoralt:!0,appendsubhtmlto:".lg-sub-html",subhtmlselectorrelative:!1,preload:1,showafterload:!0,selector:"",selectwithin:"",nexthtml:"",prevhtml:"",index:!1,iframemaxwidth:"100%",download:!0,counter:!0,appendcounterto:".lg-toolbar",swipethreshold:50,enableswipe:!0,enabledrag:!0,dynamic:!1,dynamicel:[],galleryid:1};b.prototype.init=function(){this.s.dynamic?this.$items=this.s.dynamicel:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectwithin?this.$items=a(this.s.selectwithin).find(this.s.selector):this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children();var b=this;b.s.preload>b.$items.length&&(b.s.preload=b.$items.length);var c=window.location.hash;c.indexof("lg="+this.s.galleryid)>0&&(b.index=parseint(c.split("&slide=")[1],10),a("body").addclass("lg-from-hash"),a("body").hasclass("lg-on")||(settimeout(function(){b.build(b.index)}),a("body").addclass("lg-on"))),b.s.dynamic?(b.$el.trigger("onbeforeopen.lg"),b.index=b.s.index||0,a("body").hasclass("lg-on")||settimeout(function(){b.build(b.index),a("body").addclass("lg-on")})):b.$items.on("click.lgcustom",function(c){try{c.preventdefault(),c.preventdefault()}catch(a){c.returnvalue=!1}b.$el.trigger("onbeforeopen.lg"),b.index=b.s.index||b.$items.index(this),a("body").hasclass("lg-on")||(b.build(b.index),a("body").addclass("lg-on"))})},b.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightgallery.modules,function(b){c.modules[b]=new a.fn.lightgallery.modules[b](c.el)}),c.slide(b,!1,!1,!1),c.s.keypress&&c.keypress(),c.$items.length>1?(c.arrow(),settimeout(function(){c.enabledrag(),c.enableswipe()},50),c.s.mousewheel&&c.mousewheel()):c.$slide.on("click.lg",function(){c.$el.trigger("onslideclick.lg")}),c.counter(),c.closegallery(),c.$el.trigger("onafteropen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeclass("lg-hide-items"),cleartimeout(c.hidebartimeout),c.hidebartimeout=settimeout(function(){c.$outer.addclass("lg-hide-items")},c.s.hidebarsdelay)}),c.$outer.trigger("mousemove.lg")},b.prototype.structure=function(){var b,c="",d="",e=0,f="",g=this;for(a("body").append('
'),a(".lg-backdrop").css("transition-duration",this.s.backdropduration+"ms"),e=0;e';if(this.s.controls&&this.$items.length>1&&(d='"),".lg-sub-html"===this.s.appendsubhtmlto&&(f=''),b='",a("body").append(b),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useleft?(this.$outer.addclass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addclass("lg-use-css3"),g.settop(),a(window).on("resize.lg orientationchange.lg",function(){settimeout(function(){g.settop()},100)}),this.$slide.eq(this.index).addclass("lg-current"),this.docss()?this.$outer.addclass("lg-css3"):(this.$outer.addclass("lg-css"),this.s.speed=0),this.$outer.addclass(this.s.mode),this.s.enabledrag&&this.$items.length>1&&this.$outer.addclass("lg-grab"),this.s.showafterload&&this.$outer.addclass("lg-show-after-load"),this.docss()){var h=this.$outer.find(".lg-inner");h.css("transition-timing-function",this.s.csseasing),h.css("transition-duration",this.s.speed+"ms")}settimeout(function(){a(".lg-backdrop").addclass("in")}),settimeout(function(){g.$outer.addclass("lg-visible")},this.s.backdropduration),this.s.download&&this.$outer.find(".lg-toolbar").append(''),this.prevscrolltop=a(window).scrolltop()},b.prototype.settop=function(){if("100%"!==this.s.height){var b=a(window).height(),c=(b-parseint(this.s.height,10))/2,d=this.$outer.find(".lg");b>=parseint(this.s.height,10)?d.css("top",c+"px"):d.css("top","0px")}},b.prototype.docss=function(){return!!function(){var a=["transition","moztransition","webkittransition","otransition","mstransition","khtmltransition"],b=document.documentelement,c=0;for(c=0;c'+(parseint(this.index,10)+1)+' / '+this.$items.length+"")},b.prototype.addhtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicel[b].subhtmlurl?c=this.s.dynamicel[b].subhtmlurl:e=this.s.dynamicel[b].subhtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getcaptionfromtitleoralt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if(void 0!==e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subhtmlselectorrelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendsubhtmlto?c?this.$outer.find(this.s.appendsubhtmlto).load(c):this.$outer.find(this.s.appendsubhtmlto).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),void 0!==e&&null!==e&&(""===e?this.$outer.find(this.s.appendsubhtmlto).addclass("lg-empty-html"):this.$outer.find(this.s.appendsubhtmlto).removeclass("lg-empty-html")),this.$el.trigger("onafterappendsubhtml.lg",[b])},b.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadcontent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadcontent(a-c,!1,0)},b.prototype.loadcontent=function(b,c,d){var e,f,g,h,i,j,k=this,l=!1,m=function(b){for(var c=[],d=[],e=0;eh){f=d[i];break}};if(k.s.dynamic){if(k.s.dynamicel[b].poster&&(l=!0,g=k.s.dynamicel[b].poster),j=k.s.dynamicel[b].html,f=k.s.dynamicel[b].src,k.s.dynamicel[b].responsive){m(k.s.dynamicel[b].responsive.split(","))}h=k.s.dynamicel[b].srcset,i=k.s.dynamicel[b].sizes}else{if(k.$items.eq(b).attr("data-poster")&&(l=!0,g=k.$items.eq(b).attr("data-poster")),j=k.$items.eq(b).attr("data-html"),f=k.$items.eq(b).attr("href")||k.$items.eq(b).attr("data-src"),k.$items.eq(b).attr("data-responsive")){m(k.$items.eq(b).attr("data-responsive").split(","))}h=k.$items.eq(b).attr("data-srcset"),i=k.$items.eq(b).attr("data-sizes")}var n=!1;k.s.dynamic?k.s.dynamicel[b].iframe&&(n=!0):"true"===k.$items.eq(b).attr("data-iframe")&&(n=!0);var o=k.isvideo(f,b);if(!k.$slide.eq(b).hasclass("lg-loaded")){if(n)k.$slide.eq(b).prepend('');else if(l){var p="";p=o&&o.youtube?"lg-has-youtube":o&&o.vimeo?"lg-has-vimeo":"lg-has-html5",k.$slide.eq(b).prepend('')}else o?(k.$slide.eq(b).prepend(''),k.$el.trigger("hasvideo.lg",[b,f,j])):k.$slide.eq(b).prepend('');if(k.$el.trigger("onaferappendslide.lg",[b]),e=k.$slide.eq(b).find(".lg-object"),i&&e.attr("sizes",i),h){e.attr("srcset",h);try{picturefill({elements:[e[0]]})}catch(a){console.warn("lightgallery :- if you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.")}}".lg-sub-html"!==this.s.appendsubhtmlto&&k.addhtml(b),k.$slide.eq(b).addclass("lg-loaded")}k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){var c=0;d&&!a("body").hasclass("lg-from-hash")&&(c=d),settimeout(function(){k.$slide.eq(b).addclass("lg-complete"),k.$el.trigger("onslideitemload.lg",[b,d||0])},c)}),o&&o.html5&&!l&&k.$slide.eq(b).addclass("lg-complete"),!0===c&&(k.$slide.eq(b).hasclass("lg-complete")?k.preload(b):k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){k.preload(b)}))},b.prototype.slide=function(b,c,d,e){var f=this.$outer.find(".lg-current").index(),g=this;if(!g.lgalleryon||f!==b){var h=this.$slide.length,i=g.lgalleryon?this.s.speed:0;if(!g.lgbusy){if(this.s.download){var j;j=g.s.dynamic?!1!==g.s.dynamicel[b].downloadurl&&(g.s.dynamicel[b].downloadurl||g.s.dynamicel[b].src):"false"!==g.$items.eq(b).attr("data-download-url")&&(g.$items.eq(b).attr("data-download-url")||g.$items.eq(b).attr("href")||g.$items.eq(b).attr("data-src2")||g.$items.eq(b).attr("data-src")),j?(a("#lg-download").attr("href",j),g.$outer.removeclass("lg-hide-download")):g.$outer.addclass("lg-hide-download")}if(this.$el.trigger("onbeforeslide.lg",[f,b,c,d]),g.lgbusy=!0,cleartimeout(g.hidebartimeout),".lg-sub-html"===this.s.appendsubhtmlto&&settimeout(function(){g.addhtml(b)},i),this.arrowdisable(b),e||(bf&&(e="next")),c){this.$slide.removeclass("lg-prev-slide lg-current lg-next-slide");var k,l;h>2?(k=b-1,l=b+1,0===b&&f===h-1?(l=0,k=h-1):b===h-1&&0===f&&(l=0,k=h-1)):(k=0,l=1),"prev"===e?g.$slide.eq(l).addclass("lg-next-slide"):g.$slide.eq(k).addclass("lg-prev-slide"),g.$slide.eq(b).addclass("lg-current")}else g.$outer.addclass("lg-no-trans"),this.$slide.removeclass("lg-prev-slide lg-next-slide"),"prev"===e?(this.$slide.eq(b).addclass("lg-prev-slide"),this.$slide.eq(f).addclass("lg-next-slide")):(this.$slide.eq(b).addclass("lg-next-slide"),this.$slide.eq(f).addclass("lg-prev-slide")),settimeout(function(){g.$slide.removeclass("lg-current"),g.$slide.eq(b).addclass("lg-current"),g.$outer.removeclass("lg-no-trans")},50);g.lgalleryon?(settimeout(function(){g.loadcontent(b,!0,0)},this.s.speed+50),settimeout(function(){g.lgbusy=!1,g.$el.trigger("onafterslide.lg",[f,b,c,d])},this.s.speed)):(g.loadcontent(b,!0,g.s.backdropduration),g.lgbusy=!1,g.$el.trigger("onafterslide.lg",[f,b,c,d])),g.lgalleryon=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}g.index=b}},b.prototype.gotonextslide=function(a){var b=this,c=b.s.loop;a&&b.$slide.length<3&&(c=!1),b.lgbusy||(b.index+10?(b.index--,b.$el.trigger("onbeforeprevslide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):c?(b.index=b.$items.length-1,b.$el.trigger("onbeforeprevslide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):b.s.slideendanimatoin&&!a&&(b.$outer.addclass("lg-left-end"),settimeout(function(){b.$outer.removeclass("lg-left-end")},400)))},b.prototype.keypress=function(){var b=this;this.$items.length>1&&a(window).on("keyup.lg",function(a){b.$items.length>1&&(37===a.keycode&&(a.preventdefault(),b.gotoprevslide()),39===a.keycode&&(a.preventdefault(),b.gotonextslide()))}),a(window).on("keydown.lg",function(a){!0===b.s.esckey&&27===a.keycode&&(a.preventdefault(),b.$outer.hasclass("lg-thumb-open")?b.$outer.removeclass("lg-thumb-open"):b.destroy())})},b.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.gotoprevslide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.gotonextslide()})},b.prototype.arrowdisable=function(a){!this.s.loop&&this.s.hidecontrolonend&&(a+10?this.$outer.find(".lg-prev").removeattr("disabled").removeclass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addclass("disabled"))},b.prototype.settranslate=function(a,b,c){this.s.useleft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},b.prototype.touchmove=function(b,c){var d=c-b;math.abs(d)>15&&(this.$outer.addclass("lg-dragging"),this.settranslate(this.$slide.eq(this.index),d,0),this.settranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.settranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},b.prototype.touchend=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addclass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),settimeout(function(){b.$outer.removeclass("lg-dragging"),a<0&&math.abs(a)>b.s.swipethreshold?b.gotonextslide(!0):a>0&&math.abs(a)>b.s.swipethreshold?b.gotoprevslide(!0):math.abs(a)<5&&b.$el.trigger("onslideclick.lg"),b.$slide.removeattr("style")}),settimeout(function(){b.$outer.hasclass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeclass("lg-slide")},b.s.speed+100)},b.prototype.enableswipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableswipe&&a.docss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasclass("lg-zoomed")||a.lgbusy||(c.preventdefault(),a.manageswipeclass(),b=c.originalevent.targettouches[0].pagex)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasclass("lg-zoomed")||(e.preventdefault(),c=e.originalevent.targettouches[0].pagex,a.touchmove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasclass("lg-zoomed")||(d?(d=!1,a.touchend(c-b)):a.$el.trigger("onslideclick.lg"))}))},b.prototype.enabledrag=function(){var b=this,c=0,d=0,e=!1,f=!1;b.s.enabledrag&&b.docss()&&(b.$slide.on("mousedown.lg",function(d){b.$outer.hasclass("lg-zoomed")||b.lgbusy||a(d.target).text().trim()||(d.preventdefault(),b.manageswipeclass(),c=d.pagex,e=!0,b.$outer.scrollleft+=1,b.$outer.scrollleft-=1,b.$outer.removeclass("lg-grab").addclass("lg-grabbing"),b.$el.trigger("ondragstart.lg"))}),a(window).on("mousemove.lg",function(a){e&&(f=!0,d=a.pagex,b.touchmove(c,d),b.$el.trigger("ondragmove.lg"))}),a(window).on("mouseup.lg",function(g){f?(f=!1,b.touchend(d-c),b.$el.trigger("ondragend.lg")):(a(g.target).hasclass("lg-object")||a(g.target).hasclass("lg-video-play"))&&b.$el.trigger("onslideclick.lg"),e&&(e=!1,b.$outer.removeclass("lg-grabbing").addclass("lg-grab"))}))},b.prototype.manageswipeclass=function(){var a=this.index+1,b=this.index-1;this.s.loop&&this.$slide.length>2&&(0===this.index?b=this.$slide.length-1:this.index===this.$slide.length-1&&(a=0)),this.$slide.removeclass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addclass("lg-prev-slide"),this.$slide.eq(a).addclass("lg-next-slide")},b.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltay&&(b.deltay>0?a.gotoprevslide():a.gotonextslide(),b.preventdefault())})},b.prototype.closegallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mousemove.lg",function(){c=!1}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasclass("lg-dragging")||b.destroy())}))},b.prototype.destroy=function(b){var c=this;b||(c.$el.trigger("onbeforeclose.lg"),a(window).scrolltop(c.prevscrolltop)),b&&(c.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removedata(c.el,"lightgallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightgallery.modules,function(a){c.modules[a]&&c.modules[a].destroy()}),this.lgalleryon=!1,cleartimeout(c.hidebartimeout),this.hidebartimeout=!1,a(window).off(".lg"),a("body").removeclass("lg-on lg-from-hash"),c.$outer&&c.$outer.removeclass("lg-visible"),a(".lg-backdrop").removeclass("in"),settimeout(function(){c.$outer&&c.$outer.remove(),a(".lg-backdrop").remove(),b||c.$el.trigger("oncloseafter.lg")},c.s.backdropduration+50)},a.fn.lightgallery=function(c){return this.each(function(){if(a.data(this,"lightgallery"))try{a(this).data("lightgallery").init()}catch(a){console.error("lightgallery has not initiated properly")}else a.data(this,"lightgallery",new b(this,c))})},a.fn.lightgallery.modules={}}()});