($=>{var a,T=$(window),n=$("html"),D=$("body"),M=$("#page-header"),t=$("#page-header-inner"),i=($("#page-content"),parseInt($makeaholic.header_sticky_height)),o=200,s=window.innerWidth;function W(e){return e.attr("href")||e.data("href")}function S(e){return!!e.match(/^([.#])(.+)/)}function z(e){a||(n=window.innerWidth,a=0,1==$makeaholic.header_sticky_enable&&0<M.length&&"1"==t.data("sticky")&&("1"!=t.data("header-vertical")||n<$makeaholic.mobile_menu_breakpoint)&&(a+=i),600<n&&0<(n=$("#wpadminbar")).length&&(a+=n.height()),0<a&&(a=-a));var n=a;$.smoothScroll({offset:n,scrollTarget:$(e),speed:600,easing:"linear"})}function O(){D.removeClass("page-mobile-menu-opened"),$(document).trigger("mobileMenuClose")}function P(){var e=$makeaholic.mobile_menu_breakpoint;s<=e?D.removeClass("primary-nav-rendering").removeClass("desktop-menu").addClass("mobile-menu"):D.removeClass("primary-nav-rendering").addClass("desktop-menu").removeClass("mobile-menu")}function l(){var e,n,a,i,o=M.children(".page-header-place-holder");1==$makeaholic.header_sticky_enable&&0<M.length&&"1"==t.data("sticky")&&("1"!=t.data("header-vertical")?(i=(n=(n=t.offset().top)<0?0:n)+(a=t.outerHeight())+100,M.hasClass("header-layout-fixed")||(a=t.outerHeight(),o.height(a),t.addClass("held")),e="header-pinned",M.headroom({offset:i,onTop:function(){D.removeClass(e),M.hasClass("header-layout-fixed")||setTimeout(function(){var e=t.outerHeight();o.height(e)},300)},onPin:function(){"down"!==$makeaholic.header_sticky_behaviour?D.addClass(e):D.removeClass(e)},onUnpin:function(){"up"!==$makeaholic.header_sticky_behaviour?D.addClass(e):D.removeClass(e)}})):s<=$makeaholic.mobile_menu_breakpoint?M.data("headroom")||((n=t.offset().top)<0&&(n=0),a=t.outerHeight(),M.headroom({offset:i=n+a+100})):M.data("headroom")&&(M.data("headroom").destroy(),M.removeData("headroom")))}function L(){D.removeClass("page-off-sidebar-opened")}function x(){var e;"1"==t.data("header-vertical")&&(window.innerWidth<=$makeaholic.mobile_menu_breakpoint?n.css({marginLeft:0}):(e=t.outerWidth(),n.css({marginLeft:e+"px"})))}$(window).on("resize",function(){s=window.innerWidth,P(),l(),x()}),$(window).on("load",function(){var e,n,a;setTimeout(function(){D.addClass("loaded")},200),e=$("#page-preloader"),setTimeout(function(){e.remove()},2e3),l(),D.hasClass("one-page")&&(a=$("#page-navigation").find(".menu__container").first().children(".menu-item"),n=a.children('a[href*="#"]:not([href="#"])'),a.each(function(){$(this).hasClass("current-menu-item")&&""!==$(this).children("a")[0].hash&&$(this).removeClass("current-menu-item")}),$.fn.elementorWaypoint&&n.each(function(){var e=$(this),n=this.hash,a=e.parent();S(n)&&0<(e=$(n)).length&&(e.elementorWaypoint(function(e){"down"===e&&(a.siblings("li").removeClass("current-menu-item"),a.addClass("current-menu-item"))},{offset:"25%"}),e.elementorWaypoint(function(e){"up"===e&&(a.siblings("li").removeClass("current-menu-item"),a.addClass("current-menu-item"))},{offset:"-25%"}))}),n.on("click",function(){var e=$(this),n=this.hash,e=e.parent("li");return e.siblings("li").removeClass("current-menu-item"),e.addClass("current-menu-item"),S(n)&&z(n),!1}),S(a=window.location.hash))&&z(a),$(".modern-grid").children(".grid-item").elementorWaypoint(function(){var e=this.element||this;$(e).addClass("animate")},{offset:"100%",triggerOnce:!0}),$(".makeaholic-entrance-animation-queue").each(function(){var n=[],a=$(this).data("animation-delay")?$(this).data("animation-delay"):o;$(this).children(".item").elementorWaypoint(function(){var e=this.element||$(this);setTimeout(function(){a=o},o),n.push(e),function e(n,a,i,o){clearTimeout(o);i=window.setInterval(function(){void 0!==n&&n.length?($(n.shift()).addClass("animate"),e()):window.clearInterval(i)},a)}(n,a,void 0),a+=o},{offset:"100%",triggerOnce:!0})})}),$(document).ready(function(){var n,a,i,o,t,s,e,l,r,c,d,m,h,u,p,f,g,v,k,C;P(),1==$makeaholic.scroll_top_enable&&(n=$("#page-scroll-up"),a=0,T.on("scroll",function(){var e=$(this).scrollTop();!(a<e)&&200<T.scrollTop()?n.addClass("show"):n.removeClass("show"),a=e}),n.on("click",function(e){$("html, body").animate({scrollTop:0},600),e.preventDefault()})),$("p:empty").each(function(){this.attributes.length<=0&&$(this).remove()}),$(".tm-slider").each(function(){var e,n;$(this).hasClass("makeaholic-swiper-linked-yes")?(e=$(this).children(".makeaholic-main-swiper").MakeaholicSwiper(),n=$(this).children(".makeaholic-thumbs-swiper").MakeaholicSwiper(),(e.controller.control=n).controller.control=e):$(this).MakeaholicSwiper()}),$(".makeaholic-main-post").MakeaholicGridLayout(),$(".smooth-scroll-link").on("click",function(e){var n=W($(this));S(n)&&(e.preventDefault(),e.stopPropagation(),z(n))}),$(".makeaholic-light-gallery").each(function(){var e,n,a,i,o,t;e=$(this),n="1"===$makeaholic.light_gallery_download,a="1"===$makeaholic.light_gallery_auto_play,i="1"===$makeaholic.light_gallery_zoom,o="1"===$makeaholic.light_gallery_full_screen,t="1"===$makeaholic.light_gallery_share,n={selector:".zoom",mode:"lg-fade",thumbnail:"1"===$makeaholic.light_gallery_thumbnail,download:n,autoplay:a,zoom:i,share:t,fullScreen:o,hash:!1,animateThumb:!1,showThumbByDefault:!1,getCaptionFromTitleOrAlt:!1},e.lightGallery(n)}),$(".tm-popup-video").each(function(){$(this).lightGallery({selector:"a",fullScreen:!1,zoom:!1,getCaptionFromTitleOrAlt:!1,counter:!1})}),i=$("#popup-search"),$("#page-open-popup-search").on("click",function(e){e.preventDefault(),D.addClass("page-search-popup-opened"),i.addClass("open"),setTimeout(function(){i.find(".search-field").focus()},500)}),$("#search-popup-close").on("click",function(e){e.preventDefault(),D.removeClass("page-search-popup-opened"),i.removeClass("open")}),(o=$("#page-open-components")).on("click",function(){D.toggleClass("header-more-tools-opened")}),$(document).on("click",function(e){"header-right-inner"===e.target.id||$(e.target).closest("#header-right-inner").length||$(e.target).closest(o).length||D.removeClass("header-more-tools-opened")}),$("#page-open-off-sidebar").on("click",function(e){e.preventDefault(),D.addClass("page-off-sidebar-opened")}),$("#page-close-off-sidebar").on("click",function(e){e.preventDefault(),L()}),$("#page-off-sidebar").on("click",function(e){e.target===this&&L()}),(w=M.find(".sm.sm-simple")).smartmenus({hideTimeout:250,subMenusSubOffsetX:0,subMenusSubOffsetY:-17}),w.on({"show.smapi":function(e,n){$(n).removeClass("hide-animation").addClass("show-animation")},"hide.smapi":function(e,n){$(n).removeClass("show-animation").addClass("hide-animation")}}).on("animationend webkitAnimationEnd oanimationend MSAnimationEnd","ul",function(e){$(this).removeClass("show-animation hide-animation"),e.stopPropagation()}),t=$("#off-canvas-menu-primary"),w=t.children("li"),s=$("#popup-canvas-menu"),$("#page-open-main-menu").on("click",function(e){e.preventDefault(),s.addClass("open"),D.addClass("page-popup-open")}),$("#page-close-main-menu").on("click",function(e){e.preventDefault(),t.fadeOut(function(){D.removeClass("page-popup-open"),s.removeClass("open"),t.fadeIn(),t.find(".sub-menu").slideUp()})}),e=.4,w.each(function(){$(this)[0].setAttribute("style","-webkit-transition-delay:"+e+"s; -moz-transition-delay:"+e+"s; -ms-transition-delay:"+e+"s; -o-transition-delay:"+e+"s; transition-delay:"+e+"s"),e+=.1}),t.on("click",".menu-item-has-children > a, .page_item_has_children > a",function(e){e.preventDefault(),e.stopPropagation();var e=$(this).parent("li"),n=e.siblings(".opened");n.removeClass("opened"),n.find(".opened").removeClass("opened"),n.find(".sub-menu, .children").stop().slideUp(),e.hasClass("opened")?(e.removeClass("opened"),e.find(".opened").removeClass("opened"),e.find(".sub-menu, .children").stop().slideUp()):(e.addClass("opened"),e.children(".sub-menu, .children").stop().slideDown())}),(w=$(".header-11")).length&&(l=w.find("#page-navigation"),r=l.find("#menu-primary > li"),c=r.length,d=$("body").hasClass("rtl"),m=w.find(".branding__logo > a"),p=d?"marginLeft":"marginRight",f=u=0,g=Math.ceil(c/2)-1,v=function(){h=m.outerWidth(),f=u=0;for(var e=c-1;0<=e;e--){var n=r.eq(e).outerWidth();g<e?f+=n:u+=n}var a=u-f;d?f<u?l.find("#menu-primary > li:first-child").css("marginRight",-a):l.find("#menu-primary > li:last-child").css("marginLeft",a):f<u?l.find("#menu-primary > li:last-child").css("marginRight",a):l.find("#menu-primary > li:first-child").css("marginLeft",-a),r.eq(g).css(p,h+25)},m.imagesLoaded(function(){v(),l.addClass("menu-calculated")}),$(window).on("resize",v));var b,w=$("#page-open-mobile-menu"),y=(0<w.length&&(b=w.data("menu-settings"),y=b.animation||"slide",b=b.direction||"left",D.addClass("mobile-menu-"+y+"-to-"+b),w.on("click",function(e){e.preventDefault(),e.stopPropagation(),D.addClass("page-mobile-menu-opened"),$(document).trigger("mobileMenuOpen")})),$("#page-close-mobile-menu").on("click",function(e){e.preventDefault(),e.stopPropagation(),O()}),$("#page-mobile-main-menu").on("click",function(e){e.target===this&&O()}),$("#mobile-menu-primary"));function _(){var e,n;0<k.length&&(e=$(document).width(),0<(n=k.find(".wpml-ls-sub-menu")).length)&&(n.offset().left+200>=e?n.addClass("hover-back"):n.removeClass("hover-back"))}y.on("click","a",function(e){var n=$(this),a=$(this).parent("li"),i=W(n);if(D.hasClass("one-page")&&S(i))return O(),a.siblings("li").removeClass("current-menu-item"),a.addClass("current-menu-item"),setTimeout(function(){z(i)},300),!1}),y.on("click",".toggle-sub-menu",function(e){var n=$(this).parents("li").first(),e=(e.preventDefault(),e.stopPropagation(),n.siblings(".opened"));e.removeClass("opened"),e.find(".opened").removeClass("opened"),e.find(".sub-menu").stop().slideUp(),n.hasClass("opened")?(n.removeClass("opened"),n.find(".opened").removeClass("opened"),n.find(".sub-menu").stop().slideUp()):(n.addClass("opened"),n.children(".sub-menu").stop().slideDown())}),1==$makeaholic.noticeCookieEnable&&"yes"!=$makeaholic.noticeCookieConfirm&&""!=$makeaholic.noticeCookieMessages&&($.growl({location:"br",fixed:!0,duration:36e5,size:"large",title:"",message:$makeaholic.noticeCookieMessages}),$("#tm-button-cookie-notice-ok").on("click",function(){$(this).parents(".growl-message").first().siblings(".growl-close").trigger("click");var e=$.param({action:"notice_cookie_confirm"});$.ajax({url:$makeaholic.ajaxurl,type:"POST",data:e,dataType:"json",success:function(e){},error:function(e){console.log(e)}})})),D.hasClass("error404")&&$("#btn-go-back").on("click",function(e){e.preventDefault(),window.history.back()}),x(),0<(b=$("#nav-toggle-btn")).length&&b.on("click",function(){var e=$(this).parents(".header-categories-nav").first(),n="opened-menu";e.hasClass(n)?e.removeClass(n):e.addClass(n)}),0<(w=$("#archive-form-filtering")).length&&w.find("select").on("change",function(){$(this).closest("form").submit()}),k=$("#switcher-language-wrapper"),_(),$(window).on("resize",function(){_()}),y=$(".sale-on-top"),C=$("body"),y.after().on("click",function(){C.addClass("hidden-badge")}),$(".makeaholic-nice-select").MakeaholicNiceSelect()}),window.nativeAlert=window.alert,window.alert=function(e){$.growl.error({location:"br",duration:5e3,size:"large",title:$makeaholic.alertTitle,message:e})}})(jQuery);