import{b$ as p,r as h,d as x,j as e,l as a,B as j,O as b,z as f,U as g,gl as y,t as r}from"./index-cc84e56a.js";const A=s=>{const{iPrId:d,source:t}=s;p(),h.useState({});const n={dominio:"",label:"Documento",name:"",tabla:"adjtip",id:"AdjTipId",type:"supercombobox",text:"AdjTipNom",where:"",whereAdicion:"",otrosCampos:"AdjTipVinc , AdjTipId",groupBy:"",ordenBy:""},{control:i,handleSubmit:l,formState:{errors:c}}=x({defaultValues:{documento:"",iPrId:d,archivo:t},mode:"onBlur"});return e("div",{children:a("form",{onSubmit:l(u=>{g.post(`${y}`,u).then(m=>{const o=m.data;o.success?(r.success("El archivo fue adjuntado correctamente"),s.handleClose(!1)):r.error(o.msg??"Error al adjuntar archivo")}).finally(()=>{})}),children:[a(j,{sx:{display:"flex",alignItems:"center",gap:"10px"},children:[e("img",{src:t,alt:"Mensaje de imagen",style:{width:"40%"}}),e("div",{style:{flexBasis:"100%"},children:e(b,{control:i,name:"documento",required:!0,iField:n,type:"supercombobox"})})]}),e(f,{sx:{marginY:"10px"},fullWidth:!0,type:"submit",disabled:Object.keys(c).length>0,children:"Adjuntar"})]})})};export{A as default};
