import{i as e,o as t,r as n}from"./button-DJ30HgDO.js";import{s as r}from"./chunk-EPOLDU6W-BGm2xlSj.js";import"./use-runtime-config-CkwqDzno.js";import{t as i}from"./use-api-CtLXpHJw.js";import"./user-service-Dl9A7L06.js";import"./toast-context-val-Z-lwvYkJ.js";import{a,i as o}from"./gateway-service-BwyflEJR.js";import"./page-status-CNIWXN7q.js";import"./page-container-DN56Bi3o.js";import"./icon-button-DFhNpcsD.js";import"./use-toast-BWmLhWRD.js";import"./input-BbiN5lj4.js";import"./grant-permission-modal-CddXPWUg.js";import{t as s}from"./entity-permissions-page-layout-CmGpyxVz.js";import"./use-all-users-Bs-V-nql.js";import"./use-all-accounts-B8jcgmIk.js";import"./entity-service-KdPsD3WQ.js";import"./use-all-groups-DdRVyBae.js";var c=t(e(),1);function l({name:e}){let{data:t,isLoading:n,error:r,refetch:o}=i((0,c.useCallback)(t=>e===null?Promise.resolve([]):a(e,t),[e]));return{permissions:t??[],isLoading:n,error:r,refresh:o}}function u({name:e}){let{data:t,isLoading:n,error:r,refetch:a}=i((0,c.useCallback)(t=>e===null?Promise.resolve([]):o(e,t),[e]));return{permissions:t??[],isLoading:n,error:r,refresh:a}}var d=t(n(),1);function f(){let{name:e}=r(),t=e||null,{isLoading:n,error:i,refresh:a,permissions:o}=l({name:t}),{isLoading:c,error:f,refresh:p,permissions:m}=u({name:t}),h=n||c,g=i||f;return t?(0,d.jsx)(s,{title:`Permissions for Endpoint ${t}`,resourceId:t,resourceName:t,resourceType:`ai-endpoints`,userPermissions:o,groupPermissions:m,isLoading:h,error:g,refresh:()=>{a(),p()}}):(0,d.jsx)(`div`,{children:`Endpoint Name is required.`})}export{f as default};