PageSourceSearch

https://theworldyacht.com/assets/WavecastRegister-d8xMBRRi.js

js theworldyacht.com collected 2026-10-09 22:54:54 UTC 4,808 bytes, 1 lines download raw bytes

1import{h as E,r as l,s as h,j as e,S as L,N as q,$ as P,m as W,n as A,o as T,t as D,p as _,Z as i,B as $,b as H,L as J,F as M,av as k,J as d,aw as o}from"./index-D8tRRnO5.js";import{L as c}from"./label-BTRcGS1g.js";const p="/courses/vhf-src-prep/dashboard",B=k({fullName:o().trim().min(2,"Full name is required").max(100),email:o().trim().email("Enter a valid email").max(255),whatsapp:o().trim().min(7,"Enter a valid WhatsApp number").max(20,"WhatsApp number is too long").regex(/^[+]?[\d\s().-]+$/,"Use digits and + only"),password:o().min(6,"Password must be at least 6 characters").max(200),confirm:o()}).refine(s=>s.password===s.confirm,{message:"Passwords do not match",path:["confirm"]}),V=()=>{const s=E(),[x,j]=l.useState(""),[v,b]=l.useState(""),[g,C]=l.useState(""),[f,S]=l.useState(""),[y,F]=l.useState(""),[t,w]=l.useState(!1);l.useEffect(()=>{h.auth.getSession().then(({data:{session:a}})=>{a&&s(p,{replace:!0})})},[s]);async function R(a){a.preventDefault();const r=B.safeParse({fullName:x,email:v,whatsapp:g,password:f,confirm:y});if(!r.success){d.error(r.error.issues[0].message);return}w(!0);try{const m=`${window.location.origin}${p}`,{data:u,error:N}=await h.auth.signUp({email:r.data.email,password:r.data.password,options:{emailRedirectTo:m,data:{full_name:r.data.fullName,whatsapp_number:r.data.whatsapp}}});if(N)throw N;if(u.user)try{await h.from("profiles").update({display_name:r.data.fullName}).eq("id",u.user.id)}catch{}u.session?(d.success("Account created"),s(p,{replace:!0})):(d.success("Account created. Check your email to confirm, then log in."),s("/courses/vhf-src-prep/login",{replace:!0}))}catch(m){d.error(m?.message??"Could not create account")}finally{w(!1)}}const n="bg-[hsl(var(--vdr-navy))] border-[hsl(var(--vdr-gold)/0.25)] text-white";return e.jsxs("div",{className:"min-h-screen bg-[hsl(var(--vdr-navy))] text-white",children:[e.jsx(L,{title:"Wavecast — Student Registration",description:"Create your Wavecast VHF / SRC student account.",noindex:!0}),e.jsx(q,{}),e.jsxs("main",{className:"container mx-auto px-4 pt-28 pb-16 max-w-md",children:[e.jsxs("div",{className:"mb-6 text-center",children:[e.jsx(P,{className:"mx-auto mb-3 h-10 w-10 text-[hsl(var(--vdr-gold))]"}),e.jsx("h1",{className:"text-3xl font-bold font-['Playfair_Display']",children:"Create your account"}),e.jsx("p",{className:"mt-1 text-sm text-gray-400",children:"VHF Marine Radio / SRC Preparation"})]}),e.jsxs(W,{className:"border-[hsl(var(--vdr-gold)/0.2)] bg-[hsl(var(--vdr-navy-light))] text-white",children:[e.jsxs(A,{children:[e.jsx(T,{className:"text-white",children:"Student registration"}),e.jsx(D,{className:"text-gray-400",children:"Set up your access to the student dashboard."})]}),e.jsxs(_,{children:[e.jsxs("form",{onSubmit:R,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fullName",className:"text-gray-200",children:"Full name"}),e.jsx(i,{id:"fullName",type:"text",autoComplete:"name",placeholder:"Jane Mariner",value:x,onChange:a=>j(a.target.value),required:!0,maxLength:100,disabled:t,className:n})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"email",className:"text-gray-200",children:"Email address"}),e.jsx(i,{id:"email",type:"email",autoComplete:"email",placeholder:"[email protected]",value:v,onChange:a=>b(a.target.value),required:!0,disabled:t,className:n})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"whatsapp",className:"text-gray-200",children:"WhatsApp number"}),e.jsx(i,{id:"whatsapp",type:"tel",autoComplete:"tel",placeholder:"+44 7700 900123",value:g,onChange:a=>C(a.target.value),required:!0,maxLength:20,disabled:t,className:n})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"password",className:"text-gray-200",children:"Password"}),e.jsx(i,{id:"password",type:"password",autoComplete:"new-password",placeholder:"Min 6 characters",value:f,onChange:a=>S(a.target.value),required:!0,minLength:6,disabled:t,className:n})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"confirm",className:"text-gray-200",children:"Confirm password"}),e.jsx(i,{id:"confirm",type:"password",autoComplete:"new-password",placeholder:"Re-enter password",value:y,onChange:a=>F(a.target.value),required:!0,minLength:6,disabled:t,className:n})]}),e.jsxs($,{type:"submit",disabled:t,className:"w-full bg-[hsl(var(--vdr-gold))] text-[hsl(var(--vdr-navy))] hover:bg-[hsl(var(--vdr-gold)/0.85)]",children:[t&&e.jsx(H,{className:"mr-2 h-4 w-4 animate-spin"}),"Create account"]})]}),e.jsxs("p",{className:"mt-4 text-center text-sm text-gray-400",children:["Already have an account?"," ",e.jsx(J,{to:"/courses/vhf-src-prep/login",className:"text-[hsl(var(--vdr-gold))] hover:underline",children:"Sign in"})]})]})]})]}),e.jsx(M,{})]})};export{V 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.