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