PageSourceSearch

https://kolabo.co.id/assets/Register-C4cFVeSb.js

js kolabo.co.id collected 2026-10-05 01:04:48 UTC 9,769 bytes, 1 lines download raw bytes

1import{u as R,r as m,j as e,m as i,L as p,b as u,C as w,f as H,g as O,d as T,aQ as N,aC as b,e as G,B as f,A as z,Q as c,D as J}from"./index-CxTzo_i5.js";import{I as l}from"./input-CcS2mpyJ.js";import{L as o}from"./label-u97y7T5C.js";import{F as Q}from"./floating-particles-DCMp4rdB.js";import{K as U}from"./kolabo-logo-svg-CeQF8VtG.js";import{G as y}from"./gradient-text-CRbrcK7y.js";import{M as k}from"./mail-ne6v6G0L.js";import{E as X}from"./eye-off-Cb-Ha_7t.js";import{E as V}from"./eye-DtgkDt4i.js";import{B as P}from"./building-B_ds5d3X.js";import{A as Z}from"./arrow-left-B8GMcwgo.js";const v=[{id:1,title:"Akun",icon:b},{id:2,title:"Profil",icon:k},{id:3,title:"Brand",icon:P},{id:4,title:"Selesai",icon:w}];function ne(){const C=R(),[t,x]=m.useState(1),[g,j]=m.useState(!1),[h,S]=m.useState(!1),[s,L]=m.useState({email:"",password:"",confirmPassword:"",name:"",phone:"",company:"",role:""}),[d,A]=m.useState(0),F=a=>{let r=0;a.length>=8&&r++,/[a-z]/.test(a)&&/[A-Z]/.test(a)&&r++,/\d/.test(a)&&r++,/[!@#$%^&*(),.?":{}|<>]/.test(a)&&r++,A(r)},n=(a,r)=>{L(I=>({...I,[a]:r})),a==="password"&&F(r)},B=()=>{if(t===1){if(!s.email||!s.password){c.error("Harap isi email dan password");return}if(s.password!==s.confirmPassword){c.error("Password tidak cocok");return}if(d<2){c.error("Password terlalu lemah");return}}if(t===2&&!s.name){c.error("Harap isi nama lengkap");return}x(a=>Math.min(a+1,4))},K=()=>{x(a=>Math.max(a-1,1))},M=async()=>{j(!0);try{const{error:a}=await J.auth.signUp({email:s.email,password:s.password,options:{data:{name:s.name,phone:s.phone,company:s.company,role:s.role}}});if(a)throw a;x(4),c.success("Registrasi berhasil! Silakan cek email untuk verifikasi."),setTimeout(()=>C("/auth"),3e3)}catch(a){c.error(a.message||"Registrasi gagal")}finally{j(!1)}},D=["bg-destructive","bg-orange-500","bg-yellow-500","bg-green-500"],E=["Sangat Lemah","Lemah","Sedang","Kuat"];return e.jsxs("div",{className:"min-h-screen bg-background relative overflow-hidden flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-background to-neon-pink/5"}),e.jsx(Q,{particleCount:30,className:"opacity-20"}),e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-primary/20 rounded-full blur-3xl animate-pulse-slow"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-neon-pink/20 rounded-full blur-3xl animate-pulse-slow",style:{animationDelay:"1s"}}),e.jsxs(i.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"relative z-10 w-full max-w-lg",children:[e.jsx("div",{className:"text-center mb-8",children:e.jsxs(p,{to:"/",className:"inline-flex items-center gap-2 group",children:[e.jsx(i.div,{whileHover:{rotate:360},transition:{duration:.5},children:e.jsx(U,{className:"h-12 w-12"})}),e.jsx("span",{className:"font-futuristic font-black text-2xl tracking-[0.08em]",children:e.jsx(y,{children:"KOLABO"})})]})}),e.jsx("div",{className:"flex justify-center mb-8",children:e.jsx("div",{className:"flex items-center gap-2",children:v.map((a,r)=>e.jsxs("div",{className:"flex items-center",children:[e.jsx(i.div,{initial:!1,animate:{scale:t>=a.id?1:.9,opacity:t>=a.id?1:.5},className:u("w-10 h-10 rounded-full flex items-center justify-center transition-all duration-300",t>=a.id?"bg-gradient-to-r from-primary to-neon-pink text-primary-foreground shadow-glow-md":"bg-muted text-muted-foreground"),children:t>a.id?e.jsx(w,{className:"h-5 w-5"}):e.jsx(a.icon,{className:"h-5 w-5"})}),r<v.length-1&&e.jsx("div",{className:u("w-8 h-0.5 mx-1 transition-all duration-300",t>a.id?"bg-primary":"bg-muted")})]},a.id))})}),e.jsx(H,{className:"glass-strong border-primary/20 overflow-hidden",children:e.jsxs(O,{className:"p-8",children:[e.jsxs(T,{mode:"wait",children:[t===1&&e.jsxs(i.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:"space-y-6",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Buat Akun"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Masukkan email dan password untuk memulai"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(k,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(l,{id:"email",type:"email",placeholder:"[email protected]",value:s.email,onChange:a=>n("email",a.target.value),className:"pl-10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(N,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(l,{id:"password",type:h?"text":"password",placeholder:"••••••••",value:s.password,onChange:a=>n("password",a.target.value),className:"pl-10 pr-10"}),e.jsx("button",{type:"button",onClick:()=>S(!h),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:h?e.jsx(X,{className:"h-4 w-4"}):e.jsx(V,{className:"h-4 w-4"})})]}),s.password&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex gap-1",children:[0,1,2,3].map(a=>e.jsx(i.div,{initial:{scaleX:0},animate:{scaleX:d>a?1:.3},className:u("h-1.5 flex-1 rounded-full transition-colors",d>a?D[d-1]:"bg-muted")},a))}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Kekuatan: ",E[d-1]||"Sangat Lemah"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"confirmPassword",children:"Konfirmasi Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(N,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(l,{id:"confirmPassword",type:"password",placeholder:"••••••••",value:s.confirmPassword,onChange:a=>
1n("confirmPassword",a.target.value),className:"pl-10"})]}),s.confirmPassword&&s.password!==s.confirmPassword&&e.jsx("p",{className:"text-xs text-destructive",children:"Password tidak cocok"})]})]})]},"step1"),t===2&&e.jsxs(i.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:"space-y-6",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Profil Anda"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Lengkapi informasi profil Anda"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"name",children:"Nama Lengkap *"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(l,{id:"name",placeholder:"John Doe",value:s.name,onChange:a=>n("name",a.target.value),className:"pl-10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"phone",children:"Nomor Telepon"}),e.jsx(l,{id:"phone",placeholder:"+62 812 3456 7890",value:s.phone,onChange:a=>n("phone",a.target.value)})]})]})]},"step2"),t===3&&e.jsxs(i.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:"space-y-6",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Informasi Brand"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Opsional - bisa diisi nanti"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"company",children:"Nama Perusahaan/Brand"}),e.jsxs("div",{className:"relative",children:[e.jsx(P,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(l,{id:"company",placeholder:"PT. Contoh Indonesia",value:s.company,onChange:a=>n("company",a.target.value),className:"pl-10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"role",children:"Jabatan"}),e.jsx(l,{id:"role",placeholder:"Marketing Manager",value:s.role,onChange:a=>n("role",a.target.value)})]})]})]},"step3"),t===4&&e.jsxs(i.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center py-8",children:[e.jsx(i.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",bounce:.5},className:"w-20 h-20 mx-auto mb-6 rounded-full bg-gradient-to-r from-primary to-neon-pink flex items-center justify-center shadow-glow-lg",children:e.jsx(G,{className:"h-10 w-10 text-primary-foreground"})}),e.jsx("h2",{className:"text-2xl font-bold mb-2",children:e.jsx(y,{children:"Selamat Datang!"})}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Akun Anda berhasil dibuat. Silakan cek email untuk verifikasi."}),e.jsx(f,{asChild:!0,className:"bg-gradient-to-r from-primary to-neon-pink hover:opacity-90",children:e.jsx(p,{to:"/auth",children:"Ke Halaman Login"})})]},"step4")]}),t<4&&e.jsxs("div",{className:"flex gap-3 mt-8",children:[t>1&&e.jsxs(f,{variant:"outline",onClick:K,className:"flex-1",children:[e.jsx(Z,{className:"mr-2 h-4 w-4"}),"Kembali"]}),e.jsx(f,{onClick:t===3?M:B,disabled:g,className:"flex-1 bg-gradient-to-r from-primary to-neon-pink hover:opacity-90",children:g?e.jsx("div",{className:"animate-spin h-4 w-4 border-2 border-primary-foreground border-t-transparent rounded-full"}):t===3?"Daftar":e.jsxs(e.Fragment,{children:["Lanjut",e.jsx(z,{className:"ml-2 h-4 w-4"})]})})]}),t===1&&e.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-6",children:["Sudah punya akun?"," ",e.jsx(p,{to:"/auth",className:"text-primary hover:underline font-medium",children:"Masuk di sini"})]})]})})]})]})}export{ne 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.