1import{j as t,a as P,b as E}from"./ui-radix-Bk4hRwrv.js";import{u as y,R as g,f as k,r as x}from"./router-vendor-DYgwYSPk.js";import{u as W,b as I}from"./state-vendor-BAEYWeIk.js";import{u as F,a as D,b as j}from"./auth-vendor-BbutvCVi.js";import{G as U,M as G,C as K}from"./icons-vendor-D0sZMWLB.js";import{S as O,c as b,l as Q,a as q}from"./index-aG5_WC5Q.js";import"./react-vendor-F2Vt0_di.js";import"./utils-vendor-CsQ2SZQD.js";function R(n){return U({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M3 21h3.75L17.81 9.94l-3.75-3.75L3 17.25V21zm2-2.92 9.06-9.06.92.92L5.92 19H5v-.92zM18.37 3.29a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83a.996.996 0 0 0 0-1.41l-2.34-2.34z"},child:[]}]})(n)}const T=({otpLength:n=6,code:i,setCode:v})=>t.jsx("div",{className:"flex gap-2 justify-between mb-4",children:[...Array(n)].map((s,c)=>t.jsx("input",{type:"text",maxLength:1,value:i[c]||"",onChange:a=>{const h=a.target.value.replace(/[^0-9]/g,""),e=i.split("");if(e[c]=h,v(e.join("")),h&&c<5){const l=a.currentTarget.parentElement?.querySelectorAll("input");l&&l[c+1]&&l[c+1].focus()}},onKeyDown:a=>{if(a.key==="Backspace"&&!i[c]&&c>0){const h=a.currentTarget.parentElement?.querySelectorAll("input");h&&h[c-1]&&h[c-1].focus()}},onPaste:c===0?a=>{a.preventDefault();const h=a.clipboardData.getData("text").replace(/[^0-9]/g,"").slice(0,6);if(h){v(h);const e=a.currentTarget.parentElement?.querySelectorAll("input");if(e){const l=Math.min(h.length,5);e[l].focus()}}}:void 0,className:"w-12 h-12 text-center p-0 rounded-lg bg-[#1a1a1a] border border-[#2a2a2a] text-white focus:outline-none focus:border-[#3a3a3a] transition-colors",inputMode:"numeric"},c))}),_=({onNavigateToSignUp:n})=>{const i=y(),{signIn:v,isLoaded:s,setActive:c}=F(),{signUp:a}=D(),[h,e]=g.useState(""),[l,d]=g.useState(""),[z,u]=g.useState(!1),[V,p]=g.useState(!1),[f,m]=g.useState(""),[A,S]=g.useState("signin"),w=k();if(x.useEffect(()=>{if(new URLSearchParams(w.search).get("redirected")){d("Kindly signup with a business email.");const L=window.location.pathname;window.history.replaceState({},document.title,L)}},[w.search]),!s)return null;const B=M=>{switch(M){case"form_identifier_not_found":return"Failed to find your account, please sign up to continue.";case"form_email_address_blocked":case"not_allowed_access":return"Kindly signup with a business email.";default:return"An error occurred"}},o=async M=>{M.preventDefault(),d(""),u(!0);try{try{await v.create({strategy:"email_code",identifier:h}),p(!0);return}catch(r){if(r.errors?.[0]?.code==="session_exists"){i("/intermediate-signin");return}else if(r.errors?.[0]?.code==="form_identifier_not_found"){if(!a)throw r;S("signup");const L=h.split("@")[0]||"";await a.create({emailAddress:h,firstName:L,lastName:""}),await a.prepareEmailAddressVerification(),p(!0);return}throw r}}catch(r){const L=r.errors?.[0]?.code||"";d(B(L))}finally{u(!1)}},H=async M=>{M.preventDefault(),d(""),u(!0);try{let r={};if(A==="signin")r=await v.attemptFirstFactor({strategy:"email_code",code:f});else{if(!a)return;r=await a.attemptEmailAddressVerification({code:f})}r?.status==="complete"&&(c&&r?.createdSessionId&&c({session:r?.createdSe
1ssionId}),setTimeout(()=>{i("/intermediate-signin")},1e3))}catch(r){d(r.errors?.[0]?.message||"Invalid verification code")}finally{u(!1)}},C=async M=>{try{u(!0),await v.authenticateWithRedirect({strategy:M,redirectUrl:"/sso-callback",redirectUrlComplete:"/intermediate-signin"})}catch(r){if(r.errors?.[0]?.code==="session_exists"){i("/intermediate-signin");return}else d(r.errors?.[0]?.message||"An error occurred"),u(!1)}};return t.jsxs("div",{className:"w-full max-w-[480px] px-8 py-10 rounded-2xl",style:{backgroundColor:"#1E1E1EAA",boxShadow:"0 16px 70px 0 rgba(0, 0, 0, 0.50)"},children:[!V&&t.jsxs("div",{className:"text-center mb-8",children:[t.jsx("div",{className:"flex items-center justify-center mb-8",children:t.jsx("img",{src:O,alt:"SMTPFOX",className:"h-8"})}),t.jsx("h1",{className:"text-white text-2xl font-medium mb-2",children:"Welcome to SMTPFOX"}),t.jsx("p",{className:"text-gray-400 text-sm",children:"Sign in to continue to your account"})]}),V&&t.jsxs("div",{className:"text-center mb-8",children:[t.jsx("div",{className:"flex items-center justify-center mb-8",children:t.jsx("img",{src:O,alt:"SMTPFOX",className:"h-8"})}),t.jsx("h1",{className:"text-white text-xl font-medium mb-2",children:"Enter Email OTP"}),t.jsx("p",{className:"text-gray-400 text-sm mb-3",children:"OTP has been sent to your email"}),t.jsxs("div",{className:"flex items-center justify-center gap-2 text-white text-sm",children:[t.jsx("span",{children:h}),t.jsx(R,{className:"cursor-pointer text-gray-400 hover:text-white",onClick:()=>{p(!1),m(""),d("")}})]})]}),V?t.jsxs("form",{onSubmit:H,className:"space-y-6",children:[t.jsx(T,{otpLength:6,code:f,setCode:m}),l&&t.jsx("div",{className:"text-red-500 text-sm",children:l}),t.jsx("button",{type:"submit",disabled:z,className:"w-full h-12 bg-[#2a2a2a] hover:bg-[#353535] text-white text-sm font-medium rounded-lg transition-all disabled:opacity-50",children:z?t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx("span",{children:"Verifying Code"}),t.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})]}):"Verify Code"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-3 mb-6",children:[t.jsxs("button",{onClick:()=>C("oauth_google"),disabled:z,className:"w-full flex items-center justify-center gap-3 h-12 bg-[#1a1a1a] hover:bg-[#252525] text-white text-sm font-medium rounded-lg border border-[#2a2a2a] transition-all",children:[t.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[t.jsx("path",{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",fill:"#4285F4"}),t.jsx("path",{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",fill:"#34A853"}),t.jsx("path",{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",fill:"#FBBC05"}),t.jsx("path",{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",fill:"#EA4335"})]}),"Continue with Google"]}),t.jsxs("button",{onClick:()=>C("oauth_microsoft"),disabled:z,className:"w-full flex items-center justify-center gap-3 h-12 bg-[#1a1a1a] hover:bg-[#252525] text-white text-sm font-medium rounded-lg border border-[#2a2a2a] transition-all",children:[t.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 23 23",children:[t.jsx("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),t.jsx("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),t.jsx("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),t.jsx("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),t.jsx("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),"Continue with Microsoft"]})]}),t.jsxs("div",{className:"flex items-center gap-4 my-6",children:[t.jsx("div",{className:"h-px flex-1 bg-[#2a2a2a]"}),t.jsx("span",{className:"text-gray-500 text-xs uppercase",children:"OR"}),t.jsx("div",{className:"h-px flex-1 bg-[#2a2a2a]"})]}),t.jsxs("form",{onSubmit:o,className:"space-y-4",children:[t.jsx("input",{type:"email",value:h,onChange:M=>e(M.target.value),placeholder:"Enter Business Email",className:"w-full h-12 px-4 bg-[#1a1a1a] border border-[#2a2a2a] rounded-lg text-white placeholder-gray-500 focus:outline-none focus:border-[#3a3a3a] transition-colors",required:!0}),l&&t.jsx("div",{className:"text-red-500 text-sm",children:l}),t.jsx("button",{type:"submit",disabled:z,className:"w-full h-12 bg-[#2a2a2a] hover:bg-[#353535] text-white text-sm font-medium rounded-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:z?t.jsx("span",{className:"animate-pulse",children:"Signing in..."}):"Sign In"})]})]}),t.jsx("div",{className:"mt-8 text-center",children:t.jsxs("span",{className:"text-gray-400 text-sm",children:["Don't have an account?"," ",t.jsx("button",{onClick:n,className:"text-white hover:underline font-medium",children:"Sign Up"})]})})]})},N=x.memo(x.forwardRef(({className:n,...i},v)=>t.jsx(P,{ref:v,className:b("peer h-4 w-4 shrink-0 rounded-md border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-white",n),...i,children:t.jsx(E,{className:b("flex items-center justify-center text-current"),children:i.checked==="indeterminate"?t.jsx(G,{className:"h-3 w-3"}):t.jsx(K,{className:"h-3 w-4"})})})));N.displayName=P.displayName;const Z=({onNavigateToSignIn:n})=>{const{signUp:i,isLoaded:v}=D(),{setActive:s}=F(),c=y(),[a,h]=g.useState(""),[e,l]=g.useState(""),[d,z]=g.useState(!1),[u,V]=g.useState(!1),[p,f]=g.useState(""),[m,A]=g.useState(!1);if(!v)return null;const S=async o=>{if(o.preventDefault(),!m){l("Please agree to the Terms of Use and Privacy Policy");return}l(""),z(!0);const H=a.split("@")[0]||"",C="";try{await i.create({emailAddress:a,firstName:H,lastName:C}),await i.prepareEmailAddressVerification(),V(!0)}
1catch(M){l(M.errors?.[0]?.message||"An error occurred")}finally{z(!1)}},w=async o=>{o.preventDefault(),l(""),z(!0);try{const H=await i.attemptEmailAddressVerification({code:p});H.status==="complete"&&(s&&H?.createdSessionId&&s({session:H?.createdSessionId}),setTimeout(()=>{c("/intermediate-signup")},1e3))}catch(H){l(H.errors?.[0]?.message||"Invalid verification code")}finally{z(!1)}},B=async o=>{try{z(!0),await i.authenticateWithRedirect({strategy:o,redirectUrl:"/sso-callback",redirectUrlComplete:"/intermediate-signup"})}catch(H){l(H.errors?.[0]?.message||"An error occurred"),z(!1)}};return t.jsxs("div",{className:"w-full max-w-[480px] px-8 py-10 rounded-2xl",style:{backgroundColor:"#1E1E1EAA",boxShadow:"0 16px 70px 0 rgba(0, 0, 0, 0.50)"},children:[!u&&t.jsxs("div",{className:"text-center mb-8",children:[t.jsx("div",{className:"flex items-center justify-center mb-8",children:t.jsx("img",{src:O,alt:"SMTPFOX",className:"h-8"})}),t.jsx("h1",{className:"text-white text-2xl font-medium mb-2",children:"Welcome to SMTPFOX"}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["Sign up to start searching personalised",t.jsx("br",{}),"leads in minutes"]})]}),u&&t.jsxs("div",{className:"text-center mb-8",children:[t.jsx("div",{className:"flex items-center justify-center mb-8",children:t.jsx("img",{src:O,alt:"SMTPFOX",className:"h-8"})}),t.jsx("h1",{className:"text-white text-xl font-medium mb-2",children:"Enter Email OTP"}),t.jsx("p",{className:"text-gray-400 text-sm mb-3",children:"OTP has been sent to your email"}),t.jsxs("div",{className:"flex items-center justify-center gap-2 text-white text-sm",children:[t.jsx("span",{children:a}),t.jsx(R,{className:"cursor-pointer text-gray-400 hover:text-white",onClick:()=>{V(!1),f(""),l("")}})]})]}),u?t.jsxs("form",{onSubmit:w,className:"space-y-6",children:[t.jsx(T,{otpLength:6,code:p,setCode:f}),e&&t.jsx("div",{className:"text-red-500 text-sm",children:e}),t.jsx("button",{type:"submit",disabled:d,className:"w-full h-12 bg-[#2a2a2a] hover:bg-[#353535] text-white text-sm font-medium rounded-lg transition-all disabled:opacity-50",children:d?t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx("span",{children:"Verifying Code"}),t.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})]}):"Verify Code"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-3 mb-6",children:[t.jsxs("button",{onClick:()=>B("oauth_google"),disabled:d,className:"w-full flex items-center justify-center gap-3 h-12 bg-[#1a1a1a] hover:bg-[#252525] text-white text-sm font-medium rounded-lg border border-[#2a2a2a] transition-all",children:[t.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[t.jsx("path",{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",fill:"#4285F4"}),t.jsx("path",{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",fill:"#34A853"}),t.jsx("path",{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",fill:"#FBBC05"}),t.jsx("path",{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",fill:"#EA4335"})]}),"Continue with Google"]}),t.jsxs("button",{onClick:()=>B("oauth_microsoft"),disabled:d,className:"w-full flex items-center justify-center gap-3 h-12 bg-[#1a1a1a] hover:bg-[#252525] text-white text-sm font-medium rounded-lg border border-[#2a2a2a] transition-all",children:[t.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 23 23",children:[t.jsx("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),t.jsx("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),t.jsx("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),t.jsx("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),t.jsx("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),"Continue with Microsoft"]})]}),t.jsxs("div",{className:"flex items-center gap-4 my-6",children:[t.jsx("div",{className:"h-px flex-1 bg-[#2a2a2a]"}),t.jsx("span",{className:"text-gray-500 text-xs uppercase",children:"OR"}),t.jsx("div",{className:"h-px flex-1 bg-[#2a2a2a]"})]}),t.jsxs("form",{onSubmit:S,className:"space-y-4",children:[t.jsx("input",{type:"email",value:a,onChange:o=>h(o.target.value),placeholder:"Enter Business Email",className:"w-full h-12 px-4 bg-[#1a1a1a] border border-[#2a2a2a] rounded-lg text-white placeholder-gray-500 focus:outline-none focus:border-[#3a3a3a] transition-colors",required:!0}),e&&t.jsx("div",{className:"text-red-500 text-sm",children:e}),t.jsx("button",{type:"submit",disabled:d,className:"w-full h-12 bg-[#2a2a2a] hover:bg-[#353535] text-white text-sm font-medium rounded-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:d?t.jsx("span",{className:"animate-pulse",children:"Signing up..."}):"Signup With Email"}),t.jsxs("div",{className:"flex items-start gap-3 pt-2",children:[t.jsx(N,{id:"saveInfo",checked:m,onCheckedChange:o=>A(o),className:"mt-0.5 bg-transparent border-[#2a2a2a] data-[state=checked]:bg-white data-[state=checked]:text-black"}),t.jsx("label",{htmlFor:"saveInfo",className:"text-gray-400 text-xs leading-relaxed cursor-pointer",children:"I agree to smtpfox's Terms of Use and Privacy policy"})]})]})]}),t.jsx("div",{className:"mt-8 text-center",children:t.jsxs("span",{className:"text-gray-400 text-sm",children:["Already have an account?"," ",t.jsx("button",{onClick:n,className:"text-white hover:underline font-medium",children:"Sign In"})]})})]})},J=(n,i)=>{if(!n)return!1;const s=new Date().getTime()-n.getTime();return Math.floor(s/(1e3*60))<=i},X=()=>{const n=W(d=>d.user),i=k(),v=y(),s=i.pathname.includes("sign-in"),c=I(),{signOut:a}=j(),h=localStorage.getItem("redirectPath"),e=x.useCallback(async()=>{c(Q()),await a(),h?(localStorage.removeItem("redirectPath"),v(h)):v("/sign-in")},[c,a,h,v]);x.useEffect(()=>{n?.user&&(J(new Date(n?.user?.sessionDate),2880)?(c(q()),h?(localStorage.removeItem("redirectPath"),v(h)):v("/intermediate-signin")):e())},[n?.user,v,e,c,h]);const l=d=>{v(d)};return t.jsx("div",{className:"flex flex-col h-screen w-full bg-[#191A1A]",children:t.jsx("div",{className:"flex flex-1 flex-col justify-center items-center",children:s?t.jsx(_,{onNavigateToSignUp:()=>l("/sign-up")}):t.jsx(Z,{onNavigateToSignIn:()=>l("/sign-in")})})})},d1=g.memo(X);export{d1 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.