!function(e){function i(p,f){var e=p.find(".premium-adv-carousel__container"),v=e.data("settings"),i=p.find(".premium-adv-carousel__inner-container");if(v){if("infinite"===v.type){var _=e.find(".premium-adv-carousel__items"),r=v.lightbox_type;if("load"===v.renderEvent)d();else{var t=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(d(),t.unobserve(e.target))})});t.observe(p[0])}i.css("visibility","inherit"),v.pauseOnHover&&c(),v.scroll?(c(),"horizontal"===v.dir&&e.find(".premium-adv-carousel__inner-container").mousewheel(function(e,i){this.scrollLeft-=30*i,e.preventDefault()})):e.find(".premium-adv-carousel__inner-container").css({overflow:"hidden"})}else{var a=p.find(".premium-adv-carousel__items"),o=p.find(".premium-adv-carousel__item-outer-wrapper"),n=p.find(".premium-adv-carousel__prev-icon").html(),s=p.find(".premium-adv-carousel__next-icon").html(),u=["mobile","mobile_extra","tablet","tablet_extra"].includes(elementorFrontend.getCurrentDeviceMode());if(p.find(".premium-adv-carousel__icons-holder").remove(),i.flipster({itemContainer:a,itemSelector:o,style:v.type,fadeIn:0,start:v.start,loop:v.loop,autoplay:v.autoPlay,scrollwheel:v.scroll,pauseOnHover:v.pauseOnHover,click:!v.loop&&v.click,keyboard:v.keyboard,touch:v.touch,spacing:v.spacing,buttons:!!v.buttons&&"custom",buttonPrev:n,buttonNext:s,onItemSwitch:function(){m()}}).css("visibility","inherit"),v.keyboard&&!u){var l=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(f.fn.focusWithoutScrolling=function(){var e=window.scrollX,i=window.scrollY;this.focus(),window.scrollTo(e,i)},i.focusWithoutScrolling(),l.unobserve(e.target))})});l.observe(i[0])}v.loop&&v.click&&p.find(".premium-adv-carousel__item-outer-wrapper").on("click.paFlipClick",function(){var e=f(this).index();i.flipster("jump",e)})}"yes"===v.light_box?"default"===r&&p.find(".premium-adv-carousel__inner-container a[data-rel^='prettyPhoto']").prettyPhoto({theme:v.theme,hook:"data-rel",opacity:.7,show_title:!1,deeplinking:!1,overlay_gallery:v.overlay,custom_markup:"",default_width:900,default_height:506,social_tools:""}):p.find(".premium-adv-carousel__item .premium-adv-carousel__video-wrap").each(function(e,o){var n=f(o).data("type");f(o).closest(".premium-adv-carousel__item").on("click.paPlayVid"+e,function(){var e=f(this);if(m(),e.find(".premium-adv-carousel__media-wrap").css("background","#000"),e.find(".premium-adv-carousel__video-icon, .premium-adv-carousel__vid-overlay").css("visibility","hidden"),"hosted"!==n){var i=e.find(".premium-adv-carousel__iframe-wrap"),r=i.data("src");r=r.replace("&mute","&autoplay=1&mute");var t=f("<iframe/>");t.attr({src:r,frameborder:"0",allowfullscreen:"1",allow:"autoplay;encrypted-media;"}),i.html(t),t.css("visibility","visible")}else{var a=f(o).find("video");a.attr("pa-playing","true").get(0).play(),a.css("visibility","visible")}})})}function c(){e.on("mouseenter.paMediaWheel",function(){_.css("animation-play-state","paused")}).on("mouseleave.paMediaWheel",function(){_.css("animation-play-state","running")})}function m(){p.find("iframe").attr("src",""),$video=p.find("video[pa-playing='true']").each(function(){var e=f(this).get(0);e.pause(),e.currentTime=0}),p.find(".premium-adv-carousel__video-icon, .premium-adv-carousel__vid-overlay").css("visibility","visible"),p.find(".premium-adv-carousel__media-wrap").css("background","unset")}function h(){var e=0;return p.find(".premium-adv-carousel__item").each(function(){e+=f(this).outerWidth(!0)}),_.css({width:e}),e}function d(){var e=p.find(".premium-adv-carousel__item"),i=v.dir,t=v.reverse,r=10,a=_.outerHeight();if("horizontal"===i){var o=h();_.css({height:a,position:"relative"}),_.find(".premium-adv-carousel__item-outer-wrapper").css("position","absolute"),"normal"===t?_.find(".premium-adv-carousel__item-outer-wrapper").css("right",0):(_.css("left","-"+o/e.length+"px"),"rtl"===document.dir&&_.css("direction","ltr"));for(var n=getComputedStyle(p[0]).getPropertyValue("--pa-wheel-spacing")||0,s="normal"===t?-1:1,u=0;o<=p.outerWidth(!0)||o-p.outerWidth(!0)<=400;)g(),o=h();gsap.set(p.find(".premium-adv-carousel__item-outer-wrapper"),{x:function(e){return u=(transformVal=u)+p.find(".premium-adv-carousel__item").eq(e).outerWidth(!0)+parseFloat(n),transformVal*s}});var l=o+p.find(".premium-adv-carousel__item").length*parseFloat(n),c=gsap.to(p.find(".premium-adv-carousel__item-outer-wrapper"),{duration:v.speed,ease:"none",x:("normal"===t?"-=":"+=")+l,modifiers:{x:gsap.utils.unitize(function(e){var i=parseFloat(e)%l,r=Math.max(i,-l);return"normal"===t?r:i})},repeat:-1})}else{e.each(function(){r+=f(this).outerHeight(!0)}),_.css({position:"relative",height:r}),_.find(".premium-adv-carousel__item-outer-wrapper").css("position","absolute"),"normal"===t?_.find(".premium-adv-carousel__item-outer-wrapper").css("bottom",0):_.css("top","-"+r/e.length+"px");n=getComputedStyle(p[0]).getPropertyValue("--pa-wheel-spacing")||0,s="normal"===t?-1:1;var m=0;gsap.set(p.find(".premium-adv-carousel__item-outer-wrapper"),{y:function(e){return transformVal=m,m+=p.find(".premium-adv-carousel__item").eq(e).outerHeight(!0),transformVal*s}});var d=r+p.find(".premium-adv-carousel__item").length*parseFloat(n);c=gsap.to(p.find(".premium-adv-carousel__item-outer-wrapper"),{duration:v.speed,ease:"none",y:("normal"===t?"-=":"+=")+d,modifiers:{y:gsap.utils.unitize(function(e){var i=parseFloat(e)%d,r=Math.max(i,-d);return"normal"===t?r:i})},repeat:-1})}v.pauseOnHover&&p.hover(function(){c.pause()},function(){c.play()})}function g(){var e=_.children().length,i=new DocumentFragment;_.find(".premium-adv-carousel__item-outer-wrapper:lt("+e+")").clone(!0,!0).appendTo(i),_.append(i)}}e(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/premium-media-wheel.default",i)})}(jQuery);