!function(e){"use strict";window.VAMTAM_FRONT.elementor=window.VAMTAM_FRONT.elementor||{};var t={domLoaded:function(){this.VamtamMainNavHandler.init(),this.VamtamActionLinksHandler.init(),this.VamtamPopupsHandler.disablePopupAutoFocus()},pageLoaded:function(){this.VamtamPopupsHandler.init(),this.VamtamWidgetsHandler.stickyInsideParentFix()},VamtamPopupsHandler:{init:function(){this.searchFormPopupsGetFocus(),this.absolutelyPositionedPopups(),this.alignedWithSelectorPopups(),this.enablePageTransitionsForPopupLinks(),this.lateInit()},lateInit:function(){setTimeout(()=>{this.hoverActivatedPopups()},50)},searchFormPopupsGetFocus:function(){window.elementorFrontendConfig.kit.vamtam_theme_search_form_popups_get_focus&&elementorFrontend.elements.$window.on("elementor/popup/show",e=>{if(!e.originalEvent)return;const t=e.originalEvent.detail.id,n=e.originalEvent.detail.instance;if(!t||!n)return;if(n.$element.find('form[role="search"]').length){n.$element.find('input[type="search"]').first().focus()}})},absolutelyPositionedPopups:function(){const e=[];elementorFrontend.elements.$window.on("elementor/popup/show",t=>{if(!t.originalEvent)return;const n=t.originalEvent.detail.id,i=t.originalEvent.detail.instance;if(!n||!i||e.includes(n))return;i.$element.filter('[data-elementor-settings*="vamtam_abs_pos"]').length&&(i.$element.closest(`#elementor-popup-modal-${n}`).addClass("vamtam-abs-pos"),e.push(n))})},alignedWithSelectorPopups:function(){const t=[],n=()=>{t.length=0};elementorFrontend.elements.$window.on("elementor/popup/show",n=>{if(!n.originalEvent)return;const i=n.originalEvent.detail.id,o=n.originalEvent.detail.instance;if(!i||!o||t.includes(i))return;const s=o.$element.filter('[data-elementor-settings*="vamtam_align_with_selector"]');if(s.length){const n=o.$element.closest(".dialog-widget-content"),r=s.data("elementorSettings").open_selector,a=r&&e(`${r}:visible`);if(!a.length)return;const l=a[0].getBoundingClientRect();window.requestAnimationFrame(()=>{n.css({top:l.bottom+"px",left:l.left+"px"})}),t.push(i)}}),window.removeEventListener("resize",n),window.addEventListener("resize",n,!0)},disablePopupAutoFocus:function(){elementorFrontend.elements.$window.on("elementor/popup/show elementor/popup/hide",e=>{setTimeout(()=>{"input"!==document.activeElement.nodeName&&document.activeElement.blur()},100)})},enablePageTransitionsForPopupLinks(){if(!elementorFrontend.config.experimentalFeatures["page-transitions"])return;let e=jQuery("e-page-transition");if(!e.length)return;e=e[0];if(e.getAttribute("triggers"))return;const t=e.onLinkClick;t&&jQuery(document).on("click",'.elementor-popup-modal a:not([data-elementor-open-lightbox="yes"])',t.bind(e))},hoverActivatedPopups:function(){if(window.elementorFrontend.isEditMode())return;const e=this.utils.getPopups();if(!e.length)return;const t=[];function n(e){const n=jQuery(e);if(!n.length)return;let i;return t.forEach(e=>{i||n.filter(e.selector).length&&(i=e)}),i}function i(e){let n;return t.forEach(t=>{n||t.id===e&&(n=t)}),n}e.forEach(e=>{if(e.instance.getDocumentSettings().vamtam_open_on_selector_hover){const n=e.instance.getDocumentSettings().open_selector,i=e.instance.getDocumentSettings().vamtam_close_on_hover_lost;t.push({id:parseInt(e.id),selector:n,instance:e.instance,isHovering:!1,selectorIsHovering:!1,closeOnHoverLost:i,modal:e.instance.getModal(),showPopup:function(){this.instance.showModal(),"input"!==document.activeElement.nodeName&&document.activeElement.blur()},hidePopup:function(){const e=this.modal;if(e.parent?.openDialogs&&e.isVisible()){const t=e.getElements("widget")?.attr("id"),n=e.parent.openDialogs,i=n.indexOf(t);-1!==i&&n.splice(i,1),n.push(t)}this.modal.hide()},isVisible:function(){return this.modal.isVisible()}})}}),t.length&&t.forEach(e=>{jQuery(e.selector).on("mouseenter",function(){const e=n(this);e&&(e.selectorIsHovering=!0,e.isVisible()||e.showPopup())}),jQuery(document.body).on("mouseenter",`#elementor-popup-modal-${e.id} [data-elementor-id="${e.id}"]`,function(){const e=parseInt(jQuery(this).data("elementorId"));if(Number.isInteger(e)){const t=i(e);t&&(t.isHovering=!0)}}),e.closeOnHoverLost&&(jQuery(e.selector).on("mouseleave",function(){setTimeout(()=>{if(e=this,"open_selector"==="open_selector"&&jQuery(e).find("*:hover").length)return;var e;const t=n(this);t&&(t.selectorIsHovering=!1,t.isVisible()&&!t.isHovering&&t.hidePopup())},200)}),jQuery(document.body).on("mouseleave",`#elementor-popup-modal-${e.id} [data-elementor-id="${e.id}"]`,function(){setTimeout(()=>{const e=parseInt(jQuery(this).data("elementorId"));if(Number.isInteger(e)){const t=i(e);t&&(t.isHovering=!1,t.selectorIsHovering||t.hidePopup())}},200)}))})},utils:{getPopups:function(){const e=elementorFrontend.documentsManager.documents,t=[];return Object.entries(e).forEach(([e,n])=>{n.initModal&&(n.getModal||n.initModal(),t.push({id:e,instance:n}))}),t}}},VamtamMainNavHandler:{init:function(){this.fixMenuDrodownScrolling()},fixMenuDrodownScrolling:function(){var t=e(".elementor-location-header .elementor-nav-menu--dropdown-tablet .elementor-nav-menu--dropdown.elementor-nav-menu__container").first(),n=t.siblings(".elementor-menu-toggle")[0];if(t.length&&n.length){var i=function(){if(e(n).hasClass("elementor-active")){var o=e("html").hasClass("ios-safari")?t[0].getBoundingClientRect().top+100:t[0].getBoundingClientRect().top;t.css("max-height","calc(100vh - "+o+"px)"),n.removeEventListener("click",i)}};n.addEventListener("click",i)}}},VamtamActionLinksHandler:{init:function(){this.popupActionLinks()},popupActionLinks:function(){var t=this,n=window.VAMTAM.isBelowMaxDeviceWidth(),i=[],o=function(t,n,i){var o=e("#elementor-popup-modal-"+t),s=e(o).find(".dialog-widget-content"),r=window.VAMTAM.adminBarHeight;if(s.length&&n){var a,l=n.getBoundingClientRect();i?e(s).css({top:"",left:""}):(e(s).css({top:l.bottom-r,left:l.left}),a=setInterval(function(){"none"===e(o).css("display")&&(e(s).css({top:"",left:""}),clearInterval(a))},500))}},s=function(e){i.forEach(function(t){e?o(t.id,t.parent,!0):o(t.id,t.parent)})},r=function(){var e=window.VAMTAM.isBelowMaxDeviceWidth();n!==e?(e?s(!0):s(),n=e):e||s()},a=function(){requestAnimationFrame(function(){s()})};elementorFrontend.elements.$document.on("click",'a[href^="#elementor-action"]',function(n){var s=e(n.currentTarget).attr("href");if(s){var l,d,c,u=t.utils.getSettingsFromActionLink(s);u&&u.align_with_parent&&(l=u.id,d=n.currentTarget,i.forEach(function(e){e.id===l&&(e.parent=d,c=!0)}),c||i.push({id:l,parent:d}),window.VAMTAM.isMaxDeviceWidth()&&o(u.id,n.currentTarget),window.removeEventListener("resize",r),window.addEventListener("resize",r,!1),function(t){const n=e(t).parents(".elementor-element.elementor-widget")[0];if(!n)return;let i=e(n).attr("data-settings");if(!i)return;try{i=JSON.parse(i)}catch(e){return}i.sticky&&(window.removeEventListener("scroll",a),window.addEventListener("scroll",a,{passive:!0}))}(n.currentTarget))}})},utils:{getSettingsFromActionLink:function(e){if(e=decodeURIComponent(e)){var t=e.match(/settings=(.+)/),n={};return t&&(n=JSON.parse(atob(t[1]))),n}},getActionFromActionLink:function(e){if(e=decodeURIComponent(e)){var t=e.match(/action=(.+?)&/);if(t)return t[1]}}}},VamtamWidgetsHandler:{isWidgetModActive:e=>{if(!e)return!1;const t=elementorFrontend.getKitSettings(),n="vamtam_theme_";return!!window.VAMTAM_FRONT.widget_mods_list[e]&&("yes"===t[`${n}enable_all_widget_mods`]||"yes"!==t[`${n}disable_all_widget_mods`]&&"yes"===t[`${n}${e}`])},stickyInsideParentFix:()=>{const e=document.querySelectorAll('.elementor-sticky[data-settings*=\'"sticky_parent":"yes"\']');e.length&&e.forEach(e=>{window.VAMTAM_FRONT.WidgetsResizeObserver.observe(e,function(){window.VAMTAM.debounce(window.dispatchEvent(new Event("resize")),500)})})}},WidgetsObserver:{observer:null,targetsMap:new Map,init(){this.observer||(this.observer=new IntersectionObserver(this.handleIntersect.bind(this),{root:null,threshold:0,rootMargin:"0px"}))},observe(e,t,n={once:!0}){this.init(),this.targetsMap.has(e)||(this.targetsMap.set(e,{onIntersect:t,options:n}),this.observer.observe(e))},unobserve(e){this.targetsMap.has(e)&&(this.targetsMap.delete(e),this.observer.unobserve(e))},handleIntersect(e){e.forEach(e=>{if(this.targetsMap.has(e.target)){const{onIntersect:t,options:n}=this.targetsMap.get(e.target);e.isIntersecting&&(t(),n.once&&this.unobserve(e.target))}})}},WidgetsResizeObserver:{observer:null,targetsMap:new Map,init(){this.observer||(this.observer=new ResizeObserver(this.handleResize.bind(this)))},observe(e,t){this.init(),this.targetsMap.has(e)||(this.targetsMap.set(e,{onElementResize:t}),this.observer.observe(e))},unobserve(e){this.targetsMap.has(e)&&(this.targetsMap.delete(e),this.observer.unobserve(e))},handleResize(e){e.forEach(e=>{if(this.targetsMap.has(e.target)){const{onElementResize:t}=this.targetsMap.get(e.target);t()}})}}};window.VAMTAM_FRONT.elementor.urlActions=t.VamtamActionLinksHandler.utils,window.VAMTAM_FRONT.elementor.popups=t.VamtamPopupsHandler.utils,window.VAMTAM_FRONT.elementor.widgets={isWidgetModActive:t.VamtamWidgetsHandler.isWidgetModActive},window.VAMTAM_FRONT.WidgetsObserver=t.WidgetsObserver,window.VAMTAM_FRONT.WidgetsResizeObserver=t.WidgetsResizeObserver,e(document).ready(function(){t.domLoaded()}),e(window).on("load",function(){t.pageLoaded()});class n extends elementorModules.frontend.handlers.Base{onInit(...e){super.onInit(...e),this.checkAddBaseThemeStylesClass()}checkAddBaseThemeStylesClass(){e("body").hasClass("elementor-editor-active")&&this.isWidgetModActive()&&this.$element.addClass("vamtam-has-theme-widget-styles")}isWidgetModActive(){let e=this.getElementType();return"widget"===e&&(e=this.getWidgetType()),t.VamtamWidgetsHandler.isWidgetModActive(e)}}jQuery(window).on("elementor/frontend/init",()=>{elementorFrontend.hooks.addAction("frontend/element_ready/global",e=>{elementorFrontend.elementsHandler.addHandler(n,{$element:e})})})}(jQuery);