(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1970],{1635:function(e,t,r){Promise.resolve().then(r.bind(r,1439)),Promise.resolve().then(r.bind(r,8001))},1439:function(e,t,r){"use strict";r.d(t,{default:function(){return b}});var a=r(7437),s=r(2265),n=r(3014),i=r(9317),d=r(3464),o=r(3330),l=r(5740);let c=async(e,t)=>{try{return(await d.Z.get("".concat(o.Q,"/api/v1/consultaSUBE?student_legajo=").concat(e,"&idVista=").concat(t),{headers:{Authorization:"".concat((0,l.B)())}})).data.registros}catch(e){throw Error(e.response.data.statussalida)}},x=async(e,t,r,a)=>{try{return(await d.Z.post("".concat(o.Q,"/api/v1/autorizarSUBE"),{tid:e,student_legajo:t,link_Sube:r,Inicio_tramite_sube:a},{headers:{Authorization:"".concat((0,l.B)())}})).data.registros}catch(e){throw Error(e.response.data.statussalida)}},m=async(e,t,r,a)=>{try{return await d.Z.post("/proxy-boleto",{student_id:e,student_id_type:t,student_name:r,student_last_name:a})}catch(e){var s,n;throw console.error("Error en postObtenerEnlaceSube:",e),Error((null===(n=e.response)||void 0===n?void 0:null===(s=n.data)||void 0===s?void 0:s.error)||e.message)}},u=e=>"TRAMITE_EXPIRADO"===e||"TRAMITE_EXPIRADOS"===e,p=()=>{let e=new Date,t=String(e.getDate()).padStart(2,"0"),r=String(e.getMonth()+1).padStart(2,"0"),a=e.getFullYear(),s=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0");return"".concat(t,"/").concat(r,"/").concat(a," ").concat(s,":").concat(n,":").concat(i)};var b=()=>{var e,t;let{user:r}=(0,n.a)(),[d,o]=(0,s.useState)(!1),[b,h]=(0,s.useState)(!1),[g,k]=(0,s.useState)(""),[f,j]=(0,s.useState)(0),[w,y]=(0,s.useState)(!1),[v,N]=(0,s.useState)(!1),[S,E]=(0,s.useState)(""),[_,T]=(0,s.useState)(""),[z,I]=(0,s.useState)(""),U=async e=>{var t;let r,a,s,n;h(!0);let i=async(e,t)=>{let n,i,d="";if(e.status>=200&&e.status<300){let o=JSON.parse(e.data);if(201===(n=o.status)){r=o.data["redirect-url"],a=o.data.tid,0===Number(o.data.in_progress)?s="Tramite pendiente de finalizacion":(s="Tramite finalizado",r="");let e=p(),n=r;await x(a,t,n,e)}else 400===n?d="Error de validaci\xf3n de datos":403===n?d="Error de credenciales":409===n?(a=i,r="",s="Tramite finalizado, ya posee un beneficio asignado"):423===n?d="Error: La persona tiene un beneficio pero deshabilitado.":439===n?d="Error: La IP desde la cual se env\xeda el request no est\xe1 autorizada.":500===n&&(d="Error interno del sistema, reintente en unos minutos")}else d=500===e.status?"Error interno del sistema, reintente en unos minutos":"Server returned: "+n;k(d)},d=e.currentUser.legajo,b=await c(d,"3135987");j(Number(null!==(t=null==b?void 0:b.length)&&void 0!==t?t:0));let g=0,f=0;if(n=0,b.length){let e;let t=b[b.length-1],d=t.student_legajo,c=t.student_id,x=t.student_id_type,p=t.nombre_alumno,k=t.id_facultad,j=t.link_sube,w=t.inicio_tramite_sube,v=t.tid,S=t.respuesta_sube,_=p.split(", "),z=w&&""!==w,U=new Date().getTime(),O=z?new Date(w).getTime():0,A=z?Math.floor((U-O)/1e3):0;""===v?n=0:0===A&&u(S)?n=0:A<1200&&""!==v?n=1:A>=1200&&""!==v&&(n=2),1===x?e=0:5===x?e=1:3===x?e=19:4===x?e=18:6===x?e=90:f=1,g=(0,l.K)(k)?0:1,"OK"!==S&&0===g?0===n?(""===S||u(S))&&i(await m(c,e,_[1],_[0]),d):1===n?(a=v,r=j,s="Tramite pendiente de finalizacion"):2===n&&u(S)?i(await m(c,e,_[1],_[0]),d):2!==n||u(S)||""===S||(a=v,r="",s="Tramite incompleto, contactese con el administrador del sistema"):"OK"===S&&0===g&&(a=v,r="",s="Tramite finalizado, beneficio otorgado"),E(s),T(a),I(r),h(!1),o(!0),y(1===g),N(1===f);return}h(!1)};return((0,s.useEffect)(()=>{(async()=>{var e;if((null==r?void 0:null===(e=r.currentUser)||void 0===e?void 0:e.legajo)&&!d)try{await U(r)}catch(e){console.error("Error:",e),k("Error al obtener la informaci\xf3n del boleto estudiantil"),h(!1)}})()},[r,d]),b)?(0,a.jsx)(i.Z,{mensaje:"Cargando informaci\xf3n del boleto estudiantil"}):(0,a.jsxs)("div",{className:"rounded-sm border border-stroke bg-white px-5 pt-6 pb-2.5 shadow-default dark:border-strokedark dark:bg-boxdark sm:px-7.5 xl:pb-1",children:[(0,a.jsx)("div",{className:"flex justify-between pb-4",children:(0,a.jsx)("div",{className:"w-100 relative"})}),(0,a.jsxs)("div",{className:"max-w-full overflow-x-auto",children:[(0,a.jsxs)("table",{className:"w-full",children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{className:"bg-gray-2 text-center dark:bg-meta-4",children:(0,a.jsxs)("th",{colSpan:3,className:"py-4 px-4 font-medium text-black dark:text-white",children:["Estado de tr\xe1mite del boleto estudiantil ",(null==r?void 0:null===(e=r.currentUser)||void 0===e?void 0:e.nombre)&&"de "+(null==r?void 0:null===(t=r.currentUser)||void 0===t?void 0:t.nombre)]})})}),(0,a.jsx)("tbody",{children:""!==g?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{className:"text-center text-sm border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:g})}):0===f?(0,a.jsx)("tr",{className:"textoTabla",children:(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:"Error: Alumno no regular, no puede iniciar el tramite. Regularice su situaci\xf3n"})}):w||v?!w&&v?(0,a.jsx)("tr",{className:"textoTabla",children:(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:"Tipo de documento invalido, por favor contactese con la secretaria academica de la facultad para actualizar su documento"})}):w&&!v?(0,a.jsx)("tr",{className:"textoTabla",children:(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:"Facultad no permitida para realizar el tramite"})}):(0,a.jsxs)("tr",{className:"textoTabla",children:[(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:"Facultad no permitida para realizar el tramite"}),(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:"Tipo de documento invalido, por favor contactese con la secretaria academica de la facultad para actualizar su documento"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("tr",{className:"textoTabla bg-gray-2 text-left dark:bg-meta-4",children:[(0,a.jsx)("th",{className:"text-center py-4 px-4 font-medium text-black dark:text-white",children:"Estado"}),(0,a.jsx)("th",{className:"text-center py-4 px-4 font-medium text-black dark:text-white",children:"N\xba Tr\xe1mite"}),(0,a.jsx)("th",{className:"text-center py-4 px-4 font-medium text-black dark:text-white",children:"Link"})]}),(0,a.jsxs)("tr",{className:"textoTabla",children:[(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:S}),(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:_}),z&&""!==z?(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:(0,a.jsx)("a",{href:z,className:"text-white bg-black hover:bg-primary focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center",children:"Link_Formulario_Solicitud"})}):(0,a.jsx)("td",{className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:"-"})]}),z&&""!==z?(0,a.jsx)("tr",{className:"textoTabla",children:(0,a.jsx)("td",{colSpan:3,className:"text-center sm:max-w-[100px] lg:min-w-[250px] border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:(0,a.jsxs)("ul",{children:[(0,a.jsxs)("li",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:["Recuerde que para completar este formulario tiene ",(0,a.jsx)("b",{children:"20"})," minutos "]}),(0,a.jsxs)("li",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:["El formulario le va a solicitar ",(0,a.jsx)("b",{children:"datos personales"})," y el ",(0,a.jsx)("b",{children:"CUIL"})]}),(0,a.jsxs)("li",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:["Tenga a mano su n\xfamero de tarjeta ",(0,a.jsx)("b",{children:"SUBE"})," asociada a su documento "]}),(0,a.jsxs)("li",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:["Solo va a poder seleccionar hasta un",(0,a.jsx)("i",{children:(0,a.jsxs)("b",{children:[" m\xe1ximo de ",(0,a.jsx)("u",{children:"4"})," l\xedneas"]})})," de transporte "]}),(0,a.jsx)("li",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:(0,a.jsx)("b",{children:"Nota importante:"})}),(0,a.jsxs)("li",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:["El tr\xe1mite tiene una fecha de cierre del ",(0,a.jsx)("b",{children:"17"})," de cada mes"]}),(0,a.jsxs)("li",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:["Luego de la fecha de cierre y de haber finalizado el tr\xe1mite, la acreditaci\xf3n puede demorar ",(0,a.jsxs)("b",{children:[" hasta ",(0,a.jsx)("u",{children:"10"})," d\xedas h\xe1biles"]})]}),(0,a.jsxs)("li",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:["Posterior a el d\xeda ",(0,a.jsx)("b",{children:"17"}),", el tramite se har\xe1 efectivo luego del 17 del ",(0,a.jsx)("b",{children:(0,a.jsx)("i",{children:"pr\xf3ximo mes"})})]})]})})}):null]})})]}),(0,a.jsxs)("div",{className:"flex justify-between px-6 pt-5 pb-5 border-t border-stroke",children:[(0,a.jsx)("div",{className:"flex"}),(0,a.jsx)("p",{className:"font-medium"})]})]})]})}},4474:function(e,t,r){"use strict";r.d(t,{o:function(){return s}});class a extends Error{}function s(e,t){let r;if("string"!=typeof e)throw new a("Invalid token specified: must be a string");t||(t={});let s=!0===t.header?0:1,n=e.split(".")[s];if("string"!=typeof n)throw new a(`Invalid token specified: missing part #${s+1}`);try{r=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(n)}catch(e){throw new a(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new a(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}a.prototype.name="InvalidTokenError"}},function(e){e.O(0,[3587,9070,4609,5947,8316,798,1320,8001,2971,2117,1744],function(){return e(e.s=1635)}),_N_E=e.O()}]);