1import{_ as S}from"./BzDzswo2.js";import{d as V,b as q,l as B,k as T,m as r,c as A,e as l,f as t,g as i,w as c,x as M,i as s,B as R,P as b,Q as v,O as k,t as _,_ as P,o as d,h as f}from"./CcgJ1jke.js";const D={class:"min-h-screen bg-gray-50 flex items-center justify-center px-4 py-12"},H={class:"w-full max-w-md"},L={class:"text-center mb-8"},U={class:"bg-white rounded-2xl shadow-lg p-6 space-y-5"},Y={key:0,class:"text-center space-y-3"},j={key:1,class:"text-center space-y-3"},E=["disabled"],G={key:3,class:"text-sm text-red-500 text-center"},O={class:"mt-6 text-center text-sm text-gray-400"},I=V({__name:"reset-password",setup(Q){q({title:"Choose a new password | AHA Music",meta:[{name:"robots",content:"noindex, nofollow"}]});const w=B(),{resetPassword:h}=T(),u=r(!1),o=r(""),g=r(!1),n=r(""),m=r(""),y=A(()=>w.query.error?"":w.query.token||"");async function C(){if(n.value!==m.value){o.value="The two passwords do not match";return}u.value=!0,o.value="";try{const{error:a}=await h(n.value,y.value);if(a){o.value=a.message||"Could not update your password. The link may have expired.";return}g.value=!0}catch(a){o.value=a?.message||"Something went wrong"}finally{u.value=!1}}return(a,e)=>{const N=S,p=P;return d(),l("div",D,[t("div",H,[t("div",L,[i(p,{to:"/",class:"inline-block mb-6"},{default:c(()=>[i(N,{class:"h-10 w-auto mx-auto"})]),_:1}),e[2]||(e[2]=t("h1",{class:"text-2xl font-bold text-gray-900"},"Choose a new password",-1)),e[3]||(e[3]=t("p",{class:"mt-2 text-sm text-gray-500"},"You'll use it to sign in from now on",-1))]),t("div",U,[s(y)?s(g)?(d(),l("div",j,[e[7]||(e[7]=t("p",{class:"text-sm text-green-600 bg-green-50 p-3 rounded-lg"}," Password updated. You can sign in with it now. ",-1)),i(p,{to:"/login",class:"inline-block text-sm text-sky-500 hover:underline font-medium"},{default:c(()=>[...e[6]||(e[6]=[f(" Go to sign in ",-1)])]),_:1})])):(d(),l("form",{key:2,class:"space-y-4",onSubmit:R(C,["prevent"])},[t("div",null,[e[8]||(e[8]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"New password",-1)),b(t("input",{"onUpdate:modelValue":e[0]||(e[0]=x=>k(n)?n.value=x:null),type:"password",autocomplete:"new-password",required:"",minlength:"8",class:"w-full px-4 py-2.5 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-sky-400 focus:border-transparent",placeholder:"At least 8 characters"},null,512),[[v,s(n)]])]),t("div",null,[e[9]||(e[9]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Confirm new password",-1)),b(t("input",{"onUpdate:modelValue":e[1]||(e[1]=x=>k(m)?m.value=x:null),type:"password",autocomplete:"new-password",required:"",minlength:"8",class:"w-full px-4 py-2.5 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-sky-400 focus:border-transparent",placeholder:"Repeat your password"},null,512),[[v,s(m)]])]),t("button",{type:"submit",disabled:s(u),class:"w-full py-2.5 rounded-xl text-sm font-semibold text-white bg-sky-500 hover:bg-sky-600 transition disabled:opacity-50"},_(s(u)?"Saving...":"Save new password"),9,E)],32)):(d(),l("div",Y,[e[5]||(e[5]=t("p",{class:"text-sm text-red-500 bg-red-50 p-3 rounded-lg"}," This reset link is invalid or has expired. ",-1)),i(p,{to:"/forgot-password",class:"inline-block text-sm text-sky-500 hover:underline font-medium"},{default:c(()=>[...e[4]||(e[4]=[f(" Request a new link ",-1)])]),_:1})])),s(o)?(d(),l("p",G,_(s(o)),1)):M("",!0)]),t("p",O,[i(p,{to:"/login",class:"text-sky-500 hover:underline font-medium"},{default:c(()=>[...e[10]||(e[10]=[f("Back to sign in",-1)])]),_:1})])])])}}});export{I 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.