import{i as n}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-2ce7a1bc.js";import{a as e,B as r,j as s,F as x}from"./Tooltip-5ec3092e.js";import{C as f,a as g}from"./Slide-ab750237.js";import{i as F,j as y,k as b,b as w,T as l,L as C,S as L,G as S}from"./index-76588cc8.js";/* empty css                  */import{a as T}from"./abrirPDF-ed56ab2a.js";const j=async o=>{const{data:i}=await F.post(`${y}/${b}/rest/firma/docsFirmados`,{idFirma:o});return i},{useState:p}=await n("react"),A=await n("react"),{Button:D,List:k,ListItem:B,ListItemIcon:I,ListItemText:$}=await n("@mui/material"),J=o=>{const{authFirma:i,unAuthenticateSignature:c}=w();if(!i)return c(o.tipo);const[d,u]=p([]),[h,m]=p(!0);return A.useEffect(()=>{const t=JSON.parse(localStorage.getItem("authFirma"));(async()=>{m(!0);try{const a=await j(t.idFirma);a.success?u(a.documentos):a.success||S.error(a.msg)}catch{}finally{m(!1)}})()},[]),e(r,{sx:{backgroundColor:"#F4F5FA",height:"100dvh"},children:e(f,{maxWidth:"xl",children:s(r,{children:[e(r,{width:"100%",display:"flex",justifyContent:"right",children:e(D,{sx:{marginTop:"1em"},variant:"contained",size:"small",onClick:()=>c(o.tipo),children:"Salir"})}),s(r,{width:"100%",sx:{paddingTop:"2em",display:"flex"},children:[e(r,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:e(l,{level:"h1",gutterBottom:!0,component:"h1",children:"Documentos firmados"})}),e(g,{})]}),e(r,{width:"100%",sx:{marginTop:"1em"},children:h?e(C,{}):e(x,{children:d.length?e(k,{sx:{backgroundColor:"#FFF",padding:"0.5em",borderRadius:"2px",boxShadow:"rgba(149, 157, 165, 0.2) 0px 8px 24px"},children:d.map(t=>s(B,{sx:{borderRadius:"2px",backgroundColor:"#FAFAF9",marginY:"0.5em"},secondaryAction:e("span",{style:{borderBottom:"1px solid rgb(8 141 245)",color:"rgb(8 141 245)",cursor:"pointer"},onClick:()=>T(t.urlTemp,"tset"),children:"Ver"}),children:[e(I,{children:e(L,{sx:{color:"#D72219"}})}),e($,{primary:`${t.nombre}.pdf`,secondary:`${t.descripcion} - ${t.fecha?t.fecha:""}`})]}))}):e(l,{sx:{marginTop:"2em"},textAlign:"center",children:"No hay documentos firmados"})})})]})})})};export{J as default};
