-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1.11.2-premium-header-footer.min.js.download
1 lines (1 loc) · 11.7 KB
/
1.11.2-premium-header-footer.min.js.download
1
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/build/js",n(n.s=1)}([function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(0);function i(){var e=document.querySelector("#alwaysVisibleRiskWarning2"),t=document.querySelector(".megaMenu-premium"),n=document.querySelector(".navigation"),i=window.innerWidth<=1025;setTimeout((function(){if(e){var o=e.offsetHeight,a=t.offsetHeight,r=n.querySelectorAll(".second-level");e.classList.contains("risk-bottom")?n.style.top=a+"px":n.style.top=o+a+"px";for(var l=0;l<r.length;l++)e.classList.contains("risk-bottom")?r[l].style.top=a+"px":r[l].style.top=o+a+"px";if(i)for(var s=n.querySelectorAll(".third-level"),c=0;c<s.length;c++)e.classList.contains("risk-bottom")?s[c].style.top=a+"px":s[c].style.top=o+a+"px"}}),1e3)}function o(e){return e.trim()}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init(),this.bindEvents()}var t,n,r;return t=e,(n=[{key:"init",value:function(){this.megamenuParentContainer=document.querySelector(".megaMenu"),this.megaMenuContainer=document.querySelector(".megaMenu-premium"),this.navigationContainer=document.querySelector(".navigation"),this.navigationWrapper=this.navigationContainer.querySelector(".navigation-wrapper"),this.navigationList=this.navigationContainer?this.navigationContainer.querySelector(".navigation-list"):"",this.allparentNavLevel=this.navigationContainer.querySelectorAll(".has-submenu"),this.mobileOpenMenu=this.megaMenuContainer.querySelector(".mobile-navigation .mobile-nav-open"),this.mobileBackMenu=this.megaMenuContainer.querySelector(".mobile-navigation .mobile-nav-back"),this.mobileCloseMenu=this.megaMenuContainer.querySelector(".mobile-nav-close"),this.mobileOnboarding=this.megaMenuContainer.querySelector(".mobile-onboarding"),this.logoContainer=this.megaMenuContainer.querySelector(".logo"),this.activeTitleLabel=this.megaMenuContainer.querySelector(".active-title p"),this.appContainer=this.megaMenuContainer.querySelector(".apps-container"),this.activeNavLevel="",this.desktopBreakpoint=1025}},{key:"bindEvents",value:function(){var e,t=this;window.addEventListener("resize",(function(){clearTimeout(e),e=setTimeout((function(){t.bindDeviceEvents()}),100)})),this.mobileOpenMenu.addEventListener("click",(function(){t.openMobileMenu()})),this.mobileBackMenu.addEventListener("click",(function(){t.backNavigation()})),this.mobileCloseMenu.addEventListener("click",(function(){t.toggleMobileMenu(),t.resetNavigationLevel()})),this.bindDeviceEvents()}},{key:"bindDeviceEvents",value:function(){window.innerWidth<=this.desktopBreakpoint?this.appendMobileFunctions():(this.resetNavigationLevel(),this.navigationContainer.classList.contains("mobile-show")&&this.toggleMobileMenu(),this.appendDesktopFunctions()),i()}},{key:"appendMobileFunctions",value:function(){var e=this;this.megaMenuContainer.querySelector(".mobile-parent-link")||this.megaMenuContainer.querySelectorAll(".first-level.has-submenu").forEach((function(e){var t=e.firstElementChild.cloneNode(!0);if(t.classList.remove("title"),t.classList.add("nav-title"),e.querySelector(".second-level")){var n=e.querySelector(".second-level"),i=document.createElement("li");i.classList.add("mobile-parent-link"),i.appendChild(t),e.querySelector(".second-level .sub-container").prepend(i),n.querySelector(".nav-col.has-submenu")&&n.querySelectorAll(".nav-col.has-submenu").forEach((function(e){if(e.querySelector(".third-level .nav-menu")){var t=e.firstElementChild.cloneNode(!0),n=document.createElement("li");n.classList.add("mobile-parent-link"),n.appendChild(t),e.querySelector(".third-level .nav-menu").prepend(n)}else e.classList.remove("has-submenu")}))}else e.classList.remove("has-submenu")}));for(var t=function(t){var n=e.allparentNavLevel[t];n.addEventListener("click",(function(t){n.classList.contains("active")||n.classList.contains("expanded")||e.mobileNavigation(n,t)}))},n=0;n<this.allparentNavLevel.length;n++)t(n);if(!this.navigationContainer.querySelector(".onboarding")){var i=this.megaMenuContainer.querySelector(".onboarding").cloneNode(!0);this.navigationWrapper.insertBefore(i,this.appContainer)}}},{key:"appendDesktopFunctions",value:function(){var e=this;this.navigationList.addEventListener("mouseenter",(function(){e.megamenuParentContainer.classList.add("open")})),this.navigationList.addEventListener("mouseleave",(function(){e.megamenuParentContainer.classList.remove("open")}))}},{key:"mobileNavigation",value:function(e,t){if(t.preventDefault(),e.classList.add("expanded"),e.querySelector(".second-level")&&e.querySelector(".second-level").classList.add("active"),e.querySelector(".has-submenu"))this.activeNavLevel=e.querySelector(".has-submenu"),this.mobileBackMenu.classList.add("active"),this.logoContainer.classList.add("hide"),this.activeTitleLabel.parentElement.classList.remove("hide"),this.activeTitleLabel.innerText=o(e.querySelector(".mobile-parent-link a").textContent);else{var n=e.querySelector(".sub-menu");n.classList.add("active"),this.activeNavLevel=n,this.activeTitleLabel.innerText=o(e.querySelector(".mobile-parent-link").innerText)}}},{key:"backNavigation",value:function(){this.activeNavLevel.classList.contains("has-submenu")?(this.activeNavLevel.parentElement.parentElement.classList.remove("active"),this.megaMenuContainer.querySelector(".first-level.expanded").classList.remove("expanded"),this.firstLevelSettings()):(this.activeNavLevel.classList.remove("active"),this.activeNavLevel.classList.remove("expanded"),this.activeNavLevel.parentElement.classList.remove("active"),this.activeNavLevel.parentElement.classList.remove("expanded"),this.activeNavLevel=this.activeNavLevel.parentElement,this.activeTitleLabel.innerText=o(this.activeNavLevel.parentElement.querySelector(".mobile-parent-link").innerText))}},{key:"openMobileMenu",value:function(){i(),this.toggleMobileMenu(),this.activeNavLevel=""}},{key:"toggleMobileMenu",value:function(){this.navigationContainer.classList.toggle("mobile-show"),this.mobileOpenMenu.classList.toggle("active"),this.mobileCloseMenu.classList.toggle("active"),this.mobileOnboarding&&this.mobileOnboarding.classList.toggle("active")}},{key:"resetNavigationLevel",value:function(){var e=this.navigationList.querySelector(".first-level.expanded");if(e){for(var t=e.querySelectorAll(".expanded"),n=e.querySelectorAll(".active"),i=0;i<t.length;i++)t[i].classList.remove("expanded");for(var o=0;o<n.length;o++)n[o].classList.remove("active");e.classList.remove("expanded"),this.activeNavLevel=""}this.firstLevelSettings()}},{key:"firstLevelSettings",value:function(){this.logoContainer.classList.remove("hide"),this.mobileBackMenu.classList.remove("active"),this.activeTitleLabel.parentElement.classList.add("hide"),this.activeTitleLabel.innerText=""}}])&&a(t.prototype,n),r&&a(t,r),e}();function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init(),this.bindEvents()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.countrySelector=document.querySelector(".current-lang"),this.countryList=document.querySelector(".country-selector")}},{key:"bindEvents",value:function(){var e=this;this.countrySelector.addEventListener("click",(function(){e.countryList.classList.toggle("open"),e.countrySelector.classList.toggle("open")}))}}])&&l(t.prototype,n),i&&l(t,i),e}(),c={globals:{elem:document.querySelector(".nav-magnifier"),formContainer:document.querySelector(".global-search-container"),mobileForm:document.querySelector(".global-mobile-form"),desktopBreakpoint:1025,firstLevelLinks:document.querySelectorAll(".first-level")},init:function(){this.globals.elem&&this.bindEvents()},bindEvents:function(){var e=this;this.globals.elem.addEventListener("click",(function(t){t.preventDefault(),window.innerWidth<=e.globals.desktopBreakpoint?(t.target.classList.contains("search-icon")||t.target.classList.contains("search-button"))&&e.globals.mobileForm.submit():e.globals.formContainer&&(e.globals.formContainer.classList.toggle("show"),e.globals.elem.classList.toggle("active"))})),this.globals.firstLevelLinks.forEach((function(t){t.addEventListener("mouseenter",(function(){e.globals.formContainer&&e.globals.elem.classList.contains("active")&&(e.globals.formContainer.classList.remove("show"),e.globals.elem.classList.remove("active"))}))}))}},u={globals:{elems:document.querySelectorAll(".js-onboarding"),onboardingModal:document.querySelector(".onboarding-modal"),closeButton:null},init:function(){this.globals.elems&&this.globals.onboardingModal&&(this.globals.closeButton=this.globals.onboardingModal.querySelector(".close-modal"),this.bindEvents())},bindEvents:function(){var e=this;this.globals.elems.forEach((function(t){t.addEventListener("click",(function(t){e.globals.onboardingModal&&(t.preventDefault(),e.globals.onboardingModal.classList.toggle("hide"))}))})),this.globals.closeButton.addEventListener("click",(function(){e.globals.onboardingModal&&e.globals.onboardingModal.classList.toggle("hide")}))}};var v,d,m,g,h,b={Android:navigator.userAgent.match(/Android/i),BlackBerry:navigator.userAgent.match(/BlackBerry/i),iOS:navigator.userAgent.match(/iPhone|iPad|iPod/i),iOSMob:navigator.userAgent.match(/iPhone|iPad|iPod/i),iOSiPad:navigator.userAgent.match(/iPad/i),Opera:navigator.userAgent.match(/Opera Mini/i),Windows:navigator.userAgent.match(/IEMobile/i),browser:navigator.userAgent.match(/Gecko/i),any:function(){return b.Android||b.BlackBerry||b.iOS||b.Opera||b.Windows}};function f(){if(!b.any()&&document.querySelector(".popupBanner")){var e,t=document.querySelector(".popupBanner"),n=t.getAttribute("data-cookie-text");(function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return""})(n)||(t.classList.remove("hidden"),setTimeout((function(){document.querySelector("#footerAlerts")&&document.querySelector("#footerAlerts").offsetHeight>0&&(e=document.querySelector("#footerAlerts"),t.style.bottom=e.offsetHeight+20+"px")}),1500),t.addEventListener("click",(function(e){e.target.classList.contains("close")&&(e.preventDefault(),t.classList.add("hidden"),function(e,t,n,i,o){var a=new Date;n=n||30,a.setTime(a.getTime()+24*n*60*60*1e3);var r="expires="+a.toUTCString();document.cookie=i&&o?e+"="+t+"; "+r+";domain="+i+";path="+o:e+"="+t+"; "+r}(n,"on",365))}),!1))}}d=document.querySelector(".megaMenu-premium"),m=document.querySelector(".footer-premium"),g=document.querySelector(".breadcrumb-premium-ul"),h=document.querySelector(".popupBanner"),d&&new r,m&&new s,g&&(v=g).addEventListener("click",(function(){v.classList.add("expand")})),h&&f(),c.init(),u.init()}]);