1import{aX as v,r as s,a8 as C,aN as k,j as e,ad as E,N as r,i as l,k as o,$ as S,l as c,aY as d,m,B as p,aZ as P,aV as V}from"./index-BUR_l9d0.js";import{l as I}from"./login-hero-B-vl_vET.js";import{C as L}from"./circle-alert-CUwKabO8.js";const T="https://flightsim.to";function F(){const[y]=v(),a=y.get("token"),[N,x]=s.useState(!0),[u,b]=s.useState(!1),[f,i]=s.useState(null),h=C(),{toast:g}=k();s.useEffect(()=>{if(!a){i("Missing verification token. Please use the link from your email."),x(!1);return}(async()=>{try{const n=await fetch(`${T}/backend/user/settings/verify-email-change?token=${encodeURIComponent(a)}`,{method:"GET",credentials:"include"}),t=await n.json();n.ok&&t.success!==!1?(b(!0),g({title:"Email updated!",description:t.message||"Your email address has been changed successfully."})):i(t.message||t.error||"Verification failed. Please try again.")}catch{i("An unexpected error occurred. Please try again.")}finally{x(!1)}})()},[a,g]),s.useEffect(()=>{if(u){const j=setTimeout(()=>{h("/settings")},5e3);return()=>clearTimeout(j)}},[u,h]);const w=()=>N?e.jsxs(l,{className:"w-full lg:w-1/2 border-0 shadow-none rounded-none",children:[e.jsxs(o,{className:"space-y-1 text-center pt-10",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary mx-auto mb-4 flex items-center justify-center",children:e.jsx(S,{className:"h-6 w-6 text-primary-foreground animate-spin"})}),e.jsx(c,{className:"text-2xl font-bold",children:"Verifying Email Change"}),e.jsx(d,{children:"Please wait while we verify your new email address..."})]}),e.jsx(m,{className:"text-center pb-10",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This will only take a moment."})})]}):f?e.jsxs(l,{className:"w-full lg:w-1/2 border-0 shadow-none rounded-none",children:[e.jsxs(o,{className:"space-y-1 text-center pt-10",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-destructive mx-auto mb-4 flex items-center justify-center",children:e.jsx(L,{className:"h-6 w-6 text-destructive-foreground"})}),e.jsx(c,{className:"text-2xl font-bold",children:"Verification Failed"}),e.jsx(d,{children:f})]}),e.jsxs(m,{className:"text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Verification links expire after a short time for security reasons. You can request a new email change from your settings."}),e.jsx(p,{asChild:!0,className:"w-full max-w-xs",children:e.jsx(r,{to:"/settings",children:"Go to Settings"})})]}),e.jsx(P,{className:"flex justify-center pb-10",children:e.jsx(r,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground",children:"Return to Home"})})]}):e.jsxs(l,{className:"w-full lg:w-1/2 border-0 shadow-none rounded-none",children:[e.jsxs(o,{className:"space-y-1 text-center pt-10",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary mx-auto mb-4 flex items-center justify-center",children:e.jsx(V,{className:"h-6 w-6 text-primary-foreground"})}),e.jsx(c,{className:"text-2xl font-bold",children:"Email Updated!"}),e.jsx(d,{children:"Your email address has been changed successfully."})]}),e.jsxs(m,{className:"text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Redirecting you to settings automatically..."}),e.jsx(p,{asChild:!0,className:"w-full max-w-xs",children:e.jsx(r,{to:"/settings",children:"Go to Settings"})})]})]});return e.jsx(E,{children:e.jsx("div",{className:"min-h-[calc(100vh-16rem)] flex items-center justify-center py-12 px-4 bg-gradient-to-br from-primary/5 via-background to-secondary/20",children:e.jsxs("div",{className:"w-full max-w-5xl flex rounded-xl overflow-hidden shadow-2xl border border-border",children:[e.jsxs("div",{className:"hidden lg:flex lg:w-1/2 relative bg-gradient-to-br from-primary/90 to-primary flex-col justify-between p-8 text-primary-foreground",children:[e.jsx("div",{className:"absolute inset-0 bg-cover bg-center opacity-40",style:{backgroundImage:`url(${I})`}}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/95 via-primary/70 to-primary/40"}),e.jsx("div",{className:"relative z-10",children:e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary-foreground
1/20 backdrop-blur-sm flex items-center justify-center mb-6",children:e.jsx("span",{className:"font-bold text-2xl",children:"F"})})}),e.jsxs("div",{className:"relative z-10 space-y-4",children:[e.jsxs("h1",{className:"text-4xl font-bold leading-tight",children:["Email",e.jsx("br",{}),"Verification"]}),e.jsx("p",{className:"text-lg text-primary-foreground/80 max-w-sm",children:"Confirm your new email address to keep your Flightsim.to account secure."})]}),e.jsx("div",{className:"relative z-10",children:e.jsxs("p",{className:"text-sm text-primary-foreground/70",children:["Need help?"," ",e.jsx(r,{to:"/about",className:"text-primary-foreground font-medium hover:underline",children:"Contact support"})]})})]}),w()]})})})}export{F 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.