!function(e,i){"use strict";ElementsKit_Helper.registerWidget("elementskit-video-gallery.default",(function(t){var a=t.find(".video-link.popup"),l=t.find(".video-link.inline"),o=(t.find(".ekit-video-gallery-wrapper.ekit-masonry"),t.find(".elementskit-main-filter>li>a")),n=t.find(".ekit-video-gallery.ekit-carousel"),s=n.data("config"),r=t.find(".ekit-video-gallery").data("filter");let{layout:d,showFilters:f,allLabel:p,columns:c,filterBarClass:u,filterBarBtnGroupClass:m,filterBarStyleClass:v}=r||{};if(a.length>0&&a.magnificPopup({type:"iframe",mainClass:"mfp-fade",removalDelay:160,preloader:!0,fixedContentPos:!1,callbacks:{open:function(){e("body").find(".mfp-close").addClass("ekit-popup-close"),window.dispatchEvent(new Event("resize")),y(e(".mfp-iframe"))},close:function(){e("body").find(".mfp-close").removeClass("ekit-popup-close"),t.find("video").each((function(){this.pause()}))}},iframe:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close ekit-popup-close"></div><iframe class="mfp-iframe" frameborder="0" allow="autoplay"></iframe></div>',patterns:{youtube:{index:"youtube.com/",id:"v=",src:"https://www.youtube.com/embed/%id%?autoplay=1&rel=0"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"}}}}),l.on("click",(function(i){i.preventDefault();var t=e(this).data("url");e(this).addClass("video-added").append('<iframe src="'+t+'" width="643" height="360" allow="autoplay" frameborder="0"></iframe>'),y(e(this).find("iframe"),10)})),o.on("click",(function(i){i.preventDefault();var a=e(this).data("value")?"."+e(this).data("value"):"";t.find("a").removeClass("selected"),e(this).addClass("selected"),t.find(".ekit-video-item").hide(),t.find(".ekit-video-item"+a).fadeIn()})),n.length){s.arrows&&(s.navigation={prevEl:t.find(".swiper-button-prev").get(0),nextEl:t.find(".swiper-button-next").get(0)}),s.dots&&(s.pagination={el:t.find(".swiper-pagination").get(0),type:"bullets",clickable:!0});let e=t.find(`.${i.config.swiperClass}`);ElementsKit_Helper.swiper(e,s).then((function(i){s.autoplay&&s.pauseOnMouseEnter&&e.hover((function(){i.autoplay.stop()}),(function(){i.autoplay.start()}))}))}r&&"carousel"!==r?.gridStyle&&t.find(".ekit-video-gallery").GalleryFilter({layout:d||"grid",showFilters:f,allLabel:p||"All",columns:c||3,filterBarClass:`${u}`,filterBarBtnGroupClass:`${m} ${v}`});const y=(i,t=100)=>{setTimeout((function(){var t=i,a=t[0].contentDocument||t[0].contentWindow.document;a&&e(a).find("video").css({"object-fit":"cover",width:"100%",height:"100%"})}),t)}}))}(jQuery,window.elementorFrontend);