{
  "version": 3,
  "sources": ["/cdn/shop/t/1/assets/header.js?blabla=jzan7ll3rv"],
  "sourcesContent": ["import { Component } from '@theme/component';\nimport { onDocumentLoaded, changeMetaThemeColor } from '@theme/utilities';\n\n/**\n * @typedef {Object} HeaderComponentRefs\n * @property {HTMLDivElement} headerDrawerContainer - The header drawer container element\n * @property {HTMLElement} headerMenu - The header menu element\n * @property {HTMLElement} headerRowTop - The header top row element\n */\n\n/**\n * @typedef {CustomEvent<{ minimumReached: boolean }>} OverflowMinimumEvent\n */\n\n/**\n * A custom element that manages the site header.\n *\n * @extends {Component<HeaderComponentRefs>}\n */\n\nclass HeaderComponent extends Component {\n  requiredRefs = ['headerDrawerContainer', 'headerMenu', 'headerRowTop'];\n\n  /**\n   * Width of window when header drawer was hidden\n   * @type {number | null}\n   */\n  #menuDrawerHiddenWidth = null;\n\n  /**\n   * An intersection observer for monitoring sticky header position\n   * @type {IntersectionObserver | null}\n   */\n  #intersectionObserver = null;\n\n  /**\n   * Whether the header has been scrolled offscreen, when sticky behavior is 'scroll-up'\n   * @type {boolean}\n   */\n  #offscreen = false;\n\n  /**\n   * The last recorded scrollTop of the document, when sticky behavior is 'scroll-up\n   * @type {number}\n   */\n  #lastScrollTop = 0;\n\n  /**\n   * A timeout to allow for hiding animation, when sticky behavior is 'scroll-up'\n   * @type {number | null}\n   */\n  #timeout = null;\n\n  /**\n   * The duration to wait for hiding animation, when sticky behavior is 'scroll-up'\n   * @constant {number}\n   */\n  #animationDelay = 150;\n\n  /**\n   * Keeps the global `--header-height` custom property up to date,\n   * which other theme components can then consume\n   */\n  #resizeObserver = new ResizeObserver(([entry]) => {\n    if (!entry || !entry.borderBoxSize[0]) return;\n\n    // The initial height is calculated using the .offsetHeight property, which returns an integer.\n    // We round to the nearest integer to avoid unnecessaary reflows.\n    const roundedHeaderHeight = Math.round(entry.borderBoxSize[0].blockSize);\n    document.body.style.setProperty('--header-height', `${roundedHeaderHeight}px`);\n\n    // Check if the menu drawer should be hidden in favor of the header menu\n    if (this.#menuDrawerHiddenWidth && window.innerWidth > this.#menuDrawerHiddenWidth) {\n      this.#updateMenuVisibility(false);\n    }\n  });\n\n  /**\n   * Observes the header while scrolling the viewport to track when its actively sticky\n   * @param {Boolean} alwaysSticky - Determines if we need to observe when the header is offscreen\n   */\n  #observeStickyPosition = (alwaysSticky = true) => {\n    if (this.#intersectionObserver) return;\n\n    const config = {\n      threshold: alwaysSticky ? 1 : 0,\n    };\n\n    this.#intersectionObserver = new IntersectionObserver(([entry]) => {\n      if (!entry) return;\n\n      const { isIntersecting } = entry;\n\n      if (alwaysSticky) {\n        this.dataset.stickyState = isIntersecting ? 'inactive' : 'active';\n        changeMetaThemeColor(this.refs.headerRowTop);\n      } else {\n        this.#offscreen = !isIntersecting || this.dataset.stickyState === 'active';\n      }\n    }, config);\n\n    this.#intersectionObserver.observe(this);\n  };\n\n  /**\n   * Handles the overflow minimum event from the header menu\n   * @param {OverflowMinimumEvent} event\n   */\n  #handleOverflowMinimum = (event) => {\n    this.#updateMenuVisibility(event.detail.minimumReached);\n  };\n\n  /**\n   * Updates the visibility of the menu and drawer\n   * @param {boolean} hideMenu - Whether to hide the menu and show the drawer\n   */\n  #updateMenuVisibility(hideMenu) {\n    if (hideMenu) {\n      this.refs.headerDrawerContainer.classList.remove('desktop:hidden');\n      this.#menuDrawerHiddenWidth = window.innerWidth;\n      this.refs.headerMenu.classList.add('hidden');\n    } else {\n      this.refs.headerDrawerContainer.classList.add('desktop:hidden');\n      this.#menuDrawerHiddenWidth = null;\n      this.refs.headerMenu.classList.remove('hidden');\n    }\n  }\n\n  #handleWindowScroll = () => {\n    const stickyMode = this.getAttribute('sticky');\n    if (!this.#offscreen && stickyMode !== 'always') return;\n\n    const scrollTop = document.scrollingElement?.scrollTop ?? 0;\n    const isScrollingUp = scrollTop < this.#lastScrollTop;\n    if (this.#timeout) {\n      clearTimeout(this.#timeout);\n      this.#timeout = null;\n    }\n\n    if (stickyMode === 'always') {\n      const isAtTop = this.getBoundingClientRect().top >= 0;\n\n      if (isAtTop) {\n        this.dataset.scrollDirection = 'none';\n      } else if (isScrollingUp) {\n        this.dataset.scrollDirection = 'up';\n      } else {\n        this.dataset.scrollDirection = 'down';\n      }\n\n      this.#lastScrollTop = scrollTop;\n      return;\n    }\n\n    if (isScrollingUp) {\n      this.removeAttribute('data-animating');\n\n      if (this.getBoundingClientRect().top >= 0) {\n        // reset sticky state when header is scrolled up to natural position\n        this.#offscreen = false;\n        this.dataset.stickyState = 'inactive';\n        this.dataset.scrollDirection = 'none';\n      } else {\n        // show sticky header when scrolling up\n        this.dataset.stickyState = 'active';\n        this.dataset.scrollDirection = 'up';\n      }\n    } else if (this.dataset.stickyState === 'active') {\n      this.dataset.scrollDirection = 'none';\n      // delay transitioning to idle hidden state for hiding animation\n      this.setAttribute('data-animating', '');\n\n      this.#timeout = setTimeout(() => {\n        this.dataset.stickyState = 'idle';\n        this.removeAttribute('data-animating');\n      }, this.#animationDelay);\n    } else {\n      this.dataset.scrollDirection = 'none';\n      this.dataset.stickyState = 'idle';\n    }\n\n    this.#lastScrollTop = scrollTop;\n  };\n\n  connectedCallback() {\n    super.connectedCallback();\n    this.#resizeObserver.observe(this);\n    this.addEventListener('overflowMinimum', this.#handleOverflowMinimum);\n\n    const stickyMode = this.getAttribute('sticky');\n    if (stickyMode) {\n      this.#observeStickyPosition(stickyMode === 'always');\n\n      if (stickyMode === 'scroll-up' || stickyMode === 'always') {\n        document.addEventListener('scroll', this.#handleWindowScroll);\n      }\n    }\n  }\n\n  disconnectedCallback() {\n    super.disconnectedCallback();\n    this.#resizeObserver.disconnect();\n    this.#intersectionObserver?.disconnect();\n    this.removeEventListener('overflowMinimum', this.#handleOverflowMinimum);\n    document.removeEventListener('scroll', this.#handleWindowScroll);\n    document.body.style.setProperty('--header-height', '0px');\n  }\n}\n\nif (!customElements.get('header-component')) {\n  customElements.define('header-component', HeaderComponent);\n}\n\nonDocumentLoaded(() => {\n  const header = document.querySelector('header-component');\n  const headerGroup = document.querySelector('#header-group');\n\n  // Note: Initial header heights are set via inline script in theme.liquid\n  // This ResizeObserver handles dynamic updates after page load\n\n  // Update header group height on resize of any child\n  if (headerGroup) {\n    const resizeObserver = new ResizeObserver((entries) => {\n      const headerGroupHeight = entries.reduce((totalHeight, entry) => {\n        if (\n          entry.target !== header ||\n          (header.hasAttribute('transparent') && header.parentElement?.nextElementSibling)\n        ) {\n          return totalHeight + (entry.borderBoxSize[0]?.blockSize ?? 0);\n        }\n        return totalHeight;\n      }, 0);\n      // The initial height is calculated using the .offsetHeight property, which returns an integer.\n      // We round to the nearest integer to avoid unnecessaary reflows.\n      const roundedHeaderGroupHeight = Math.round(headerGroupHeight);\n      document.body.style.setProperty('--header-group-height', `${roundedHeaderGroupHeight}px`);\n    });\n\n    if (header instanceof HTMLElement) {\n      resizeObserver.observe(header);\n    }\n\n    // Observe all children of the header group\n    const children = headerGroup.children;\n    for (let i = 0; i < children.length; i++) {\n      const element = children[i];\n      if (element instanceof HTMLElement) {\n        resizeObserver.observe(element);\n      }\n    }\n\n    // Also observe the header group itself for child changes\n    const mutationObserver = new MutationObserver((mutations) => {\n      for (const mutation of mutations) {\n        if (mutation.type === 'childList') {\n          // Re-observe all children when the list changes\n          const children = headerGroup.children;\n          for (let i = 0; i < children.length; i++) {\n            const element = children[i];\n            if (element instanceof HTMLElement) {\n              resizeObserver.observe(element);\n            }\n          }\n        }\n      }\n    });\n\n    mutationObserver.observe(headerGroup, { childList: true });\n  }\n});\n"],
  "mappings": "AAAA,OAAS,cAAiB,mBAC1B,OAAS,iBAAkB,yBAA4B,mBAmBvD,MAAM,wBAAwB,SAAU,CACtC,aAAe,CAAC,wBAAyB,aAAc,cAAc,EAMrE,uBAAyB,KAMzB,sBAAwB,KAMxB,WAAa,GAMb,eAAiB,EAMjB,SAAW,KAMX,gBAAkB,IAMlB,gBAAkB,IAAI,eAAe,CAAC,CAAC,KAAK,IAAM,CAChD,GAAI,CAAC,OAAS,CAAC,MAAM,cAAc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