{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/modules/new-menu.js"],"names":["Module","Component","$menuItem","$subItem","$btn","$dropdownButton","$subItemBack","$linksItemBack","$dropdownOption","$megaMenuLink","$featuredLink","$item","$clickedElement","$openElements","$openElement","hiddenItem","$subItems","$onlyLinksWrapper","$itemLink","$megamenu","$featuredLinkWrapper","$onlyLinksFeatured","$linksGroup","subitemHeight","notificationsBarItemsHeight","maxMenuHeight","firstLink","$element","$currentDropDown","$dwButton","$dwOptions","$currentDropdownOptions","isOpen","$searchBox","valueLen","button","$coveoFilterToggle","wrapper","$notVisibleLinks","$notVisibleLink","func","timeParam","time","timer","event","notificationsBar","notificationsBarHeight","menuHeight","jumpLinksHeight"],"mappings":"kJAEA,MAAMA,UAAeC,WAAU,CAC7B,eAAgB,CACd,KAAK,IAAM,CACT,IAAK,KAAK,GACV,YAAa,KAAK,IAAI,cAAc,sBAAsB,EAC1D,YAAa,KAAK,IAAI,cAAc,sBAAsB,EAC1D,eAAgB,KAAK,IAAI,QAAQ,kBAAkB,EACnD,SAAU,KAAK,IAAI,iBAAiB,wCAAwC,EAC5E,iBAAkB,KAAK,IAAI,iBAAiB,8BAA8B,EAC1E,UAAW,KAAK,IAAI,iBAAiB,gCAAgC,EACrE,eAAgB,KAAK,IAAI,iBAAiB,yBAAyB,EACnE,eAAgB,KAAK,IAAI,iBAAiB,wBAAwB,EAClE,aAAc,KAAK,IAAI,iBAAiB,gCAAgC,EACxE,iBAAkB,KAAK,IAAI,iBAAiB,kBAAkB,EAC9D,cAAe,UAAU,cAAc,wBAAwB,EAC/D,wBAAyB,KAAK,GAAG,cAAc,sBAAsB,EACrE,aAAc,KAAK,GAAG,iBAAiB,6CAA6C,EACpF,eAAgB,KAAK,GAAG,iBAAiB,qCAAqC,EAC9E,eAAgB,SAAS,cAAc,MAAM,EAC7C,MAAO,KAAK,GAAG,cAAc,cAAc,EAC3C,iBAAkB,KAAK,GAAG,iBAAiB,kBAAkB,CAC/D,EAEA,KA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,EAAkB,KAAK,UAAY,KAAK,UAAU,aAAe,EAEpE,OAAO,QAAU,KAAOD,GACvB,KAAK,GAAG,MAAM,IAAM,GAAGD,MACvB,KAAK,GAAG,UAAU,IAAI,OAAO,EAC7BD,GAAkB,UAAU,IAAI,OAAO,EACvC,KAAK,gBAAgB,MAAM,IAAM,GAAGE,EAAaD,EAAyBE,MAGvE,KAAK,WACN,KAAK,UAAU,MAAM,IAAM,GAAGD,EAAaD,MAC3C,KAAK,gBAAgB,UAAU,OAAO,6BAA6B,GAEnE,KAAK,gBAAgB,UAAU,OAAO,kBAAkB,GAGpDC,GAAc,OAAO,QAAU,KAAO,KAAK,GAAG,UAAU,SAAS,OAAO,IAC9E,KAAK,GAAG,UAAU,OAAO,OAAO,EAChCF,GAAkB,UAAU,OAAO,OAAO,EAC1C,KAAK,GAAG,MAAM,IAAM,IACpB,KAAK,gBAAgB,MAAM,IAAM,IAC9B,KAAK,WACN,KAAK,UAAU,MAAM,IAAM,IAC3B,KAAK,gBAAgB,UAAU,IAAI,6BAA6B,GAEhE,KAAK,gBAAgB,UAAU,IAAI,kBAAkB,GAIxD,OAAO,UAAY,IACpB,KAAK,GAAG,MAAM,IAAM,IAExB,CAEA,0BAA2B,CACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EACA,SAAS,cAAc,gCAAgC,GAC9D,gBAAgB,OAAO,CAE7C,CACF,CAEA,UAAe7C,C","file":"scripts/153.92356c50.js","sourcesContent":["import { Component } from '@verndale/core';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n $el: this.el,\n $primaryNav: this.el?.querySelector('.header__primary-nav'),\n $utilityNav: this.el?.querySelector('.header__utility-nav'),\n $headerWrapper: this.el?.closest('.header__wrapper'),\n $subItem: this.el?.querySelectorAll('.header__magamenu-wrapper-subitem-link'),\n $closeMenuButton: this.el?.querySelectorAll('.header__mega-menu-close-btn'),\n $menuItem: this.el?.querySelectorAll('.header__magamenu-wrapper-item'),\n $megaMenuLinks: this.el?.querySelectorAll('.header__mega-menu-link'),\n $featuredLinks: this.el?.querySelectorAll('.header-featured-row a'),\n $bottomLinks: this.el?.querySelectorAll('.header__mega-menu-bottom-link'),\n $dropdownButtons: this.el?.querySelectorAll('.dropdown-button'),\n $mastheadHome: document?.querySelector('.masthead-home-wrapper'),\n $headerMenuToggleButton: this.el.querySelector('.header__menu-toggle'),\n $subItemBack: this.el.querySelectorAll('.header__magamenu-wrapper-subitem-link-back'),\n $linksItemBack: this.el.querySelectorAll('.header__magamenu-wrapper-link-back'),\n $mainContainer: document.querySelector('main'),\n $navs: this.el.querySelector('.header-navs'),\n $dropdownOptions: this.el.querySelectorAll('.dropdown-option'),\n };\n\n this.isEditMode = this.el.getAttribute('data-is-edit-mode');\n this.lastScroll = 0;\n this.checkHome();\n this.el.dispatchEvent(new CustomEvent('scroll'));\n this.el.height = this.el.offsetHeight;\n this.mainHtmlElement = document.querySelector('html');\n this.jumpLinks = document.querySelector('.jumplinks-section');\n if(this.jumpLinks) {\n this.mainHtmlElement.classList.add('not-fixed-header-jump-links');\n } else {\n this.mainHtmlElement.classList.add('not-fixed-header');\n }\n this.windowWidth = window.innerWidth;\n this.headerWrapperHeight = this.el.offsetHeight;\n this.dom.$headerWrapper.setAttribute('style', `height: ${this.headerWrapperHeight}px`);\n this.el.style.top = '0';\n }\n\n addListeners() {\n this.dom.$menuItem.forEach($menuItem => {\n $menuItem.addEventListener('click', this.toggleMegaMenu.bind(this));\n });\n this.dom.$subItem.forEach($subItem => {\n $subItem.addEventListener('click', this.toggleSubItem.bind(this));\n });\n\n this.dom.$closeMenuButton.forEach($btn => {\n $btn.addEventListener('click', this.handleCloseMenus.bind(this));\n });\n\n this.dom.$dropdownButtons.forEach($dropdownButton => {\n $dropdownButton.addEventListener('click', this.handleDropdownButtonClick.bind(this));\n });\n\n this.dom.$subItemBack.forEach($subItemBack => {\n $subItemBack.addEventListener('click', this.handleSubItemBack.bind(this));\n });\n\n this.dom.$linksItemBack.forEach($linksItemBack => {\n $linksItemBack.addEventListener('click', this.handlelinksBack.bind(this));\n });\n\n this.dom.$headerMenuToggleButton.addEventListener('click',this.handleToggleMenuButtonClick.bind(this));\n\n this.dom.$dropdownOptions.forEach($dropdownOption => {\n $dropdownOption.addEventListener('click', this.handleCloseMenus.bind(this));\n })\n\n this.dom.$megaMenuLinks.forEach($megaMenuLink => {\n $megaMenuLink.addEventListener('click', this.handleMegamenuLinksClick.bind(this));\n })\n\n this.dom.$featuredLinks.forEach($featuredLink => {\n $featuredLink.addEventListener('click', this.handleMegamenuLinksClick.bind(this));\n })\n\n if(this.isEditMode !== 'true') {\n window.addEventListener('scroll', this.debounce(this.handleDocumentScroll.bind(this), 10), {passive: true});\n }\n\n document.addEventListener('keyup', this.handleKeyUp.bind(this));\n\n document.addEventListener('click', this.handleDocumentClick.bind(this));\n\n window.addEventListener('resize', this.handleResize.bind(this));\n \n }\n\n handleKeyPress(e) {\n if (e.currentTarget.value !== '') {\n this.dom.$clearBtn.classList.add('search-form__clear--active');\n } else {\n this.dom.$clearBtn.classList.remove('search-form__clear--active');\n }\n this.handleUpdateResult();\n }\n\n toggleMegaMenu(e) {\n e.stopPropagation();\n const $item = e.currentTarget;\n const $clickedElement = e.target;\n const $openElements = document?.querySelectorAll(\n '.header__primary-nav-item-toggle--open'\n );\n this.closeAllDropDowns();\n\n if (\n $clickedElement.classList.contains('header__mega-menu') ||\n $clickedElement.closest('.header__mega-menu')\n )\n return;\n if (\n $item.classList.contains('header__primary-nav-item-toggle--open')\n ) {\n this.handleCloseMenus();\n } else {\n $openElements.forEach($openElement => {\n if ($openElement !== this) {\n $openElement.querySelector('.header__container').classList.add('hidden');\n setTimeout(() => {\n $openElement.classList.remove(\n 'header__primary-nav-item-toggle--open'\n );\n }, 300);\n \n $openElement\n ?.querySelector('.header__mega-menu')\n ?.setAttribute('aria-hidden', 'true');\n }\n });\n\n $item\n ?.querySelector('.header__mega-menu')\n ?.setAttribute(\n 'aria-hidden',\n $item.classList.contains('header__primary-nav-item-toggle--open')\n ? 'true'\n : 'false'\n );\n $item.classList.toggle('header__primary-nav-item-toggle--open');\n $item.querySelector('.header__container').classList.remove('hidden');\n\n if($item.classList.contains('header__primary-nav-item-toggle--open')) {\n setTimeout(() => {\n document.body.classList.add('body-fixed');\n this.dom.$mainContainer.classList.add('blur');\n const $subItem = $item?.querySelector('.header__mega-menu-nav-sub-item-content-item');\n if(document.body.clientWidth > 1200)\n this.activateSubItem($subItem);\n }, 500);\n } \n }\n\n const hiddenItems = this.el.querySelectorAll('.mobile-not-visible');\n hiddenItems.forEach(hiddenItem => {\n hiddenItem.classList.remove('mobile-not-visible');\n });\n\n if($item.classList.contains('header__primary-nav-item-toggle--open')) {\n this.dom.$el.classList.add('header__wrapper-menu--open');\n this.dom.$primaryNav.classList.add('header__primary-nav--open');\n } else {\n this.dom.$el.classList.remove('header__wrapper-menu--open');\n this.dom.$primaryNav.classList.remove('header__primary-nav--open');\n }\n }\n\n toggleSubItem(e) {\n const $itemLink = e.currentTarget;\n const $item = $itemLink.closest('.header__mega-menu-nav-sub-item')?.querySelector('.header__mega-menu-nav-sub-item-content-item');\n this.activateSubItem($item);\n }\n\n activateSubItem($subItem) {\n const $subItems = this.el?.querySelectorAll('.header__mega-menu-nav-sub-item-content-item');\n const $onlyLinksWrapper = document.querySelector('.header__primary-nav-item-toggle--open .header__mega-menu-sub-item-links-only-wrapper');\n $subItems.forEach($item => {\n const $itemLink = $item.closest('.header__mega-menu-nav-sub-item')?.querySelector('.header__magamenu-wrapper-subitem-link');\n if($itemLink) {\n $itemLink.classList.remove('header__magamenu-wrapper-subitem-link--active');\n if($subItem)\n $itemLink.classList.add('mobile-not-visible');\n }\n $item.classList.remove('header__mega-menu-nav-sub-item--active');\n $item.setAttribute('aria-hidden', 'true');\n });\n\n\n if($subItem) {\n const $subItemLink = $subItem.closest('.header__mega-menu-nav-sub-item')?.querySelector('.header__magamenu-wrapper-subitem-link');\n $subItemLink.classList.add('header__magamenu-wrapper-subitem-link--active');\n $subItem.classList.add('header__mega-menu-nav-sub-item--active');\n $subItem.setAttribute('aria-hidden', 'false');\n this.setDesktopMenuHeight($subItem);\n \n }\n\n\n\n if($onlyLinksWrapper) { \n this.setDesktopMenuHeight($onlyLinksWrapper);\n }\n\n \n const $megamenu = this.el?.querySelector('.header__primary-nav-item-toggle--open .header__mega-menu');\n const $featuredLinkWrapper = document.querySelector('.header__mega-menu-nav-sub-item--active .header-featured-row-wrapper');\n const $onlyLinksFeatured = $onlyLinksWrapper?.querySelector('.header-featured-row-wrapper');\n $megamenu?.classList.remove('no-featured');\n\n if($onlyLinksWrapper == null && $featuredLinkWrapper === null) {\n $megamenu?.classList.add('no-featured');\n } if($onlyLinksWrapper && $onlyLinksFeatured === null) {\n $megamenu?.classList.add('no-featured');\n }\n \n }\n\n setDesktopMenuHeight($subItem){\n $subItem.style.height = null;\n const isOnlyLinks = $subItem.classList.contains('header__mega-menu-sub-item-links-only-wrapper');\n const $megamenu = !isOnlyLinks?this.el.querySelector('.header__primary-nav-item-toggle--open .header__mega-menu .header__mega-menu-sub-nav'):$subItem;\n const $linksGroup = $megamenu?.querySelector('.header__mega-menu-links-group');\n const $featuredLinkWrapper = $megamenu?.querySelector('.header-featured-row-wrapper');\n const subitemHeight = $subItem.offsetHeight;\n const notificationsBarItemsHeight = document.querySelector('.notifications-bar').offsetHeight;\n let maxMenuHeight = Number(this.el.querySelector('.header__primary-nav-item-toggle--open .header__mega-menu').style.maxHeight.replace('px', '')) - 160;\n\n if(maxMenuHeight < 300) {\n maxMenuHeight = window.innerHeight - notificationsBarItemsHeight - 350;\n }\n\n if(window.innerWidth >= 1280) {\n if($megamenu){\n $megamenu.style.height = subitemHeight < maxMenuHeight?`${subitemHeight}px`:`${maxMenuHeight}px`;\n }\n } else {\n $megamenu.style.height = null;\n $linksGroup.style.height = null;\n $featuredLinkWrapper.style.height = null;\n }\n }\n\n handleCloseMenus() {\n if(!this.el.classList.contains('header__mobile-menu--open')) {\n document.body.classList.remove('body-fixed');\n }\n this.dom.$el.classList.remove('header__wrapper-menu--open');\n this.dom.$mainContainer.classList.remove('blur');\n const $openElements = document?.querySelectorAll('.header__primary-nav-item-toggle--open');\n this.activateSubItem();\n $openElements.forEach($openElement => {\n $openElement.classList.remove('header__primary-nav-item-toggle--open');\n $openElement?.querySelector('.header__mega-menu')?.setAttribute('aria-hidden', 'true');\n });\n }\n\n handleSubItemKeyUp(e) {\n e.stopPropagation();\n const $activeLinksContainer = this.el?.querySelector('.header__mega-menu-nav-sub-item--active');\n const firstLink = $activeLinksContainer?.querySelector('.header__mega-menu-link');\n const $element = e.currentTarget;\n\n switch (e.keyCode) {\n case 27: // esc\n this.handleCloseMenus();\n break;\n case 9: // tab \n if($element.classList.contains('header__magamenu-wrapper-subitem-link--active')) {\n firstLink.focus();\n }\n break;\n default:\n $element.nextElementByTabIndex.focus();\n }\n\n }\n\n closeAllDropDowns($currentDropDown) {\n this.dom.$dropdownButtons.forEach($dwButton => {\n if ($currentDropDown && $dwButton !== $currentDropDown) {\n const $dwOptions = $dwButton.nextElementSibling;\n $dwButton.classList.remove('active');\n $dwOptions.classList.remove('active');\n } else {\n const $dwOptions = $dwButton.nextElementSibling;\n $dwButton.classList.remove('active');\n $dwOptions.classList.remove('active');\n }\n });\n }\n\n handleDropdownButtonClick(e) {\n e.stopPropagation();\n this.handleCloseMenus();\n const $currentDropDown = e.target.tagName.toLowerCase() === 'span'?e.target.closest('.dropdown-button'):e.currentTarget;\n const $currentDropdownOptions = $currentDropDown.nextElementSibling;\n const isOpen = $currentDropDown.classList.contains('active');\n this.closeAllDropDowns();\n\n if(!isOpen) {\n $currentDropDown.classList.add('active');\n $currentDropdownOptions.classList.add('active');\n }\n \n \n }\n\n handleDocumentClick() {\n this.closeAllDropDowns();\n this.handleCloseMenus()\n const $searchBox = this.el?.querySelector('.coveo-search-results__search-box-input');\n\n if($searchBox.classList.contains('focus-visible')) {\n const valueLen = $searchBox.value.length;\n this.dom.$utilityNav.classList.add('wide');\n $searchBox.setSelectionRange(valueLen, valueLen);\n this.el.querySelector('.coveo-search-results__search-box-clear').classList.remove('coveo-search-results__search-box-clear--blured');\n if(valueLen > 0) {\n this.el.querySelector('.coveo-search-results__search-box-search ').removeAttribute('disabled');\n }\n if(window.innerWidth >= 1280) {\n this.dom.$primaryNav.classList.add('hidden');\n }\n\n } else if($searchBox.offsetWidth > 100){\n this.dom.$navs.classList.add('right');\n this.dom.$utilityNav.classList.remove('wide');\n setTimeout(() => {\n this.dom.$navs.classList.remove('right');\n this.dom.$primaryNav.classList.remove('hidden');\n }, 200);\n this.el.querySelector('.coveo-search-results__search-box-clear').classList.add('coveo-search-results__search-box-clear--blured');\n this.el.querySelector('.coveo-search-results__search-box-search ').disabled = true;\n }\n }\n\n\n handleKeyUp(e) {\n if (e.keyCode === 27) { // esc\n this.handleCloseMenus();\n this.handleCloseMobileMenu(); \n }\n }\n\n handleResize() {\n this.handleCloseMenus();\n this.closeAllDropDowns();\n this.handleCloseMobileMenu();\n\n if(window.scrollY < 140)\n this.el.style.top = '0';\n };\n\n checkHome() {\n if(this.dom.$mastheadHome) {\n this.el.classList.add('homepage__header');\n } \n }\n\n handleToggleMenuButtonClick() {\n this.el.classList.toggle('header__mobile-menu--open'); \n const button = this.dom.$menuItem[0].querySelector('.header__magamenu-wrapper-item-link')\n const $coveoFilterToggle = document.querySelector('.coveo-search-results__sidebar');\n if(this.el.classList.contains('header__mobile-menu--open')) {\n document.body.classList.add('body-fixed');\n button.focus();\n if($coveoFilterToggle) {\n $coveoFilterToggle.style.zIndex = -1;\n }\n } else {\n document.body.classList.remove('body-fixed');\n this.dom.$headerMenuToggleButton.focus();\n $coveoFilterToggle?.removeAttribute('style');\n }\n }\n\n handleSubItemBack() {\n const $openElements = document?.querySelectorAll('.header__primary-nav-item-toggle--open');\n $openElements.forEach($openElement => {\n $openElement.classList.remove('header__primary-nav-item-toggle--open');\n $openElement?.querySelector('.header__mega-menu')?.setAttribute('aria-hidden', 'true');\n });\n } \n\n handlelinksBack(e) {\n const button = e.currentTarget;\n const wrapper = button.closest('.header__mega-menu-sub-item-links-only-wrapper');\n const $openElements = document?.querySelectorAll('.header__mega-menu-nav-sub-item--active');\n const $notVisibleLinks = document.querySelectorAll('.mobile-not-visible');\n $openElements.forEach($openElement => {\n $openElement.classList.remove('header__mega-menu-nav-sub-item--active');\n $openElement?.querySelector('.header__mega-menu')?.setAttribute('aria-hidden', 'true');\n });\n\n $notVisibleLinks.forEach($notVisibleLink => {\n $notVisibleLink.classList.remove('mobile-not-visible');\n })\n\n if(wrapper) {\n this.handleSubItemBack();\n }\n }\n\n handleCloseMobileMenu() {\n document.body.classList.remove('body-fixed');\n this.dom.$mainContainer.classList.remove('blur');\n this.el.classList.remove('header__mobile-menu--open');\n this.handleCloseMenus();\n this.closeAllDropDowns();\n }\n\n debounce(func, timeParam) {\n const time = timeParam || 100; // 100 by default if no param\n\n let timer; // eslint-disable-next-line space-before-function-paren\n\n return function (event) {\n if (timer) clearTimeout(timer);\n timer = setTimeout(func, time, event);\n };\n }\n\n handleDocumentScroll() {\n const notificationsBar = document.querySelector('.notifications-bar__items');\n const notificationsBarHeight = notificationsBar ? notificationsBar.offsetHeight : 0;\n const menuHeight = this.el.offsetHeight;\n const jumpLinksHeight = this.jumpLinks ? this.jumpLinks.offsetHeight : 0;\n\n if(window.scrollY > 140 && menuHeight) {\n this.el.style.top = `${notificationsBarHeight}px`;\n this.el.classList.add('fixed');\n notificationsBar?.classList.add('fixed');\n this.mainHtmlElement.style.top = `${menuHeight + notificationsBarHeight + jumpLinksHeight}px`;\n\n\n if(this.jumpLinks) {\n this.jumpLinks.style.top = `${menuHeight + notificationsBarHeight}px`;\n this.mainHtmlElement.classList.remove('not-fixed-header-jump-links');\n } else {\n this.mainHtmlElement.classList.remove('not-fixed-header');\n }\n\n } else if(menuHeight && window.scrollY < 140 && this.el.classList.contains('fixed')){\n this.el.classList.remove('fixed');\n notificationsBar?.classList.remove('fixed');\n this.el.style.top = '0';\n this.mainHtmlElement.style.top = '0';\n if(this.jumpLinks) {\n this.jumpLinks.style.top = '0';\n this.mainHtmlElement.classList.add('not-fixed-header-jump-links');\n } else {\n this.mainHtmlElement.classList.add('not-fixed-header');\n }\n }\n\n if(window.scrollY === 0) {\n this.el.style.top = '0';\n }\n }\n\n handleMegamenuLinksClick() {\n this.handleCloseMenus();\n this.handleCloseMobileMenu();\n const $coveoFilterToggle = document.querySelector('.coveo-search-results__sidebar');\n $coveoFilterToggle?.removeAttribute('style');\n\n }\n}\n\nexport default Module;\n"],"sourceRoot":""}