1import{a as t,j as e}from"./vendor-react-DfgN88zu.js";import{k as v,N,B as w,F as k}from"./index-B9ywNYzW.js";import{u as C}from"./vendor-utils-DA9vXrEL.js";import{m as P}from"./vendor-motion-DZJ_Y2uo.js";import{ah as S}from"./vendor-icons-Dw56iAp8.js";import"./vendor-query-DpS8foko.js";import"./vendor-ui-Drqq0CNL.js";function U(){const[,o]=C(),{register:p}=v(),[n,g]=t.useState(""),[i,f]=t.useState(""),[d,b]=t.useState(""),[a,h]=t.useState(""),[l,y]=t.useState(""),[u,s]=t.useState(""),[c,m]=t.useState(!1),j=async r=>{if(r.preventDefault(),s(""),a.length<8){s("Password must be at least 8 characters.");return}if(a!==l){s("Passwords do not match.");return}m(!0);try{await p(n,i,d,a),o("/applicant/dashboard")}catch(x){(x instanceof Error?x.message:"").includes("409")?s("An account with this email already exists."):s("Registration failed. Please try again.")}finally{m(!1)}};return e.jsxs("div",{className:"min-h-screen flex flex-col font-sans bg-background",children:[e.jsx(N,{}),e.jsx("div",{className:"pt-24 pb-12 md:pt-40 md:pb-20 flex-grow flex items-center justify-center",children:e.jsx("div",{className:"w-full max-w-md px-6",children:e.jsxs(P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-card border border-border rounded-2xl p-8",children:[e.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-xl flex items-center justify-center text-primary mb-6 mx-auto",children:e.jsx(S,{className:"w-6 h-6"})}),e.jsx("h1",{className:"text-2xl font-display font-bold text-center text-foreground mb-2",children:"Create Account"}),e.jsx("p",{className:"text-sm text-muted-foreground text-center mb-6",children:"Register to apply for jobs"}),e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[u&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 rounded-xl px-4 py-3 text-sm","data-testid":"text-register-error",children:u}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"Full Name *"}),e.jsx("input",{type:"text",value:n,onChange:r=>g(r.target.value),className:"w-full px-4 py-3 rounded-xl border border-border bg-background text-foreground focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none",required:!0,"data-testid":"input-register-name"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"Email *"}),e.jsx("input",{type:"email",value:i,onChange:r=>f(r.target.value),className:"w-full px-4 py-3 rounded-xl border border-border bg-background text-foreground focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none",required:!0,"data-testid":"input-register-email"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"Phone *"}),e.jsx("input",{type:"tel",value:d,onChange:r=>b(r.target.value),className:"w-full px-4 py-3 rounded-xl border border-border bg-background text-foreground focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none",required:!0,"data-testid":"input-register-phone"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"Password (min 8 characters) *"}),e.jsx("input",{type:"password",value:a,onChange:r=>h(r.target.value),className:"w-full px-4 py-3 rounded-xl border border-border bg-background text-foreground focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none",required:!0,minLength:8,"data-testid":"input-register-password"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"Confirm Password *"}),e.jsx("input",{type:"password",value:l,onChange:r=>y(r.target.value),className:"w-full px-4 py-3 rounded-xl border border-border bg-background text-foreground focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none",required:!0,minLength:8,"data-testid":"input-register-confirm"})]}),e.jsx(w,{type:"submit",disabled:c,className:"w-full rounded-full h-12 bg-accent text-accent-foreground hover:bg-accent/90","data-testid":"button-register-submit",children:c?"Creating Account...":"Create Account"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Already have an account?"," ",e.jsx("button",{onClick:()=>
1o("/applicant/login"),className:"text-primary hover:underline font-medium","data-testid":"link-login",children:"Sign in"})]})})]})})}),e.jsx(k,{})]})}export{U 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.