1import{a as g,e as b,j as r,g as s,b as v,h as a,k as c,s as m,m as w,p as f,P as x,r as h,c as y,Y as C}from"./index-J9uV3pCC.js";import{_}from"./FormInput.vue_vue_type_script_setup_true_lang-Cl7eeOcu.js";import{s as k}from"./card.esm-wulA95nn.js";import{s as B}from"./divider.esm-FUM7xxGs.js";import{u as S,b as U,c as P,d as E}from"./index.esm-urcZXd9A.js";const F=c("h2",null,"Change password",-1),V={class:"flex flex-col gap-2"},j={class:"flex flex-wrap gap-2 justify-end"},q=g({__name:"EditPasswordForm",props:{updatingPassword:{type:Boolean}},emits:["cancel","updatePassword"],setup($,{emit:n}){const i=n,{defineField:o,handleSubmit:p}=S({validationSchema:U({password:P().required().min(5).matches(/^(?=.*[0-9])/,"Password must contain at least one digit").label("Password"),confirmPassword:P().required().oneOf([E("password")],"Passwords do not match").label("Password confirmation")})}),[l]=o("password"),e=p(()=>i("updatePassword",l.value));return(t,u)=>(v(),b(s(k),null,{title:r(()=>[F,a(s(B))]),content:r(()=>[c("div",V,[a(_,{name:"password",label:"Password:"},{default:r(d=>[a(s(m),w(d,{type:"password"}),null,16)]),_:1}),a(_,{name:"confirmPassword",label:"Confirm password:"},{default:r(d=>[a(s(m),w(d,{type:"password"}),null,16)]),_:1})])]),footer:r(()=>[c("div",j,[a(s(f),{label:"Cancel",severity:"secondary",onClick:u[0]||(u[0]=d=>t.$emit("cancel"))}),a(s(f),{label:"Update password",onClick:s(e),loading:t.updatingPassword},null,8,["onClick","loading"])])]),_:1}))}}),N={class:"flex flex-col items-center"},D=g({__name:"EditPasswordView",setup($){const n=C(),i=x(),o=h(!1);async function p(l){o.value=!0;try{await i.updateUserProfile({password:l}),await n.push({name:"profile-view"})}finally{o.value=!1}}return(l,e)=>(v(),y("div",N,[a(q,{class:"w-full max-w-xl","updating-password":o.value,onCancel:e[0]||(e[0]=t=>
1s(n).back()),onUpdatePassword:e[1]||(e[1]=t=>p(t))},null,8,["updating-password"])]))}});export{D 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.