PageSourceSearch

https://effervescent-cupcake-210607.netlify.app/assets/CandidateDashboard-Bd--pNwI.js

js effervescent-cupcake-210607.netlify.app collected 2026-10-03 10:41:11 UTC 29,922 bytes, 1 lines download raw bytes

1import{r as p,j as e,s as A}from"./index-bMFZPluE.js";import{s as Y,g as be,f as me,b as ge,c as ee,d as ae,e as se,h as $,a as te,i as he,p as re}from"./candidateAvailability-DgcALE0v.js";import{l as fe,s as H}from"./localCandidatePreview-soJiaFs0.js";import{f as ye,v as ve,n as je}from"./phoneFormatting-bIoASOCT.js";const B=a=>({phone:ye(a==null?void 0:a.phone),location:(a==null?void 0:a.location)||"",province:(a==null?void 0:a.province)||"Granada",studies:(a==null?void 0:a.studies)||"",subjects:(a==null?void 0:a.subjects)||"",levels:(a==null?void 0:a.levels)||"",mobility:(a==null?void 0:a.mobility)||"",hasCar:!!(a!=null&&a.has_car),hasMetro:!!(a!=null&&a.has_metro),wantsAcademy:!!(a!=null&&a.wants_academy),winterSchedule:(a==null?void 0:a.winter_schedule)||""}),le=a=>[{label:"telefono",ready:String(a.phone||"").replace(/\D/g,"").length>=9},{label:"localidad",ready:!!a.location.trim()},{label:"provincia",ready:!!a.province.trim()},{label:"estudios y titulacion",ready:!!a.studies.trim()},{label:"materias que puedes impartir",ready:!!a.subjects.trim()},{label:"niveles que puedes impartir",ready:!!a.levels.trim()},{label:"movilidad",ready:!!a.mobility.trim()},{label:"horario general",ready:!!a.winterSchedule.trim()}].filter(u=>!u.ready).map(u=>u.label),N=a=>({weekly:re(a==null?void 0:a.weekly_availability),summer:re(a==null?void 0:a.summer_availability),state:(a==null?void 0:a.availability_state)||"Disponible ahora",notes:(a==null?void 0:a.availability_update_notes)||""}),Ne=(a,w,u)=>{const L=[{key:"subjects",done:!!((a==null?void 0:a.subjects)||"").trim(),label:"Materias definidas"},{key:"levels",done:!!((a==null?void 0:a.levels)||"").trim(),label:"Niveles definidos"},{key:"weekly",done:Object.keys(w.weekly||{}).length>0,label:"Horario semanal revisado"},...u?[{key:"summer",done:Object.keys(w.summer||{}).length>0,label:"Verano revisado"}]:[],{key:"confirmed",done:!!(a!=null&&a.availability_last_confirmed_at),label:"Disponibilidad confirmada"}],f=L.filter(r=>r.done).length,y=Math.round(f/L.length*100),d=L.filter(r=>!r.done).map(r=>r.label);let k="A reforzar",m="bg-orange-50 text-orange-600 border-orange-100";return y>=100?(k="Perfil muy listo",m="bg-emerald-50 text-emerald-600 border-emerald-100"):y>=60&&(k="Buen perfil",m="bg-blue-50 text-[#1c74e9] border-blue-100"),{percent:y,missing:d,tone:k,toneClasses:m}},Se=({previewEmail:a,onBackToAdmin:w})=>{const u=typeof window<"u"&&["localhost","127.0.0.1"].includes(window.location.hostname),[L,f]=p.useState(!0),[y,d]=p.useState(!1),[k,m]=p.useState(!1),[r,g]=p.useState(null),[oe,ie]=p.useState(""),[C,T]=p.useState(!1),[F,z]=p.useState(""),[G,I]=p.useState(""),[i,b]=p.useState({weekly:{},summer:{},state:"Disponible ahora",notes:""}),[l,c]=p.useState(B(null)),U="candidate-professional-profile-section",J="candidate-availability-section",ne=async()=>{f(!0);let s=(a||"").trim();if(!s){const{data:{user:n}}=await A.auth.getUser();s=((n==null?void 0:n.email)||"").trim()}if(!s){f(!1);return}if(ie(s),u){const n=fe();if(n&&String(n.email||"").toLowerCase()===s.toLowerCase()){g(n),b(N(n)),c(B(n)),f(!1);return}}const{data:t,error:o}=await A.from("candidates").select("*").ilike("email",s).limit(1).maybeSingle();if(o){console.error("No se pudo cargar el perfil del candidato:",o),alert("No hemos podido cargar tu perfil en este momento. Vuelve a intentarlo dentro de unos instantes y, si continúa, avísanos por WhatsApp."),f(!1);return}g(t),b(N(t)),c(B(t)),f(!1)};p.useEffect(()=>{ne()},[a]);const Z=(s,t,o)=>{b(n=>({...n,[s]:{...n[s],[t]:o}}))},de=async()=>{if(!(r!=null&&r.id)||r.status!=="Pendiente")return;const s=ve(l.phone,"telefono");if(!s.ok){alert(s.error||"Revisa el telefono.");return}const t=le(l);if(t.length>0){alert(`Completa estos datos antes de guardar: ${t.join(", ")}.`);return}const o={phone:je(l.phone),location:l.location.trim(),province:l.province.trim(),studies:l.studies.trim(),subjects:l.subjects.trim(),levels:l.levels.trim(),mobility:l.mobility.trim(),has_car:l.hasCar,has_metro:l.hasMetro,wants_academy:l.wantsAcademy,winter_schedule:l.winterSchedule.trim()};if(m(!0),u){const P={...r,...o};if(!H(P)){alert("No se pudo guardar la prueba en este navegador."),m(!1);return}g(P),c(B(P)),m(!1),alert("Perfil profesional actualizado en la prueba local.");return}const{error:n}=await A.from("candidates").update(o).eq("id",r.id);if(n){console.error("No se pudo completar el perfil profesional:",n),alert("No hemos podido guardar el perfil. Los datos siguen escritos para que puedas revisarlos y reintentar."),m(!1);return}const D={...r,...o};g(D),c(B(D)),m(!1),alert("Perfil profesional actualizado. Coordinacion ya puede revisar los nuevos datos.")},ce=async()=>
1{if(!(r!=null&&r.id))return;d(!0);const s=r.status==="Seleccionado"?"Profesor disponible":r.status,t=s==="Profesor disponible";if(s==="Contratado"){alert("Tu horario ya forma parte de una incorporacion activa. Cualquier cambio debe tratarse con Coordinacion."),d(!1);return}if(t&&!C){alert("Pulsa Solicitar cambio excepcional antes de proponer nuevos dias."),d(!1);return}if(t){if(!F.trim()){alert("Explica brevemente por que necesitas cambiar las tardes reservadas."),d(!1);return}if(!G){alert("Indica desde que fecha necesitarias el cambio."),d(!1);return}const M=he(i.weekly).filter(V=>["Lunes","Martes","Miércoles","Jueves","Viernes"].includes(V));if(M.length===0){alert("Marca al menos una tarde completa disponible. La recomendacion son dos tardes completas."),d(!1);return}const W={availability_change_status:"pending",availability_change_requested_weekly:i.weekly,availability_change_requested_summer:i.summer,availability_change_requested_state:i.state,availability_change_requested_notes:i.notes.trim()||null,availability_change_requested_weekdays:M,availability_change_reason:F.trim(),availability_change_effective_date:G,availability_change_requested_at:new Date().toISOString()};if(u){const V={...r,...W};if(!H(V)){alert("No se pudo guardar la solicitud de prueba en este navegador. Revisa el almacenamiento local e intentalo de nuevo."),d(!1);return}g(V),b(N(r)),T(!1),z(""),I(""),d(!1);return}const{error:X}=await A.from("candidates").update(W).eq("id",r.id);if(X){console.error("No se pudo enviar la solicitud de cambio de disponibilidad:",X),alert("No hemos podido enviar la solicitud. Los cambios siguen visibles para que puedas volver a intentarlo dentro de unos instantes."),d(!1);return}g({...r,...W}),b(N(r)),T(!1),z(""),I(""),d(!1),alert("Solicitud enviada a Coordinacion. Tus tardes actuales siguen vigentes hasta que se revise.");return}const n={weekly_availability:i.weekly,summer_availability:i.summer,availability_state:i.state,availability_update_notes:i.notes.trim()||null,availability_last_confirmed_at:new Date().toISOString()};if(u){const M={...r,...n};if(!H(M)){alert("No se pudo guardar la disponibilidad de prueba en este navegador. Revisa el almacenamiento local e intentalo de nuevo."),d(!1);return}g(M),b(N(M)),d(!1);return}const{error:D}=await A.from("candidates").update(n).eq("id",r.id);if(D){console.error("No se pudo guardar la disponibilidad del candidato:",D),alert("No hemos podido guardar tu disponibilidad. Los datos siguen visibles para que puedas revisarlos y volver a intentarlo dentro de unos instantes."),d(!1);return}const P={...r,...n};g(P),b(N(P)),d(!1),alert("Disponibilidad actualizada. Gracias por mantener tu perfil al dia.")},ue=()=>{T(!1),z(""),I(""),b(N(r))},K=async()=>{if(a&&w){w();return}await A.auth.signOut(),window.location.href="/"};if(L)return e.jsx("div",{className:"min-h-full bg-[#F5F7FA] flex items-center justify-center",children:e.jsx("div",{className:"w-10 h-10 border-4 border-[#1c74e9] border-t-transparent rounded-full animate-spin"})});if(!r)return e.jsx("div",{className:"p-6 pb-24 space-y-6 animate-in fade-in duration-300",children:e.jsxs("div",{className:"bg-white rounded-[28px] border border-gray-100 shadow-sm p-6 text-center space-y-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-blue-50 text-[#1c74e9] flex items-center justify-center text-3xl mx-auto",children:"👋"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-black text-gray-900",children:"No encontramos tu perfil de candidato"}),e.jsx("p",{className:"text-gray-500 text-sm mt-2",children:"Revisa que hayas entrado con el mismo correo con el que enviaste tu candidatura."})]}),e.jsx("button",{onClick:K,className:"w-full bg-[#1c74e9] text-white py-4 rounded-2xl font-black uppercase text-xs tracking-widest shadow-lg shadow-blue-500/20",children:"Volver al acceso"})]})});const xe=Y(i.weekly,ee),pe=Y(i.summer,te),Q=new Date().getMonth(),E=Q>=2&&Q<=7,v=Ne(r,i,E),O=r.status==="Seleccionado"?"Profesor disponible":r.status,h=O==="Profesor disponible",j=O==="Contratado",_=be(r),S=r.availability_change_status==="pending",R=j||h&&!C,q=le(l),x=O==="Pendiente";return e.jsxs("div",{className:"p-6 pb-24 space-y-6 animate-in fade-in duration-300 text-left",children:[e.jsxs("div",{className:"bg-[#1c74e9] text-white rounded-[32px] p-6 shadow-lg shadow-blue-500/20 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-white/10 rounded-full translate-x-8 -translate-y-8"}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-blue-100 text-[10px] font-black uppercase tracking-[3px]",children:"Zona de candidato"}),e.jsx("h1",{className:"text-3xl font-black leading-none mt-3",children:r.first_name||r.full_name}),e.jsx("p",{className:"text-blue-100 text-[11px] font-bold mt-2",children:oe})]}),e.jsx("button",{onClick:K,className:"bg-white/15 hover:bg-white/25 px-4 py-2 rounded-2xl text-[10px] font-black uppercase tracking-widest",children:a?"Cerrar":"Salir"})]}),e.jsxs("div",{className:"mt-5 bg-white/10 rounded-[24px] p-4 border border-white/10",children:[e.jsx("p",{className:"text-[11px] font-black uppercase tracking-widest text-white/90",children:j?"Horario incorporado":h?"Tus tardes reservadas":"Tu disponibilidad importa"}),e.jsx("p",{className:"text-blue-50 text-sm mt-2 leading-relaxed",children:j?"Desde que comienzas a trabajar, los dias acordados no se cambian desde la web. Si surge una situacion importante, habla con Coordinacion.":h?`Coordinacion cuenta contigo ${_.length>0?`los ${_.join(" y ")}`:"en las tardes pendientes de confirmar"}. Un cambio debe ser excepcional y revisado antes de aplicarse.`:"Cuanto mas afinada este tu disponibilidad real, mas facil es que podamos ofrecerte clases que encajen contigo. Marca solo los huecos que de verdad puedes asumir."})]}),u&&e.jsxs("div",{className:"mt-4 rounded-[20px] border border-amber-200 bg-amber-50 p-4 text-amber-900",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Revision local segura"}),e.jsx("p",{className:"mt-1 text-xs font-bold",children:"Los cambios se simulan y no se guardan en Supabase."})]}),e.jsxs("div",{className:"mt-4 bg-white/10 rounded-[24px] p-4 border border-white/10 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-black uppercase tracking-widest text-white/90",children:"Perfil listo para asignaciones"}
1),e.jsx("p",{className:"text-blue-50 text-[12px] font-medium mt-1",children:"Cuanto mas completo este tu perfil, mas facil es poder proponerte clases reales."})]}),e.jsx("span",{className:`shrink-0 px-2 py-1 rounded-lg border text-[9px] font-black uppercase tracking-widest ${v.toneClasses}`,children:v.tone})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-3 rounded-full bg-white/20 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-white transition-all duration-500",style:{width:`${Math.max(v.percent,8)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-white text-sm font-black",children:[v.percent,"% completado"]}),v.missing.length>0&&e.jsxs("p",{className:"text-blue-50 text-[11px] font-medium text-right",children:["Falta: ",v.missing.slice(0,2).join(" · ")]})]})]}),v.percent<100&&e.jsx("button",{type:"button",onClick:()=>{var s;return(s=document.getElementById(q.length>0?U:J))==null?void 0:s.scrollIntoView({behavior:"smooth",block:"start"})},className:"w-full bg-white text-[#1c74e9] py-3 rounded-2xl font-black uppercase text-[10px] tracking-widest shadow-lg shadow-blue-900/10",children:"Completar ahora"})]})]})]}),e.jsxs("div",{id:U,className:"bg-white rounded-[28px] border border-gray-100 shadow-sm p-5 space-y-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-sm",children:"Completar datos profesionales"}),e.jsx("p",{className:"text-gray-400 text-[10px] font-bold mt-1",children:"Estos datos se incorporan a tu ficha para buscar clases compatibles."})]}),e.jsx("span",{className:`shrink-0 rounded-lg border px-2 py-1 text-[9px] font-black uppercase tracking-widest ${q.length===0?"border-emerald-200 bg-emerald-50 text-emerald-700":"border-amber-200 bg-amber-50 text-amber-700"}`,children:q.length===0?"Completo":`${q.length} pendientes`})]}),q.length>0&&e.jsxs("div",{className:"rounded-2xl border border-amber-200 bg-amber-50 p-4",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-amber-700",children:"Falta completar"}),e.jsx("p",{className:"mt-2 text-xs font-bold leading-relaxed text-amber-900",children:q.join(" · ")})]}),!x&&e.jsx("div",{className:"rounded-2xl border border-blue-100 bg-blue-50 p-4",children:e.jsx("p",{className:"text-xs font-bold leading-relaxed text-blue-900",children:"Tu proceso ya ha avanzado. Para cambiar materias, niveles o movilidad, habla con Coordinacion. La disponibilidad mantiene su circuito independiente."})}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"mb-2 block text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Telefono"}),e.jsx("input",{type:"tel",value:l.phone,disabled:!x,onChange:s=>c(t=>({...t,phone:s.target.value})),className:"w-full rounded-xl border border-gray-100 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:text-gray-400",placeholder:"600 000 000"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Localidad"}),e.jsx("input",{type:"text",value:l.location,disabled:!x,onChange:s=>c(t=>({...t,location:s.target.value})),className:"w-full rounded-xl border border-gray-100 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:text-gray-400",placeholder:"Granada"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Provincia"}),e.jsx("input",{type:"text",value:l.province,disabled:!x,onChange:s=>c(t=>({...t,province:s.target.value})),className:"w-full rounded-xl border border-gray-100 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:text-gray-400",placeholder:"Granada"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"mb-2 block text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Estudios y titulacion"}),e.jsx("textarea",{rows:2,value:l.studies,disabled:!x,onChange:s=>c(t=>({...t,studies:s.target.value})),className:"w-full resize-none rounded-xl border border-gray-100 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:text-gray-400",placeholder:"Ej: Grado en Filologia Inglesa, C1 Cambridge..."})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"mb-2 block text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Materias que puedes impartir"}),e.jsx("textarea",{rows:2,value:l.subjects,disabled:!x,onChange:s=>c(t=>({...t,subjects:s.target.value})),className:"w-full resize-none rounded-xl border border-gray-100 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:text-gray-400",placeholder:"Ej: Ingles, Lengua, refuerzo general"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"mb-2 block text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Niveles que puedes impartir"}),e.jsx("input",{type:"text",value:l.levels,disabled:!x,onChange:s=>c(t=>({...t,levels:s.target.value})),className:"w-full rounded-xl border border-gray-100 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:text-gray-400",placeholder:"Primaria, ESO, Bachillerato"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Movilidad"}),e.jsxs("select",{value:l.mobility,disabled:!x,onChange:s=>c(t=>({...t,mobility:s.target.value})),className:"w-full rounded-xl border border-gray-100 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:text-gray-400",children:[e.jsx("option",{value:"",children:"Selecciona"}),e.jsx("option",{value:"Sí",children:"Si"}),e.jsx("option",{value:"Según ubicación",children:"Segun ubicacion"}),e.jsx("option",{value:"No",children:"No"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Horario general"}),e.jsx("input",{type:"text",value:l.winterSchedule,disabled:!x,onChange:s=>c(t=>({...t,winterSchedule:s.target.value})),className:"w-full rounded-xl border border-gray-100 bg-gray-50 p-3 text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:text-gray-400",placeholder:"Ej: tardes desde las 17:30"})]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:[{key:"hasCar",label:"Tengo coche"},{key:"hasMetro",label:"Puedo usar metro"},{key:"wantsAcademy",label:"Me interesa academia"}].map(s=>e.jsxs("label",{className:"flex items-center gap-3 rounded-2xl border border-gray-100 bg-gray-50 p-3 text-[10px] font-black text-gray-700",children:[e.jsx("input",{type:"checkbox",checked:l[s.key],disabled:!x,onChange:t=>c(o=>({...o,[s.key]:t.target.checked})),className:"h-4 w-4"}),s.label]},s.key))}),x&&e.jsx("button",{type:"button",onClick:()=>void de(),disabled:k,className:"w-full rounded-2xl bg-[#1c74e9] py-4 text-[10px] font-black uppercase tracking-widest text-white shadow-lg shadow-blue-500/20 disabled:bg-gray-300",children:k?"Guardando perfil...":"Guardar datos profesionales"}),e.jsx("p",{className:"text-[10px] font-bold leading-relaxed text-gray-400",children:"Guardar estos datos no supone seleccion, contratacion ni asignacion de clases."})]}),e.jsxs("div",{className:"bg-white rounded-[28px] border border-gray-100 shadow-sm p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-sm",children:"Tu perfil actual"}),e.jsx("p",{className:"text-gray-400 text-[10px] font-bold mt-1",children:"Esto nos ayuda a proponerte grupos que encajen de verdad contigo."})]}),e.jsx("span",{className:"bg-slate-50 text-slate-600 border border-slate-200 text-[9px] font-black px-2 py-1 rounded-lg uppercase tracking-widest",children:i.state})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-blue-50/60 border border-blue-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[#1c74e9] text-[9px] font-black uppercase tracking-widest",children:"Bloques semanales"}),e.jsx("p",{className:"text-gray-900 text-2xl font-black leading-none mt-2",children:xe.totalAvailable}),e.jsx("p",{className:"text-gray-500 text-[10px] font-bold mt-2",children:"Curso escolar"})]}),e.jsxs("div",{className:"bg-orange-50/60 border border-orange-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-orange-500 text-[9px] font-black uppercase tracking-widest",children:"Verano mañanas"}),e.jsx("p",{className:`${E?"text-2xl":"text-xs"} text-gray-900 font-black leading-tight mt-2`,children:E?pe.totalAvailable:"Más adelante"}),e.jsx("p",{className:"text-gray-500 text-[10px] font-bold mt-2",children:E?"20 junio - 31 agosto":"Lo pediremos en primavera"})]})]}),e.jsxs("div",{className:"bg-gray-50 border border-gray-100 rounded-2xl p-4 space-y-2",children:[e.jsx("p",{className:"text-[9px] font-black text-gray-400 uppercase tracking-widest",children:"Lo que nos dijiste al principio"}),e.jsxs("p",{className:"text-[10px] text-gray-600 font-medium",children:[e.jsx("span",{className:"font-black text-gray-900",children:"Materias:"})," ",r.subjects||"Sin detalle"]}),e.jsxs("p",{className:"text-[10px] text-gray-600 font-medium",children:[e.jsx("span",{className:"font-black text-gray-900",children:"Niveles:"})," ",r.levels||"Sin detalle"]}),e.jsxs("p",{className:"text-[10px] text-gray-600 font-medium",children:[e.jsx("span",{className:"font-black text-gray-900",children:"Curso escolar:"})," ",_.length>0?`${_.join(" y ")} · tardes completas 16:00-20:30`:r.winter_schedule||"Sin detalle"]}),e.jsxs("p",{className:"text-[10px] text-gray-600 font-medium",children:[e.jsx("span",{className:"font-black text-gray-900",children:"Verano:"})," ",r.summer_schedule||"Sin detalle"]}),r.availability&&e.jsxs("p",{className:"text-[10px] text-gray-600 font-medium leading-relaxed",children:[e.jsx("span",{className:"font-black text-gray-900",children:"Info adicional:"})," ",r.availability]})]})]}),e.jsxs("div",{id:J,className:"bg-white rounded-[28px] border border-gray-100 shadow-sm p-5 space-y-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-900 font-black text-sm",children:j?"Horario bloqueado":h?"Tardes completas comprometidas":"Actualiza tu disponibilidad"}),e.jsx("p",{className:"text-gray-400 text-[10px] font-bold mt-1",children:j?"Los cambios posteriores se gestionan directamente con Coordinacion.":h?"Tus tardes actuales siguen vigentes hasta que Coordinacion acepte una solicitud excepcional.":"Puedes revisarla antes de comprometer tus dos tardes completas de 16:00 a 20:30."})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-gray-400",children:"Ultima confirmacion"}),e.jsx("p",{className:"text-[10px] font-bold text-gray-700 mt-1",children:me(r.availability_last_confirmed_at)})]})]}),_.length>0&&e.jsxs("div",{className:"rounded-2xl border border-emerald-200 bg-emerald-50 p-4",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-emerald-700",children:h?"Compromiso actual":"Tardes indicadas en tu candidatura"}),e.jsx("p",{className:"mt-1 text-base font-black text-gray-900",children:_.join(" y ")}),e.jsx("p",{className:"mt-1 text-[11px] font-bold text-gray-600",children:"Bloque completo de 16:00 a 20:30. Profe en Casa procurara completarlo progresivamente."})]}),S&&e.jsxs("div",{className:"rounded-2xl border border-amber-200 bg-amber-50 p-4",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-amber-800",children:"Cambio pendiente de revision"}),e.jsxs("p",{className:"mt-2 text-xs font-bold text-gray-800",children:["Propuesta: ",(r.availability_change_requested_weekdays||[]).join(" y ")||"Nuevos dias enviados"]}),e.jsx("p",{className:"mt-1 text-[11px] font-medium text-gray-600",children:"Tus tardes anteriores siguen vigentes mientras Coordinacion responde."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-violet-600 uppercase tracking-widest block mb-2",children:"Estado actual"}),e.jsx("select",{value:i.state,onChange:s=>b(t=>({...t,state:s.target.value})),disabled:R||S,className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold text-gray-900 outline-none focus:border-violet-400 disabled:bg-gray-100 disabled:text-gray-400",children:ge.map(s=>e.jsx("option",{value:s,children:s},s))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black text-gray-400 uppercase tracking-widest block mb-2",children:"Comentario breve"}),e.jsx("input",{type:"text",value:i.notes,onChange:s=>b(t=>({...t,notes:s.target.value})),disabled:R||S,placeholder:"Ej: en junio me cambia una tarde por oposiciones",className:"w-full bg-gray-50 border border-gray-100 p-3 rounded-xl text-xs font-bold text-gray-900 outline-none focus:border-[#1c74e9] disabled:bg-gray-100 disabled:text-gray-400"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-black text-[#1c74e9] uppercase tracking-widest mb-2",children:"Curso escolar · tardes"}),e.jsx("div",{className:"space-y-2",children:["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"].map(s=>e.jsxs("div",{className:"bg-gray-50 border border-gray-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-gray-400 mb-2",children:s}),e.jsx("div",{className:"space-y-2",children:ee.filter(t=>t.day===s).map(t=>e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-center",children:[e.jsx("p",{className:"text-[10px] font-bold text-gray-600",children:t.time}),e.jsx("select",{value:$(i.weekly,t.key),onChange:o=>Z("weekly",t.key,o.target.value),disabled:R||S,className:`min-w-[120px] border p-2 rounded-xl text-[10px] font-black outline-none disabled:opacity-60 ${se($(i.weekly,t.key))}`,children:ae.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))})]},t.key))})]},s))})]}),e.jsxs("div",{className:E?"":"hidden",children:[e.jsx("p",{className:"text-[9px] font-black text-orange-500 uppercase tracking-widest mb-2",children:"Verano · mañanas del 20/06 al 31/08"}),e.jsx("div",{className:"space-y-2",children:["Lunes","Martes","Miércoles","Jueves","Viernes"].map(s=>e.jsxs("div",{className:"bg-orange-50/40 border border-orange-100 rounded-2xl p-3",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-orange-400 mb-2",children:s}),e.jsx("div",{className:"space-y-2",children:te.filter(t=>t.day===s).map(t=>e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-center",children:[e.jsx("p",{className:"text-[10px] font-bold text-gray-600",children:t.time}),e.jsx("select",{value:$(i.summer,t.key),onChange:o=>Z("summer",t.key,o.target.value),disabled:R||S,className:`min-w-[120px] border p-2 rounded-xl text-[10px] font-black outline-none disabled:opacity-60 ${se($(i.summer,t.key))}`,children:ae.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))})]},t.key))})]},`summer-${s}`))})]})]}),C&&e.jsxs("div",{className:"space-y-4 rounded-2xl border border-amber-200 bg-amber-50 p-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black uppercase tracking-widest text-amber-800",children:"Motivo del cambio excepcional"}),e.jsx("textarea",{value:F,onChange:s=>
1z(s.target.value),placeholder:"Explícanos brevemente qué ha cambiado.",rows:3,className:"mt-2 w-full rounded-xl border border-amber-200 bg-white p-3 text-xs font-bold text-gray-900 outline-none focus:border-amber-500 resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-black uppercase tracking-widest text-amber-800",children:"Fecha desde la que lo necesitas"}),e.jsx("input",{type:"date",value:G,onChange:s=>I(s.target.value),className:"mt-2 w-full rounded-xl border border-amber-200 bg-white p-3 text-xs font-bold text-gray-900 outline-none focus:border-amber-500"})]}),e.jsx("p",{className:"text-[11px] font-bold leading-relaxed text-amber-900",children:"Enviar esta solicitud no cambia todavía tus tardes. Coordinacion revisará el impacto antes de confirmarla."})]}),e.jsxs("div",{className:"bg-blue-50/50 border border-blue-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-[#1c74e9] text-[10px] font-black uppercase tracking-widest",children:"Importante"}),e.jsx("p",{className:"text-[12px] text-gray-700 font-medium mt-2 leading-relaxed",children:j?"Tu horario ya está unido a clases y familias. Contacta con Coordinación si surge una situación importante.":h?"El compromiso general son dos tardes completas de 16:00 a 20:30. Los cambios deben ser excepcionales y no se aplican hasta que Coordinación los acepte.":"Antes de confirmar tus tardes completas, mantén aquí tu disponibilidad real para que podamos proponerte clases compatibles."})]}),j?e.jsx("div",{className:"w-full rounded-2xl border border-gray-200 bg-gray-100 py-4 text-center text-xs font-black uppercase tracking-widest text-gray-500",children:"Horario gestionado por Coordinacion"}):S?e.jsx("div",{className:"w-full rounded-2xl border border-amber-200 bg-amber-100 py-4 text-center text-xs font-black uppercase tracking-widest text-amber-800",children:"Solicitud pendiente"}):h&&!C?e.jsx("button",{type:"button",onClick:()=>T(!0),className:"w-full bg-amber-500 text-white py-4 rounded-2xl font-black uppercase text-xs tracking-widest shadow-lg shadow-amber-500/20",children:"Solicitar cambio excepcional"}):e.jsxs("div",{className:"flex gap-3",children:[C&&e.jsx("button",{type:"button",onClick:ue,disabled:y,className:"flex-1 border border-gray-200 bg-white text-gray-600 py-4 rounded-2xl font-black uppercase text-xs tracking-widest disabled:opacity-60",children:"Cancelar"}),e.jsx("button",{type:"button",onClick:ce,disabled:y,className:"flex-1 bg-[#1c74e9] text-white py-4 rounded-2xl font-black uppercase text-xs tracking-widest shadow-lg shadow-blue-500/20 disabled:opacity-60 disabled:cursor-not-allowed",children:y?"Guardando...":C?"Enviar solicitud":"Guardar disponibilidad"})]})]})]})};export{Se as CandidateDashboard};

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.