felicity-lims/felicity/templates/static/assets/PasswordReset-548cbca1.js
2024-04-21 12:22:39 +02:00

1 line
5.8 KiB
JavaScript

import{d as C,l as R,s as P,r as y,C as T,D as V,o as r,c as a,b as e,f as s,w as m,e as b,v as _,y as c,g as f,H as g,t as D,h as S,j as B,_ as F,k as M}from"./index-2a6c9271.js";const j={class:"flex justify-center items-center h-screen bg-sky-800 px-6"},E={class:"p-6 max-w-sm w-full bg-white shadow-md rounded-sm"},L=S('<div class="flex justify-center items-center"><svg class="h-10 w-10" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M364.61 390.213C304.625 450.196 207.37 450.196 147.386 390.213C117.394 360.22 102.398 320.911 102.398 281.6C102.398 242.291 117.394 202.981 147.386 172.989C147.386 230.4 153.6 281.6 230.4 307.2C230.4 256 256 102.4 294.4 76.7999C320 128 334.618 142.997 364.608 172.989C394.601 202.981 409.597 242.291 409.597 281.6C409.597 320.911 394.601 360.22 364.61 390.213Z" fill="#4C51BF" stroke="#4C51BF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M201.694 387.105C231.686 417.098 280.312 417.098 310.305 387.105C325.301 372.109 332.8 352.456 332.8 332.8C332.8 313.144 325.301 293.491 310.305 278.495C295.309 263.498 288 256 275.2 230.4C256 243.2 243.201 320 243.201 345.6C201.694 345.6 179.2 332.8 179.2 332.8C179.2 352.456 186.698 372.109 201.694 387.105Z" fill="white"></path></svg><span class="text-gray-700 font-semibold text-2xl">FelicityLIMS</span></div>',1),N={key:0},U={class:"block mt-3"},q=e("span",{class:"text-gray-700 text-sm"},"Email",-1),A=["disabled"],I={class:"flex justify-between items-center mt-4"},$={class:"mt-6"},H=["disabled"],Z=e("span",null,"Request Password Reset",-1),z=[Z],O={key:1,class:"text-center"},G={key:1},J={class:"block mt-3"},K=e("span",{class:"text-gray-700 text-sm"},"Reset Token",-1),Q=["disabled"],W={class:"mt-6"},X=["disabled"],Y=e("span",null,"Submit token",-1),ee=[Y],se={key:1,class:"text-center"},te={class:"mt-2"},oe={class:"bg-blue-100"},re={class:"block mt-3"},ae=e("span",{class:"text-gray-700 text-sm"},"Password",-1),de=["disabled"],ne={class:"block mt-3"},le=e("span",{class:"text-gray-700 text-sm"},"Password Confirmation",-1),ie=["disabled"],ce={class:"mt-6"},ue=["disabled"],pe=e("span",null,"Reset Password",-1),me=[pe],be={key:1,class:"text-center"},_e=C({__name:"PasswordReset",emits:["forgot"],setup(ve,{emit:h}){const v=B(()=>F(()=>import("./LoadingMessage-72d34fcf.js"),["assets/LoadingMessage-72d34fcf.js","assets/index-2a6c9271.js","assets/index-88806377.css"])),w=h,u=R(),{auth:o}=P(u),l=y(""),i=y(""),k=()=>{o.value.receivedToken?u.validatePasswordResetToken(i.value):u.resetPasswordRequest(l.value)},d=T({password:"",passwordc:""}),p=V(()=>!(!d.password||!d.passwordc||d.password!==d.passwordc)),x=()=>{p||alert("Correct Form errrs"),u.resetPassword(d.password,d.passwordc)};return(fe,t)=>(r(),a("div",j,[e("div",E,[L,s(o).resetData?.canReset?(r(),a("form",{key:1,class:"mt-4",onSubmit:m(x,["prevent"])},[e("p",te,[g("Hie "),e("span",oe,"@"+D(s(o)?.resetData?.username),1),g(". Change your password")]),e("label",re,[ae,b(e("input",{type:"password",class:c(["form-input mt-1 block w-full rounded-sm focus:border-sky-800",{"border-red-500 focus:border-red-500":!p.value}]),"onUpdate:modelValue":t[5]||(t[5]=n=>d.password=n),disabled:s(o).processing},null,10,de),[[_,d.password]])]),e("label",ne,[le,b(e("input",{type:"password",class:c(["form-input mt-1 block w-full rounded-sm focus:border-sky-800",{"border-red-500 focus:border-red-500":!p.value}]),"onUpdate:modelValue":t[6]||(t[6]=n=>d.passwordc=n),disabled:s(o).processing},null,10,ie),[[_,d.passwordc]])]),e("div",ce,[s(o).processing?(r(),a("div",be,[f(s(v),{message:"Resetting password ..."})])):(r(),a("button",{key:0,type:"submit",class:c(["py-2 px-4 text-center rounded-sm w-full text-white text-sm ",{"bg-gray-500":!p.value,"bg-sky-800 hover:bg-sky-600":p.value}]),disabled:!p.value},[...me],10,ue))])],32)):(r(),a("form",{key:0,class:"mt-4",onSubmit:m(k,["prevent"])},[s(o).receivedToken?(r(),a("div",G,[e("label",J,[e("div",null,[e("a",{class:"px-2 py-1 border rounded-sm border-gray-300 text-gray-500 text-xs font-semibold hover:bg-gray-600 hover:border-none hover:text-gray-100",onClick:t[3]||(t[3]=m(n=>s(u).setReceivedResetToken(!1),["prevent"]))},"← Token not received")]),K,b(e("input",{type:"text",class:c(["form-input mt-1 block w-full rounded-sm focus:border-sky-800",{"border-red-500 focus:border-red-500":!i.value}]),"onUpdate:modelValue":t[4]||(t[4]=n=>i.value=n),disabled:s(o).processing},null,10,Q),[[_,i.value]])]),e("div",W,[s(o).processing?(r(),a("div",se,[f(s(v),{message:"Validating password reset token ..."})])):(r(),a("button",{key:0,type:"submit",class:c(["py-2 px-4 text-center rounded-sm w-full text-white text-sm ",{"bg-gray-500":!i.value,"bg-sky-800 hover:bg-sky-600":i.value}]),disabled:!i.value},[...ee],10,X))])])):(r(),a("div",N,[e("label",U,[e("div",null,[e("a",{class:"px-2 py-1 border rounded-sm border-gray-300 text-gray-500 text-xs font-semibold hover:bg-gray-600 hover:border-none hover:text-gray-100",onClick:t[0]||(t[0]=m(n=>w("forgot"),["prevent"]))},"← Back to Login")]),q,b(e("input",{type:"email",class:c(["form-input mt-1 block w-full rounded-sm focus:border-sky-800",{"border-red-500 focus:border-red-500":!l.value}]),"onUpdate:modelValue":t[1]||(t[1]=n=>l.value=n),disabled:s(o).processing},null,10,A),[[_,l.value]])]),e("div",I,[e("div",null,[e("a",{class:"block text-sm fontme text-indigo-700 hover:underline",onClick:t[2]||(t[2]=m(n=>s(u).setReceivedResetToken(!0),["prevent"]))},"Received a Token?")])]),e("div",$,[s(o).processing?(r(),a("div",O,[f(s(v),{message:"Requesting ..."})])):(r(),a("button",{key:0,type:"submit",class:c(["py-2 px-4 text-center rounded-sm w-full text-white text-sm ",{"bg-gray-500":!l.value,"bg-sky-800 hover:bg-sky-600":l.value}]),disabled:!l.value},[...z],10,H))])]))],32))])]))}}),ge=M(_e,[["__file","/home/aurthur/Documents/Development/felicity-lims/webapp/views/auth/PasswordReset.vue"]]);export{ge as default};