"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2469,4301],{34301:function(e,t,s){s.r(t),s.d(t,{default:function(){return LoginUserForm}});var l=s(85893),a=s(29613),r=s(84488),i=s(45009),n=s(60802),o=s(30184),c=s(66644),x=s(16974),m=s(11358),d=s(28319),u=s(54858),h=s(5233),p=s(86501),f=s(88767),b=s(16310);let g=b.Ry().shape({email:b.Z_().email().required(),password:b.Z_().required()});function LoginUserForm(){let{t:e}=(0,h.$G)("common"),{openModal:t,closeModal:s}=(0,i.SO)(),{authorize:b}=(0,r.Z)(),{mutate:k,isLoading:j}=(0,f.useMutation)(d.Z.users.login,{onSuccess:t=>{if(!t.token){p.ZP.error((0,l.jsx)("b",{children:e("text-wrong-user-name-and-pass")}),{className:"-mt-10 xs:mt-0"});return}b(t.token),(0,u.j9)(t.token,t.permissions),s()}});return(0,l.jsxs)("div",{className:"bg-light px-6 pt-10 pb-8 dark:bg-dark-300 sm:px-8 lg:p-12",children:[(0,l.jsx)(a.i,{className:"absolute bottom-0 left-0 text-light dark:text-dark-300 dark:opacity-60"}),(0,l.jsx)("div",{className:"relative z-10 flex items-center",children:(0,l.jsxs)("div",{className:"w-full shrink-0 text-left md:w-[380px]",children:[(0,l.jsxs)("div",{className:"flex flex-col pb-5 text-center xl:pb-6 xl:pt-2",children:[(0,l.jsx)("h2",{className:"text-lg font-medium tracking-[-0.3px] text-dark dark:text-light lg:text-xl",children:e("text-welcome-back")}),(0,l.jsxs)("div",{className:"mt-1.5 text-13px leading-6 tracking-[0.2px] dark:text-light-900 lg:mt-2.5 xl:mt-3",children:[e("text-join-now")," ",(0,l.jsx)("button",{onClick:()=>t("REGISTER"),className:"inline-flex font-semibold text-brand hover:text-dark-400 hover:dark:text-light-500",children:e("text-create-account")})]})]}),(0,l.jsx)(c.l,{onSubmit:e=>{k(e)},validationSchema:g,className:"space-y-4 pt-4 lg:space-y-5",children:s=>{var a,r;let{register:i,formState:{errors:c}}=s;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.Z,{label:"contact-us-email-field",inputClassName:"bg-light dark:bg-dark-300",type:"email",...i("email"),error:null===(a=c.email)||void 0===a?void 0:a.message}),(0,l.jsx)(m.Z,{label:"text-auth-password",inputClassName:"bg-light dark:bg-dark-300",...i("password"),error:null===(r=c.password)||void 0===r?void 0:r.message}),(0,l.jsxs)("div",{className:"flex items-center justify-between space-x-5 rtl:space-x-reverse",children:[(0,l.jsx)(o.Z,{label:"text-remember-me"}),(0,l.jsx)("button",{type:"button",className:"text-13px font-semibold text-brand hover:text-dark-400 hover:dark:text-light-500",onClick:()=>t("FORGOT_PASSWORD_VIEW"),children:e("text-forgot-password")})]}),(0,l.jsx)(n.Z,{type:"submit",className:"!mt-5 w-full text-sm tracking-[0.2px] lg:!mt-7",isLoading:j,disabled:j,children:e("text-get-login")})]})}})]})})]})}},30184:function(e,t,s){var l=s(85893),a=s(67294),r=s(93967),i=s.n(r),n=s(5233),o=s(98388);let c=(0,a.forwardRef)((e,t)=>{let{label:s,className:a,...r}=e,{t:c}=(0,n.$G)("common");return(0,l.jsxs)("label",{className:(0,o.m6)(i()("group flex cursor-pointer items-center justify-between text-13px transition-all",a)),children:[(0,l.jsx)("input",{type:"checkbox",className:"checkbox-component invisible absolute -z-[1] opacity-0",ref:t,...r}),(0,l.jsx)("span",{}),(0,l.jsx)("span",{className:"text-dark/70 ltr:ml-2.5 rtl:mr-2.5 dark:text-light/70",children:c(s)})]})});c.displayName="CheckBox",t.Z=c},92469:function(e,t,s){s.r(t),s.d(t,{default:function(){return PrivateRoute}});var l=s(85893),a=s(11163),r=s(99930),i=s(97514),n=s(60802),o=s(5965),c=s(34301),x=s(5233),m=s(34483);function UnAuthorizedView(){let e=(0,a.useRouter)(),{t}=(0,x.$G)("common");return(0,l.jsxs)("div",{className:"relative flex min-h-full flex-col items-center justify-center overflow-hidden py-5 px-4 md:py-8",children:[(0,l.jsxs)(n.Z,{variant:"icon",onClick:()=>e.push(i.Z.home),className:"sx:mb-10 left-4 z-10 mb-8 flex items-center justify-center sm:absolute sm:mb-0",children:[(0,l.jsx)(o.f,{className:"h-4 w-4 rtl:order-1"})," ",t("404-back-home")]}),(0,l.jsx)("div",{className:"relative mx-auto w-full max-w-[445px] overflow-hidden rounded-lg bg-light pb-2 dark:bg-dark-300 lg:max-w-[478px] lg:pb-1",children:(0,l.jsx)(c.default,{})})]})}function PrivateRoute(e){let{children:t}=e,{t:s}=(0,x.$G)("common"),{me:a,isAuthorized:i}=(0,r.P)(),n=!!a;return n||i?n&&i?(0,l.jsx)(l.Fragment,{children:t}):(0,l.jsx)("div",{className:"grid min-h-full w-full place-content-center",children:(0,l.jsx)(m.wY,{})}):(0,l.jsx)(UnAuthorizedView,{})}}}]);