1import{j as e}from"./ui-vendor-CwKPOJE8.js";import{r as o,L as t}from"./react-vendor-BoB-7tOT.js";import{u as v,bf as N,L as d,I as m,aN as b,H as w,B as y,Q as L}from"./index-BdZNXa7t.js";import{u as S}from"./useLoginAuth-B2YccIf5.js";import{u as k}from"./useLoginRedirect-Bhso3kgQ.js";import"./supabase-QBQ6M2WM.js";import"./utils-BomB368b.js";import"./charts-DdJgN9kB.js";const q=()=>{const{toast:a}=v(),{login:x,loading:r}=S(),[i,h]=o.useState(""),[n,u]=o.useState(""),[l,p]=o.useState(!1),[j,g]=o.useState(!1);k({expectedUserType:"tc",redirectPath:"/tc/dashboard",enabled:j});const f=async s=>{if(s.preventDefault(),!i||!n){a({title:"Error",description:"Please fill in all fields",variant:"destructive"});return}try{const c=await x(i,n,"tc");c.success?(a({title:"Welcome back!",description:"Taking you to your transactions."}),g(!0)):a({title:"Login failed",description:c.error||"Invalid credentials",variant:"destructive"})}catch{a({title:"Error",description:"An unexpected error occurred. Please try again.",variant:"destructive"})}};return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-teal-50 to-white flex items-center justify-center p-4",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-teal-100 rounded-full mb-4",children:e.jsx(N,{className:"w-8 h-8 text-teal-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-stone-900",children:"Transaction Coordinator Login"}),e.jsx("p",{className:"text-stone-600 mt-2",children:"Access your files and deadlines"})]}),e.jsxs("form",{onSubmit:f,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx(d,{htmlFor:"email",children:"Email Address"}),e.jsx(m,{id:"email",type:"email",placeholder:"[email protected]",value:i,onChange:s=>h(s.target.value),className:"mt-1",required:!0,disabled:r})]}),e.jsxs("div",{children:[e.jsx(d,{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:"relative mt-1",children:[e.jsx(m,{id:"password",type:l?"text":"password",placeholder:"Enter your password",value:n,onChange:s=>u(s.target.value),required:!0,disabled:r}),e.jsx("button",{type:"button",onClick:()=>p(!l),className:"absolute right-3 top-1/2 -translate-y-1/2 text-stone-500 hover:text-stone-700",children:l?e.jsx(b,{className:"w-4 h-4"}):e.jsx(w,{className:"w-4 h-4"})})]})]}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(t,{to:"/forgot-password",className:"text-sm text-teal-700 hover:text-teal-800",children:"Forgot password?"})}),e.jsx(y,{type:"submit",className:"w-full bg-teal-600 hover:bg-teal-700",disabled:r,children:r?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing in..."]}):"Sign In"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-stone-600",children:["New here?"," ",e.jsx(t,{to:"/tc-signup",className:"font-medium text-teal-700 hover:text-teal-800",children:"Create a coordinator account"})]})}),e.jsx("div",{className:"mt-6 pt-5 border-t border-stone-200 text-center",children:e.jsxs("p",{className:"text-xs text-stone-500 leading-relaxed",children:["Coordinate for a brokerage that added you? Sign in at"," ",e.jsx(t,{to:"/brokerage-login",className:"text-teal-700 hover:text-teal-800",children:"brokerage login"}),". Either door works â you will land in the right place."]})}),e.jsx("div",{className:"mt-6 pt-5 border-t border-stone-200",children:e.jsxs("div",{className:"flex items-center justify-center space-x-4 text-sm",children:[e.jsx(t,{to:"/agent-login",className:"text-stone-600 hover:text-stone-800",children:"Agent Login"}),e.jsx("span",{className:"text-stone-400",children:"|"}),e.jsx(t,{to:"/for-transaction-coordinators",className:"text-stone-600 hover:text-stone-800",children:"How it works"}),e.jsx("span",{className:"text-stone-400",children:"|"}),e.jsx(t,{to:"/",className:"text-stone-600 hover:text-stone-800",children:"Home"})]})})]})})})};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.