import{Cv as e,Hy as t,Ly as n,Mh as r,Sv as i,Zv as a,ap as o,bv as s,wv as c,xv as l}from"./index-DDwwBb9e.js";var u=t();function d({message:t,alertProps:o={},permission:d}){let f=`You don't have permission to view this content. Required permission: ${d}. Ask your team administrator to request access.`,p=t??f;return(0,u.jsx)(n,{padding:4,children:(0,u.jsxs)(e,{status:`warning`,...o,children:[(0,u.jsx)(i,{children:(0,u.jsx)(r,{size:16})}),(0,u.jsxs)(s,{children:[(0,u.jsx)(c,{children:`Access Restricted`}),(0,u.jsx)(l,{children:(0,u.jsx)(a,{children:p})})]})]})})}function f(e,t){return function(n){let{fallbackComponent:r=d,layoutComponent:i,customMessage:a,bypassOnboardingRedirect:s=!1}=t??{},c=t=>{let{hasAnyPermission:c,isLoading:l}=o(s?{redirectToOnboarding:!1,redirectToProjectOnboarding:!1}:void 0);if(l)return(0,u.jsx)(n,{...t});if(!c(e)){let t=(0,u.jsx)(r,{permission:e,message:a});return i?(0,u.jsx)(i,{children:t}):t}return(0,u.jsx)(n,{...t})};return c.displayName=`withPermissionGuard(${n.displayName??n.name??`Component`})`,c}}export{d as n,f as t};
//# sourceMappingURL=WithPermissionGuard-wX0IC3VF.js.map