import { getAvailableEnvironmentsCacheKey as e, getWorkflowTypesCacheKey as t, getWorkspaceTypesCacheKey as n } from "./query-keys.js";
import { useApiClient as r } from "./useApi.js";
import { useQuery as i } from "@tanstack/react-query";
//#region src/hooks/useConfig.ts
function a() {
	let { envKey: e, api: t } = r();
	return i({
		queryKey: n(e),
		queryFn: () => t.config.getWorkspaceTypes()
	});
}
function o(e) {
	let { envKey: n, api: a } = r();
	return i({
		queryKey: t(n, e),
		queryFn: () => a.config.getWorkflowTypesByWorkspace({ workspaceBlockName: e }),
		enabled: !!e
	});
}
function s(t) {
	let { envKey: n, api: a } = r();
	return i({
		queryKey: e(n),
		queryFn: () => a.config.getAvailableEnvironments(),
		enabled: t?.enabled ?? !0
	});
}
//#endregion
export { s as useAvailableEnvironments, o as useWorkflowConfig, a as useWorkspaceConfig };
