1import{r as i,h as R,j as e,L as n}from"./vendor-react-BtGqQFvK.js";import{P as W}from"./PageSEO-Cf3GPOjC.js";import{C as F,Q as k,k as L,s as h}from"./app-shell-CMj3qzLx.js";import{m as q}from"./vendor-motion-D4fhTsRL.js";import"./App-UtdOfdj1.js";import"./vendor-supabase-PhdYWwdx.js";import"./card-DX6FEdjS.js";import"./vendor-ui-zUh5tm1d.js";import"./vendor-query-CzlW6vM0.js";import"./vendor-i18n-Duo0qcql.js";import"./config-CI13lgno.js";import"./serviceWorker-BdOWgZKc.js";import"./useSiteSettingsCache-CfWB2_oA.js";import"./vendor-utils-BPqL1lCz.js";import"./sv2-iframe-runtime-evNQzxL9.js";const I="/assets/affiliate-signup-side-D6T6EZxV.jpg",V="00000000-0000-4000-9000-000000000001",H=()=>{const p="ABCDEFGHJKLMNPQRSTUVWXYZ23456789";let s="";for(let l=0;l<6;l++)s+=p.charAt(Math.floor(Math.random()*p.length));return s},re=()=>{i.useEffect(()=>{window.scrollTo(0,0)},[]);const s=R().pathname.startsWith("/en"),[l,C]=i.useState(""),[o,E]=i.useState(""),[f,S]=i.useState(""),[u,P]=i.useState("paypal"),[g,_]=i.useState(""),[b,A]=i.useState(""),[x,T]=i.useState(!1),[d,y]=i.useState(!1),[K,M]=i.useState(!1),[j,v]=i.useState(null),a=s?{title:"Join the Klasoo affiliate program",sub:"Create your free affiliate account. We review every application manually and you'll get your tracked link by email.",name:"Full name",email:"Email",password:"Password",paymentMethod:"How do you want to get paid?",paypal:"PayPal",stripe:"Stripe",bank:"Bank transfer",paymentEmail:"Payment email (PayPal/Stripe)",paymentEmailOptional:"If different from your contact email",channel:"Where will you promote Klasoo?",channelPh:"Newsletter, YouTube, blog, community⦠tell us where your audience is.",submit:"Create my affiliate account",submitting:"Creating your accountâ¦",back:"Back to the program",successTitle:"Application received",successSub:"We've received your application. We review each one manually and you'll receive an email with your tracked link and access to your dashboard.",successCta:"Back to Klasoo"}:{title:"Ãnete al programa de afiliados de Klasoo",sub:"Crea tu cuenta de afiliado gratis. Revisamos cada solicitud manualmente y recibirás tu enlace trackeado por email.",name:"Nombre completo",email:"Email",password:"Contraseña",paymentMethod:"¿Cómo quieres cobrar?",paypal:"PayPal",stripe:"Stripe",bank:"Transferencia bancaria",paymentEmail:"Email de pago (PayPal/Stripe)",paymentEmailOptional:"Si es distinto al de contacto",channel:"¿Dónde vas a promocionar Klasoo?",channelPh:"Newsletter, YouTube, blog, comunidad⦠cuéntanos dónde está tu audiencia.",submit:"Crear mi cuenta de afiliado",submitting:"Creando tu cuentaâ¦",back:"Volver al programa",successTitle:"Solicitud recibida",successSub:"Hemos recibido tu solicitud. Revisamos cada una manualmente y recibirás un email con tu enlace trackeado y el acceso a tu panel.",successCta:"Volver a Klasoo"},D=async t=>{if(t.preventDefault(),!(!x||d)){y(!0),v(null);try{const{data:m,error:w}=await h.auth.signUp({email:o,password:f,options:{emailRedirectTo:`${window.location.origin}/portal-afiliado`,data:{first_name:l.split(" ")[0],last_name:l.split(" ").slice(1).join(" ")}}});if(w)throw w;const{error:N}=await h.from("affiliates").insert({tenant_id:V,user_id:m.user?.id,name:l,email:o,status:"pending",commission_type:"percentage",commission_value:30,payment_method:u,payment_email:g||o,affiliate_code:H(),application_reason:b||null});if(N)throw N;h.functions.invoke("notify-affiliate-signup",{body:{email:o}}).catch(O=>console.error("notify-affiliate-signup failed",O)),M(!0)}catch(m){v(m instanceof Error?m.message:"Error")}finally{y(!1)}}},c="w-full h-10 px-3.5 rounded-xl bg-white ring-1 ring-[#E8ECF0] focus:ring-2 focus:ring-[#4091FF] outline-none text-[14px] text-[#0F172A] placeholder:text-[#94A3B8] transition",r="block text-[12px] font-semibold text-[#0F172A] mb-1",B=s?["30% recurring commission, no cap","60-day tracking cookie","Monthly payouts from 50â¬"]:["30% de comisión recurrente, sin tope","Cookie de seguimiento de 60 dÃas","Pagos mensuales desde 50 â¬"];return e.jsxs(e.Fragment,{children:[e.jsx(W,{title:s?"Join the affiliate program â Klasoo":"Ãnete al programa de afiliados â Klasoo",description:s?"Create your free Klasoo affiliate account and earn 30% recurring commission.":"Crea tu cuenta de afiliado de Klasoo gratis y gana un 3
10% de comisión recurrente.",path:s?"/en/affiliates/join":"/es/afiliados/registro",alternates:[{hreflang:"es",href:"/es/afiliados/registro"},{hreflang:"en",href:"/en/affiliates/join"},{hreflang:"x-default",href:"/es/afiliados/registro"}]}),e.jsx("section",{className:"mesh-gradient-hero min-h-[100svh] flex items-center pt-24 pb-8 lg:pt-28 lg:pb-10",children:e.jsx("div",{className:"w-full max-w-6xl mx-auto px-5 lg:px-8",children:e.jsx(q.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5},children:K?e.jsxs("div",{className:"max-w-xl mx-auto bg-white rounded-3xl ring-1 ring-[#E8ECF0] shadow-xl p-8 sm:p-10 text-center",children:[e.jsx(F,{className:"w-12 h-12 text-[#4091FF] mx-auto mb-4",strokeWidth:1.5}),e.jsx("h1",{className:"text-2xl font-extrabold text-[#0F172A] mb-3",children:a.successTitle}),e.jsx("p",{className:"text-[15px] text-[#64748B] leading-relaxed mb-8",children:a.successSub}),e.jsxs(n,{to:s?"/en":"/es",className:"inline-flex items-center gap-2 px-7 py-3.5 bg-gradient-to-b from-[#4091FF] to-[#3578DD] text-white font-semibold rounded-2xl text-[15px] shadow-[0_4px_24px_rgba(64,145,255,0.3)]",children:[a.successCta,e.jsx(k,{className:"w-4 h-4"})]})]}):e.jsxs("div",{className:"grid lg:grid-cols-[0.85fr_1fr] gap-8 lg:gap-12 items-center",children:[e.jsxs("div",{className:"hidden lg:block",children:[e.jsx("p",{className:"text-[12px] font-semibold text-[#4091FF] uppercase tracking-wider mb-2",children:s?"Affiliate Program":"Programa de Afiliados"}),e.jsx("h1",{className:"!text-[30px] !leading-[1.1] !tracking-tight font-extrabold tracking-tight text-[#0F172A] mb-3",children:a.title}),e.jsx("p",{className:"text-[14px] text-[#64748B] leading-relaxed mb-5",children:a.sub}),e.jsx("ul",{className:"space-y-2 mb-6",children:B.map(t=>e.jsxs("li",{className:"flex items-start gap-2 text-[14px] text-[#475569]",children:[e.jsx(F,{className:"w-4 h-4 mt-0.5 text-[#4091FF] shrink-0",strokeWidth:2}),e.jsx("span",{children:t})]},t))}),e.jsx("div",{className:"rounded-3xl overflow-hidden ring-1 ring-[#E8ECF0] shadow-xl max-h-[200px]",children:e.jsx("img",{src:I,alt:s?"Online academy dashboard on a laptop":"Panel de una academia online en un portátil",width:1024,height:1408,loading:"lazy",className:"w-full h-[200px] object-cover object-center"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"lg:hidden mb-5",children:[e.jsx("p",{className:"text-[12px] font-semibold text-[#4091FF] uppercase tracking-wider mb-2",children:s?"Affiliate Program":"Programa de Afiliados"}),e.jsx("h1",{className:"!text-[26px] !leading-[1.15] font-extrabold tracking-tight text-[#0F172A] mb-2",children:a.title}),e.jsx("p",{className:"text-[14px] text-[#64748B] leading-relaxed",children:a.sub})]}),e.jsxs("form",{onSubmit:D,className:"bg-white rounded-3xl ring-1 ring-[#E8ECF0] shadow-xl p-5 sm:p-7 space-y-3.5",children:[e.jsxs("div",{className:"grid sm:grid-cols-2 gap-3.5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"aff-name",className:r,children:a.name}),e.jsx("input",{id:"aff-name",className:c,value:l,onChange:t=>C(t.target.value),required:!0,autoComplete:"name"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"aff-email",className:r,children:a.email}),e.jsx("input",{id:"aff-email",type:"email",className:c,value:o,onChange:t=>E(t.target.value),required:!0,autoComplete:"email"})]})]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-3.5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"aff-password",className:r,children:a.password}),e.jsx("input",{id:"aff-password",type:"password",className:c,value:f,onChange:t=>S(t.target.value),required:!0,minLength:8,autoComplete:"new-password",placeholder:s?"Min. 8 characters":"MÃn. 8 caracteres"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"aff-payment-method",className:r,children:a.paymentMethod}),e.jsxs("select",{id:"aff-payment-method",className:c,value:u,onChange:t=>P(t.target.value),children:[e.jsx("option",{value:"paypal",children:a.paypal}),e.jsx("option",{value:"stripe",children:a.stripe}),e.jsx("option",{value:"bank_transfer",children:a.bank})]})]})]}),u!=="bank_transfer"&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"aff-payment-email",className:r,children:a.paymentEmail}),e.jsx("input",{id:"aff-payment-email",type:"email",className:c,value:g,onChange:t=>_(t.target.value),placeholder:a.paymentEmailOptional})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"aff-channel",className:r,children:a.channel}),e.jsx("textarea",{id:"aff-channel",rows:2,className:"w-full min-h-[64px] px-3.5 py-2.5 rounded-xl bg-white ring-1 ring-[#E8ECF0] focus:ring-2 focus:ring-[#4091FF] outline-none text-[14px] text-[#0F172A] placeholder:text-[#94A3B8] transition resize-y",value:b,onChange:t=>A(t.target.value),placeholder:a.channelPh})]}),e.jsxs("label",{className:"flex items-start gap-2.5 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:x,onChange:t=>
1T(t.target.checked),className:"mt-0.5 h-4 w-4 rounded border-[#E8ECF0] accent-[#4091FF]",required:!0}),e.jsx("span",{className:"text-[12.5px] text-[#475569] leading-relaxed",children:s?e.jsxs(e.Fragment,{children:["I accept the"," ",e.jsx(n,{to:"/en/affiliates/terms",target:"_blank",className:"font-semibold text-[#4091FF] hover:underline",children:"affiliate program terms"})," ","and the"," ",e.jsx(n,{to:"/privacy",target:"_blank",className:"font-semibold text-[#4091FF] hover:underline",children:"privacy policy"}),"."]}):e.jsxs(e.Fragment,{children:["Acepto los"," ",e.jsx(n,{to:"/es/afiliados/terminos",target:"_blank",className:"font-semibold text-[#4091FF] hover:underline",children:"términos del programa de afiliados"})," ","y la"," ",e.jsx(n,{to:"/privacy",target:"_blank",className:"font-semibold text-[#4091FF] hover:underline",children:"polÃtica de privacidad"}),"."]})})]}),j&&e.jsxs("div",{className:"flex items-start gap-2 text-[13px] text-red-600 bg-red-50 rounded-xl px-4 py-3",children:[e.jsx(L,{className:"w-4 h-4 mt-0.5 shrink-0"}),e.jsx("span",{children:j})]}),e.jsxs("button",{type:"submit",disabled:d||!x,className:"w-full inline-flex items-center justify-center gap-2 px-7 py-3 bg-gradient-to-b from-[#4091FF] to-[#3578DD] text-white font-semibold rounded-2xl text-[15px] shadow-[0_4px_24px_rgba(64,145,255,0.3)] disabled:opacity-50 disabled:cursor-not-allowed transition",children:[d?a.submitting:a.submit,!d&&e.jsx(k,{className:"w-4 h-4"})]}),e.jsx("p",{className:"text-center pt-0.5",children:e.jsxs(n,{to:s?"/en/affiliates":"/es/afiliados",className:"text-[12.5px] font-semibold text-[#4091FF] hover:underline",children:["â ",a.back]})})]})]})]})})})})]})};export{re 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.