function setSecondaryHeight(n){var r=document.querySelector("footer.footer"),i,t;r&&((i=r.getBoundingClientRect().top-n.getBoundingClientRect().top,!i||i<0)||(i+=50,t=n.querySelector(".secondary-content__back"),t||(t=document.createElement("div"),t.className="secondary-content__back",n.insertAdjacentElement("afterbegin",t),r.classList.add("m-with-secondary")),t.style.height=i+"px"))}function controlSideBanners(){var n=document.querySelector(".secondary-content"),t=document.querySelectorAll(".layout-cols__side .banner-sm, .layout-cols__side .banner-md, .layout-cols__side .b-holder"),i;n&&t.length&&(i=n.getBoundingClientRect().top,[].forEach.call(t,function(n){if(!n.closest(".secondary-content")){var t=n.getBoundingClientRect().bottom;t>i&&n.classList.add("hidden")}}))}function debounce(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null;i||n.apply(u,f)},o=i&&!r;clearTimeout(r);r=setTimeout(e,t);o&&n.apply(u,f)}}function externalLinks(){for(var t,i=document.getElementsByTagName("a"),n=0;n<i.length;n++)t=i[n],t.getAttribute("href")&&t.hostname!==location.hostname&&(t.target="_blank")}document.addEventListener("DOMContentLoaded",function(){var f=document.querySelectorAll(".header__nav-expand"),t,n,r,i,u;[].forEach.call(f,function(n){var t=n.closest("li"),i=t.querySelector("a");i.addEventListener("click",function(n){n.preventDefault();var i=document.querySelector(".header__nav .expanded");i&&i!==t&&i.classList.remove("expanded");t.classList.toggle("expanded")})});document.body.addEventListener("click",function(n){var t=document.querySelector(".header__nav .expanded"),i;t&&!n.target.closest(".header__nav")&&t.classList.remove("expanded");i=document.querySelector(".header__nav-full");i&&document.querySelector(".mobile-nav-opened")&&!n.target.closest(".header__nav-full ul")&&document.querySelector(".mobile-nav-opened").classList.remove("mobile-nav-opened")});t=document.querySelector(".header__nav-button");t&&t.addEventListener("click",function(n){n.stopPropagation();document.body.classList.add("mobile-nav-opened")});n=document.querySelector(".header__nav-full");n&&(n.addEventListener("touchstart",function(t){n.swipeStart=t.changedTouches[0].clientX}),n.addEventListener("touchend",function(t){n.swipeStart&&n.swipeStart-t.changedTouches[0].clientX>50&&document.querySelector(".mobile-nav-opened").classList.remove("mobile-nav-opened");n.swipeStart=null}));r=document.querySelectorAll(".preview-bg .vis > img");[].forEach.call(r,function(n){var t=document.createElement("div");t.className="vis-mirror";t.style.backgroundImage='url("'+n.src+'")';n.closest(".vis").appendChild(t)});i=document.querySelectorAll(".section-slider");i.length&&(window.addEventListener("resize",fixSliderScroll),[].forEach.call(i,function(n){var u;n.currentSlide=0;var i=n.querySelector(".btn-arrow-prev"),r=n.querySelector(".btn-arrow-next"),f=n.querySelector(".section-slider__wrap"),t=n.querySelector(".section-slider__container");f&&t&&(n.querySelector(".section-slider__container > div").classList.add("active"),u=t.children.length,i.disabled=!0,u===1&&(r.disabled=!0),i.addEventListener("click",function(){var u=t.offsetWidth;n.currentSlide--;t.style.transform="translateX(-"+u*n.currentSlide+"px)";t.querySelector(".active").classList.remove("active");n.querySelector(".section-slider__container > div:nth-child("+(n.currentSlide+1)+")").classList.add("active");n.currentSlide<=0&&(i.disabled=!0);r.disabled=!1}),r.addEventListener("click",function(){var f=t.offsetWidth;n.currentSlide++;t.style.transform="translateX(-"+f*n.currentSlide+"px)";t.querySelector(".active").classList.remove("active");n.querySelector(".section-slider__container > div:nth-child("+(n.currentSlide+1)+")").classList.add("active");u<=n.currentSlide+1&&(r.disabled=!0);i.disabled=!1}))}));u=document.querySelectorAll(".secondary-content");[].forEach.call(u,function(n){setSecondaryHeight(n);controlSideBanners();window.addEventListener("scroll",function(){n.getBoundingClientRect().top<window.outerHeight&&(setSecondaryHeight(n),controlSideBanners())})})});var fixSliderScroll=debounce(function(){var n=document.querySelectorAll(".section-slider");[].forEach.call(n,function(n){var t=n.querySelector(".section-slider__container"),i;t&&typeof n.currentSlide!="undefined"&&(i=t.offsetWidth,t.style.transform="translateX(-"+i*n.currentSlide+"px)")})},200);Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);Element.prototype.closest||(Element.prototype.closest=function(n){var t=this;do{if(t.matches(n))return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1);return null});document.addEventListener("DOMContentLoaded",function(){externalLinks()})