class VamtamImage extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{image:".elementor-image img",imageWrap:".vamtam-image-wrapper"}}}getDefaultElements(){const e=this.getSettings("selectors");return{$image:this.$element.find(e.image),$imageWrap:this.$element.find(e.imageWrap)}}onInit(...e){super.onInit(...e),this.handleImageGrowAnims()}handleImageGrowAnims(){var e=this.getElementSettings(),t=["growFromLeft","growFromRight"],i=["imageGrowWithScaleLeft","imageGrowWithScaleRight","imageGrowWithScaleTop","imageGrowWithScaleBottom"];t.includes(e._animation)||t.includes(e.animation)?(this.elements.$image.addClass("elementor-invisible"),window.VAMTAM_FRONT.WidgetsObserver.observe(this.$element[0],this.animateScale.bind(this))):(i.includes(e._animation)||i.includes(e.animation))&&(this.elements.$imageWrap.addClass("elementor-invisible"),this.elements.$image.addClass("elementor-invisible"),this.animDuration=this.calcAnimDuration(),window.VAMTAM_FRONT.WidgetsObserver.observe(this.$element[0],this.animate.bind(this)))}animate(){this.animateGrow(),this.animateScale()}calcAnimDuration(){const e=this.$element.hasClass("animated-slow")?100:this.$element.hasClass("animated-fast")?400:200,t=this.elements.$imageWrap[0].offsetWidth/e;return t}animateGrow(){const e=this.elements.$imageWrap,t=this.getAnimation();if("none"===t)return void e.removeClass("elementor-invisible");const i=this.getElementSettings(),n=i._animation_delay||i.animation_delay||0,a=this.animDuration||i.animation_duration||"";e.removeClass(t),this.currentAnimation&&e.removeClass(this.currentAnimation),this.currentAnimation=t,a?(e[0].style["-webkit-animation-duration"]=this.animDuration+"s",e[0].style["-moz-animation-duration"]=this.animDuration+"s",e[0].style["-o-animation-duration"]=this.animDuration+"s",e[0].style["animation-duration"]=this.animDuration+"s"):(this.$element.hasClass("animated-slow")&&e.addClass("animated-slow"),this.$element.hasClass("animated-fast")&&e.addClass("animated-fast")),setTimeout(()=>{window.requestAnimationFrame(()=>{e.removeClass("elementor-invisible").addClass("animated "+t)})},n)}animateScale(){const e=this.elements.$image,t=this.getAnimation();if("none"===t)return void e.removeClass("elementor-invisible");const i=this.getElementSettings(),n=i._animation_delay||i.animation_delay||0,a=this.animDuration||i.animation_duration||"";e.removeClass(t),this.currentAnimation&&e.removeClass(this.currentAnimation),this.currentAnimation=t,a?(e[0].style["-webkit-animation-duration"]=a+"s",e[0].style["-moz-animation-duration"]=a+"s",e[0].style["-o-animation-duration"]=a+"s",e[0].style["animation-duration"]=a+"s"):(this.$element.hasClass("animated-slow")&&e.addClass("animated-slow"),this.$element.hasClass("animated-fast")&&e.addClass("animated-fast")),setTimeout(()=>{window.requestAnimationFrame(()=>{e.removeClass("elementor-invisible").addClass("animated "+t)})},n)}getAnimation(){return this.getCurrentDeviceSetting("animation")||this.getCurrentDeviceSetting("_animation")}onElementChange(e){/^_?animation/.test(e)&&this.animate()}}jQuery(window).on("elementor/frontend/init",()=>{if(elementorFrontend.elementsHandler&&elementorFrontend.elementsHandler.attachHandler)elementorFrontend.elementsHandler.attachHandler("image",VamtamImage);else{const e=e=>{elementorFrontend.elementsHandler.addHandler(VamtamImage,{$element:e})};elementorFrontend.hooks.addAction("frontend/element_ready/image.default",e,100)}});