(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9203],{3945:function(e,r,a){Promise.resolve().then(a.bind(a,6633))},6633:function(e,r,a){"use strict";a.r(r),a.d(r,{default:function(){return o}});var s=a(7437),t=a(2265),n=a(9376),u=a(8706),i=a(6175);function o(){let[e,r]=(0,t.useState)(""),[a,o]=(0,t.useState)(""),[l,d]=(0,t.useState)(""),c=(0,n.useRouter)(),m=(0,n.useSearchParams)(),f=m.get("phone")||"",h=m.get("code")||"",p=(0,u.T)(),[g,{isLoading:b}]=(0,i.$h)();async function w(r){if(r.preventDefault(),d(""),e!==a){d(p("password_mismatch",{defaultValue:"Fjalekalimi nuk perputhet."}));return}if(e.length<6){d(p("password_too_short",{defaultValue:"Fjalekalimi duhet te kete te pakten 6 karaktere."}));return}try{let r=await g({phone:f,code:h,newPassword:e}).unwrap();r.success?c.push("/login"):d(r.message||p("password_change_error",{defaultValue:"Ndryshimi i fjalekalimit deshtoi."}))}catch(e){d(p("generic_error",{defaultValue:"Ndodhi nje gabim."}))}}return(0,s.jsx)("div",{className:"min-h-[60vh] flex items-center justify-center px-4 py-12",children:(0,s.jsxs)("div",{className:"w-full max-w-md",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-center mb-6",children:p("new_password",{defaultValue:"Fjalekalim i Ri"})}),(0,s.jsxs)("div",{className:"bg-white rounded-xl p-8 shadow-sm",children:[l&&(0,s.jsx)("div",{className:"bg-red-50 text-red-600 p-3 rounded-lg mb-4 text-sm",children:l}),(0,s.jsxs)("form",{onSubmit:w,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:p("new_password",{defaultValue:"Fjalekalimi i ri"})}),(0,s.jsx)("input",{type:"password",value:e,onChange:e=>r(e.target.value),required:!0,minLength:6,className:"w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-orange-500 focus:border-transparent outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:p("confirm_password",{defaultValue:"Konfirmo fjalekalimin"})}),(0,s.jsx)("input",{type:"password",value:a,onChange:e=>o(e.target.value),required:!0,minLength:6,className:"w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-orange-500 focus:border-transparent outline-none"})]}),(0,s.jsx)("button",{type:"submit",disabled:b,className:"w-full bg-orange-500 hover:bg-orange-600 disabled:bg-orange-300 text-white font-semibold px-6 py-3 rounded-lg transition-colors",children:b?p("saving",{defaultValue:"Duke ruajtur..."}):p("save_password",{defaultValue:"Ruaj Fjalekalimin"})})]})]})]})})}},9376:function(e,r,a){"use strict";var s=a(5475);a.o(s,"useParams")&&a.d(r,{useParams:function(){return s.useParams}}),a.o(s,"usePathname")&&a.d(r,{usePathname:function(){return s.usePathname}}),a.o(s,"useRouter")&&a.d(r,{useRouter:function(){return s.useRouter}}),a.o(s,"useSearchParams")&&a.d(r,{useSearchParams:function(){return s.useSearchParams}})},6175:function(e,r,a){"use strict";a.d(r,{$h:function(){return l},cv:function(){return n},er:function(){return u},oq:function(){return o},s:function(){return i}});var s=a(3557),t=a(9523);let n=(0,s.LC)({reducerPath:"miscApi",baseQuery:(0,t.ni)({baseUrl:"/"}),endpoints:e=>({registerFcmToken:e.mutation({query:e=>({url:"api/fcm",method:"POST",body:e})}),sendPasswordSms:e.mutation({query:e=>({url:"api/password/send-sms",method:"POST",body:e})}),verifyPasswordCode:e.mutation({query:e=>({url:"api/password/verify-code",method:"POST",body:e})}),changePassword:e.mutation({query:e=>({url:"api/password/change",method:"POST",body:e})})})}),{useRegisterFcmTokenMutation:u,useSendPasswordSmsMutation:i,useVerifyPasswordCodeMutation:o,useChangePasswordMutation:l}=n}},function(e){e.O(0,[8706,3557,2971,2117,1744],function(){return e(e.s=3945)}),_N_E=e.O()}]);