diff --git a/THIRD_PARTY.txt b/THIRD_PARTY.txt
index a4692484..c9930ef6 100644
--- a/THIRD_PARTY.txt
+++ b/THIRD_PARTY.txt
@@ -1230,9 +1230,9 @@ https://cdnjs.cloudflare.com/ajax/libs/lightcase/2.5.0/js/lightcase.min.js
https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.10.0/css/lightgallery.min.css
https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.10.0/fonts/lg.woff
https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.10.0/js/lightgallery.min.js
-https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.2.1/css/lightgallery.min.css
-https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.2.1/fonts/lg.woff
-https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.2.1/lightgallery.min.js
+https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.3.0/css/lightgallery.min.css
+https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.3.0/fonts/lg.woff
+https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.3.0/lightgallery.min.js
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js
https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js
diff --git a/modules/internal/targets.js b/modules/internal/targets.js
index a5400002..41c6bde4 100644
--- a/modules/internal/targets.js
+++ b/modules/internal/targets.js
@@ -427,7 +427,7 @@ targets.setLastVersion = function (type, version) {
} else if (type.startsWith('/lightgallery/1.')) {
return '1.10.0';
} else if (type.startsWith('/lightgallery/2.')) {
- return '2.2.1';
+ return '2.3.0';
} else if (type.startsWith('/lodash.js/3.')) {
return '3.10.1';
} else if (type.startsWith('/lodash.js/4.')) {
diff --git a/pages/updates/updates.html b/pages/updates/updates.html
index 7b167cdf..841be956 100644
--- a/pages/updates/updates.html
+++ b/pages/updates/updates.html
@@ -42,6 +42,7 @@
axios v0.23.0 -> v0.24.0 (#746 )
react-redux v7.2.5 -> v7.2.6 (#747 )
twitter-bootstrap v4.6.0 -> v4.6.1 (#748 )
+ lightgallery v2.2.1 -> v2.3.0 (#749 )
Improved
diff --git a/resources/lightgallery/2.2.1/css/lightgallery.min.css b/resources/lightgallery/2.2.1/css/lightgallery.min.css
deleted file mode 100644
index 53744090..00000000
--- a/resources/lightgallery/2.2.1/css/lightgallery.min.css
+++ /dev/null
@@ -1 +0,0 @@
-@font-face{font-family:lg;src:url(../fonts/lg.woff2?io9a6k) format("woff2"),url(../fonts/lg.ttf?io9a6k) format("truetype"),url(../fonts/lg.woff?io9a6k) format("woff"),url(../fonts/lg.svg?io9a6k#lg) format("svg");font-weight:400;font-style:normal;font-display:block}.lg-icon{font-family:lg!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lg-container{font-family:system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans','Liberation Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'}.lg-next,.lg-prev{background-color:rgba(0,0,0,.45);border-radius:2px;color:#999;cursor:pointer;display:block;font-size:22px;margin-top:-10px;padding:8px 10px 9px;position:absolute;top:50%;z-index:1080;outline:0;border:none}.lg-next.disabled,.lg-prev.disabled{opacity:0!important;cursor:default}.lg-next:hover:not(.disabled),.lg-prev:hover:not(.disabled){color:#fff}.lg-single-item .lg-next,.lg-single-item .lg-prev{display:none}.lg-next{right:20px}.lg-next:before{content:'\e095'}.lg-prev{left:20px}.lg-prev:after{content:'\e094'}@-webkit-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-moz-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-ms-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-webkit-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@-moz-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@-ms-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}.lg-outer.lg-right-end .lg-object{-webkit-animation:lg-right-end .3s;-o-animation:lg-right-end .3s;animation:lg-right-end .3s;position:relative}.lg-outer.lg-left-end .lg-object{-webkit-animation:lg-left-end .3s;-o-animation:lg-left-end .3s;animation:lg-left-end .3s;position:relative}.lg-toolbar{z-index:1082;left:0;position:absolute;top:0;width:100%}.lg-media-overlap .lg-toolbar{background-image:linear-gradient(0deg,rgba(0,0,0,0),rgba(0,0,0,.4))}.lg-toolbar .lg-icon{color:#999;cursor:pointer;float:right;font-size:24px;height:47px;line-height:27px;padding:10px 0;text-align:center;width:50px;text-decoration:none!important;outline:medium none;will-change:color;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear;background:0 0;border:none;box-shadow:none}.lg-toolbar .lg-icon.lg-icon-18{font-size:18px}.lg-toolbar .lg-icon:hover{color:#fff}.lg-toolbar .lg-close:after{content:'\e070'}.lg-toolbar .lg-maximize{font-size:22px}.lg-toolbar .lg-maximize:after{content:'\e90a'}.lg-toolbar .lg-download:after{content:'\e0f2'}.lg-sub-html{color:#eee;font-size:16px;padding:10px 40px;text-align:center;z-index:1080;opacity:0;-webkit-transition:opacity .2s ease-out 0s;-o-transition:opacity .2s ease-out 0s;transition:opacity .2s ease-out 0s}.lg-sub-html h4{margin:0;font-size:13px;font-weight:700}.lg-sub-html p{font-size:12px;margin:5px 0 0}.lg-sub-html a{color:inherit}.lg-sub-html a:hover{text-decoration:underline}.lg-media-overlap .lg-sub-html{background-image:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.6))}.lg-item .lg-sub-html{position:absolute;bottom:0;right:0;left:0}.lg-error-msg{font-size:14px;color:#999}.lg-counter{color:#999;display:inline-block;font-size:16px;padding-left:20px;padding-top:12px;height:47px;vertical-align:middle}.lg-closing .lg-next,.lg-closing .lg-prev,.lg-closing .lg-sub-html,.lg-closing .lg-toolbar{opacity:0;-webkit-transition:-webkit-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-moz-transition:-moz-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-o-transition:-o-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;transition:transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-object{opacity:0;will-change:opacity;-webkit-transition:opacity 250ms cubic-bezier(0,0,.25,1)!important;-moz-transition:opacity 250ms cubic-bezier(0,0,.25,1)!important;-o-transition:opacity 250ms cubic-bezier(0,0,.25,1)!important;transition:opacity 250ms cubic-bezier(0,0,.25,1)!important}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object{opacity:1}.lg-group:after{content:'';display:table;clear:both}.lg-container{display:none;outline:0}.lg-container.lg-show{display:block}.lg-on{scroll-behavior:unset}.lg-hide-sub-html .lg-sub-html,.lg-next,.lg-pager-outer,.lg-prev,.lg-toolbar{opacity:0;will-change:transform,opacity;-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;transition:transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s}.lg-show-in .lg-next,.lg-show-in .lg-pager-outer,.lg-show-in .lg-prev,.lg-show-in .lg-toolbar{opacity:1}.lg-show-in.lg-hide-sub-html .lg-sub-html{opacity:1}.lg-show-in .lg-hide-items .lg-prev{opacity:0;-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}.lg-show-in .lg-hide-items .lg-next{opacity:0;-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}.lg-show-in .lg-hide-items .lg-toolbar{opacity:0;-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}.lg-show-in .lg-hide-items.lg-hide-sub-html .lg-sub-html{opacity:0;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.lg-outer{width:100%;height:100%;position:fixed;top:0;left:0;z-index:1050;text-align:left;opacity:.001;outline:0;will-change:auto;overflow:hidden;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lg-outer.lg-zoom-from-image{opacity:1}.lg-outer.lg-visible{opacity:1}.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-current,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-next-slide,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-prev-slide{-webkit-transition-duration:inherit!important;transition-duration:inherit!important;-webkit-transition-timing-function:inherit!important;transition-timing-function:inherit!important}.lg-outer.lg-css3.lg-dragging .lg-item.lg-current,.lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-outer.lg-grab img.lg-object{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer.lg-grabbing img.lg-object{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-content{position:absolute;top:0;left:0;right:0;bottom:0}.lg-outer .lg-inner{width:100%;position:absolute;left:0;top:0;bottom:0;-webkit-transition:opacity 0s;-o-transition:opacity 0s;transition:opacity 0s;white-space:nowrap}.lg-outer .lg-item{will-change:transform,opacity;display:none!important}.lg-outer .lg-item:not(.lg-start-end-progress){background:url(../images/loading.gif) no-repeat scroll center center transparent}.lg-outer.lg-css3 .lg-current,.lg-outer.lg-css3 .lg-next-slide,.lg-outer.lg-css3 .lg-prev-slide{display:inline-block!important}.lg-outer.lg-css .lg-current{display:inline-block!important}.lg-outer .lg-img-wrap,.lg-outer .lg-item{display:inline-block;text-align:center;position:absolute;width:100%;height:100%}.lg-outer .lg-img-wrap:before,.lg-outer .lg-item:before{content:'';display:inline-block;height:100%;vertical-align:middle}.lg-outer .lg-img-wrap{position:absolute;left:0;right:0;top:0;bottom:0;white-space:nowrap;font-size:0}.lg-outer .lg-item.lg-complete{background-image:none}.lg-outer .lg-item.lg-current{z-index:1060}.lg-outer .lg-object{display:inline-block;vertical-align:middle;max-width:100%;max-height:100%;width:auto;height:auto;position:relative}.lg-outer.lg-show-after-load .lg-item .lg-object,.lg-outer.lg-show-after-load .lg-item .lg-video-play-button{opacity:0;will-change:opacity;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer.lg-show-after-load .lg-item.lg-zoom-from-image .lg-object,.lg-outer.lg-show-after-load .lg-item.lg-zoom-from-image .lg-video-play-button{opacity:1}.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-object,.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-video-play-button{opacity:1}.lg-outer .lg-empty-html .lg-sub-html,.lg-outer .lg-empty-html.lg-sub-html{display:none}.lg-outer.lg-hide-download .lg-download{opacity:.75;pointer-events:none}.lg-outer .lg-first-slide .lg-dummy-img{position:absolute;top:50%;left:50%}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-components{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-sub-html{opacity:1;transition:opacity .2s ease-out .15s}.lg-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1040;background-color:#000;opacity:0;will-change:auto;-webkit-transition:opacity 333ms ease-in 0s;-o-transition:opacity 333ms ease-in 0s;transition:opacity 333ms ease-in 0s}.lg-backdrop.in{opacity:1}.lg-css3.lg-no-trans .lg-current,.lg-css3.lg-no-trans .lg-next-slide,.lg-css3.lg-no-trans .lg-prev-slide{-webkit-transition:none 0s ease 0s!important;-moz-transition:none 0s ease 0s!important;-o-transition:none 0s ease 0s!important;transition:none 0s ease 0s!important}.lg-css3.lg-use-css3 .lg-item{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-css3.lg-fade .lg-item{opacity:0}.lg-css3.lg-fade .lg-item.lg-current{opacity:1}.lg-css3.lg-fade .lg-item.lg-current,.lg-css3.lg-fade .lg-item.lg-next-slide,.lg-css3.lg-fade .lg-item.lg-prev-slide{-webkit-transition:opacity .1s ease 0s;-moz-transition:opacity .1s ease 0s;-o-transition:opacity .1s ease 0s;transition:opacity .1s ease 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-moz-transition:-moz-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-o-transition:-o-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;transition:transform 1s cubic-bezier(.175,.885,.32,1.275) 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-end-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s}.lg-css3.lg-slide.lg-use-css3 .lg-item{opacity:0}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s}.lg-container{display:none}.lg-container.lg-show{display:block}.lg-container.lg-dragging-vertical .lg-backdrop{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-container.lg-dragging-vertical .lg-css3 .lg-item.lg-current{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-inline .lg-backdrop,.lg-inline .lg-outer{position:absolute}.lg-inline .lg-backdrop{z-index:1}.lg-inline .lg-outer{z-index:2}.lg-inline .lg-maximize:after{content:'\e909'}.lg-components{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);will-change:transform;-webkit-transition:-webkit-transform .35s ease-out 0s;-moz-transition:-moz-transform .35s ease-out 0s;-o-transition:-o-transform .35s ease-out 0s;transition:transform .35s ease-out 0s;z-index:1080;position:absolute;bottom:0;right:0;left:0}
\ No newline at end of file
diff --git a/resources/lightgallery/2.2.1/js/lightgallery.min.jsm b/resources/lightgallery/2.2.1/js/lightgallery.min.jsm
deleted file mode 100644
index f8b1ed63..00000000
--- a/resources/lightgallery/2.2.1/js/lightgallery.min.jsm
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * lightgallery | 2.2.1 | September 4th 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="undefined"!=typeof globalThis?globalThis:t||self).lightGallery=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,s=arguments.length;il){o=g;break}a===r.length-1&&(o=g)}var d=o.split("-"),h=parseInt(d[0],10),c=parseInt(d[1],10),u=e.width(),m=e.height()-s,p=Math.min(u,h),f=Math.min(m,c),v=Math.min(p/h,f/c);return{width:h*v,height:c*v}}},r=function(t,e,s,n,o){if(o){var r=i(t).find("img").first();if(r.get()){var l=e.get().getBoundingClientRect(),a=l.width,g=e.height()-(s+n),d=r.width(),h=r.height(),c=r.style(),u=(a-d)/2-r.offset().left+(parseFloat(c.paddingLeft)||0)+(parseFloat(c.borderLeft)||0)+i(window).scrollLeft()+l.left,m=(g-h)/2-r.offset().top+(parseFloat(c.paddingTop)||0)+(parseFloat(c.borderTop)||0)+i(window).scrollTop()+s;return"translate3d("+(u*=-1)+"px, "+(m*=-1)+"px, 0) scale3d("+d/o.width+", "+h/o.height+", 1)"}}},l=function(t,e,i,s){return' \n \n
'},a=function(t,e,i,s,n,o){var r=" ',l="";o&&(l=("string"==typeof o?JSON.parse(o):o).map((function(t){var e="";return Object.keys(t).forEach((function(i){e+=" "+i+'="'+t[i]+'"'}))," "})));return""+l+r},g=function(t){for(var e=[],i=[],s="",n=0;nr){s=i[l];break}return s},d=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},h=function(t,e,i,s){return'\n
\n '+(e||"")+'\n
\n
'},c=function(t,e,o,r){var l=[],a=function(){for(var t=0,e=0,i=arguments.length;e-1&&(h=d),h&&(e[h]=g.value)}}var c=i(t),u=c.find("img").first().attr("alt"),m=c.attr("title"),p=r?c.attr(r):c.find("img").first().attr("src");e.thumb=p,o&&!e.subHtml&&(e.subHtml=m||u||""),e.alt=u||m||"",l.push(e)})),l},u=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},m={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:[]},p="lgAfterAppendSlide",f="lgInit",v="lgHasVideo",y="lgContainerResize",b="lgUpdateSlides",C="lgAfterAppendSubHtml",I="lgBeforeOpen",w="lgAfterOpen",x="lgSlideItemLoad",S="lgBeforeSlide",T="lgAfterSlide",E="lgPosterClick",O="lgDragStart",L="lgDragMove",D="lgDragEnd",z="lgBeforeNextSlide",G="lgBeforePrevSlide",M="lgBeforeClose",k="lgAfterClose",A=0,B=function(){function s(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.dragOrSwipeEnabled=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(A++,this.lgId=A,this.el=t,this.LGel=i(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 s.prototype.generateSettings=function(e){if(this.settings=t(t({},m),e),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():u()){var i=t(t({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=t(t({},this.settings),i)}},s.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)},s.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(f,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe(),t.triggerPosterClick()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},s.prototype.openGalleryOnItemClick=function(){for(var t=this,s=function(s){var o=n.items[s],r=i(o),l=e.generateUUID();r.attr("data-lg-id",l).on("click.lgcustom-item-"+l,(function(e){e.preventDefault();var i=t.settings.index||s;t.openGallery(i,o)}))},n=this,o=0;o '+this.settings.prevHtml+' \n '+this.settings.nextHtml+" "),".lg-item"!==this.settings.appendSubHtmlTo&&(s='
');var n="";this.settings.allowMediaOverlap&&(n+="lg-media-overlap ");var o=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",r=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",l="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),a=this.settings.closable&&this.settings.showCloseIcon?' ':"",g=this.settings.showMaximizeIcon?' ':"",d='\n \n
\n\n
\n\n
\n
\n '+g+"\n "+a+"\n
\n "+(".lg-outer"===this.settings.appendSubHtmlTo?s:"")+'\n
\n '+(".lg-sub-html"===this.settings.appendSubHtmlTo?s:"")+"\n
\n
\n
\n ";i(this.settings.container).css("position","relative").append(d),this.outer=this.getElementById("lg-outer"),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.$content=this.getElementById("lg-content"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var h=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(h+="lg-grab "),this.settings.showAfterLoad&&(h+="lg-show-after-load"),this.outer.addClass(h),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append(' '),this.counter(),i(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},s.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].__slideVideoInfo;this.mediaContainerPosition=this.getMediaContainerPosition();var e=this.mediaContainerPosition,i=e.top,s=e.bottom;if(this.currentImageSize=o(this.items[this.index],this.outer,i+s,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var n=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",n)}this.LGel.trigger(y)}},s.prototype.resizeVideoSlide=function(t,e){var i=this.getVideoContStyle(e);this.getSlideItem(t).find(".lg-video-cont").attr("style",i)},s.prototype.updateSlides=function(t,e){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var i=this.galleryItems[e].src;this.galleryItems=t,this.updateControls(),this.$inner.empty(),this.currentItemsInDom=[];var 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.LGel.trigger(b)}else this.closeGallery()},s.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=i(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return c(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},s.prototype.openGallery=function(t,e){var s=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show");var n=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=n;var l="";n.forEach((function(t){l=l+'
'})),this.$inner.append(l),this.addHtml(t);var a="";this.mediaContainerPosition=this.getMediaContainerPosition();var g=this.mediaContainerPosition,d=g.top,h=g.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(d,h),this.zoomFromOrigin&&e&&(this.currentImageSize=o(e,this.outer,d+h,this.galleryItems[t].__slideVideoInfo&&this.settings.videoMaxSize),a=r(e,this.outer,d,h,this.currentImageSize)),this.zoomFromOrigin&&a||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var c=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){s.outer.addClass("lg-components-open")}),c),this.index=t,this.LGel.trigger(I),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=i(window).scrollTop(),setTimeout((function(){if(s.zoomFromOrigin&&a){var e=s.getSlideItem(t);e.css("transform",a),setTimeout((function(){e.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",s.settings.startAnimationDuration+"ms"),s.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){e.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){s.$backdrop.addClass("in"),s.$container.addClass("lg-show-in")}),10),s.zoomFromOrigin&&a||setTimeout((function(){s.outer.addClass("lg-visible")}),s.settings.backdropDuration),s.slide(t,!1,!1,!1),s.LGel.trigger(w)})),document.body===this.settings.container&&i("html").addClass("lg-on")}},s.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,e=this.outer.find(".lg-components .lg-sub-html").get(),i=this.settings.defaultCaptionHeight||e&&e.clientHeight||0,s=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(s?s.clientHeight:0)+i}},s.prototype.setMediaContainerPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.$content.css("top",t+"px").css("bottom",e+"px")},s.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(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)},s.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.")}},s.prototype.counter=function(){if(this.settings.counter){var t='\n '+(this.index+1)+' /\n '+this.galleryItems.length+"
";this.outer.find(this.settings.appendCounterTo).append(t)}},s.prototype.addHtml=function(t){var e,s;if(this.galleryItems[t].subHtmlUrl?s=this.galleryItems[t].subHtmlUrl:e=this.galleryItems[t].subHtml,!s)if(e){var n=e.substring(0,1);"."!==n&&"#"!==n||(e=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?i(this.items).eq(t).find(e).first().html():i(e).first().html())}else e="";if(".lg-item"!==this.settings.appendSubHtmlTo)s?this.outer.find(".lg-sub-html").load(s):this.outer.find(".lg-sub-html").html(e);else{var o=i(this.getSlideItemId(t));s?o.load(s):o.append(''+e+"
")}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})},s.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)},s.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":""},s.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px;\n height:"+t.height+"px":""},s.prototype.getDummyImageContent=function(t,e,s){var n;if(this.settings.dynamic||(n=i(this.items).eq(e)),n){var o=void 0;if(!(o=this.settings.exThumbImage?n.attr(this.settings.exThumbImage):n.find("img").first().attr("src")))return"";var r=" ';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),r}return""},s.prototype.setImgMarkup=function(t,e,i){var s=this.galleryItems[i],n=s.alt,o=s.srcset,r=s.sizes,l=s.sources,g=n?'alt="'+n+'"':"",d=' '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(e,i,g):a(i,t,g,o,r,l))+" ";e.prepend(d)},s.prototype.onLgObjectLoad=function(t,e,i,s,n){var o=this;n&&this.LGel.trigger(x,{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('Oops... Failed to load content... ')}))}),s)},s.prototype.handleLgObjectLoad=function(t,e,i,s,n){var o=this;setTimeout((function(){t.addClass("lg-complete lg-complete_"),n||o.LGel.trigger(x,{index:e,delay:i||0})}),s)},s.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),s=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),n=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return i?{youtube:i}:s?{vimeo:s}:n?{wistia:n}:void 0},s.prototype.addSlideVideoInfo=function(t){var e=this;t.forEach((function(t,i){t.__slideVideoInfo=e.isVideo(t.src,i)}))},s.prototype.loadContent=function(t,e){var s=this,n=this.galleryItems[t],r=i(this.getSlideItemId(t)),c=n.poster,u=n.srcset,m=n.sizes,f=n.sources,y=n.src,b=n.video,C=b&&"string"==typeof b?JSON.parse(b):b;if(n.responsive){var I=n.responsive.split(",");y=g(I)||y}var w=n.__slideVideoInfo,x="",S=!!n.iframe;if(!r.hasClass("lg-loaded")){if(w){var T=this.mediaContainerPosition,E=T.top,O=T.bottom,L=o(this.items[t],this.outer,E+O,w&&this.settings.videoMaxSize);x=this.getVideoContStyle(L)}if(S){var D=l(this.settings.iframeWidth,this.settings.iframeHeight,y,n.iframeTitle);r.prepend(D)}else if(c){var z="",G=!this.lGalleryOn,M=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize;M&&(z=this.getDummyImageContent(r,t,""));D=h(c,z||"",x,w);r.prepend(D);var k=(M?this.settings.startAnimationDuration:this.settings.backdropDuration)+100;setTimeout((function(){s.LGel.trigger(v,{index:t,src:y,html5Video:C,hasPoster:!0,isFirstSlide:G})}),k)}else if(w){D='
';r.prepend(D),this.LGel.trigger(v,{index:t,src:y,html5Video:C,hasPoster:!1})}else if(this.setImgMarkup(y,r,t),u||f){var A=r.find(".lg-object");this.initPictureFill(A)}this.LGel.trigger(p,{index:t}),this.lGalleryOn&&".lg-item"===this.settings.appendSubHtmlTo&&this.addHtml(t)}var B=0,P=0;this.lGalleryOn||(P=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),P&&!i(document.body).hasClass("lg-from-hash")&&(B=P),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout((function(){r.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),r.hasClass("lg-loaded")||setTimeout((function(){if(r.find(".lg-img-wrap").append(a(t,y,"",u,m,n.sources)),u||f){var e=r.find(".lg-object");s.initPictureFill(e)}s.onLgObjectLoad(r,t,P,B,!0);var i=r.find(".lg-object").first();d(i.get())?s.loadContentOnLoad(t,r,B):i.on("load.lg error.lg",(function(){s.loadContentOnLoad(t,r,B)}))}),this.settings.startAnimationDuration+100)),r.addClass("lg-loaded"),this.onLgObjectLoad(r,t,P,B,!1),w&&w.html5&&!c&&r.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!r.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){r.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===e&&(r.hasClass("lg-complete_")?this.preload(t):r.find(".lg-object").first().on("load.lg error.lg",(function(){s.preload(t)})))},s.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)},s.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);var r="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 l=t;l>t-o/2&&l>=0;l--)n.push("lg-item-"+this.lgId+"-"+l);var a=n.length;for(l=0;l')})),this.currentItemsInDom.forEach((function(t){-1===n.indexOf(t)&&i("#"+t).remove()})),n},s.prototype.getPreviousSlideIndex=function(){var t=0;try{var e=this.outer.find(".lg-current").first().attr("id");t=parseInt(e.split("-")[3])||0}catch(e){t=0}return t},s.prototype.setDownloadValue=function(t){if(this.settings.download){var e=this.galleryItems[t];if(!1===e.downloadUrl||"false"===e.downloadUrl)this.outer.addClass("lg-hide-download");else{var i=this.getElementById("lg-download");this.outer.removeClass("lg-hide-download"),i.attr("href",e.downloadUrl||e.src),e.download&&i.attr("download",e.download)}}},s.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)},s.prototype.slide=function(t,e,i,s){var n=this,r=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,r),!this.lGalleryOn||r!==t){var l=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var a=this.getSlideItem(t),g=this.getSlideItem(r),d=this.galleryItems[t],h=d.__slideVideoInfo;if(this.outer.attr("data-lg-slide-type",this.getSlideType(d)),this.setDownloadValue(t),h){var c=this.mediaContainerPosition,u=c.top,m=c.bottom,p=o(this.items[t],this.outer,u+m,h&&this.settings.videoMaxSize);this.resizeVideoSlide(t,p)}if(this.LGel.trigger(S,{prevIndex:r,index:t,fromTouch:!!e,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),s||(tr&&(s="next")),e){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var f=void 0,v=void 0;l>2?(f=t-1,v=t+1,(0===t&&r===l-1||t===l-1&&0===r)&&(v=0,f=l-1)):(f=0,v=1),"prev"===s?this.getSlideItem(v).addClass("lg-next-slide"):this.getSlideItem(f).addClass("lg-prev-slide"),a.addClass("lg-current")}else this.makeSlideAnimation(s,a,g);this.lGalleryOn||this.loadContent(t,!0),setTimeout((function(){n.lGalleryOn&&n.loadContent(t,!0),".lg-item"!==n.settings.appendSubHtmlTo&&n.addHtml(t)}),(this.lGalleryOn?this.settings.speed+50:50)+(e?0:this.settings.slideDelay)),setTimeout((function(){n.lgBusy=!1,g.removeClass("lg-slide-progress"),n.LGel.trigger(T,{prevIndex:r,index:t,fromTouch:e,fromThumb:i})}),(this.lGalleryOn?this.settings.speed+100:100)+(e?0:this.settings.slideDelay))}this.index=t}},s.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},s.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},s.prototype.getSlideType=function(t){return t.__slideVideoInfo?"video":t.iframe?"iframe":"image"},s.prototype.touchMove=function(t,e,i){var s=e.pageX-t.pageX,n=e.pageY-t.pageY,o=!1;if(this.swipeDirection?o=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",o=!0):Math.abs(n)>15&&(this.swipeDirection="vertical",o=!0),o){var r=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){null==i||i.preventDefault(),this.outer.addClass("lg-dragging"),this.setTranslate(r,s,0);var l=r.get().offsetWidth,a=15*l/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-l+s-a,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),l+s+a,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){null==i||i.preventDefault(),this.$container.addClass("lg-dragging-vertical");var g=1-Math.abs(n)/window.innerHeight;this.$backdrop.css("opacity",g);var d=1-Math.abs(n)/(2*window.innerWidth);this.setTranslate(r,0,n,d,d),Math.abs(n)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},s.prototype.touchEnd=function(t,e,s){var n,o=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){o.$container.removeClass("lg-dragging-vertical"),o.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var r=!0;if("horizontal"===o.swipeDirection){n=t.pageX-e.pageX;var l=Math.abs(t.pageX-e.pageX);n<0&&l>o.settings.swipeThreshold?(o.goToNextSlide(!0),r=!1):n>0&&l>o.settings.swipeThreshold&&(o.goToPrevSlide(!0),r=!1)}else if("vertical"===o.swipeDirection){if(n=Math.abs(t.pageY-e.pageY),o.settings.closable&&o.settings.swipeToClose&&n>100)return void o.closeGallery();o.$backdrop.css("opacity",1)}if(o.outer.find(".lg-item").removeAttr("style"),r&&Math.abs(t.pageX-e.pageX)<5){var a=i(s.target);o.isPosterElement(a)&&o.LGel.trigger(E)}o.swipeDirection=void 0})),setTimeout((function(){o.outer.hasClass("lg-dragging")||"lg-slide"===o.settings.mode||o.outer.removeClass("lg-slide")}),this.settings.speed+100)},s.prototype.enableSwipe=function(){var t=this,e={},s={},n=!1,o=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(s){t.dragOrSwipeEnabled=!0;var n=t.getSlideItem(t.index);!i(s.target).hasClass("lg-item")&&!n.get().contains(s.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==s.targetTouches.length||(o=!0,t.touchAction="swipe",t.manageSwipeClass(),e={pageX:s.targetTouches[0].pageX,pageY:s.targetTouches[0].pageY})})),this.$inner.on("touchmove.lg",(function(i){o&&"swipe"===t.touchAction&&1===i.targetTouches.length&&(s={pageX:i.targetTouches[0].pageX,pageY:i.targetTouches[0].pageY},t.touchMove(e,s,i),n=!0)})),this.$inner.on("touchend.lg",(function(r){if("swipe"===t.touchAction){if(n)n=!1,t.touchEnd(s,e,r);else if(o){var l=i(r.target);t.isPosterElement(l)&&t.LGel.trigger(E)}t.touchAction=void 0,o=!1}})))},s.prototype.enableDrag=function(){var t=this,e={},s={},n=!1,o=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(s){t.dragOrSwipeEnabled=!0;var o=t.getSlideItem(t.index);(i(s.target).hasClass("lg-item")||o.get().contains(s.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(s.preventDefault(),t.lgBusy||(t.manageSwipeClass(),e={pageX:s.pageX,pageY:s.pageY},n=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(O))))})),i(window).on("mousemove.lg.global"+this.lgId,(function(i){n&&t.lgOpened&&(o=!0,s={pageX:i.pageX,pageY:i.pageY},t.touchMove(e,s),t.LGel.trigger(L))})),i(window).on("mouseup.lg.global"+this.lgId,(function(r){if(t.lgOpened){var l=i(r.target);o?(o=!1,t.touchEnd(s,e,r),t.LGel.trigger(D)):t.isPosterElement(l)&&t.LGel.trigger(E),n&&(n=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},s.prototype.triggerPosterClick=function(){var t=this;this.$inner.on("click.lg",(function(e){!t.dragOrSwipeEnabled&&t.isPosterElement(i(e.target))&&t.LGel.trigger(E)}))},s.prototype.manageSwipeClass=function(){var t=this.index+1,e=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(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"),e>-1&&this.getSlideItem(e).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},s.prototype.goToNextSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+10?(this.index--,this.LGel.trigger(G,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(G,{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)))},s.prototype.keyPress=function(){var t=this;i(window).on("keydown.lg.global"+this.lgId,(function(e){t.lgOpened&&!0===t.settings.escKey&&27===e.keyCode&&(e.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===e.keyCode&&(e.preventDefault(),t.goToPrevSlide()),39===e.keyCode&&(e.preventDefault(),t.goToNextSlide()))}))},s.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()}))},s.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var e=this.getElementById("lg-prev"),i=this.getElementById("lg-next");t+1===this.galleryItems.length?i.attr("disabled","disabled").addClass("disabled"):i.removeAttr("disabled").removeClass("disabled"),0===t?e.attr("disabled","disabled").addClass("disabled"):e.removeAttr("disabled").removeClass("disabled")}},s.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)")},s.prototype.mousewheel=function(){var t=this;this.outer.on("mousewheel.lg",(function(e){!e.deltaY||t.galleryItems.length<2||(e.deltaY>0?t.goToPrevSlide():t.goToNextSlide(),e.preventDefault())}))},s.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},s.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())},s.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},s.prototype.invalidateItems=function(){for(var t=0;tl){o=g;break}a===r.length-1&&(o=g)}var d=o.split("-"),h=parseInt(d[0],10),u=parseInt(d[1],10),c=e.width(),m=e.height()-s,p=Math.min(c,h),f=Math.min(m,u),v=Math.min(p/h,f/u);return{width:h*v,height:u*v}}},r=function(t,e,s,n,o){if(o){var r=i(t).find("img").first();if(r.get()){var l=e.get().getBoundingClientRect(),a=l.width,g=e.height()-(s+n),d=r.width(),h=r.height(),u=r.style(),c=(a-d)/2-r.offset().left+(parseFloat(u.paddingLeft)||0)+(parseFloat(u.borderLeft)||0)+i(window).scrollLeft()+l.left,m=(g-h)/2-r.offset().top+(parseFloat(u.paddingTop)||0)+(parseFloat(u.borderTop)||0)+i(window).scrollTop()+s;return"translate3d("+(c*=-1)+"px, "+(m*=-1)+"px, 0) scale3d("+d/o.width+", "+h/o.height+", 1)"}}},l=function(t,e,i,s,n,o){return'\n \n
'},a=function(t,e,i,s,n,o){var r=" ',l="";o&&(l=("string"==typeof o?JSON.parse(o):o).map((function(t){var e="";return Object.keys(t).forEach((function(i){e+=" "+i+'="'+t[i]+'"'}))," "})));return""+l+r},g=function(t){for(var e=[],i=[],s="",n=0;nr){s=i[l];break}return s},d=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},h=function(t,e,i,s){return'\n
\n '+(e||"")+'\n
\n
'},u=function(t,e,o,r){var l=[],a=function(){for(var t=0,e=0,i=arguments.length;e-1&&(h=d),h&&(e[h]=g.value)}}var u=i(t),c=u.find("img").first().attr("alt"),m=u.attr("title"),p=r?u.attr(r):u.find("img").first().attr("src");e.thumb=p,o&&!e.subHtml&&(e.subHtml=m||c||""),e.alt=c||m||"",l.push(e)})),l},c=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},m=function(t,e,i){if(!t)return e?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(i+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var s=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)([\&|?][\S]*)*/i),n=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)(.*)?/i),o=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return s?{youtube:s}:n?{vimeo:n}:o?{wistia:o}:void 0},p={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:"",startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",loadYouTubePoster:!0,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,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",iframeMaxWidth:"100%",iframeMaxHeight:"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:[]},f="lgAfterAppendSlide",v="lgInit",y="lgHasVideo",b="lgContainerResize",I="lgUpdateSlides",C="lgAfterAppendSubHtml",x="lgBeforeOpen",w="lgAfterOpen",S="lgSlideItemLoad",T="lgBeforeSlide",E="lgAfterSlide",O="lgPosterClick",L="lgDragStart",D="lgDragMove",z="lgDragEnd",M="lgBeforeNextSlide",G="lgBeforePrevSlide",k="lgBeforeClose",A="lgAfterClose",B=0,P=function(){function s(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.dragOrSwipeEnabled=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(B++,this.lgId=B,this.el=t,this.LGel=i(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 s.prototype.generateSettings=function(e){if(this.settings=t(t({},p),e),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():c()){var i=t(t({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=t(t({},this.settings),i)}},s.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)},s.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(v,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe(),t.triggerPosterClick()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},s.prototype.openGalleryOnItemClick=function(){for(var t=this,s=function(s){var o=n.items[s],r=i(o),l=e.generateUUID();r.attr("data-lg-id",l).on("click.lgcustom-item-"+l,(function(e){e.preventDefault();var i=t.settings.index||s;t.openGallery(i,o)}))},n=this,o=0;o '+this.settings.prevHtml+' \n '+this.settings.nextHtml+" "),".lg-item"!==this.settings.appendSubHtmlTo&&(s='
');var n="";this.settings.allowMediaOverlap&&(n+="lg-media-overlap ");var o=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",r=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",l="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),a=this.settings.closable&&this.settings.showCloseIcon?' ':"",g=this.settings.showMaximizeIcon?' ':"",d='\n \n
\n\n
\n\n
\n
\n '+g+"\n "+a+"\n
\n "+(".lg-outer"===this.settings.appendSubHtmlTo?s:"")+'\n
\n '+(".lg-sub-html"===this.settings.appendSubHtmlTo?s:"")+"\n
\n
\n
\n ";i(this.settings.container).css("position","relative").append(d),this.outer=this.getElementById("lg-outer"),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.$content=this.getElementById("lg-content"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var h=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(h+="lg-grab "),this.outer.addClass(h),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append(' '),this.counter(),i(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},s.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].__slideVideoInfo;this.mediaContainerPosition=this.getMediaContainerPosition();var e=this.mediaContainerPosition,i=e.top,s=e.bottom;if(this.currentImageSize=o(this.items[this.index],this.outer,i+s,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var n=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",n)}this.LGel.trigger(b)}},s.prototype.resizeVideoSlide=function(t,e){var i=this.getVideoContStyle(e);this.getSlideItem(t).find(".lg-video-cont").attr("style",i)},s.prototype.updateSlides=function(t,e){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var i=this.galleryItems[e].src;this.galleryItems=t,this.updateControls(),this.$inner.empty(),this.currentItemsInDom=[];var 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.LGel.trigger(I)}else this.closeGallery()},s.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=i(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return u(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},s.prototype.openGallery=function(t,e){var s=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show");var n=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=n;var l="";n.forEach((function(t){l=l+'
'})),this.$inner.append(l),this.addHtml(t);var a="";this.mediaContainerPosition=this.getMediaContainerPosition();var g=this.mediaContainerPosition,d=g.top,h=g.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(d,h);var u=this.galleryItems[t].__slideVideoInfo;this.zoomFromOrigin&&e&&(this.currentImageSize=o(e,this.outer,d+h,u&&this.settings.videoMaxSize),a=r(e,this.outer,d,h,this.currentImageSize)),this.zoomFromOrigin&&a||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var c=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){s.outer.addClass("lg-components-open")}),c),this.index=t,this.LGel.trigger(x),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=i(window).scrollTop(),setTimeout((function(){if(s.zoomFromOrigin&&a){var e=s.getSlideItem(t);e.css("transform",a),setTimeout((function(){e.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",s.settings.startAnimationDuration+"ms"),s.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){e.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){s.$backdrop.addClass("in"),s.$container.addClass("lg-show-in")}),10),s.zoomFromOrigin&&a||setTimeout((function(){s.outer.addClass("lg-visible")}),s.settings.backdropDuration),s.slide(t,!1,!1,!1),s.LGel.trigger(w)})),document.body===this.settings.container&&i("html").addClass("lg-on")}},s.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,e=this.outer.find(".lg-components .lg-sub-html").get(),i=this.settings.defaultCaptionHeight||e&&e.clientHeight||0,s=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(s?s.clientHeight:0)+i}},s.prototype.setMediaContainerPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.$content.css("top",t+"px").css("bottom",e+"px")},s.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(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)},s.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.")}},s.prototype.counter=function(){if(this.settings.counter){var t='\n '+(this.index+1)+' /\n '+this.galleryItems.length+"
";this.outer.find(this.settings.appendCounterTo).append(t)}},s.prototype.addHtml=function(t){var e,s;if(this.galleryItems[t].subHtmlUrl?s=this.galleryItems[t].subHtmlUrl:e=this.galleryItems[t].subHtml,!s)if(e){var n=e.substring(0,1);"."!==n&&"#"!==n||(e=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?i(this.items).eq(t).find(e).first().html():i(e).first().html())}else e="";if(".lg-item"!==this.settings.appendSubHtmlTo)s?this.outer.find(".lg-sub-html").load(s):this.outer.find(".lg-sub-html").html(e);else{var o=i(this.getSlideItemId(t));s?o.load(s):o.append(''+e+"
")}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})},s.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)},s.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":""},s.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px;\n height:"+t.height+"px":""},s.prototype.getDummyImageContent=function(t,e,s){var n;if(this.settings.dynamic||(n=i(this.items).eq(e)),n){var o=void 0;if(!(o=this.settings.exThumbImage?n.attr(this.settings.exThumbImage):n.find("img").first().attr("src")))return"";var r=" ';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),r}return""},s.prototype.setImgMarkup=function(t,e,i){var s=this.galleryItems[i],n=s.alt,o=s.srcset,r=s.sizes,l=s.sources,g=n?'alt="'+n+'"':"",d=' '+(this.isFirstSlideWithZoomAnimation()?this.getDummyImageContent(e,i,g):a(i,t,g,o,r,l))+" ";e.prepend(d)},s.prototype.onSlideObjectLoad=function(t,e,i,s){var n=t.find(".lg-object").first();d(n.get())||e?i():(n.on("load.lg error.lg",(function(){i&&i()})),n.on("error.lg",(function(){s&&s()})))},s.prototype.onLgObjectLoad=function(t,e,i,s,n,o){var r=this;this.onSlideObjectLoad(t,o,(function(){r.triggerSlideItemLoad(t,e,i,s,n)}),(function(){t.addClass("lg-complete lg-complete_"),t.html('Oops... Failed to load content... ')}))},s.prototype.triggerSlideItemLoad=function(t,e,i,s,n){var o=this,r=this.galleryItems[e],l=n&&"video"===this.getSlideType(r)&&!r.poster?s:0;setTimeout((function(){t.addClass("lg-complete lg-complete_"),o.LGel.trigger(S,{index:e,delay:i||0,isFirstSlide:n})}),l)},s.prototype.isFirstSlideWithZoomAnimation=function(){return!(this.lGalleryOn||!this.zoomFromOrigin||!this.currentImageSize)},s.prototype.addSlideVideoInfo=function(t){var e=this;t.forEach((function(t,i){t.__slideVideoInfo=m(t.src,!!t.video,i),t.__slideVideoInfo&&e.settings.loadYouTubePoster&&!t.poster&&t.__slideVideoInfo.youtube&&(t.poster="//img.youtube.com/vi/"+t.__slideVideoInfo.youtube[1]+"/maxresdefault.jpg")}))},s.prototype.loadContent=function(t,e){var s=this,n=this.galleryItems[t],r=i(this.getSlideItemId(t)),d=n.poster,u=n.srcset,c=n.sizes,m=n.sources,p=n.src,v=n.video,b=v&&"string"==typeof v?JSON.parse(v):v;if(n.responsive){var I=n.responsive.split(",");p=g(I)||p}var C=n.__slideVideoInfo,x="",w=!!n.iframe,S=!this.lGalleryOn,T=0;if(S&&(T=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),!r.hasClass("lg-loaded")){if(C){var E=this.mediaContainerPosition,O=E.top,L=E.bottom,D=o(this.items[t],this.outer,O+L,C&&this.settings.videoMaxSize);x=this.getVideoContStyle(D)}if(w){var z=l(this.settings.iframeWidth,this.settings.iframeHeight,this.settings.iframeMaxWidth,this.settings.iframeMaxHeight,p,n.iframeTitle);r.prepend(z)}else if(d){var M="";S&&this.zoomFromOrigin&&this.currentImageSize&&(M=this.getDummyImageContent(r,t,""));z=h(d,M||"",x,C);r.prepend(z)}else if(C){z='
';r.prepend(z)}else if(this.setImgMarkup(p,r,t),u||m){var G=r.find(".lg-object");this.initPictureFill(G)}(d||C)&&this.LGel.trigger(y,{index:t,src:p,html5Video:b,hasPoster:!!d}),this.LGel.trigger(f,{index:t}),this.lGalleryOn&&".lg-item"===this.settings.appendSubHtmlTo&&this.addHtml(t)}var k=0;T&&!i(document.body).hasClass("lg-from-hash")&&(k=T),this.isFirstSlideWithZoomAnimation()&&(setTimeout((function(){r.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),r.hasClass("lg-loaded")||setTimeout((function(){if("image"===s.getSlideType(n)&&(r.find(".lg-img-wrap").append(a(t,p,"",u,c,n.sources)),u||m)){var e=r.find(".lg-object");s.initPictureFill(e)}("image"===s.getSlideType(n)||"video"===s.getSlideType(n)&&d)&&(s.onLgObjectLoad(r,t,T,k,!0,!1),s.onSlideObjectLoad(r,!(!C||!C.html5||d),(function(){s.loadContentOnFirstSlideLoad(t,r,k)}),(function(){s.loadContentOnFirstSlideLoad(t,r,k)})))}),this.settings.startAnimationDuration+100)),r.addClass("lg-loaded"),this.isFirstSlideWithZoomAnimation()&&("video"!==this.getSlideType(n)||d)||this.onLgObjectLoad(r,t,T,k,S,!(!C||!C.html5||d)),this.zoomFromOrigin&&this.currentImageSize||!r.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){r.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===e&&(r.hasClass("lg-complete_")?this.preload(t):r.find(".lg-object").first().on("load.lg error.lg",(function(){s.preload(t)})))},s.prototype.loadContentOnFirstSlideLoad=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)},s.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);var r="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 l=t;l>t-o/2&&l>=0;l--)n.push("lg-item-"+this.lgId+"-"+l);var a=n.length;for(l=0;l')})),this.currentItemsInDom.forEach((function(t){-1===n.indexOf(t)&&i("#"+t).remove()})),n},s.prototype.getPreviousSlideIndex=function(){var t=0;try{var e=this.outer.find(".lg-current").first().attr("id");t=parseInt(e.split("-")[3])||0}catch(e){t=0}return t},s.prototype.setDownloadValue=function(t){if(this.settings.download){var e=this.galleryItems[t];if(!1===e.downloadUrl||"false"===e.downloadUrl)this.outer.addClass("lg-hide-download");else{var i=this.getElementById("lg-download");this.outer.removeClass("lg-hide-download"),i.attr("href",e.downloadUrl||e.src),e.download&&i.attr("download",e.download)}}},s.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)},s.prototype.slide=function(t,e,i,s){var n=this,r=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,r),!this.lGalleryOn||r!==t){var l=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var a=this.getSlideItem(t),g=this.getSlideItem(r),d=this.galleryItems[t],h=d.__slideVideoInfo;if(this.outer.attr("data-lg-slide-type",this.getSlideType(d)),this.setDownloadValue(t),h){var u=this.mediaContainerPosition,c=u.top,m=u.bottom,p=o(this.items[t],this.outer,c+m,h&&this.settings.videoMaxSize);this.resizeVideoSlide(t,p)}if(this.LGel.trigger(T,{prevIndex:r,index:t,fromTouch:!!e,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),s||(tr&&(s="next")),e){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var f=void 0,v=void 0;l>2?(f=t-1,v=t+1,(0===t&&r===l-1||t===l-1&&0===r)&&(v=0,f=l-1)):(f=0,v=1),"prev"===s?this.getSlideItem(v).addClass("lg-next-slide"):this.getSlideItem(f).addClass("lg-prev-slide"),a.addClass("lg-current")}else this.makeSlideAnimation(s,a,g);this.lGalleryOn?setTimeout((function(){n.loadContent(t,!0),".lg-item"!==n.settings.appendSubHtmlTo&&n.addHtml(t)}),this.settings.speed+50+(e?0:this.settings.slideDelay)):this.loadContent(t,!0),setTimeout((function(){n.lgBusy=!1,g.removeClass("lg-slide-progress"),n.LGel.trigger(E,{prevIndex:r,index:t,fromTouch:e,fromThumb:i})}),(this.lGalleryOn?this.settings.speed+100:100)+(e?0:this.settings.slideDelay))}this.index=t}},s.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},s.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},s.prototype.getSlideType=function(t){return t.__slideVideoInfo?"video":t.iframe?"iframe":"image"},s.prototype.touchMove=function(t,e,i){var s=e.pageX-t.pageX,n=e.pageY-t.pageY,o=!1;if(this.swipeDirection?o=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",o=!0):Math.abs(n)>15&&(this.swipeDirection="vertical",o=!0),o){var r=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){null==i||i.preventDefault(),this.outer.addClass("lg-dragging"),this.setTranslate(r,s,0);var l=r.get().offsetWidth,a=15*l/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-l+s-a,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),l+s+a,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){null==i||i.preventDefault(),this.$container.addClass("lg-dragging-vertical");var g=1-Math.abs(n)/window.innerHeight;this.$backdrop.css("opacity",g);var d=1-Math.abs(n)/(2*window.innerWidth);this.setTranslate(r,0,n,d,d),Math.abs(n)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},s.prototype.touchEnd=function(t,e,s){var n,o=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){o.$container.removeClass("lg-dragging-vertical"),o.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var r=!0;if("horizontal"===o.swipeDirection){n=t.pageX-e.pageX;var l=Math.abs(t.pageX-e.pageX);n<0&&l>o.settings.swipeThreshold?(o.goToNextSlide(!0),r=!1):n>0&&l>o.settings.swipeThreshold&&(o.goToPrevSlide(!0),r=!1)}else if("vertical"===o.swipeDirection){if(n=Math.abs(t.pageY-e.pageY),o.settings.closable&&o.settings.swipeToClose&&n>100)return void o.closeGallery();o.$backdrop.css("opacity",1)}if(o.outer.find(".lg-item").removeAttr("style"),r&&Math.abs(t.pageX-e.pageX)<5){var a=i(s.target);o.isPosterElement(a)&&o.LGel.trigger(O)}o.swipeDirection=void 0})),setTimeout((function(){o.outer.hasClass("lg-dragging")||"lg-slide"===o.settings.mode||o.outer.removeClass("lg-slide")}),this.settings.speed+100)},s.prototype.enableSwipe=function(){var t=this,e={},s={},n=!1,o=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(s){t.dragOrSwipeEnabled=!0;var n=t.getSlideItem(t.index);!i(s.target).hasClass("lg-item")&&!n.get().contains(s.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==s.targetTouches.length||(o=!0,t.touchAction="swipe",t.manageSwipeClass(),e={pageX:s.targetTouches[0].pageX,pageY:s.targetTouches[0].pageY})})),this.$inner.on("touchmove.lg",(function(i){o&&"swipe"===t.touchAction&&1===i.targetTouches.length&&(s={pageX:i.targetTouches[0].pageX,pageY:i.targetTouches[0].pageY},t.touchMove(e,s,i),n=!0)})),this.$inner.on("touchend.lg",(function(r){if("swipe"===t.touchAction){if(n)n=!1,t.touchEnd(s,e,r);else if(o){var l=i(r.target);t.isPosterElement(l)&&t.LGel.trigger(O)}t.touchAction=void 0,o=!1}})))},s.prototype.enableDrag=function(){var t=this,e={},s={},n=!1,o=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(s){t.dragOrSwipeEnabled=!0;var o=t.getSlideItem(t.index);(i(s.target).hasClass("lg-item")||o.get().contains(s.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(s.preventDefault(),t.lgBusy||(t.manageSwipeClass(),e={pageX:s.pageX,pageY:s.pageY},n=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(L))))})),i(window).on("mousemove.lg.global"+this.lgId,(function(i){n&&t.lgOpened&&(o=!0,s={pageX:i.pageX,pageY:i.pageY},t.touchMove(e,s),t.LGel.trigger(D))})),i(window).on("mouseup.lg.global"+this.lgId,(function(r){if(t.lgOpened){var l=i(r.target);o?(o=!1,t.touchEnd(s,e,r),t.LGel.trigger(z)):t.isPosterElement(l)&&t.LGel.trigger(O),n&&(n=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},s.prototype.triggerPosterClick=function(){var t=this;this.$inner.on("click.lg",(function(e){!t.dragOrSwipeEnabled&&t.isPosterElement(i(e.target))&&t.LGel.trigger(O)}))},s.prototype.manageSwipeClass=function(){var t=this.index+1,e=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(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"),e>-1&&this.getSlideItem(e).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},s.prototype.goToNextSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+10?(this.index--,this.LGel.trigger(G,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(G,{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)))},s.prototype.keyPress=function(){var t=this;i(window).on("keydown.lg.global"+this.lgId,(function(e){t.lgOpened&&!0===t.settings.escKey&&27===e.keyCode&&(e.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===e.keyCode&&(e.preventDefault(),t.goToPrevSlide()),39===e.keyCode&&(e.preventDefault(),t.goToNextSlide()))}))},s.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()}))},s.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var e=this.getElementById("lg-prev"),i=this.getElementById("lg-next");t+1===this.galleryItems.length?i.attr("disabled","disabled").addClass("disabled"):i.removeAttr("disabled").removeClass("disabled"),0===t?e.attr("disabled","disabled").addClass("disabled"):e.removeAttr("disabled").removeClass("disabled")}},s.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)")},s.prototype.mousewheel=function(){var t=this,e=0;this.outer.on("wheel.lg",(function(i){if(i.deltaY&&!(t.galleryItems.length<2)){i.preventDefault();var s=(new Date).getTime();s-e<1e3||(e=s,i.deltaY>0?t.goToNextSlide():i.deltaY<0&&t.goToPrevSlide())}}))},s.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},s.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())},s.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},s.prototype.invalidateItems=function(){for(var t=0;t