import{M as e,O as t,c as n,ct as r,d as i,h as a,j as o,m as s,t as c,u as l,w as u}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as d,c as f}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{i as p}from"./router-9tkBnM0Q.js";var m={name:`ForgotPassword`,data(){return{email:``,dialogTitle:``,dialogMessage:``,dialogVisible:!1}},methods:{async submitForgotPassword(){try{let e=await p.post(`/auth/forgot-password`,{email:this.email});this.showDialog(`E-Mail gesendet`,e.data?.message||`Ein Link zum Zurücksetzen wurde an Ihre E-Mail-Adresse gesendet.`),this.email=``}catch(e){let t=e?.response?.data?.message||e?.message||`Ein unbekannter Fehler ist aufgetreten`;this.showDialog(`Fehler`,t)}},showDialog(e,t){this.dialogTitle=e,this.dialogMessage=t,this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1}}},h={class:`forgot-password`},g={key:0,class:`dialog`},_={class:`dialog-content`};function v(c,p,m,v,y,b){let x=t(`router-link`);return u(),i(`div`,h,[p[7]||=n(`h2`,null,`Passwort vergessen`,-1),n(`form`,{onSubmit:p[1]||=f((...e)=>b.submitForgotPassword&&b.submitForgotPassword(...e),[`prevent`])},[p[3]||=n(`label`,{for:`email`},`Email-Adresse:`,-1),e(n(`input`,{type:`email`,id:`email`,"onUpdate:modelValue":p[0]||=e=>y.email=e,required:``},null,512),[[d,y.email]]),p[4]||=n(`button`,{type:`submit`},`Link zum Zurücksetzen senden`,-1)],32),n(`p`,null,[a(x,{to:`/login`},{default:o(()=>[...p[5]||=[s(`Login`,-1)]]),_:1})]),n(`p`,null,[a(x,{to:`/register`},{default:o(()=>[...p[6]||=[s(`Registrieren`,-1)]]),_:1})]),y.dialogVisible?(u(),i(`div`,g,[n(`div`,_,[n(`h3`,null,r(y.dialogTitle),1),n(`p`,null,r(y.dialogMessage),1),n(`button`,{type:`button`,onClick:p[2]||=(...e)=>b.closeDialog&&b.closeDialog(...e)},`Schließen`)])])):l(``,!0)])}var y=c(m,[[`render`,v],[`__scopeId`,`data-v-021070f7`]]);export{y as default};
//# sourceMappingURL=ForgotPasswordContent-Bk9IgMh_.js.map