PageSourceSearch

https://novo.gruposvip.com/assets/SetupPassword-CyX0yiYT.js

js gruposvip.com collected 2026-09-26 08:44:07 UTC 4,219 bytes, 1 lines download raw bytes

1import{j as e}from"./query-Q_ThwKGI.js";import{r as o,k as E,i as k}from"./react-vendor-wefok28f.js";import{s as g}from"./client-DjLwxtrO.js";import{u as A}from"./index-C4Kq7kkR.js";import{B as h}from"./button-DrepnwkX.js";import{I as v}from"./input-Cu6Tiemi.js";import{L as j}from"./label-Ch0F7L4t.js";import{a2 as q,E as y,Q as N,Y as c}from"./icons-By8asZST.js";import"./supabase-COHOFxoQ.js";const Q=()=>{const[a,b]=o.useState(""),[l,C]=o.useState(""),[d,P]=o.useState(!1),[m,S]=o.useState(!1),[n,p]=o.useState(!1);E();const u=k(),{toast:t}=A();o.useEffect(()=>{(async()=>{const{data:{session:i}}=await g.auth.getSession();i||(t({title:"Access denied",description:"Please log in to access this page.",variant:"destructive"}),u("/login"))})()},[u,t]);const r=(s=>{const x=/[A-Z]/.test(s),w=/[a-z]/.test(s),f=/\d/.test(s);return{isValid:s.length>=8&&x&&w&&f,minLength:s.length>=8,hasUpperCase:x,hasLowerCase:w,hasNumbers:f}})(a),L=async s=>{if(s.preventDefault(),a!==l){t({title:"Error",description:"Passwords do not match.",variant:"destructive"});return}if(!r.isValid){t({title:"Error",description:"Password does not meet requirements.",variant:"destructive"});return}p(!0);try{const{error:i}=await g.auth.updateUser({password:a});i?t({title:"Error",description:i.message,variant:"destructive"}):(t({title:"Success",description:"Your password has been set successfully. Welcome to Leads Flow!"}),u("/"))}catch{t({title:"Error",description:"Something went wrong. Please try again.",variant:"destructive"})}finally{p(!1)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs("div",{className:"w-full max-w-md 
1space-y-6 bg-white rounded-lg shadow-lg p-8",children:[e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mx-auto",children:e.jsx(q,{className:"h-8 w-8 text-primary"})}),e.jsx("h1",{className:"text-2xl font-bold",children:"Complete your setup"}),e.jsx("p",{className:"text-muted-foreground",children:"Set up your password to complete your account setup."})]}),e.jsxs("form",{onSubmit:L,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"password",children:"Create password"}),e.jsxs("div",{className:"relative",children:[e.jsx(v,{id:"password",type:d?"text":"password",placeholder:"Create your password",value:a,onChange:s=>b(s.target.value),required:!0,disabled:n}),e.jsx(h,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>P(!d),children:d?e.jsx(y,{className:"h-4 w-4"}):e.jsx(N,{className:"h-4 w-4"})})]})]}),a&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{className:"font-medium",children:"Password requirements:"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:`flex items-center ${r.minLength?"text-green-600":"text-gray-500"}`,children:[e.jsx(c,{className:"h-3 w-3 mr-1"}),"At least 8 characters"]}),e.jsxs("div",{className:`flex items-center ${r.hasUpperCase?"text-green-600":"text-gray-500"}`,children:[e.jsx(c,{className:"h-3 w-3 mr-1"}),"One uppercase letter"]}),e.jsxs("div",{className:`flex items-center ${r.hasLowerCase?"text-green-600":"text-gray-500"}`,children:[e.jsx(c,{className:"h-3 w-3 mr-1"}),"One lowercase letter"]}),e.jsxs("div",{className:`flex items-center ${r.hasNumbers?"text-green-600":"text-gray-500"}`,children:[e.jsx(c,{className:"h-3 w-3 mr-1"}),"One number"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"confirmPassword",children:"Confirm password"}),e.jsxs("div",{className:"relative",children:[e.jsx(v,{id:"confirmPassword",type:m?"text":"password",placeholder:"Confirm your password",value:l,onChange:s=>C(s.target.value),required:!0,disabled:n}),e.jsx(h,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>S(!m),children:m?e.jsx(y,{className:"h-4 w-4"}):e.jsx(N,{className:"h-4 w-4"})})]})]}),e.jsx(h,{type:"submit",className:"w-full",disabled:n||!r.isValid||a!==l,children:n?"Setting up...":"Complete setup"})]})]})})};export{Q 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.