import{X as Y,r,j as e,A as j}from"./app-C7YxHmQz.js";import Z from"./Sidebar-CoDNqVRY.js";import{C as N,a as _,b as C,c as S,d as A,e as b}from"./card-B5AdkNGv.js";import{S as v}from"./SearchBar-DnIfIAds.js";import $ from"./DataTable-CvdKQsaH.js";import w from"./DataTable-C43a-TQy.js";import y from"./DataTable-B0kM4ujz.js";import{Pagination as U}from"./Pagination-DUuDMfYk.js";import aa from"./Select-Sesion-Estudio-CYZaC8qQ.js";import"./ModeToggle-BCfRgZ6p.js";import"./index-CCZex4bU.js";import"./index-Cp62Blk_.js";import"./index-Djfxw5dv.js";import"./index-BvfrUVYs.js";import"./createLucideIcon-CBwNTxoJ.js";import"./utils-DjqsqOe8.js";import"./chevron-right-DHVrRgbL.js";import"./button-CJ9RiI_R.js";import"./Dropdown-Bg5wGf8-.js";import"./transition-BNr4eNro.js";import"./input-BY0xThFe.js";import"./select-mU9SGeCM.js";import"./index-rT265Z_w.js";import"./validations-CdsIOtZM.js";import"./table-BLh168x8.js";import"./dialog-I_l9fXBT.js";import"./index-w2AxdR7H.js";import"./x-Dr1RcXTX.js";import"./calculador-promedio-DVzJKk5J.js";function Ba(){var k,E,B,F,H,I,R,X,q;const{estudiante:z,cursos_materiales:G,notas:c,conductas:n,asistencias:i,filters:t}=Y().props,[g,J]=r.useState(((k=t.nota)==null?void 0:k.search)||""),[p,K]=r.useState(((E=t.nota)==null?void 0:E.per_page)||10),[ea,D]=r.useState(((B=t.nota)==null?void 0:B.page)||1),[d,L]=r.useState(((F=t.asistencia)==null?void 0:F.search)||""),[m,M]=r.useState(((H=t.asistencia)==null?void 0:H.per_page)||10),[sa,T]=r.useState(((I=t.asistencia)==null?void 0:I.page)||1),[u,O]=r.useState(((R=t.conducta)==null?void 0:R.search)||""),[h,Q]=r.useState(((X=t.conducta)==null?void 0:X.per_page)||10),[ta,V]=r.useState(((q=t.conducta)==null?void 0:q.page)||1),x=(a,s)=>{const o=Number(a),l=1;j.get(route("calificaciones.index"),{[s]:{search:s==="nota"?g:s==="asistencia"?d:u,per_page:o,page:l}},{preserveState:!0}),s==="nota"?(K(o),D(l)):s==="asistencia"?(M(o),T(l)):s==="conducta"&&(Q(o),V(l))},P=(a,s)=>{const o=s==="nota"?c.last_page:s==="asistencia"?i.last_page:n.last_page;if(a>=1&&a<=o){const l=s==="nota"?g:s==="asistencia"?d:u,W=s==="nota"?p:s==="asistencia"?m:h;j.get(route("calificaciones.index"),{[s]:{search:l,per_page:W,page:a}},{preserveState:!0}),s==="nota"?D(a):s==="asistencia"?T(a):s==="conducta"&&V(a)}},f=(a,s)=>{j.get(route("calificaciones.index"),{[s]:{search:a,per_page:s==="nota"?p:s==="asistencia"?m:h}},{preserveState:!0}),s==="nota"?J(a):s==="asistencia"?L(a):s==="conducta"&&O(a)};return e.jsx(Z,{estudiante:z,children:e.jsxs("div",{className:"w-full max-w-4xl",children:[e.jsx(aa,{data:G}),e.jsxs(N,{className:"mt-4",children:[e.jsxs(_,{children:[e.jsx(C,{className:"text-center pb-3",children:"Notas"}),e.jsx(S,{className:"flex gap-4",children:e.jsx(v,{className:"flex-1",keyName:"Notas",search:g,perPage:p,onSearch:a=>f(a,"nota"),onPerPageChange:a=>x(a,"nota")})})]}),e.jsx(A,{children:e.jsx(w,{data:c.data})}),e.jsx(b,{className:"justify-center",children:e.jsx(U,{currentPage:c.current_page,lastPage:c.last_page,prevPageUrl:c.prev_page_url,nextPageUrl:c.next_page_url,search:g,perPage:p,onPageChange:a=>P(a,"nota")})})]}),e.jsxs(N,{className:"my-4",children:[e.jsxs(_,{children:[e.jsx(C,{className:"text-center pb-3",children:"Asistencias"}),e.jsx(S,{className:"flex gap-4",children:e.jsx(v,{className:"flex-1",keyName:"Asistencia",search:d,perPage:m,onSearch:a=>f(a,"asistencia"),onPerPageChange:a=>x(a,"asistencia")})})]}),e.jsx(A,{children:e.jsx($,{data:i.data})}),e.jsx(b,{className:"justify-center",children:e.jsx(U,{currentPage:i.current_page,lastPage:i.last_page,prevPageUrl:i.prev_page_url,nextPageUrl:i.next_page_url,search:d,perPage:m,onPageChange:a=>P(a,"asistencia")})})]}),e.jsxs(N,{className:"mb-4",children:[e.jsxs(_,{children:[e.jsx(C,{className:"text-center pb-3",children:"Conductas"}),e.jsx(S,{className:"flex gap-4",children:e.jsx(v,{className:"flex-1",keyName:"Conducta",search:u,perPage:h,onSearch:a=>f(a,"conducta"),onPerPageChange:a=>x(a,"conducta")})})]}),e.jsx(A,{children:e.jsx(y,{data:n.data})}),e.jsx(b,{className:"justify-center",children:e.jsx(U,{currentPage:n.current_page,lastPage:n.last_page,prevPageUrl:n.prev_page_url,nextPageUrl:n.next_page_url,search:u,perPage:h,onPageChange:a=>P(a,"conducta")})})]})]})})}export{Ba as default};
