(function(){"use strict";var a={simulateClick:function(a){var b=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}),c=!a.dispatchEvent(b)},checkImage:function(a){return /(png|jpg|jpeg|gif|tiff|bmp|webp)$/.test(a.getAttribute("href").toLowerCase().split("?")[0].split("#")[0])},handleClones:function(b){var d=b.querySelectorAll(".slick-cloned a.kb-gallery-item-link"),e=b.querySelectorAll(".slick-slide:not(.slick-cloned) a.kb-gallery-item-link");for(let f=0;f<d.length;f++)d[f].addEventListener("click",function(b){b.preventDefault();var c=d[f].getAttribute("href");for(let d=0;d<e.length;d++)if(c===e[d].getAttribute("href")){a.simulateClick(e[d]);break}})},findGalleries:function(){var b=document.querySelectorAll(".kb-gallery-magnific-init");if(b.length&&b){var c=[];for(let j=0;j<b.length;j++){c[j]=b[j].querySelector(".kt-blocks-carousel-init"),c[j]&&setTimeout(function(){a.handleClones(c[j])},200);var d=b[j].classList,e=b[j].getAttribute("data-lightbox-caption"),f=b[j].getAttribute("data-image-filter"),g=!1;for(let a=0;a<d.length;a++)if(-1!==d[a].indexOf("kb-gallery-id")){g=d[a];break}if("true"==e){var h=b[j].querySelectorAll("a.kb-gallery-item-link");for(let a=0;a<h.length;a++){var i=h[a].querySelector(".kadence-blocks-gallery-item__caption");i&&h[a].setAttribute("data-caption",i.innerText)}}g&&(SimpleLightbox.defaults.elementClass=f?"slg-kt-blocks kb-gal-light-filter-"+f:"slg-kt-blocks",new SimpleLightbox({elements:"."+g+" a.kb-gallery-item-link"}))}}},initAll:function(){SimpleLightbox.defaults.captionAttribute="data-caption",a.findGalleries()},init:function(){if("function"==typeof SimpleLightbox)a.initAll();else var b=setInterval(function(){"function"==typeof SimpleLightbox&&(a.initAll(),clearInterval(b))},200)}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",a.init):a.init()})();