text: !function(z){"use strict";Berserk.behaviors.header_init={attach:function(e,n){z(e).parent().find(".brk-header:not(.rendered)").addClass("rendered").each(function(){var c=z(this),i=c.find(".brk-header__main-bar"),a=i.data("height-scroll"),n=992,o=c.data("sticky-hide");z("body").width();if(z(".brk-header__top-bar").length){var t=c.find(".brk-header__top-bar_hide"),s=c.find(".brk-header__top-bar_scroll"),l=c.find(".brk-header__top-bar").data("top");l=l||0;var e=function(e){if(e<=(window.innerWidth||z(window).width())){if(t.length){var n=t.innerHeight()-l;if(z("body").hasClass("admin-bar")){var r=n-32;c.css("top","-"+r+"px")}else c.css("top","-"+n+"px")}}else c.css("top","0")},r=function(e){if(1!==o)if(e<=(window.innerWidth||z(window).width())){if(s.length){var n=s.innerHeight()-l;if(0<z(window).scrollTop())if(z(".brk-open-top-bar").length&&c.find(".brk-open-top-bar").removeClass("active"),z("body").hasClass("admin-bar")){var r=n-32;c.css("top","-"+r+"px")}else c.css("top","-"+n+"px");else z(window).scrollTop()<=0&&(z(".brk-open-top-bar").length&&c.find(".brk-open-top-bar").addClass("active"),z("body").hasClass("admin-bar")?c.css("top","32px"):c.css("top","0"))}}else c.css("top","0")};setTimeout(function(){e(n)},2e3),r(n),z(window).on("resize scroll",function(){e(n),r(n)})}if(z(".brk-open-top-bar").length&&!c.find(".brk-header__top-bar_scroll").length){var d=c.find(".brk-open-top-bar");d.on("click",function(){d.toggleClass("active"),c.toggleClass("top-bar-active")})}function b(e){var n=window.innerWidth||z(window).width();if(a)var r=i.data("height-temp");c.hasClass("brk-header_not-fixed")||e<=n&&(0<z(window).scrollTop()?(c.addClass("brk-header_scroll"),a&&i.css("height",a+"px")):z(window).scrollTop()<=0&&(c.removeClass("brk-header_scroll"),a&&i.css("height",r+"px"))),0<z(window).scrollTop()?z(".brk-header-mobile").addClass("brk-header-mobile_scroll"):z(window).scrollTop()<=0&&z(".brk-header-mobile").removeClass("brk-header-mobile_scroll")}if(z(window).on("scroll",function(){if(c.find(".brk-header__top-bar_scroll")&&0<z(window).scrollTop()){var e=c.find(".brk-open-top-bar");e.unbind("click"),e.on("click",function(){e.toggleClass("active"),c.toggleClass("top-bar-active")})}}),a&&i.data("height-temp",i.height()),b(n),z(window).on("scroll",function(){b(n)}),1===o){var h=0;setTimeout(function(){z(window).on("scroll",function(){var e=z(this).scrollTop(),n=!1,r=!1;0<e&&(h<e?(n=!1,e<c.height()+c.offset().top&&!1===r&&(c.addClass("brk-header_sticky-hide"),r=!0)):(r=!1,e>c.offset().top&&!1===n&&(c.removeClass("brk-header_sticky-hide"),n=!0)),h=e)})},2500)}var k=!1;function v(e){var n=window.innerWidth||z(window).width();if(n<e&&!k){c.wrap('<div class="brk-header-mobile-wrap"><div class="brk-header-mobile-wrap__body"></div></div>');var r=z(".brk-header-mobile-wrap"),i=z(".brk-header-mobile-wrap__body"),a=c.data("logo-src"),o=c.data("bg-mobile");i.prepend('<div class="brk-before"></div><div class="brk-header-mobile-wrap__header"><div class="brk-header-mobile-wrap__close"><span></span></div></div>'),""!==a&&z(".brk-header-mobile-wrap__header").prepend('<div class="brk-header-mobile-wrap__logo"><img src="'+a+'" alt=""></div>'),""!==o&&void 0!==o&&r.css("background-image","url("+o+")"),r.before('<div class="brk-header-mobile-wrap-layer"></div>'),k=!0}else e<=n&&k&&(z(".brk-header-mobile-wrap__header").detach(),z(".brk-header-mobile-wrap-layer").remove(),z(".brk-before, .brk-header-mobile-wrap__header").remove(),c.unwrap(),c.unwrap(),k=!1);var t=z(".brk-header-mobile"),s=t.find(".brk-header-mobile__open"),l=(r=z(".brk-header-mobile-wrap")).find(".brk-header-mobile-wrap__close"),d=z(".brk-header-mobile-wrap-layer");t.length&&s.on("click",function(){z("body").addClass("brk-modal-open"),r.addClass("is-active"),d.addClass("is-active")}),r.length&&l.on("click",function(){z("body").removeClass("brk-modal-open"),r.removeClass("is-active"),d.removeClass("is-active")})}v(n),z(window).on("resize load",function(){v(n)});var f=!1;function p(e){var n=z(".brk-nav, .brk-header-popup-menu"),r=n.find(".brk-nav__children"),i=n.find(".brk-nav__menu > li").children("a"),a=n.find("a"),o=window.innerWidth||z(window).width();if(o<e&&!f){if(r.prepend('<div class="brk-nav__link-open"><i class="fa fa-angle-right"></i></div>'),z(".brk-nav__link-open").length){var t=z(".brk-nav__link-open");0<t.length&&t.on("click",function(){var e=z(this),n=e.parent(),r=n.children(".brk-nav-drop-down");n.toggleClass("children-active"),e.toggleClass("is-active"),r.slideToggle(400)}),i.each(function(){var e=z(this),n=e.attr("href");"/"!==n&&("#"===n[0]&&1===n.length||"javascript:void(0)"===n||!n.length)&&e.on("click",function(e){e.preventDefault();var n=z(this).parent(),r=n.children(".brk-nav-drop-down"),i=n.children(".brk-nav__link-open");n.toggleClass("children-active"),i.toggleClass("is-active"),r.slideToggle(400)})})}a.each(function(){var e=z(this),r=e.attr("href");"#"===r[0]&&e.on("click",function(e){if(e.preventDefault(),z(r).length){var n=z(this).parents(".brk-header-mobile-wrap");z("body").removeClass("brk-modal-open"),n.removeClass("is-active"),z(".brk-header-mobile-wrap-layer").removeClass("is-active")}})}),f=!0}else 0<z(".brk-nav__link-open").length&&e<=o&&f&&(z(".brk-nav__link-open").remove(),r.removeClass("children-active"),f=!1)}z(window).on("load",function(){p(n)}),z(window).on("resize",function(){p(n)}),z(".brk-nav__drop-down-effect").each(function(){var e=z(this),a=e.find(".dd-effect");e.on("mouseenter",function(){var e,n,r,i;e=a,n=10,i="left"===r?{opacity:0,left:10}:{opacity:0,left:-10},(e="left"===r?z(e.get().reverse()):e).css(i).each(function(e){z(this).delay(n*e).animate({opacity:1,left:0})})})}),z(".brk-quantity").find(".brk-quantity__arrows").on("click",function(){var e=z(this).parent().find(".brk-quantity__value"),n=e.val();z(this).hasClass("minus")&&1<n?e.val(+n-1):z(this).hasClass("plus")&&e.val(+n+1)});var u,_=z(".brk-info-menu"),m=z(".brk-info-menu-open"),w=_.find(".brk-info-menu__close"),g=window.innerWidth||z(window).width(),C=z("body"),y=window.innerWidth-document.documentElement.clientWidth;function T(e,n,r,i){n=(e=z(e)).find(n),r=e.find(r);var a=window.innerWidth||z(window).width();a<i?n.unbind("click").on("click",function(){r.slideToggle(400)}):i<=a&&(n.unbind("click"),r.css("display",""))}function x(e){var n=window.innerWidth||z(window).width();n<e?z(".brk-lang:not(.brk-lang-rendered)").addClass("brk-lang-rendered").each(function(){var e=z(this),n=e.find(".brk-lang__open"),r=e.find(".brk-lang__option");e.unbind(),n.on("click",function(){r.slideToggle(300)})}).removeClass("brk-lang_interactive-rendered"):e<=n&&(z(".brk-lang_interactive:not(.brk-lang_interactive-rendered)").addClass("brk-lang_interactive-rendered").each(function(){var e=z(this),n=e.closest(".brk-header__top-bar, .brk-header__main-bar"),r=n.find(".container-fluid, .container"),i=n.find(".brk-header__item:not(.brk-lang_interactive)"),a=i.parents('[class*="col"]');n.css({height:n.outerHeight(),transition:"height .3s"}),e.on({mouseenter:function(){i.css("opacity","0"),r.css("background","transparent !important"),n.addClass("top-bar-bg"),z("div").is(".brk-overlay")||c.after('<div class="brk-overlay"></div>'),a.css("border","0")},mouseleave:function(){i.css("opacity","1"),r.removeAttr("style"),n.removeClass("top-bar-bg"),z("div").is(".brk-overlay")&&z(".brk-overlay").remove(),a.css("border","")}})}).removeClass("brk-lang-rendered"),z(".brk-lang__option").css("display",""),z(".brk-lang").find(".brk-lang__open").unbind("click"))}function W(){var r=window.innerWidth||z(window).width();if(!(r<992)){z(".brk-mini-cart, .brk-social-links, .brk-search, .brk-lang, .brk-nav__sub-menu, .flexMenu-popup").each(function(){var e=z(this),n=r/2+350;e.offset().left+e.width()/2<n?e.removeClass("brk-location-screen-left brk-location-screen-right").addClass("brk-location-screen-left"):e.removeClass("brk-location-screen-left brk-location-screen-right").addClass("brk-location-screen-right")})}}function M(){var e=z(".brk-mini-cart__open"),n=window.innerWidth||z(window).width();e.on("click",function(e){n<992&&e.preventDefault()})}m.on("click",function(){_.toggleClass("active"),m.toggleClass("open-active"),n<=g&&(C.toggleClass("brk-modal-open"),C.hasClass("brk-modal-open")?C.attr("style","--mr:"+y+"px"):C.attr("style",""))}),w.on("click",function(){_.hasClass("active")&&_.removeClass("active"),m.hasClass("open-active")&&m.removeClass("open-active"),n<=g&&(C.hasClass("brk-modal-open")&&C.removeClass("brk-modal-open"),C.hasClass("brk-modal-open")?C.attr("style","--mr:"+y+"px"):C.attr("style",""))}),z(document).on("click",function(e){z(e.target).closest(".brk-info-menu").length||z(e.target).closest(".brk-info-menu-open").length||(_.hasClass("active")&&_.removeClass("active"),m.hasClass("open-active")&&m.removeClass("open-active"),n<=g&&(C.hasClass("brk-modal-open")&&C.removeClass("brk-modal-open"),C.hasClass("brk-modal-open")?C.attr("style","--mr:"+y+"px"):C.attr("style",""))),e.stopPropagation()}),T(".brk-mini-cart",".brk-mini-cart__open, .brk-mini-cart__info-open",".brk-mini-cart__menu",n),T(".brk-social-links",".brk-social-links__open",".brk-social-links__block",n),T(".brk-search",".brk-search__open",".brk-search__block",n),z(window).on("resize",function(){T(".brk-mini-cart",".brk-mini-cart__open, .brk-mini-cart__info-open",".brk-mini-cart__menu",n),T(".brk-social-links",".brk-social-links__open",".brk-social-links__block",n),T(".brk-search",".brk-search__open",".brk-search__block",n)}),u=window.innerWidth||z(window).width(),n<=u&&z(".brk-search_interactive").each(function(){var e=z(this),n=e.parents(".brk-header__main-bar"),r=n.children(".container-fluid, .container"),i=e.find(".brk-search__open"),a=e.find(".brk-search__close"),o=e.find(".brk-search__block"),t=o.find('[type="search"]'),s=n.find(".brk-header__item:not(.brk-search_interactive)"),l=s.parents('[class*="col"]');i.on("click",function(){o.addClass("active"),r.addClass("position-relative"),s.hide(0),z(this).hide(0),z("div").is(".brk-overlay")||c.after('<div class="brk-overlay"></div>'),setTimeout(function(){t.focus()},150),l.css("border","0")}),a.on("click",function(){o.removeClass("active"),s.show(0),i.show(0),r.removeClass("position-relative"),z("div").is(".brk-overlay")&&z(".brk-overlay").remove(),l.css("border","")}),z(document).on("click",function(e){z(e.target).closest(".brk-header").length||(o.removeClass("active"),s.show(0),i.show(0),r.removeClass("position-relative"),z("div").is(".brk-overlay")&&z(".brk-overlay").remove(),l.css("border","")),e.stopPropagation()})}),window.addEventListener("load",function(){x(n)}),z(window).on("resize",function(){x(n)}),function(){if(0<z(".brk-header-popup-menu").length){c.after('<div class="brk-header-popup-menu-layer"></div>');var n=z(".brk-header-popup-menu").find(".brk-header-popup-menu__open-close"),r=z(".brk-header-popup-menu__menu"),i=z(".brk-header-popup-menu-layer"),a=r.find("a");0<z(".brk-header_vertical").length&&(z(".brk-header").append(r),r.addClass("brk-moved-by-js")),n.on("click",function(){z(this).toggleClass("is-active"),r.fadeToggle(300),i.fadeToggle(500)}),i.on("click",function(){var e=z(this);n.toggleClass("is-active"),r.fadeToggle(300),e.fadeToggle(500)}),a.each(function(){var e=z(this).attr("href");"#"===e[0]&&1<e.length&&z(e).length&&a.on("click",function(){n.removeClass("is-active"),r.fadeOut(300),i.fadeOut(500)})})}}(),z(".brk-totop").on("click",function(){z("html, body").stop().animate({scrollTop:0},500)}),W(),z(window).on("load resize",function(){setTimeout(function(){W()},300)}),M(),z(window).on("load resize",function(){M()})})}},Berserk.behaviors.header_init_menu_flex={attach:function(e,n){if(!(z(".brk-nav:not(.rendered)").length<1)){if("function"!=typeof z.fn.flexMenu)return console.log("Waiting for the flexMenu library"),void setTimeout(Berserk.behaviors.header_init_menu_flex.attach,n.timeout_delay,e,n);var i=!0;z(e).parent().find(".brk-nav:not(.rendered)").addClass("rendered").each(function(){var e=z(this),n=e.find(".brk-nav__menu"),r=e.data("flexmenu-link-text");0===e.closest(".brk-header_vertical").length&&(r=r||"More",z(window).on("load",function(){setTimeout(a(n,r),350)}),z(window).on("resize",function(){a(n,r)}),setTimeout(function(){z(window).trigger("resize")},500))})}function a(n,e){var r=window.innerWidth||z(window).width();r<992&&!i?(n.flexMenu({undo:!0}),i=!0):992<=r&&i&&(n.flexMenu({linkText:e}),setTimeout(function(){if(z(".flexMenu-viewMore").length){var e=z(".flexMenu-popup").offset().left+80;n.find(".flexMenu-viewMore .brk-nav__mega-menu").attr("style","width: calc(100vw - "+e+"px)")}},500),i=!1)}}}}(jQuery);