1import{utils}from"@hh/global.js";class LocalizationForm extends HTMLElement{constructor(){super(),this.open=!1,this.elements={input:this.querySelector('input[name="language_code"], input[name="country_code"]'),button:this.querySelector("hh-button-wrapper > button"),panel:this.querySelector("[country-list-panel]")},this.elements.button.addEventListener("keyup",this.onTriggerKeyUp.bind(this)),document.body.addEventListener("click",this.toggleSelector.bind(this)),this.addEventListener("keyup",this.onContainerKeyUp.bind(this)),this.querySelectorAll("a").forEach(item=>item.addEventListener("click",this.onItemClick.bind(this)))}hidePanel(){this.elements.button.setAttribute("aria-expanded","false"),this.elements.panel.setAttribute("hidden",!0),this.elements.button.classList.remove("active"),this.elements.button.focus({focusVisible:!0}),this.open=!1}onContainerKeyUp(event){event.code.toUpperCase()==="ESCAPE"&&(this.hidePanel(),this.elements.button.focus())}onTriggerKeyUp(e){if(e.type==="keyup"&&e.code.toUpperCase()!=="ENTER"&&e.code.toUpperCase()!=="ARROWDOWN")return!0;this.openSelector()}onItemClick(event){event.preventDefault();const form=this.querySelector("form");this.elements.input.value=event.currentTarget.dataset.value,form&&form.submit()}openSelector(){const isExpanded=this.elements.button.getAttribute("aria-expanded")==="true";this.elements.panel.toggleAttribute("hidden"),this.elements.button.setAttribute("aria-expanded",(!isExpanded).toString()),this.elements.button.classList.toggle("active",!isExpanded),this.open=!this.open,utils.trapFocus(this.elements.panel)}toggleSelector(event){event.target!==this.elements.panel&&event.target!==this.elements.button?this.open&&this.hidePanel():event.target===this.elements.button&&(this.open?this.hidePanel():this.openSelector())}}customElements.define("localization-form",LocalizationForm); 2//# sourceMappingURL=/cdn/shop/t/1031/assets/component-localization-form.js.map?v=134871094504261124661742243424
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.