PageSourceSearch

https://trackinv.com/assets/LoginPage-DuygH2Jc.js

js trackinv.com collected 2026-10-04 09:04:50 UTC 7,470 bytes, 1 lines download raw bytes

1import{r as l,c as D,i as O,j as e,L as C,u as V}from"./vendor-react-BK8d_rMm.js";import{e as W,g as J,h as q,q as U,f as $,L as h,B as f,N as K,J as g,O as Q,v as X}from"./index-B8biD5r7.js";import{u as Y,t as Z}from"./zod-COi2A8R6.js";import{u as _,r as ee}from"./AuthenticatedShell-GH_pYau2.js";import{l as se}from"./auth-C4uYM6o2.js";import{f as c,j as d}from"./auth-DcNjHlbz.js";import{s as te}from"./client-CGMratL4.js";import{I as L}from"./input-vEcEZ-KS.js";import{C as re}from"./checkbox-BQ7y7TJO.js";import{A as ae,a as ie}from"./alert-BHcPEpRl.js";import{M as oe}from"./mail-A4L9_l4W.js";import{L as le}from"./lock-BL-OSOu8.js";import{E as ne}from"./eye-off-DKb9A8Zx.js";import{E as me}from"./eye-CfzWBM-E.js";import{L as S}from"./loader-circle-CvwIJ-B2.js";import"./vendor-lodash-DXlbqpIS.js";import"./vendor-radix-D_Pkr-rs.js";import"./vendor-ui-utils-CYC2HZ_g.js";import"./vendor-query-vY6WKEIX.js";import"./tooltip-CYUHqobB.js";import"./auth-password-C7pI9sgd.js";import"./admin-api-oh0k8xsP.js";import"./subscription-utils-C164p-4e.js";import"./avatar-CSvN-QH2.js";import"./dropdown-menu-ChuT1v_U.js";import"./check-BZ8cdTuR.js";import"./chevron-right-CQjnzPgA.js";import"./badge-mdCtszfd.js";import"./refresh-cw-Bvi9RKBD.js";import"./circle-check-big-CdKd7Tgo.js";import"./circle-x-DqG3cuoS.js";import"./chevron-down-QvWr78NB.js";import"./newspaper-CId0jV4S.js";import"./book-open-Cub643Z1.js";import"./lightbulb-t-_QHrKd.js";import"./graduation-cap-BtxKycg7.js";import"./heart-Du6rQ9xv.js";import"./user-PdxeO8zF.js";import"./vendor-zod-06qWc2Xj.js";function ce({redirectTo:u,showTitle:s=!0,showFooter:E=!0}){const[n,F]=l.useState(!1),[A,p]=l.useState(!1),[j,w]=l.useState(!1),[b,r]=l.useState(null),{login:k,loginWithGoogle:M}=_(),P=D(),[N]=O(),G=u||N.get("redirect")||"/dashboard",{register:x,handleSubmit:I,watch:R,formState:{errors:i,isSubmitting:B}}=Y({resolver:Z(se),defaultValues:{email:"",password:"",remember:!1}});R("email");const z=async t=>{var a;if(r(null),p(!0),!d.canAttempt(t.email)){const o=Math.ceil(d.getRemainingTime(t.email)/1e3/60);r(`Too many failed attempts. Please try again in ${o} minutes.`),p(!1);return}try{const o=await k(t);if(o.success){g.success("Welcome back!",{duration:3e3,closeButton:!0}),Q("login","email"),X("login");const{data:{user:m}}=await te.auth.getUser(),T=m!=null&&m.id?await ee(m.id,u||N.get("redirect")):G;P(T,{replace:!0})}else d.recordAttempt(t.email),r(c((a=o.error)==null?void 0:a.message))}catch(o){d.recordAttempt(t.email),r(c(o.message))}finally{p(!1)}},H=async()=>{var t;r(null),w(!0);try{const a=await M();a.success?g.success("Redirecting to Google..."):r(c((t=a.error)==null?void 0:t.message))}catch(a){r(c(a.message))}finally{w(!1)}},v=A||B,y=v||j;return e.jsxs(W,{className:"w-full max-w-md mx-auto",children:[s&&e.jsxs(J,{className:"space-y-1",children:[e.jsx(q,{className:"text-2xl font-bold text-center",children:"Sign In"}),e.jsx(U,{className:"text-center",children:"Enter your email and password to access your account"})]}),e.jsx("form",{onSubmit:I(z),children:e.jsxs($,{className:"space-y-4",children:[b&&e.jsx(ae,{variant:"destructive",children:e.jsx(ie,{children:b})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(oe,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(L,{id:"email",type:"email",placeholder:"Enter your email",className:"pl-10",autoComplete:"email",autoFocus:!0,...x("email"),"aria-invalid":i.email?"true":"false"})]}),i.email&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:i.email.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(le,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(L,{id:"password",type:n?"text":"password",placeholder:"Enter your password",className:"pl-10 pr-10",autoComplete:"current-password",...x("password"),"aria-invalid":i.password?"true":"false"}),e.jsx(f,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>F(!n),"aria-label":n?"Hide password":"Show password",children:n?e.jsx(ne,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(me,{className:"h-4 w-4 text-muted-foreground"})})]}),i.password&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:i.password.message})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(re,{id:"remember",...x("remember"),"aria-describedby":"remember-description"}),e.jsx(h,{htmlFor:"remember",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Remember me"})]}),e.jsx(C,{to:"/reset-password/",className:"text-sm text-primary hover:underline focus:outline-none focus:underline",tabIndex:0,children:"Forgot password?"})]}),e.jsx(f,{type:"button",variant:"outline",className:"w-full",onClick:H,disabled:y,children:j?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"mr-2 h-4 w-4 animate-spin"}),"Connecting to Google..."]}):e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Continue with Google"]})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with"})})]}),e.jsx(f,{type:"submit",className:"w-full",disabled:y,children:v?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing in..."]}):"Sign In"})]})}),E&&e.jsx(K,{children:e.jsx("div",{className:"text-center w-full",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Don't have an account?"," ",e.jsx(C,{to:"/register/",className:"text-primary hover:underline focus:outline-none focus:underline",children:"Create account"})]})})})]})}function Xe(){const s=V().state;return l.useEffect(()=>{s!=null&&s.message&&g.info(s.message)},[s==null?void 0:s.message]),e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background to-muted/20 p-4",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:"Welcome to TrackinV"}),e.jsx("p",{className:"text-muted-foreground",children:"Sign in to manage your investment portfolio"})]}),e.jsx(ce,{redirectTo:s==null?void 0:s.redirect})]})})}export{Xe as LoginPage,Xe 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.