import{r as t,c as s,h as e,H as i,g as o}from"./p-CV0Pyo1O.js";import{w as a,x as r,q as h,u as c,v as l}from"./p-CPKMvyV_.js";import{F as f}from"./p-Ce_W43gc.js";import"./p-CZfYo5-1.js";const n=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.fileSelected=s(this,"fileSelected",7),this.isFocused=!1,this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=t=>{const s=t.target,e=s.getAttribute("name");this.inputHandler(e,s.value),this.formControlInput.emit({name:e,value:s.value})},this.changeHandler=()=>{const t=this.fileInput.files;t&&this.fileSelected.emit({fileList:t,document_type:this.documentType})}}componentDidLoad(){this.fileInput=this.el.querySelector("input")}get part(){let t=a;return this.errorText&&(t=h),this.disabled&&(t=c),this.isFocused&&(t=l),t}render(){return e(i,{key:"9463f54c8850245de8d3ae92a45447fe8d2ce329"},e("div",{key:"fec5946a226ef5c270514e6b1f8a95de60d6bcb0",class:"form-group d-flex flex-column"},e("div",{key:"95783cbeab704b1b970af6619191667991814e73",class:"d-flex align-items-start gap-2"},e("label",{key:"c258720ecba808fcf18d3408569b4e391ca0e31f",part:r,class:"form-label",htmlFor:this.name},this.label),e("form-control-tooltip",{key:"280b23806bc9616506eb56025318b5c6fe395762",helpText:this.helpText})),e("input",{key:"2fcdd1ad6c923de9b28587ee3d1349d0fdf021eb",ref:t=>this.fileInput=t,type:"file",name:this.name,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onChange:this.changeHandler,onInput:this.handleFormControlInput,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()}}),e(f,{key:"df64bb1a0ac921da01fa8a4c3b63a8f5880781d2",errorText:this.errorText,name:this.name})))}get el(){return o(this)}};export{n as form_control_file}