📁 File Manager
📍
/
/
home
/
u449181296
/
domains
/
birulogi.smakpbaleendah.sch.id
/
public_html
/
lms
/
tukang-ngatur
/
assets
/
img
/
qr-logos
/home/u449181296/domains/birulogi.smakpbaleendah.sch.id/public_html/lms/tukang-ngatur/assets/img/qr-logos
Upload
Name
Size
Date
CHMOD
Action
— FILE —
logo_1773801405.php
6.73 KB
2026-03-18 02:36
644
(rw-r--r--)
Edit
|
Rename
|
Preview
|
Del
Edit
import{r as n,j as e}from"./react-vendor-Cdu9POhR.js";import{j as ye,n as Ae,d as R,G as Ce,H as Pe,I as De,y as he,b as Re,P as Ee,u as Me,w as Ie,f as Te,h as Le,E as Ke,L as Be}from"./index-Cv4HPzFZ.js";import{j as y,h as oe,e as E,s as X,f as O,o as Q,q as j,w as k}from"./firebase-vendor-CChqQX8m.js";import{E as He}from"./pdf-vendor-BoEiDn9A.js";import{S as Ge}from"./SarprasWorkspace-DG2TJLxC.js";import{b as $e,a as de}from"./finance-Tc08cmEj.js";import"./router-vendor-EW88JuZe.js";import"./xlsx-BBWTpfDg.js";const ze=({onLogin:s})=>{const[c,m]=n.useState("nisn"),[d,h]=n.useState(""),[g,u]=n.useState(""),[f,K]=n.useState(""),[b,Z]=n.useState(null),[A,B]=n.useState(!1),[ne,v]=n.useState(null),_=async w=>{var P;if(w.preventDefault(),!!d){B(!0),v(null);try{const z=await y(ye);let M=null;const te=Ae(z.docs.map(D=>({id:D.id,...D.data()})));for(const D of te){const W=(P=D.students)==null?void 0:P.find(Y=>String(Y.nisn||Y.id).trim()===d.trim());if(W){if(W.isRestricted){v("Akses siswa diblokir oleh Manajemen.");return}M={student:W,classInfo:{id:D.id,name:D.name}};break}}if(!M){v("NISN tidak ditemukan.");return}const F=String(M.student.id).trim();await Fe(F);const V=await oe(E(R,"student_auth",F)),se=V.exists()&&V.data().mustChangePassword===!0;Z({...M,studentId:F}),m(se?"change-password":"password")}catch(z){console.error(z),v("Terjadi kesalahan koneksi.")}finally{B(!1)}}},ee=async()=>{if(b){B(!0),v(null);try{const w=E(R,"student_auth",b.studentId),P=await oe(w);if(!P.exists()){v("Data autentikasi tidak ditemukan.");return}if(P.data().passwordHash!==g){v("Password salah.");return}s({...b,mustChangePassword:P.data().mustChangePassword===!0})}finally{B(!1)}}},ae=async()=>{if(f.length<6){v("Password minimal 6 karakter.");return}if(b){B(!0),v(null);try{await X(E(R,"student_auth",b.studentId),{passwordHash:f,mustChangePassword:!1,updatedAt:O()},{merge:!0}),s({...b,mustChangePassword:!1})}catch(w){console.error(w),v("Gagal menyimpan password")}finally{B(!1)}}};return e.jsx("div",{className:"max-w-md mx-auto mt-12 px-4",children:e.jsxs("div",{className:"bg-indigo-900 p-8 rounded-[2.5rem] text-white shadow-2xl",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("img",{src:"/logo.png",alt:"Logo Sekolah",className:"h-20 w-auto drop-shadow-md"})}),e.jsx("h1",{className:"text-3xl font-black text-center mb-2",children:"Portal Siswa"}),e.jsx("p",{className:"text-center text-indigo-200 text-sm mb-8",children:"Sistem Laporan Ruang Ajar Siswa"}),c==="nisn"&&e.jsxs("form",{onSubmit:_,className:"space-y-6",children:[e.jsx("input",{value:d,onChange:w=>h(w.target.value),placeholder:"Masukkan NISN",className:"w-full px-6 py-5 rounded-2xl bg-indigo-800 text-center text-2xl font-black placeholder-indigo-300 focus:outline-none focus:ring-4 focus:ring-indigo-400"}),e.jsx("button",{disabled:A,className:"w-full bg-white text-indigo-900 py-4 rounded-2xl font-black uppercase tracking-widest hover:bg-indigo-100 transition-all disabled:opacity-50",children:A?"MEMERIKSA...":"LANJUTKAN"})]}),c==="password"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("input",{type:"password",placeholder:"Password",value:g,onChange:w=>u(w.target.value),className:"w-full px-6 py-5 rounded-2xl bg-indigo-800 placeholder-indigo-300 focus:outline-none focus:ring-4 focus:ring-indigo-400"}),e.jsx("button",{onClick:ee,disabled:A,className:"w-full bg-white text-indigo-900 py-4 rounded-2xl font-black uppercase tracking-widest hover:bg-indigo-100 transition-all disabled:opacity-50",children:A?"MEMPROSES...":"MASUK DASHBOARD"})]}),c==="change-password"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-indigo-200 text-center",children:"Login pertama — silakan ganti password"}),e.jsx("input",{type:"password",placeholder:"Password Baru (min. 6 karakter)",value:f,onChange:w=>K(w.target.value),className:"w-full px-6 py-5 rounded-2xl bg-indigo-800"}),e.jsx("button",{onClick:ae,className:"w-full bg-green-500 py-4 rounded-2xl font-black",children:"SIMPAN & MASUK"})]}),ne&&e.jsx("p",{className:"mt-6 text-center text-red-300 text-sm",children:ne})]})})},Fe=async s=>{const c=E(R,"student_auth",s),m=await oe(c);return m.exists()?m.data():(await X(c,{passwordHash:s,mustChangePassword:!0,createdAt:O()}),{mustChangePassword:!0})},be=s=>s&&s.length?s:[{id:"f1",title:"F1",material:"",semester:"ganjil",type:"custom"},{id:"f2",title:"F2",material:"",semester:"ganjil",type:"custom"},{id:"sas",title:"SAS",material:"",semester:"ganjil",type:"psts"},{id:"f3",title:"F3",material:"",semester:"genap",type:"custom"},{id:"f4",title:"F4",material:"",semester:"genap",type:"custom"},{id:"sat",title:"SAT",material:"",semester:"genap",type:"psaf"}],fe=(s,c)=>{if(!s)return;if(s.assessmentScores&&c.id in s.assessmentScores)return s.assessmentScores[c.id];const d={f1:"f1",f2:"f2",sas:"sas",f3:"f3",f4:"f4",sat:"sat","ganjil-psts":"sas","ganjil-psas":"sat","genap-psts":"f3","genap-psaf":"f4"}[c.id];return d?s[d]:void 0},ge=(s,c)=>{const m=be(c).map(d=>fe(s,d)).filter(d=>typeof d=="number"&&d>0);return m.length?Math.round(m.reduce((d,h)=>d+h,0)/m.length):0},We=({text:s})=>{const c=s.split(` `);return e.jsx("div",{className:"space-y-6 text-slate-700",children:c.map((m,d)=>{if(m.startsWith("###"))return e.jsxs("h3",{className:"text-lg font-black text-indigo-900 border-b-2 border-indigo-50 pb-2 mt-8 flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-6 bg-indigo-600 rounded-full"}),m.replace("###","").replace(/\*\*/g,"").trim()]},d);if(m.trim().startsWith("*")){const g=m.trim().substring(1).trim().split("**");return e.jsxs("div",{className:"flex gap-3 pl-2 group",children:[e.jsx("span",{className:"text-indigo-400 mt-1.5",children:"•"}),e.jsx("p",{className:"text-sm font-medium leading-relaxed",children:g.map((u,f)=>f%2===1?e.jsx("span",{className:`font-black ${u.includes("BELUM LAYAK")||u.includes("Terancam")?"text-red-600 bg-red-50 px-1 rounded":u.includes("SANGAT BAIK")||u.includes("LAYAK")?"text-green-600 bg-green-50 px-1 rounded":"text-slate-900"}`,children:u},f):u)})]},d)}if(m.trim().length>0){const h=m.split("**");return e.jsx("p",{className:"text-sm font-medium leading-relaxed",children:h.map((g,u)=>u%2===1?e.jsx("span",{className:"font-black text-slate-900",children:g},u):g)},d)}return e.jsx("div",{className:"h-2"},d)})})},Oe=({student:s,classInfo:c,onLogout:m})=>{const[d,h]=n.useState("Dashboard"),[g,u]=n.useState([]),[f,K]=n.useState([]),[b,Z]=n.useState(""),[A,B]=n.useState(!1),[ne,v]=n.useState(!0),[_,ee]=n.useState(""),[ae,w]=n.useState([]),[P,z]=n.useState([]),[M,te]=n.useState([]),[F,V]=n.useState([]),[se,D]=n.useState([]),[W,Y]=n.useState([]),[I,re]=n.useState([]),[ce,we]=n.useState([]),[Ve,Ne]=n.useState([]),[Ye,je]=n.useState([]),[U,xe]=n.useState(!1),[q,le]=n.useState(""),[ke,ve]=n.useState(""),[C,H]=n.useState({fatherName:"",motherName:"",address:"",fatherPhone:"",motherPhone:""}),[me,ue]=n.useState(!1);n.useEffect(()=>{if(!["Dashboard","Nilai","Analisis"].includes(d)){u([]),K([]);return}let t=!1;return(async()=>{const[o,l]=await Promise.all([y(j(Re,k("classId","==",c.id))),y(j(Ee,k("classId","==",c.id)))]);t||(u(o.docs.map(i=>({id:i.id,...i.data()})).sort((i,p)=>p.date.localeCompare(i.date))),K(l.docs.map(i=>({id:i.id,...i.data()}))))})().catch(o=>console.error(o)),()=>{t=!0}},[d,c.id]),n.useEffect(()=>Q(E(R,"settings","ai"),t=>{t.exists()&&v(t.data().enabled===!0)}),[]),n.useEffect(()=>{if(d!=="Data Orang Tua/Wali")return;const a=E(R,"student_parent_profiles",s.nisn||s.id);return Q(a,r=>{if(r.exists()){const o=r.data();H({fatherName:String(o.fatherName||""),motherName:String(o.motherName||""),address:String(o.address||""),fatherPhone:String(o.fatherPhone||""),motherPhone:String(o.motherPhone||"")})}else H({fatherName:"",motherName:"",address:"",fatherPhone:"",motherPhone:""})})},[d,s.id,s.nisn]),n.useEffect(()=>{if(!["Dashboard","Analisis"].includes(d)){Y([]);return}let t=!1;return(async()=>{const o=await y(j(Me,k("classId","==",c.id)));t||Y(o.docs.map(l=>({id:l.id,...l.data()})).sort((l,i)=>i.date.localeCompare(l.date)))})().catch(o=>console.error(o)),()=>{t=!0}},[d,c.id]),n.useEffect(()=>{const a=Q(j(Ce,k("studentId","==",s.id)),o=>{we(o.docs.map(l=>({id:l.id,...l.data()})).sort((l,i)=>l.extracurricularName.localeCompare(i.extracurricularName)))}),t=Q(j(Pe,k("studentId","==",s.id)),o=>{Ne(o.docs.map(l=>({id:l.id,...l.data()})).sort((l,i)=>l.category.localeCompare(i.category)||l.competitionName.localeCompare(i.competitionName)))}),r=Q(j(De,k("studentId","==",s.id)),o=>{je(o.docs.map(l=>({id:l.id,...l.data()})).sort((l,i)=>l.scholarshipType.localeCompare(i.scholarshipType)||l.period.localeCompare(i.period)))});return()=>{a(),t(),r()}},[s.id]);const ie=n.useCallback(async()=>{xe(!0),le("");try{const a=String(s.id).trim(),t=String(s.nisn||"").trim();let r=[];if(r=(await y(j(he,k("studentId","==",a)))).docs.map(i=>({id:i.id,...i.data()})),!r.length&&t&&(r=(await y(j(he,k("nisn","==",t)))).docs.map(p=>({id:p.id,...p.data()}))),r.sort((i,p)=>{var S,L;const N=((S=i.updatedAt)==null?void 0:S.seconds)||0;return(((L=p.updatedAt)==null?void 0:L.seconds)||0)-N||p.month.localeCompare(i.month)}),!r.length){re([]),le(`Data keuangan untuk NISN ${s.nisn||s.id} belum ditemukan.`);return}const l=r.map(i=>({...i,note:i.note||$e(i.amountDue||0)}));re(l),ve(new Date().toLocaleTimeString("id-ID",{hour:"2-digit",minute:"2-digit"}))}catch(a){console.error(a),re([]),le(a instanceof Error?a.message:"Gagal membaca data keuangan.")}finally{xe(!1)}},[s.id,s.nisn]);n.useEffect(()=>{d!=="BIAYA PENDIDIKAN"||U||I.length||q||ie()},[d,ie,q,I.length,U]),n.useEffect(()=>{if(!["Catatan Siswa","Analisis"].includes(d)){w([]),z([]),te([]),V([]),D([]);return}let t=!1;return(async()=>{const[o,l,i,p,N]=await Promise.all([y(j(Ie,k("studentId","==",s.id))),y(j(Te,k("studentId","==",s.id))),y(j(Le,k("studentId","==",s.id))),y(j(Ke,k("studentId","==",s.id))),y(j(Be,k("studentId","==",s.id)))]);t||(w(o.docs.map(x=>({id:x.id,...x.data()})).sort((x,S)=>S.date.localeCompare(x.date))),z(l.docs.map(x=>({id:x.id,...x.data()})).filter(x=>x.classId===c.id).sort((x,S)=>S.date.localeCompare(x.date))),te(i.docs.map(x=>({id:x.id,...x.data()})).filter(x=>x.classId===c.id).sort((x,S)=>{var L,J;return(((L=S.updatedAt)==null?void 0:L.seconds)||0)-(((J=x.updatedAt)==null?void 0:J.seconds)||0)})),V(p.docs.map(x=>({id:x.id,...x.data()})).filter(x=>x.classId===c.id).sort((x,S)=>{var L,J;return(((L=S.createdAt)==null?void 0:L.seconds)||0)-(((J=x.createdAt)==null?void 0:J.seconds)||0)})),D(N.docs.map(x=>({id:x.id,...x.data()})).filter(x=>x.classId===c.id).sort((x,S)=>S.date.localeCompare(x.date))))})().catch(o=>console.error(o)),()=>{t=!0}},[d,s.id,c.id]);const G=n.useMemo(()=>{const a=g.filter(i=>i.attendance[s.id]),t=a.filter(i=>i.attendance[s.id]==="Hadir").length,r=a.length>0?Math.round(t/a.length*100):0,o=f.map(i=>({entry:i.scores[s.id],config:i.assessmentConfig})).filter(i=>!!i.entry),l=o.length>0?Math.round(o.reduce((i,p)=>i+ge(p.entry,p.config),0)/o.length):0;return{attendancePercentage:r,avgGrade:l,totalSesi:a.length}},[g,f,s.id]),$=n.useMemo(()=>{const a=W.filter(l=>{var i,p;return!!((i=l.attendance)!=null&&i[s.id]||(p=l.waliOverrides)!=null&&p[s.id])}),t={Hadir:0,Sakit:0,Izin:0,Alfa:0,Terlambat:0,Dispensasi:0};a.forEach(l=>{var p,N;const i=((p=l.waliOverrides)==null?void 0:p[s.id])||((N=l.attendance)==null?void 0:N[s.id])||"Hadir";t[i]+=1});const r=a.length,o=r?Math.round(t.Hadir/r*100):0;return{total:r,percentage:o,counts:t,latest:a.slice(0,10)}},[W,s.id]),T=n.useMemo(()=>({total:I.reduce((a,t)=>a+(t.amountDue||0),0),latest:I[0]||null}),[I]);n.useMemo(()=>ce.map(a=>({...a,semester1Display:a.semester1Score||a.score||"-",semester2Display:a.semester2Score||"-"})),[ce]),n.useMemo(()=>{const a=new Map;return g.forEach(t=>{var l;const r=(l=t.attendance)==null?void 0:l[s.id];if(!r)return;const o=a.get(t.subject)||{total:0,hadir:0,terlambat:0,alfa:0};o.total+=1,r==="Hadir"&&(o.hadir+=1),r==="Terlambat"&&(o.terlambat+=1),r==="Alfa"&&(o.alfa+=1),a.set(t.subject,o)}),Array.from(a.entries()).map(([t,r])=>({subject:t,...r,percentage:r.total?Math.round(r.hadir/r.total*100):0})).sort((t,r)=>r.total-t.total||t.subject.localeCompare(r.subject))},[g,s.id]);const pe=n.useMemo(()=>{const a=[];return P.forEach(t=>{const r=M.find(o=>{var l;return(l=o.linkedRecordIds)==null?void 0:l.includes(t.id)});a.push({id:`record-${t.id}`,date:t.date,sourceRole:t.sourceRole,sourceName:t.sourceUserName,title:`${t.categoryName} • ${t.subcategoryName}`,note:t.description,processStatus:(r==null?void 0:r.currentStage)||t.status||"Tersimpan",badge:t.recordType==="positive"?"Catatan Positif":"Catatan Negatif"})}),ae.forEach(t=>{a.push({id:`wali-${t.id}`,date:t.date,sourceRole:"wali",sourceName:t.waliTeacherName,title:"Catatan Wali Kelas",note:t.note,processStatus:"Dipantau wali kelas",badge:"Catatan Wali"})}),se.forEach(t=>{const r=M.find(o=>o.id===t.linkedCaseId);a.push({id:`minute-${t.id}`,date:t.date,sourceRole:t.counselorRole,sourceName:t.counselorTeacherName,title:`Berita Acara ${t.counselorRoleLabel}`,note:[t.basis,t.chronology,t.coachingResult,t.followUp].filter(Boolean).join(" • "),processStatus:(r==null?void 0:r.currentStage)||`${t.documentStatus} • Buku Besar BK`,badge:"Berita Acara"})}),F.filter(t=>["bk","kesiswaan"].includes(t.actorRole)).forEach(t=>{var r;a.push({id:`event-${t.id}`,date:(r=t.createdAt)!=null&&r.toDate?t.createdAt.toDate().toISOString().slice(0,10):"",sourceRole:t.actorRole,sourceName:t.actorName,title:t.actionType,note:t.note,processStatus:t.toStage||t.actionType,badge:t.actorRole==="bk"?"Tindak Lanjut BK":"Tindak Lanjut Kesiswaan"})}),a.sort((t,r)=>r.date.localeCompare(t.date))},[P,M,ae,se,F]),Se=()=>{const a=new He;a.setFontSize(18),a.text("Rangkuman Siswa SELARAS",20,20),a.setFontSize(12),a.text(`Nama: ${s.name}`,20,30),a.text(`Kelas: ${c.name}`,20,37),a.text(`Tanggal Cetak: ${new Date().toLocaleDateString("id-ID")}`,20,44),a.line(20,48,190,48);const t=a.splitTextToSize(b.replace(/[*#]/g,""),170);a.text(t,20,60),a.save(`Analisis_Akademik_${s.name}.pdf`)};return e.jsxs("div",{className:"max-w-6xl mx-auto space-y-8 animate-fade-in pb-20 px-4",children:[e.jsxs("div",{className:"bg-slate-900 text-white p-8 md:p-12 rounded-[3rem] shadow-2xl relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-indigo-500/20 blur-[100px] rounded-full"}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-8 relative z-10",children:[e.jsx("div",{className:"w-24 h-24 rounded-[2.5rem] bg-indigo-600 flex items-center justify-center shadow-2xl ring-4 ring-indigo-500/30",children:e.jsx("span",{className:"text-4xl font-black",children:s.name.charAt(0)})}),e.jsxs("div",{className:"text-center md:text-left flex-1",children:[e.jsx("h1",{className:"text-3xl font-black tracking-tight",children:s.name}),e.jsxs("p",{className:"text-indigo-300 font-bold uppercase text-xs tracking-[0.2em] mt-1",children:["NISN: ",s.nisn||s.id," • KELAS ",c.name]}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-6 justify-center md:justify-start",children:["Dashboard","Nilai","Catatan Siswa","BIAYA PENDIDIKAN","Data Orang Tua/Wali","Lapor Sarpras","Analisis","Ganti Password"].map(a=>e.jsx("button",{onClick:()=>h(a),className:`px-6 py-2.5 rounded-2xl text-[10px] font-black uppercase tracking-widest transition-all ${d===a?"bg-white text-slate-900 shadow-lg":"bg-white/10 hover:bg-white/20 text-indigo-100"}`,children:a},a))})]}),e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsxs("div",{className:"bg-white/5 backdrop-blur-xl p-6 rounded-[2.5rem] border border-white/10 text-center min-w-[150px]",children:[e.jsx("p",{className:"text-[9px] font-black text-indigo-300 uppercase tracking-widest mb-1",children:"Panel Siswa"}),e.jsx("p",{className:"text-2xl font-black",children:"SELARAS"})]}),e.jsx("button",{onClick:()=>{confirm("Yakin ingin keluar?")&&m()},className:"w-full bg-red-600/20 hover:bg-red-600 text-red-400 hover:text-white border border-red-500/30 px-6 py-3 rounded-2xl text-[10px] font-black uppercase tracking-widest shadow-xl transition-all",children:"Logout"})]})]})]}),d==="Dashboard"&&e.jsx("div",{className:"space-y-6 animate-fade-in",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"bg-gradient-to-br from-violet-500/15 via-fuchsia-500/10 to-white rounded-[2.5rem] shadow-xl border border-violet-100 p-8",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.24em] text-violet-700/70",children:"Rata-rata Nilai"}),e.jsx("p",{className:"mt-4 text-5xl font-black text-slate-900",children:G.avgGrade||0}),e.jsx("p",{className:"mt-3 text-sm font-bold text-slate-500",children:"Ringkasan nilai akademik siswa dari data mapel yang sudah masuk."})]}),e.jsxs("div",{className:"bg-gradient-to-br from-emerald-500/15 via-teal-500/10 to-white rounded-[2.5rem] shadow-xl border border-emerald-100 p-8",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.24em] text-emerald-700/70",children:"Presensi Mapel"}),e.jsxs("div",{className:"mt-4 flex items-end gap-3",children:[e.jsxs("p",{className:"text-5xl font-black text-slate-900",children:[G.attendancePercentage,"%"]}),e.jsxs("span",{className:`mb-2 inline-flex rounded-full px-3 py-1 text-[10px] font-black uppercase tracking-widest ${G.attendancePercentage>=85?"bg-emerald-50 text-emerald-700":G.attendancePercentage>=75?"bg-amber-50 text-amber-700":"bg-rose-50 text-rose-700"}`,children:["Status: ",G.attendancePercentage>=85?"SANGAT BAIK":G.attendancePercentage>=75?"BAIK":"PERLU PERHATIAN"]})]}),e.jsxs("p",{className:"mt-3 text-sm font-bold text-slate-500",children:[G.totalSesi," sesi pembelajaran tercatat."]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-amber-500/15 via-orange-500/10 to-white rounded-[2.5rem] shadow-xl border border-amber-100 p-8",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.24em] text-amber-700/70",children:"Presensi Kehadiran Sekolah"}),e.jsxs("div",{className:"mt-4 flex items-end gap-3",children:[e.jsxs("p",{className:"text-5xl font-black text-slate-900",children:[$.percentage,"%"]}),e.jsxs("p",{className:"mb-2 text-xs font-black uppercase tracking-widest text-slate-400",children:[$.total," hari tercatat"]})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-3 text-sm font-bold text-slate-600",children:[e.jsxs("div",{className:"rounded-2xl bg-slate-50 px-4 py-3",children:["Hadir ",$.counts.Hadir]}),e.jsxs("div",{className:"rounded-2xl bg-slate-50 px-4 py-3",children:["Terlambat ",$.counts.Terlambat]}),e.jsxs("div",{className:"rounded-2xl bg-slate-50 px-4 py-3",children:["Sakit ",$.counts.Sakit]}),e.jsxs("div",{className:"rounded-2xl bg-slate-50 px-4 py-3",children:["Izin ",$.counts.Izin]}),e.jsxs("div",{className:"rounded-2xl bg-slate-50 px-4 py-3 col-span-2",children:["Alfa ",$.counts.Alfa]})]})]})]})}),d==="Catatan Siswa"&&e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsx("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Catatan Siswa"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Riwayat catatan dan tindak lanjut"}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-500",children:"Panel ini hanya memuat daftar catatan saat dibuka agar dashboard siswa tetap ringan."})]}),e.jsx("button",{onClick:()=>h("Dashboard"),className:"px-5 py-3 rounded-2xl bg-slate-100 text-slate-700 text-xs font-black uppercase tracking-widest",children:"Kembali ke Dashboard"})]})}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Timeline Catatan"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Riwayat catatan siswa"})]}),e.jsx("button",{onClick:()=>h("Dashboard"),className:"px-5 py-3 rounded-2xl bg-slate-100 text-slate-700 text-xs font-black uppercase tracking-widest",children:"Kembali ke Dashboard"})]}),e.jsx("div",{className:"mt-6 space-y-4",children:pe.length?pe.map(a=>e.jsx("div",{className:"rounded-[2rem] border border-slate-100 bg-slate-50 p-5",children:e.jsx("div",{className:"flex flex-col xl:flex-row xl:items-start xl:justify-between gap-4",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.jsx("span",{className:"px-3 py-1 rounded-full bg-indigo-100 text-indigo-700 text-[10px] font-black uppercase tracking-widest",children:a.badge}),e.jsx("span",{className:"px-3 py-1 rounded-full bg-slate-900 text-white text-[10px] font-black uppercase tracking-widest",children:a.processStatus})]}),e.jsx("p",{className:"mt-3 text-base font-black text-slate-800",children:a.title}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold uppercase tracking-widest text-slate-400",children:[a.date||"-"," • ",a.sourceRole.toUpperCase()," • ",a.sourceName]}),e.jsx("p",{className:"mt-3 text-sm font-medium text-slate-700 leading-relaxed whitespace-pre-wrap",children:a.note||"-"})]})})},a.id)):e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Belum ada catatan yang tersimpan untuk siswa ini."})})]})]}),d==="BIAYA PENDIDIKAN"&&e.jsx("div",{className:"space-y-6 animate-fade-in",children:e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Biaya Pendidikan"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Panel biaya pendidikan siswa"}),e.jsx("p",{className:"mt-2 text-sm font-medium text-slate-500",children:"Data keuangan hanya dibaca saat panel ini dibuka agar dashboard tetap hemat read."})]}),e.jsx("button",{onClick:ie,disabled:U,className:"px-5 py-3 rounded-2xl bg-indigo-600 text-white text-xs font-black uppercase tracking-widest disabled:opacity-50",children:U?"Memuat...":"Muat Ulang Data"})]}),e.jsxs("div",{className:"mt-5 grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"rounded-2xl bg-slate-50 border border-slate-100 px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"NISN"}),e.jsx("p",{className:"mt-1 text-sm font-black text-slate-800",children:s.nisn||s.id})]}),e.jsxs("div",{className:"rounded-2xl bg-slate-50 border border-slate-100 px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Terakhir Dicek"}),e.jsx("p",{className:"mt-1 text-sm font-black text-slate-800",children:ke||"-"})]}),e.jsxs("div",{className:"rounded-2xl bg-slate-900 text-white px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-300",children:"Total Tercatat"}),e.jsx("p",{className:"mt-1 text-sm font-black",children:de(T.total)})]})]}),e.jsxs("div",{className:"mt-6 space-y-4",children:[q?e.jsx("div",{className:"rounded-[1.75rem] border border-amber-200 bg-amber-50 px-5 py-4",children:e.jsx("p",{className:"text-sm font-bold text-amber-700",children:q})}):null,T.latest?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-[1.9rem] border border-slate-100 bg-slate-50 px-5 py-5",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-indigo-500",children:T.latest.month}),e.jsx("p",{className:"mt-2 text-sm font-black text-slate-800",children:T.latest.studentName}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold text-slate-400",children:["Kelas ",T.latest.className]}),e.jsxs("div",{className:"mt-5 grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-2xl bg-white border border-slate-200 px-4 py-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Biaya Pendidikan"}),e.jsx("p",{className:`mt-1 text-2xl font-black ${T.latest.status==="LUNAS"?"text-emerald-600":"text-indigo-600"}`,children:de(T.latest.amountDue||0)})]}),e.jsxs("div",{className:"rounded-2xl bg-white border border-slate-200 px-4 py-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Catatan"}),e.jsx("p",{className:"mt-1 text-sm font-medium text-slate-700 leading-relaxed",children:T.latest.note||"-"})]})]})]}),I.length>1&&e.jsxs("div",{className:"rounded-[1.9rem] border border-slate-100 bg-white px-5 py-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Riwayat Tagihan"}),e.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-300",children:[I.length," data"]})]}),e.jsx("div",{className:"mt-4 space-y-3",children:I.slice(1).map(a=>e.jsxs("div",{className:"rounded-2xl bg-slate-50 border border-slate-100 px-4 py-4 flex flex-col md:flex-row md:items-center md:justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-indigo-500",children:a.month}),e.jsx("p",{className:"mt-1 text-sm font-black text-slate-800",children:a.studentName}),e.jsxs("p",{className:"mt-1 text-[11px] font-bold text-slate-400",children:["Kelas ",a.className]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:`text-lg font-black ${a.status==="LUNAS"?"text-emerald-600":"text-indigo-600"}`,children:de(a.amountDue||0)}),e.jsx("p",{className:"mt-1 text-[11px] font-bold text-slate-400",children:a.note})]})]},a.id))})]})]}):!q&&!U?e.jsx("p",{className:"text-sm italic font-bold text-slate-400",children:"Panel biaya pendidikan belum memuat data. Gunakan tombol muat ulang bila diperlukan."}):null]})]})}),d==="Lapor Sarpras"&&e.jsx(Ge,{actor:{id:s.id,name:s.name,mode:"student",classInfo:c}}),d==="Nilai"&&e.jsx("div",{className:"space-y-6 animate-fade-in",children:f.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:f.map(a=>{const t=a.scores[s.id]||{},r=be(a.assessmentConfig),o=ge(t,a.assessmentConfig);return e.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl border border-slate-50 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-slate-50 rounded-full translate-x-10 -translate-y-10"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start mb-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-slate-800 leading-tight",children:a.subject}),e.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Rekap Nilai Akademik"})]}),e.jsxs("div",{className:`w-14 h-14 rounded-2xl flex flex-col items-center justify-center font-black shadow-lg ${o>=75?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[e.jsx("span",{className:"text-[8px] uppercase tracking-tighter opacity-70",children:"AVG"}),e.jsx("span",{className:"text-xl",children:o})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:r.map((l,i)=>{const p=fe(t,l),N=l.type==="psts"?"blue":l.type==="psas"||l.type==="psaf"?"green":"default";return e.jsxs("div",{className:`p-4 rounded-2xl text-center border transition-all ${N==="blue"?"bg-blue-50 border-blue-100":N==="green"?"bg-green-50 border-green-100":"bg-slate-50 border-slate-100"}`,children:[e.jsx("p",{className:`text-[9px] font-black uppercase tracking-widest mb-1 ${N==="blue"?"text-blue-400":N==="green"?"text-green-400":"text-slate-400"}`,children:l.title}),e.jsx("p",{className:"text-[10px] font-bold text-slate-500 min-h-[28px]",children:l.material||"Materi belum diisi"}),e.jsx("p",{className:`mt-2 text-lg font-black ${N==="blue"?"text-blue-700":N==="green"?"text-green-700":"text-slate-800"}`,children:typeof p=="number"&&p>0?p:"-"})]},i)})})]},a.id)})}):e.jsx("div",{className:"bg-white p-20 rounded-[4rem] shadow-xl border border-slate-50 text-center",children:e.jsx("p",{className:"font-black text-slate-400 italic",children:"Data nilai belum diunggah oleh guru mata pelajaran."})})}),d==="Data Orang Tua/Wali"&&e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsx("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Data Orang Tua/Wali"}),e.jsx("h3",{className:"mt-2 text-2xl font-black text-slate-800",children:"Lengkapi data orang tua atau wali siswa"})]}),e.jsx("button",{onClick:()=>h("Dashboard"),className:"px-5 py-3 rounded-2xl bg-slate-100 text-slate-700 text-xs font-black uppercase tracking-widest",children:"Kembali ke Dashboard"})]})}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-xl border border-slate-50 p-8",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-black uppercase tracking-widest text-slate-500 mb-2",children:"Nama Ayah"}),e.jsx("input",{value:C.fatherName,onChange:a=>H(t=>({...t,fatherName:a.target.value})),className:"w-full px-5 py-4 rounded-2xl bg-slate-50 border border-slate-100 focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all font-semibold",placeholder:"Masukkan nama ayah"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-black uppercase tracking-widest text-slate-500 mb-2",children:"Nama Ibu"}),e.jsx("input",{value:C.motherName,onChange:a=>H(t=>({...t,motherName:a.target.value})),className:"w-full px-5 py-4 rounded-2xl bg-slate-50 border border-slate-100 focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all font-semibold",placeholder:"Masukkan nama ibu"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-[11px] font-black uppercase tracking-widest text-slate-500 mb-2",children:"Alamat"}),e.jsx("textarea",{value:C.address,onChange:a=>H(t=>({...t,address:a.target.value})),className:"w-full px-5 py-4 rounded-2xl bg-slate-50 border border-slate-100 focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all font-semibold min-h-[120px]",placeholder:"Masukkan alamat orang tua / wali"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-black uppercase tracking-widest text-slate-500 mb-2",children:"Nomer HP Ayah"}),e.jsx("input",{value:C.fatherPhone,onChange:a=>H(t=>({...t,fatherPhone:a.target.value})),className:"w-full px-5 py-4 rounded-2xl bg-slate-50 border border-slate-100 focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all font-semibold",placeholder:"Masukkan nomer hp ayah"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-black uppercase tracking-widest text-slate-500 mb-2",children:"Nomer HP Ibu"}),e.jsx("input",{value:C.motherPhone,onChange:a=>H(t=>({...t,motherPhone:a.target.value})),className:"w-full px-5 py-4 rounded-2xl bg-slate-50 border border-slate-100 focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all font-semibold",placeholder:"Masukkan nomer hp ibu"})]})]}),e.jsx("div",{className:"mt-6 flex justify-end",children:e.jsx("button",{onClick:async()=>{ue(!0);try{await X(E(R,"student_parent_profiles",s.nisn||s.id),{studentId:s.id,studentName:s.name,nisn:s.nisn||"",classId:c.id,className:c.name,fatherName:C.fatherName.trim(),motherName:C.motherName.trim(),address:C.address.trim(),fatherPhone:C.fatherPhone.trim(),motherPhone:C.motherPhone.trim(),updatedAt:O()},{merge:!0}),alert("Data orang tua/wali berhasil disimpan")}catch(a){console.error(a),alert("Data orang tua/wali gagal disimpan")}finally{ue(!1)}},disabled:me,className:"px-6 py-4 rounded-2xl bg-slate-900 text-white text-xs font-black uppercase tracking-widest shadow-xl hover:bg-indigo-600 transition-all disabled:opacity-60",children:me?"Menyimpan...":"Simpan Data Orang Tua/Wali"})})]})]}),d==="Ganti Password"&&e.jsxs("div",{className:"bg-white p-12 rounded-[3.5rem] shadow-2xl border border-slate-50 max-w-md mx-auto animate-fade-in text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-indigo-50 text-indigo-600 rounded-[2rem] flex items-center justify-center mx-auto mb-8 shadow-inner",children:e.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),e.jsx("h3",{className:"text-2xl font-black mb-2 text-slate-800",children:"Keamanan Akun"}),e.jsx("p",{className:"text-sm text-slate-400 font-medium mb-8 leading-relaxed",children:"Ganti katasandi Anda secara berkala untuk menjaga keamanan data akademik Anda."}),e.jsx("input",{type:"password",placeholder:"Password Baru (min. 6 karakter)",value:_,onChange:a=>ee(a.target.value),className:"w-full px-8 py-5 rounded-[1.8rem] bg-slate-50 border border-slate-100 focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all font-bold mb-6 text-center text-xl tracking-widest placeholder:text-slate-300 placeholder:text-sm placeholder:tracking-normal"}),e.jsx("button",{onClick:async()=>{if(_.length<6){alert("Password minimal 6 karakter");return}await X(E(R,"student_auth",s.nisn||s.id),{passwordHash:_,mustChangePassword:!1,updatedAt:O()},{merge:!0}),alert("Password berhasil diubah"),ee(""),h("Dashboard")},className:"w-full bg-slate-900 text-white py-5 rounded-[1.8rem] font-black uppercase tracking-widest shadow-xl hover:bg-indigo-600 active:scale-95 transition-all",children:"PERBARUI PASSWORD"})]}),d==="Analisis"&&e.jsxs("div",{className:"space-y-8 animate-fade-in",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4 px-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-14 h-14 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shadow-xl",children:e.jsx("svg",{className:"w-7 h-7",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-black text-slate-800 leading-tight",children:"Rangkuman Naratif Siswa"}),e.jsx("p",{className:"text-slate-400 font-bold text-xs uppercase tracking-widest",children:"Dibuat otomatis dari data SELARAS"})]})]}),b&&e.jsxs("button",{onClick:Se,className:"bg-slate-900 text-white px-8 py-3 rounded-2xl font-black text-xs uppercase tracking-widest flex items-center gap-3 shadow-xl hover:bg-indigo-600 transition-all",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Cetak PDF"]})]}),b?e.jsxs("div",{className:"bg-white p-10 md:p-16 rounded-[4rem] shadow-2xl border border-slate-100 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-full h-2 bg-gradient-to-r from-indigo-500 via-blue-500 to-indigo-600"}),e.jsx("div",{className:"max-w-3xl mx-auto",children:e.jsx(We,{text:b})}),e.jsxs("div",{className:"mt-16 pt-8 border-t border-slate-50 flex justify-between items-center text-[10px] font-black text-slate-300 uppercase tracking-widest",children:[e.jsx("span",{children:"Sistem SELARAS v2.5"}),e.jsxs("span",{children:["© ",new Date().getFullYear()," SMA KP BALEENDAH"]})]})]}):e.jsxs("div",{className:"bg-white p-20 rounded-[4rem] shadow-xl border border-slate-50 text-center space-y-4",children:[e.jsx("div",{className:"w-20 h-20 bg-slate-50 rounded-full flex items-center justify-center mx-auto text-slate-200",children:e.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})}),e.jsx("p",{className:"font-black text-slate-400 italic",children:"Belum ada analisis terbaru untuk ditampilkan."}),e.jsx("button",{onClick:()=>h("Dashboard"),className:"px-8 py-3 bg-indigo-600 text-white rounded-2xl font-black text-xs uppercase tracking-widest shadow-lg",children:"Kembali Ke Dashboard"})]})]})]})},_e=({student:s,onSuccess:c})=>{const[m,d]=n.useState(""),[h,g]=n.useState(""),[u,f]=n.useState(!1),[K,b]=n.useState(null),Z=async()=>{if(m.length<6){b("Password minimal 6 karakter");return}if(m!==h){b("Konfirmasi password tidak cocok");return}f(!0),b(null);try{await X(E(R,"student_auth",s.id),{passwordHash:m,mustChangePassword:!1,updatedAt:O(),createdAt:O()},{merge:!0}),c()}catch{b("Gagal menyimpan password")}finally{f(!1)}};return e.jsx("div",{className:"max-w-md mx-auto mt-16 px-4",children:e.jsxs("div",{className:"bg-white p-8 rounded-3xl shadow-xl space-y-6",children:[e.jsx("h2",{className:"text-xl font-black text-center",children:"Ganti Password"}),e.jsxs("p",{className:"text-sm text-slate-500 text-center",children:["Halo ",s.name,", silakan buat password baru"]}),e.jsx("input",{type:"password",placeholder:"Password baru",value:m,onChange:A=>d(A.target.value),className:"w-full px-5 py-4 rounded-xl border font-bold"}),e.jsx("input",{type:"password",placeholder:"Konfirmasi password",value:h,onChange:A=>g(A.target.value),className:"w-full px-5 py-4 rounded-xl border font-bold"}),K&&e.jsx("div",{className:"text-red-600 text-xs font-bold text-center",children:K}),e.jsx("button",{onClick:Z,disabled:u,className:"w-full bg-indigo-600 text-white py-4 rounded-xl font-black uppercase tracking-widest",children:"SIMPAN PASSWORD"})]})})},ta=({embeddedUser:s=null,onLogin:c})=>{const[m,d]=n.useState(s?s.mustChangePassword?"change-password":"dashboard":"login"),[h,g]=n.useState(s);return n.useEffect(()=>{s&&(g(s),d(s.mustChangePassword?"change-password":"dashboard"))},[s]),m==="login"?e.jsx(ze,{onLogin:u=>{g(u),c==null||c(u),u.mustChangePassword===!0?d("change-password"):d("dashboard")}}):m==="change-password"?e.jsx(_e,{student:h.student,onSuccess:()=>{const u={...h,mustChangePassword:!1};g(u),c==null||c(u),d("dashboard")}}):e.jsx(Oe,{student:h.student,classInfo:h.classInfo,onLogout:()=>{g(null),d("login"),typeof window<"u"&&localStorage.removeItem("selaras_auth")}})};export{ta as default};
Save
🧪 PHP Preview
<?php echo 'hello'; ?>
Run PHP
🖥 Linux CMD
Run CMD