import{i as e,o as t,r as n}from"./button-DJ30HgDO.js";import{c as r}from"./chunk-EPOLDU6W-Dzz6WSjf.js";import"./free-solid-svg-icons-zCYot7wU.js";import{t as i}from"./use-api-BQhcC0Jo.js";import"./user-service-CruKwI9u.js";import"./toast-context-val-Z-lwvYkJ.js";import{a,i as o}from"./gateway-service-DqLfkgKn.js";import"./entity-list-table-zGFxBB5g.js";import"./page-container-DN56Bi3o.js";import"./page-status-Dgf15-K2.js";import"./icon-button-SGdacqAu.js";import"./use-toast-ehNQGp1o.js";import"./input-C5ngh159.js";import"./grant-permission-modal-C0plkvS4.js";import"./edit-permission-modal-CNhpXowl.js";import{t as s}from"./entity-permissions-page-layout-B3wC9Vq0.js";import"./use-all-users-D1dQfQpQ.js";import"./use-all-accounts-qqOdInba.js";import"./entity-service-Cpn5Fxqr.js";import"./use-all-groups-CdEQrry9.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};