import{i as x}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-6809063d.js";import{a as e,j as N}from"./Tooltip-ae8d7992.js";import{L as y}from"./Loader-45efafef.js";import{m as p,z as S,h as D,O as l}from"./index-dfa17bed.js";import{r as C}from"./DatosDom-24d9f33c.js";import{C as F}from"./MoreVert-40ae9564.js";const{useEffect:v}=await x("react"),{Button:A}=await x("@mui/material"),z=a=>{const{ejecutarAdministraWf:c,paramsProceso:b,isFirstTarea:n,mode:i,tarActual:s,dataPrc:u}=a,m=a.dataPrc;return m?e(g,{paramsProceso:b,solInfo:m,ejecutarAdministraWf:c,isFirstTarea:n,mode:i,tarActual:s,dataPrc:u}):e(y,{})},g=a=>{const{ejecutarAdministraWf:c,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"},m={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}c({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:m}),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{z as default};
