1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6798],{35626:(e,t,s)=>{s.d(t,{A:()=>r});let r=(0,s(71847).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},46798:(e,t,s)=>{s.r(t),s.d(t,{AuthGuard:()=>N});var r=s(95155),a=s(12115),i=s(20063),n=s(49203),c=s(3290),l=s(25686),o=s(9515);function u(e){let{width:t=100,height:s=100,className:a="",alt:i="".concat(n.vQ.NAME," Logo"),type:c="light"}=e,l="light"===c?n.I_:n.vW;return(0,r.jsx)("img",{src:l,alt:i,width:t,height:s,className:a,loading:"eager",decoding:"sync"})}var d=s(97003),f=s(83209),h=s(17910),x=s(35626),m=s(65993);function g(){let e=(0,i.useRouter)();return(0,r.jsx)("div",{className:"min-h-[calc(100vh-2rem)] flex items-center justify-center p-4",children:(0,r.jsxs)(f.Zp,{className:"w-full max-w-md",children:[(0,r.jsxs)(f.aR,{className:"text-center",children:[(0,r.jsx)("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/20",children:(0,r.jsx)(h.A,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),(0,r.jsx)(f.ZB,{className:"text-2xl font-bold",children:"Access Forbidden"}),(0,r.jsx)(f.BT,{children:"You don't have permission to access this page"})]}),(0,r.jsxs)(f.Wu,{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground text-center",children:"The page you're trying to access requires specific permissions that you don't currently have. Please contact your administrator if you believe this is an error."}),(0,r.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,r.jsxs)(d.Button,{variant:"outline",onClick:()=>e.back(),className:"w-full",children:[(0,r.jsx)(x.A,{className:"mr-2 h-4 w-4"}),"Go Back"]}),(0,r.jsxs)(d.Button,{variant:"default",onClick:()=>e.push("/"),className:"w-full",children:[(0,r.jsx)(m.A,{className:"mr-2 h-4 w-4"}),"Go Home"]})]})]})]})})}var p=s(57533),j=s(9143);function v(e){return n.vQ.AUTH.PUBLIC_ROUTES.some(t=>e===t||e.startsWith(t+"/"))}function y(){return(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-8",children:[(0,r.jsx)(o.kt,{size:"lg",className:"h-12 w-12"}),(0,r.jsx)("div",{className:"flex flex-col items-center gap-2",children:(0,r.jsx)(u,{width:120,height:40,className:"opacity-90",alt:"xyrus.ai Logo",type:"dark"})})]})})}function N(e){let{children:t}=e,s=(0,i.usePathname)(),o=(0,i.useRouter)(),{isAuthenticated:u,loading:d}=(0,c.useAuth)(),{permissions:f,isLoading:h,error:x,hasRouteAccess:m}=(0,l.J)(),[N,b]=(0,a.useState)(!1),{profileData:w,isLoading:A}=(0,j.GV)(e=>e.userProfile),{isAuthenticated:k,loading:T}=(0,c.useAuth)(),R=(0,i.useRouter)(),U=(0,i.usePathname)();if((0,a.useEffect)(()=>{!T&&(k||n.vQ.AUTH.PUBLIC_ROUTES.some(e=>U===e||U.startsWith(e+"/"))||R.replace("".concat(n.vQ.AUTH.LOGIN_PATH,"?returnUrl=").concat(encodeURIComponent(U))),k&&n.vQ.AUTH.AUTH_REDIRECT_ROUTES.some(e=>U===e||U.startsWith(e+"/"))&&R.replace(n.vQ.AUTH.DEFAULT_REDIRECT))},[k,T,U,R]),(0,a.useEffect)(()=>{if(!s||d)return;let e=null==w?void 0:w.user_type;if(u&&!A&&"organization_member"!==e){let t=s.startsWith("/candidate-profile"),r=s.startsWith("/client-profile"),a=s.match(/^\/candidates\/[^/]+$/);if(t||"candidate"!==e)if(r||"client"!==e||a){if(!t&&!r&&!a){b(!0),o.replace("/403");return}}else{b(!0),o.replace("/client-profile");return}else{b(!0),o.replace("/candidate-profile");return}}if(v(s)||!u)return void b(!1);let{hasAccess:t,requiredPermissions:r,redirectTo:a}=m(s);if(r.length>0){if(h)return;if(!f||0===f.length){b(!0),o.replace("/403");return}if(!t){if(a){b(!0),o.replace(a);return}b(!1);return}}b(!1)},[s,o,d,u,h,x,f,m,w,A]),h||N)return(0,r.jsx)(y,{});if(!v(s)&&u&&h){let{requiredPermissions:e}=m(s);if(e.length>0)return(0,r.jsx)(y,{})}if(x&&!h&&!v(s)&&u){let{requiredPermissions:e}=m(s);if(e.length>0)return(0,r.jsx)(p.default,{})}if(!v(s)&&u&&!N){let{hasAccess:e,requiredPermissions:t}=m(s);if(t.length>0){if(!f||0===f.length)return(0,r.jsx)(p.default,{});if(!e)return(0,r.jsx)(g,{})}}return(0,r.jsx)(r.Fragment,{children:t})}},57533:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155);s(12115);var a=s(83209),i=s(17910),n=s(35626),c=s(20063);function l(){let e=(0,c.useRouter)();return(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,r.jsxs)(a.Zp,{className:"w-full max-w-md",children:[(0,r.jsxs)(a.aR,{className:"text-center",children:[(0,r.jsx)("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-red-100",children:(0,r.jsx)(i.A,{className:"h-8 w-8 text-red-600"})}),(0,r.jsx)(a.ZB,{className:"text-2xl font-bold text-gray-900",children:"Access Forbidden"}),(0,r.jsx)(a.BT,{className:"text-gray-600",children:"You don't have permission to access this page"})]}),(0,r.jsxs)(a.Wu,{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-gray-500 text-center",children:"The page you're trying to access requires specific permissions that you don't currently have. Please contact your administrator if you believe this is an error."}),(0,r.jsx)("div",{className:"flex flex-col space-y-2",children:(0,r.jsxs)("button",{onClick:()=>e.back(),className:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2 w-full cursor-pointer",children:[(0,r.jsx)(n.A,{className:"mr-2 h-4 w-4"}),"Go Back"]})})]})]})})}}}]);
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.