import{L as w,y as g,c as m,a as s,l as v,m as b,q as i,v as n,j as t,k as y,s as k,d as x,t as h,x as B,o as p,z as r,E as _,r as j}from"./DuD5s02W.js";import{_ as S}from"./DVbguE1Z.js";import{_ as V}from"./Dmtnqq3B.js";const M={class:"bg-gray-50 min-h-screen"},z={class:"flex min-h-screen"},C={class:"w-full lg:w-1/2 flex items-center justify-center p-8 md:p-16"},T={class:"max-w-md w-full"},U={class:"relative"},A={class:"relative"},K=["disabled"],D={key:0,class:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},R={__name:"reset-password",setup(N){const u=w(),c=B().public.apiBase,l=j(!1),e=g({token:u.query.token||"",email:u.query.email||"",password:"",password_confirmation:""}),f=async()=>{if(e.password!==e.password_confirmation){r.warning("Konfirmasi kata sandi tidak cocok");return}l.value=!0;const d=r.loading("Mengubah kata sandi Anda...");try{await $fetch(`${c}/reset-password`,{method:"POST",body:e}),r.success("Password Berhasil Diubah! Silakan login dengan password baru",{id:d}),setTimeout(()=>_("/login"),2e3)}catch(a){const o=a.data?.message||"Terjadi kesalahan saat mengatur ulang kata sandi";r.error(o,{id:d})}finally{l.value=!1}};return(d,a)=>(p(),m("div",M,[s("div",z,[a[10]||(a[10]=s("div",{class:"hidden lg:block lg:w-1/2 relative"},[s("img",{src:S,alt:"Masjid",class:"absolute inset-0 w-full h-full object-cover"}),s("div",{class:"absolute inset-0 bg-black/20"})],-1)),s("div",C,[s("div",T,[a[9]||(a[9]=v('<div class="flex items-center justify-center lg:justify-start gap-2 mb-8"><img src="'+V+'" alt="Logo Sajada" class="h-8 w-auto"></div><div class="mb-8 text-center lg:text-left"><h1 class="text-3xl font-bold text-gray-800 mb-2">Atur Ulang Kata Sandi</h1><p class="text-gray-600">Silakan masukkan kata sandi baru Anda di bawah ini.</p></div>',2)),s("form",{onSubmit:b(f,["prevent"]),class:"space-y-5"},[i(s("input",{type:"hidden","onUpdate:modelValue":a[0]||(a[0]=o=>t(e).token=o)},null,512),[[n,t(e).token]]),i(s("input",{type:"hidden","onUpdate:modelValue":a[1]||(a[1]=o=>t(e).email=o)},null,512),[[n,t(e).email]]),s("div",null,[a[5]||(a[5]=s("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Kata Sandi Baru",-1)),s("div",U,[a[4]||(a[4]=s("span",{class:"absolute inset-y-0 left-0 flex items-center pl-3 text-gray-400"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 118 0v4h-8z"})])],-1)),i(s("input",{"onUpdate:modelValue":a[2]||(a[2]=o=>t(e).password=o),type:"password",placeholder:"Minimal 8 karakter",class:"w-full pl-10 pr-4 py-3 border border-gray-200 rounded-xl focus:ring-2 focus:ring-[#166534] outline-none"},null,512),[[n,t(e).password]])])]),s("div",null,[a[7]||(a[7]=s("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Konfirmasi Kata Sandi Baru",-1)),s("div",A,[a[6]||(a[6]=s("span",{class:"absolute inset-y-0 left-0 flex items-center pl-3 text-gray-400"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 118 0v4h-8z"})])],-1)),i(s("input",{"onUpdate:modelValue":a[3]||(a[3]=o=>t(e).password_confirmation=o),type:"password",placeholder:"Ulangi kata sandi baru",class:"w-full pl-10 pr-4 py-3 border border-gray-200 rounded-xl focus:ring-2 focus:ring-[#166534] outline-none"},null,512),[[n,t(e).password_confirmation]])])]),s("button",{type:"submit",disabled:t(l),class:y(["w-full bg-[#D4AF37] hover:bg-[#b8962e] text-white font-semibold py-3.5 rounded-xl shadow-lg transition-all transform active:scale-[0.98] flex items-center justify-center gap-2",t(l)?"opacity-50 cursor-not-allowed":""])},[t(l)?(p(),m("svg",D,[...a[8]||(a[8]=[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"#065f46","stroke-width":"4"},null,-1),s("path",{class:"opacity-75",fill:"white",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):k("",!0),x(" "+h(t(l)?"Memproses...":"Simpan Password Baru"),1)],10,K)],32)])])])]))}};export{R as default};
