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