(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1468],{6306:function(e,a,r){Promise.resolve().then(r.bind(r,5913)),Promise.resolve().then(r.bind(r,8001))},5913:function(e,a,r){"use strict";r.d(a,{default:function(){return b}});var t=r(7437),s=r(2265),d=r(3708),n=r(3464),o=r(3330),c=r(5740);let l=async e=>{let a=(0,c.B)();try{let r=await n.Z.post("".concat(o.Q,"/api/v1/legacy306"),e,{headers:{Authorization:"".concat(a)}});return{estadisticas:r.data.registros,datosGenerales:r.data.parametro3[0]}}catch(e){throw Error(e.response.data.statussalida)}};var i=r(3014),u=r(9317),m=r(9376);let p=[{Header:"Pregunta",accessor:"pregunta"},{Header:"Respuesta",accessor:"respuesta"},{Header:"Cantidad",accessor:"cantidad"}];var b=()=>{let[e,a]=(0,s.useState)([]),[r,n]=(0,s.useState)(null),[o,c]=(0,s.useState)(!1),[b,x]=(0,s.useState)(!1),{user:h}=(0,i.a)(),k=(0,m.useSearchParams)(),g=Number(k.get("plan")),j=Number(k.get("materia")),N=Number(k.get("anoacademico")),f=Number(k.get("encuesta")),y=Number(k.get("comision")),v=Number(k.get("especialidad")),w=(0,s.useMemo)(()=>p,[]),E=(0,s.useMemo)(()=>Array.isArray(e)?e:[],[e]),{getTableProps:S,getTableBodyProps:H,headerGroups:P,rows:_,prepareRow:C}=(0,d.useTable)({data:E,columns:w}),A=async e=>{c(!0);let{estadisticas:r,datosGenerales:t}=await l({encuesta:f,especialidad:v,plan:g,materia:j,anoacademico:N,comision:y});a(r||[]),n(t||null),c(!1)};return((0,s.useEffect)(()=>{o||!h||b||(A(h),x(!0))},[h,o,b]),o)?(0,t.jsx)(u.Z,{mensaje:"Cargando informaci\xf3n"}):(0,t.jsx)("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,t.jsxs)("div",{className:"max-w-full overflow-x-auto",children:[r&&(0,t.jsxs)("div",{className:"text-center mb-6 pb-10",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-800",children:r.nombre}),(0,t.jsx)("h4",{className:"text-xl font-semibold text-gray-800",children:r.observacion}),(0,t.jsxs)("p",{className:"text-sm text-gray-600",children:[r.comision," | Cantidad de respuestas: ",r.cantidad," (",r.porcentaje," %)"]})]}),(0,t.jsxs)("table",{className:"w-full table-auto",...S(),children:[(0,t.jsx)("thead",{children:P.map((e,a)=>(0,s.createElement)("tr",{...e.getHeaderGroupProps(),key:"headerGroup-".concat(a)},e.headers.map(e=>(0,s.createElement)("th",{...e.getHeaderProps(),key:"column-".concat(e.id),className:"py-4 px-4 font-medium text-black dark:text-white"},e.render("Header")))))}),(0,t.jsx)("tbody",{...H(),children:e.map((a,r)=>{let s=r>0?e[r-1]:null;return a.pregunta&&!a.pregunta.includes("-------")?"S"!==a.titulo?(0,t.jsxs)("tr",{children:[s&&a.pregunta===s.pregunta?(0,t.jsx)("td",{}):(0,t.jsx)("td",{className:"border border-[#eee] py-5 px-4 dark:border-strokedark",children:a.pregunta}),(0,t.jsx)("td",{className:"border-b border-l border-[#eee] py-5 px-4 dark:border-strokedark",children:a.respuesta}),(0,t.jsxs)("td",{className:"border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:[a.cantidad," ( ",a.porcentaje," %)"]})]},r):(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:3,className:"border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:(0,t.jsx)("b",{children:a.pregunta})})},r):null})})]})]})})}}},function(e){e.O(0,[3587,9070,4609,5947,8316,798,5640,1320,8001,2971,2117,1744],function(){return e(e.s=6306)}),_N_E=e.O()}]);