1import{r as a,j as e}from"./markdown-CLqt0F8k.js";import{a as x,aw as v,bb as y,L as N,z as u}from"./index-Cpg_ZFX4.js";import{P as h}from"./FloatingLabelInput-BcPqPuZl.js";import{v as k,P}from"./PasswordStrengthIndicator-C5N65osU.js";import{E as S}from"./ErledigtWordmark-ysAyyq-7.js";import{M as z}from"./MiniLegalFooter-C4KRuRAJ.js";import C from"./arrow-right-BwhasIl9.js";import{u as W}from"./vendor-uoS_y2yG.js";import"./eye-off-BeO9N4LK.js";import"./eye-BZKPyY9D.js";import"./erledigt-logo-dark-D0lCrFMQ.js";const E="/assets/reset-password-illustration-DNtHGl9O.svg",O=()=>{const[t,f]=a.useState(""),[r,g]=a.useState(""),[o,m]=a.useState(!1),[w,b]=a.useState(!1),[l,i]=a.useState(null),p=W(),d=k(t),n=t===r;a.useEffect(()=>{const{data:{subscription:s}}=x.auth.onAuthStateChange(c=>{});return()=>s.unsubscribe()},[]);const j=async s=>{if(s.preventDefault(),i(null),!d.isValid){i("Passwort erfüllt nicht die Anforderungen.");return}if(!n){i("Passwörter stimmen nicht überein.");return}m(!0);const{error:c}=await x.auth.updateUser({password:t});m(!1),c?(i(c.message),u.auth.passwordChangeError()):(b(!0),u.auth.passwordChanged(),setTimeout(()=>p("/tasks"),2500))};return e.jsxs("section",{className:"min-h-screen flex flex-col bg-white dark:bg-background",children:[e.jsxs("div",{className:"relative mx-auto w-full max-w-[1060px] px-5 sm:px-10 py-[60px] sm:py-[90px] flex-1",children:[e.jsx("img",{src:E,alt:"","aria-hidden":"true",className:"pointer-events-none select-none absolute",style:{width:"715px",maxWidth:"none",height:"auto",left:"50%",top:"600px",transform:"translate(-50%, -50%)",opacity:.9,zIndex:0}}),e.jsx("div",{className:"relative z-10 flex justify-center mb-10",children:e.jsx(S,{className:"h-8 w-auto",alt:"erledigt"})}),e.jsx("div",{className:"relative z-10 text-center mb-4",children:e.jsx("h1",{className:"font-bold leading-[1.2] text-[#14141a] dark:text-foreground",style:{fontSize:"clamp(28px, 3.5vw, 40px)"},children:"Neues Passwort setzen"})}),e.jsx("p",{className:"relative z-10 text-center mx-auto mb-14 text-muted-foreground",style:{fontSize:"16px",lineHeight:1.65,maxWidth:"500px"},children:"Wähle ein sicheres neues Passwort, um dich wieder einzuloggen."}),e.jsx("div",{className:"relative z-10 mx-auto flex justify-center",children:e.jsx("div",{className:"relative bg-card rounded-[20px] border border-black/[0.07] dark:border-white/[0.07]",style:{width:"100%",maxWidth:"420px",padding:"40px"},children:w?e.jsxs("div",{className:"text-center space-y-4 py-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(v,{className:"w-8 h-8 text-primary"})})}),e.jsx("h2",{className:"text-foreground",style:{fontSize:"17px",fontWeight:700},children:"Passwort erfolgreich geändert"}),e.jsx("p",{className:"text-muted-foreground",style:{fontSize:"14px"},children:"Du wirst gleich weitergeleitetâ¦"}),e.jsxs("button",{onClick:()=>p("/tasks"),className:"w-full flex items-center justify-center gap-2 text-white hover:opacity-90 transition-opacity",style:{background:"hsl(var(--primary))",borderRadius:"99px",padding:"14px",fontWeight:700,fontSize:"15px"},children:["Zur App ",e.jsx(C,{className:"w-5 h-5"})]})]}):e.jsxs("form",{onSubmit:j,className:"space-y-4",autoComplete:"on",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{label:"Neues Passwort",name:"new-password",autoComplete:"new-password",value:t,onChange:s=>f(s.target.value),error:!!l&&!d.isValid,className:"bg-transparent dark:bg-background border-black/[0.12] dark:border-white/[0.12] rounded-[10px] text-sm"}),t.length>0&&e.jsx(P,{password:t})]}),e.jsx(h,{label:"Passwort bestätigen",name:"confirm-password",autoComplete:"new-password",value:r,onChange:s=>g(s.target.value),error:!!r&&!n,className:"bg-transparent dark:bg-background border-black/[0.12] dark:border-white/[0.12] rounded-[10px] text-sm"}),r&&!n&&e.jsxs("p",{className:"text-destructive flex items-center gap-1",style:{fontSize:"12px"},children:[e.jsx(y,{className:"h-3 w-3"})," Passwörter stimmen nicht überein"]}),l&&e.jsx("p",{className:"text-destructive text-center",style:{fontSize:"14px"},children:l}),e.jsxs("button",{type:"submit",className:"w-full flex items-center justify-center gap-2 text-white hover:opacity-90 transition-opacity disabled:opacity-50",style:{background:"hsl(var(--primary))",borderRadius:"99px",padding:"14px",fontWeight:700,fontSize:"15px"},disabled:o||!d.isValid||!n,"aria-label":"Lädt",children:[o&&e.jsx(N,{className:"w-4 h-4 animate-spin"}),o?"Wird gespeichertâ¦":"Passwort speichern"]})]})})})]}),e.jsx(z,{className:"relative z-10"})]})};export{O 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.