import{s as u}from"./helper-77b46e57.js";import{_ as i,o as r,c as a,t as l,f as o,a as c,s as m}from"./app-9daf7b25.js";const f={props:{modelValue:[String,Number],placeholder:String,type:{type:String,default:"text"},label:String,error:[String,Array],field:String,required:Boolean,subLabel:String,readonly:Boolean,disabled:Boolean,autocomplete:{type:String,default:"off"},autocorrect:{type:String,default:"off"}},computed:{fieldName(){return this.field?this.field:u(this.label??"")},errorMessage(){return Array.isArray(this.error)?this.error[0]:this.error}},methods:{onInput(d){this.$emit("update:modelValue",d.target.value)}}},_={class:"mb-4"},b=["for"],y={key:1,class:"text-sm"},g=["id","name","type","required","value","autocomplete","autocorrect","placeholder","readonly","disabled"],h={key:2,class:"block text-red text-xs font-bold rounded my-1"};function p(d,n,e,x,S,t){return r(),a("div",_,[e.label?(r(),a("label",{key:0,class:"label",for:t.fieldName},l(e.label),9,b)):o("",!0),e.subLabel?(r(),a("p",y,l(e.subLabel),1)):o("",!0),c("input",{class:m(["w-full py-2 px-3 rounded-md border bg-white border-market-gray mt-1 disabled:bg-gray-200",{"bg-gray-100 focus-visible:outline-none":e.readonly}]),id:t.fieldName,name:t.fieldName,onInput:n[0]||(n[0]=(...s)=>t.onInput&&t.onInput(...s)),type:e.type,required:e.required,value:e.modelValue,autocomplete:e.autocomplete,autocorrect:e.autocorrect,placeholder:e.placeholder,readonly:e.readonly,disabled:e.disabled},null,42,g),t.errorMessage?(r(),a("p",h,l(t.errorMessage),1)):o("",!0)])}const I=i(f,[["render",p],["__scopeId","data-v-f27e6462"]]);export{I as F};