1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7181],{34425:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/portal/subject/classes",function(){return s(93728)}])},31133:function(e,t,s){"use strict";s.d(t,{l:function(){return n}});var r=s(85893),l=s(12416),a=s(6788);function n(e){let{closePopup:t,confirmDelete:s,label:n,openModal:i,isProcessing:c=!1}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(l.u_,{show:i,size:"md",onClose:()=>t(),popup:!0,children:[(0,r.jsx)(l.u_.Header,{}),(0,r.jsx)(l.u_.Body,{children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)(a.Z,{className:"mx-auto mb-4 h-14 w-14 text-gray-400"}),(0,r.jsx)("h3",{className:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400",children:n}),(0,r.jsxs)("div",{className:"flex justify-center gap-4",children:[(0,r.jsx)(l.zx,{color:"failure",isProcessing:c,onClick:()=>s(),children:"Remover"}),(0,r.jsx)(l.zx,{color:"gray",onClick:()=>t(),children:"Cancelar"})]})]})})]})})}},51390:function(e,t,s){"use strict";s.d(t,{v:function(){return o}});var r=s(85893),l=s(12416),a=s(45696),n=s(33299),i=s(70385),c=s(67294);function o(e){let{options:t}=e,[s,o]=(0,c.useState)(!1),{user:{role:u}}=(0,n.useSession)().data;return(0,c.useEffect)(()=>{o(u==i.Role.USER)},[u]),(0,r.jsx)(l.Lt,{className:"w-[80%] min-w-[6rem]",label:"",inline:!0,renderTrigger:()=>(0,r.jsx)(a.Z,{}),children:t.map((e,a)=>{let n="";("Remover"==e.label||"Reprovar"==e.label)&&(n=s?"hidden":"h-10 cursor-pointer px-4 py-2 text-red-600 hover:bg-gray-100");let i="Remover"==e.label&&s;return(0,r.jsxs)("div",{children:[(0,r.jsx)(l.Lt.Item,{disabled:i,className:n,onClick:e.action,children:e.label}),a==t.length?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(l.Lt.Divider,{})]},a)})})}},53819:function(e,t,s){"use strict";s.d(t,{Z:function(){return l}});var r=s(85893);function l(e){let{className:t}=e;return(0,r.jsxs)("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,r.jsx)("g",{clipPath:"url(#clip0_330_2856)",children:(0,r.jsx)("path",{d:"M10.0002 0.833496V10.0002M10.0002 10.0002V19.1668M10.0002 10.0002H19.1668M10.0002 10.0002H0.833496",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_330_2856",children:(0,r.jsx)("rect",{width:"20",height:"20",fill:"white"})})})]})}s(67294)},45696:function(e,t,s){"use strict";s.d(t,{Z:function(){return l}});var r=s(85893);function l(e){let{onClick:t=()=>{}}=e;return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"cursor-pointer",onClick:t,children:[(0,r.jsx)("path",{d:"M18 13C19.1046 13 20 11.8807 20 10.5C20 9.11929 19.1046 8 18 8C16.8954 8 16 9.11929 16 10.5C16 11.8807 16.8954 13 18 13Z",fill:"#6B7280"}),(0,r.jsx)("path",{d:"M10 13C11.1046 13 12 11.8807 12 10.5C12 9.11929 11.1046 8 10 8C8.89543 8 8 9.11929 8 10.5C8 11.8807 8.89543 13 10 13Z",fill:"#6B7280"}),(0,r.jsx)("path",{d:"M2 13C3.10457 13 4 11.8807 4 10.5C4 9.11929 3.10457 8 2 8C0.895431 8 0 9.11929 0 10.5C0 11.8807 0.895431 13 2 13Z",fill:"#6B7280"})]})}s(67294)},6788:function(e,t,s){"use strict";s.d(t,{Z:function(){return l}});var r=s(85893);function l(e){let{className:t}=e;return(0,r.jsx)("svg",{className:t,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}s(67294)},14990:function(e,t,s){"use strict";s.d(t,{Z:function(){return l}});var r=s(85893);function l(e){let{className:t,check:s,isWhite:l}=e,a=s?"#1F2A37":l?"#ffffff":"#6B7280";return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"".concat(t),children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_330_2850)",children:[(0,r.jsx)("path",{d:"M8.0001 16C6.41783 16 4.87109 15.5308 3.55548 14.6518C2.23987 13.7727 1.21448 12.5233 0.608974 11.0615C0.00346629 9.59966 -0.154962 7.99112 0.153723 6.43928C0.462409 4.88743 1.22434 3.46197 2.34318 2.34315C3.46201 1.22433 4.88749 0.462403 6.43936 0.153721C7.99122 -0.1549
16 9.59977 0.00346625 11.0616 0.608967C12.5234 1.21447 13.7729 2.23985 14.6519 3.55544C15.531 4.87103 16.0002 6.41775 16.0002 8C15.9978 10.121 15.1542 12.1544 13.6544 13.6542C12.1546 15.154 10.1211 15.9976 8.0001 16ZM8.0001 2C6.8134 2 5.65334 2.3519 4.66664 3.01118C3.67993 3.67047 2.91089 4.60754 2.45675 5.7039C2.00262 6.80026 1.8838 8.00665 2.11532 9.17054C2.34683 10.3344 2.91828 11.4035 3.75741 12.2426C4.59653 13.0818 5.66564 13.6532 6.82954 13.8847C7.99344 14.1162 9.19985 13.9974 10.2962 13.5433C11.3926 13.0891 12.3297 12.3201 12.989 11.3334C13.6483 10.3467 14.0002 9.18669 14.0002 8C13.9986 6.40919 13.3659 4.88399 12.241 3.75912C11.1161 2.63424 9.59093 2.00159 8.0001 2Z",fill:a}),(0,r.jsx)("path",{d:"M19.0002 20C18.735 19.9999 18.4807 19.8946 18.2932 19.707L14.2931 15.707C14.111 15.5184 14.0102 15.2658 14.0125 15.0036C14.0147 14.7414 14.1199 14.4906 14.3053 14.3052C14.4907 14.1198 14.7416 14.0146 15.0038 14.0123C15.266 14.01 15.5186 14.1108 15.7072 14.293L19.7072 18.293C19.847 18.4329 19.9422 18.611 19.9808 18.805C20.0194 18.9989 19.9996 19.2 19.9239 19.3827C19.8482 19.5654 19.7201 19.7215 19.5557 19.8314C19.3913 19.9413 19.198 20 19.0002 20Z",fill:a})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_330_2850",children:(0,r.jsx)("rect",{width:"20",height:"20",fill:"white"})})})]})}s(67294)},79404:function(e,t,s){"use strict";s.d(t,{PK:function(){return a},bF:function(){return l},i0:function(){return n}});var r=s(22920);function l(e){return r.Am.success(e,{position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function a(e){return r.Am.error(e,{position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function n(e){return r.Am.warn(e,{position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}},59866:function(e,t,s){"use strict";s.d(t,{N:function(){return l}});var r=s(67294);function l(e,t){let[s,l]=(0,r.useState)(e);return(0,r.useEffect)(()=>{let s=setTimeout(()=>l(e),null!=t?t:500);return()=>{clearTimeout(s)}},[e,t]),s}},93728:function(e,t,s){"use strict";s.r(t);var r=s(85893),l=s(53819),a=s(14990),n=s(52819),i=s(12416),c=s(67294),o=s(80983),u=s(79404),d=s(59866),h=s(11163),x=s(80765),f=s(51390),m=s(31133);t.default=function(){let e=(0,h.useRouter)(),{query:{subjectId:t}}=e,[s,g]=(0,c.useState)(1),p=o.h.classesGetsRouters.getAllClassesSubject.useQuery({pageOffset:s-1,pageSize:10,subjectClassId:t}).data,j=o.h.classRemove.removeClassSubject.useMutation(),[C,w]=(0,c.useState)([]),[b,v]=(0,c.useState)(0),[N,y]=(0,c.useState)(0),[_,A]=(0,c.useState)(null),[k,M]=(0,c.useState)(""),S=(0,d.N)(k,500),P=o.h.classesGetsRouters.getSearchByStringSubjectClass.useQuery({searchBy:S,pageOffset:s-1,pageSize:10,getAllWithNotParam
1s:!0},{enabled:""!=S}),B=e=>{e?A(e):A(null)},Z=async()=>{try{_&&(await j.mutateAsync({id:_}),A(null),(0,u.bF)("Mat\xe9ria deletada!")),e.reload()}catch(e){(0,u.PK)("N\xe3o foi poss\xedvel deletar a mat\xe9ria")}},R=async t=>{await e.push("/portal/subject/classes/create?id=".concat(t))},E=async t=>{await e.push("/portal/subject".concat(t))};if((0,c.useEffect)(()=>{p&&(w(p.data),y((null==p?void 0:p.totalItems)?Math.ceil((null==p?void 0:p.totalItems)/10):0),v(null==p?void 0:p.totalItems))},[p]),(0,c.useEffect)(()=>{if(P.data){var e;w(P.data.data),v(null===(e=P.data)||void 0===e?void 0:e.totalItems)}},[P,S]),!p||!C)return(0,r.jsx)(n.Z,{children:(0,r.jsx)("div",{className:"m-auto flex h-auto w-full flex-col items-center justify-center rounded-lg bg-white py-10 shadow-[0px_1px_3px_0px_rgba(0,0,0,0.10)]",children:(0,r.jsx)(i.$j,{})})});let H=Math.min((s+1)*10,b);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.l,{openModal:_,closePopup:()=>B(),confirmDelete:Z,label:"Tem certeza que deseja remover esta turma?"}),(0,r.jsx)(n.Z,{children:(0,r.jsxs)("div",{className:"flex h-auto w-full flex-col rounded-lg bg-white shadow-[0px_1px_3px_0px_rgba(0,0,0,0.10)]",children:[(0,r.jsxs)("div",{className:"flex h-16 w-full flex-row items-center justify-between px-4 py-4",children:[(0,r.jsxs)("div",{className:"relative mt-1 flex h-10 w-2/6 flex-row rounded-md border border-gray-200 bg-gray-50 text-sm text-gray-700 shadow-sm ",children:[(0,r.jsx)(i.__,{htmlFor:"search",className:"absolute left-4 top-3 cursor-pointer",children:(0,r.jsx)(a.Z,{})}),(0,r.jsx)("input",{type:"text",id:"search-class",className:"w-full border-none bg-transparent px-14 ",placeholder:"Buscar mat\xe9rias",onChange:e=>{M(e.target.value)}})]}),(0,r.jsxs)(i.zx,{color:"blue",onClick:()=>{if(t)return void e.push("/portal/subject/classes/create?subjectId=".concat(t));e.push("/portal/subject/classes/create?")},className:" w-2/6 lg:w-2/12",children:[(0,r.jsx)(l.Z,{className:"mx-4"}),"Adicionar turma"]})]}),(0,r.jsxs)(i.iA,{className:"w-full text-start",children:[(0,r.jsxs)(i.iA.Head,{className:"h-14 w-full border border-gray-200 bg-gray-50 text-start",children:[(0,r.jsx)(i.iA.HeadCell,{className:"w-3/12 px-5 text-start font-semibold text-gray-500",children:"MAT\xc9RIA"}),(0,r.jsx)(i.iA.HeadCell,{className:"w-2/12 text-start font-semibold text-gray-500",children:"C\xd3DIGO"}),(0,r.jsx)(i.iA.HeadCell,{className:"w-2/12 text-start font-semibold text-gray-500",children:"PROFESSOR"}),(0,r.jsx)(i.iA.HeadCell,{className:"w-2/12 text-start font-semibold text-gray-500",children:"CRIADA EM"}),(0,r.jsx)(i.iA.HeadCell,{className:"w-1/12 text-start font-semibold text-gray-500",children:"ALUNOS"}),(0,r.jsx)(i.iA.HeadCell,{className:"w-2/12 text-start"})]}),(0,r.jsx)(i.iA.Body,{children:C.map(e=>(0,r.jsxs)(i.iA.Row,{className:"relative h-14 w-full border border-gray-200 px-[10px]",children:[(0,r.jsx)(i.iA.Cell,{className:"px-[10px] font-medium text-gray-800 ",children:e.subject.name}),(0,r.jsx)(i.iA.Cell,{className:"text-gray-500",children:e.code}),(0,r.jsx)(i.iA.Cell,{className:"text-gray-500",children:e.teacher.name}),(0,r.jsx)(i.iA.Cell,{className:"text-gray-500",children:(0,x.C)(e.createdAt)}),(0,r.jsx)(i.iA.Cell,{className:"text-gray-500",children:e.students.length}),(0,r.jsx)(i.iA.Cell,{className:"relative flex h-14 content-center items-center justify-end px-4",children:(0,r.jsx)(f.v,{options:[{label:"Ver alunos",action:()=>
1{E("/classes/students?id=".concat(e.id))}},{label:"Ver notas",action:()=>{E("/classes/notes?id=".concat(e.id))}},{label:"Editar",action:()=>{R(e.id)}},{label:"Remover",action:()=>{B(e.id)}}]})})]},e.id))})]}),""==S||P.isFetched?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)("div",{className:"flex h-12 w-full items-center justify-center",children:(0,r.jsx)(i.$j,{})}),(0,r.jsxs)("div",{className:"flex h-16 items-center justify-between px-4 py-4",children:[(0,r.jsxs)("p",{children:["Exibindo"," ",(0,r.jsxs)("span",{className:"font-semibold",children:[(s-1)*10+1,"-",H]})," ","de ",(0,r.jsx)("span",{className:"font-semibold",children:b})]}),(0,r.jsx)(i.tl,{currentPage:s,totalPages:N,onPageChange:e=>g(e),previousLabel:"",nextLabel:"",showIcons:!0,theme:{pages:{selector:{active:"bg-[#e1effe] text-[#1A56DB]"}}}})]})]})})]})}},80765:function(e,t,s){"use strict";function r(e){let t=new Date(e),s=t.getFullYear(),r=t.getMonth()+1,l=t.getDate();return l<10&&(l="0"+l),r<10&&(r="0"+r),l+"/"+r+"/"+s}function l(e){let t=new Date(e),s=t.getHours(),r=t.getMinutes();return s<10&&(s="0"+s),r<10&&(r="0"+r),"".concat(s,":").concat(r)}s.d(t,{C:function(){return r},g:function(){return l}})},11163:function(e,t,s){e.exports=s(9090)}},function(e){e.O(0,[9260,1664,385,9332,1813,2819,2888,9774,179],function(){return e(e.s=34425)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.