PageSourceSearch

https://berghaus.com/cdn/shop/t/17/assets/header-menu.js?v=31555000881264346561788951557

js berghaus.com collected 2026-09-24 19:10:48 UTC 3,004 bytes, 1 lines download raw bytes

1import{D as m}from"./details-disclosure.js";import{O as l}from"./_constants.js";import{t as u}from"./_analytics.js";import{l as c}from"./_lazyImages.js";class d extends m{constructor(){super(),this.header=document.querySelector(".header-wrapper"),this.hoverDelay=350,this.isHovered=!1,this.hoverTimeout=null,this.trackNavigationClicks(this),this.menuContent=this.querySelector(".mega-menu__content"),this.isLinkedParent&&this.trigger&&this.trigger.addEventListener("keydown",this.onTriggerKeydown.bind(this))}get isLinkedParent(){var e;return(e=this.container)==null?void 0:e.classList.contains("header-menu__container")}onHover(){this.isHovered=!0,this.hoverTimeout&&clearTimeout(this.hoverTimeout),this.hoverTimeout=setTimeout(()=>{this.isHovered&&this.open()},l)}onHoverLeave(){this.isHovered=!1,this.hoverTimeout&&clearTimeout(this.hoverTimeout),this.close()}open(){var e,t;this.isLinkedParent?(this.container.classList.add("header-menu--open"),(e=this.trigger)==null||e.setAttribute("aria-expanded","true"),(t=this.menuContent)==null||t.removeAttribute("inert")):this.mainDetailsToggle.open=!0,this.onToggle()}close(){var e,t,i;this.isLinkedParent?(this.container.classList.remove("header-menu--open"),(e=this.trigger)==null||e.setAttribute("aria-expanded","false"),(t=this.menuContent)==null||t.setAttribute("inert",!0)):(this.mainDetailsToggle.removeAttribute("open"),(i=this.mainDetailsToggle.querySelector("summary"))==null||i.setAttribute("aria-expanded",!1)),this.onToggle()}onToggle(){if(this.content&&c(this.content),!this.header)return;const e=this.isLinkedParent?this.container.classList.contains("header-menu--open"):this.mainDetailsToggle.open;this.header.preventHide=e,document.documentElement.style.getPropertyValue("--header-bottom-position-desktop")===""&&document.documentElement.style.setProperty("--header-bottom-position-desktop",`${Math.floor(this.header.getBoundingClientRect().bottom)}px`)}trackNavigationClicks(e){e.querySelectorAll(".header__inline-menu a, .mega-menu__link").forEach(t=>{t.addEventListener("click",()=>{var a,h;const i=t.textContent.trim(),n=t.closest("details")||t.closest(".header-menu__container"),r=((a=(n==null?void 0:n.querySelector("summary"))||(n==null?void 0:n.querySelector(":scope > a")))==null?void 0:a.textContent.trim())||"",o=(h=t.closest("ul"))==null?void 0:h.previousElementSibling,s=(o==null?void 0:o.classList.contains("mega-menu__link--level-2"))?{navigation_tier_1:r,navigation_tier_2:o.textContent.trim(),navigation_tier_3:i}:r?{navigation_tier_1:r,navigation_tier_2:i,navigation_tier_3:""}:{navigation_tier_1:i,navigation_tier_2:"",navigation_tier_3:""};s.menu_location="header",s.menu_type="desktop",s.link_type=t.classList.contains("mega-menu__promotion__text")?"image":"text",s.link_url=t.href,u("menu_navigation",s)})})}onTriggerKeydown(e){e.key===" "&&(e.preventDefault(),this.container.classList.contains("header-menu--open")?this.close():this.open())}}customElements.get("header-menu")||customElements.define("header-menu",d);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.