1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`30149d819cc8dac3c444edc00a81f10cbd8d263e`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`166a4d6c-3ad4-4b77-9183-515443069dae`,e._sentryDebugIdIdentifier=`sentry-dbid-166a4d6c-3ad4-4b77-9183-515443069dae`)}catch{}})();import{a as e}from"./chunk-CDjK9YqF.js";import{t}from"./react-CTUbuZO2.js";import{t as n}from"./link-1qJ4CdCo.js";import{t as r}from"./jsx-runtime-C34n93T5.js";import{Mt as i,T as a,_ as o,kt as s,lt as c,st as l}from"./dist-DcG0ite7.js";import{n as u,r as d}from"./auth-context-CSD9FsK-.js";var f=e(t(),1),p=r(),m=[{provider:`google`,label:`Google Login`},{provider:`apple`,label:`Apple Login`},{provider:`x`,label:`X Login`}],h={login:`email`,register:`register`,forgot:`forgot`};function g(){return(0,p.jsxs)(`div`,{className:`flex w-full flex-col items-center justify-center gap-4`,children:[(0,p.jsxs)(`div`,{className:`inline-flex flex-row items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`text-lg text-white sm:text-xl`,children:`Welcome`}),(0,p.jsx)(`div`,{className:`w-[38px] sm:w-[44px]`,children:(0,p.jsx)(`img`,{className:`block w-full`,src:`/svg/profile-macronaut.svg`,alt:``})}),(0,p.jsx)(`span`,{className:`text-lg text-white sm:text-xl`,children:`Macronaut`})]}),(0,p.jsxs)(`div`,{className:`flex w-full flex-col items-center justify-center gap-2`,children:[(0,p.jsx)(`span`,{className:`text-center font-quagmire text-2xl font-bold uppercase leading-7 text-white`,children:`Suit up and Let's Go...`}),(0,p.jsx)(`span`,{className:`text-center font-quagmire text-2xl font-bold uppercase leading-7 text-mv-red-600`,children:`Adventure awaits!`})]})]})}function _(){return(0,p.jsxs)(`div`,{className:`flex w-full flex-col items-center justify-center gap-4`,children:[(0,p.jsx)(`div`,{className:`inline-flex flex-row items-center gap-2`,children:(0,p.jsx)(`span`,{className:`text-lg text-white sm:text-xl`,children:`Forgot Password?`})}),(0,p.jsxs)(`div`,{className:`flex w-full flex-col items-center justify-center gap-2`,children:[(0,p.jsx)(`span`,{className:`text-center font-quagmire text-2xl font-bold leading-7 text-white`,children:`Stay calm...`}),(0,p.jsx)(`span`,{className:`text-center font-quagmire text-2xl font-bold uppercase leading-7 text-mv-blue-300`,children:`We've got this.`})]})]})}function v({initialView:e,onSuccess:t}){let{loginWithPassword:r,registerWithPassword:h,sendPasswordReset:v,loginWithSocial:b}=u(),[x,S]=(0,f.useState)(e),[C,w]=(0,f.useState)(``),[T,E]=(0,f.useState)(``),[D,O]=(0,f.useState)(``),[k,A]=(0,f.useState)(null),[j,M]=(0,f.useState)(null),[N,P]=(0,f.useState)(!1),F=e=>{S(e),M(null),P(!1),E(``),O(``)},I=async e=>{if(!k){M(null),A(`password`);try{await e()}catch(e){M(y(e))}finally{A(null)}}},L=e=>{e.preventDefault(),!(!C||!T)&&I(async()=>{await r(C,T),t()})},R=e=>{if(e.preventDefault(),!(!C||!T)){if(T!==D){M(`Passwords do not match.`);return}I(async()=>{await h(C,T),t()})}},z=e=>{e.preventDefault(),C&&I(async()=>{await v(C),P(!0)})},B=async e=>{if(!k){M(null),A(e);try{await b(e),t()}catch(e){e instanceof d&&e.code===`cancelled`||M(y(e))}finally{A(null)}}},V=j?(0,p.jsx)(s,{variant:`error`,children:(0,p.jsx)(a,{children:j})}):null;return(0,p.jsx)(`div`,{className:`flex w-full flex-col items-center justify-center`,children:(0,p.jsxs)(`div`,{className:`flex w-full max-w-[380px] flex-col gap-8`,children:[x===`socials`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(g,{}),V,(0,p.jsxs)(`div`,{className:`flex w-full flex-col divide-y divide-white/20`,children:[(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 pb-6`,children:[(0,p.jsx)(`div`,{className:`grid w-full grid-cols-12 gap-2`,children:m.map(({provider:e,label:t})=>(0,p.jsx)(`div`,{className:`col-span-12 mt-2 flex w-full flex-col`,children:(0,p.jsx)(l,{type:`button`,variant:`outline`,size:`lg`,isLoading:k===e,disabled:k!==null,className:`w-full bg-mv-black font-quagmire uppercase`,onClick:()=>B(e),children:t})},e))}),(0,p.jsxs)(`div`,{className:`mt-2 flex w-full flex-col items-center justify-center`,children:[(0,p.jsx)(`span`,{className:`text-md text-white/70`,children:`Need an account?`}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>F(`register`),className:`text-lg font-semibold uppercase text-white`,children:`Register`})]})]}),(0,p.jsx)(`div`,{className:`flex w-full flex-col gap-3 pt-6`,children:(0,p.jsx)(o,{type:`button`,variant:`outline`,color:`blue`,className:`w-full font-quagmire uppercase`,onClick:()=>F(`email`),children:`Login with email`})})]})]}),x===`email`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(g,{}),V,(0,p.jsxs)(`form`,{onSubmit:L,className:`flex w-full flex-col divide-y divide-white/20`,children:[(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 pb-6`,children:[(0,p.jsxs)(`div`,{className:`grid w-full grid-cols-12 gap-3`,children:[(0,p.jsx)(`div`,{className:`col-span-12 flex w-full flex-col`,children:(0,p.jsx)(c,{variant:`filled`,size:`lg`,type:`email`,autoComplete:`email`,placeholder:`Email Address`,value:C,onChange:e=>w(e.target.value)})}),(0,p.jsx)(`div`,{className:`col-span-12 flex w-full flex-col`,children:(0,p.jsx)(c,{variant:`filled`,size:`lg`,type:`password`,autoComplete:`current-password`,placeholder:`Password`,value:T,onChange:e=>E(e.target.value)})}),(0,p.jsx)(`div`,{className:`col-span-12 mt-2 flex w-full flex-col`,children:(0,p.jsx)(l,{type:`submit`,variant:`outline`,size:`lg`,isLoading:k===`password`,disabled:k!==null||!C||!T,className:`w-full bg-mv-black font-quagmire uppercase`,children:`Login`})})]}),(0,p.jsxs)(`div`,{className:`mt-2 flex w-full flex-col items-center justify-center`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:()=>F(`forgot`),className:`text-md font-semibold text-white`,children:`Forgot Password?`}),(0,p.jsxs)(`p`,{children:[(0,p.jsx)(`span`,{className:`text-md text-white/70`,children:`Need an account? `}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>F(`register`),className:`text-md font-semibold uppercase text-white`,children:`Register`})]})]})]}),(0,p.jsx)(`div`,{className:`flex w-full flex-col gap-3 pt-6`,children:(0,p.jsx)(o,{type:`button`,variant:`outline`,color:`blue`,className:`w-full font-quagmire uppercase`,onClick:()=>F(`socials`),children:`Login with socials`})})]})]}),x===`register`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(g,{}),V,(0,p.jsxs)(`form`,{onSubmit:R,className:`flex w-full flex-col divide-y divide-white/20`,children:[(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 pb-6`,children:[(0,p.jsxs)(`div`,{className:`grid w-full grid-cols-12 gap-3`,children:[(0,p.jsx)(`div`,{className:`col-span-12 flex w-full flex-col`,children:(0,p.jsx)(c,{variant:`filled`,size:`lg`,type:`email`,autoComplete:`email`,placeholder:`Email Address`,value:C,onChange:e=>w(e.target.value)})}),(0,p.jsx)(`div`,{className:`col-span-12 flex w-full flex-col`,children:(0,p.jsx)(c,{variant:`filled`,size:`lg`,type:`password`,autoComplete:`new-password`,placeholder:`Password`,value:T,onChange:e=>E(e.target.value)})}),(0,p.jsx)(`div`,{className:`col-span-12 flex w-full flex-col`,children:(0,p.jsx)(c,{variant:`filled`,size:`lg`,type:`password`,autoComplete:`new-password`,placeholder:`Re-type Password`,value:D,onChange:e=>O(e.target.value)})}),(0,p.jsxs)(`div`,{className:`col-span-12 mt-2 flex w-full flex-col gap-2 px-8`,children:[(0,p.jsxs)(`p`,{className:`text-center text-sm text-white/70`,children:[`By signing up, I agree to the Macroverse`,` `,(0,p.jsx)(n,{to:`/terms-of-use`,className:`text-white`,children:`Terms of use`}),` `,`and`,` `,(0,p.jsx)(n,{to:`/privacy-policy`,className:`text-white`,children:`Privacy Policy`}),`.`]}),(0,p.jsx)(`p`,{className:`text-center text-sm text-white/70`,children:`Macroverse collects and processes email address for marketing purposes. You can unsubscribe at any time.`})]}),(0,p.jsx)(`div`,{className:`col-span-12 mt-2 flex w-full flex-col`,children:(0,p.jsx)(l,{type:`submit`,variant:`outline`,size:`lg`,isLoading:k===`password`,disabled:k!==null||!C||!T||!D,className:`w-full bg-mv-black font-quagmire uppercase`,children:`Register`})})]}),(0,p.jsxs)(`div`,{className:`mt-2 flex w-full flex-row items-center justify-center divide-x-2 divide-white/20`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:()=>F(`email`),className:`text-md px-4 leading-4 text-white hover:text-mv-blue-300`,children:`Login`}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>F(`forgot`),className:`text-md px-4 leading-4 text-white hover:text-mv-blue-300`,children:`Forgot Password`})]})]}),(0,p.jsx)(`div`,{className:`flex w-full flex-col gap-3 pt-6`,children:(0,p.jsx)(o,{type:`button`,variant:`outline`,color:`blue`,className:`w-full font-quagmire uppercase`,onClick:()=>F(`socials`),children:`Login with socials`})})]})]}),x===`forgot`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(_,{}),N&&(0,p.jsxs)(s,{variant:`success`,children:[(0,p.jsx)(i,{children:`Check your inbox`}),(0,p.jsx)(a,{children:`We've just sent you an email to reset your password.`})]}),V,(0,p.jsx)(`form`,{onSubmit:z,className:`flex w-full flex-col`,children:(0,p.jsxs)(`div`,{className:`flex w-full flex-col items-center justify-center gap-4 pb-2`,children:[(0,p.jsxs)(`div`,{className:`grid w-full grid-cols-12 gap-3`,children:[(0,p.jsx)(`div`,{className:`col-span-12 flex w-full flex-col`,children:(0,p.jsx)(c,{variant:`filled`,size:`lg`,type:`email`,autoComplete:`email`,placeholder:`Email Address`,value:C,onChange:e=>w(e.target.value)})}),(0,p.jsx)(`div`,{className:`col-span-12 mt-2 flex w-full flex-col`,children:(0,p.jsx)(l,{type:`submit`,variant:`outline`,size:`lg`,isLoading:k===`password`,disabled:k!==null||!C,className:`w-full bg-mv-black font-quagmire uppercase`,children:`Submit`})})]}),(0,p.jsx)(`div`,{className:`mt-2 flex w-full flex-row items-center justify-center`,children:(0,p.jsx)(`button`,{type:`button`,onClick:()=>F(`email`),className:`text-md px-4 leading-4 text-white hover:text-mv-blue-300`,children:`Login`})})]})})]})]})})}function y(e){return e instanceof d?e.message:`Something went wrong. Please try again.`}export{h as n,v as t};
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.