import{r as i,c as t,h as s,g as a}from"./p-52e3bb32.js";import{r as h}from"./p-ffe5c0e8.js";import{F as e,B as r}from"./p-4841b4e1.js";import{a as n,F as o}from"./p-88b4d03a.js";import{d}from"./p-430607cb.js";import{d as f}from"./p-ee33960b.js";import"./p-bdd811bc.js";const u=class{constructor(s){i(this,s),this.afOnFocusOutside=t(this,"afOnFocusOutside",7),this.afOnFocusInside=t(this,"afOnFocusInside",7),this.afOnClickOutside=t(this,"afOnClickOutside",7),this.afOnClickInside=t(this,"afOnClickInside",7),this.afOnChange=t(this,"afOnChange",7),this.afOnBlur=t(this,"afOnBlur",7),this.afOnKeyup=t(this,"afOnKeyup",7),this.afOnFocus=t(this,"afOnFocus",7),this.afOnFocusout=t(this,"afOnFocusout",7),this.afOnInput=t(this,"afOnInput",7),this.afOnClick=t(this,"afOnClick",7),this.afOnSubmitSearch=t(this,"afOnSubmitSearch",7),this.afOnReady=t(this,"afOnReady",3),this.afLabel=void 0,this.afLabelDescription=void 0,this.afType=n.SEARCH,this.afButtonVariation=o.PRIMARY,this.afName=void 0,this.afId=h("digi-form-input-search"),this.value=void 0,this.afValue=void 0,this.afAutocomplete=void 0,this.afAriaAutocomplete=void 0,this.afAriaActivedescendant=void 0,this.afAriaLabelledby=void 0,this.afAriaDescribedby=void 0,this.afVariation=e.MEDIUM,this.afHideButton=void 0,this.afButtonType=r.SUBMIT,this.afButtonText=void 0,this.afButtonAriaLabel=void 0,this.afButtonAriaLabelledby=void 0,this.afAutofocus=void 0}onValueChanged(i){this.afValue=i}onAfValueChanged(i){this.value=i}async afMGetFormControlElement(){return await this._input.afMGetFormControlElement()}blurHandler(i){this.afOnBlur.emit(i)}changeHandler(i){this.afValue=this.value=i.target.value,this.afOnChange.emit(i)}focusHandler(i){i.stopPropagation(),this.afOnFocus.emit(i)}focusoutHandler(i){this.afOnFocusout.emit(i)}keyupHandler(i){this.afOnKeyup.emit(i),"Enter"===i.detail.key&&this.afOnSubmitSearch.emit(this.afValue)}inputHandler(i){this.afOnInput.emit(i)}clickHandler(i){i.stopPropagation(),this.afOnClick.emit(i),this.afOnSubmitSearch.emit(this.afValue)}clickOutsideListener(i){d(i.target,`[data-af-identifier="${this.afId}"]`)?this.afOnClickOutside.emit(i):this.afOnClickInside.emit(i)}focusOutsideListener(i){f(i.target,`[data-af-identifier="${this.afId}"]`)?this.afOnFocusOutside.emit(i):this.afOnFocusInside.emit(i)}componentWillLoad(){this.afValue?this.value=this.afValue:this.afValue=this.value}componentDidLoad(){this.afOnReady.emit()}get cssModifiers(){return{"digi-form-input-search--small":this.afVariation===e.SMALL,"digi-form-input-search--medium":this.afVariation===e.MEDIUM,"digi-form-input-search--large":this.afVariation===e.LARGE}}render(){return s("div",{key:"7ecbb4390771cc1e95dba43ca55f3d015580c8d5",class:Object.assign({"digi-form-input-search":!0},this.cssModifiers),"data-af-identifier":this.afId},s("digi-form-input",{key:"f09541e380357c6058e79848ffd99a95060e950e",class:{"digi-form-input-search__input":!0,"digi-form-input-search__input--no-button":this.afHideButton},ref:i=>this._input=i,onAfOnBlur:i=>this.blurHandler(i),onAfOnChange:i=>this.changeHandler(i),onAfOnFocus:i=>this.focusHandler(i),onAfOnFocusout:i=>this.focusoutHandler(i),onAfOnKeyup:i=>this.keyupHandler(i),onAfOnInput:i=>this.inputHandler(i),afLabel:this.afLabel,afLabelDescription:this.afLabelDescription,afAriaActivedescendant:this.afAriaActivedescendant,afAriaDescribedby:this.afAriaDescribedby,afAriaLabelledby:this.afAriaLabelledby,afAriaAutocomplete:this.afAriaAutocomplete,afAutocomplete:this.afAutocomplete,afName:this.afName,afType:this.afType,afValue:this.afValue,afVariation:this.afVariation,afAutofocus:this.afAutofocus?this.afAutofocus:null,afButtonVariation:this.afButtonVariation,afId:this.afId},!this.afHideButton&&s("digi-button",{key:"42d7bbb08288ed5a482500b7dfaae220e64c24a9",class:"digi-form-input-search__button",onAfOnClick:i=>this.clickHandler(i),onAfOnFocus:i=>i.stopPropagation(),afType:this.afButtonType,afAriaLabel:this.afButtonAriaLabel,afAriaLabelledby:this.afButtonAriaLabelledby,afSize:this.afVariation,slot:"button"},s("digi-icon-search",{key:"4147f2f43df7c82a074d464d38851a13e2b11b8f",slot:"icon"}),this.afButtonText)))}get hostElement(){return a(this)}static get watchers(){return{value:["onValueChanged"],afValue:["onAfValueChanged"]}}};u.style=".sc-digi-form-input-search-h{--digi--form-input-search--input--border-radius--default:var(--digi--border-radius--input-search);width:100%}.sc-digi-form-input-search-h .digi-form-input-search__input.sc-digi-form-input-search{--digi--form-input--border-radius:var(--digi--form-input-search--input--border-radius--default)}.sc-digi-form-input-search-h .digi-form-input-search--large.sc-digi-form-input-search .digi-form-input-search__button.sc-digi-form-input-search button.sc-digi-form-input-search{font-size:var(--digi--global--typography--font-size--interaction-large);padding:var(--digi--gutter--button-block-large) var(--digi--gutter--button-inline-large)}";export{u as digi_form_input_search}