try {
	let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
	n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "fbe6879a-aef0-4eb0-bad9-86510a31cabe", e._sentryDebugIdIdentifier = "sentry-dbid-fbe6879a-aef0-4eb0-bad9-86510a31cabe");
} catch (e) {}
import { n as httpGet, s as useApiContext } from "./http-CHTzpXCd.js";
import { useQuery } from "@tanstack/preact-query";
//#region src/api/businessLines/useBusinessLines.ts
var getBusinessLines = async (legalEntityId, baseUrl) => {
	return httpGet({
		baseUrl,
		path: `legalEntities/${legalEntityId}/businessLines`
	});
};
/**
* @param options additional options passed to Tanstack Query, eg; refetchInterval for polling
*/
var useBusinessLines = (businessLineType, options) => {
	const { rootLegalEntityId, baseUrl } = useApiContext();
	return useQuery({
		queryKey: ["businessLines"],
		queryFn: () => getBusinessLines(rootLegalEntityId.value, baseUrl.value),
		select: (businessLines) => businessLines.filter((businessLine) => businessLineType.includes(businessLine.service)),
		...options
	});
};
//#endregion
export { useBusinessLines as t };
