1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[863],{326:(e,s,t)=>{t.d(s,{A:()=>j});var a=t(21173),n=t(37730),r=t(18678),l=t(96497),i=t(65348),d=t(94503),c=t(17990),o=t(72844),u=t(72270),m=t(98516),h=t(39018),x=t(25152),f=t(49381);function j(e){var s;let{tr:t}=(0,f.k)(),j=null!=(s=null==e?void 0:e.embedded)&&s,p=null==e?void 0:e.onRequestClose,v=null==e?void 0:e.onSwitchToLogin,[b,g]=(0,l.useState)(!1),N=(0,r.useSearchParams)().get("callbackUrl"),[w,y]=(0,l.useState)(""),[C,_]=(0,l.useState)(!1),[k,S]=(0,l.useState)(null),P=async e=>{if(e.preventDefault(),!w.trim())return void S("Email is required.");g(!0),S(null);try{let e=await (0,x.B2)("/forgot-password",{email:w.trim()});e&&e.status?_(!0):S((null==e?void 0:e.message)||"Unable to send reset link. Please try again.")}catch(e){S("string"==typeof(null==e?void 0:e.message)?e.message:"Network error. Please try again.")}finally{g(!1)}},E=j?(0,a.jsx)("button",{type:"button",onClick:v,className:i.Lh,children:t("auth.sign_in","Sign In")}):(0,a.jsx)(n.default,{href:(0,h._k)("/login",N),className:i.Lh,children:t("auth.sign_in","Sign In")});return C?(0,a.jsx)("div",{className:"w-full",children:(0,a.jsxs)(o.Zp,{className:i.P4,children:[(0,a.jsxs)(o.aR,{className:(0,i.wI)(j),children:[j?(0,a.jsx)(i.Hd,{embedded:!0,onRequestClose:p}):(0,a.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,a.jsx)(d.A,{}),(0,a.jsx)(i.Hd,{})]}),(0,a.jsx)(o.ZB,{className:i.P7,children:t("auth.check_email","Check Your Email")}),(0,a.jsxs)(o.BT,{className:i.RU,children:[t("auth.reset_sent_prefix","We've sent a password reset link to")," ",(0,a.jsx)("span",{className:"font-semibold text-slate-900",children:w})]})]}),(0,a.jsxs)(o.Wu,{className:(0,i.QH)(j),children:[(0,a.jsxs)("p",{className:"text-center text-sm font-medium text-slate-700 sm:text-base",children:[t("auth.didnt_receive","Didn't receive the email? Check your spam folder or")," ",(0,a.jsx)("button",{type:"button",onClick:()=>_(!1),className:i.Lh,children:t("auth.try_again","try again")})]}),j?(0,a.jsx)(c.$,{type:"button",className:i.ty,onClick:v,children:t("auth.back_to_sign_in","Back to Sign In")}):(0,a.jsx)(n.default,{href:(0,h._k)("/login",N),children:(0,a.jsx)(c.$,{className:i.ty,children:t("auth.back_to_sign_in","Back to Sign In")})})]})]})}):(0,a.jsx)("div",{className:"w-full",children:(0,a.jsxs)(o.Zp,{className:i.P4,children:[(0,a.jsxs)(o.aR,{className:(0,i.wI)(j),children:[j?(0,a.jsx)(i.Hd,{embedded:!0,onRequestClose:p}):(0,a.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,a.jsx)(d.A,{}),(0,a.jsx)(i.Hd,{})]}),(0,a.jsx)(o.ZB,{className:i.P7,children:t("auth.reset_password","Reset Password")}),(0,a.jsx)(o.BT,{className:i.RU,children:t("auth.reset_desc","Enter your email address and we'll send you a reset link")})]}),(0,a.jsxs)(o.Wu,{className:(0,i.QH)(j),children:[(0,a.jsxs)("form",{onSubmit:P,className:"space-y-4 sm:space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-1 sm:space-y-2",children:[(0,a.jsx)(m.J,{htmlFor:"email",className:"font-medium text-slate-800",children:t("auth.email_address","Email Address")}),(0,a.jsx)(u.p,{id:"email",name:"email",type:"email",placeholder:t("auth.enter_email","Enter your email address"),value:w,onChange:e=>y(e.target.value),required:!0,className:i.VH})]}),(0,a.jsx)(c.$,{type:"submit",className:i.ty,disabled:b,children:b?(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white"}),(0,a.jsx)("span",{children:t("auth.sending_reset","Sending reset link...")})]}):t("auth.send_reset","Send Reset Link")}),k?(0,a.jsx)("p",{className:"text-center text-xs font-medium text-red-600 sm:text-sm",children:k}):null]}),(0,a.jsxs)("div",{className:i.eS,children:[(0,a.jsx)("p",{children:t("auth.remember_password","Remember your password?")}),E]})]})]})})}},1666:(e,s,t)=>{t.d(s,{a:()=>n});var a=t(96497);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[s,t]=(0,a.useState)(()=>window.matchMedia("(max-width: ".concat(e-1,"px)")).matches);return(0,a.useEffect)(()=>{let s=window.matchMedia("(max-width: ".concat(e-1,"px)")),a=()=>t(s.matches);return a(),s.addEventListener("change",a),()=>s.removeEventListener("change",a)},[e]),s}},23949:(e,s,t)=>{t.d(s,{A:()=>g});var a=t(21173),n=t(31932),r=t(37730),l=t(96497),i=t(72987),d=t(65348),c=t(94503),o=t(17990),u=t(72844),m=t(2745),h=t(72821);function x(e){let{className:s,containerClassName:t,...n}=e;return(0,a.jsx)(m.wE,{"data-slot":"input-otp",containerClassName:(0,h.cn)("flex items-center gap-2 has-disabled:opacity-50",t),className:(0,h.cn)("disabled:cursor-not-allowed",s),...n})}function f(e){let{className:s,...t}=e;return(0,a.jsx)("div",{"data-slot":"input-otp-group",className:(0,h.cn)("flex items-center",s
1),...t})}function j(e){var s;let{index:t,className:n,...r}=e,i=l.useContext(m.dK),{char:d,hasFakeCaret:c,isActive:o}=null!=(s=null==i?void 0:i.slots[t])?s:{};return(0,a.jsxs)("div",{"data-slot":"input-otp-slot","data-active":o,className:(0,h.cn)("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",n),...r,children:[d,c&&(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,a.jsx)("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}var p=t(86320),v=t(93762),b=t(24885);function g(e){let{userId:s,email:t,phone:m,embedded:h=!1,onBack:g,onRequestClose:N,onContinueToProfile:w}=e,[y,C]=(0,l.useState)(""),_=(0,b.mb)(),k=(0,l.useRef)(!1),S=async e=>{if(e.preventDefault(),4===y.length&&s&&!k.current){k.current=!0;try{let e=await _.mutateAsync({user_id:s,otp:y});if(e.status){if(i.oR.success((0,v.X)(e,"Code verified successfully")),w)return void w({userId:s,email:t||""});(0,p.a9)(s,t||"");return}k.current=!1,i.oR.error((0,v.X)(e,"Invalid code. Check the WhatsApp message and try again.")),C("")}catch(e){k.current=!1,console.error("OTP verification error:",e),i.oR.error((0,v.c)(e,"Could not verify the code. Please try again.")),C("")}}};return(0,l.useEffect)(()=>{if(4!==y.length||!s||k.current||_.isPending)return;let e=document.getElementById("marhaba-otp-form");null==e||e.requestSubmit()},[y,s,_.isPending]),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsxs)(u.Zp,{className:d.P4,children:[(0,a.jsxs)(u.aR,{className:(0,d.wI)(h),children:[(0,a.jsxs)("div",{className:"relative flex items-center justify-center",children:[g?(0,a.jsx)("button",{type:"button",onClick:g,"aria-label":"Back to create account",className:"absolute left-0 inline-flex h-9 w-9 items-center justify-center rounded-full text-slate-700 transition hover:bg-slate-100",children:(0,a.jsx)(n.A,{className:"h-4 w-4"})}):(0,a.jsx)(c.A,{}),(0,a.jsx)(d.Hd,{embedded:h,onRequestClose:N})]}),(0,a.jsx)(u.ZB,{className:d.P7,children:"Verify Your Account"}),(0,a.jsxs)(u.BT,{className:d.RU,children:["Enter the 4-digit code sent to your WhatsApp",m?(0,a.jsx)("span",{className:"mt-1 block font-semibold text-slate-900",children:m}):null]})]}),(0,a.jsxs)(u.Wu,{className:(0,d.QH)(h),children:[(0,a.jsxs)("form",{id:"marhaba-otp-form",onSubmit:S,className:"space-y-5",children:[(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(x,{maxLength:4,value:y,onChange:C,disabled:_.isPending,children:(0,a.jsxs)(f,{className:"gap-3",children:[(0,a.jsx)(j,{index:0,className:d.O0}),(0,a.jsx)(j,{index:1,className:d.O0}),(0,a.jsx)(j,{index:2,className:d.O0}),(0,a.jsx)(j,{index:3,className:d.O0})]})})}),(0,a.jsx)(o.$,{type:"submit",className:d.ty,disabled:_.isPending||4!==y.length||!s,children:_.isPending?(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white"}),(0,a.jsx)("span",{children:"Verifying..."})]}):"Verify Code"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:d.eS,children:g?(0,a.jsx)("button",{type:"button",onClick:g,className:d.Lh,children:"Back to create account"}):(0,a.jsxs)("p",{children:["Want a different account?"," ",(0,a.jsx)(r.default,{href:"/signup",className:d.Lh,children:"Sign up again"})]})}),(0,a.jsxs)("p",{className:"text-center text-sm font-medium text-slate-700",children:["Having trouble?"," ",(0,a.jsx)(r.default,{href:"/contact",className:d.Lh,children:"Contact support"})]})]})]})]})})}},53008:(e,s,t)=>{t.d(s,{default:()=>l});var a=t(21173),n=t(93138),r=t(20807);function l(e){let{children:s,containerId:t="recaptcha-container"}=e;return r._.NEXT_PUBLIC_RECAPTCHA_SITE_KEY?(0,a.jsx)(n.G3,{reCaptchaKey:r._.NEXT_PUBLIC_RECAPTCHA_SITE_KEY,scriptProps:{async:!0,defer:!0,appendTo:"head",nonce:void 0},...!1===t?{}:{container:{element:t,parameters:{badge:"bottomright",theme:"light"}}},children:s}):(console.warn("Google reCAPTCHA site key not found. reCAPTCHA will not work."),(0,a.jsx)(a.Fragment,{children:s}))}},60863:(e,s,t)=>{t.r(s),t.d(s,{default:()=>w});var a=t(21173),n=t(96497),r=t(67647),l=t(23949),i=t(326),d=t(54151),c=t(27636),o=t(53008),u=t(65524),m=t(33298),h=t(15279),x=t(72821);function f(e){let{...s}=e;return(0,a.jsx)(h._s.Root,{"data-slot":"drawer",...s})}function j(e){let{...s}=e;return(0,a.jsx)(h._s.Portal,{"data-slot":"drawer-portal",...s})}function p(e){let{className:s,...t}=e;return(0,a.jsx)(h._s.Overlay,{"data-slot":"drawer-overlay",className:(0,x.cn)("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t})}function v(e){let{className:s,children:t,showHandle:n=!0,...r}=e;return(0,a.jsxs)(j,{"data-slot":"drawer-portal",children:[(0,a.jsx)(p,{}
1),(0,a.jsxs)(h._s.Content,{"data-slot":"drawer-content",className:(0,x.cn)("group/drawer-content fixed z-50 flex h-auto flex-col bg-white","inset-x-0 bottom-0 mt-24 max-h-[92vh] rounded-t-3xl border-t border-black/5 shadow-[0_-8px_40px_rgba(0,0,0,0.15)] after:hidden",s),...r,children:[n&&(0,a.jsx)("div",{className:"mx-auto mt-3 h-1.5 w-12 shrink-0 rounded-full bg-slate-300"}),t]})]})}function b(e){let{className:s,...t}=e;return(0,a.jsx)(h._s.Title,{"data-slot":"drawer-title",className:(0,x.cn)("font-semibold text-foreground",s),...t})}var g=t(1666),N=t(86320);function w(e){let{open:s,onOpenChange:t,initialTab:h="login"}=e,{status:x}=(0,r.useSession)(),[j,p]=(0,n.useState)(h),[w,y]=(0,n.useState)(null),[C,_]=(0,n.useState)(null),[k,S]=(0,n.useState)(""),P=(0,g.a)();(0,n.useEffect)(()=>{if(!s){p(h),y(null),_(null),S("");return}p(h)},[s,h]),(0,n.useEffect)(()=>{s&&"authenticated"===x&&t(!1)},[s,x,t]);let E=s?(0,a.jsx)(o.default,{children:(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"login"===j?"block":"hidden",children:(0,a.jsx)(d.default,{embedded:!0,defaultEmail:null==C?void 0:C.email,onRequestClose:()=>t(!1),onSwitchToSignup:()=>p("signup"),onSwitchToForgotPassword:()=>p("forgot")})}),(0,a.jsx)("div",{className:"signup"===j?"block":"hidden",children:(0,a.jsx)(u.default,{embedded:!0,onRequestClose:()=>t(!1),onSwitchToLogin:()=>p("login"),onContinueToOtp:e=>{y(e),S(e.password||""),p("otp")}})}),(0,a.jsx)("div",{className:"forgot"===j?"block":"hidden",children:(0,a.jsx)(i.A,{embedded:!0,onRequestClose:()=>t(!1),onSwitchToLogin:()=>p("login")})}),w&&"otp"===j?(0,a.jsx)(l.A,{embedded:!0,userId:w.userId,email:w.email,phone:(0,N.nr)(w.countryCode,w.phone),onBack:()=>p("signup"),onRequestClose:()=>t(!1),onContinueToProfile:e=>{_(e),p("profile")}}):null,C?(0,a.jsx)("div",{className:"profile"===j?"block":"hidden",children:(0,a.jsx)(c.A,{embedded:!0,userId:C.userId,email:C.email,onRequestClose:()=>t(!1),onFinished:async e=>{let s=(e||C.email||"").trim();if(_({...C,email:s}),s&&k){let e=await (0,r.signIn)("user-credentials",{email:s,password:k,redirect:!1});if(S(""),null==e?void 0:e.ok)return}p("login")}})}):null,(0,a.jsx)("div",{id:"recaptcha-container"})]})}):null;return P?(0,a.jsx)(f,{open:s,onOpenChange:t,repositionInputs:!1,children:(0,a.jsxs)(v,{"aria-describedby":void 0,showHandle:!0,className:"top-auto bottom-0 mt-0 h-auto max-h-[100dvh] overflow-hidden rounded-t-2xl border-0",children:[(0,a.jsx)(b,{className:"sr-only",children:"Authentication"}),(0,a.jsx)("div",{className:"min-h-0 max-h-[min(92dvh,100dvh)] overflow-y-auto overscroll-contain px-1 pb-[max(0.75rem,env(safe-area-inset-bottom))] scrollbar-hide",children:E})]})}):(0,a.jsx)(m.lG,{open:s,onOpenChange:t,children:(0,a.jsx)(m.Cf,{accessibleTitle:"Authentication",showCloseButton:!1,className:"max-w-[calc(100%-1.5rem)] border-0 bg-transparent p-0 shadow-none ".concat("sm:max-w-lg"),children:(0,a.jsx)("div",{className:"max-h-[88dvh] overflow-auto scrollbar-hide",children:E})})})}}}]);
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.