PageSourceSearch

https://effervescent-cupcake-210607.netlify.app/assets/FamilyPortalRouter-CXOB0vQt.js

js effervescent-cupcake-210607.netlify.app collected 2026-10-03 10:41:08 UTC 49,684 bytes, 24 lines download raw bytes

1import{j as e,r as n,s as p}from"./index-bMFZPluE.js";import{F as at}from"./familyReceiptPolicy-egdKJ3_6.js";import{C as st}from"./ContractModal-D4DUQDZS.js";import{A as rt}from"./AcademyRulesContent-CQsXNIN7.js";import{g as nt,a as lt,b as ke,c as it,d as ct,e as ot,f as dt,h as ve}from"./studentProfileSummary-D5cIUZpH.js";import{e as K,a as ee,s as xt,p as mt,g as pt,b as bt,c as ut,f as te,d as gt,h as _e,i as ht,j as ft}from"./academicTracking-DV-rV9tC.js";import{b as Ae,F as ae,r as jt}from"./familyAgreement-Bm5j7ljB.js";import"./educationCatalog-pqwMnMBs.js";import"./pricingEngine-DmHUGCKM.js";const wt="34958891092",yt=({onBack:i})=>{const y=()=>{const u=["Hola, escribo desde el Portal de Familias de Profe en Casa.","","Quiero consultar el recibo y la forma de pago de este mes."].join(`
2`);window.open(`https://wa.me/${wt}?text=${encodeURIComponent(u)}`,"_blank","noopener,noreferrer")};return e.jsx("div",{className:"min-h-screen overflow-y-auto bg-[#F5F7FA] p-4 pb-24 text-left",children:e.jsxs("div",{className:"mx-auto max-w-md space-y-6",children:[e.jsx("button",{type:"button",onClick:i,className:"mb-2 flex items-center gap-2 text-[10px] font-black uppercase text-gray-400 transition-colors hover:text-[#16A0EB]",children:"← Volver a inicio"}),e.jsxs("header",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-black uppercase tracking-widest text-[#16A0EB]",children:"Tu cuenta"}),e.jsx("h1",{className:"text-3xl font-black leading-tight text-gray-900",children:"Recibos y pagos"})]}),e.jsxs("section",{className:"overflow-hidden rounded-[32px] border border-blue-100 bg-white shadow-xl",children:[e.jsxs("div",{className:"bg-gradient-to-br from-[#16A0EB] to-[#1264A3] p-6 text-white",children:[e.jsx("p",{className:"mb-2 text-[10px] font-black uppercase tracking-widest text-blue-100",children:"Información oficial del mes"}),e.jsx("h2",{className:"text-2xl font-black leading-tight",children:"Comprueba siempre el recibo enviado por Dirección"})]}),e.jsxs("div",{className:"space-y-5 p-6",children:[e.jsxs("p",{className:"text-sm font-semibold leading-relaxed text-slate-700",children:["El día ",at," de cada mes recibirás por WhatsApp y correo electrónico un recibo con las sesiones previstas, el importe y la forma de pago vigente."]}),e.jsxs("div",{className:"rounded-2xl border border-orange-200 bg-orange-50 p-4",children:[e.jsx("p",{className:"mb-1 text-[10px] font-black uppercase tracking-widest text-orange-700",children:"Importante"}),e.jsx("p",{className:"text-sm font-bold leading-relaxed text-orange-950",children:"Por ahora no se realizan pagos dentro de la app. No utilices enlaces, números de Bizum o cuentas bancarias que no aparezcan en el recibo oficial del mes."})]}),e.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-4 text-sm leading-relaxed text-slate-700",children:"El pago se realiza al comenzar el mes, durante la primera semana. Si tienes cualquier duda, consúltala antes de realizarlo."}),e.jsx("button",{type:"button",onClick:y,className:"w-full rounded-2xl bg-[#16A0EB] py-4 text-xs font-black uppercase tracking-widest text-white shadow-lg transition-colors hover:bg-[#1264A3]",children:"Consultar por WhatsApp"}),e.jsx("p",{className:"text-center text-[10px] font-bold leading-relaxed text-gray-400",children:"WhatsApp de atención: 958 89 10 92. Abrir el botón no realiza ningún pago ni envía el mensaje automáticamente."})]})]})]})})},Ce="34958891092",Nt=({previewStudentEmail:i,onBackToAdmin:y,linkedStudentIds:u,familyDisplayName:B})=>{var he,fe,je,we,ye;const V=new URLSearchParams(window.location.search),F=V.get("agreement")==="1",P=V.get("student"),[a,W]=n.useState(null),[H,Q]=n.useState([]),[D,se]=n.useState(null),[x,re]=n.useState(null),[J,ne]=n.useState([]),[N,le]=n.useState([]),[Y,Z]=n.useState(!0),[Se,ie]=n.useState(""),[Ee,Fe]=n.useState({}),[Pe,T]=n.useState(!1),[De,k]=n.useState(!1),[ce,oe]=n.useState(!1),[de,Te]=n.useState(""),[$,R]=n.useState("home"),[$e,M]=n.useState(!1),[Re,I]=n.useState(!1),[z,G]=n.useState(!1),[b,h]=n.useState(K),[m,f]=n.useState(ee),[xe,me]=n.useState(1),pe=t=>(t||"").trim().toLowerCase(),L=t=>{const s=pe(t);return s?Ee[s]||s.split("@")[0]:"Sin asignar"};n.useEffect(()=>{(async()=>{var s;try{Z(!0);let r="";if(i)r=i.trim(),ie(`[MODO ESPIA] ${r}`);else{const{data:d}=await p.auth.getUser(),X=(s=d.user)==null?void 0:s.email;if(!X){console.error("No hay usuario logueado"),Z(!1);return}r=X,ie(X)}
2const o=p.from("students").select("*").is("archived_at",null),{data:c}=await(u?o.in("student_id",u):o.or(`email.ilike.${r},parent_email.ilike.${r}`)).order("name",{ascending:!0}),{data:S}=await p.from("teachers").select("email, name");if(S&&Fe(Object.fromEntries(S.filter(d=>d.email).map(d=>[pe(d.email),d.name||d.email]))),!c||c.length===0){Q([]),W(null),re(null),ne([]),le([]),i&&console.warn(`Modo espia: no encontramos alumnos para ${r}`);return}Q(c);const q=P?c.find(d=>d.student_id===P):null,w=c.find(d=>d.student_id===D)||q||c[0];(!D||!c.some(d=>d.student_id===D))&&se(w.student_id),W(w);const E=w.name,U=new Date().toISOString().split("T")[0],{data:Ne}=await p.from("classes").select("*").ilike("student_name",`%${E}%`).eq("status","Pendiente").gte("class_date",U).is("deleted_at",null).order("class_date",{ascending:!0}).order("start_time",{ascending:!0}).limit(32);ne(Ne||[]),re((Ne||[])[0]||null);const{data:tt}=await p.from("classes").select("*").ilike("student_name",`%${E}%`).in("status",["Completada","Cancelada"]).is("deleted_at",null).order("class_date",{ascending:!1});le(tt||[])}catch(r){console.error("Error:",r)}finally{Z(!1)}})()},[$,i,P,D,u==null?void 0:u.join("|")]),n.useEffect(()=>{if(!F||ce||Y||!a)return;if(a.contract_signed){T(!0),oe(!0);return}Ae(a,J).readyToSign&&ae&&(k(!0),oe(!0))},[F,ce,Y,a,J]);const Me=t=>{if(!t)return{attitude:null,understanding:null,text:"Sin comentarios del profesor."};const s=t.match(/Actitud y Trabajo: ([⭐☆]+)/),r=t.match(/Comprensión: ([⭐☆]+)/);let o=t.replace(/\[📍 GPS: .*?\] /g,"").replace(/\[⚠️ Fichaje sin GPS\] /g,"").replace(/\n📊 REPORTE ACADÉMICO:[\s\S]*?Comprensión: [⭐☆]+\n/g,"").replace(/\n📝 NOTAS DEL PROFESOR:\n/g,"");return{attitude:s?s[1]:null,understanding:r?r[1]:null,text:o.trim()}},be=async()=>{if(i&&y){y();return}await p.auth.signOut(),window.location.href="/"},Ie=t=>{if(!t||!t.signature_data)return null;
2try{const s=typeof t.signature_data=="string"?JSON.parse(t.signature_data):t.signature_data;return s.image||s.signatureMethod||s.schemaVersion||s.agreementText?s:{image:t.signature_data,date:"Fecha no disponible",legacy:!0}}catch{return{image:t.signature_data,date:"Fecha no disponible",legacy:!0}}},ze=()=>{var r;const t=document.getElementById("printable-family-contract");if(!t)return;const s=window.open("","_blank");s?(s.document.write(`
3              <html>
4                  <head>
5                      <title>Acuerdo_Academia_${(r=a==null?void 0:a.name)==null?void 0:r.replace(/\s+/g,"_")}</title>
6                      <script src="https://cdn.tailwindcss.com"><\/script>
7                      <style>
8                          @page { margin: 20mm; }
9                          body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
10                      </style>
11                  </head>
12                  <body class="bg-white text-black font-sans p-8 max-w-4xl mx-auto">
13                      ${t.innerHTML}
14                  </body>
15              </html>
16          `),s.document.close(),s.focus(),setTimeout(()=>{s.print(),s.close()},1e3)):alert("⚠️ Por favor, permite las ventanas emergentes (pop-ups) en tu navegador para generar el PDF.")},Ge=()=>{const t=`¡Hola Coordinación! 👋
17
18Soy el padre/madre de *${a==null?void 0:a.name}*.
19Tenemos ${a==null?void 0:a.extra_classes_balance} bonos disponibles y me gustaría canjear *${xe} bono(s)* para programar clases extra.
20
21¿Me decís qué huecos tiene el profesor libre? ¡Gracias! 📅`;window.open(`https://wa.me/${Ce}?text=${encodeURIComponent(t)}`,"_blank")},j=xt(mt(a==null?void 0:a.upcoming_exams)),v=pt(j),ue=new Set(v.map(t=>t.id)),_=v[0]||null,A=bt(ut(a==null?void 0:a.term_grades)),Le=nt(a)||"Pendiente",Oe=lt(a)||"Pendiente",qe=ke(a)||"Nivel pendiente",Ue=it(a)||"Pendiente de concretar",Be=ct(a)||"Pendiente de concretar",Ve=ot(a)||"Pendiente de concretar",We=dt(a)||"Pendiente de concretar",He=ve(a)!==null?String(ve(a)):"Pendiente de concretar",C=t=>{W(t),Q(s=>s.map(r=>r.student_id===t.student_id?t:r))},ge=async(t,s)=>{a!=null&&a.name&&await p.from("parent_logs").insert([{student_name:a.name,contact_date:new Date().toISOString().slice(0,10),topic:t,notes:s}])},Qe=async()=>{if(!(a!=null&&a.student_id))return;if(!b.subject.trim()||!b.exam_date){alert("Rellena al menos asignatura y fecha del examen.");return}G(!0);const t=[...j,ht(b,"family")],s={...a,upcoming_exams:t},{error:r}=await p.from("students").update({upcoming_exams:t}).eq("student_id",a.student_id);if(G(!1),r){alert(`No se pudo guardar el examen: ${r.message}`);return}C(s),h(K),M(!1),await ge("🗓️ EXAMEN ACTUALIZADO",`La familia ha registrado un examen de ${b.subject.trim()} para ${te(b.exam_date)}.`)},Je=async()=>{if(!(a!=null&&a.student_id))return;if(!m.subject.trim()||!m.grade.trim()||!m.term.trim()){alert("Rellena trimestre, asignatura y nota antes de guardar.");return}G(!0);const t=[...A,ft(m,"family")],s={...a,term_grades:t},{error:r}=await p.from("students").update({term_grades:t}).eq("student_id",a.student_id);if(G(!1),r){alert(`No se pudo guardar la nota: ${r.message}`);return}C(s),f(ee),I(!1),await ge("📘 NOTA ACTUALIZADA",`La familia ha registrado una nota de ${m.grade.trim()} en ${m.subject.trim()} (${m.term.trim()}).`)},Ye=async t=>{if(!(a!=null&&a.student_id))return;const s=j.filter(c=>c.id!==t),r={...a,upcoming_exams:s},{error:o}=await p.from("students").update({upcoming_exams:s}).eq("student_id",a.student_id);if(o){alert(`No se pudo borrar el examen: ${o.message}`);return}C(r)},Ze=async t=>{if(!(a!=null&&a.student_id))return;const s=A.filter(c=>c.id!==t),r={...a,term_grades:s},{error:o}=await p.from("students").update({term_grades:s}).eq("student_id",a.student_id);if(o){alert(`No se pudo borrar la nota: ${o.message}`);return}C(r)},Xe=()=>{const t=`¡Hola! Si buscas clases de apoyo, puedes consultar a *Profe en Casa*.
22
23Web: https://profe-en-casa.com/
24WhatsApp de atención: https://wa.me/${Ce}`;window.open(`https://wa.me/?text=${encodeURIComponent(t)}`,"_blank")},Ke=N.length>0&&(((he=N[0].monitor_notes)==null?void 0:he.includes("Actitud y Trabajo: ⭐⭐⭐⭐⭐"))||((fe=N[0].monitor_notes)==null?void 0:fe.includes("Comprensión: ⭐⭐⭐⭐⭐")));if(Y)return e.jsx("div",{className:"min-h-screen bg-[#F5F7FA] flex items-center justify-center w-full h-full",children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-10 h-10 border-4 border-[#1c74e9] border-t-transparent roun
24ded-full animate-spin mb-4"}),e.jsx("p",{className:"text-[#1c74e9] font-black uppercase tracking-widest text-xs",children:"Cargando Portal..."})]})});if(!a)return e.jsx("div",{className:"min-h-screen bg-[#F5F7FA] flex flex-col items-center justify-center p-6 text-center w-full h-full",children:e.jsxs("div",{className:"bg-white p-8 rounded-[32px] shadow-xl max-w-sm w-full border border-gray-100",children:[e.jsx("span",{className:"text-5xl block mb-4",children:"🕵️‍♂️"}),e.jsx("h2",{className:"text-xl font-black text-gray-900 mb-2",children:"Ficha no encontrada"}),e.jsxs("p",{className:"text-sm text-gray-500 mb-6",children:["Buscando a ",e.jsx("strong",{children:Se}),", pero no encontramos ningún alumno matriculado con este correo exacto."]}),e.jsx("button",{onClick:be,className:"w-full bg-[#1c74e9] text-white py-4 rounded-2xl font-black uppercase text-xs tracking-widest shadow-lg shadow-blue-500/30 active:scale-95 transition-transform",children:i?"Volver al Admin":"Cerrar Sesión e intentar de nuevo"})]})});const O=a.extra_classes_balance||0,l=Ie(a),g=Ae(a,J),et=(l==null?void 0:l.agreementDetails)||g;return e.jsxs("div",{className:"w-full h-full overflow-y-auto",children:[De&&a&&!a.contract_signed&&e.jsx(st,{studentId:a.student_id,studentName:a.name,agreementDetails:g,previewOnly:!!i,onClose:()=>k(!1),onSuccess:t=>{C({...a,contract_signed:!0,signature_data:t}),k(!1),Te("Acuerdo firmado y guardado. Podéis volver a leerlo siempre desde el Portal de Familias.")}}),i&&e.jsx("div",{className:"bg-red-500 text-white text-center py-2 font-black text-[10px] uppercase tracking-widest sticky top-0 z-[10000] shadow-md w-full",children:"👁️ MODO ESPÍA ACTIVADO: Estás viendo lo que ve la familia"}),de&&e.jsx("div",{className:"sticky top-0 z-[9998] mx-auto max-w-md border-b border-emerald-200 bg-emerald-50 px-5 py-3 text-center text-xs font-bold text-emerald-800",children:de}),Pe&&a.contract_signed&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/90 backdrop-blur-md z-[9999] flex flex-col justify-end sm:justify-center items-center p-0 sm:p-4 animate-in fade-in",children:e.jsxs("div",{className:"bg-white w-full max-w-lg h-[90vh] sm:h-auto sm:max-h-[90vh] sm:rounded-[40px] rounded-t-[40px] shadow-2xl flex flex-col overflow-hidden relative",children:[e.jsx("button",{onClick:()=>T(!1),className:"absolute top-4 right-4 bg-white/20 text-white hover:bg-white/40 w-8 h-8 rounded-full font-black text-xs z-20 transition-colors",children:"✕"}),e.jsxs("div",{className:"bg-gradient-to-br from-[#1c74e9] to-blue-800 p-6 sm:p-8 text-center text-white shrink-0 relative",children:[e.jsx("div",{className:"w-16 h-16 bg-white/20 rounded-2xl mx-auto flex items-center justify-center text-sm font-black mb-4 shadow-inner border border-white/20",children:"PEC"}),e.jsx("h2",{className:"font-black text-2xl tracking-tight leading-none mb-1",children:"Acuerdo guardado"}),e.jsxs("p",{className:"text-blue-200 text-xs font-bold uppercase tracking-widest",children:["Alumno: ",a.name]})]}),e.jsxs("div",{className:"p-6 overflow-y-auto flex-1 bg-gray-50 text-xs text-gray-600 leading-relaxed space-y-4",id:"printable-family-contract",children:[e.jsx(rt,{details:et,savedAgreement:jt(a.signature_data)}),e.jsxs("div",{className:"border-t-2 border-gray-200 pt-6 mt-6",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-gray-500 mb-4 text-center",children:"Confirmación guardada"}),e.jsx("div",{className:"w-full max-w-[250px] mx-auto border-b border-gray-300 pb-2 mb-4",children:l!=null&&l.image?e.jsx("img",{src:l.image,alt:"Firma Tutor",className:"w-full h-auto object-contain max-h-[100px] filter contrast-125"}):e.jsx("div",{className:"flex h-[80px] items-center justify-center text-center text-[10px] font-bold uppercase tracking-widest text-gray-400",children:(l==null?void 0:l.signatureMethod)==="paper"?"Firmado en papel. Copia guardada por Profe en Casa.":"Firma registrada correctamente"})}),e.jsxs("div",{className:"text-center text-[9px] text-gray-600 bg-gray-50 p-3 rounded-lg border border-gray-100 space-y-1",children:[e.jsxs("p",{children:["Forma de firma: ",e.jsx("strong",{className:"text-gray-800",children:(l==null?void 0:l.signatureMethod)==="paper"?"En papel":"Online desde la app"})]}),e.jsxs("p",{children:["Confirmado por: ",e.jsx("strong",{className:"text-gray-800",children:(l==null?void 0:l.signerName)||"Firma anterior sin nombre guardado"})]}),e.jsxs("p",{children:["Relación: ",e.jsx("strong",{className:"text-gray-800",children:(l==null?void 0:l.signerRole)||"Firma anterior sin este dato"})]}),e.jsxs("p",{children:["Fecha: ",e.jsx("strong",{className:"text-gray-800",children:(l==null?void 0:l.date)||"Fecha no disponible"})]}),e.jsxs("p",{children:["Versión: ",e.jsx("strong",{className:"text-gray-800",children:(l==null?void 0:l.agreementVersion)||"Acuerdo anterior"})]})]})]})]}),e.jsxs("div",{className:"p-6 bg-white border-t border-gray-100 shrink-0 text-center flex gap-3",children:[e.jsx("button",{onClick:()=>T(!1),className:"flex-1 bg-gray-100 text-gray-900 font-black uppercase text-[10px] tracking-widest py-4 rounded-2xl hover:bg-gray-200 active:scale-95 transition-all",children:"Cerrar"}),e.jsx("button",{onClick:ze,className:"flex-[2] bg-[#1c74e9] text-white font-black uppercase text-[10px] tracking-widest py-4 rounded-2xl shadow-lg shadow-blue-500/30 active:scale-95 transition-all flex items-center justify-center gap-2",children:"Imprimir copia"})]})]})}),$==="payments"&&e.jsx(yt,{onBack:()=>R("home"),previewEmail:i}),$==="history"&&e.jsx("div",{className:"min-h-screen bg-[#F5F7FA] p-4 font-sans pb-20 text-left",children:e.jsxs("div",{className:"max-w-md mx-auto",children:[e.jsx("button",{onClick:()=>R("home"),className:"mb-6 text-xs font-black text-gray-400 uppercase tracking-widest hover:text-[#1c74e9] transition-colors flex items-center gap-2",children:"← Volver al Portal"}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-black text-gray-900 leading-tight",children:"Muro Académico"}),e.jsxs("p",{className:"text-[#1c74e9] font-bold text-sm mt-1",children:["El progreso de ",a==null?void 0:a.name]})]}),Ke&&e.jsxs("div",{className:"mb-8 bg-gradient-to-r from-yellow-400 to-yellow-500 p-6 rounded-[32px] shadow-lg shadow-yellow-500/30 relative overflow-hidden animate-in slide-in-from-top-4",children:[e.jsx("div",{className:"absolute -right-4 -top-4 text-7xl opacity-20 rotate-12",children:"⭐"}),e.jsx("h3",{className:"text-white font-black text-xl mb-2 relative z-10",children:"¡Menuda semana! 🎉"}),e.jsxs("p",{className:"text-yellow-50 text-sm font-medium mb-4 relative z-10",children:["El profesor de ",a==null?void 0:a.name," nos acaba de contar que ha tenido una clase de ",e.jsx("strong",{children:"5 estrellas"}),". Nos hace muchísima ilusión ver este progreso. ",e.jsx("br",{}),e.jsx("br",{}),"¿Nos ayudarías dejándonos una reseña rápida en Google? Tardas 10 segundos y nos ayudas un montón."]}),e.jsx("a",{href:"https://g.page/Profe-en-Casa/review?nr",target:"_blank",rel:"noopener noreferrer",className:"block text-center w-full bg-white text-yellow-600 font-black text-xs uppercase tracking-widest py-3.5 rounded-xl shadow-md active:scale-95 transition-transform relative z-10",children:"⭐ Dejar 5 Estrellas"})]}),e.jsx("div",{className:"space-y-6",children:N.length===0?e.jsxs("div",{className:"text-center py-10 bg-white rounded-[32px] border border-gray-100 shadow-sm",children:[e.jsx("span",{className:"text-4xl block mb-3",children:"🌱"}),e.jsx("p",{className:"text-gray-900 font-bold text-lg",children:"Aún no hay reportes"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"Aquí aparecerán las valoraciones de los profesores tras cada clase."})]}):N.map((t,s)=>{var S,q,w,E;const r=t.status==="Cancelada",o=(S=t.monitor_notes)==null?void 0:S.includes("FALTA INJUSTIFICADA"),c=Me(t.monitor_notes);return e.jsxs("div",{className:`bg-white p-6 rounded-[32px] shadow-[0_4px_20px_rgba(0,0,0,0.03)] border relative overflow-hidden transition-all ${r?"border-gray-200":o?"border-orange-200":"border-blue-100 hover:shadow-lg"}`,children:[e.jsx("div",{className:`absolute left-0 top-0 bottom-0 w-1.5 ${r?"bg-gray-300":o?"bg-orange-400":"bg-[#1c74e9]"}`}),e.jsxs("div",{className:"flex justify-between items-start border-b border-gray-50 pb-4 mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-black text-gray-900 text-lg leading-tight",children:t.subject}),e.jsxs("p",{className:"text-[10px] text-gray-400 font-black uppercase tracking-widest mt-1",children:["Profesor de esta clase: ",L(t.monitor_email)]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:`inline-block px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest mb-1 ${r?"bg-gray-100 text-gray-500":o?"bg-orange-100 text-orange-600":"bg-green-100 text-green-600"}`,children:r?"Falta Just.":o?"Falta Inj.":"Completada"}),e.jsxs("p",{className:"text-[10px] text-gray-500 font-bold",children:[new Date(t.class_date).toLocaleDateString("es-ES",{day:"numeric",month:"short"})," • ",(q=t.start_time)==null?void 0:q.substring(0,5)]})]})]}),r?e.jsxs("div",{className:"bg-gray-50 p-4 rounded-2xl flex items-center gap-3",children:[e.jsx("span",{className:"text-2xl opacity-50",children:"🩺"}),e.jsx("p",{className:"text-sm text-gray-500 font-medium italic",children:"Clase cancelada por falta justificada. Podrá ser recuperada."})]}):o?e.jsxs("div",{className:"bg-orange-50 p-4 rounded-2xl border border-orange-100",children:[e.jsx("p",{className:"text-orange-800 text-sm font-bold mb-1",children:"⚠️ El alumno no asistió"}),e.jsx("p",{className:"text-xs text-orange-600",children:"Al no haber aviso previo, esta sesión generará cobro. Contacte con coordinación para dudas."})]}):e.jsxs("div",{className:"space-y-4",children:[c.attitude&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-blue-50/50 p-3 rounded-2xl border border-blue-50/50",children:[e.jsx("p",{className:"text-[9px] text-gray-400 font-black uppercase tracking-widest mb-1",children:"Actitud"}),e.jsx("p",{className:"text-lg tracking-widest",children:c.attitude})]}),e.jsxs("div",{className:"bg-blue-50/50 p-3 rounded-2xl border border-blue-50/50",children:[e.jsx("p",{className:"text-[9px] text-gray-400 font-black uppercase tracking-widest mb-1",children:"Comprensión"}),e.jsx("p",{className:"text-lg tracking-widest",children:c.understanding})]})]}),(((w=c.attitude)==null?void 0:w.includes("⭐⭐⭐⭐⭐"))||((E=c.understanding)==null?void 0:E.includes("⭐⭐⭐⭐⭐")))&&e.jsxs("button",{onClick:()=>{const U=`¡Mi hijo/a la está rompiendo en las clases de ${t.subject} con Profe en Casa! ⭐⭐⭐⭐⭐ ¡Súper orgullos@! 🚀`;navigator.share?navigator.share({title:"¡Súper Logro!",text:U}).catch(console.error):window.open(`https://wa.me/?text=${encodeURIComponent(U)}`,"_blank")},className:"w-full bg-gradient-to-r from-pink-500 to-purple-600 text-white font-black text-[10px] uppercase tracking-widest py-3 rounded-xl shadow-md shadow-pink-500/30 active:scale-95 transition-transform flex items-center justify-center gap-2",children:[e.jsx("span",{children:"📸"})," Presumir en Redes"]}
24)]}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-2xl relative",children:[e.jsx("span",{className:"absolute -top-2 left-4 bg-white px-2 text-[9px] text-gray-400 font-black uppercase tracking-widest border border-gray-100 rounded-full shadow-sm",children:"Reporte del Profesor"}),e.jsxs("p",{className:"text-sm text-gray-700 font-medium leading-relaxed mt-1",children:['"',c.text,'"']})]})]})]},s)})})]})}),$==="home"&&e.jsx("div",{className:"min-h-screen bg-[#F5F7FA] p-4 font-sans pb-20 text-left",children:e.jsxs("div",{className:"max-w-md mx-auto space-y-6",children:[e.jsxs("header",{className:"flex justify-between items-center py-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest mb-1",children:"Portal de Familias"}),e.jsx("h1",{className:"text-2xl font-black text-gray-900 leading-none",children:B||(a==null?void 0:a.name)}),B&&e.jsxs("p",{className:"text-sm text-gray-500 mt-2",children:["Seguimiento de ",a==null?void 0:a.name]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:be,className:`${i?"bg-orange-100 text-orange-600":"bg-red-50 text-red-500"} hover:bg-gray-200 p-3 rounded-2xl transition-colors shadow-sm active:scale-95 flex items-center justify-center`,title:i?"Salir del Modo Espía":"Cerrar Sesión",children:i?"🕵️‍♂️":"👋"}),e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#1c74e9] to-blue-800 flex items-center justify-center text-white text-xl font-bold shadow-lg shadow-blue-500/30 ring-4 ring-white shrink-0",children:(je=a==null?void 0:a.name)==null?void 0:je.charAt(0)})]})]}),H.length>1&&e.jsxs("section",{className:"bg-white rounded-[28px] border border-gray-100 shadow-sm p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest mb-1",children:"Familia vinculada"}),e.jsx("h2",{className:"text-lg font-black text-gray-900",children:"Selecciona al alumno"})]}),e.jsxs("span",{className:"bg-blue-50 text-[#1c74e9] text-[10px] font-black uppercase tracking-widest px-3 py-1 rounded-full",children:[H.length," hijos"]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:H.map(t=>{const s=t.student_id===(a==null?void 0:a.student_id);return e.jsx("button",{onClick:()=>se(t.student_id),className:`w-full text-left rounded-2xl border px-4 py-3 transition-all ${s?"border-[#1c74e9] bg-blue-50 shadow-sm":"border-gray-100 bg-gray-50 hover:bg-white hover:border-gray-200"}`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:`font-black ${s?"text-[#1c74e9]":"text-gray-900"}`,children:t.name}),e.jsx("p",{className:"text-[10px] text-gray-400 font-black uppercase tracking-widest mt-1",children:ke(t)||"Nivel pendiente"})]}),e.jsx("span",{className:`text-[10px] font-black uppercase tracking-widest px-3 py-1 rounded-full ${s?"bg-[#1c74e9] text-white":"bg-white text-gray-500 border border-gray-200"}`,children:s?"Activo":"Ver ficha"})]})},t.student_id)})})]}),e.jsx("section",{className:"bg-white rounded-[28px] border border-gray-100 shadow-sm p-4",children:e.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[e.jsxs("div",{className:"bg-blue-50 border border-blue-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[9px] text-blue-500 font-black uppercase tracking-widest mb-1",children:"Tutor Académico"}),e.jsx("p",{className:"text-gray-900 font-black text-base",children:L((a==null?void 0:a.tutor_email)||(a==null?void 0:a.monitor_email))}),e.jsxs("p",{className:"text-[10px] text-gray-500 font-bold mt-2 leading-relaxed",children:["Es la persona de referencia para el seguimiento de ",a==null?void 0:a.name,", aunque luego una clase concreta pueda darla otro profesor desde Agenda Centro."]})]}),e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[9px] text-indigo-500 font-black uppercase tracking-widest mb-1",children:"Profesor de la próxima clase"}),e.jsx("p",{className:"text-gray-900 font-black text-base",children:x?L(x.monitor_email):"Pendiente de agenda"}),e.jsx("p",{className:"text-[10px] text-gray-500 font-bold mt-2 leading-relaxed",children:"Este dato sale directamente de la clase o grupo activo programado en la agenda."})]})]})}),e.jsxs("section",{className:"bg-white rounded-[28px] border border-gray-100 shadow-sm p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest mb-1",children:"Perfil de la familia"}),e.jsx("h2",{className:"text-lg font-black text-gray-900",children:"Resumen de ficha"})]}),e.jsx("span",{className:"bg-blue-50 text-[#1c74e9] text-[10px] font-black uppercase tracking-widest px-3 py-1 rounded-full",children:"Datos base"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-gray-50 border border-gray-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[9px] text-gray-400 font-black uppercase tracking-widest mb-1",children:"Tutor / familia"}),e.jsx("p",{className:"text-sm font-black text-gray-900 leading-relaxed",children:Le})]}),e.jsxs("div",{className:"bg-gray-50 border border-gray-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[9px] text-gray-400 font-black uppercase tracking-widest mb-1",children:"Email"}),e.jsx("p",{className:"text-sm font-black text-gray-900 leading-relaxed break-all",children:Oe})]}),e.jsxs("div",{className:"bg-blue-50 border border-blue-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[9px] text-blue-500 font-black uppercase tracking-widest mb-1",children:"Curso / nivel"}),e.jsx("p",{className:"text-sm font-black text-gray-900 leading-relaxed",children:qe})]}),e.jsxs("div",{className:"bg-purple-50 border border-purple-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[9px] text-purple-500 font-black uppercase tracking-widest mb-1",children:"Modalidad"}),e.jsx("p",{className:"text-sm font-black text-gray-900 leading-relaxed",children:Ve})]}),e.jsxs("div",{className:"bg-rose-50 border border-rose-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[9px] text-rose-500 font-black uppercase tracking-widest mb-1",children:"Nacimiento"}),e.jsx("p",{className:"text-sm font-black text-gray-900 leading-relaxed",children:We})]}),e.jsxs("div",{className:"bg-cyan-50 border border-cyan-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[9px] text-cyan-600 font-black uppercase tracking-widest mb-1",children:"Edad"}),e.jsx("p",{className:"text-sm font-black text-gray-900 leading-relaxed",children:He})]}),e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-2xl p-4 col-span-2",children:[e.jsx("p",{className:"text-[9px] text-amber-600 font-black uppercase tracking-widest mb-1",children:"Asignatura / interés principal"}),e.jsx("p",{className:"text-sm font-black text-gray-900 leading-relaxed",children:Ue})]}),e.jsxs("div",{className:"bg-emerald-50 border border-emerald-100 rounded-2xl p-4 col-span-2",children:[e.jsx("p",{className:"text-[9px] text-emerald-600 font-black uppercase tracking-widest mb-1",children:"Disponibilidad y restricciones"}),e.jsx("p",{className:"text-sm font-black text-gray-900 leading-relaxed",children:Be})]})]})]}),e.jsxs("section",{className:"bg-white rounded-[28px] border border-gray-100 shadow-sm p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest mb-1",children:"Seguimiento académico"}),e.jsx("h2",{className:"text-lg font-black text-gray-900",children:"Exámenes y notas"}),e.jsx("p",{className:"text-[10px] text-gray-500 font-bold mt-1 leading-relaxed",children:"Deja aquí próximos exámenes o notas nuevas para que coordinación y el profesor lo tengan en cuenta."})]}),e.jsxs("div",{className:"flex flex-col gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>{M(t=>!t),I(!1)},className:"px-3 py-2 rounded-xl bg-blue-50 text-[#1c74e9] text-[10px] font-black uppercase tracking-widest border border-blue-100",children:"+ Examen"}),e.jsx("button",{type:"button",onClick:()=>{I(t=>!t),M(!1)},className:"px-3 py-2 rounded-xl bg-emerald-50 text-emerald-700 text-[10px] font-black uppercase tracking-widest border border-emerald-100",children:"+ Nota"})]})]}),v.length>0&&_&&e.jsx("div",{className:"mb-4 bg-amber-50 border border-amber-200 rounded-2xl p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-amber-700 font-black uppercase tracking-widest",children:"Examen cerca"}),e.jsxs("p",{className:"text-sm font-black text-gray-900 mt-2",children:[a==null?void 0:a.name," tiene ",v.length===1?"1 examen previsto":`${v.length} examenes previstos`," en los proximos 7 dias."]}),e.jsxs("p",{className:"text-[11px] text-amber-800 font-bold mt-2 leading-5",children:[_.subject," · ",te(_.exam_date)," · ",_.urgency_label]})]}),e.jsx("span",{className:"shrink-0 bg-white text-amber-700 text-[9px] font-black uppercase tracking-widest px-3 py-1 rounded-full border border-amber-200",children:_.urgency_label})]})}),$e&&e.jsxs("div",{className:"mb-4 bg-blue-50/70 border border-blue-100 rounded-2xl p-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-blue-600 font-black uppercase tracking-widest mb-1 block",children:"Asignatura"}),e.jsx("input",{value:b.subject,onChange:t=>h(s=>({...s,subject:t.target.value})),className:"w-full bg-white border border-blue-100 rounded-xl px-3 py-3 text-sm font-bold text-gray-900 outline-none",placeholder:"Ej: Matemáticas"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-blue-600 font-black uppercase tracking-widest mb-1 block",children:"Fecha"}),e.jsx("input",{type:"date",value:b.exam_date,onChange:t=>h(s=>({...s,exam_date:t.target.value})),className:"w-full bg-white border border-blue-100 rounded-xl px-3 py-3 text-sm font-bold text-gray-900 outline-none"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-blue-600 font-black uppercase tracking-widest mb-1 block",children:"Tema o unidad"}),e.jsx("input",{value:b.unit,onChange:t=>h(s=>({...s,unit:t.target.value})),className:"w-full bg-white border border-blue-100 rounded-xl px-3 py-3 text-sm font-bold text-gray-900 outline-none",placeholder:"Ej: Tema 6, sintaxis, derivadas..."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-blue-600 font-black uppercase tracking-widest mb-1 block",children:"Comentario opcional"}),e.jsx("textarea",{value:b.notes,onChange:t=>h(s=>({...s,notes:t.target.value})),className:"w-full bg-white border border-blue-100 rounded-xl px-3 py-3 text-sm font-bold text-gray-900 outline-none resize-none",rows:2,placeholder:"Ej: le preocupa esta parte o entra bastante teoría"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{M(!1),h(K)},className:"flex-1 py-3 rounded-xl bg-white text-gray-500 border border-gray-200 text-[10px] font-black uppercase tracking-widest",children:"Cancelar"}),e.jsx("button",{type:"button",onClick:Qe,disabled:z,className:"flex-[2] py-3 rounded-xl bg-[#1c74e9] text-white text-[10px] font-black uppercase tracking-widest shadow-lg shadow-blue-500/20 disabled:opacity-60",children:z?"Guardando...":"Guardar examen"})]})]}),Re&&e.jsxs("div",{className:"mb-4 bg-emerald-50/70 border border-emerald-100 rounded-2xl p-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-emerald-700 font-black uppercase tracking-widest mb-1 block",children:"Trimestre"}),e.jsx("select",{value:m.term,onChange:t=>f(s=>({...s,term:t.target.value})),className:"w-full bg-white border border-emerald-100 rounded-xl px-3 py-3 text-sm font-bold text-gray-900 outline-none",children:gt.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-emerald-700 font-black uppercase tracking-widest mb-1 block",children:"Nota"}
24),e.jsx("input",{value:m.grade,onChange:t=>f(s=>({...s,grade:t.target.value})),className:"w-full bg-white border border-emerald-100 rounded-xl px-3 py-3 text-sm font-bold text-gray-900 outline-none",placeholder:"Ej: 7,5"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-emerald-700 font-black uppercase tracking-widest mb-1 block",children:"Asignatura"}),e.jsx("input",{value:m.subject,onChange:t=>f(s=>({...s,subject:t.target.value})),className:"w-full bg-white border border-emerald-100 rounded-xl px-3 py-3 text-sm font-bold text-gray-900 outline-none",placeholder:"Ej: Física o Inglés"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-emerald-700 font-black uppercase tracking-widest mb-1 block",children:"Comentario opcional"}),e.jsx("textarea",{value:m.notes,onChange:t=>f(s=>({...s,notes:t.target.value})),className:"w-full bg-white border border-emerald-100 rounded-xl px-3 py-3 text-sm font-bold text-gray-900 outline-none resize-none",rows:2,placeholder:"Ej: ha subido mucho respecto al trimestre anterior"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{I(!1),f(ee)},className:"flex-1 py-3 rounded-xl bg-white text-gray-500 border border-gray-200 text-[10px] font-black uppercase tracking-widest",children:"Cancelar"}),e.jsx("button",{type:"button",onClick:Je,disabled:z,className:"flex-[2] py-3 rounded-xl bg-emerald-500 text-white text-[10px] font-black uppercase tracking-widest shadow-lg shadow-emerald-500/20 disabled:opacity-60",children:z?"Guardando...":"Guardar nota"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[e.jsxs("div",{className:"bg-blue-50/60 border border-blue-100 rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[e.jsx("p",{className:"text-[9px] text-blue-600 font-black uppercase tracking-widest",children:"Próximos exámenes"}),e.jsx("span",{className:"bg-white text-blue-600 text-[9px] font-black uppercase tracking-widest px-3 py-1 rounded-full border border-blue-100",children:j.length})]}),e.jsx("div",{className:"space-y-2",children:j.length===0?e.jsx("p",{className:"text-[11px] text-gray-500 font-bold leading-5",children:"Todavía no hay fechas cargadas. Cuando sepáis un examen, podéis dejarlo aquí."}):j.map(t=>e.jsx("div",{className:`rounded-2xl border p-3 ${ue.has(t.id)?"bg-amber-50 border-amber-200":"bg-white border-blue-100"}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-black text-sm text-gray-900",children:t.subject}),e.jsxs("p",{className:`text-[10px] font-black uppercase tracking-widest mt-1 ${ue.has(t.id)?"text-amber-700":"text-blue-600"}`,children:[te(t.exam_date)," · ",t.status==="done"?"Hecho":"Pendiente"]}),t.unit&&e.jsx("p",{className:"text-[11px] text-gray-600 font-bold mt-2",children:t.unit}),t.notes&&e.jsx("p",{className:"text-[11px] text-gray-500 mt-2 leading-5",children:t.notes}),e.jsxs("p",{className:"text-[9px] text-gray-400 font-black uppercase tracking-widest mt-2",children:["Añadido por ",_e(t.source)]})]}),e.jsx("button",{type:"button",onClick:()=>Ye(t.id),className:"w-8 h-8 rounded-full bg-red-50 text-red-500 border border-red-100 text-xs font-black shrink-0",title:"Quitar examen",children:"×"})]})},t.id))})]}),e.jsxs("div",{className:"bg-emerald-50/60 border border-emerald-100 rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[e.jsx("p",{className:"text-[9px] text-emerald-700 font-black uppercase tracking-widest",children:"Notas trimestrales"}),e.jsx("span",{className:"bg-white text-emerald-700 text-[9px] font-black uppercase tracking-widest px-3 py-1 rounded-full border border-emerald-100",children:A.length})]}),e.jsx("div",{className:"space-y-2",children:A.length===0?e.jsx("p",{className:"text-[11px] text-gray-500 font-bold leading-5",children:"Si os entregan una nota nueva, podéis subirla aquí para que el seguimiento sea más fino."}):A.map(t=>e.jsx("div",{className:"bg-white rounded-2xl border border-emerald-100 p-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-black text-sm text-gray-900",children:t.subject}),e.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest text-emerald-700 mt-1",children:[t.term," · Nota ",t.grade]}),t.notes&&e.jsx("p",{className:"text-[11px] text-gray-500 mt-2 leading-5",children:t.notes}),e.jsxs("p",{className:"text-[9px] text-gray-400 font-black uppercase tracking-widest mt-2",children:["Añadido por ",_e(t.source)]})]}),e.jsx("button",{type:"button",onClick:()=>Ze(t.id),className:"w-8 h-8 rounded-full bg-red-50 text-red-500 border border-red-100 text-xs font-black shrink-0",title:"Quitar nota",children:"×"})]})},t.id))})]})]})]}),e.jsxs("section",{className:"bg-gradient-to-br from-purple-700 to-indigo-900 p-6 rounded-[32px] shadow-xl relative overflow-hidden mb-2",children:[e.jsx("div",{className:"absolute -right-10 -bottom-10 text-8xl op
24acity-10 rotate-12",children:"🎟️"}),e.jsxs("div",{className:"relative z-10 flex justify-between items-start mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-black text-lg leading-tight",children:"Clases Extra"}),e.jsx("p",{className:"text-purple-200 text-[10px] font-bold uppercase tracking-widest mt-0.5",children:"Bolsa de horas (Exámenes)"})]}),O>0&&e.jsx("span",{className:"bg-green-400 text-white text-[10px] font-black px-3 py-1 rounded-full uppercase tracking-widest shadow-md",children:"Disponible"})]}),e.jsx("div",{className:"relative z-10 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/20",children:O>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center mb-3 border-b border-white/10 pb-3",children:[e.jsx("span",{className:"text-white text-xs font-bold",children:"Bonos restantes:"}),e.jsx("span",{className:"text-white text-2xl font-black",children:O})]}),e.jsxs("div",{className:"bg-white/10 rounded-2xl p-4 border border-white/20",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-[10px] text-purple-200 font-black uppercase tracking-widest",children:"Canjear bonos:"}),e.jsxs("div",{className:"flex items-center gap-3 bg-white/20 rounded-xl p-1",children:[e.jsx("button",{onClick:()=>me(t=>Math.max(1,t-1)),className:"w-8 h-8 rounded-lg bg-white/10 text-white font-black flex items-center justify-center hover:bg-white/30 transition-colors",children:"-"}),e.jsx("span",{className:"text-white font-black w-4 text-center",children:xe}),e.jsx("button",{onClick:()=>me(t=>Math.min(O,t+1)),className:"w-8 h-8 rounded-lg bg-white/10 text-white font-black flex items-center justify-center hover:bg-white/30 transition-colors",children:"+"})]})]}),e.jsxs("button",{onClick:Ge,className:"w-full flex items-center justify-center gap-2 bg-white text-purple-700 hover:bg-gray-50 active:scale-95 transition-all rounded-xl p-3 font-black uppercase text-[10px] tracking-widest shadow-sm",children:[e.jsx("span",{className:"text-lg",children:"📲"})," Enviar WhatsApp"]})]})]}):e.jsxs("div",{className:"text-center",children:[e.jsx("span",{className:"text-3xl mb-2 block opacity-50 grayscale",children:"🎟️"}),e.jsx("p",{className:"text-white font-bold text-sm",children:"No tienes clases extra"}),e.jsx("p",{className:"text-purple-200 text-xs mt-1",children:"Consulta con Coordinación si necesitas apoyo puntual."})]})})]}),e.jsxs("section",{className:"bg-gradient-to-br from-[#1c74e9] to-blue-900 p-6 rounded-[32px] shadow-xl relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-[-50%] right-[-10%] w-[80%] h-[200%] bg-white/10 rounded-full blur-3xl"}),e.jsxs("div",{className:"flex justify-between items-start mb-4 relative z-10",children:[e.jsx("h3",{className:"text-[10px] font-black text-blue-200 uppercase tracking-widest",children:"Próxima Clase"}),x&&e.jsx("span",{className:"bg-white/20 text-white backdrop-blur-md text-[9px] font-black px-3 py-1.5 rounded-full uppercase tracking-widest border border-white/20 shadow-sm",children:"Programada"})]}),x?e.jsxs("div",{className:"space-y-4 relative z-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-black text-white leading-tight",children:x.subject}),e.jsx("p",{className:"text-blue-100 font-bold text-sm mt-1",children:x.modality}),e.jsxs("p",{className:"text-blue-100 font-black text-[10px] uppercase tracking-widest mt-2",children:["Profesor de esta clase: ",L(x.monitor_email)]})]}),e.jsxs("div",{className:"p-4 bg-white/10 backdrop-blur-md border border-white/10 rounded-2xl flex items-center gap-4 mt-6",children:[e.jsx("div",{className:"bg-white p-3 rounded-xl shadow-sm text-2xl",children:"📅"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-black text-white text-lg",children:new Date(x.class_date).toLocaleDateString("es-ES",{day:"numeric",month:"long"})}),e.jsxs("p",{className:"text-xs text-blue-200 font-bold uppercase tracking-widest mt-0.5",children:["A las ",(we=x.start_time)==null?void 0:we.substring(0,5)]})]})]}),((ye=x.modality)==null?void 0:ye.includes("Online"))&&e.jsx("div",{className:"mt-4 pt-4 border-t border-white/10",children:x.meet_link?e.jsxs("button",{onClick:()=>window.open(x.meet_link,"_blank"),className:"w-full bg-white text-[#1c74e9] font-black text-xs uppercase tracking-widest py-4 rounded-xl shadow-lg hover:bg-gray-50 active:scale-95 transition-all flex items-center justify-center gap-2",children:[e.jsx("span",{className:"text-xl",children:"🎥"})," Entrar a la Clase (Meet)"]}):e.jsxs("div",{className:"w-full bg-white/10 border border-white/20 text-blue-100 font-bold text-[10px] uppercase tracking-widest py-3 rounded-xl text-center flex items-center justify-center gap-2",children:[e.jsx("span",{children:"⏳"})," Enlace pendiente de Coordinación"]})})]}):e.jsxs("div",{className:"py-8 text-center relative z-10",children:[e.jsx("span",{className:"text-5xl block mb-4 opacity-80",children:"🏖️"}),e.jsx("p",{className:"text-white font-black text-lg",children:"Sin clases a la vista"}),e.jsx("p",{className:"text-blue-200 text-sm mt-1 font-medium",children:"Avisa al coordinador si necesitas programar una nueva sesión."})]})]}),e.jsxs("section",{className:"bg-gradient-to-br from-amber-400 to-orange-500 p-6 rounded-[32px] shadow-xl relative overflow-hidden mt-6 mb-2 text-center border-4 border-white",children:[e.jsx("div",{className:"absolute top-[-20%] left-[-10%] w-[60%] h-[150%] bg-white/20 rounded-full blur-2xl"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("span",{className:"text-4xl block mb-2",children:"🎁"}),e.jsx("h3",{className:"text-white font-black text-xl leading-tight",children:"Recomienda Profe en Casa"}),e.jsx("p",{className:"text-amber-100 text-[11px] font-bold uppercase tracking-widest mt-1 mb-4",children:"¿Conoces a una familia que necesite apoyo?"}),e.jsx("div",{className:"bg-white p-4 rounded-2xl shadow-inner mb-4",children:e.jsx("p",{className:"text-gray-600 text-xs font-bold leading-relaxed",children:"Puedes compartir nuestra web y el WhatsApp oficial de atención. La familia recibirá información antes de decidir."})}),e.jsxs("button",{onClick:Xe,className:"w-full bg-[#25D366] text-white font-black text-[11px] uppercase tracking-widest py-4 rounded-xl shadow-[0_4px_15px_rgba(37,211,102,0.4)] hover:bg-green-600 active:scale-95 transition-all flex items-center justify-center gap-2",children:[e.jsx("span",{children:"📲"})," Compartir por WhatsApp"]})]})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h3",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mb-4 pl-2",children:"Accesos Rápidos"}),e.jsxs("section",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("button",{type:"button",onClick:()=>R("history"),className:"w-full p-5 bg-white rounded-[28px] shadow-[0_4px_20px_rgba(0,0,0,0.03)] border border-gray-100 active:scale-95 transition-all cursor-pointer hover:border-blue-200 relative overflow-hidden group text-left",children:[e.jsx("div",{className:"absolute right-[-10px] bottom-[-10px] text-5xl opacity-5 transition-transform group-hover:scale-110",children:"⭐"}),e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-blue-50 text-blue-600 flex items-center justify-center mb-4 text-2xl border border-blue-100 shadow-sm",children:"📊"}),e.jsx("span",{className:"text-sm font-black text-gray-900 block",children:"Reportes"}),e.jsx("span",{className:"text-[9px] text-gray-400 font-black uppercase mt-1 block tracking-widest",children:"Notas del profe"})]}),e.jsxs("button",{type:"button",onClick:()=>R("payments"),className:"w-full p-5 bg-white rounded-[28px] shadow-[0_4px_20px_rgba(0,0,0,0.03)] border border-gray-100 active:scale-95 transition-all cursor-pointer hover:border-green-200 group text-left",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-green-50 text-green-600 flex items-center justify-center mb-4 text-2xl border border-green-100 shadow-sm group-hover:scale-110 transition-transform",children:"💶"}),e.jsx("span",{className:"text-sm font-black text-gray-900 block",children:"Facturas"}),e.jsx("span",{className:"text-[9px] text-gray-400 font-black uppercase mt-1 block tracking-widest",children:"Ver saldos"})]})]}),e.jsxs("button",{onClick:()=>{a.contract_signed?T(!0):(i||g.readyToSign&&ae&&!i)&&k(!0)},disabled:!a.contract_signed&&!i&&(!g.readyToSign||!ae),className:"mt-4 w-full bg-white p-5 rounded-[28px] shadow-[0_4px_20px_rgba(0,0,0,0.03)] border border-gray-100 flex items-center justify-between hover:border-[#1c74e9] transition-all group active:scale-95 disabled:cursor-default disabled:opacity-80 disabled:active:scale-100",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-blue-50 text-blue-600 flex items-center justify-center text-2xl border border-blue-100 shadow-sm",children:"📝"}),e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-sm font-black text-gray-900 block",children:"Acuerdo familiar"}),e.jsx("span",{className:`text-[9px] font-black uppercase tracking-widest ${a.contract_signed?"text-green-500":"text-amber-600"}`,children:a.contract_signed?"Firmado":i?"Vista previa disponible para Dirección":g.readyToSign?"Preparado para revisar y firmar":"Coordinación está completando las condiciones"}),!a.contract_signed&&g.missingFields.length>0&&e.jsxs("span",{className:"mt-1 block max-w-[235px] text-[10px] font-medium leading-snug text-gray-500",children:["Falta confirmar: ",g.missingFields.join(", "),"."]})]})]}),e.jsx("span",{className:"text-gray-300 group-hover:text-[#1c74e9] font-black text-xl",children:"›"})]})]})]})})]})};function Dt(i){const[y,u]=n.useState(null),[B,V]=n.useState(""),[F,P]=n.useState(0);return n.useEffect(()=>{},[i.previewStudentEmail,F]),e.jsx(Nt,{...i})}export{Dt as FamilyPortalRouter};

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.