import{I as z}from"./ImageUploader-7882029f.js";import{o as r,c as i,q as c,t as s,d,n as y,b as p,$ as v,j as b,a as t,m as F,r as h,u as q}from"./app-583c7dce.js";const B={key:0,class:"text-danger"},$=["title"],x={__name:"Label",props:{label:String,labelClass:{type:String,default:"mb-2"},labelRequired:{type:Boolean,default:!1},labelHint:{type:String}},setup(e){return(n,o)=>e.label?(r(),i("label",{key:0,class:y(e.labelClass)},[c(s(e.label)+" ",1),e.labelRequired?(r(),i("span",B,"*")):d("",!0),e.labelHint?(r(),i("i",{key:1,class:"bi bi-info-circle-fill ms-1","data-bs-toggle":"tooltip","data-bs-html":"true","data-bs-placement":"top",title:e.labelHint},null,8,$)):d("",!0)],2)):d("",!0)}},V=()=>{const e=p("");return{error:e,validateFileSize:(o,a=1)=>{o.size/(1048576*a)>1?e.value=`Sorry! Maximum allowed size for an image is ${a}MB`:e.value=""}}},k={class:"d-flex align-items-center flex-wrap gap-3"},I={class:"mt-4 px-2"},M={class:"text-danger validation-error mt-2"},R={__name:"Attachment",props:{label:String,modelValue:{require:!0},error:{type:String},labelRequired:Boolean,fileSize:{type:Number,default:()=>1},recommendedSize:{type:String},recommendedFileSize:{type:String}},emits:["changeFile"],setup(e,{emit:n}){v();const{errorMsg:o,error:a,validateFileSize:m}=V(),g=e,f=n,S=l=>{m(l,g.fileSize),f("changeFile",l)};return(l,u)=>(r(),i("div",null,[b(x,{label:e.label,"label-required":e.labelRequired},null,8,["label","label-required"]),t("div",k,[b(z,F({data:l.$props,value:e.modelValue,onGetFile:S},l.$attrs),null,16,["data","value"]),h(l.$slots,"default",{},()=>[t("p",I,[c(s(e.recommendedSize)+" ",1),u[0]||(u[0]=t("br",null,null,-1)),c(" "+s(e.recommendedFileSize),1)])])]),t("div",M,s(q(a)||e.error),1)]))}};export{R as _};
