/* Generated time: January 26, 2026 23:51 This file was created by the app developer. Feel free to contact the original developer with any questions. It was minified (compressed) by AVADA. AVADA do NOT own this script. */ customElements.get("quantity-popover")||customElements.define("quantity-popover",class extends HTMLElement{constructor(){super(),this.mql=window.matchMedia("(min-width: 990px)"),this.mqlTablet=window.matchMedia("(min-width: 750px)"),this.infoButtonDesktop=this.querySelector(".quantity-popover__info-button--icon-only"),this.infoButtonMobile=this.querySelector(".quantity-popover__info-button--icon-with-label"),this.popoverInfo=this.querySelector(".quantity-popover__info"),this.closeButton=this.querySelector(".button-close"),this.eventMouseEnterHappened=!1,this.closeButton&&this.closeButton.addEventListener("click",this.closePopover.bind(this)),this.popoverInfo&&this.infoButtonDesktop&&this.mqlTablet.matches&&this.popoverInfo.addEventListener("mouseleave",this.closePopover.bind(this)),this.infoButtonDesktop&&(this.infoButtonDesktop.addEventListener("click",this.togglePopover.bind(this)),this.infoButtonDesktop.addEventListener("focusout",this.closePopover.bind(this))),this.infoButtonMobile&&this.infoButtonMobile.addEventListener("click",this.togglePopover.bind(this)),this.infoButtonDesktop&&this.mqlTablet.matches&&(this.infoButtonDesktop.addEventListener("mouseenter",this.togglePopover.bind(this)),this.infoButtonDesktop.addEventListener("mouseleave",this.closePopover.bind(this)))}togglePopover(t){var e,o;t.preventDefault(),"mouseenter"===t.type&&(this.eventMouseEnterHappened=!0),"click"===t.type&&this.eventMouseEnterHappened||(o="true"===(e=this.infoButtonDesktop&&this.mql.matches?this.infoButtonDesktop:this.infoButtonMobile).getAttribute("aria-expanded"),(this.mql.matches&&!o||"click"===t.type)&&(e.setAttribute("aria-expanded",!o),this.popoverInfo.toggleAttribute("hidden"),e.classList.toggle("quantity-popover__info-button--open"),this.infoButtonDesktop.classList.add("quantity-popover__info-button--icon-only--animation")),"true"===e.getAttribute("aria-expanded")&&"mouseenter"!==t.type&&(e.focus(),e.addEventListener("keyup",t=>{"Escape"===t.key&&this.closePopover(t)})))}closePopover(t){t.preventDefault();var e=this.infoButtonDesktop.contains(t.relatedTarget),t=this.popoverInfo.contains(t.relatedTarget),o=this.infoButtonDesktop&&this.mql.matches?this.infoButtonDesktop:this.infoButtonMobile;e||t||(o.setAttribute("aria-expanded","false"),o.classList.remove("quantity-popover__info-button--open"),this.popoverInfo.setAttribute("hidden",""),this.infoButtonDesktop.classList.remove("quantity-popover__info-button--icon-only--animation")),this.eventMouseEnterHappened=!1}});