PageSourceSearch

https://app.guardianpro.cloud/assets/VerifyEmail-ppTabEll.js

js guardianpro.cloud collected 2026-10-03 21:15:54 UTC 4,967 bytes, 1 lines download raw bytes

1import{r as i,k as C,g as R,j as e}from"./vendor-BFXU7DOE.js";import{s as N,m as I,B as m,R as L,a as v}from"./index-0a0uir_3.js";import{I as z}from"./input-tkUwFhSJ.js";import{G as B}from"./GuardianLogo-CR5GMaoV.js";import{m as F}from"./SpinnerGap.es-Ss98-HCj.js";import"./ui-B_QsM55A.js";import"./radix-BmG-mZpu.js";const $=()=>{const[c,y]=i.useState(""),[o,x]=i.useState(""),[u,f]=i.useState(!1),[h,b]=i.useState(!1),[g,n]=i.useState(""),[w,S]=i.useState(!1),[E,p]=i.useState(!1),l=C(),j=R();i.useEffect(()=>{var t;const s=(t=j.state)==null?void 0:t.email,a=sessionStorage.getItem("pendingVerificationEmail");s?(x(s),sessionStorage.setItem("pendingVerificationEmail",s)):a?x(a):l("/login")},[j.state,l]);const k=async s=>{var a,t;s.preventDefault(),n(""),f(!0);try{await v.verify(o,c),S(!0),sessionStorage.removeItem("pendingVerificationEmail"),setTimeout(()=>{l("/login")},2e3)}catch(r){const d=r instanceof Error&&"response"in r?r:null;n(((t=(a=d==null?void 0:d.response)==null?void 0:a.data)==null?void 0:t.message)||"Verification failed. Please check your code.")}finally{f(!1)}},V=async()=>{var s,a;n(""),b(!0);try{await v.resendVerification(o),n(""),p(!0),setTimeout(()=>p(!1),5e3)}catch(t){const r=t instanceof Error&&"response"in t?t:null;n(((a=(s=r==null?void 0:r.response)==null?void 0:s.data)==null?void 0:a.message)||"Failed to resend code. Please try again.")}finally{b(!1)}};return w?e.jsx("div",{className:"min-h-screen bg-linear-to-br from-gray-900 via-brand-darker to-blue-900 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-surface-solid rounded-2xl p-8 border border-edge max-w-md w-full text-center",children:[e.jsx(N,{className:"w-16 h-16 text-status-green mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-bold text-fg mb-2",children:"Email Verified!"}),e.jsx("p",{className:"text-fg-muted mb-4",children:"Your email has been successfully verified."}),e.jsx("p",{className:"text-fg-subtle",children:"Redirecting to login..."})]})}):e.jsxs("div",{className:"min-h-screen bg-linear-to-br from-gray-900 via-brand-darker to-blue-900 flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute -top-40 -right-40 w-80 h-80 bg-brand rounded-full mix-blend-screen filter blur-xl opacity-20 animate-blob"}),e.jsx("div",{className:"absolute -bottom-40 -left-40 w-80 h-80 bg-blue-500 rounded-full mix-blend-screen filter blur-xl opacity-20 animate-blob animation-delay-2000"}),e.jsx("div",{className:"absolute top-40 left-40 w-80 h-80 bg-cyan-500 rounded-full mix-blend-screen filter blur-xl opacity-20 animate-blob animation-delay-4000"})]}),e.jsxs("div",{className:"relative w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(B,{size:"lg",variant:"light"}),e.jsx("h1",{className:"text-3xl font-bold text-white mt-4 mb-2",children:"Verify Your Email"}),e.jsx("p",{className:"text-white/70",children:"We've sent a verification code to"}),e.jsx("p",{className:"text-brand-light font-medium",children:o})]}),e.jsx("div",{className:"bg-surface-solid rounded-2xl p-8 border border-edge shadow-2xl",children:e.jsxs("form",{onSubmit:k,className:"space-y-6",children:[E&&e.jsx("div",{className:"bg-green-500/10 border border-green-500/50 rounded-lg p-4",children:e.jsxs("p",{className:"text-sm text-status-green flex items-center",children:[e.jsx(N,{className:"w-5 h-5 mr-2 shrink-0"}),"Verification code resent! Check your email."]})}),g&&e.jsx("div",{className:"bg-red-500/10 border border-red-500/50 rounded-lg p-4",children:e.jsxs("p",{className:"text-sm text-status-red flex items-center",children:[e.jsx(I,{className:"w-5 h-5 mr-2 shrink-0"}),g]})}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"code",className:"block text-sm font-medium text-fg-muted mb-2",children:"Verification Code"}),e.jsx(z,{id:"code",name:"code",type:"text",required:!0,value:c,onChange:s=>y(s.target.value),className:"py-3 text-fg text-center text-2xl tracking-widest",placeholder:"000000",maxLength:6}),e.jsx("p",{className:"mt-2 text-xs text-fg-subtle text-center",children:"Enter the 6-digit code from your email"})]}),e.jsx(m,{type:"submit",disabled:u||c.length!==6,className:"w-full",children:u?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"w-5 h-5 mr-2 animate-spin"}),"Verifying..."]}):"Verify Email"}),e.jsx("div",{className:"text-center",children:e.jsxs("p",{className:"text-fg-subtle text-sm",children:["Didn't receive the code?"," ",e.jsx(m,{type:"button",variant:"link",size:"sm",onClick:V,disabled:h,className:"p-0 h-auto font-medium",children:h?e.jsxs("span",{className:"inline-flex items-center",children:[e.jsx(L,{className:"w-4 h-4 mr-1 animate-spin"}),"Sending..."]}):"Resend Code"})]})}),e.jsx("div",{className:"text-center pt-4 border-t border-edge",children:e.jsx(m,{type:"button",variant:"link",size:"sm",onClick:()=>
1l("/login"),children:"← Back to Login"})})]})})]})]})};export{$ 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.