1/*! For license information please see 3392.1dd11fca.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[3392],{3392(t,e,s){s.r(e),s.d(e,{default:()=>u});var r=s(5043),a=s(7874),i=s(3046),o=s(2339),n=s(8132),l=s(7097),d=s(4651),c=s(5087),h=s(579);const u=()=>{const t=(0,a.Zp)(),[e]=(0,a.ok)(),s=e.get("token"),u=e.get("email"),[m,x]=(0,r.useState)(""),[p,v]=(0,r.useState)(""),[b,y]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),A=(0,l.n)({mutationFn:async t=>(await i.A.post("".concat("https://www.bagchee.com/api","/user/reset-password"),t)).data,onSuccess:e=>{e.status?(o.Ay.success(e.msg),setTimeout(()=>t("/login"),2e3)):o.Ay.error(e.msg)},onError:t=>{var e,s;o.Ay.error((null===(e=t.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.msg)||"Failed to reset password. Please try again.")}});return s&&u?(0,h.jsxs)("div",{className:"min-h-screen bg-cream-50 flex flex-col items-center justify-center p-4 overflow-x-hidden w-full",children:[(0,h.jsx)("h2",{className:"text-3xl text-text-main mb-8 uppercase tracking-slick font-display animate-fadeInLeft",children:"RESET PASSWORD"}),(0,h.jsxs)("div",{className:"max-w-[98%] sm:max-w-xl w-full bg-white p-6 sm:p-8 md:p-10 rounded-2xl shadow-2xl border border-cream-200 animate-fadeInRight",children:[(0,h.jsx)("div",{className:"flex justify-center mb-8",children:(0,h.jsx)(a.N_,{to:"/",className:"bg-gradient-to-r from-primary to-primary-dark p-4 rounded-xl shadow-md hover:shadow-lg transition-all duration-300 transform hover:scale-105 active:scale-95 block cursor-pointer",children:(0,h.jsx)(n.A,{className:"h-12 w-auto text-white"})})}),(0,h.jsxs)("form",{className:"space-y-6",onSubmit:t=>(t.preventDefault(),m&&p?m!==p?o.Ay.error("Passwords do not match."):m.length<8?o.Ay.error("Password must be at least 8 characters."):/[A-Z]/.test(m)&&/[0-9]/.test(m)?void A.mutate({email:u,token:s,newPassword:m}):o.Ay.error("Password must contain at least one uppercase letter and one number."):o.Ay.error("Please fill in both fields.")),children:[(0,h.jsxs)("p",{className:"text-sm text-text-muted text-center leading-relaxed",children:["Create a new password for ",(0,h.jsx)("strong",{className:"text-text-main",children:u})]}),(0,h.jsxs)("div",{className:"relative",children:[(0,h.jsx)("input",{type:b?"text":"password",value:m,onChange:t=>x(t.target.value),placeholder:"New Password",required:!0,className:"w-full bg-cream-100/30 border border-cream-200 text-text-main text-sm font-body rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary block px-4 py-4 pr-12 outline-none transition-all placeholder-text-muted/50"}),(0,h.jsx)("button",{type:"button",onClick:()=>y(t=>!t),className:"absolute right-4 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",tabIndex:-1,children:b?(0,h.jsx)(d.A,{size:18}):(0,h.jsx)(c.A,{size:18})})]}),(0,h.jsxs)("div",{className:"relative",children:[(0,h.jsx)("input",{type:f?"text":"password",value:p,onChange:t=>v(t.target.value),placeholder:"Confirm New Password",required:!0,className:"w-full bg-cream-100/30 border border-cream-200 text-text-main text-sm font-body rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary block px-4 py-4 pr-12 outline-none transition-all placeholder-text-muted/50"}),(0,h.jsx)("button",{type:"button",onClick:()=>g(t=>!t),className:"absolute right-4 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",tabIndex:-1,children:f?(0,h.jsx)(d.A,{size:18}):(0,h.jsx)(c.A,{size:18})})]}),(0,h.jsxs)("div",{className:"text-xs text-text-muted space-y-1 bg-cream-50 p-3 rounded-lg",children:[(0,h.jsx)("p",{className:"font-bold text-text-muted mb-1",children:"Password must have:"}),(0,h.jsx)("p",{className:m.length>=8?"text-green-600":"",children:"- At least 8 characters"}),(0,h.jsx)("p",{className:/[A-Z]/.test(m)?"text-green-600":"",children:"- At least one uppercase letter"}),(0,h.jsx)("p",{className:/[0-9]/.test(m)?"text-green-600":"",children:"- At least one number"})]}),(0,h.jsx)("div",{className:"pt-2 flex justify-center",children:(0,h.jsx)("button",{type:"submit",disabled:A.isPending,className:"px-12 py-3.5 bg-gradient-to-r from-primary to-primary-dark text-white font-bold rounded-lg text-sm uppercase tracking-wider shadow-lg shadow-primary/30 hover:shadow-
2primary/50 transform hover:-translate-y-0.5 transition-all duration-300 font-montserrat ".concat(A.isPending?"opacity-70 cursor-not-allowed":""),children:A.isPending?"RESETTING...":"RESET PASSWORD"})}),(0,h.jsx)("div",{className:"text-center mt-6 text-sm text-text-muted border-t border-cream-100 pt-6",children:(0,h.jsx)(a.N_,{to:"/login",className:"font-bold text-primary hover:text-primary-dark hover:underline font-montserrat flex items-center justify-center gap-1",children:"\u2190 Back to Login"})})]})]})]}):(0,h.jsx)("div",{className:"min-h-screen bg-cream-50 flex flex-col items-center justify-center p-4",children:(0,h.jsxs)("div",{className:"max-w-xl w-full bg-white p-10 rounded-2xl shadow-2xl border border-cream-200 text-center",children:[(0,h.jsx)("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,h.jsx)("svg",{className:"w-8 h-8 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,h.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,h.jsx)("h3",{className:"text-lg font-bold text-text-main font-display mb-2",children:"Invalid Reset Link"}),(0,h.jsx)("p",{className:"text-sm text-text-muted mb-6",children:"This password reset link is invalid or has expired."}),(0,h.jsx)(a.N_,{to:"/forgot-password",className:"px-8 py-3 bg-gradient-to-r from-primary to-primary-dark text-white font-bold rounded-lg text-sm uppercase tracking-wider shadow-lg font-montserrat",children:"Request New Link"})]})})}},4651(t,e,s){s.d(e,{A:()=>r});const r=(0,s(7784).A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},5087(t,e,s){s.d(e,{A:()=>r});const r=(0,s(7784).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},7097(t,e,s){s.d(e,{n:()=>j});var r,a,i,o,n,l=s(9379),d=s(5043),c=s(9790),h=s(5149),u=s(8458),m=s(6562),x=s(4558),p=s(5239),v=s(1454),b=s(329),y=s(9723),f=(r=new WeakMap,a=new WeakMap,i=new WeakMap,o=new WeakMap,n=new WeakSet,class extends b.Q{constructor(t,e){super(),(0,c.A)(this,n),(0,h.A)(this,r,void 0),(0,h.A)(this,a,void 0),(0,h.A)(this,i,void 0),(0,h.A)(this,o,void 0),(0,x.A)(r,this,t),this.setOptions(e),this.bindMethods(),(0,m.A)(n,this,g).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var e;const s=this.options;this.options=(0,u.A)(r,this).defaultMutationOptions(t),(0,y.f8)(this.options,s)||(0,u.A)(r,this).getMutationCache().notify({type:"observerOptionsUpdated",mutation:(0,u.A)(i,this),observer:this}),null!==s&&void 0!==s&&s.mutationKey&&this.options.mutationKey&&(0,y.EN)(s.mutationKey)!==(0,y.EN)(this.options.mutationKey)?this.reset():"pending"===(null===(e=(0,u.A)(i,this))||void 0===e?void 0:e.state.status)&&(0,u.A)(i,this).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(null===(t=(0,u.A)(i,this))||void 0===t||t.removeObserver(this))}onMutationUpdate(t){(0,m.A)(n,this,g).call(this),(0,m.A)(n,this,A).call(this,t)}getCurrentResult(){return(0,u.A)(a,this)}reset(){var t;null===(t=(0,u.A)(i,this))||void 0===t||t.removeObserver(this),(0,x.A)(i,this,void 0),(0,m.A)(n,this,g).call(this),(0,m.A)(n,this,A).call(this)}mutate(t,e){var s;return(0,x.A)(o,this,e),null===(s=(0,u.A)(i,this))||void 0===s||s.removeObserver(this),(0,x.A)(i,this,(0,u.A)(r,this).getMutationCache().build((0,u.A)(r,this),this.options)),(0,u.A)(i,this).addObserver(this),(0,u.A)(i,this).execute(t)}});function g(){var t,e;const s=null!==(t=null===(e=(0,u.A)(i,this))||void 0===e?void 0:e.state)&&void 0!==t?t:(0,p.$)();(0,x.A)(a,this,(0,l.A)((0,l.A)({},s),{},{isPending:"pending"===s.status,isSuccess:"success"===s.status,isError:"error"===s.status,isIdle:"idle"===s.status,mutate:this.mutate,reset:this.reset}))}function A(t){v.jG.batch(()=>
2{if((0,u.A)(o,this)&&this.hasListeners()){const x=(0,u.A)(a,this).variables,p=(0,u.A)(a,this).context,v={client:(0,u.A)(r,this),meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===(null===t||void 0===t?void 0:t.type)){try{var e,s;null===(e=(s=(0,u.A)(o,this)).onSuccess)||void 0===e||e.call(s,t.data,x,p,v)}catch(m){Promise.reject(m)}try{var i,n;null===(i=(n=(0,u.A)(o,this)).onSettled)||void 0===i||i.call(n,t.data,null,x,p,v)}catch(m){Promise.reject(m)}}else if("error"===(null===t||void 0===t?void 0:t.type)){try{var l,d;null===(l=(d=(0,u.A)(o,this)).onError)||void 0===l||l.call(d,t.error,x,p,v)}catch(m){Promise.reject(m)}try{var c,h;null===(c=(h=(0,u.A)(o,this)).onSettled)||void 0===c||c.call(h,void 0,t.error,x,p,v)}catch(m){Promise.reject(m)}}}this.listeners.forEach(t=>{t((0,u.A)(a,this))})})}var w=s(3248);function j(t,e){const s=(0,w.jE)(e),[r]=d.useState(()=>new f(s,t));d.useEffect(()=>{r.setOptions(t)},[r,t]);const a=d.useSyncExternalStore(d.useCallback(t=>r.subscribe(v.jG.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=d.useCallback((t,e)=>{r.mutate(t,e).catch(y.lQ)},[r]);if(a.error&&(0,y.GU)(r.options.throwOnError,[a.error]))throw a.error;return(0,l.A)((0,l.A)({},a),{},{mutate:i,mutateAsync:a.mutate})}}}]); 3//# sourceMappingURL=3392.1dd11fca.chunk.js.map
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.