import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{d as defineCustomElement$2}from"./va-select2.js";const vaSortCss=":host{display:block}",VaSortStyle0=vaSortCss,VaSort$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaSortKeyDown=createEvent(this,"vaSortKeyDown",7),this.vaSortSelect=createEvent(this,"vaSortSelect",7),this.vaSortSelectBlur=createEvent(this,"vaSortSelectBlur",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.name="sort",this.value=void 0,this.width="lg",this.messageAriaDescribedby=void 0,this.enableAnalytics=!1}handleVaKeyDown(e){e.stopPropagation(),this.vaSortKeyDown.emit()}handleVaSelect(e){if(e.stopPropagation(),this.value=e.detail.value,this.enableAnalytics){const e={componentName:"va-sort",action:"change",details:{label:"Sort by",selectLabel:this.value}};this.componentLibraryAnalytics.emit(e)}this.vaSortSelect.emit({value:this.value})}handleVaSelectBlur(e){e.stopPropagation(),this.vaSortSelectBlur.emit({value:e.detail.value})}render(){const{name:e,value:t,width:a,messageAriaDescribedby:s}=this;return h(Host,{key:"da6b3ef9ab5f029aa307ce1bf5e003f24e6566de"},h("va-select",{key:"788342ff479557bc834434cf21647e0453322fa0",label:"Sort by",name:e,value:t,"message-aria-describedby":s,width:a,class:"va-sort__select",onVaKeyDown:e=>this.handleVaKeyDown(e),onVaSelect:e=>this.handleVaSelect(e),onVaSelectBlur:e=>this.handleVaSelectBlur(e)},h("slot",{key:"8756d35e227e7daec17d1197417d8016d0fb0d54"})))}static get style(){return VaSortStyle0}},[1,"va-sort",{name:[1],value:[1537],width:[1],messageAriaDescribedby:[1,"message-aria-describedby"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-sort","va-select"].forEach(e=>{switch(e){case"va-sort":customElements.get(e)||customElements.define(e,VaSort$1);break;case"va-select":customElements.get(e)||defineCustomElement$2()}})}const VaSort=VaSort$1,defineCustomElement=defineCustomElement$1;export{VaSort,defineCustomElement};