1import{_ as k}from"./BodJxGTV.js";import{e as B,B as P,C as N,m as d,E as M,c as u,a as e,l as v,t as L,y as V,b as c,q as f,a1 as w,n as q,w as x,f as E,o as p,d as g}from"./D3mXZbvm.js";import{B as S}from"./CbyiM6aK.js";import"./D0HDmefO.js";const A={class:"min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8"},T={class:"max-w-md w-full"},Z={class:"bg-white shadow-lg rounded-xl p-6"},z={key:0,class:"mb-4 p-4 bg-red-50 border border-red-200 rounded-lg flex items-start justify-between"},D={class:"flex items-start gap-3"},j={class:"text-sm text-red-700"},H={class:"relative"},O={class:"relative"},R={key:0,class:"mt-1 text-sm text-red-600"},U={class:"mt-6 text-center"},K=B({__name:"index",setup(F){const m=N(),y=E(),{request:b}=P(),h=m.params.code,o=d(""),r=d(""),t=d(null),l=d(!1),a=M(()=>o.value&&r.value&&o.value!==r.value);async function _(){if(a.value){t.value="Passwords do not match.";return}l.value=!0,t.value=null;try{if((await b("/api/v3/me/reset_password",{method:"POST",body:JSON.stringify({passwordChangeCode:h,newPassword:o.value})})).ok){const s=m.query.redirect||"/login";y.push(s)}else t.value="Failed to reset password. The link may have expired."}catch(i){console.error("Error:",i),t.value="An error occurred. Please try again."}finally{l.value=!1}}return(i,s)=>{const C=k;return p(),u("div",A,[e("div",T,[s[10]||(s[10]=e("div",{class:"text-center mb-8"},[e("h1",{class:"text-3xl font-bold text-gray-900"},"Set New Password"),e("p",{class:"mt-2 text-gray-600"},"Enter your new password below")],-1)),e("div",Z,[t.value?(p(),u("div",z,[e("div",D,[s[3]||(s[3]=e("svg",{class:"h-5 w-5 text-red-500 mt-0.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"})],-1)),e("span",j,L(t.value),1)]),e("button",{onClick:s[0]||(s[0]=n=>t.value=null),class:"text-red-500 hover:text-red-700 font-bold"}," â ")])):v("",!0),e("form",{onSubmit:V(_,["prevent"]),class:"space-y-4"},[e("div",null,[s[5]||(s[5]=e("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"New Password",-1)),e("div",H,[s[4]||(s[4]=e("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[e("svg",{class:"h-5 w-5 text-gray-400",fill:"currentColor",viewBox:"0 0 16 16"},[e("path",{"fill-rule":"evenodd",d:"M14 6a4 4 0 0 1-4.899 3.899l-1.955 1.955a.5.5 0 0 1-.353.146H5v1.5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2.293a.5.5 0 0 1 .146-.353l3.955-3.955A4 4 0 1 1 14 6Zm-4-2a.75.75 0 0 0 0 1.5.5.5 0 0 1 .5.5.75.75 0 0 0 1.5 0 2 2 0 0 0-2-2Z","clip-rule":"evenodd"})])],-1)),f(e("input",{"onUpdate:modelValue":s[1]||(s[1]=n=>o.value=n),type:"password",placeholder:"Enter new password",required:"",class:"w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent outline-none transition-all"},null,512),[[w,o.value]])])]),e("div",null,[s[7]||(s[7]=e("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Confirm Password",-1)),e("div",O,[s[6]||(s[6]=e("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[e("svg",{class:"h-5 w-5 text-gray-400",fill:"currentColor",viewBox:"0 0 16 16"},[e("path",{"fill-rule":"evenodd",d:"M14 6a4 4 0 0 1-4.899 3.899l-1.955 1.955a.5.5 0 0 1-.353.146H5v1.5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2.293a.5.5 0 0 1 .146-.353l3.955-3.955A4 4 0 1 1 14 6Zm-4-2a.75.75 0 0 0 0 1.5.5.5 0 0 1 .5.5.75.75 0 0 0 1.5 0 2 2 0 0 0-2-2Z","clip-rule":"evenodd"})])],-1)),f(e("input",{"onUpdate:modelValue":s[2]||(s[2]=n=>r.value=n),type:"password",placeholder:"Confirm new password",required:"",class:q(["w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent outline-none transition-all",{"border-red-300 focus:ring-red-500":a.value}])},null,2),[[w,r.value]])]),a.value?(p(),u("p",R," Passwords do not match ")):v("",!0)]),c(S,{variant:"primary",block:"",type:"submit",loading:l.value,disabled:l.value||a.value},{default:x(()=>[...s[8]||(s[8]=[g(" Confirm ",-1)])]),_:1},8,["loading","disabled"])],32),e("div",U,[c(C,{to:"/login",class:"text-sm text-secondary hover:underline font-medium"},{default:x(()=>[...s[9]||(s[9]=[g(" Back to Login ",-1)])]),_:1})])])])])}}});
1export{K 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.