1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PasswordRecoverySentBanner-DJklFeR6.js","assets/index-DnVm687U.js","assets/index-7vO0yUCL.css","assets/authErrors-C-7fSvDC.js","assets/circle-check-CEudxvXQ.js","assets/mail-BBtFmBsn.js","assets/clock-CIC8GvrU.js"])))=>i.map(i=>d[i]); 2import{r as m,g as Be,d as Re,u as Ie,j as e,B as N,s as _,b as oe,_ as Ge}from"./index-DnVm687U.js";import{o as xe,s as a,u as Fe,a as ke,F as Ue,b as n,c as o,d as c,e as l,l as h,f as ee,g as qe,i as Le,h as $}from"./form-CETOqwtM.js";import{H as Me,F as He}from"./Footer-Bvqa_r8G.js";import{C as W,a as Z,b as Ce,c as we}from"./card-CRFaJYNz.js";import{F as u}from"./floating-label-input-CPARRe0H.js";import{R as Je,a as Ee}from"./radio-group-CcBF0RkW.js";import{C as Xe}from"./checkbox-DQGP46Z3.js";import{S as ce,a as le,b as de,c as me,d as q}from"./select-BBeLgipb.js";import{I as Se}from"./input-D4ugazI8.js";import{L as Pe}from"./label-BWZGrcrB.js";import{D as Ke,b as Qe,c as We,d as Ze,e as er}from"./dialog-BQOPzVNo.js";import{c as ue}from"./countries-CCyu059Z.js";import{g as rr}from"./postLoginRedirect-qxzP7qby.js";import{P as Ve,r as sr}from"./PasswordRecoverySentBanner-DJklFeR6.js";import{translateAuthError as pe}from"./authErrors-C-7fSvDC.js";import{D as ar}from"./date-of-birth-input-jW_WuZ-N.js";import{U as tr}from"./user-plus-CpZP5_uI.js";import{U as ir}from"./dropdown-menu-elZyZctl.js";import{A as Te}from"./arrow-left-i1Qu9EeE.js";import{C as De}from"./circle-check-CEudxvXQ.js";import{C as nr}from"./circle-x-DIo5bdqO.js";import{T as or}from"./triangle-alert-DrFwYdXz.js";import{M as cr}from"./mail-BBtFmBsn.js";import"./shield-BN1RiLGr.js";import"./log-out-CtUQRbPX.js";import"./Combination-D1NCdNup.js";import"./search-BNZJvCG8.js";import"./eye-off-BgwrI24M.js";import"./eye-Bub6U8nG.js";import"./index-C7OIboLl.js";import"./index-B-Wc5f3e.js";import"./index-Cue5PJE5.js";import"./chevron-up-46FaISor.js";import"./index-yRo4nqrX.js";import"./clock-CIC8GvrU.js";const lr=xe({email:a().email("Email inválido"),password:a().min(1,"La contraseña es requerida")}),dr=()=>{const[i,p]=m.useState(!1),[j,C]=m.useState(!1),[I,w]=m.useState(""),[E,Y]=m.useState(!1),[F,O]=m.useState(null),{signIn:S}=Be(),{toast:T}=Re(),v=Ie(),D=Fe({resolver:ke(lr),defaultValues:{email:"",password:""}}),B=async x=>{p(!0);try{const{error:f}=await S(x.email,x.password,"participantes");if(f){T({title:"Error al iniciar sesión",description:pe(f.message),variant:"destructive"});return}T({title:"¡Bienvenido!",description:"Has iniciado sesión correctamente"}),setTimeout(async()=>{const{data:{user:L}}=await _.auth.getUser();if(L){const re=await rr(L.id);v(re)}else v("/mi-portal")},500)}catch(f){T({title:"Error",description:pe(f==null?void 0:f.message),variant:"destructive"})}finally{p(!1)}},R=async()=>{if(!I){T({title:"Correo requerido",description:"Por favor ingrese su correo electrónico",variant:"destructive"});return}Y(!0);try{const x=await sr(I,"participantes");if(!x.success){T({title:"Error",description:x.message,variant:"destructive"});return}O(I)}catch(x){T({title:"Error",description:pe(x==null?void 0:x.message),variant:"destructive"})}finally{Y(!1)}};return j?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Recuperar Contraseña"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Ingrese su correo electrónico y le enviaremos un enlace para restablecer su contraseña."})]}),F?e.jsx(Ve,{email:F,isResending:E,onResend:R,onClose:()=>{C(!1),w(""),O(null)}}):e.jsxs(e.Fragment,{children:[e.jsx(u,{label:"Correo Electrónico",type:"email",value:I,onChange:x=>w(x.target.value)}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(N,{type:"button",variant:"outline",onClick:()=>{C(!1),w("")},className:"flex-1",children:"Cancelar"}),e.jsx(N,{type:"button",onClick:R,disabled:E,className:"flex-1",children:E?"Enviando...":"Enviar Email"})]})]})]}):e.jsx(Ue,{...D,children:e.jsxs("form",{onSubmit:D.handleSubmit(B),className:"space-y-6",children:[e.jsx(n,{control:D.control,name:"email",render:({field:x,fieldState:f})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Email",type:"email",error:!!f.error,...x})}),e.jsx(l,{})]})}),e.jsx(n,{control:D.control,name:"password",render:({field:x,fieldState:f})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Contraseña",type:"password",error:!!f.error,showPasswordToggle:!0,...x})}),e.jsx(l,{})]})}),e.jsx(N,{type:"submit",size:"lg",className:"w-full",disabled:i,children:i?"Ingresando...":"Ingresar"}),e.jsx("div",{className:"text-center",children:e.jsx(N,{type:"button",variant:"link",onClick:()=>C(!0),className:"text-sm text-primary hover:underline",children:"¿Olvidó su contraseña?"})})]})})},Ae=xe({email:a().email("Email inválido").max(255),password:a().min(8,"La contraseña debe tener al menos 8 caracteres").max(100),confirmPassword:a().min(8,"La confirmación debe tener al menos 8 caracteres").max(100),first_name:a().min(2,"El primer nombre es requerido").max(50),second_name:a().max(50).optional().or(h("")),first_surname:a().min(2,"El primer apellido es requerido").max(50),second_surname:a().max(50).optional().or(h("")),document_type:ee(["DNI","CC","RUT","PASAPORTE"],{required_error:"El tipo de documento es requerido"}),identification_number:a().min(5,"Número de identificación inválido").max(50),birth_date:a().min(1,"La fecha de nacimiento es requerida").refine(i=>{if(!i)return!1;const p=new Date(i);if(isNaN(p.getTime()))return!1;const j=new Date,C=j.getFullYear()-p.getFullYear();return p<=j&&C<=120},{message:"Ingrese una fecha de nacimiento válida"}),birth_country:a().min(2,"El paÃs de nacimiento es requerido"),residence_country:a().optional().or(h("")),contact_phone:a().max(20).optional(),primary_email:a().email("Email inválido").max(255),alternative_email:a().email("Email inválido").max(255).optional().or(h("")),category:ee(["profesional_tecnico","estudiante_pregrado"]),data_treatment_authorized:qe().refine(i=>i===!0,{message:"Debe autorizar el tratamiento de datos"})}),ze=xe({email:a().optional(),password:a().optional(),confirmPassword:a().optional(),first_name:a().min(2,"El primer nombre es requerido").max(50),second_name:a().max(50).optional().or(h("")),first_surname:a().min(2,"El primer apellido es requerido").max(50),second_surname:a().max(50).optional().or(h("")),document_type:ee(["DNI","CC","RUT","PASAPORTE"],{required_error:"El tipo de documento es requerido"}),identification_number:a().min(5,"Número de identificación inválido").max(50),birth_date:a().min(1,"La fecha de nacimiento es requerida").refine(i=>{if(!i)return!1;const p=new Date(i);if(isNaN(p.getTime()))return!1;const j=new Date,C=j.getFullYear()-p.getFullYear();return p<=j&&C<=120},{message:"Ingrese una fecha de nacimiento válida"}),birth_country:a().min(2,"El paÃs de nacimiento es requerido"),residence_country:a().optional().or(h("")),contact_phone:a().max(20).optional(),primary_email:a().email("Email inválido").max(255),alternative_email:a().email("Email inválido").max(255).optional().or(h("")),category:ee(["profesional_tecnico","estudiante_pregrado"]),data_treatment_authorized:qe().refine(i=>i===!0,{message:"Debe autorizar el tratamiento de datos"})}),mr=Ae.extend({profession:a().min(2,"La profesión es requerida").max(100),academic_degree:a().max(100).optional().or(h("")),primary_institution:a().min(2,"La institución principal es requerida").max(200),secondary_institution:a().max(200).optional().or(h("")),position:a().max(100).optional().or(h(""))}).refine(i=>i.password===i.confirmPassword,{message:"Las contraseñas no coinciden",path:["confirmPassword"]}),ur=Ae.extend({study_institution:a().min(2,"La institución de estudio es requerida").max(200),career:a().max(200).optional().or(h("")),student_certificate:Le(File,{message:"El certificado de estudiante es obligatorio"}).refine(i=>i.size<=5*1024*1024,{message:"El archivo debe ser menor a 5MB"}).refine(i=>["image/jpeg","image/jpg","image/png","application/pdf"].includes(i.type),{message:"Solo se permiten archivos JPG, PNG o PDF"})}).refine(i=>i.password===i.confirmPassword,{message:"Las contraseñas no coinciden",path:["confirmPassword"]}),pr=ze.extend({profession:a().min(2,"La profesión es requerida").max(100),academic_degree:a().max(100).optional().or(h("")),primary_institution:a().min(2,"La institución principal es requerida").max(200),secondary_institution:a().max(200).optional().or(h("")),position:a().max(100).optional().or(h(""))}),xr=ze.extend({study_institution:a().min(2,"La institución de estudio es requerida").max(200),career:a().max(200).optional().or(h("")),student_certificate:Le(File,{message:"El certificado de estudiante es obligatorio"}).refine(i=>i.size<=5*1024*1024,{message:"El archivo debe ser menor a 5MB"}).refine(i=>["image/jpeg","image/jpg","image/png","application/pdf"].includes(i.type),{message:"Solo se permiten archivos JPG, PNG o PDF"})}),Qr=()=>{const[i,p]=m.useState("select"),[j,C]=m.useState("profesional_tecnico"),[I,w]=m.useState(!1),[E,Y]=m.useState(null),[F,O]=m.useState(""),[S,T]=m.useState(null),v=!!S,[D,B]=m.useState(!1),[R,x]=m.useState(!1),[f,L]=m.useState(!1),[re,G]=m.useState(!1),[V,A]=m.useState(""),[se,he]=m.useState(!1),[je,ae]=m.useState(null),[te,$e]=m.useState(null),[ie,Ye]=m.useState(null),{toast:b}=Re(),fe=Ie();m.useEffect(()=>{(async()=>{const{data:{session:s}}=await _.auth.getSession();s!=null&&s.user&&(T(s.user),p("signup"),t.setValue("primary_email",s.user.email||""),t.setValue("email",s.user.email||""),t.setValue("password","placeholder1"),t.setValue("confirmPassword","placeholder1"))})()},[]),m.useEffect(()=>{const r=setTimeout(()=>{window.scrollTo({top:0,behavior:"instant"})},50);return()=>clearTimeout(r)},[]),m.useEffect(()=>{(async()=>{const{data:s}=await _.from("legal_documents").select("document_type, file_url").in("document_type",["terms_conditions","habeas_data"]);
2s==null||s.forEach(d=>{d.document_type==="terms_conditions"&&$e(d.file_url),d.document_type==="habeas_data"&&Ye(d.file_url)})})()},[]);const t=Fe({resolver:ke(v?j==="estudiante_pregrado"?xr:pr:j==="estudiante_pregrado"?ur:mr),mode:"onChange",defaultValues:{email:"",password:"",confirmPassword:"",category:j,first_name:"",second_name:"",first_surname:"",second_surname:"",document_type:void 0,identification_number:"",birth_date:"",birth_country:"",residence_country:"",contact_phone:"",primary_email:"",alternative_email:"",data_treatment_authorized:!1,profession:"",academic_degree:"",primary_institution:"",secondary_institution:"",position:"",study_institution:"",career:""}}),M=t.watch("identification_number");m.useEffect(()=>{if(!M||M.length<5){x(!1),L(!1);return}const r=setTimeout(async()=>{B(!0);try{const{data:s,error:d}=await _.rpc("check_document_exists",{doc_number:M});d||(x(s===!0),L(!0))}catch(s){console.error("Error checking document:",s)}finally{B(!1)}},500);return()=>clearTimeout(r)},[M]);const ge=async()=>{if(!V.trim()||V.length<5){b({title:"Documento inválido",description:"Ingrese un número de documento válido (mÃnimo 5 caracteres)",variant:"destructive"});return}he(!0);try{const{data:r,error:s}=await _.rpc("get_email_by_document",{doc_number:V});if(s||!r){b({title:"Documento no encontrado",description:"No existe ningún participante registrado con este número de documento.",variant:"destructive"});return}const{requestPasswordRecovery:d}=await Ge(async()=>{const{requestPasswordRecovery:H}=await import("./PasswordRecoverySentBanner-DJklFeR6.js").then(J=>J.p);return{requestPasswordRecovery:H}},__vite__mapDeps([0,1,2,3,4,5,6])),g=await d(r,"inscribirme");if(!g.success){b({title:"Error al enviar correo",description:g.message,variant:"destructive"});return}const k=r.replace(/(.{2})(.*)(@.*)/,"$1***$3");ae(k)}catch{b({title:"Error",description:"Ocurrió un error inesperado. Intente más tarde.",variant:"destructive"})}finally{he(!1)}},Oe=async r=>{var s,d,g,k,H,J,_e,be,ve;w(!0);try{const{data:X,error:ye}=await _.rpc("check_document_exists",{doc_number:r.identification_number});if(ye&&console.error("Error verificando documento:",ye),X===!0){b({title:"Documento ya registrado",description:"Ya existe un participante registrado con este número de documento. Si ya tiene cuenta, use 'Ya Tengo Cuenta' para iniciar sesión.",variant:"destructive"}),w(!1);return}const ne=`${r.first_name} ${r.second_name||""} ${r.first_surname} ${r.second_surname||""}`.trim().toUpperCase();let K;if(v&&S){K=S.id;const{error:y}=await _.rpc("assign_participant_role",{p_user_id:S.id});y&&console.error("Error añadiendo rol participant a usuario existente:",y)}else{const{data:y,error:U}=await _.auth.signUp({email:r.email,password:r.password,options:{emailRedirectTo:`${window.location.origin}/`,data:{full_name:ne,phone:r.contact_phone}}});if(U){if(U.message==="User already registered"){b({title:"Usuario ya registrado",description:"Este correo ya está registrado. Use la opción 'Ya Tengo Cuenta' para iniciar sesión.",variant:"destructive"}),w(!1);return}throw U}if(!y.user)throw new Error("No se pudo crear el usuario");const{error:z}=await _.rpc("assign_participant_role",{p_user_id:y.user.id});z&&(console.error("Error assigning participant role:",z),b({title:"Advertencia",description:"Su cuenta fue creada pero hubo un problema asignando permisos. Contacte al administrador si no puede acceder.",variant:"destructive"})),K=y.user.id}let Ne=null;if(j==="estudiante_pregrado"&&E){const y=E.name.split(".").pop(),U=`${K}/${Date.now()}.${y}`,{error:z}=await _.storage.from("student-certificates").upload(U,E);z?(console.error("Error uploading certificate:",z),b({title:"Advertencia",description:"No se pudo subir el certificado, pero la inscripción continuará.",variant:"destructive"})):Ne=U}const P={user_id:K,category:r.category,full_name:ne,first_name:r.first_name.trim().toUpperCase(),second_name:((s=r.second_name)==null?void 0:s.trim().toUpperCase())||null,first_surname:r.first_surname.trim().toUpperCase(),second_surname:((d=r.second_surname)==null?void 0:d.trim().toUpperCase())||null,document_type:r.document_type,identification_number:r.identification_number,birth_date:r.birth_date,birth_country:r.birth_country,residence_country:r.residence_country||null,contact_phone:r.contact_phone||null,primary_email:r.primary_email,alternative_email:r.alternative_email||null,data_treatment_authorized:r.data_treatment_authorized,registration_type:"paid",payment_status:"pending",status:"pre_registrado"};j==="profesional_tecnico"?(P.profession=((g=r.profession)==null?void 0:g.trim().toUpperCase())||null,P.academic_degree=r.academic_degree||null,P.primary_institution=((k=r.primary_institution)==null?void 0:k.trim().toUpperCase())||null,P.secondary_institution=((H=r.secondary_institution)==null?void 0:H.trim().toUpperCase())||null,P.position=((J=r.position)==null?void 0:J.trim().toUpperCase())||null):(P.study_institution=((_e=r.study_institution)==null?void 0:_e.trim().toUpperCase())||null,P.career=((be=r.career)==null?void 0:be.trim().toUpperCase())||null,P.student_certificate_url=Ne);const{error:Q}=await _.from("registrations").insert(P);if(Q){if(Q.code==="23505"&&((ve=Q.message)!=null&&ve.includes("identification_number"))){b({title:"Documento duplicado",description:"Ya existe otro participante con este número de documento.",variant:"destructive"}),w(!1);return}throw Q}try{await _.functions.invoke("send-registration-confirmation",{body:{email:r.primary_email,fullName:ne,category:r.category==="profesional_tecnico"?"Profesional / Técnico":"Estudiante de Pregrado"}})}catch(y){console.error("Error sending confirmation email:",y)}
2b({title:"¡Pre-registro exitoso!",description:"Su cuenta ha sido creada. Complete el pago en el portal para finalizar su inscripción."}),fe("/mi-portal")}catch(X){console.error("Error en registro:",X),b({title:"Error en el registro",description:X.message||"Ocurrió un error al procesar su solicitud",variant:"destructive"})}finally{w(!1)}};return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(Me,{}),e.jsxs("main",{className:"flex-1 pt-20 pb-20",children:[e.jsx("section",{className:"py-12 gradient-hero text-white",children:e.jsxs("div",{className:"container mx-auto px-4 text-center",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:"InscrÃbete al Congreso"}),e.jsx("p",{className:"text-xl text-white/90 max-w-2xl mx-auto",children:"XIII Congreso Regional de Seguridad Radiológica y Nuclear"})]})}),e.jsx("section",{className:"py-12 bg-background",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[i==="select"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(W,{className:"hover-lift cursor-pointer transition-all",onClick:()=>p("signup"),children:e.jsxs(Z,{className:"p-8 text-center",children:[e.jsx(tr,{className:"h-16 w-16 mx-auto mb-4 text-primary"}),e.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Crear Cuenta Nueva"}),e.jsx("p",{className:"text-muted-foreground",children:"Primera vez en el congreso? RegÃstrate aquÃ"})]})}),e.jsx(W,{className:"hover-lift cursor-pointer transition-all",onClick:()=>p("login"),children:e.jsxs(Z,{className:"p-8 text-center",children:[e.jsx(ir,{className:"h-16 w-16 mx-auto mb-4 text-primary"}),e.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Ya Tengo Cuenta"}),e.jsx("p",{className:"text-muted-foreground",children:"¿Ya te registraste? Ingresa aquÃ"})]})})]}),i==="login"&&e.jsxs(W,{children:[e.jsxs(Ce,{children:[e.jsxs(N,{variant:"ghost",onClick:()=>p("select"),className:"w-fit mb-4",children:[e.jsx(Te,{className:"h-4 w-4 mr-2"}),"Volver"]}),e.jsx(we,{className:"text-2xl",children:"Iniciar Sesión"})]}),e.jsx(Z,{children:e.jsx(dr,{})})]}),i==="signup"&&e.jsxs(W,{children:[e.jsxs(Ce,{children:[e.jsxs(N,{variant:"ghost",onClick:()=>v?fe("/mi-portal"):p("select"),className:"w-fit mb-4",children:[e.jsx(Te,{className:"h-4 w-4 mr-2"}),v?"Volver al portal":"Volver"]}),e.jsx(we,{className:"text-2xl",children:v?"Completar datos de inscripción":"Formulario de Pre-inscripción"}),v&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Sesión activa: ",e.jsx("span",{className:"font-medium",children:S==null?void 0:S.email})]})]}),e.jsx(Z,{children:e.jsx(Ue,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(Oe),className:"space-y-8",children:[!v&&e.jsxs("div",{className:"space-y-4 pb-6 border-b",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Datos de Acceso"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsx(n,{control:t.control,name:"email",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Email (Usuario) *",type:"email",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"password",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Contraseña *",type:"password",showPasswordToggle:!0,error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"confirmPassword",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Confirmar Contraseña *",type:"password",showPasswordToggle:!0,error:!!s.error,...r})}),e.jsx(l,{})]})})]})]}),e.jsxs("div",{className:"space-y-4 pb-6 border-b",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Datos Personales"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsx(n,{control:t.control,name:"first_name",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Primer Nombre *",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"second_name",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Segundo Nombre",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"first_surname",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Primer Apellido *",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"second_surname",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Segundo Apellido",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"document_type",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx($,{children:"Tipo de Documento *"}),e.jsxs(ce,{onValueChange:r.onChange,defaultValue:r.value,children:[e.jsx(c,{children:e.jsx(le,{children:e.jsx(de,{placeholder:"Seleccione tipo"})})}),e.jsxs(me,{children:[e.jsx(q,{value:"DNI",children:"DNI"}),e.jsx(q,{value:"CC",children:"CC (Cédula de CiudadanÃa)"}),e.jsx(q,{value:"RUT",children:"RUT"}),e.jsx(q,{value:"PASAPORTE",children:"Pasaporte"})]})]}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"identification_number",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"relative",children:[e.jsx(u,{label:"Número de Identificación Personal *",error:!!s.error||R,...r}),e.jsxs("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:[D&&e.jsx(oe,{className:"h-4 w-4 animate-spin text-muted-foreground"}),!D&&f&&!R&&e.jsx(De,{className:"h-4 w-4 text-green-500"}),!D&&R&&e.jsx(nr,{className:"h-4 w-4 text-destructive"})]})]})}),e.jsx(l,{}),R&&e.jsx("div",{className:"mt-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(or,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-amber-800 font-medium",children:"Ya existe una persona registrada con este documento."}),e.jsx("p",{className:"text-sm text-amber-700",children:"Si no recuerda su contraseña para acceder, digite su número de documento y al email vinculado a ese documento le enviamos email de recuperación de cuenta de usuario."}),e.jsxs(N,{type:"button",variant:"outline",size:"sm",onClick:()=>{G(!0),A(r.value)},className:"mt-1",children:[e.jsx(cr,{className:"h-4 w-4 mr-2"}),"Recuperar contraseña por documento"]})]})]})})]})}),e.jsx(n,{control:t.control,name:"birth_date",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(ar,{value:r.value,onChange:r.onChange,error:!!s.error})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"birth_country",render:({field:r,fieldState:s})=>
2e.jsxs(o,{children:[e.jsx($,{children:"PaÃs de Nacimiento *"}),e.jsxs(ce,{onValueChange:r.onChange,defaultValue:r.value,children:[e.jsx(c,{children:e.jsx(le,{children:e.jsx(de,{placeholder:"Seleccione paÃs"})})}),e.jsx(me,{className:"max-h-[300px]",children:ue.map(d=>e.jsx(q,{value:d.label,children:d.label},d.value))})]}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"residence_country",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx($,{children:"PaÃs de Residencia"}),e.jsxs(ce,{onValueChange:d=>{r.onChange(d);const g=ue.find(k=>k.label===d);g&&(O(g.dialCode),t.setValue("contact_phone",g.dialCode+" "))},defaultValue:r.value,children:[e.jsx(c,{children:e.jsx(le,{children:e.jsx(de,{placeholder:"Seleccione paÃs"})})}),e.jsx(me,{className:"max-h-[300px]",children:ue.map(d=>e.jsx(q,{value:d.label,children:d.label},d.value))})]}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"contact_phone",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:`Teléfono de Contacto${F?` (${F})`:""}`,error:!!s.error,placeholder:F?`${F} `:"",...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"primary_email",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Correo Electrónico Principal *",type:"email",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"alternative_email",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Correo Electrónico Alternativo",type:"email",error:!!s.error,...r})}),e.jsx(l,{})]})})]})]}),e.jsxs("div",{className:"space-y-4 pb-6 border-b",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Seleccione su categorÃa"}),e.jsx(n,{control:t.control,name:"category",render:({field:r})=>e.jsxs(o,{children:[e.jsx($,{children:"CategorÃa *"}),e.jsx(c,{children:e.jsxs(Je,{onValueChange:s=>{C(s),r.onChange(s)},defaultValue:r.value,className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 border rounded-lg p-4 hover:border-primary transition-colors",children:[e.jsx(Ee,{value:"profesional_tecnico",id:"prof"}),e.jsx("label",{htmlFor:"prof",className:"cursor-pointer flex-1 font-medium",children:"Profesional / Técnico"})]}),e.jsxs("div",{className:"flex items-center space-x-2 border rounded-lg p-4 hover:border-primary transition-colors",children:[e.jsx(Ee,{value:"estudiante_pregrado",id:"est"}),e.jsx("label",{htmlFor:"est",className:"cursor-pointer flex-1 font-medium",children:"Estudiante de Pregrado"})]})]})}),e.jsx(l,{})]})})]}),j==="profesional_tecnico"&&e.jsxs("div",{className:"space-y-4 pb-6 border-b",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Información Profesional"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsx(n,{control:t.control,name:"profession",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Profesión *",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"academic_degree",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Grado Académico",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"primary_institution",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Institución Principal a la que Representa *",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"secondary_institution",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Institución Secundaria a la que Representa",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"position",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Cargo",error:!!s.error,...r})}),e.jsx(l,{})]})})]})]}),j==="estudiante_pregrado"&&e.jsxs("div",{className:"space-y-4 pb-6 border-b",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Información Académica"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsx(n,{control:t.control,name:"study_institution",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Institución donde Estudia *",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx(n,{control:t.control,name:"career",render:({field:r,fieldState:s})=>e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(u,{label:"Carrera",error:!!s.error,...r})}),e.jsx(l,{})]})}),e.jsx("div",{className:"md:col-span-2",children:e.jsx(n,{control:t.control,name:"student_certificate",render:({fieldState:r})=>e.jsxs(o,{children:[e.jsx(Pe,{htmlFor:"certificate",className:"mb-2 block",children:"Certificado de Estudios *"}),e.jsx(c,{children:e.jsx(Se,{id:"certificate",type:"file",accept:".jpg,.jpeg,.png,.pdf",onChange:s=>{var g;const d=(g=s.target.files)==null?void 0:g[0];d&&(Y(d),t.setValue("student_certificate",d,{shouldValidate:!0}))}
2,className:`cursor-pointer ${r.error?"border-destructive":""}`})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Formatos permitidos: JPG, PNG, PDF (máx. 5MB)"}),E&&!r.error&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 text-sm text-green-600",children:[e.jsx(De,{className:"h-4 w-4"}),e.jsx("span",{children:E.name})]}),e.jsx(l,{})]})})})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(n,{control:t.control,name:"data_treatment_authorized",render:({field:r})=>e.jsxs(o,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(c,{children:e.jsx(Xe,{checked:r.value,onCheckedChange:r.onChange})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsxs($,{className:"cursor-pointer",children:["He leÃdo y acepto los"," ",e.jsx("button",{type:"button",onClick:()=>te&&window.open(te,"_blank"),className:"text-primary underline hover:no-underline",disabled:!te,children:"Términos y Condiciones"})," ","y la"," ",e.jsx("button",{type:"button",onClick:()=>ie&&window.open(ie,"_blank"),className:"text-primary underline hover:no-underline",disabled:!ie,children:"PolÃtica de Habeas Data"})," ","*"]}),e.jsx(l,{})]})]})})}),e.jsx(N,{type:"submit",className:"w-full",size:"lg",disabled:I||R,onClick:()=>{t.trigger()},children:I?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}),"Procesando..."]}):"Pre-inscribirme"})]})})})]})]})})})]}),e.jsx(He,{}),e.jsx(Ke,{open:re,onOpenChange:r=>{G(r),r||(A(""),ae(null))},children:e.jsxs(Qe,{children:[e.jsxs(We,{children:[e.jsx(Ze,{children:"Recuperar Contraseña por Documento"}),e.jsx(er,{children:"Ingrese su número de documento para enviar un enlace de recuperación al email vinculado a su cuenta."})]}),e.jsx("div",{className:"space-y-4 pt-4",children:je?e.jsx(Ve,{email:je,isResending:se,onResend:ge,onClose:()=>{G(!1),A(""),ae(null)}}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Pe,{htmlFor:"recovery-document",children:"Número de Documento"}),e.jsx(Se,{id:"recovery-document",value:V,onChange:r=>A(r.target.value),placeholder:"Ingrese su número de documento"})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(N,{variant:"outline",onClick:()=>{G(!1),A("")},children:"Cancelar"}),e.jsx(N,{onClick:ge,disabled:se||V.length<5,children:se?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}),"Enviando..."]}):"Enviar Recuperación"})]})]})})]})})]})};export{Qr 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.