import{i as x}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-2ce7a1bc.js";import{a as e,j as N}from"./Tooltip-5ec3092e.js";import{L as y,m as p,z as S,h as D,O as l}from"./index-76588cc8.js";import{r as C}from"./DatosDom-5fd326e1.js";import{C as F}from"./MoreVert-c3c121c8.js";const{useEffect:v}=await x("react"),{Button:A}=await x("@mui/material"),L=a=>{const{ejecutarAdministraWf:m,paramsProceso:b,isFirstTarea:n,mode:i,tarActual:s,dataPrc:u}=a,c=a.dataPrc;return c?e(g,{paramsProceso:b,solInfo:c,ejecutarAdministraWf:m,isFirstTarea:n,mode:i,tarActual:s,dataPrc:u}):e(y,{})},g=a=>{const{ejecutarAdministraWf:m,paramsProceso:b,tarActual:n}=a,i=a.dataPrc;v(()=>{p.getData(i,["sol"]).then(o=>{o.sol!==void 0&&(t("SolNumDoc",o.sol.SolNumDoc),t("SolNumDoc",o.sol.SolNumDoc),t("SolCuit",o.sol.SolCuit),t("SolSex",o.sol.SolSex),t("SolNom",o.sol.SolNom),t("SolApe",o.sol.SolApe),t("SolFchNac",o.sol.SolFchNac),t("SolNivEst",o.sol.SolNivEst),p.isTruthy(o.sol.SolNac)&&t("SolNac",o.sol.SolNac),t("SolEstCiv",o.sol.SolEstCiv))}).catch(o=>{S.error("Error al buscar datos"),console.error(o)})},[]);const s={id:"DmnAbr",name:"SolSex",text:"DmnDet",tabla:"dmn",where:"DmnFilt = 'TIPSEX'",type:"supercombobox"},u={id:"DmnAbr",name:"SolNivEst",text:"DmnDet",tabla:"dmn",where:"DmnFilt = 'ESTNIV'",type:"supercombobox"},c={id:"NacAbr",name:"SolNac",text:"NacNom",tabla:"nac",type:"supercombobox"},f={id:"DmnAbr",name:"SolEstCiv",text:"DmnDet",tabla:"dmn",where:"DmnFilt = 'ESTCIV'",type:"supercombobox"},{control:r,handleSubmit:h,formState:E,setValue:t}=D({mode:"onChange",defaultValues:{SolNumDoc:"",SolCuit:"",SolApe:"",SolNom:"",SolFchNac:"",SolSex:"",SolNivEst:"",SolNac:"ARG",SolEstCiv:""}});return e(F,{children:N("form",{onSubmit:h(o=>{C.guardar("Sol",{iprId:i,data:o}).then(d=>{if(!d.success){S.error("Error al guardar datos");return}m({out:o,act:"END",tar:n})}).catch(d=>{S.error("Error al guardar datos"),console.error(d)})},()=>{console.log(E.errors)}),children:[N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[e(l,{required:!0,control:r,name:"SolNumDoc",type:"number",label:"Número de documento"}),e(l,{required:!0,control:r,name:"SolCuit",type:"number",label:"CUIT"}),e(l,{required:!0,control:r,name:"SolApe",type:"text",label:"Apellido"}),e(l,{required:!0,control:r,name:"SolNom",type:"text",label:"Nombre"}),e(l,{required:!0,control:r,name:"SolFchNac",type:"date",label:"Fecha de Nacimiento"}),e(l,{required:!0,control:r,name:"SolSex",type:"supercombobox",label:"Sexo",iField:s}),e(l,{required:!0,control:r,name:"SolNivEst",type:"supercombobox",label:"Nivel de estudio",iField:u}),e(l,{required:!0,control:r,name:"SolNac",type:"supercombobox",label:"Nacionalidad",iField:c}),e(l,{required:!0,control:r,name:"SolEstCiv",type:"supercombobox",label:"Estado civil",iField:f})]}),a.mode!=="history"&&e("div",{style:{display:"flex",justifyContent:"end",marginTop:"10px"},children:e(A,{sx:{marginLeft:"10px"},color:"secondary",type:"submit",variant:"contained",children:"Continuar"})})]})})};export{L as default};
