import{__awaiter as e,__generator as t}from"tslib";import{useQuery as r,useMutation as n}from"@tanstack/react-query";import{GetAppsecRoles as a,appsecGetUsersByQueryLite as i,appsecGetUserGroups as u,ApproveOrRejectVariants as s}from"../apis/scopeApis.js";import o from"../store/useEnvStore.js";function c(n){var a=this;return r({queryKey:["approver-search",n],queryFn:function(){return e(a,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return[4,i(n)];case 1:return[2,(null==(e=t.sent())?void 0:e.data)||[]]}})})},enabled:!!n.trim(),staleTime:3e4})}function d(n){var a=this,i=o(function(e){var t;return null===(t=e.rbacConfig)||void 0===t?void 0:t.applicationId});return r({queryKey:["group-search",i,n],queryFn:function(){return e(a,void 0,void 0,function(){return t(this,function(e){switch(e.label){case 0:return[4,u({appId:i,name:n})];case 1:return[2,e.sent().data]}})})},enabled:!!i,staleTime:3e4})}function p(){return n({mutationFn:function(e){var t=e.variantIds,r=e.status,n=e.feedback,a=e.scopeId,i=e.is_deleted,u=e.appsecData;return s({variant_ids:t,status:r,feedback:n,scopeId:a,is_deleted:i,appsecData:u})}})}function f(n,i){var u=this;return void 0===i&&(i=!0),r({queryKey:["appsec-roles",n],queryFn:function(){return e(u,void 0,void 0,function(){return t(this,function(e){switch(e.label){case 0:return[4,a(n)];case 1:return[2,e.sent().data]}})})},enabled:i&&!!n,staleTime:1e5})}export{p as useApproveOrRejectVariantsMutation,c as useApproverSearchQuery,f as useGetAppSecRolesQuery,d as useGroupSearchQuery};
//# sourceMappingURL=useApprovalQueries.js.map
