PageSourceSearch

https://hackathonhub.ai/assets/JudgeSignup-BGdqWkLk.js

js hackathonhub.ai collected 2026-10-05 13:33:37 UTC 3,354 bytes, 1 lines download raw bytes

1import{bJ as L,l as S,u as F,a1 as P,r,j as e,H as A,x as I,Y as k,Z as _,cz as J,aE as R,y as T,L as u,I as m,B as q,ab as D,F as H,s as g}from"./index-BR70Jv3h.js";function z(){const[n]=L(),l=S(),{language:p}=F(),{toast:i}=P(),[w,N]=r.useState(""),[h,C]=r.useState(""),[o,b]=r.useState(""),[c,y]=r.useState(""),[d,x]=r.useState(!1),f=p==="ar",a={ar:{title:"التسجيل كمحكم",description:"أكمل التسجيل للوصول إلى منصة التقييم",email:"البريد الإلكتروني",password:"كلمة المرور",fullName:"الاسم الكامل",createAccount:"إنشاء الحساب",creating:"جاري الإنشاء...",invalidLink:"رابط دعوة غير صالح",accountCreated:"تم إنشاء الحساب بنجاح",redirecting:"سيتم تحويلك إلى لوحة التحكم...",error:"حدث خطأ"},en:{title:"Judge Signup",description:"Complete your registration to access the evaluation platform",email:"Email",password:"Password",fullName:"Full Name",createAccount:"Create Account",creating:"Creating...",invalidLink:"Invalid invitation link",accountCreated:"Account created successfully",redirecting:"Redirecting to dashboard...",error:"An error occurred"}}[p];r.useEffect(()=>{const s=n.get("judge_id"),t=n.get("email");if(!s||!t){i({title:a.invalidLink,variant:"destructive"}),l("/");return}N(s),C(decodeURIComponent(t))},[n,l,i,a.invalidLink]);const E=async s=>{if(s.preventDefault(),!o||!c){i({title:a.error,description:f?"يرجى ملء جميع الحقول":"Please fill all fields",variant:"destructive"});return}try{x(!0);const{data:t,error:j}=await g.auth.signUp({email:h,password:o,options:{emailRedirectTo:`${window.location.origin}/`,data:{full_name:c}}});if(j)throw j;if(!t.user)throw new Error("Failed to create user");const{error:v}=await g.from("judges").update({user_id:t.user.id,status:"signed_up"}).eq("id",w);if(v)throw v;await g.from("user_roles").insert({user_id:t.user.id,role:"judge"}),i({title:a.accountCreated,description:a.redirecting}),setTimeout(()=>{l("/judge")},2e3)}catch(t){console.error("Error creating account:",t),i({title:a.error,description:t.message,variant:"destructive"})}finally{x(!1)}};return e.jsxs("div",{className:"min-h-screen flex flex-col",dir:f?"rtl":"ltr",children:[e.jsx(A,{}),e.jsx("main",{className:"flex-1 bg-background px-4 py-8",children:e.jsx("div",{className:"container mx-auto max-w-md",children:e.jsxs(I,{children:[e.jsxs(k,{children:[e.jsxs(_,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-6 h-6"}),a.title]}),e.jsx(R,{children:a.description})]}),e.jsx(T,{children:e.jsxs("form",{onSubmit:E,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(u,{htmlFor:"email",children:a.email}),e.jsx(m,{id:"email",type:"email",value:h,disabled:!0,className:"bg-muted"})]}),e.jsxs("div",{children:[e.jsx(u,{htmlFor:"fullName",children:a.fullName}),e.jsx(m,{id:"fullName",type:"text",value:c,onChange:s=>y(s.target.value),required:!0})]}),e.jsxs("div",{children:[e.jsx(u,{htmlFor:"password",children:a.password}),e.jsx(m,{id:"password",type:"password",value:o,onChange:s=>b(s.target.value),required:!0,minLength:6})]}),e.jsxs(q,{type:"submit",disabled:d,className:"w-full",children:[d&&e.jsx(D,{className:"w-4 h-4 mr-2 animate-spin"}),d?a.creating:a.createAccount]})]})})]})})}),e.jsx(H,{})]})}export{z 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.