1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-12 11:26:17 +01:00
LocalCDN-Firefox-Chrome-Brave/resources/lightgallery/2.1.5/js/lightgallery.min.jsm
2021-06-13 06:29:48 +02:00

9 lines
42 KiB
JavaScript

/**
* lightgallery | 2.1.5 | June 12th 2021
* http://www.lightgalleryjs.com/
* Copyright (c) 2020 Sachin Neravath;
* @license GPLv3
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lightGallery=e()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r=(s.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},s.prototype._getSelector=function(t,e){return void 0===e&&(e=document),"string"!=typeof t?t:(e=e||document,"#"===t.substring(0,1)?e.querySelector(t):e.querySelectorAll(t))},s.prototype._each=function(t){return this.selector&&(void 0!==this.selector.length?[].forEach.call(this.selector,t):t(this.selector,0)),this},s.prototype._setCssVendorPrefix=function(t,e,i){e=e.replace(/-([a-z])/gi,function(t,e){return e.toUpperCase()});-1!==this.cssVenderPrefixes.indexOf(e)?(t.style[e.charAt(0).toLowerCase()+e.slice(1)]=i,t.style["webkit"+e]=i,t.style["moz"+e]=i,t.style["ms"+e]=i,t.style["o"+e]=i):t.style[e]=i},s.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},s.prototype.isEventMatched=function(t,e){var i=e.split(".");return t.split(".").filter(function(t){return t}).every(function(t){return-1!==i.indexOf(t)})},s.prototype.attr=function(e,i){return void 0===i?this.firstElement?this.firstElement.getAttribute(e):"":(this._each(function(t){t.setAttribute(e,i)}),this)},s.prototype.find=function(t){return C(this._getSelector(t,this.selector))},s.prototype.first=function(){return this.selector&&void 0!==this.selector.length?C(this.selector[0]):C(this.selector)},s.prototype.eq=function(t){return C(this.selector[t])},s.prototype.parent=function(){return C(this.selector.parentElement)},s.prototype.get=function(){return this._getFirstEl()},s.prototype.removeAttr=function(t){var i=t.split(" ");return this._each(function(e){i.forEach(function(t){return e.removeAttribute(t)})}),this},s.prototype.wrap=function(t){if(!this.firstElement)return this;var e=document.createElement("div");return e.className=t,this.firstElement.parentNode.insertBefore(e,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),e.appendChild(this.firstElement),this},s.prototype.addClass=function(t){return void 0===t&&(t=""),this._each(function(e){t.split(" ").forEach(function(t){e.classList.add(t)})}),this},s.prototype.removeClass=function(t){return this._each(function(e){t.split(" ").forEach(function(t){e.classList.remove(t)})}),this},s.prototype.hasClass=function(t){return!!this.firstElement&&this.firstElement.classList.contains(t)},s.prototype.hasAttribute=function(t){return!!this.firstElement&&this.firstElement.hasAttribute(t)},s.prototype.toggleClass=function(t){return this.firstElement&&(this.hasClass(t)?this.removeClass(t):this.addClass(t)),this},s.prototype.css=function(e,i){var s=this;return this._each(function(t){s._setCssVendorPrefix(t,e,i)}),this},s.prototype.on=function(t,e){var i=this;return this.selector&&t.split(" ").forEach(function(t){Array.isArray(s.eventListeners[t])||(s.eventListeners[t]=[]),s.eventListeners[t].push(e),i.selector.addEventListener(t.split(".")[0],e)}),this},s.prototype.once=function(t,e){var i=this;return this.on(t,function(){i.off(t),e(t)}),this},s.prototype.off=function(t){var i=this;return this.selector&&Object.keys(s.eventListeners).forEach(function(e){i.isEventMatched(t,e)&&(s.eventListeners[e].forEach(function(t){i.selector.removeEventListener(e.split(".")[0],t)}),s.eventListeners[e]=[])}),this},s.prototype.trigger=function(t,e){if(!this.firstElement)return this;e=new CustomEvent(t.split(".")[0],{detail:e||null});return this.firstElement.dispatchEvent(e),this},s.prototype.load=function(t){var e=this;return fetch(t).then(function(t){e.selector.innerHTML=t}),this},s.prototype.html=function(e){return void 0===e?this.firstElement?this.firstElement.innerHTML:"":(this._each(function(t){t.innerHTML=e}),this)},s.prototype.append=function(e){return this._each(function(t){"string"==typeof e?t.insertAdjacentHTML("beforeend",e):t.appendChild(e)}),this},s.prototype.prepend=function(e){return this._each(function(t){t.insertAdjacentHTML("afterbegin",e)}),this},s.prototype.remove=function(){return this._each(function(t){t.parentNode.removeChild(t)}),this},s.prototype.empty=function(){return this._each(function(t){t.innerHTML=""}),this},s.prototype.scrollTop=function(t){return void 0!==t?(document.body.scrollTop=t,document.documentElement.scrollTop=t,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},s.prototype.scrollLeft=function(t){return void 0!==t?(document.body.scrollLeft=t,document.documentElement.scrollLeft=t,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},s.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var t=this.firstElement.getBoundingClientRect(),e=C("body").style().marginLeft;return{left:t.left-parseFloat(e)+this.scrollLeft(),top:t.top+this.scrollTop()}},s.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},s.prototype.width=function(){var t=this.style();return this.firstElement.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)},s.prototype.height=function(){var t=this.style();return this.firstElement.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)},s.eventListeners={},s);function s(t){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(t),this.firstElement=this._getFirstEl(),this}function C(t){return new r(t)}var i=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];var I=function(t,e,i,s){void 0===i&&(i=0);var n=C(t).attr("data-lg-size")||s;if(n){var o=n.split(",");if(o[1])for(var r=window.innerWidth,l=0;l<o.length;l++){var a=o[l];if(r<parseInt(a.split("-")[2],10)){n=a;break}l===o.length-1&&(n=a)}var g=n.split("-"),t=parseInt(g[0],10),s=parseInt(g[1],10),g=e.width(),i=e.height()-i,g=Math.min(g,t),i=Math.min(i,s),i=Math.min(g/t,i/s);return{width:t*i,height:s*i}}},l=function(t,e,i,s,n){if(n){var o=C(t).find("img").first();if(o.get()){var r=e.get().getBoundingClientRect(),l=r.width,a=e.height()-(i+s),t=o.width(),e=o.height(),s=o.style(),r=(l-t)/2-o.offset().left+(parseFloat(s.paddingLeft)||0)+(parseFloat(s.borderLeft)||0)+C(window).scrollLeft()+r.left,i=(a-e)/2-o.offset().top+(parseFloat(s.paddingTop)||0)+(parseFloat(s.borderTop)||0)+C(window).scrollTop()+i;return"translate3d("+(r*=-1)+"px, "+(i*=-1)+"px, 0) scale3d("+t/n.width+", "+e/n.height+", 1)"}}},x=function(t,e,i,s){return'<div class="lg-video-cont lg-has-iframe" style="width:'+e+"; height: "+i+'">\n <iframe class="lg-object" frameborder="0" '+(s?'title="'+s+'"':"")+' src="'+t+'" allowfullscreen="true"></iframe>\n </div>'},w=function(t,e,i,s,n,o){t="<img "+i+" "+(s?'srcset="'+s+'"':"")+" "+(n?'sizes="'+n+'"':"")+' class="lg-object lg-image" data-index="'+t+'" src="'+e+'" />',e="";return o&&(e=("string"==typeof o?JSON.parse(o):o).map(function(e){var i="";return Object.keys(e).forEach(function(t){i+=" "+t+'="'+e[t]+'"'}),"<source "+i+"></source>"})),e+t},S=function(t){for(var e=[],i=[],s="",n=0;n<t.length;n++){var o=t[n].split(" ");""===o[0]&&o.splice(0,1),i.push(o[0]),e.push(o[1])}for(var r=window.innerWidth,l=0;l<e.length;l++)if(parseInt(e[l],10)>r){s=i[l];break}return s},T=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},E=function(t,e,i,s){return'<div class="lg-video-cont '+(s&&s.youtube?"lg-has-youtube":s&&s.vimeo?"lg-has-vimeo":"lg-has-html5")+'" style="'+i+'">\n <div class="lg-video-play-button">\n <svg\n viewBox="0 0 20 20"\n preserveAspectRatio="xMidYMid"\n focusable="false"\n aria-labelledby="Play video"\n role="img"\n class="lg-video-play-icon"\n >\n <title>Play video</title>\n <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n </svg>\n <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle></svg>\n <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle>\n </svg>\n </div>\n '+(e||"")+'\n <img class="lg-object lg-video-poster" src="'+t+'" />\n </div>'},n=function(t,e,g,h){var d=[],c=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var s=Array(t),n=0,e=0;e<i;e++)for(var o=arguments[e],r=0,l=o.length;r<l;r++,n++)s[n]=o[r];return s}(i,e);return[].forEach.call(t,function(t){for(var e={},i=0;i<t.attributes.length;i++){var s,n,o=t.attributes[i];o.specified&&(s="href"===(n=o.name)?"src":n=(n=(n=n.replace("data-","")).charAt(0).toLowerCase()+n.slice(1)).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()}),n="",-1<c.indexOf(s)&&(n=s),n&&(e[n]=o.value))}var r=C(t),l=r.find("img").first().attr("alt"),a=r.attr("title"),r=h?r.attr(h):r.find("img").first().attr("src");e.thumb=r,g&&!e.subHtml&&(e.subHtml=a||l||""),e.alt=l||a||"",d.push(e)}),d},o=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},a={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:document.body,startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[]},O="lgAfterAppendSlide",g="lgInit",L="lgHasVideo",h="lgContainerResize",d="lgUpdateSlides",c="lgAfterAppendSubHtml",u="lgBeforeOpen",m="lgAfterOpen",p="lgSlideItemLoad",f="lgBeforeSlide",y="lgAfterSlide",v="lgPosterClick",b="lgDragStart",D="lgDragMove",z="lgDragEnd",G="lgBeforeNextSlide",M="lgBeforePrevSlide",k="lgBeforeClose",A="lgAfterClose",B=0,P=(t.prototype.generateSettings=function(t){this.settings=e(e({},a),t),(this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():o())&&(t=e(e({},this.settings.mobileSettings),this.settings.mobileSettings),this.settings=e(e({},this.settings),t))},t.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},t.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(g,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout(function(){t.enableDrag(),t.enableSwipe()},50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},t.prototype.openGalleryOnItemClick=function(){for(var n=this,o=this,t=0;t<this.items.length;t++)!function(e){var i=o.items[e],t=C(i),s=r.generateUUID();t.attr("data-lg-id",s).on("click.lgcustom-item-"+s,function(t){t.preventDefault();t=n.settings.index||e;n.openGallery(t,i)})}(t)},t.prototype.buildModules=function(){var e=this;this.settings.plugins.forEach(function(t){e.plugins.push(new t(e,C))})},t.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},t.prototype.getSlideItem=function(t){return C(this.getSlideItemId(t))},t.prototype.getSlideItemId=function(t){return"#lg-item-"+this.lgId+"-"+t},t.prototype.getIdName=function(t){return t+"-"+this.lgId},t.prototype.getElementById=function(t){return C("#"+this.getIdName(t))},t.prototype.manageSingleSlideClassName=function(){this.galleryItems.length<2?this.outer.addClass("lg-single-item"):this.outer.removeClass("lg-single-item")},t.prototype.buildStructure=function(){var t,e,i,s,n,o,r,l,a=this;this.$container&&this.$container.get()||(l=t="",this.settings.controls&&(t='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="Previous slide" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="Next slide" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-sub-html"===this.settings.appendSubHtmlTo&&(l='<div class="lg-sub-html" role="status" aria-live="polite"></div>'),e="",this.settings.allowMediaOverlap&&(e+="lg-media-overlap "),i=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",s=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",n="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),o=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="Close gallery" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",r=this.settings.showMaximizeIcon?'<button type="button" aria-label="Toggle maximize" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",l='\n <div class="'+n+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+i+" "+s+' role="dialog"\n >\n <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-use-css3 lg-css3 lg-hide-items '+e+' ">\n <div id="'+this.getIdName("lg-content")+'" class="lg" style="width: '+this.settings.width+"; height:"+this.settings.height+'">\n <div id="'+this.getIdName("lg-inner")+'" class="lg-inner"></div>\n <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n '+r+"\n "+o+"\n </div>\n "+t+'\n <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n '+l+"\n </div>\n </div> \n </div>\n </div>\n ",C(this.settings.container).css("position","relative").append(l),this.outer=this.getElementById("lg-outer"),this.$lgContent=this.getElementById("lg-content"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms"),l=this.settings.mode+" ",this.manageSingleSlideClassName(),this.settings.enableDrag&&(l+="lg-grab "),this.settings.showAfterLoad&&(l+="lg-show-after-load"),this.outer.addClass(l),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" aria-label="Download" download class="lg-download lg-icon"></a>'),this.counter(),C(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,function(){a.refreshOnResize()}),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules())},t.prototype.refreshOnResize=function(){var t,e,i;this.lgOpened&&(i=this.galleryItems[this.index].__slideVideoInfo,t=(e=this.getMediaContainerPosition()).top,e=e.bottom,this.currentImageSize=I(this.items[this.index],this.$lgContent,t+e,i&&this.settings.videoMaxSize),i&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved&&(i=this.getDummyImgStyles(this.currentImageSize),this.outer.find(".lg-current .lg-dummy-img").first().attr("style",i)),this.LGel.trigger(h))},t.prototype.resizeVideoSlide=function(t,e){e=this.getVideoContStyle(e);this.getSlideItem(t).find(".lg-video-cont").attr("style",e)},t.prototype.updateSlides=function(t,e){var i,s;this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length?(i=this.galleryItems[e].src,this.addSlideVideoInfo(t),this.galleryItems=t,this.$inner.empty(),this.currentItemsInDom=[],s=0,this.galleryItems.some(function(t,e){return t.src===i&&(s=e,!0)}),this.currentItemsInDom=this.organizeSlideItems(s,-1),this.loadContent(s,!0),this.getSlideItem(s).addClass("lg-current"),this.index=s,this.updateCurrentCounter(s),this.updateCounterTotal(),this.LGel.trigger(d)):this.closeGallery()},t.prototype.getItems=function(){return this.items=[],this.settings.dynamic?this.settings.dynamicEl||[]:("this"===this.settings.selector?this.items.push(this.el):this.settings.selector?"string"==typeof this.settings.selector?this.settings.selectWithin?(t=C(this.settings.selectWithin),this.items=t.find(this.settings.selector).get()):this.items=this.el.querySelectorAll(this.settings.selector):this.items=this.settings.selector:this.items=this.el.children,n(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage));var t},t.prototype.openGallery=function(e,t){var i,s,n,o,r=this;void 0===e&&(e=this.settings.index),this.lgOpened||(this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show"),n=this.getItemsToBeInsertedToDom(e,e),this.currentItemsInDom=n,i="",n.forEach(function(t){i=i+'<div id="'+t+'" class="lg-item"></div>'}),this.$inner.append(i),this.addHtml(e),s="",this.mediaContainerPosition=this.getMediaContainerPosition(),n=(o=this.mediaContainerPosition).top,o=o.bottom,this.settings.allowMediaOverlap||this.setMediaContainerPosition(n,o),this.zoomFromOrigin&&t&&(this.currentImageSize=I(t,this.$lgContent,n+o,this.galleryItems[e].__slideVideoInfo&&this.settings.videoMaxSize),s=l(t,this.$lgContent,n,o,this.currentImageSize)),this.zoomFromOrigin&&s||(this.outer.addClass(this.settings.startClass),this.getSlideItem(e).removeClass("lg-complete")),o=this.settings.zoomFromOrigin?100:this.settings.backdropDuration,setTimeout(function(){r.outer.addClass("lg-components-open")},o),this.index=e,this.LGel.trigger(u),this.getSlideItem(e).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=C(window).scrollTop(),setTimeout(function(){var t;r.zoomFromOrigin&&s&&((t=r.getSlideItem(e)).css("transform",s),setTimeout(function(){t.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",r.settings.startAnimationDuration+"ms"),r.outer.addClass("lg-zoom-from-image")}),setTimeout(function(){t.css("transform","translate3d(0, 0, 0)")},100)),setTimeout(function(){r.$backdrop.addClass("in"),r.$container.addClass("lg-show-in")},10),r.zoomFromOrigin&&s||setTimeout(function(){r.outer.addClass("lg-visible")},r.settings.backdropDuration),r.slide(e,!1,!1,!1),r.LGel.trigger(m)}),document.body===this.settings.container&&C("html").addClass("lg-on"))},t.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,e=this.settings.defaultCaptionHeight||this.outer.find(".lg-sub-html").get().clientHeight,i=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(i?i.clientHeight:0)+e}},t.prototype.setMediaContainerPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.$inner.css("top",t+"px").css("bottom",e+"px")},t.prototype.hideBars=function(){var t=this;setTimeout(function(){t.outer.removeClass("lg-hide-items"),0<t.settings.hideBarsDelay&&(t.outer.on("mousemove.lg click.lg touchstart.lg",function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout(function(){t.outer.addClass("lg-hide-items")},t.settings.hideBarsDelay)}),t.outer.trigger("mousemove.lg"))},this.settings.showBarsAfter)},t.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},t.prototype.counter=function(){var t;this.settings.counter&&(t='<div class="lg-counter" role="status" aria-live="polite">\n <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> / \n <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>",this.outer.find(this.settings.appendCounterTo).append(t))},t.prototype.addHtml=function(t){var e,i,s;this.galleryItems[t].subHtmlUrl?i=this.galleryItems[t].subHtmlUrl:e=this.galleryItems[t].subHtml,i||(e?"."!==(s=e.substring(0,1))&&"#"!==s||(e=(this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?C(this.items).eq(t).find(e):C(e)).first().html()):e=""),".lg-sub-html"===this.settings.appendSubHtmlTo?i?this.outer.find(".lg-sub-html").load(i):this.outer.find(".lg-sub-html").html(e):(s=C(this.getSlideItemId(t)),i?s.load(i):s.append('<div class="lg-sub-html">'+e+"</div>")),null!=e&&(""===e?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(c,{index:t})},t.prototype.preload=function(t){for(var e=1;e<=this.settings.preload&&!(e>=this.galleryItems.length-t);e++)this.loadContent(t+e,!1);for(var i=1;i<=this.settings.preload&&!(t-i<0);i++)this.loadContent(t-i,!1)},t.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px; \n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px; \n height:"+t.height+"px":""},t.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px; \n height:"+t.height+"px":""},t.prototype.getDummyImageContent=function(t,e,i){var s;if(this.settings.dynamic||(s=C(this.items).eq(e)),s){e=void 0;if(!(e=this.settings.exThumbImage?s.attr(this.settings.exThumbImage):s.find("img").first().attr("src")))return"";e="<img "+i+' style="'+this.getDummyImgStyles(this.currentImageSize)+'" class="lg-dummy-img" src="'+e+'" />';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),e}return""},t.prototype.setImgMarkup=function(t,e,i){var s=this.galleryItems[i],n=s.alt,o=s.srcset,r=s.sizes,s=s.sources,n=n?'alt="'+n+'"':"",s='<picture class="lg-img-wrap"> '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(e,i,n):w(i,t,n,o,r,s))+"</picture>";e.prepend(s)},t.prototype.onLgObjectLoad=function(t,e,i,s,n){var o=this;n&&this.LGel.trigger(p,{index:e,delay:i||0}),t.find(".lg-object").first().on("load.lg",function(){o.handleLgObjectLoad(t,e,i,s,n)}),setTimeout(function(){t.find(".lg-object").first().on("error.lg",function(){t.addClass("lg-complete lg-complete_"),t.html('<span class="lg-error-msg">Oops... Failed to load content...</span>')})},s)},t.prototype.handleLgObjectLoad=function(t,e,i,s,n){var o=this;setTimeout(function(){t.addClass("lg-complete lg-complete_"),n||o.LGel.trigger(p,{index:e,delay:i||0})},s)},t.prototype.isVideo=function(t,e){if(!t)return this.galleryItems[e].video?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(e+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var i=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),e=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),t=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return i?{youtube:i}:e?{vimeo:e}:t?{wistia:t}:void 0},t.prototype.addSlideVideoInfo=function(t){var i=this;t.forEach(function(t,e){t.__slideVideoInfo=i.isVideo(t.src,e)})},t.prototype.loadContent=function(e,t){var i=this,s=this.galleryItems[e],n=C(this.getSlideItemId(e)),o=s.poster,r=s.srcset,l=s.sizes,a=s.sources,g=s.src,h=s.video,d=h&&"string"==typeof h?JSON.parse(h):h;s.responsive&&(c=s.responsive.split(","),g=S(c)||g);var c,u,m,p,f=s.__slideVideoInfo,y="",h=!!s.iframe;n.hasClass("lg-loaded")||(f&&(c=(u=this.mediaContainerPosition).top,u=u.bottom,u=I(this.items[e],this.$lgContent,c+u,f&&this.settings.videoMaxSize),y=this.getVideoContStyle(u)),h?(p=x(g,this.settings.iframeWidth,this.settings.iframeHeight,s.iframeTitle),n.prepend(p)):o?(u="",m=!this.lGalleryOn,(h=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize)&&(u=this.getDummyImageContent(n,e,"")),p=E(o,u||"",y,f),n.prepend(p),h=(h?this.settings.startAnimationDuration:this.settings.backdropDuration)+100,setTimeout(function(){i.LGel.trigger(L,{index:e,src:g,html5Video:d,hasPoster:!0,isFirstSlide:m})},h)):f?(p='<div class="lg-video-cont " style="'+y+'"></div>',n.prepend(p),this.LGel.trigger(L,{index:e,src:g,html5Video:d,hasPoster:!1})):(this.setImgMarkup(g,n,e),(r||a)&&(p=n.find(".lg-object"),this.initPictureFill(p))),this.LGel.trigger(O,{index:e}),this.lGalleryOn&&".lg-sub-html"!==this.settings.appendSubHtmlTo&&this.addHtml(e));var v=0,b=0;this.lGalleryOn||(b=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),b&&!C(document.body).hasClass("lg-from-hash")&&(v=b),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout(function(){n.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")},this.settings.startAnimationDuration+100),n.hasClass("lg-loaded")||setTimeout(function(){n.find(".lg-img-wrap").append(w(e,g,"",r,l,s.sources)),(r||a)&&(t=n.find(".lg-object"),i.initPictureFill(t)),i.onLgObjectLoad(n,e,b,v,!0);var t=n.find(".lg-object").first();T(t.get())?i.loadContentOnLoad(e,n,v):t.on("load.lg error.lg",function(){i.loadContentOnLoad(e,n,v)})},this.settings.startAnimationDuration+100)),n.addClass("lg-loaded"),this.onLgObjectLoad(n,e,b,v,!1),f&&f.html5&&!o&&n.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!n.hasClass("lg-complete_")||this.lGalleryOn||setTimeout(function(){n.addClass("lg-complete")},this.settings.backdropDuration),(this.lGalleryOn=!0)===t&&(n.hasClass("lg-complete_")?this.preload(e):n.find(".lg-object").first().on("load.lg error.lg",function(){i.preload(e)}))},t.prototype.loadContentOnLoad=function(t,e,i){var s=this;setTimeout(function(){e.find(".lg-dummy-img").remove(),e.removeClass("lg-first-slide"),s.outer.removeClass("lg-first-slide-loading"),s.isDummyImageRemoved=!0,s.preload(t)},i+300)},t.prototype.getItemsToBeInsertedToDom=function(t,e,i){var s=this;void 0===i&&(i=0);var n=[],o=Math.max(i,3),o=Math.min(o,this.galleryItems.length),i="lg-item-"+this.lgId+"-"+e;if(this.galleryItems.length<=3)return this.galleryItems.forEach(function(t,e){n.push("lg-item-"+s.lgId+"-"+e)}),n;if(t<(this.galleryItems.length-1)/2){for(var r=t;t-o/2<r&&0<=r;r--)n.push("lg-item-"+this.lgId+"-"+r);for(var l=n.length,r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t+r+1))}else{for(r=t;r<=this.galleryItems.length-1&&r<t+o/2;r++)n.push("lg-item-"+this.lgId+"-"+r);for(l=n.length,r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t-r-1))}return this.settings.loop&&(t===this.galleryItems.length-1?n.push("lg-item-"+this.lgId+"-0"):0===t&&n.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===n.indexOf(i)&&n.push("lg-item-"+this.lgId+"-"+e),n},t.prototype.organizeSlideItems=function(t,e){var i=this,s=this.getItemsToBeInsertedToDom(t,e,this.settings.numberOfSlideItemsInDom);return s.forEach(function(t){-1===i.currentItemsInDom.indexOf(t)&&i.$inner.append('<div id="'+t+'" class="lg-item"></div>')}),this.currentItemsInDom.forEach(function(t){-1===s.indexOf(t)&&C("#"+t).remove()}),s},t.prototype.getPreviousSlideIndex=function(){var e=0;try{var t=this.outer.find(".lg-current").first().attr("id"),e=parseInt(t.split("-")[3])||0}catch(t){e=0}return e},t.prototype.setDownloadValue=function(t){var e;!this.settings.download||(t=!1!==(e=this.galleryItems[t]).downloadUrl&&(e.downloadUrl||e.src))&&!e.iframe&&this.getElementById("lg-download").attr("href",t)},t.prototype.makeSlideAnimation=function(t,e,i){var s=this;this.lGalleryOn&&i.addClass("lg-slide-progress"),setTimeout(function(){s.outer.addClass("lg-no-trans"),s.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(e.addClass("lg-prev-slide"),i.addClass("lg-next-slide")):(e.addClass("lg-next-slide"),i.addClass("lg-prev-slide")),setTimeout(function(){s.outer.find(".lg-item").removeClass("lg-current"),e.addClass("lg-current"),s.outer.removeClass("lg-no-trans")},50)},this.lGalleryOn?this.settings.slideDelay:0)},t.prototype.slide=function(t,e,i,s){var n,o,r,l,a,g,h=this,d=this.getPreviousSlideIndex();this.currentItemsInDom=this.organizeSlideItems(t,d),this.lGalleryOn&&d===t||(n=this.galleryItems.length,this.lgBusy||(this.settings.counter&&this.updateCurrentCounter(t),o=this.getSlideItem(t),r=this.getSlideItem(d),a=(l=this.galleryItems[t]).__slideVideoInfo,this.outer.attr("data-lg-slide-type",this.getSlideType(l)),this.setDownloadValue(t),a&&(l=(g=this.mediaContainerPosition).top,g=g.bottom,g=I(this.items[t],this.$lgContent,l+g,a&&this.settings.videoMaxSize),this.resizeVideoSlide(t,g)),this.LGel.trigger(f,{prevIndex:d,index:t,fromTouch:!!e,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),s||(t<d?s="prev":d<t&&(s="next")),e?(this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide"),g=a=void 0,2<n?(a=t-1,g=t+1,(0===t&&d===n-1||t===n-1&&0===d)&&(g=0,a=n-1)):(a=0,g=1),"prev"===s?this.getSlideItem(g).addClass("lg-next-slide"):this.getSlideItem(a).addClass("lg-prev-slide"),o.addClass("lg-current")):this.makeSlideAnimation(s,o,r),this.lGalleryOn||this.loadContent(t,!0),setTimeout(function(){h.lGalleryOn&&h.loadContent(t,!0),".lg-sub-html"===h.settings.appendSubHtmlTo&&h.addHtml(t)},(this.lGalleryOn?this.settings.speed+50:50)+(e?0:this.settings.slideDelay)),setTimeout(function(){h.lgBusy=!1,r.removeClass("lg-slide-progress"),h.LGel.trigger(y,{prevIndex:d,index:t,fromTouch:e,fromThumb:i})},(this.lGalleryOn?this.settings.speed+100:100)+(e?0:this.settings.slideDelay))),this.index=t)},t.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},t.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},t.prototype.getSlideType=function(t){return t.__slideVideoInfo?"video":t.iframe?"iframe":"image"},t.prototype.touchMove=function(t,e){var i,s=e.pageX-t.pageX,n=e.pageY-t.pageY,e=!1;this.swipeDirection?e=!0:15<Math.abs(s)?(this.swipeDirection="horizontal",e=!0):15<Math.abs(n)&&(this.swipeDirection="vertical",e=!0),e&&(t=this.getSlideItem(this.index),"horizontal"===this.swipeDirection?(this.outer.addClass("lg-dragging"),this.setTranslate(t,s,0),i=15*(e=t.get().offsetWidth)/100-Math.abs(10*s/100),this.setTranslate(this.outer.find(".lg-prev-slide").first(),s-e-i,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),e+s+i,0)):"vertical"===this.swipeDirection&&this.settings.swipeToClose&&(this.$container.addClass("lg-dragging-vertical"),i=1-Math.abs(n)/window.innerHeight,this.$backdrop.css("opacity",i),i=1-Math.abs(n)/(2*window.innerWidth),this.setTranslate(t,0,n,i,i),100<Math.abs(n)&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")))},t.prototype.touchEnd=function(i,s,n){var o,r=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout(function(){r.$container.removeClass("lg-dragging-vertical"),r.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var t=!0;if("horizontal"===r.swipeDirection){o=i.pageX-s.pageX;var e=Math.abs(i.pageX-s.pageX);o<0&&e>r.settings.swipeThreshold?(r.goToNextSlide(!0),t=!1):0<o&&e>r.settings.swipeThreshold&&(r.goToPrevSlide(!0),t=!1)}else if("vertical"===r.swipeDirection){if(o=Math.abs(i.pageY-s.pageY),r.settings.closable&&r.settings.swipeToClose&&100<o)return void r.closeGallery();r.$backdrop.css("opacity",1)}r.outer.find(".lg-item").removeAttr("style"),t&&Math.abs(i.pageX-s.pageX)<5&&(t=C(n.target),r.isPosterElement(t)&&r.LGel.trigger(v)),r.swipeDirection=void 0}),setTimeout(function(){r.outer.hasClass("lg-dragging")||"lg-slide"===r.settings.mode||r.outer.removeClass("lg-slide")},this.settings.speed+100)},t.prototype.enableSwipe=function(){var i=this,s={},e={},n=!1,o=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",function(t){t.preventDefault();var e=i.getSlideItem(i.index);!C(t.target).hasClass("lg-item")&&!e.get().contains(t.target)||i.outer.hasClass("lg-zoomed")||i.lgBusy||1!==t.targetTouches.length||(o=!0,i.touchAction="swipe",i.manageSwipeClass(),s={pageX:t.targetTouches[0].pageX,pageY:t.targetTouches[0].pageY})}),this.$inner.on("touchmove.lg",function(t){t.preventDefault(),o&&"swipe"===i.touchAction&&1===t.targetTouches.length&&(e={pageX:t.targetTouches[0].pageX,pageY:t.targetTouches[0].pageY},i.touchMove(s,e),n=!0)}),this.$inner.on("touchend.lg",function(t){"swipe"===i.touchAction&&(n?(n=!1,i.touchEnd(e,s,t)):o&&(t=C(t.target),i.isPosterElement(t)&&i.LGel.trigger(v)),i.touchAction=void 0,o=!1)}))},t.prototype.enableDrag=function(){var i=this,s={},n={},o=!1,r=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",function(t){var e=i.getSlideItem(i.index);(C(t.target).hasClass("lg-item")||e.get().contains(t.target))&&(i.outer.hasClass("lg-zoomed")||i.lgBusy||(t.preventDefault(),i.lgBusy||(i.manageSwipeClass(),s={pageX:t.pageX,pageY:t.pageY},o=!0,i.outer.get().scrollLeft+=1,--i.outer.get().scrollLeft,i.outer.removeClass("lg-grab").addClass("lg-grabbing"),i.LGel.trigger(b))))}),C(window).on("mousemove.lg.global"+this.lgId,function(t){o&&i.lgOpened&&(r=!0,n={pageX:t.pageX,pageY:t.pageY},i.touchMove(s,n),i.LGel.trigger(D))}),C(window).on("mouseup.lg.global"+this.lgId,function(t){var e;i.lgOpened&&(e=C(t.target),r?(r=!1,i.touchEnd(n,s,t),i.LGel.trigger(z)):i.isPosterElement(e)&&i.LGel.trigger(v),o&&(o=!1,i.outer.removeClass("lg-grabbing").addClass("lg-grab")))}))},t.prototype.manageSwipeClass=function(){var t=this.index+1,e=this.index-1;this.settings.loop&&2<this.galleryItems.length&&(0===this.index?e=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),-1<e&&this.getSlideItem(e).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},t.prototype.goToNextSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(G,{index:this.index}),this.slide(this.index,!!t,!1,"next")):i?(this.index=0,this.LGel.trigger(G,{index:this.index}),this.slide(this.index,!!t,!1,"next")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-right-end"),setTimeout(function(){e.outer.removeClass("lg-right-end")},400)))},t.prototype.goToPrevSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(0<this.index?(this.index--,this.LGel.trigger(M,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(M,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout(function(){e.outer.removeClass("lg-left-end")},400)))},t.prototype.keyPress=function(){var e=this;C(window).on("keydown.lg.global"+this.lgId,function(t){e.lgOpened&&!0===e.settings.escKey&&27===t.keyCode&&(t.preventDefault(),e.settings.allowMediaOverlap&&e.outer.hasClass("lg-can-toggle")&&e.outer.hasClass("lg-components-open")?e.outer.removeClass("lg-components-open"):e.closeGallery()),e.lgOpened&&1<e.galleryItems.length&&(37===t.keyCode&&(t.preventDefault(),e.goToPrevSlide()),39===t.keyCode&&(t.preventDefault(),e.goToNextSlide()))})},t.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",function(){t.goToPrevSlide()}),this.getElementById("lg-next").on("click.lg",function(){t.goToNextSlide()})},t.prototype.arrowDisable=function(t){var e,i;!this.settings.loop&&this.settings.hideControlOnEnd&&(e=this.getElementById("lg-prev"),i=this.getElementById("lg-next"),t+1<this.galleryItems.length?e.removeAttr("disabled").removeClass("disabled"):e.attr("disabled","disabled").addClass("disabled"),0<t?i.removeAttr("disabled").removeClass("disabled"):i.attr("disabled","disabled").addClass("disabled"))},t.prototype.setTranslate=function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=1),t.css("transform","translate3d("+e+"px, "+i+"px, 0px) scale3d("+s+", "+n+", 1)")},t.prototype.mousewheel=function(){var e=this;this.outer.on("mousewheel.lg",function(t){!t.deltaY||e.galleryItems.length<2||(0<t.deltaY?e.goToPrevSlide():e.goToNextSlide(),t.preventDefault())})},t.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},t.prototype.isPosterElement=function(t){var e=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||e&&e.contains(t.get())},t.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()})},t.prototype.invalidateItems=function(){for(var t=0;t<this.items.length;t++){var e=C(this.items[t]);e.off("click.lgcustom-item-"+e.attr("data-lg-id"))}},t.prototype.manageCloseGallery=function(){var e,i=this;this.settings.closable&&(e=!1,this.getElementById("lg-close").on("click.lg",function(){i.closeGallery()}),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",function(t){t=C(t.target);e=!!i.isSlideElement(t)}),this.outer.on("mousemove.lg",function(){e=!1}),this.outer.on("mouseup.lg",function(t){t=C(t.target);i.isSlideElement(t)&&e&&(i.outer.hasClass("lg-dragging")||i.closeGallery())})))},t.prototype.closeGallery=function(t){var e=this;if(!this.lgOpened||!this.settings.closable&&!t)return 0;this.LGel.trigger(k),C(window).scrollTop(this.prevScrollTop);var i,s,n=this.items[this.index];this.zoomFromOrigin&&n&&(i=(o=this.mediaContainerPosition).top,t=o.bottom,o=I(n,this.$lgContent,i+t,this.galleryItems[this.index].__slideVideoInfo&&this.settings.videoMaxSize),s=l(n,this.$lgContent,i,t,o)),this.zoomFromOrigin&&s?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",s)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,C("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var o=this.zoomFromOrigin&&s?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout(function(){e.zoomFromOrigin&&s&&e.outer.removeClass("lg-zoom-from-image"),e.$container.removeClass("lg-show"),e.$backdrop.removeAttr("style").css("transition-duration",e.settings.backdropDuration+"ms"),e.outer.removeClass("lg-closing "+e.settings.startClass),e.getSlideItem(e.index).removeClass("lg-start-end-progress"),e.$inner.empty(),e.lgOpened&&e.LGel.trigger(A,{instance:e}),e.outer.get()&&e.outer.get().blur(),e.lgOpened=!1},o+100),o+100},t.prototype.initModules=function(){this.plugins.forEach(function(t){try{t.init()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly initiated")}})},t.prototype.destroyModules=function(e){this.plugins.forEach(function(t){try{e?t.destroy():t.closeGallery&&t.closeGallery()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}})},t.prototype.refresh=function(t){this.settings.dynamic||this.invalidateItems(),this.galleryItems=t||this.getItems(),this.openGalleryOnItemClick(),this.updateCounterTotal(),this.manageSingleSlideClassName(),this.LGel.trigger(d)},t.prototype.destroy=function(){var t=this,e=this.closeGallery(!0);setTimeout(function(){t.destroyModules(!0),t.settings.dynamic||t.invalidateItems(),C(window).off(".lg.global"+t.lgId),t.LGel.off(".lg"),t.$container.remove()},e)},t);function t(t,e){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.isDummyImageRemoved=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(B++,this.lgId=B,this.el=t,this.LGel=C(t),this.generateSettings(e),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return function(t,e){return new P(t,e)}});