1import{r as m,j as e,P as Ce,s as A,a as ia}from"./index-bMFZPluE.js";import{n as Q,f as qa,g as Oa,a as Xe,b as Wa}from"./addressFormatting-eDBQ4TmV.js";import{s as ea}from"./emailApi-BQfIvn0G.js";import{g as aa}from"./classRoster-DcgYT_RM.js";import{b as Va,a as Ra,c as Ya}from"./teacherMonthlyForecast-DGTfyxMK.js";import{T as Ga,b as ta}from"./TeacherAvailabilityEditor-CzOirxAn.js";import{o as Ua}from"./protectedStorage-l8nXRU0Q.js";import{C as Y}from"./laborAssignmentControls-PBEP3hIy.js";import{e as Ha}from"./emailHtml-CNLY3Q4b.js";import{p as ue,a as Za,c as Ja}from"./candidateAvailability-DgcALE0v.js";import"./pricingEngine-DmHUGCKM.js";import"./educationCatalog-pqwMnMBs.js";const sa=r=>` 2 <div style="font-family: sans-serif; max-width: 640px; margin: 0 auto; color: #1f2937; border: 1px solid #e5e7eb; border-radius: 20px; overflow: hidden;"> 3 <div style="background-color: #1c74e9; padding: 28px 24px;"> 4 <p style="margin: 0; color: #bfdbfe; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;">Profe en Casa</p> 5 <h1 style="margin: 8px 0 0; color: white; font-size: 24px;">Bienvenida al equipo</h1> 6 </div> 7 <div style="padding: 28px 24px; font-size: 16px; line-height: 1.65;"> 8 ${Ha(r).replace(/\n/g,"<br>")} 9 <div style="text-align: center; margin: 30px 0 10px;"> 10 <a href="${ia}" style="display: inline-block; background-color: #1c74e9; color: white; padding: 13px 24px; text-decoration: none; border-radius: 12px; font-weight: 800;">Abrir mi área de profesora</a> 11 </div> 12 <p style="margin-top: 32px; color: #6b7280; font-size: 13px;">Equipo de selección · Profe en Casa</p> 13 </div> 14 </div> 15`,Ka=r=>{if(!r)return{work_modality:"",availability_notes:""};const d="[MODALIDAD: ";if(!r.startsWith(d))return{work_modality:"",availability_notes:r.trim()};const[,f=""]=r.split(d),[g="",S=""]=f.split("] - ");return{work_modality:g.trim(),availability_notes:S.trim()}},Qa=["L","M","X","J","V"],le=r=>(r||"").split(",").map(d=>d.trim()).filter(Boolean),da=r=>(r||"").trim().split(" ")[0]||"",K=r=>(r||"").slice(0,5)||"--:--",Ae=r=>{if(r!=null&&r.class_date){const f=new Date(`${r.class_date}T12:00:00`);if(!Number.isNaN(f.getTime()))return(f.getDay()+6)%7}const d=typeof(r==null?void 0:r.day_of_week)=="string"?r.day_of_week.toLowerCase():"";return d.includes("lu")?0:d.includes("ma")?1:d.includes("mi")||d.includes("xi")?2:d.includes("ju")?3:d.includes("vi")?4:d.includes("sa")?5:d.includes("do")?6:-1},Xa=r=>{const d=Ae(r);return["LUN","MAR","MIÃ","JUE","VIE","SÃB","DOM"][d]||"DÃA"},me=r=>{const d=((r==null?void 0:r.modality)||"").toLowerCase(),f=Number((r==null?void 0:r.student_count)||le(r==null?void 0:r.student_name).length||0);return d.includes("academia profe a 3")?f>=3?"closed":"academy_open":d.includes("domicilio")||d.includes("profe en casa")?"home":d.includes("online")?"online":"individual"},Se=r=>{const d=me(r);return d==="closed"?{pill:"bg-emerald-50 text-emerald-700 border-emerald-200",card:"border-emerald-100 bg-emerald-50/40",label:"Cerrado"}:d==="academy_open"?{pill:"bg-amber-50 text-amber-700 border-amber-200",card:"border-amber-100 bg-amber-50/40",label:"Grupo abierto"}:d==="home"?{pill:"bg-blue-50 text-blue-700 border-blue-200",card:"border-blue-100 bg-blue-50/40",label:"Individual domicilio"}:d==="online"?{pill:"bg-cyan-50 text-cyan-700 border-cyan-200",card:"border-cyan-100 bg-cyan-50/40",label:"Online"}:{pill:"bg-blue-50 text-blue-700 border-blue-200",card:"border-blue-100 bg-blue-50/40",label:"Individual"}},et=(r,d)=>(r||"").toLowerCase().includes("academia profe a 3")?`${d} / 3 alumnos`:`${d} ${d===1?"alumno":"alumnos"}`,ne=r=>{const d=(r||"").trim();return d?d.replace(/\bE\.?\s*S\.?\s*O\.?\b/gi,"ESO").replace(/\bBachillerato\b/gi,"Bach").replace(/\s{2,}/g," ").trim():""},ra=r=>{const d=ne(r).toLowerCase();if(!d)return 999;if(d.includes("primaria"))return 10;if(d.includes("adult"))return 80;if(d.includes("uni"))return 90;const f=d.includes("bach")?60:d.includes("eso")?40:70,g=d.match(/(\d+)/),S=g?Number(g[1]):0;return f+S},De=(r,d,f)=>{const g=Array.from(new Set(d.map(S=>
15ne(f[Q(S)])).filter(Boolean))).sort((S,G)=>ra(S)-ra(G));return g.length===1?g[0]:g.length>1?g.join(" · "):ne(r)||"General"},be=(r,d)=>{const f=da(r),g=ne(d[Q(r)]);return g?`${f} (${g})`:f},la=r=>r?String(r).split("-").reverse().join("/"):"--/--/----",at=r=>{if(!(r!=null&&r.class_date))return!1;const d=String((r==null?void 0:r.start_time)||"23:59").slice(0,5)||"23:59",f=String((r==null?void 0:r.end_time)||d).slice(0,5)||d,g=new Date(`${r.class_date}T${f}:00`);return Number.isNaN(g.getTime())?r.class_date<new Date().toISOString().split("T")[0]:g.getTime()<Date.now()},tt=(r,d)=>{const f=r!=null&&r.attendance_data&&typeof r.attendance_data=="object"?r.attendance_data:null;if(f){const g=Object.keys(f).find(S=>Q(S)===Q(d));if(g)return String(f[g]||"")}return(r==null?void 0:r.status)==="Falta Injustificada"?"falta_injustificada":(r==null?void 0:r.status)==="Completada"||(r==null?void 0:r.status)==="Pagado"?"presente":""},re=r=>(r==null?void 0:r.status)==="Inactivo",na=r=>String((r==null?void 0:r.availability_last_confirmed_at)||"").slice(0,10)>=Y.startDate,st=r=>{const d=String((r==null?void 0:r.phone)||"").replace(/\D/g,"");if(!d)return"";const g=`Hola, ${String((r==null?void 0:r.name)||(r==null?void 0:r.full_name)||"profe").trim().split(/\s+/)[0]}. Estamos organizando los grupos y horarios del curso 2026/27. 16 17Por favor, entra en https://app.profe-en-casa.com/ y abre Mi perfil > Disponibilidad real. Marca los bloques en los que puedes dar clase y guarda los cambios. 18 19Cuando lo tengas actualizado, avÃsanos por aquà para poder asignarte solo clases que encajen de verdad con tu horario. Gracias.`;return`https://wa.me/${d}?text=${encodeURIComponent(g)}`},ht=({onBack:r,onSpyMonitor:d})=>{var He,Ze,Je;const f=["HÃbrido (Presencial y Online)","Solo Online (Nacional/Intl.)","Solo Presencial (Local)"],[g,S]=m.useState([]),[G,Ee]=m.useState("active"),[L,oa]=m.useState({}),[ca,Pe]=m.useState(!0),[l,U]=m.useState(null),[$e,xa]=m.useState([]),[pa,Me]=m.useState(!1),[ua,ba]=m.useState([]),[H,Fe]=m.useState(!1),[ma,ge]=m.useState(!1),[ga,ie]=m.useState(!1),[O,Ie]=m.useState(!1),[W,Le]=m.useState(!1),[k,he]=m.useState({subject:"",body:""}),[T,Z]=m.useState("agenda"),[s,o]=m.useState({phone:"",location:"",address_line:"",address_details:"",postal_code:"",province:"",studies:"",specialty:"",subjects:"",work_modality:"",default_meet_link:"",availability_notes:"",winter_schedule:"",summer_schedule:"",weekly_availability:{},summer_availability:{},availability_state:"Disponible ahora",availability_update_notes:"",availability_last_confirmed_at:null,has_vehicle:!1,has_metro:!1,wants_academy:!1,can_capture_walkin_leads:!1,can_create_extra_classes:!1,access_paused:!1,access_pause_message:"Estamos actualizando tu area de profesora. Si necesitas algo urgente, escribe a coordinacion y lo revisamos contigo.",dni:"",iban:""}),[V,Te]=m.useState(!1),[E,X]=m.useState(!1),[fe,Be]=m.useState(!1),[de,oe]=m.useState(!1),[_,ye]=m.useState(null),[ee,ze]=m.useState(!1),[rt,ha]=m.useState([]),F=new Date,[p,ae]=m.useState(new Date(F.getFullYear(),F.getMonth(),1)),[te,ce]=m.useState(null),fa=(t,i)=>new Date(t,i+1,0).getDate(),ya=(t,i)=>{let c=new Date(t,i,1).getDay();return c===0?6:c-1},ja=fa(p.getFullYear(),p.getMonth()),va=ya(p.getFullYear(),p.getMonth());Array.from({length:ja},(t,i)=>i+1),Array.from({length:va},(t,i)=>i);const je=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],qe=()=>ae(new Date(p.getFullYear(),p.getMonth()-1,1)),Oe=()=>ae(new Date(p.getFullYear(),p.getMonth()+1,1)),ve=t=>{if(!t||!t.signature_data)return null;
19try{const i=typeof t.signature_data=="string"?JSON.parse(t.signature_data):t.signature_data;return i.image?i:{image:t.signature_data,date:"No registrada (Firma antigua)",ip:"No registrada"}}catch{return{image:t.signature_data,date:"No registrada (Firma antigua)",ip:"No registrada"}}},wa=async()=>{Pe(!0);const{data:t}=await A.from("holidays").select("start_date, end_date");if(t){const j=new Set;t.forEach(N=>{const C=new Date(N.start_date+"T00:00:00"),x=new Date(N.end_date+"T00:00:00");let $=C;for(;$<=x;){const R=$.getFullYear(),B=String($.getMonth()+1).padStart(2,"0"),z=String($.getDate()).padStart(2,"0");j.add(`${R}-${B}-${z}`),$.setDate($.getDate()+1)}}),ha(Array.from(j))}const{data:i}=await A.from("teachers").select("*").order("name",{ascending:!0}),{data:c}=await A.from("candidates").select("email, availability"),{data:h}=await A.from("classes").select("student_name, monitor_email, status").is("deleted_at",null).gte("class_date",Y.startDate).lte("class_date",Y.endDate),{data:w}=await A.from("students").select("name, level"),I=qa(h||[]);if(w){const j=Object.fromEntries(w.filter(N=>N.name).map(N=>[Q(N.name),N.level||""]));oa(j)}if(i){const j=new Map((c||[]).filter(C=>C.email).map(C=>[C.email.toLowerCase(),Ka(C.availability)])),N=await Promise.all(i.map(async C=>{const{data:x}=await A.from("classes").select("student_count").eq("monitor_email",C.email).is("deleted_at",null).gte("class_date",Y.startDate).lte("class_date",Y.endDate),$=(x==null?void 0:x.length)||0,R=(x==null?void 0:x.reduce((Ne,pe)=>Ne+(pe.student_count||0),0))||0,B=$*3,z=B>0?Math.round(R/B*100):0,J=I[Oa(C.email)]||0,_e=J>=3,q=j.get((C.email||"").toLowerCase());return{...C,work_modality:C.work_modality||(q==null?void 0:q.work_modality)||"",availability_notes:C.availability_notes||(q==null?void 0:q.availability_notes)||"",activeGroups:$,efficiency:z,currentAssignedStudents:J,isFull:_e}}));S(N)}Pe(!1)},_a=async t=>{Me(!0);const{data:i}=await A.from("classes").select("*").eq("monitor_email",t.email).is("deleted_at",null);xa(i||[]);const{data:c}=await A.from("coordinator_permissions").select("*").eq("coordinator_id",t.id).maybeSingle();ye(c?{coordinator_id:t.id,can_validate_classes:!!c.can_validate_classes,can_use_bitacora:!!c.can_use_bitacora,can_view_team:!!c.can_view_team,can_view_finances:!!c.can_view_finances,can_view_students:!!c.can_view_students,can_assign_students:!!c.can_assign_students,can_manage_calendar:!!c.can_manage_calendar}:{coordinator_id:t.id,can_validate_classes:!1,can_use_bitacora:!1,can_view_team:!1,can_view_finances:!1,can_view_students:!1,can_assign_students:!1,can_manage_calendar:!1});const{data:h}=await A.from("teacher_schedule_feedback").select("*").eq("teacher_email",t.email).order("created_at",{ascending:!1}).limit(8);ba(h||[]),Me(!1)};m.useEffect(()=>{wa()},[]),m.useEffect(()=>{ce(null)},[p,l==null?void 0:l.id]);const xe=t=>{const i=Xe(t);o({phone:t.phone||"",location:i.locality,address_line:i.address_line,address_details:i.address_details,postal_code:i.postal_code,province:i.province,studies:t.studies||"",specialty:t.specialty||"",subjects:t.subjects||"",work_modality:t.work_modality||"",default_meet_link:t.default_meet_link||"",availability_notes:t.availability_notes||"",winter_schedule:t.winter_schedule||"",summer_schedule:t.summer_schedule||"",weekly_availability:ue(t.weekly_availability),summer_availability:ue(t.summer_availability),availability_state:t.availability_state||"Disponible ahora",availability_update_notes:t.availability_update_notes||"",availability_last_confirmed_at:t.availability_last_confirmed_at||null,has_vehicle:t.has_vehicle||!1,has_metro:t.has_metro||!1,wants_academy:t.wants_academy||!1,can_capture_walkin_leads:t.can_capture_walkin_leads||!1,can_create_extra_classes:t.can_create_extra_classes||!1,access_paused:!!t.access_paused,access_pause_message:t.access_pause_message||"Estamos actualizando tu area de profesora. Si necesitas algo urgente, escribe a coordinacion y lo revisamos contigo.",dni:t.dni||"",iban:t.iban||""})},Na=t=>{const i=Xe(t);U(t),Z("agenda"),X(!1),oe(!1),o({phone:t.phone||"",location:i.locality,address_line:i.address_line,address_details:i.address_details,postal_code:i.postal_code,province:i.province,studies:t.studies||"",specialty:t.specialty||"",subjects:t.subjects||"",work_modality:t.work_modality||"",default_meet_link:t.default_meet_link||"",availability_notes:t.availability_notes||"",winter_schedule:t.winter_schedule||"",summer_schedule:t.summer_schedule||"",weekly_availability:ue(t.weekly_availability),summer_availability:ue(t.summer_availability),availability_state:t.availability_state||"Disponible ahora",availability_update_notes:t.availability_update_notes||"",availability_last_confirmed_at:t.availability_last_confirmed_at||null,has_vehicle:t.has_vehicle||!1,has_metro:t.has_metro||!1,wants_academy:t.wants_academy||!1,can_capture_walkin_leads:t.can_capture_walkin_leads||!1,can_create_extra_classes:t.can_create_extra_classes||!1,access_paused:!!t.access_paused,access_pause_message:t.access_pause_message||"Estamos actualizando tu area de profesora. Si necesitas algo urgente, escribe a coordinacion y lo revisamos contigo.",dni:t.dni||"",iban:t.iban||""}),_a(t)},We=()=>{l&&(xe(l),X(!1))},ka=()=>{l&&(xe(l),oe(!1))},Ca=(t,i,c)=>{o(h=>({...h,[t]:{...h[t],[i]:c}}))},Sa=()=>{const t=s.weekly_availability||{},i=s.summer_availability||{}
19,c=Wa({addressLine:s.address_line,addressDetails:s.address_details,postalCode:s.postal_code,locality:s.location,province:s.province});return{phone:s.phone,location:s.location,province:s.province||null,address_line:s.address_line||null,address_details:s.address_details||null,postal_code:s.postal_code||null,postal_address:c||null,studies:s.studies,specialty:s.specialty,subjects:s.subjects,work_modality:s.work_modality||null,default_meet_link:s.default_meet_link||null,availability_notes:s.availability_notes||null,winter_schedule:ta(t,Ja)||s.winter_schedule||"",summer_schedule:ta(i,Za)||s.summer_schedule||"",weekly_availability:t,summer_availability:i,availability_state:s.availability_state||"Disponible ahora",availability_update_notes:s.availability_update_notes||null,availability_last_confirmed_at:new Date().toISOString(),has_vehicle:s.has_vehicle,has_metro:s.has_metro,wants_academy:s.wants_academy,can_capture_walkin_leads:s.can_capture_walkin_leads,can_create_extra_classes:s.can_create_extra_classes,access_paused:!!s.access_paused,access_pause_message:s.access_paused&&s.access_pause_message||null,access_paused_at:s.access_paused?new Date().toISOString():null}},Da=()=>({dni:s.dni||null,iban:s.iban||null}),Ve=async t=>{if(t.preventDefault(),!l)return;Te(!0);const i=Sa(),{error:c}=await A.from("teachers").update(i).eq("id",l.id);if(Te(!1),c)alert("Error al guardar perfil: "+c.message);else{alert("â Perfil docente guardado con éxito.");const h={...l,...i};U(h),S(g.map(w=>w.id===h.id?h:w)),xe(h),X(!1)}},Aa=async t=>{if(t.preventDefault(),!l)return;Be(!0);const i=Da(),{error:c}=await A.from("teachers").update(i).eq("id",l.id);if(Be(!1),c)alert("Error al guardar datos de cobro: "+c.message);else{alert("â DNI y cuenta guardados con éxito.");const h={...l,...i};U(h),S(g.map(w=>w.id===h.id?h:w)),xe(h),oe(!1)}},Ea=async()=>{const t=l.status==="Inactivo",i=t?"Activo":"Inactivo",c=t?"reactivar":"pasar a inactivo";if(window.confirm(`¿Quieres ${c} el perfil de ${l.name}? 20 21No se borrará ningún dato ni documento. ${t?"El horario quedará pendiente de una nueva confirmación.":"Dejará de aparecer para nuevas clases y su acceso quedará pausado."}`)){const w=t?{status:i,access_paused:!1,access_pause_message:null,access_paused_at:null,availability_state:"Revisar disponibilidad",availability_last_confirmed_at:null}:{status:i,access_paused:!0,access_pause_message:"Tu ficha se conserva, pero actualmente no formas parte del equipo activo. Dirección puede reactivarla si volvemos a colaborar.",access_paused_at:new Date().toISOString(),availability_state:"Ya no disponible"},{error:I}=await A.from("teachers").update(w).eq("id",l.id);if(I)alert("No se pudo cambiar el estado del profesor: "+I.message);else{const j={...l,...w};U(j),S(g.map(N=>N.id===j.id?j:N)),o(N=>({...N,access_paused:!!j.access_paused,access_pause_message:j.access_pause_message||"",availability_state:j.availability_state||"Revisar disponibilidad",availability_last_confirmed_at:j.availability_last_confirmed_at||null})),alert(t?"Perfil reactivado.":"Perfil conservado como inactivo. No se ha borrado ningún dato.")}}},se=async(t,i)=>{if(!_||!l)return;ze(!0);const c=!i,h=l.id,w={..._,coordinator_id:h,[t]:c},{error:I}=await A.from("coordinator_permissions").upsert(w,{onConflict:"coordinator_id"});I?alert("ð¨ Error al guardar permiso: "+I.message):ye(w),ze(!1)},Re=t=>{d?d(t):alert(`ð ï¸ Falta conectar el cable en tu Panel Principal. 22 23Asegúrate de pasarle la función 'onSpyMonitor' a este componente para poder entrar al tablón del profesor.`)},Pa=()=>{l&&(he({subject:l.welcome_email_subject||"Bienvenida al equipo de Profe en Casa",body:l.welcome_email_body||""}),ie(!0))},Ye=t=>{const i={...l,...t};U(i),S(c=>c.map(h=>h.id===i.id?i:h))},$a=async()=>{if(!(l!=null&&l.id))return;if(!k.subject.trim()||!k.body.trim()){alert("Completa el asunto y el mensaje antes de guardar.");return}Ie(!0);const t={welcome_email_subject:k.subject.trim(),welcome_email_body:k.body.trim(),welcome_email_prepared_at:l.welcome_email_prepared_at||new Date().toISOString(),welcome_email_sent_at:null},{error:i}=await A.from("teachers").update(t).eq("id",l.id);if(Ie(!1),i){alert(`No se pudo guardar el borrador: ${i.message}`);return}Ye(t),alert("Borrador guardado. La bienvenida sigue pendiente y no se ha enviado.")},Ma=async()=>
23{if(!(!(l!=null&&l.id)||!l.email)){if(!k.subject.trim()||!k.body.trim()){alert("Completa el asunto y el mensaje antes de enviar.");return}if(window.confirm(`¿Enviar ahora la bienvenida a ${l.email}?`)){Le(!0);try{await ea({to:l.email,subject:k.subject.trim(),html:sa(k.body.trim())});const t=new Date().toISOString(),i={welcome_email_subject:k.subject.trim(),welcome_email_body:k.body.trim(),welcome_email_prepared_at:l.welcome_email_prepared_at||t,welcome_email_sent_at:t},{error:c}=await A.from("teachers").update(i).eq("id",l.id);if(c)throw c;Ye(i),ie(!1),alert(`Bienvenida enviada a ${l.email}.`)}catch(t){alert(`No se pudo completar el envio: ${t.message}`)}finally{Le(!1)}}}};if(l){const t=[...$e].sort((a,n)=>{const b=new Date(`${a.class_date||"2999-12-31"}T${a.start_time||"00:00"}`),v=new Date(`${n.class_date||"2999-12-31"}T${n.start_time||"00:00"}`);return b.getTime()-v.getTime()}),i=t.filter(a=>["Pendiente","En Curso"].includes(a.status)&&a.class_date>=Y.startDate&&a.class_date<=Y.endDate),c=new Map,h=[];t.forEach(a=>{if(!a.class_date)return;const n=new Date(`${a.class_date}T12:00:00`);if(Number.isNaN(n.getTime())||n.getFullYear()!==p.getFullYear()||n.getMonth()!==p.getMonth())return;if((n.getDay()+6)%7>=5){h.push(a);return}const v=a.class_date,y=c.get(v)||[];y.push(a),c.set(v,y)});const w=[];new Date(p.getFullYear(),p.getMonth(),1);const I=new Date(p.getFullYear(),p.getMonth()+1,0);for(let a=1;a<=I.getDate();a++){const b=(new Date(p.getFullYear(),p.getMonth(),a).getDay()+6)%7;if(b>=5)continue;if(w.length===0&&b>0)for(let P=0;P<b;P++)w.push(null);const v=`${p.getFullYear()}-${String(p.getMonth()+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`,y=c.get(v)||[],M=y.filter(P=>me(P)==="academy_open").length,u=y.filter(P=>me(P)==="closed").length,D=y.filter(P=>["individual","home","online"].includes(me(P))).length;w.push({date:v,dayNumber:a,classes:y,openCount:M,closedCount:u,individualCount:D})}const j=te&&w.find(a=>a&&a.date===te)||null,N=new Map;i.forEach(a=>{const n=Xa(a),b=Number(a.student_count||le(a.student_name).length||0),v=le(a.student_name),y=De(a.level,v,L),M=v.map(P=>be(P,L)),u=[Ae(a),a.start_time||"",a.end_time||"",a.subject||"",y,a.modality||"",v.join("|")].join("::"),D=N.get(u);if(!D){N.set(u,{signature:u,dayLabel:n,weekdayIndex:Ae(a),startTime:a.start_time||"",endTime:a.end_time||"",subject:a.subject||"Refuerzo Escolar",level:y,modality:a.modality||"",studentCount:b,studentNames:v,studentDisplayNames:M,nextClassDate:a.class_date||"",tone:Se(a)});return}a.class_date&&D.nextClassDate&&a.class_date<D.nextClassDate&&(D.nextClassDate=a.class_date)});const C=Array.from(N.values()).sort((a,n)=>a.weekdayIndex!==n.weekdayIndex?a.weekdayIndex-n.weekdayIndex:(a.startTime||"").localeCompare(n.startTime||"")),x=Va($e,p),$=t.filter(a=>{if(!(a!=null&&a.class_date)||(a==null?void 0:a.status)==="Cancelada")return!1;const n=new Date(`${a.class_date}T12:00:00`);return Number.isNaN(n.getTime())?!1:n.getFullYear()===p.getFullYear()&&n.getMonth()===p.getMonth()}),R=Array.from(new Set($.flatMap(a=>aa(a.student_name,a.recovery_students)))).sort((a,n)=>a.localeCompare(n,"es-ES")),B=new Map;$.forEach(a=>{const n=aa(a.student_name,a.recovery_students),b=at(a),v=b&&["Pendiente","En Curso"].includes(String(a.status||""));n.forEach(y=>{const M=Q(y);if(!M)return;const u=B.get(M)||{studentName:y,level:ne(L[M])||"Nivel pendiente",scheduledCount:0,presentCount:0,justifiedCount:0,unjustifiedCount:0,recoveryCount:0,pastPendingCount:0,nextClassDate:"",lastClassDate:""};u.scheduledCount+=1,v&&(u.pastPendingCount+=1),b&&(!u.lastClassDate||a.class_date>u.lastClassDate)&&(u.lastClassDate=a.class_date),!b&&(!u.nextClassDate||a.class_date<u.nextClassDate)&&(u.nextClassDate=a.class_date);const D=tt(a,y);D==="presente"&&(u.presentCount+=1),D==="falta_justificada"&&(u.justifiedCount+=1),D==="falta_injustificada"&&(u.unjustifiedCount+=1),D==="canjear_bono"&&(u.recoveryCount+=1),B.set(M,u)})});const z=Array.from(B.values()).sort((a,n)=>{const b=a.pastPendingCount*10+a.justifiedCount*6+a.unjustifiedCount*4,v=n.pastPendingCount*10+n.justifiedCount*6+n.unjustifiedCount*4;return v!==b?v-b:a.studentName.localeCompare(n.studentName,"es-ES")}),J=z.filter(a=>a.pastPendingCount>0||a.justifiedCount>0||a.unjustifiedCount>0),_e=z.filter(a=>a.justifiedCount>0).length,q=z.filter(a=>a.pastPendingCount>0).length,Ne=z.filter(a=>a.unjustifiedCount>0).length,pe=Ra({teacherName:l.name||l.full_name||"Profe",teacherEmail:l.email||"",summary:x}),ke=ua.filter(a=>a.month_key===x.monthKey),Ia=a=>
23{if(!a)return;const n=new Date(`${a}T12:00:00`);Number.isNaN(n.getTime())||(ae(new Date(n.getFullYear(),n.getMonth(),1)),ce(a))},Ke=async()=>{if(l!=null&&l.email){if(x.totalClasses===0){alert(`No hay clases visibles para ${x.monthLabel}.`);return}Fe(!0);try{const a=Ya({teacherName:l.name||l.full_name||"Profe",summary:x,appUrl:ia});await ea({to:l.email,subject:`Prevision docente · ${x.monthLabel} · ${l.name||l.full_name||"Monitor"}`,html:a}),alert(`â Prevision enviada a ${l.email}`)}catch(a){alert(`No se ha podido enviar la prevision: ${a.message}`)}finally{Fe(!1)}}},La=(a=!1)=>{if(x.totalClasses===0){alert(`No hay clases visibles para ${x.monthLabel}.`);return}const n=window.open("","_blank");if(!n){alert("â ï¸ Permite las ventanas emergentes para poder abrir o imprimir la prevision.");return}n.document.open(),n.document.write(pe),n.document.close(),n.focus(),a&&setTimeout(()=>{n.print()},700)},Qe=()=>La(!0),Ta=()=>{const a=document.getElementById("printable-contract");if(!a)return;const n=l.name||l.full_name||"Monitor",b=window.open("","_blank");b?(b.document.write(` 24 <html> 25 <head> 26 <title>Contrato_${n.replace(/\s+/g,"_")}</title> 27 <script src="https://cdn.tailwindcss.com"><\/script> 28 <style> 29 @page { margin: 20mm; } 30 body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } 31 </style> 32 </head> 33 <body class="bg-white text-black font-sans p-8 max-w-4xl mx-auto"> 34 ${a.innerHTML} 35 </body> 36 </html> 37 `),b.document.close(),b.focus(),setTimeout(()=>{b.print(),b.close()},1e3)):alert("â ï¸ Por favor, permite las ventanas emergentes (pop-ups) en tu navegador para poder generar el PDF.")};return e.jsxs("div",{className:"max-w-md mx-auto w-full min-h-screen bg-[#F5F7FA] p-6 text-left pb-24 overflow-y-auto font-sans animate-in slide-in-from-right-8 duration-300 relative",children:[ga&&e.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-gray-900/85 p-3 backdrop-blur-sm",children:e.jsxs("div",{className:"flex h-[94vh] w-full max-w-6xl flex-col overflow-hidden rounded-[32px] border border-gray-100 bg-white shadow-2xl",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-100 px-5 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-blue-600",children:"Correo de bienvenida pendiente"}),e.jsx("h3",{className:"text-base font-black text-gray-900",children:l.name||l.full_name}),e.jsxs("p",{className:"mt-1 break-all text-xs font-bold text-gray-500",children:["Para: ",l.email]})]}),e.jsx("button",{type:"button",onClick:()=>ie(!1),disabled:O||W,className:"h-10 w-10 rounded-full bg-gray-100 text-sm font-black text-gray-600 disabled:opacity-60",children:"X"})]}),e.jsx("div",{className:"border-b border-amber-200 bg-amber-50 px-5 py-3 text-[11px] font-bold text-amber-900",children:"Guardar conserva el borrador. Solo el botón final, después de confirmarlo, envÃa el correo."}),e.jsxs("div",{className:"grid min-h-0 flex-1 lg:grid-cols-2",children:[e.jsxs("div",{className:"min-h-0 overflow-y-auto border-b border-gray-100 p-5 lg:border-b-0 lg:border-r",children:[e.jsx("label",{className:"block text-[10px] font-black uppercase tracking-widest text-gray-500",children:"Asunto"}),e.jsx("input",{value:k.subject,onChange:a=>he(n=>({...n,subject:a.target.value})),disabled:O||W,className:"mt-2 w-full rounded-2xl border border-gray-200 px-4 py-3 text-sm font-bold outline-none focus:border-blue-500"}),e.jsx("label",{className:"mt-5 block text-[10px] font-black uppercase tracking-widest text-gray-500",children:"Mensaje editable"}),e.jsx("textarea",{value:k.body,onChange:a=>he(n=>({...n,body:a.target.value})),disabled:O||W,className:"mt-2 min-h-[430px] w-full resize-y rounded-2xl border border-gray-200 px-4 py-3 text-sm leading-relaxed outline-none focus:border-blue-500"})]}),e.jsx("div",{className:"min-h-[360px] bg-[#EEF2F7] p-3 md:p-5",children:e.jsx("iframe",{title:"Vista previa de la bienvenida",srcDoc:sa(k.body),className:"h-full min-h-[330px] w-full rounded-[24px] border border-gray-200 bg-white shadow-sm"})})]}),e.jsxs("div",{className:"grid gap-2 border-t border-gray-100 p-4 sm:grid-cols-3",children:[e.jsx("button",{type:"button",onClick:()=>ie(!1),disabled:O||W,className:"rounded-2xl border border-gray-200 py-3 text-[10px] font-black uppercase tracking-widest text-gray-600 disabled:opacity-60",children:"Cerrar sin enviar"}),e.jsx("button",{type:"button",onClick:()=>void $a(),disabled:O||W||!k.subject.trim()||!k.body.trim(),className:"rounded-2xl border border-amber-300 bg-amber-50 py-3 text-[10px] font-black uppercase tracking-widest text-amber-800 disabled:opacity-50",children:O?"Guardando...":"Guardar borrador"}),e.jsx("button",{type:"button",onClick:()=>void Ma(),disabled:O||W||!k.subject.trim()||!k.body.trim(),className:"rounded-2xl bg-blue-600 py-3 text-[10px] font-black uppercase tracking-widest text-white disabled:opacity-50",children:W?"Enviando...":"Enviar bienvenida"})]})]})}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("button",{onClick:()=>U(null),className:"text-[#1c74e9] text-sm font-black flex items-center gap-1 hover:opacity-70 transition-opacity",children:"â¹ Atrás"}),e.jsx("h2",{className:"text-lg font-black text-gray-900",children:"Perfil Docente"}),e.jsx("div",{className:"w-10"})]}),e.jsxs("div",{className:`bg-white p-5 rounded-[32px] border ${l.currentAssignedStudents>0?"border-blue-100 shadow-blue-500/10":"border-gray-100"} flex flex-col gap-4 mb-4 shadow-sm relative overflow-hidden`,children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"w-14 h-14 bg-blue-50 rounded-2xl flex items-center justify-center text-2xl shrink-0 overflow-hidden border border-blue-100",children:l.avatar_url?e.jsx("img",{src:l.avatar_url,className:"w-full h-full object-cover",alt:"Profe"}):"ð¨âð«"}),e.jsxs("div",{className:"pr-10",children:[e.jsx("h3",{className:"font-black text-gray-900 text-base leading-tight mb-1",children:l.name||l.full_name}),e.jsx("p",{className:"text-gray-500 text-[10px] font-bold uppercase tracking-wider",children:l.email}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[l.contract_signed&&e.jsx("span",{className:"bg-slate-50 text-slate-600 text-[8px] font-black px-2 py-0.5 rounded border border-slate-200 uppercase tracking-widest",children:"Documento histórico"}),l.status==="Inactivo"&&e.jsx("span",{className:"bg-rose-50 text-rose-600 text-[8px] font-black px-2 py-0.5 rounded border border-rose-200 uppercase tracking-widest",children:"Inactivo"}),l.access_paused&&l.status!=="Inactivo"&&e.jsx("span",{className:"bg-amber-50 text-amber-700 text-[8px] font-black px-2 py-0.5 rounded border border-amber-200 uppercase tracking-widest",children:"Acceso pausado"}),l.availability_state==="Solo sustituciones"&&e.jsx("span",{className:"bg-orange-50 text-[#D86C00] text-[8px] font-black px-2 py-0.5 rounded border border-orange-200 uppercase tracking-widest",children:"Solo sustituciones"}
37),l.welcome_email_prepared_at&&!l.welcome_email_sent_at&&e.jsx("span",{className:"bg-amber-50 text-amber-700 text-[8px] font-black px-2 py-0.5 rounded border border-amber-200 uppercase tracking-widest",children:"Bienvenida pendiente"}),e.jsx("span",{className:`text-[8px] font-black px-2 py-0.5 rounded border uppercase tracking-widest ${l.currentAssignedStudents===0?"bg-slate-50 text-slate-600 border-slate-200":l.isFull?"bg-indigo-50 text-indigo-700 border-indigo-200":"bg-amber-50 text-amber-700 border-amber-200"}`,children:l.currentAssignedStudents===0?"Sin grupo base":l.currentAssignedStudents>3?`Academia ${l.currentAssignedStudents} (exc.)`:`Academia ${l.currentAssignedStudents}/3`})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-2 pt-4 border-t border-gray-50",children:[l.phone&&e.jsxs("a",{href:st(l),target:"_blank",rel:"noreferrer",className:"flex-1 text-center items-center gap-1 text-[#25D366] text-[10px] font-black uppercase bg-[#25D366]/10 px-3 py-2.5 rounded-xl border border-[#25D366]/20 transition-all hover:bg-[#25D366]/20 active:scale-95 tracking-widest",children:[e.jsx("span",{children:"ð¬"})," Pedir horario"]}),e.jsxs("button",{onClick:()=>Re(l.email),className:"flex-1 text-center items-center gap-1 text-white text-[10px] font-black uppercase bg-gray-900 px-3 py-2.5 rounded-xl border border-gray-800 transition-all hover:bg-black shadow-md shadow-gray-900/20 active:scale-95 tracking-widest",children:[e.jsx("span",{children:"ðï¸"})," Ver área de profesora"]})]}),l.welcome_email_prepared_at&&!l.welcome_email_sent_at&&e.jsx("button",{type:"button",onClick:Pa,className:"w-full rounded-xl border border-amber-300 bg-amber-50 px-3 py-3 text-[10px] font-black uppercase tracking-widest text-amber-800 active:scale-95",children:"Revisar correo de bienvenida pendiente"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[e.jsx("button",{onClick:()=>Z("agenda"),className:`flex-1 py-3 rounded-2xl text-[9px] font-black uppercase tracking-widest transition-all min-w-[70px] ${T==="agenda"?"bg-gray-900 text-white shadow-lg":"bg-gray-200 text-gray-500"}`,children:"Agenda"}),e.jsx("button",{onClick:()=>Z("profile"),className:`flex-1 py-3 rounded-2xl text-[9px] font-black uppercase tracking-widest transition-all min-w-[70px] ${T==="profile"?"bg-[#1c74e9] text-white shadow-lg shadow-blue-500/30":"bg-gray-200 text-gray-500"}`,children:"Perfil ð§ "}),e.jsx("button",{onClick:()=>Z("permissions"),className:`flex-1 py-3 rounded-2xl text-[9px] font-black uppercase tracking-widest transition-all min-w-[70px] ${T==="permissions"?"bg-purple-600 text-white shadow-lg shadow-purple-500/30":"bg-gray-200 text-gray-500"}`,children:"Permisos"}),e.jsx("button",{onClick:()=>Z("contract"),className:`flex-1 py-3 rounded-2xl text-[9px] font-black uppercase tracking-widest transition-all min-w-[70px] ${T==="contract"?"bg-slate-800 text-white shadow-lg":"bg-gray-200 text-gray-500"}`,children:"Histórico ð"})]}),T==="profile"&&e.jsxs("div",{className:"bg-white p-6 rounded-[32px] border border-gray-100 shadow-sm animate-in fade-in space-y-6",children:[e.jsxs("div",{className:"bg-slate-50 p-5 rounded-2xl border border-slate-200 shadow-inner",children:[e.jsxs("h3",{className:"text-slate-700 font-black text-xs uppercase tracking-widest flex items-center gap-2 mb-3",children:[e.jsx("span",{children:"ð¡ï¸"})," Documentación docente"]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex justify-between items-center bg-white p-3 rounded-xl border border-slate-100",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-bold text-xs",children:"Acuerdo anterior"}),e.jsx("p",{className:`text-[9px] font-black uppercase tracking-widest mt-0.5 ${l.contract_signed?"text-slate-600":"text-gray-400"}`,children:l.contract_signed?"Archivado como histórico":"Sin documento anterior"})]}),l.contract_signed&&e.jsx("button",{type:"button",onClick:()=>Z("contract"),className:"bg-gray-800 hover:bg-gray-900 text-white text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-lg shadow-sm active:scale-95 transition-colors",children:"Ver Doc"})]}),e.jsxs("div",{className:"flex justify-between items-center bg-white p-3 rounded-xl border border-slate-100",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-bold text-xs",children:"Certificado D. Sexuales"}),e.jsx("p",{className:`text-[9px] font-black uppercase tracking-widest mt-0.5 ${l.certificate_url?"text-green-600":"text-red-500"}`,children:l.certificate_url?"Archivo recibido · pendiente de revisión":"Pendiente de aportar"})]}),l.certificate_url&&e.jsx("button",{type:"button",onClick:()=>void Ua("teacher_documents",l.certificate_url).catch(()=>alert("No se ha podido abrir el certificado. Revisa tu acceso o vuelve a intentarlo.")),className:"bg-[#1c74e9] hover:bg-blue-600 text-white text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-lg shadow-sm shadow-blue-500/20 active:scale-95 transition-colors",children:"Ver Doc"})]})]})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-gray-900 font-black text-sm uppercase tracking-widest flex items-center gap-2 mb-1",children:[e.jsx("span",{children:"ð§ "})," Inteligencia Docente"]}),e.jsx("p",{className:"text-[10px] text-gray-400 font-bold leading-relaxed",children:"Toda la información del profesor para emparejarlo con alumnos."})]}),e.jsx("form",{onSubmit:Ve,className:"space-y-4",children:e.jsxs("div",{className:"bg-white border border-gray-100 rounded-[28px] p-5 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 bg-slate-50 border border-slate-200 rounded-2xl p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-500",children:E?"Perfil profesional en edición":"Perfil profesional en solo lectura"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold mt-1",children:E?"Aquà ajustas materias, zonas y disponibilidad real del profesor.":"Pulsa editar para tocar solo el perfil docente y sus huecos."})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:E?e.
37jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:We,className:"bg-white text-gray-600 border border-gray-200 text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl",children:"Cancelar"}),e.jsx("button",{type:"submit",disabled:V,className:"bg-[#1c74e9] text-white text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl shadow-lg shadow-blue-500/20",children:V?"Guardando...":"Guardar"})]}):e.jsx("button",{type:"button",onClick:()=>X(!0),className:"bg-white text-[#1c74e9] border border-blue-100 text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl",children:"Editar"})})]}),e.jsxs("fieldset",{disabled:!E||V,className:`space-y-4 ${E?"":"opacity-80"}`,children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Modalidad de trabajo"}),e.jsxs("select",{value:s.work_modality,onChange:a=>o({...s,work_modality:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors",children:[e.jsx("option",{value:"",children:"Sin definir"}),f.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Titulación / Estudios"}),e.jsx("input",{type:"text",placeholder:"Ej: Grado en Matemáticas, Magisterio...",value:s.studies,onChange:a=>o({...s,studies:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Niveles / Especialidad"}),e.jsx("textarea",{rows:2,placeholder:"Ej: Primaria, 1º ESO, 2º Bachillerato...",value:s.specialty,onChange:a=>o({...s,specialty:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors resize-none"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-emerald-100 bg-emerald-50",children:[e.jsxs("div",{className:"pr-3",children:[e.jsx("p",{className:"text-emerald-900 font-bold text-xs flex items-center gap-2",children:"Crear clases extra"}),e.jsx("p",{className:"text-emerald-700 text-[9px] font-bold mt-1 leading-relaxed",children:"Permite que este profesor cree clases extra puntuales para alumnos ya asignados. Quedan marcadas en agenda para coordinacion."})]}),e.jsx("button",{type:"button",onClick:()=>o({...s,can_create_extra_classes:!s.can_create_extra_classes}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.can_create_extra_classes?"bg-emerald-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.can_create_extra_classes?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:`p-3 rounded-xl border ${s.access_paused?"border-amber-200 bg-amber-50":"border-slate-100 bg-slate-50"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"pr-3",children:[e.jsx("p",{className:"text-slate-900 font-bold text-xs flex items-center gap-2",children:"Pausar acceso a la app"}),e.jsx("p",{className:"text-slate-500 text-[9px] font-bold mt-1 leading-relaxed",children:"Bloquea temporalmente la entrada al panel sin borrar clases, pagos ni historial. Se puede reactivar cuando quieras."})]}),e.jsx("button",{type:"button",onClick:()=>o({...s,access_paused:!s.access_paused}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.access_paused?"bg-amber-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.access_paused?"translate-x-4":"translate-x-0"}`})})]}),s.access_paused&&e.jsx("textarea",{rows:3,value:s.access_pause_message,onChange:a=>o({...s,access_pause_message:a.target.value}),className:"mt-3 w-full bg-white border border-amber-200 p-3 rounded-xl text-xs font-bold text-slate-800 outline-none focus:border-amber-500 transition-colors resize-none",placeholder:"Mensaje suave que vera la profesora al intentar entrar."})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Teléfono (WhatsApp)"}),e.jsx("input",{type:"tel",value:s.phone,onChange:a=>o({...s,phone:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Dirección"}),e.jsx("input",{type:"text",placeholder:"Ej: Calle Real 15",value:s.address_line,onChange:a=>o({...s,address_line:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Detalles de dirección"}),e.jsx("input",{type:"text",placeholder:"Ej: Portal 2, 3ºB, Urbanización...",value:s.address_details,onChange:a=>o({...s,address_details:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Código postal"}),e.jsx("input",{type:"text",placeholder:"Ej: 18140",value:s.postal_code,onChange:a=>o({...s,postal_code:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Localidad / zona"}),e.jsx("input",{type:"text",placeholder:"Ej: La Zubia",value:s.location,onChange:a=>o({...s,location:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Provincia"}),e.jsx("input",{type:"text",placeholder:"Ej: Granada",value:s.province,onChange:a=>o({...s,province:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Asignaturas"}),e.jsx("textarea",{rows:3,placeholder:"Ej: Matemáticas Bach Ciencias, Matemáticas Bach Sociales, FÃ
37sica...",value:s.subjects,onChange:a=>o({...s,subjects:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Disponibilidad general"}),e.jsx("textarea",{rows:3,placeholder:"Ej: domicilio algunos dÃas, online por las noches, preferencia por academia...",value:s.availability_notes,onChange:a=>o({...s,availability_notes:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors resize-none"})]}),e.jsx(Ga,{weeklyAvailability:s.weekly_availability,summerAvailability:s.summer_availability,availabilityState:s.availability_state,availabilityNotes:s.availability_update_notes,availabilityLastConfirmedAt:s.availability_last_confirmed_at,disabled:!E||V,notesLabel:"Nota sobre cambios de horario",notesPlaceholder:"Ej: solo hasta junio o cambia por oposiciones.",onStateChange:a=>o(n=>({...n,availability_state:a})),onNotesChange:a=>o(n=>({...n,availability_update_notes:a})),onChangeValue:Ca}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-2",children:"Movilidad y academia"}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-gray-100 bg-gray-50",children:[e.jsx("p",{className:"text-gray-900 font-bold text-xs flex items-center gap-2",children:"VehÃculo propio"}),e.jsx("button",{type:"button",onClick:()=>o({...s,has_vehicle:!s.has_vehicle}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.has_vehicle?"bg-green-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.has_vehicle?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-gray-100 bg-gray-50",children:[e.jsx("p",{className:"text-gray-900 font-bold text-xs flex items-center gap-2",children:"Llega en metro"}),e.jsx("button",{type:"button",onClick:()=>o({...s,has_metro:!s.has_metro}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.has_metro?"bg-[#1c74e9]":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.has_metro?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-gray-100 bg-gray-50",children:[e.jsx("p",{className:"text-gray-900 font-bold text-xs flex items-center gap-2",children:"Academia (La Zubia)"}),e.jsx("button",{type:"button",onClick:()=>o({...s,wants_academy:!s.wants_academy}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.wants_academy?"bg-indigo-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.wants_academy?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-violet-100 bg-violet-50",children:[e.jsxs("div",{className:"pr-3",children:[e.jsx("p",{className:"text-violet-900 font-bold text-xs flex items-center gap-2",children:"Captar visitas en academia"}),e.jsx("p",{className:"text-violet-700 text-[9px] font-bold mt-1 leading-relaxed",children:"ActÃvalo solo si coordinación le pide a este profesor recoger los datos de una familia que entra a preguntar durante su clase."})]}),e.jsx("button",{type:"button",onClick:()=>o({...s,can_capture_walkin_leads:!s.can_capture_walkin_leads}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.can_capture_walkin_leads?"bg-violet-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.can_capture_walkin_leads?"translate-x-4":"translate-x-0"}`})})]})]}),e.jsx("div",{className:"pt-2",children:e.jsx("p",{className:"text-[10px] text-gray-400 font-bold text-center",children:E?"Los cambios del perfil docente se aplican solo al guardar este bloque.":"Perfil docente protegido para evitar cambios accidentales."})})]})]})}),e.jsx("form",{onSubmit:Aa,className:"space-y-4",children:e.jsxs("div",{className:"bg-blue-50/50 border border-blue-100 rounded-[28px] p-5 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 bg-white/70 border border-blue-100 rounded-2xl p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-[#1c74e9]",children:de?"Datos de cobro en edición":"Datos de cobro protegidos"}),e.jsx("p",{className:"text-[10px] text-slate-500 font-bold mt-1",children:"Este bloque solo guarda DNI/NIE e IBAN para pagos y facturación."})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:de?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:ka,className:"bg-white text-gray-600 border border-gray-200 text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl",children:"Cancelar"}),e.jsx("button",{type:"submit",disabled:fe,className:"bg-[#1c74e9] text-white text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl shadow-lg shadow-blue-500/20",children:fe?"Guardando...":"Guardar"})]}):e.jsx("button",{type:"button",onClick:()=>oe(!0),className:"bg-white text-[#1c74e9] border border-blue-100 text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl",children:"Editar"})})]}),e.jsxs("fieldset",{disabled:!de||fe,className:`space-y-3 ${de?"":"op
37acity-80"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("label",{className:"text-[10px] font-black text-[#1c74e9] uppercase tracking-widest",children:"DNI y cuenta bancaria"}),e.jsx("span",{className:`text-[8px] font-black px-2 py-1 rounded uppercase tracking-widest ${s.iban?"bg-green-100 text-green-700":"bg-red-100 text-red-600"}`,children:s.iban?"Listo":"Falta IBAN"})]}),e.jsx("input",{type:"text",placeholder:"DNI / NIE (Ej: 12345678Z)",value:s.dni,onChange:a=>o({...s,dni:a.target.value.toUpperCase()}),className:"w-full bg-white border border-blue-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"}),e.jsx("input",{type:"text",placeholder:"IBAN (Ej: ES1234...)",value:s.iban,onChange:a=>o({...s,iban:a.target.value.toUpperCase().replace(/\s/g,"")}),className:"w-full bg-white border border-blue-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"}),e.jsx("p",{className:"text-[10px] text-slate-500 font-bold leading-relaxed",children:"Aquà no tocamos materias ni disponibilidad. Solo los datos necesarios para que caja pueda preparar pagos y documentación."})]})]})}),e.jsxs("form",{onSubmit:Ve,className:"hidden",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 bg-slate-50 border border-slate-200 rounded-2xl p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-500",children:E?"Modo edición activo":"Solo lectura"}),e.jsx("p",{className:"text-[10px] text-slate-400 font-bold mt-1",children:E?"Revisa los cambios antes de guardar.":"Pulsa editar para tocar los datos del perfil docente."})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:E?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:We,className:"bg-white text-gray-600 border border-gray-200 text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl",children:"Cancelar"}),e.jsx("button",{type:"submit",disabled:V,className:"bg-[#1c74e9] text-white text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl shadow-lg shadow-blue-500/20",children:V?"Guardando...":"Guardar"})]}):e.jsx("button",{type:"button",onClick:()=>X(!0),className:"bg-white text-[#1c74e9] border border-blue-100 text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl",children:"Editar"})})]}),e.jsxs("fieldset",{disabled:!E||V,className:`space-y-4 ${E?"":"opacity-80"}`,children:[e.jsxs("div",{className:"bg-blue-50/50 p-4 rounded-2xl border border-blue-100 mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("label",{className:"text-[10px] font-black text-[#1c74e9] uppercase tracking-widest flex items-center gap-1",children:"ð³ Datos de Pago (Caja)"}),e.jsx("span",{className:`text-[8px] font-black px-2 py-1 rounded uppercase tracking-widest ${s.iban?"bg-green-100 text-green-700":"bg-red-100 text-red-600"}`,children:s.iban?"Ok":"Falta IBAN"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{children:e.jsx("input",{type:"text",placeholder:"DNI / NIE (Ej: 12345678Z)",value:s.dni,onChange:a=>o({...s,dni:a.target.value.toUpperCase()}),className:"w-full bg-white border border-blue-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})}),e.jsx("div",{children:e.jsx("input",{type:"text",placeholder:"IBAN (Ej: ES1234...)",value:s.iban,onChange:a=>o({...s,iban:a.target.value.toUpperCase().replace(/\s/g,"")}),className:"w-full bg-white border border-blue-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Modalidad de trabajo"}),e.jsxs("select",{value:s.work_modality,onChange:a=>o({...s,work_modality:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors",children:[e.jsx("option",{value:"",children:"Sin definir"}),f.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Titulacion / Estudios"}),e.jsx("input",{type:"text",placeholder:"Ej: Grado en Matemáticas, Magisterio...",value:s.studies,onChange:a=>o({...s,studies:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Niveles / Especialidad"}),e.jsx("textarea",{rows:2,placeholder:"Ej: Primaria, 1º ESO, 2º Bachillerato...",value:s.specialty,onChange:a=>o({...s,specialty:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors resize-none"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Teléfono (WhatsApp)"}),e.jsx("input",{type:"tel",value:s.phone,onChange:a=>o({...s,phone:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Dirección"}),e.jsx("input",{type:"text",placeholder:"Ej: Calle Real 15",value:s.address_line,onChange:a=>o({...s,address_line:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Detalles de dirección"}),e.jsx("input",{type:"text",placeholder:"Ej: Portal 2, 3ºB, Urbanización...",value:s.address_details,onChange:a=>o({...s,address_details:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Código postal"}),e.jsx("input",{type:"text",placeholder:"Ej: 18140",value:s.postal_code,onChange:a=>o({...s,postal_code:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Localidad / zona"}),e.jsx("input",{type:"text",placeholder:"Ej: La Zubia",value:s.location,onChange:a=>o({...s,location:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Provincia"}),e.jsx("input",{type:"text",placeholder:"Ej: Granada",value:s.province,onChange:a=>o({...s,province:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Asignaturas"}),e.jsx("textarea",{rows:3,placeholder:"Ej: Matemáticas Bach Ciencias, Matemáticas Bach Sociales, FÃ
37sica...",value:s.subjects,onChange:a=>o({...s,subjects:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-1",children:"Disponibilidad general"}),e.jsx("textarea",{rows:3,placeholder:"Ej: tardes entre semana, mañanas en verano, disponibilidad para domicilio...",value:s.availability_notes,onChange:a=>o({...s,availability_notes:a.target.value}),className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors resize-none"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 border-t border-gray-100 pt-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-[#1c74e9] uppercase tracking-widest block mb-1",children:"âï¸ Disp. Invierno"}),e.jsx("input",{type:"text",value:s.winter_schedule,onChange:a=>o({...s,winter_schedule:a.target.value}),className:"w-full bg-blue-50/50 border border-blue-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-[#1c74e9] transition-colors"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-orange-500 uppercase tracking-widest block mb-1",children:"âï¸ Disp. Verano"}),e.jsx("input",{type:"text",value:s.summer_schedule,onChange:a=>o({...s,summer_schedule:a.target.value}),className:"w-full bg-orange-50/50 border border-orange-100 p-3 rounded-xl text-xs font-bold outline-none focus:border-orange-500 transition-colors"})]})]}),e.jsxs("div",{className:"space-y-2 border-t border-gray-100 pt-4",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest block mb-2",children:"Movilidad"}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-gray-100 bg-gray-50",children:[e.jsx("p",{className:"text-gray-900 font-bold text-xs flex items-center gap-2",children:"ð VehÃculo Propio"}),e.jsx("button",{type:"button",onClick:()=>o({...s,has_vehicle:!s.has_vehicle}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.has_vehicle?"bg-green-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.has_vehicle?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-gray-100 bg-gray-50",children:[e.jsx("p",{className:"text-gray-900 font-bold text-xs flex items-center gap-2",children:"ð Llega en Metro"}),e.jsx("button",{type:"button",onClick:()=>o({...s,has_metro:!s.has_metro}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.has_metro?"bg-[#1c74e9]":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.has_metro?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-gray-100 bg-gray-50",children:[e.jsx("p",{className:"text-gray-900 font-bold text-xs flex items-center gap-2",children:"ð« Academia (La Zubia)"}),e.jsx("button",{type:"button",onClick:()=>o({...s,wants_academy:!s.wants_academy}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.wants_academy?"bg-indigo-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.wants_academy?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-violet-100 bg-violet-50",children:[e.jsxs("div",{className:"pr-3",children:[e.jsx("p",{className:"text-violet-900 font-bold text-xs flex items-center gap-2",children:"ð§² Captar visitas en academia"}),e.jsx("p",{className:"text-violet-700 text-[9px] font-bold mt-1 leading-relaxed",children:"Activalo solo si coordinacion le pide a este profesor recoger los datos de una familia que entra a preguntar durante su clase."})]}),e.jsx("button",{type:"button",onClick:()=>o({...s,can_capture_walkin_leads:!s.can_capture_walkin_leads}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.can_capture_walkin_leads?"bg-vi
37olet-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.can_capture_walkin_leads?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-emerald-100 bg-emerald-50",children:[e.jsxs("div",{className:"pr-3",children:[e.jsx("p",{className:"text-emerald-900 font-bold text-xs flex items-center gap-2",children:"Crear clases extra"}),e.jsx("p",{className:"text-emerald-700 text-[9px] font-bold mt-1 leading-relaxed",children:"Permite que este profesor cree clases extra puntuales para alumnos ya asignados. Quedan marcadas en agenda para coordinacion."})]}),e.jsx("button",{type:"button",onClick:()=>o({...s,can_create_extra_classes:!s.can_create_extra_classes}),className:`w-10 h-6 rounded-full flex items-center p-1 transition-colors shrink-0 ${s.can_create_extra_classes?"bg-emerald-500":"bg-gray-300"}`,children:e.jsx("div",{className:`w-4 h-4 bg-white rounded-full shadow-md transition-transform ${s.can_create_extra_classes?"translate-x-4":"translate-x-0"}`})})]})]}),e.jsx("div",{className:"pt-4",children:e.jsx("p",{className:"text-[10px] text-gray-400 font-bold text-center",children:E?"Los cambios del perfil docente solo se aplican al guardar.":"Perfil protegido para evitar cambios accidentales."})})]})]}),e.jsx("div",{className:"mt-8 pt-6 border-t border-red-100",children:e.jsxs("div",{className:"bg-slate-50 p-5 rounded-2xl border border-slate-200",children:[e.jsx("h4",{className:"text-slate-700 font-black text-sm uppercase tracking-widest mb-1",children:"Estado del perfil"}),e.jsx("p",{className:"text-slate-500 text-[10px] font-bold mb-4",children:"La baja es reversible: conserva historial, documentos y clases, deja de ofrecer al profesor en Agenda y pausa su acceso."}),e.jsx("button",{onClick:Ea,className:"w-full bg-white text-[#066591] border border-sky-200 font-black uppercase text-[10px] tracking-widest py-3 rounded-xl hover:bg-sky-50 transition-colors",children:l.status==="Inactivo"?"Reactivar perfil":"Pasar a inactivo"})]})})]}),T==="contract"&&e.jsxs("div",{className:"bg-white p-6 rounded-[32px] border border-gray-100 shadow-sm animate-in fade-in space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("h3",{className:"text-gray-900 font-black text-sm uppercase tracking-widest flex items-center gap-2",children:[e.jsx("span",{children:"ð"})," Documento anterior"]}),l.contract_signed&&e.jsx("button",{onClick:Ta,className:"bg-[#1c74e9] text-white text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-xl shadow-lg active:scale-95 transition-colors",children:"Imprimir PDF"})]}),l.contract_signed?e.jsxs("div",{id:"printable-contract",className:"p-6 border border-gray-200 rounded-2xl bg-gray-50 text-xs text-gray-800 font-sans",children:[e.jsxs("div",{className:"text-center mb-6 border-b-2 border-black/10 pb-4",children:[e.jsx("h2",{className:"text-xl font-black uppercase tracking-tighter text-gray-900",children:"Profe en Casa"}),e.jsx("p",{className:"text-[9px] font-bold tracking-widest uppercase text-gray-500 mt-1",children:"Archivo histórico · no acredita el alta laboral actual"})]}),e.jsxs("div",{className:"mb-4 p-3 bg-white border border-gray-200 rounded-xl",children:[e.jsxs("p",{className:"mb-1",children:[e.jsx("strong",{className:"font-black text-gray-900 uppercase text-[9px] tracking-widest block",children:"La Empresa:"})," Profe en Casa (La Zubia)"]}),e.jsxs("p",{children:[e.jsx("strong",{className:"font-black text-gray-900 uppercase text-[9px] tracking-widest block mt-2",children:"El Colaborador:"})," ",l.name," ",e.jsx("br",{})," ",l.email]})]}),e.jsxs("div",{className:"text-[10px] leading-relaxed text-justify space-y-3 mb-6",children:[e.jsx("p",{children:"Ambas partes acuerdan las siguientes normas de colaboración:"}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-gray-900",children:"1. MODALIDADES:"})," El colaborador se compromete a mantener los estándares de calidad exigidos: puntualidad y respeto en ",e.jsx("em",{className:"font-bold",children:"Domicilios"}),", entorno libre de ruidos en ",e.jsx("em",{className:"font-bold",children:"Online"}),", y dinamización equitativa en la ",e.jsx("em",{className:"font-bold",children:"Academia (Profe a 3)"}),"."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-gray-900",children:"2. USO DEL SISTEMA:"})," Es obligatorio el fichaje al llegar a la clase mediante la App y la redacción del reporte académico al finalizar. Las emergencias deberán comunicarse con máxima antelación."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-gray-900",children:"3. HONORARIOS:"})," Se abonarán las horas reales registradas. Los pagos se realizarán del 1 al 5 del mes vencido vÃa transferencia o Bizum."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-gray-900",children:"4. NO COMPETENCIA:"})," El colaborador asume la prohibición expresa de ofrecer servicios particulares a las familias de la empresa por vÃas externas, asà como su responsabilidad legal sobre esta colaboración esporádica."]})]}),e.jsxs("div",{className:"border-t-2 border-gray-200 pt-4 mt-4",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-gray-500 mb-2",children:"Firmado digitalmente y aceptado por el colaborador:"}),e.jsx("div",{className:"w-full max-w-[200px] mx-auto border-b border-gray-300 pb-2 mb-2",children:e.jsx("img",{src:(He=ve(l))==null?void 0:He.image,alt:"Firma Monitor",className:"w-full h-auto object-contain max-h-[80px] filter contrast-125"})}),e.jsxs("div",{className:"text-center font-mono text-[8px] text-gray-500",children:[e.jsxs("p",{children:["Sello de Tiempo: ",e.jsx("strong",{className:"text-gray-800",children:(Ze=ve(l))==null?void 0:Ze.date})]}),e.jsxs("p",{children:["Firma IP: ",e.jsx("strong",{className:"text-gray-800",children:(Je=ve(l))==null?void 0:Je.ip})]})]})]})]}):e.jsxs("div",{className:"text-center py-10 bg-gray-50 rounded-2xl border border-gray-100",children:[e.jsx("span",{className:"text-3xl block mb-2",children:"ð"}),e.jsx("p",{className:"text-gray-500 font-bold text-xs uppercase tracking-widest",children:"No existe documento anterior"})]})]}),T==="permissions"&&_&&e.jsxs("div",{className:"bg-white p-6 rounded-[32px] border border-gray-100 shadow-sm animate-in fade-in",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("h3",{className:"text-gray-900 font-black text-sm uppercase tracking-widest flex items-center gap-2",children:[e.jsx("span",{children:"ð"})," Panel de Control"]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl border border-sky-100 bg-sky-50",children:[e.jsxs("div",{className:"pr-4",children:[e.jsx("p",{className:"text-[#066591] font-black text-xs",children:"Finanzas y Caja"}),e.jsx("p",{className:"mt-1 text-[9px] font-bold text-sky-700",children:"Acceso reservado a Direccion."})]}),e.jsx("span",{className:"rounded-full bg-white px-3 py-1 text-[8px] font-black uppercase text-[#066591]",children:"Solo Direccion"})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl border border-gray-100 hover:bg-gray-50 transition-colors",children:[e.jsx("div",{className:"pr-4",children:e.jsx("p",{className:"text-gray-900 font-black text-xs",children:"Validar Clases âï¸"})}),e.jsx("button",{disabled:ee,onClick:()=>se("can_validate_classes",_.can_validate_classes),className:`w-12 h-7 rounded-full flex items-center p-1 transition-colors shrink-0 ${_.can_validate_classes?"bg-[#1c74e9]":"bg-gray-300"}`,children:e.jsx("div",{className:`w-5 h-5 bg-white rounded-full shadow-md transition-transform ${_.can_validate_classes?"translate-x-5":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl border border-gray-100 hover:bg-gray-50 transition-colors",children:[e.jsx("div",{className:"pr-4",children:e.jsx("p",{className:"text-gray-900 font-black text-xs",children:"Usar Bitácora Padres ð"})}),e.jsx("button",{disabled:ee,onClick:()=>se("can_use_bitacora",_.can_use_bitacora),className:`w-12 h-7 rounded-full flex items-center p-1 transition-colors shrink-0 ${_.can_use_bitacora?"bg-[#1c74e9]":"bg-gray-300"}`,children:e.jsx("div",{className:`w-5 h-5 bg-white rounded-full shadow-md transition-transform ${_.can_use_bitacora?"translate-x-5":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl border border-gray-100 hover:bg-gray-50 transition-colors",children:[e.jsx("div",{className:"pr-4",children:e.jsx("p",{className:"text-gray-900 font-black text-xs",children:"Ver Plantilla Docente ð¨âð«"})}),e.jsx("button",{disabled:ee,onClick:()=>se("can_view_team",_.can_view_team),className:`w-12 h-7 rounded-full flex items-center p-1 transition-colors shrink-0 ${_.can_view_team?"bg-[#1c74e9]":"bg-gray-300"}`,children:e.jsx("div",{className:`w-5 h-5 bg-white rounded-full shadow-md transition-transform ${_.can_view_team?"translate-x-5":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl border border-gray-100 hover:bg-gray-50 transition-colors",children:[e.jsx("div",{className:"pr-4",children:e.jsx("p",{className:"text-gray-900 font-black text-xs",children:"Asignar Alumnos ð"})}),e.jsx("button",{disabled:ee,onClick:()=>se("can_assign_students",_.can_assign_students),className:`w-12 h-7 rounded-full flex items-center p-1 transition-colors shrink-0 ${_.can_assign_students?"bg-[#1c74e9]":"bg-gray-300"}`,children:e.jsx("div",{className:`w-5 h-5 bg-white rounded-full shadow-md transition-transform ${_.can_assign_students?"translate-x-5":"translate-x-0"}`})})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl border border-gray-100 hover:bg-gray-50 transition-colors",children:[e.jsx("div",{className:"pr-4",children:e.jsx("p",{className:"text-gray-900 font-black text-xs",children:"Agenda General del Centro ð
"})}),e.jsx("button",{disabled:ee,onClick:()=>
37se("can_manage_calendar",_.can_manage_calendar),className:`w-12 h-7 rounded-full flex items-center p-1 transition-colors shrink-0 ${_.can_manage_calendar?"bg-[#1c74e9]":"bg-gray-300"}`,children:e.jsx("div",{className:`w-5 h-5 bg-white rounded-full shadow-md transition-transform ${_.can_manage_calendar?"translate-x-5":"translate-x-0"}`})})]})]})]}),T==="agenda"&&e.jsxs("div",{className:"animate-in fade-in",children:[e.jsxs("div",{className:"bg-white p-5 rounded-[32px] border border-gray-100 shadow-sm mb-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",children:"Prevision docente"}),e.jsx("p",{className:"text-gray-900 text-lg font-black mt-1",children:x.monthLabel}),e.jsx("p",{className:"text-[10px] text-gray-400 font-bold mt-1 leading-relaxed",children:"Primero elige el mes, revisa el resumen y envia al monitor solo cuando lo veas listo."})]}),e.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[e.jsx("p",{className:"text-[8px] text-gray-400 font-black uppercase tracking-widest text-center",children:"Acciones"}),e.jsx("button",{type:"button",onClick:()=>ge(!0),disabled:x.totalClasses===0,className:`px-4 py-3 rounded-2xl text-[10px] font-black uppercase tracking-widest ${x.totalClasses===0?"bg-gray-200 text-gray-400 cursor-not-allowed":"bg-white text-[#1c74e9] border border-blue-100"}`,children:"Ver documento"}),e.jsx("button",{type:"button",onClick:Qe,disabled:x.totalClasses===0,className:`px-4 py-3 rounded-2xl text-[10px] font-black uppercase tracking-widest ${x.totalClasses===0?"bg-gray-200 text-gray-400 cursor-not-allowed":"bg-purple-600 text-white shadow-lg shadow-purple-500/20"}`,children:"Imprimir PDF"}),e.jsx("button",{type:"button",onClick:Ke,disabled:H||x.totalClasses===0,className:`px-4 py-3 rounded-2xl text-[10px] font-black uppercase tracking-widest ${H||x.totalClasses===0?"bg-gray-200 text-gray-400 cursor-not-allowed":"bg-[#1c74e9] text-white shadow-lg shadow-blue-500/20"}`,children:H?"Enviando...":"Enviar prevision"})]})]}),e.jsxs("div",{className:"bg-blue-50 border border-blue-100 rounded-[24px] p-4 mb-4",children:[e.jsx("p",{className:"text-[#1c74e9] text-[9px] font-black uppercase tracking-widest mb-3",children:"1. Mes que estas revisando"}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("button",{type:"button",onClick:qe,className:"bg-white text-[#1c74e9] border border-blue-100 rounded-2xl px-3 py-3 text-[10px] font-black uppercase tracking-widest shadow-sm active:scale-95",children:"Ant."}),e.jsxs("div",{className:"text-center min-w-0",children:[e.jsxs("p",{className:"text-gray-900 text-xl font-black leading-none",children:[je[p.getMonth()]," ",p.getFullYear()]}),e.jsx("p",{className:"text-blue-500 text-[9px] font-black uppercase tracking-widest mt-1",children:"El informe se calcula con este mes"})]}),e.jsx("button",{type:"button",onClick:Oe,className:"bg-white text-[#1c74e9] border border-blue-100 rounded-2xl px-3 py-3 text-[10px] font-black uppercase tracking-widest shadow-sm active:scale-95",children:"Sig."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-3",children:[e.jsx("button",{type:"button",onClick:()=>ae(new Date(F.getFullYear(),F.getMonth(),1)),className:"bg-white text-gray-700 border border-blue-100 rounded-2xl py-3 text-[10px] font-black uppercase tracking-widest",children:"Este mes"}),e.jsx("button",{type:"button",onClick:()=>ae(new Date(F.getFullYear(),F.getMonth()+1,1)),className:"bg-[#1c74e9] text-white rounded-2xl py-3 text-[10px] font-black uppercase tracking-widest shadow-lg shadow-blue-500/20",children:"Mes siguiente"})]})]}),e.jsx("p",{className:"text-gray-400 text-[9px] font-black uppercase tracking-widest mb-2",children:"2. Resumen rapido del mes"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[e.jsxs("div",{className:"bg-slate-50 rounded-2xl border border-slate-200 p-3 text-center",children:[e.jsx("p",{className:"text-slate-500 text-[8px] font-black uppercase tracking-widest",children:"Clases"}),e.jsx("p",{className:"text-gray-900 text-lg font-black leading-none mt-1",children:x.totalClasses})]}),e.jsxs("div",{className:"bg-slate-50 rounded-2xl border border-slate-200 p-3 text-center",children:[e.jsx("p",{className:"text-slate-500 text-[8px] font-black uppercase tracking-widest",children:"Horas"}),e.jsxs("p",{className:"text-gray-900 text-lg font-black leading-none mt-1",children:[x.totalHours.toFixed(1)," h"]})]}),e.jsxs("div",{className:"bg-slate-50 rounded-2xl border border-slate-200 p-3 text-center",children:[e.jsx("p",{className:"text-slate-500 text-[8px] font-black uppercase tracking-widest",children:"Bloques"}),e.jsx("p",{className:"text-gray-900 text-lg font-black leading-none mt-1",children:x.weeklyBlocks.length})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsxs("span",{className:"bg-emerald-50 text-emerald-700 border border-emerald-200 px-3 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest",children:[x.closedBlocks," cerrados"]}),e.jsxs("span",{className:"bg-amber-50 text-amber-700 border border-amber-200 px-3 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest",children:[x.openBlocks," abiertos"]}),e.jsxs("span",{className:"bg-blue-50 text-blue-700 border border-blue-200 px-3 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest",children:[x.individualBlocks," individuales"]})]}),e.jsx("p",{className:"text-[10px] text-gray-400 font-bold leading-relaxed",children:"Si necesitas ver los dias concretos, baja al calendario. Si solo quieres mandar el contraste al profesor, usa las acciones de arriba."}),ke.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-[24px] p-4 mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-amber-700 text-[10px] font-black uppercase tracking-widest",children:"Avisos del monitor"}),e.jsxs("p",{className:"text-[10px] text-amber-800 font-bold mt-1",children:["Ajustes enviados para ",x.monthLabel]})]}),e.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-amber-700",children:ke.length})]}),e.jsx("div",{className:"space-y-2",children:ke.map(a=>e.jsxs("div",{className:"bg-white border border-amber-100 rounded-2xl p-3",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-amber-700",children:a.feedback_type}),e.jsx("span",{className:"text-[9px] font-bold text-gray-400",children:a.created_at?new Date(a.created_at).toLocaleDateString("es-ES"):""})]}),e.jsx("p",{className:"text-[11px] text-gray-700 font-bold leading-relaxed mt-2",children:a.message})]},a.id))})]})]}),e.jsxs("div",{className:"bg-white p-5 rounded-[32px] border border-gray-100 shadow-sm mb-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-violet-600 text-[10px] font-black uppercase tracking-widest",children:"Control de cierre"}),e.jsx("p",{className:"text-gray-900 text-lg font-black mt-1",children:"Alumnos del mes"}),e.jsx("p",{className:"text-[10px] text-gray-400 font-bold mt-1 leading-relaxed",children:"Esta vista se apoya en la agenda real de esta profesora. Si una clase ya ha pasado y sigue sin fichar, sale aparte para que no confundamos ausencia con falta de cierre."})]}),e.jsxs("div",{className:"bg-violet-50 border border-violet-100 rounded-2xl px-4 py-3 text-right shrink-0",children:[e.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest text-violet-500",children:"Alumnos"}),e.jsx("p",{className:"text-xl font-black text-violet-700",children:R.length})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsxs("span",{className:"bg-white text-gray-700 border border-gray-200 px-3 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest",children:[J.length," para revisar"]}),e.jsxs("span",{className:"bg-emerald-50 text-emerald-700 border border-emerald-200 px-3 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest",children:[_e," con falta justificada"]}),e.jsxs("span",{className:"bg-orange-50 text-orange-700 border border-orange-200 px-3 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest",children:[q," con clases sin fichar"]}),e.jsxs("span",{className:"bg-red-50 text-red-700 border border-red-200 px-3 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest",children:[Ne," con falta sin avisar"]})]}),R.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:R.map(a=>e.jsx("span",{className:"bg-slate-50 text-slate-700 border border-slate-200 px-3 py-1.5 rounded-full text-[10px] font-black",children:be(a,L)},`month-student-${a}`))}),J.length===0?e.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-[24px] p-5 text-center",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-500",children:"Sin incidencias de cierre en este mes"}),e.jsx("p",{className:"text-[11px] text-slate-500 font-bold mt-2",children:"Si aparecen faltas justificadas o clases pasadas sin fichar, te las resumiremos aquà para actuar rápido antes del cierre."})]}):e.jsx("div",{className:"space-y-3",children:J.map(a=>e.jsxs("div",{className:"rounded-[24px] border border-gray-100 bg-slate-50 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-black text-gray-900",children:a.studentName}),e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-gray-400 mt-1",children:a.level})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Programadas"}),e.jsx("p",{className:"text-lg font-black text-gray-900",children:a.scheduledCount})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-3",children:[a.justifiedCount>0&&e.jsxs("span",{className:"bg-emerald-50 text-emerald-700 border border-emerald-200 px-3 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest",children:[a.justifiedCount," justificada",a.justifiedCount===1?"":"s"]}),a.unjustifiedCount>0&&e.jsxs("span",{className:"bg-red-50 text-red-700 border border-red-200 px-3 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest",children:[a.unjustifiedCount," sin avisar"]}),a.pastPendingCount>0&&e.jsxs("span",{className:"bg-orange-50 text-orange-700 border border-orange-200 px-3 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest",children:[a.pastPendingCount," pasada",a.pastPendingCount===1?"":"s"," sin fichar"]}),a.recoveryCount>0&&e.jsxs("span",{className:"bg-violet-50 text-violet-700 border border-violet-200 px-3 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest",children:[a.recoveryCount," recuperada",a.recoveryCount===1?"":"s"]}),e.jsxs("span",{className:"bg-white text-gray-500 border border-gray-200 px-3 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest",children:[a.presentCount," dadas"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-3",children:[e.jsxs("div",{className:"bg-white border border-gray-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest text-gray-400",children:"Ultima clase pasada"}),e.jsx("p",{className:"text-[11px] font-black text-gray-900 mt-2",children:a.lastClassDate?la(a.lastClassDate):"Sin clase pasada"})]}),e.jsxs("div",{className:"bg-white border border-gray-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest text-gray-400",children:"Siguiente clase"}),e.jsx("p",{className:"text-[11px] font-black text-gray-900 mt-2",children:a.nextClassDate?la(a.nextClassDate):"Sin siguiente clase"})]})]}),a.pastPendingCount>0&&e.jsx("p",{className:"text-[10px] font-bold text-orange-700 mt-3 leading-relaxed",children:"Aqui no sabemos todavia si vino o no. Primero conviene pedir a la profesora que fiche esas clases para no ofrecer recuperaciones a ciegas."})]},`audit-${a.studentName}`))})]}),ma&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/70 backdrop-blur-sm z-[9999] flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white w-full max-w-5xl h-[92vh] rounded-[32px] shadow-2xl overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest",children:"Documento previo"}),e.jsxs("p",{className:"text-gray-900 text-base font-black mt-1",children:["Prevision docente · ",x.monthLabel]})]}),e.jsx("button",{type:"button",onClick:()=>ge(!1),className:"w-9 h-9 rounded-full bg-gray-100 text-gray-600 font-black",children:"â"})]}),e.jsx("div",{className:"flex-1 bg-gray-100",children:e.jsx("iframe",{title:`Prevision docente ${x.monthLabel}`,srcDoc:pe,className:"w-full h-full border-0 bg-white"})}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-100 bg-white flex flex-wrap gap-3 justify-end",children:[e.jsx("button",{type:"button",onClick:()=>ge(!1),className:"px-4 py-3 rounded-2xl bg-gray-100 text-gray-700 text-[10px] font-black uppercase tracking-widest",children:"Cerrar"}),e.jsx("button",{type:"button",onClick:Qe,className:"px-4 py-3 rounded-2xl bg-purple-600 text-white text-[10px] font-black uppercase tracking-widest shadow-lg shadow-purple-500/20",children:"Imprimir PDF"}),e.jsx("button",{type:"button",onClick:Ke,disabled:H,className:`px-4 py-3 rounded-2xl text-[10px] font-black uppercase tracking-widest ${H?"bg-gray-200 text-gray-400 cursor-not-allowed":"bg-[#1c74e9] text-white shadow-lg shadow-blue-500/20"}`,children:H?"Enviando...":"Enviar prevision"})]})]})}),e.jsxs("div",{className:"bg-white p-5 rounded-[32px] border border-gray-100 shadow-sm mb-8",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("h3",{className:"font-black text-gray-900 text-sm uppercase tracking-widest",children:[je[p.getMonth()]," ",p.getFullYear()]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("button",{onClick:qe,className:"text-gray-400 hover:text-[#1c74e9] font-black text-lg p-1",children:"â¹"}),e.jsx("button",{onClick:Oe,className:"text-gray-400 hover:text-[#1c74e9] font-black text-lg p-1",children:"âº"})]})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-[24px] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-900 text-lg font-black leading-none",children:[je[p.getMonth()]," ",p.getFullYear()]}),e.jsx("p",{className:"text-gray-400 text-[9px] font-black uppercase tracking-widest mt-1",children:"Verde = cerrado · Naranja = academia abierta · Azul/cian = individual, domicilio u online"})]}),te&&e.jsx("button",{type:"button",onClick:()=>ce(null),className:"text-[9px] font-black uppercase tracking-widest text-[#1c74e9] bg-white border border-blue-100 px-3 py-2 rounded-xl",children:"Ver todo"})]}
37),e.jsx("div",{className:"grid grid-cols-5 gap-2 mb-2",children:Qa.map(a=>e.jsx("span",{className:"text-center text-[10px] font-black text-gray-400",children:a},a))}),e.jsx("div",{className:"grid grid-cols-5 gap-2 text-center",children:w.map((a,n)=>{if(!a)return e.jsx("div",{className:"h-[72px] rounded-2xl bg-transparent"},`empty-${n}`);const b=a.dayNumber===F.getDate()&&p.getMonth()===F.getMonth()&&p.getFullYear()===F.getFullYear(),v=te===a.date,y=a.classes.length>0,M=a.openCount>0?"border-amber-200 bg-amber-50 text-amber-700":a.closedCount>0?"border-emerald-200 bg-emerald-50 text-emerald-700":y?"border-blue-200 bg-blue-50 text-blue-700":"border-gray-200 bg-white text-gray-300";return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>y&&ce(u=>u===a.date?null:a.date),className:`h-[72px] w-full rounded-[22px] border px-1.5 py-2 flex flex-col items-center justify-between transition-all ${v?"ring-2 ring-[#1c74e9] shadow-md shadow-blue-500/10":y?"hover:-translate-y-0.5 hover:shadow-sm":""} ${b&&!y?"border-orange-200 bg-orange-50 text-orange-600":M}`,children:[e.jsx("span",{className:"text-sm font-black leading-none",children:a.dayNumber}),y?e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-1 text-[8px] font-black uppercase tracking-widest leading-none",children:[a.closedCount>0&&e.jsxs("span",{children:[a.closedCount,"C"]}),a.openCount>0&&e.jsxs("span",{children:[a.openCount,"A"]}),a.individualCount>0&&e.jsxs("span",{children:[a.individualCount,"I"]})]}):e.jsx("span",{className:"text-[8px] font-black uppercase tracking-widest opacity-40",children:"-"})]}),v&&y&&e.jsxs("div",{className:`hidden md:block absolute top-full mt-2 z-20 w-64 rounded-2xl border border-gray-200 bg-white shadow-xl p-3 ${n%5>=3?"right-0":"left-0"}`,children:[e.jsx("p",{className:"text-gray-900 text-[10px] font-black uppercase tracking-widest mb-2",children:a.date.split("-").reverse().join("/")}),e.jsx("div",{className:"space-y-2",children:a.classes.map(u=>{const D=Se(u),P=le(u.student_name),Ba=De(u.level,P,L);return e.jsx("div",{className:`rounded-xl border p-2 ${D.card}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[11px] font-black text-gray-900 leading-tight",children:[u.subject||"Refuerzo Escolar"," ",e.jsxs("span",{className:"text-[9px] text-gray-400 font-bold",children:["(",Ba,")"]})]}),e.jsxs("p",{className:"text-[9px] font-bold text-gray-500 mt-1",children:[K(u.start_time)," - ",K(u.end_time)," · ",u.modality||"Sin modalidad"]}),e.jsx("p",{className:"text-[10px] font-bold text-gray-700 mt-1",children:P.map(za=>be(za,L)).join(", ")})]}),e.jsx("span",{className:`shrink-0 text-[8px] font-black uppercase tracking-widest px-2 py-1 rounded border ${D.pill}`,children:D.label})]})},`preview-${u.id}`)})})]})]},a.date)})}),h.length>0&&e.jsx("div",{className:"mt-4 bg-white border border-orange-100 rounded-[22px] p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-orange-500 text-[10px] font-black uppercase tracking-widest",children:"Fuera de lunes a viernes"}),e.jsx("p",{className:"text-gray-500 text-[10px] font-bold mt-1",children:"Estas clases aparecen aparte para no alargar el calendario principal."})]}),e.jsxs("span",{className:"text-[9px] font-black uppercase tracking-widest text-orange-500",children:[h.length," clase(s)"]})]})}),j&&j.classes.length>0&&e.jsxs("div",{className:"mt-4 bg-white border border-blue-100 rounded-[22px] p-4 md:hidden",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",children:"Detalle del dÃa"}),e.jsx("p",{className:"text-gray-900 text-sm font-black mt-1",children:j.date.split("-").reverse().join("/")})]}),e.jsxs("span",{className:"text-[8px] font-black uppercase tracking-widest text-gray-400",children:[j.closedCount,"C · ",j.openCount,"A · ",j.individualCount,"I"]})]}),e.jsx("div",{className:"space-y-2",children:j.classes.map(a=>
37{const n=Se(a),b=le(a.student_name),v=De(a.level,b,L);return e.jsx("div",{className:`rounded-2xl border p-3 ${n.card}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-black text-gray-900 leading-tight",children:[a.subject||"Refuerzo Escolar"," ",e.jsxs("span",{className:"text-[10px] text-gray-400 font-bold",children:["(",v,")"]})]}),e.jsxs("p",{className:"text-[10px] font-bold text-gray-500 mt-1",children:[K(a.start_time)," - ",K(a.end_time)," · ",a.modality||"Sin modalidad"]}),e.jsx("p",{className:"text-[11px] font-bold text-gray-700 mt-1",children:b.map(y=>be(y,L)).join(", ")})]}),e.jsx("span",{className:`text-[8px] font-black uppercase tracking-widest px-2 py-1 rounded border ${n.pill}`,children:n.label})]})},`day-${a.id}`)})})]})]})]}),e.jsxs("div",{className:"mb-4 flex justify-between items-center gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-gray-900 font-black text-sm",children:"Bloques Semanales Activos"}),e.jsx("p",{className:"text-[10px] text-gray-400 font-bold mt-1",children:"Vista rápida de la agenda real: asignatura, nivel, alumnado y si el grupo sigue abierto."})]}),e.jsxs("span",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest bg-blue-50 px-2 py-1 rounded-md border border-blue-100",children:[C.length," Bloques"]})]}),e.jsx("div",{className:"space-y-3",children:pa?e.jsx("div",{className:"flex justify-center py-10",children:e.jsx("div",{className:"w-6 h-6 border-4 border-[#1c74e9] border-t-transparent rounded-full animate-spin"})}):C.length===0?e.jsxs("div",{className:"bg-white p-8 rounded-[32px] border border-gray-100 text-center shadow-sm",children:[e.jsx("span",{className:"text-3xl block mb-2",children:"ðï¸"}),e.jsx("p",{className:"text-gray-900 font-black text-sm",children:"Sin bloques activos"}),e.jsx("p",{className:"text-[10px] text-gray-400 font-bold mt-2",children:"Cuando haya clases reales creadas en Agenda Centro, aquà verás un resumen limpio sin repeticiones."})]}):C.map(a=>e.jsxs("button",{type:"button",onClick:()=>a.nextClassDate&&Ia(a.nextClassDate),className:`w-full text-left bg-white p-4 rounded-2xl border shadow-sm flex items-center gap-4 transition-all ${a.tone.card} ${a.nextClassDate?"hover:-translate-y-0.5 hover:shadow-md":""} ${te===a.nextClassDate?"ring-2 ring-[#1c74e9] shadow-lg shadow-blue-500/15":""}`,children:[e.jsxs("div",{className:"w-14 h-14 bg-orange-50 rounded-xl flex flex-col items-center justify-center shrink-0 border border-orange-100 text-orange-500",children:[e.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:a.dayLabel}),e.jsx("span",{className:"text-sm font-black",children:K(a.startTime)}),e.jsx("span",{className:"text-[9px] font-black",children:K(a.endTime)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"font-black text-gray-900 text-sm mb-1 leading-tight",children:a.subject}),e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-[#1c74e9]",children:a.level}),e.jsx("p",{className:"text-[10px] font-bold text-gray-500 leading-relaxed mt-1",children:(a.studentDisplayNames||a.studentNames.map(n=>da(n))).join(", ")}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[e.jsx("span",{className:"bg-gray-100 text-gray-500 px-2 py-0.5 rounded text-[9px] font-black uppercase tracking-widest",children:et(a.modality,a.studentCount)}),e.jsx("span",{className:`px-2 py-0.5 rounded text-[9px] font-black uppercase tracking-widest border ${a.tone.pill}`,children:a.tone.label}),a.modality&&e.jsx("span",{className:"bg-white text-gray-500 px-2 py-0.5 rounded text-[9px] font-black uppercase tracking-widest border border-gray-200",children:a.modality}),a.nextClassDate&&e.jsxs("span",{className:"bg-white text-gray-500 px-2 py-0.5 rounded text-[9px] font-black uppercase tracking-widest border border-gray-200",children:["Próxima: ",a.nextClassDate.split("-").reverse().join("/")]}),a.nextClassDate&&e.jsx("span",{className:"bg-blue-50 text-[#1c74e9] px-2 py-0.5 rounded text-[9px] font-black uppercase tracking-widest border border-blue-100",children:"Ver dÃa"})]})]})]},a.signature))})]})]})}const we=g.filter(t=>!re(t)),Ge=g.filter(re),Ue=G==="active"?we:Ge,Fa=we.filter(t=>!na(t)).length;return e.jsxs("div",{className:"max-w-md mx-auto w-full min-h-screen bg-[#F5F7FA] p-6 text-left pb-24 overflow-y-auto font-sans animate-in fade-in duration-300 relative",children:[e.jsxs("div",{className:"flex justify-between items-start mb-6",children:[e.jsx("button",{onClick:r,className:"text-gray-400 text-[10px] font-black uppercase flex items-center gap-2 hover:text-[#1c74e9] transition-colors",children:"â Volver al Panel"}),e.jsxs("button",{onClick:()=>window.open(`${window.location.origin}/empleo`,"_blank"),className:"bg-[#1c74e9] text-white text-[10px] font-black uppercase tracking-widest px-3 py-1.5 rounded-full shadow-md hover:bg-blue-700 transition-colors flex items-center gap-1 active:scale-95",children:[e.jsx("span",{children:"+"})," Añadir desde Portal"]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-black italic text-gray-900 leading-none",children:"Plantilla"}),e.jsx("p",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest mt-2 bg-blue-50 inline-block px-3 py-1 rounded-full border border-blue-100",children:"Control de Monitores"}),e.jsxs("div",{className:"mt-4 rounded-2xl border border-sky-100 bg-sky-50 p-4",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-[#0C6FAE]",children:"Horarios del curso 2026/27"}),e.jsx("p",{className:"mt-1 text-[10px] font-bold leading-relaxed text-sky-900",children:"Cada profesor puede actualizarlos desde Mi perfil. Dirección también puede hacerlo en Gestionar > Perfil > Editar."}),e.jsxs("p",{className:"mt-2 text-[10px] font-black text-[#D86C00]",children:[Fa," pendientes de confirmar este curso"]}
37)]}),e.jsxs("div",{className:"mt-3 rounded-2xl border border-violet-100 bg-violet-50 p-4",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-violet-800",children:"Clases a domicilio"}),e.jsx("p",{className:"mt-1 text-[10px] font-bold leading-relaxed text-gray-700",children:"Hoja mensual para anotar cada clase y recoger la firma de la familia y del profesor. El registro de la clase se hace tambien en Mi Agenda."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx("a",{href:Ce.homeSignatureSheet,target:"_blank",rel:"noopener noreferrer",className:"rounded-xl bg-violet-800 px-3 py-2 text-[10px] font-black text-white",children:"Abrir PDF"}),e.jsx("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(Ce.homeSignatureSheet),alert("Enlace del PDF copiado. Ya puedes pegarlo en WhatsApp.")}catch{window.prompt("Copia este enlace para WhatsApp:",Ce.homeSignatureSheet)}},className:"rounded-xl border border-violet-200 bg-white px-3 py-2 text-[10px] font-black text-violet-800",children:"Copiar enlace"})]})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 rounded-2xl bg-gray-100 p-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>Ee("active"),className:`rounded-xl px-3 py-3 text-[9px] font-black uppercase tracking-wider ${G==="active"?"bg-[#0C6FAE] text-white shadow-sm":"bg-white text-gray-500"}`,children:["Continúan (",we.length,")"]}),e.jsxs("button",{type:"button",onClick:()=>Ee("inactive"),className:`rounded-xl px-3 py-3 text-[9px] font-black uppercase tracking-wider ${G==="inactive"?"bg-[#FC9A05] text-white shadow-sm":"bg-white text-gray-500"}`,children:["Inactivos (",Ge.length,")"]})]})]}),e.jsx("div",{className:"space-y-4",children:ca?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"w-8 h-8 border-4 border-[#1c74e9] border-t-transparent rounded-full animate-spin"})}):Ue.length===0?e.jsx("div",{className:"text-center py-10 text-gray-400 text-[10px] font-black uppercase tracking-widest bg-white rounded-[32px] p-8 border border-gray-100 shadow-sm",children:G==="active"?"No hay profesores activos":"No hay perfiles inactivos"}):Ue.map(t=>e.jsxs("div",{className:`bg-white p-5 rounded-[32px] border transition-all relative overflow-hidden ${t.isFull?"border-red-200 shadow-[0_4px_15px_rgba(239,68,68,0.05)]":"border-gray-100 shadow-[0_4px_15px_rgba(0,0,0,0.02)] hover:border-blue-100"}`,children:[t.isFull&&e.jsx("div",{className:"absolute inset-0 bg-red-50/30 pointer-events-none"}),e.jsxs("div",{className:"flex justify-between items-center mb-4 relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center text-xl overflow-hidden border relative ${t.isFull?"bg-red-100 border-red-200":"bg-blue-50 border-blue-100"}`,children:t.avatar_url?e.jsx("img",{src:t.avatar_url,className:"w-full h-full object-cover",alt:"Monitor"}):"ð¨âð«"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-black text-gray-900 text-sm flex items-center gap-1",children:t.name||t.full_name||"Monitor"}),e.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[re(t)&&e.jsx("span",{className:"text-rose-600 text-[8px] font-black uppercase tracking-widest bg-rose-50 px-1.5 py-0.5 border border-rose-100 rounded",children:"Inactivo"}),t.access_paused&&!re(t)&&e.jsx("span",{className:"text-amber-700 text-[8px] font-black uppercase tracking-widest bg-amber-50 px-1.5 py-0.5 border border-amber-100 rounded",children:"Acceso pausado"}),t.availability_state==="Solo sustituciones"&&e.jsx("span",{className:"text-[#D86C00] text-[8px] font-black uppercase tracking-widest bg-orange-50 px-1.5 py-0.5 border border-orange-100 rounded",children:"Solo sustituciones"}),!re(t)&&!na(t)&&e.jsx("span",{className:"text-[#0C6FAE] text-[8px] font-black uppercase tracking-widest bg-sky-50 px-1.5 py-0.5 border border-sky-100 rounded",children:"Horario 26/27 pendiente"}),t.certificate_url?e.jsx("span",{className:"text-green-600 text-[8px] font-black uppercase tracking-widest bg-green-50 px-1.5 py-0.5 border border-green-100 rounded flex items-center gap-0.5",children:"ð¡ï¸ Cert. recibido"}):e.jsx("span",{className:"text-red-500 text-[8px] font-black uppercase tracking-widest bg-red-50 px-1.5 py-0.5 border border-red-100 rounded flex items-center gap-0.5",children:"â ï¸ Sin Cert."}),t.currentAssignedStudents===0?e.jsx("span",{className:"text-slate-600 text-[8px] font-black uppercase bg-slate-50 px-1.5 py-0.5 border border-slate-200 rounded",children:"Sin grupo base"}):e.jsx("span",{className:`text-[8px] font-black uppercase px-1.5 py-0.5 rounded border ${t.isFull?"text-indigo-700 bg-indigo-50 border-indigo-200":"text-orange-500 bg-orange-50 border-orange-100"}`,children:t.currentAssignedStudents>3?`Academia ${t.currentAssignedStudents} (exc.)`:`Academia ${t.currentAssignedStudents}/3`})]})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:`text-xs font-black ${t.efficie
37ncy>85?"text-green-500":t.efficiency>60?"text-orange-500":"text-red-500"}`,children:[t.efficiency,"%"]}),e.jsx("p",{className:"text-[8px] text-gray-400 uppercase font-black tracking-widest",children:"Eficiencia"})]})]}),e.jsx("div",{className:"w-full bg-gray-50 h-2 rounded-full overflow-hidden border border-gray-100 relative z-10",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-1000 ${t.efficiency>85?"bg-green-500":t.efficiency>60?"bg-orange-500":"bg-red-500"}`,style:{width:`${t.efficiency}%`}})}),e.jsxs("div",{className:"mt-4 space-y-3 relative z-10",children:[t.location&&e.jsxs("p",{className:"text-[10px] text-gray-500 font-bold flex items-center gap-1.5",children:[e.jsx("span",{children:"ð"}),e.jsx("span",{children:t.location})]}),(t.work_modality||t.studies||t.specialty||t.subjects)&&e.jsxs("div",{className:"bg-gray-50 rounded-2xl border border-gray-100 p-3 space-y-1.5",children:[t.work_modality&&e.jsxs("p",{className:"text-[10px] text-gray-700",children:[e.jsx("span",{className:"font-black text-gray-900",children:"ð» Modalidad:"})," ",t.work_modality]}),t.studies&&e.jsxs("p",{className:"text-[10px] text-gray-700",children:[e.jsx("span",{className:"font-black text-gray-900",children:"ð Estudios:"})," ",t.studies]}),t.specialty&&e.jsxs("p",{className:"text-[10px] text-gray-700",children:[e.jsx("span",{className:"font-black text-gray-900",children:"ð¯ Niveles:"})," ",t.specialty]}),t.subjects&&e.jsxs("p",{className:"text-[10px] text-gray-700",children:[e.jsx("span",{className:"font-black text-gray-900",children:"ð Asignaturas:"})," ",t.subjects]})]}),t.availability_notes&&e.jsxs("div",{className:"bg-white border border-gray-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest text-gray-400 mb-1",children:"Disponibilidad"}),e.jsx("p",{className:"text-[10px] text-gray-700 font-bold leading-relaxed",children:t.availability_notes})]}),(t.has_vehicle||t.has_metro||t.wants_academy)&&e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.has_vehicle&&e.jsx("span",{className:"text-[8px] font-black uppercase tracking-widest bg-red-50 text-red-600 px-2 py-1 rounded-full border border-red-100",children:"ð Coche"}),t.has_metro&&e.jsx("span",{className:"text-[8px] font-black uppercase tracking-widest bg-blue-50 text-blue-600 px-2 py-1 rounded-full border border-blue-100",children:"ð Metro"}),t.wants_academy&&e.jsx("span",{className:"text-[8px] font-black uppercase tracking-widest bg-indigo-50 text-indigo-600 px-2 py-1 rounded-full border border-indigo-100",children:"ð« Academia"})]}),(t.winter_schedule||t.summer_schedule)&&e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"bg-blue-50/60 rounded-2xl border border-blue-100 p-3",children:[e.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest text-[#1c74e9] mb-1",children:"Invierno"}),e.jsx("p",{className:"text-[10px] font-bold text-gray-700 leading-relaxed",children:t.winter_schedule||"Sin indicar"})]}),e.jsxs("div",{className:"bg-orange-50/70 rounded-2xl border border-orange-100 p-3",children:[e.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest text-orange-500 mb-1",children:"Verano"}),e.jsx("p",{className:"text-[10px] font-bold text-gray-700 leading-relaxed",children:t.summer_schedule||"Sin indicar"})]})]})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-50 relative z-10",children:[e.jsx("span",{className:"block text-[9px] text-gray-400 italic font-medium mb-3 text-center",children:t.efficiency>=100?"ð Máximo rendimiento":t.efficiency>60?"ð Puede mejorar ocupación":"â ï¸ Baja rentabilidad"}),e.jsxs("div",{className:"flex gap-2 w-full",children:[e.jsx("button",{onClick:()=>Re(t.email),className:"flex-1 text-white text-[10px] font-black uppercase tracking-widest hover:bg-gray-800 transition-colors flex justify-center items-center gap-1 bg-gray-900 py-3 rounded-xl shadow-md active:scale-95",children:"ðï¸ Ver área"}),e.jsx("button",{onClick:()=>Na(t),className:"flex-1 text-[#1c74e9] text-[10px] font-black uppercase tracking-widest hover:bg-blue-100 transition-colors flex justify-center items-center gap-1 bg-blue-50 py-3 rounded-xl border border-blue-100 active:scale-95",children:"Gestionar âº"})]})]})]},t.id))})]})};export{ht as AdminMonitors,ht as default};
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.