PageSourceSearch

https://khatapana.com/_next/static/chunks/3eicx_mku7zid.js

js khatapana.com collected 2026-10-01 23:45:36 UTC 10,009 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="dad4f6a7-c6e2-26e7-ae9a-db221abe38a4")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,188742,e=>{"use strict";var t=e.i(565566);let a={name:"eye",size:24,node:[["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"}]]};a.node;let s=(0,t.default)(a);e.s(["EyeIcon",0,s],188742)},604562,e=>{"use strict";var t=e.i(565566);let a={name:"phone",size:24,node:[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]};a.node;let s=(0,t.default)(a);e.s(["default",0,s])},652078,e=>{"use strict";var t=e.i(821526),a=e.i(519455),s=e.i(903133),r=e.i(793479),l=e.i(471436),n=e.i(789601),i=e.i(667107),o=e.i(32870
25),d=e.i(834365),c=e.i(188742),m=e.i(565566);let u={name:"eye-off",size:24,node:[["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"}]]};u.node;let p=(0,m.default)(u);var h=e.i(604562),h=h,x=e.i(567044),f=e.i(305120),g=e.i(518071),j=e.i(742018),y=e.i(717053),v=e.i(506607),b=e.i(776373),w=e.i(93814),N=e.i(622432);let F=b.default.object({captcha:b.default.string().optional(),email:b.default.string().email().optional().or(b.default.literal("")),password:b.default.string(),phone:b.default.string().regex(/^\d{10}$/,"Please enter a valid phone number").optional().or(b.default.literal(""))}).refine(e=>!!e.email||!!e.phone,{message:"Username is required.",path:["email","phone"]}).transform(e=>{let t={...e};return e.email&&(t={email:e.email,password:e.password,phone:void 0}),e.phone&&(t={email:void 0,password:e.password,phone:e.phone}),{...t,captcha:e.captcha}});e.s(["LoginForm",0,function(){let{_hasHydrated:e,clearError:m,isLoading:u,login:b}=(0,l.useAuth)(e=>e),L=(0,f.useRouter)(),S=(0,j.useId)(),{resolvedTheme:k}=(0,g.useTheme)(),[A,z]=(0,j.useState)(!1),M=(0,j.useRef)(null),C=(0,f.useSearchParams)().get("returnUrl"),[I,B]=(0,j.useState)("email"),E=(0,y.useForm)({defaultValues:{email:"",password:"",phone:"",captcha:void 0},resolver:(0,o.zodResolver)(F)}),V=async e=>{m(),E.clearErrors("root"),M.current?.reset();let t="email"===I?{email:e.email??"",password:e.password}:{password:e.password,phone:"+977"+e.phone};if(!t.email&&!t.phone)return;if(!e.captcha)return void E.setError("root",{message:"Please complete the captcha to continue."});let a=await b({...t,captcha:e.captcha}),s=l.useAuth.getState().user?.roles?.some(e=>n.ADMIN_ROLES.includes(e))?"/admin":"/dashboard";if(!a){M.current?.reset(),E.setError("root",{message:l.useAuth.getState().error??"Login failed. Please try again."});return}return v.toast.success("Login successful!"),M.current?.reset(),L.push((0,i.safeReturnPath)(C,s))},P=()=>z(e=>!e);return e?(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-sentry-component":"LoginForm","data-sentry-source-file":"login-form.tsx",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold",children:"Welcome back!"}),(0,t.jsxs)("p",{className:"text-muted-foreground text-sm text-balance",children:["Enter your ",I," and password to sign in."]})]}),(0,t.jsxs)("div",{className:"grid gap-6",children:[(0,t.jsx)(s.Form,{...E,"data-sentry-element":"Form","data-sentry-source-file":"login-form.tsx",children:(0,t.jsx)("form",{onSubmit:E.handleSubmit(V),children:(0,t.jsxs)("div",{className:"grid gap-3",children:["email"===I?(0,t.jsx)(s.FormField,{control:E.control,name:"email",render:({field:e})=>(0,t.jsxs)(s.FormItem,{className:"grid gap-3",children:[(0,t.jsx)(s.FormLabel,{htmlFor:S+"-email",children:"Email"}),(0,t.jsx)(s.FormControl,{children:(0,t.jsx)(r.Input,{autoComplete:"email",className:"rounded-md",id:S+"-email",placeholder:"[email protected]",spellCheck:!1,type:"email",...e})}),(0,t.jsx)(s.FormMessage,{})]})}):(0,t.jsx)(s.FormField,{control:E.control,name:"phone",render:({field:e})=>(0,t.jsxs)(s.FormItem,{className:"grid gap-3",children:[(0,t.jsx)(s.FormLabel,{htmlFor:S+"-phone",children:"Phone"}),(0,t.jsx)(s.FormControl,{children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("span",{className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 tabular-nums select-none",children:"+977"}),(0,t.jsx)(r.Input,{autoComplete:"tel",className:"pl-14 tabular-nums",id:S+"-phone",inputMode:"tel",placeholder:"9800000000",spellCheck:!1,type:"tel",...e})]})}),(0,t.jsx)(s.FormMessage,{})]})}),(0,t.jsx)(s.FormField,{control:E.control,name:"password",render:({field:e})=>(0,t.jsxs)(s.FormItem,{className:"grid gap-3",children:[(0,t.jsxs)(s.FormLabel,{className:"flex justify-between gap-1",htmlFor:S+"-password",children:[(0,t.jsx)("span",{children:"Password"}),"email"===I&&(0,t.jsx)(x.default,{className:"text-primary text-xs hover:underline",href:"/dashboard/reset-password",children:"Forgot Password?"})]}),(0,t.jsx)(s.FormControl,{children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.Input,{...e,autoComplete:"current-password",id:S+"-password",placeholder:"••••••••",type:A?"text":"password"}),(0,t.jsx)(a.Button,{"aria-controls":S+"-password","aria-label":A?"Hide password":"Show password","aria-pressed":A,className:"text-muted-foreground
2/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none hover:bg-transparent focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",onClick:P,type:"button",variant:"ghost",children:A?(0,t.jsx)(p,{"aria-hidden":"true",size:16}):(0,t.jsx)(c.EyeIcon,{"aria-hidden":"true",size:16})})]})}),(0,t.jsx)(s.FormMessage,{})]}),"data-sentry-element":"FormField","data-sentry-source-file":"login-form.tsx"}),(0,t.jsx)(d.Turnstile,{as:"aside",className:"rounded-lg",onBeforeInteractive:()=>E.setValue("captcha",""),onExpire:()=>{M.current?.reset(),E.setValue("captcha","")},onSuccess:e=>{E.setValue("captcha",e)},onWidgetLoad:()=>E.setValue("captcha",""),options:{theme:"dark"===k?"dark":"light",size:"flexible",language:"en"},ref:M,siteKey:"0x4AAAAAAByfaiVmklwiNSc1","data-sentry-element":"Turnstile","data-sentry-source-file":"login-form.tsx"}),E.formState.errors.root?.message&&(0,t.jsx)("p",{className:"text-destructive text-sm",role:"alert",children:E.formState.errors.root.message}),(0,t.jsx)("div",{className:"flex w-full items-center justify-end pt-3",children:(0,t.jsx)(a.Button,{className:"w-full px-4 py-2",disabled:u,loading:u,type:"submit","data-sentry-element":"Button","data-sentry-source-file":"login-form.tsx",children:"Sign in"})})]})})}),(0,t.jsx)("div",{className:"after:border-border relative text-center text-xs after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t",children:(0,t.jsx)("span",{className:"bg-background text-muted-foreground relative z-10 px-2",children:"OR CONTINUE WITH"})}),(0,t.jsx)(N.SocialButtons,{"data-sentry-element":"SocialButtons","data-sentry-source-file":"login-form.tsx"}),"email"===I?(0,t.jsxs)(a.Button,{className:"inline-flex w-full items-center justify-center rounded-md px-4 py-2 text-sm font-medium",onClick:e=>{e.preventDefault(),E.setValue("email","",{shouldValidate:!0}),B("phone")},type:"button",variant:"outline",children:[(0,t.jsx)(h.default,{className:"size-4","aria-hidden":"true"}),"Sign in with Phone"]}):(0,t.jsxs)(a.Button,{className:"inline-flex w-full items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium",onClick:e=>{e.preventDefault(),E.setValue("phone","",{shouldValidate:!0}),B("email")},type:"button",variant:"outline",children:[(0,t.jsx)("svg",{"aria-hidden":"true",className:"size-[18px]",enableBackground:"new 0 0 122.88 78.607",height:"78.607px",id:"Layer_1",version:"1.1",viewBox:"0 0 122.88 78.607",width:"122.88px",x:"0px",xmlns:"http://www.w3.org/2000/svg",y:"0px",children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{clipRule:"evenodd",d:"M61.058,65.992l24.224-24.221l36.837,36.836H73.673h-25.23H0l36.836-36.836 L61.058,65.992L61.058,65.992z M1.401,0l59.656,59.654L120.714,0H1.401L1.401,0z M0,69.673l31.625-31.628L0,6.42V69.673L0,69.673z M122.88,72.698L88.227,38.045L122.88,3.393V72.698L122.88,72.698z",fillRule:"evenodd"})})}),"Sign in with Email"]})]}),(0,t.jsxs)("div",{className:"text-center text-sm",children:["Don't have an account?"," ",(0,t.jsx)(x.default,{className:"underline underline-offset-4",href:"/dashboard/signup","data-sentry-element":"Link","data-sentry-source-file":"login-form.tsx",children:"Sign up"})]})]}):(0,t.jsx)(w.LoadingSpinner,{})}],652078)},93814,e=>{"use strict";var t=e.i(821526),a=e.i(513408);e.s(["LoadingSpinner",0,()=>(0,t.jsxs)("div",{"aria-busy":"true","aria-live":"polite",className:"flex h-[calc(100svh-10rem)] items-center justify-center",role:"status","data-sentry-component":"LoadingSpinner","data-sentry-source-file":"loading-spinner.tsx",children:[(0,t.jsx)(a.AnimatedLogo,{"aria-label":"loading","data-sentry-element":"AnimatedLogo","data-sentry-source-file":"loading-spinner.tsx"}),(0,t.jsx)("span",{className:"sr-only",children:"Loading…"})]})])},789601,e=>{"use strict";e.s(["ADMIN_ROLES",0,["Khatapana Admin","Legal Staff"]])}]);
3
4//# debugId=dad4f6a7-c6e2-26e7-ae9a-db221abe38a4

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.