/*!
 * KoliBri - The accessible HTML-Standard
 */
import{w as t,aa as s,a5 as e,A as i,z as a}from"./index-0489af72.js";import{I as h}from"./controller-icon-421820a1.js";class o extends h{constructor(t,e,o){super(t,e,o),this.component=t}validateAutoComplete(e){t(this.component,"_autoComplete",(t=>"string"==typeof t&&("on"===t||"off"===t)),new Set(["on | off"]),e)}validateHasCounter(t){s(this.component,t)}validateMaxLength(t){e(this.component,"_maxLength",t,{min:0})}validatePattern(t){i(this.component,"_pattern",t)}validatePlaceholder(t){i(this.component,"_placeholder",t)}validateReadOnly(t){a(this.component,"_readOnly",t)}validateRequired(t){a(this.component,"_required",t)}validateValue(t){i(this.component,"_value",t),this.setFormAssociatedValue(this.component.state._value)}componentWillLoad(){super.componentWillLoad(),this.validateAutoComplete(this.component._autoComplete),this.validateHasCounter(this.component._hasCounter),this.validateMaxLength(this.component._maxLength),this.validatePattern(this.component._pattern),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateValue(this.component._value)}onBlur(t){this.component.state=Object.assign(Object.assign({},this.component.state),{_placeholder:this.placeholderCache}),this.placeholderCache=void 0,super.onBlur(t)}onFocus(t){this.placeholderCache=this.component.state._placeholder,this.component.state=Object.assign(Object.assign({},this.component.state),{_placeholder:void 0}),super.onFocus(t)}}export{o as I};