PageSourceSearch

https://effervescent-cupcake-210607.netlify.app/assets/PublicFamilyAgreement-CP1uOzNQ.js

js effervescent-cupcake-210607.netlify.app collected 2026-10-03 10:41:14 UTC 4,658 bytes, 1 lines download raw bytes

1import{r as s,j as e,s as y}from"./index-bMFZPluE.js";import{r as j,b as v}from"./familyAgreement-Bm5j7ljB.js";import{A as F}from"./AcademyRulesContent-CQsXNIN7.js";import{C as k}from"./ContractModal-D4DUQDZS.js";import"./pricingEngine-DmHUGCKM.js";import"./educationCatalog-pqwMnMBs.js";import"./familyReceiptPolicy-egdKJ3_6.js";const u={student:{student_id:"LOCAL-AGREEMENT-DEMO",name:"Carmen Villanueva Rodriguez",level:"1.º/2.º ESO",modality:"Academia Profe a 3",subjects:"Matemáticas",contract_signed:!1},classes:[{student_name:"Carmen Villanueva Rodriguez",participant_count:3,class_date:"2026-09-28",start_time:"16:00:00",end_time:"17:30:00",status:"Pendiente",modality:"Academia Profe a 3",level:"1.º/2.º ESO",subject:"Matemáticas",family_price:39},{student_name:"Carmen Villanueva Rodriguez",participant_count:3,class_date:"2026-10-05",start_time:"16:00:00",end_time:"17:30:00",status:"Pendiente",modality:"Academia Profe a 3",level:"1.º/2.º ESO",subject:"Matemáticas",family_price:39}]},O=()=>{const c=new URLSearchParams(window.location.search),r=c.get("student")||"",a=c.get("token")||"",o=["localhost","127.0.0.1"].includes(window.location.hostname)&&c.get("preview")==="1",[w,l]=s.useState(!0),[_,x]=s.useState(!1),[m,p]=s.useState(null),[n,f]=s.useState(null),[g,h]=s.useState(!1),[N,b]=s.useState(null);return s.useEffect(()=>{(async()=>{if(o){p(u),f(v(u.student,u.classes)),l(!1);return}if(!r||!a){x(!0),l(!1);return}const{data:t,error:A}=await y.rpc("get_public_family_agreement",{target_student_id:r,access_token:a});if(A||!(t!=null&&t.student)){x(!0),l(!1);return}const d={student:t.student,classes:Array.isArray(t.classes)?t.classes:[]};p(d),f(v(d.student,d.classes)),h(!!d.student.contract_signed),b(j(t.agreement_snapshot)),l(!1)})()},[a,o,r]),w?e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[#F5F7FA] p-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto h-10 w-10 animate-spin rounded-full border-4 border-[#1c74e9] border-t-transparent"}),e.jsx("p",{className:"mt-4 text-xs font-black uppercase tracking-widest text-blue-700",children:"Abriendo el acuerdo"})]})}):_||!m||!n?e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[#F5F7FA] p-6",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[32px] border border-gray-100 bg-white p-8 text-center shadow-xl",children:[e.jsx("div",{className:"text-5xl",children:"!"}),e.jsx("h1",{className:"mt-4 text-2xl font-black text-gray-900",children:"Este enlace no está disponible"}),e.jsx("p",{className:"mt-3 text-sm leading-relaxed text-gray-500",children:"Pide a Coordinación que te reenvíe el enlace personal de la familia."}),e.jsx("a",{href:"https://wa.me/34958891092",className:"mt-6 inline-flex rounded-2xl bg-[#25D366] px-5 py-3 text-xs font-black uppercase tracking-widest text-white",children:"Escribir por WhatsApp"})]})}):!g&&!n.readyToSign?e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[#F5F7FA] p-6",children:e.jsxs("div",{className:"w-full max-w-md rounded-[32px] border border-amber-200 bg-white p-7 text-center shadow-xl",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-amber-600",children:"Estamos completándolo"}),e.jsx("h1",{className:"mt-2 text-2xl font-black text-gray-900",children:"El acuerdo todavía no se puede firmar"}),e.jsxs("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:["Coordinación está terminando de confirmar ",n.missingFields.join(", "),"."]})]})}):g?e.jsx("div",{className:"min-h-screen bg-[#EDF3F8] px-4 py-8 sm:py-12",children:e.jsxs("div",{className:"mx-auto w-full max-w-xl space-y-5 rounded-[32px] bg-gray-50 p-5 shadow-2xl sm:p-7",children:[e.jsxs("div",{className:"rounded-2xl border border-emerald-200 bg-emerald-50 p-5 text-center",children:[e.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-emerald-500 text-2xl font-black text-white",children:"✓"}),e.jsx("h1",{className:"mt-3 text-2xl font-black text-gray-900",children:"Acuerdo firmado"}),e.jsx("p",{className:"mt-1 text-sm font-bold text-emerald-800",children:"Ha quedado guardado correctamente. Podéis volver a leerlo desde este mismo enlace."})]}),e.jsx(F,{details:n,savedAgreement:N})]})}):e.jsx(k,{studentId:m.student.student_id,studentName:m.student.name,agreementDetails:n,familyToken:a||void 0,previewOnly:o,standalone:!0,onClose:()=>{},onSuccess:async()=>{const{data:i}=await y.rpc("get_public_family_agreement",{target_student_id:r,access_token:a});b(j(i==null?void 0:i.agreement_snapshot)),h(!0)}})};export{O as PublicFamilyAgreement};

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.