PageSourceSearch

https://academy.bachatasensual.com/assets/ResetPassword-zKU2rLaQ.js

js bachatasensual.com collected 2026-09-25 19:55:07 UTC 6,196 bytes, 1 lines download raw bytes

1import{a as e}from"./rolldown-runtime-DOG2APjf.js";import{i as s,t}from"./react-core-CchioXwE.js";import{n as a}from"./api-Bo2_vrwo.js";import{t as l}from"./arrow-left-HbW2WjoD.js";import{a as r}from"./monitoring-DTg999Ma.js";import{Ct as n,E as o,L as i,O as d,_t as c,a as m,bt as x,f as h,it as u,o as f,xt as p,yt as g}from"./index-hmhQZAEy.js";var w=e(s(),1),j=t();function v(){const e=p(),s=x(),[t]=n(),[v,b]=(0,w.useState)(""),[y,N]=(0,w.useState)(""),[S,_]=(0,w.useState)(""),[P,C]=(0,w.useState)(""),[R,E]=(0,w.useState)(!1),[q,W]=(0,w.useState)(""),[L,T]=(0,w.useState)(!1);(0,w.useEffect)(()=>{const e=s.state?.email,a=t.get("email");let l=null;try{l=sessionStorage.getItem("reset_password_email")}catch{console.warn("sessionStorage unavailable")}const r=e||a||l;if(r&&(b(r),e||a))try{sessionStorage.setItem("reset_password_email",r)}catch{}},[s.state,t]);(0,w.useEffect)(()=>{if(!L)return;const s=setTimeout(()=>{e("/login",{state:{message:"Password reset successfully! Please sign in."}})},3e3);return()=>clearTimeout(s)},[L,e]);const k=f(S),z=m(S,P);return L?(0,j.jsx)("div",{className:"bg-page-gradient relative min-h-[100svh] overflow-hidden",children:(0,j.jsx)("div",{className:"relative z-10 flex min-h-[100svh] w-full items-center justify-center px-4 sm:px-6 md:px-8",children:(0,j.jsx)("div",{className:"w-full max-w-md",children:(0,j.jsxs)("div",{className:"bg-bg-card rounded-xl border border-white/10 p-6 text-center sm:p-8",children:[(0,j.jsx)("div",{className:"mb-4 inline-flex h-16 w-16 items-center justify-center rounded-full bg-green-500/20",children:(0,j.jsx)(u,{className:"h-8 w-8 text-green-400"})}),(0,j.jsx)("h2",{className:"mb-2 font-serif text-2xl font-bold text-white",children:"Password Reset!"}),(0,j.jsx)("p",{className:"text-text-muted mb-4 font-sans text-sm",children:"Your password has been successfully reset."}),(0,j.jsx)("p",{className:"text-text-muted font-sans text-xs",children:"Redirecting to login page..."})]})})})}):(0,j.jsxs)("div",{className:"bg-page-gradient relative min-h-[100svh] overflow-hidden",children:[(0,j.jsx)(h,{variant:"subtle"}),(0,j.jsxs)("div",{className:"bg-glassmorphism relative z-10 flex min-h-[100svh] w-full flex-col px-4 sm:px-6 md:px-8 lg:flex-row lg:items-center lg:px-12 xl:px-16",children:[(0,j.jsxs)("div",{className:"hidden lg:flex lg:flex-1 lg:flex-col lg:justify-center lg:pr-8 xl:pr-16",children:[(0,j.jsx)("h1",{className:"mb-4 font-serif text-4xl font-bold text-white xl:mb-6 xl:text-6xl",children:"BSA"}),(0,j.jsx)("p",{className:"text-text-muted font-sans text-lg leading-relaxed xl:text-xl",children:"Bachata Sensual Academy"}),(0,j.jsx)("p",{className:"text-text-muted mt-3 font-sans xl:mt-4",children:"Create a new secure password"})]}),(0,j.jsxs)("div",{className:"mx-auto flex w-full max-w-md flex-1 flex-col justify-center py-8 sm:py-12 lg:max-w-none lg:border-l lg:border-white/10 lg:py-16 lg:pl-8 xl:pl-16",children:[(0,j.jsxs)("button",{onClick:()=>e("/forgot-password"),className:"text-text-muted mb-6 flex items-center gap-2 font-sans transition-colors hover:text-white",children:[(0,j.jsx)(l,{className:"h-4 w-4"}),"Back"]}),(0,j.jsxs)("div",{className:"mb-6 sm:mb-8 lg:hidden",children:[(0,j.jsx)("h1",{className:"font-serif text-2xl font-bold text-white sm:text-3xl",children:"Reset Password"}),(0,j.jsx)("p",{className:"text-text-muted mt-2 font-sans text-sm sm:text-base",children:"Enter the code from your email"})]}),(0,j.jsxs)("div",{className:"mb-8 hidden lg:block xl:mb-12",children:[(0,j.jsx)("h2",{className:"mb-2 font-serif text-3xl font-bold text-white xl:mb-3 xl:text-4xl",children:"Reset Password"}),(0,j.jsx)("p",{className:"text-text-muted font-sans text-base xl:text-lg",children:"Enter code and new password"})]}),(0,j.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),W("");const s=f(S);if(s.isValid)if(S===P){E(!0);try{await a.confirmForgotPassword(v,y,S),r("password_reset_success",{}),T(!0);try{sessionStorage.removeItem("reset_password_email")}catch{}}catch(t){const e=t instanceof Error?t.message:"Failed to reset password",s=e.toLowerCase().includes("deactivated")||e.toLowerCase().includes("account is not active");r("password_reset_failed",{error_type:s?"account_deactivated":"reset_error",error_message:e.slice(0,100)}),W(s?"Your account has been deactivated. Password reset is not available. Please contact support.":e)}finally{E(!1)}}else W("Passwords do not match");else W(`Password must include: ${s.missingRequirements.join(", ")}`)}
1,className:"w-full max-w-md space-y-4 sm:space-y-6 lg:max-w-lg",children:[(0,j.jsx)(d,{message:q}),(0,j.jsx)(i,{label:"Email address",type:"email",value:v,onChange:e=>b(e.target.value),placeholder:"[email protected]",required:!0,fullWidth:!0}),(0,j.jsx)(i,{label:"Verification code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",enterKeyHint:"next",value:y,onChange:e=>N(e.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"Enter 6-digit code",required:!0,fullWidth:!0,maxLength:6}),(0,j.jsxs)("div",{children:[(0,j.jsx)(i,{label:"New password",type:"password",value:S,onChange:e=>_(e.target.value),placeholder:"Create a strong password",required:!0,fullWidth:!0,showPasswordToggle:!0}),(0,j.jsx)(o,{validation:k})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)(i,{label:"Confirm new password",type:"password",value:P,onChange:e=>C(e.target.value),placeholder:"Re-enter your password",required:!0,fullWidth:!0,showPasswordToggle:!0}),P&&(0,j.jsx)("div",{className:"mt-2 flex items-center gap-2 font-sans text-xs",children:z?(0,j.jsx)("span",{className:"text-green-400",children:"✓ Passwords match"}):(0,j.jsx)("span",{className:"text-brand-red-text",children:"✗ Passwords don't match"})})]}),(0,j.jsx)(c,{type:"submit",loading:R,fullWidth:!0,size:"lg",variant:"brand-outline",children:R?"Resetting password...":"Reset password"})]}
1),(0,j.jsx)("div",{className:"mt-6 w-full max-w-md space-y-3 sm:mt-8 sm:space-y-4 lg:max-w-lg",children:(0,j.jsxs)("p",{className:"text-text-muted font-sans text-xs sm:text-sm",children:["Remember your password?"," ",(0,j.jsx)(g,{to:"/login",className:"font-medium text-brand-red-text transition-colors hover:text-white",children:"Sign in"})]})})]})]})]})}export{v 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.