import{D as e,E as t,Z as n,l as r,m as i,p as a,s as o,t as s,u as c,w as l,x as u}from"./_plugin-vue_export-helper-CCRG-STz.js";import{a as d,r as f}from"./runtime-dom.esm-bundler-D2hy5fF2.js";import{i as p}from"./router-fJ3nWd5S.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(s,p,m,v,y,b){let x=l(`router-link`);return u(),c(`div`,h,[p[7]||=o(`h2`,null,`Passwort vergessen`,-1),o(`form`,{onSubmit:p[1]||=d((...e)=>b.submitForgotPassword&&b.submitForgotPassword(...e),[`prevent`])},[p[3]||=o(`label`,{for:`email`},`Email-Adresse:`,-1),e(o(`input`,{type:`email`,id:`email`,"onUpdate:modelValue":p[0]||=e=>y.email=e,required:``},null,512),[[f,y.email]]),p[4]||=o(`button`,{type:`submit`},`Link zum Zurücksetzen senden`,-1)],32),o(`p`,null,[i(x,{to:`/login`},{default:t(()=>[...p[5]||=[a(`Login`,-1)]]),_:1})]),o(`p`,null,[i(x,{to:`/register`},{default:t(()=>[...p[6]||=[a(`Registrieren`,-1)]]),_:1})]),y.dialogVisible?(u(),c(`div`,g,[o(`div`,_,[o(`h3`,null,n(y.dialogTitle),1),o(`p`,null,n(y.dialogMessage),1),o(`button`,{type:`button`,onClick:p[2]||=(...e)=>b.closeDialog&&b.closeDialog(...e)},`Schließen`)])])):r(``,!0)])}var y=s(m,[[`render`,v],[`__scopeId`,`data-v-021070f7`]]);export{y as default};
//# sourceMappingURL=ForgotPasswordContent-CCXAE1vn.js.map