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"./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 a}from"./entity-permissions-page-layout-CmGpyxVz.js";import"./use-all-users-Bs-V-nql.js";import"./use-all-accounts-B8jcgmIk.js";import{m as o,p as s}from"./entity-service-KdPsD3WQ.js";import"./use-all-groups-DdRVyBae.js";var c=t(e(),1);function l({modelName:e}){let{data:t,isLoading:n,error:r,refetch:a}=i((0,c.useCallback)(t=>e===null?Promise.resolve([]):o(e,t),[e]));return{modelUserPermissions:t??[],isLoading:n,error:r,refresh:a}}function u({modelName:e}){let{data:t,isLoading:n,error:r,refetch:a}=i((0,c.useCallback)(t=>e===null?Promise.resolve([]):s(e,t),[e]));return{modelGroupPermissions:t??[],isLoading:n,error:r,refresh:a}}var d=t(n(),1);function f(){let{modelName:e}=r(),{isLoading:t,error:n,refresh:i,modelUserPermissions:o}=l({modelName:e||null}),{isLoading:s,error:c,refresh:f,modelGroupPermissions:p}=u({modelName:e||null}),m=t||s,h=n||c;return e?(0,d.jsx)(a,{title:`Permissions for Model ${e}`,resourceId:e,resourceName:e,resourceType:`models`,userPermissions:o,groupPermissions:p,isLoading:m,error:h,refresh:()=>{i(),f()}}):(0,d.jsx)(`div`,{children:`Model Name is required.`})}export{f as default};