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] = "ca885830-77fa-4ba0-a44b-7d5cd4ff46cc", e._sentryDebugIdIdentifier = "sentry-dbid-ca885830-77fa-4ba0-a44b-7d5cd4ff46cc");
} catch (e) {}
import { r as httpPost, s as useApiContext } from "./http-CHTzpXCd.js";
import { t as useSettingsContext } from "./useSettingsContext-DzwVt0W0.js";
import { t as useBusinessLines } from "./useBusinessLines-BJV9biUj.js";
import { t as SettingNames } from "./types-BklAlvuU.js";
import { useMemo } from "preact/hooks";
import { useQuery } from "@tanstack/preact-query";
//#region src/api/pci/usePciStatus.ts
var getPciStatus = async (legalEntityId, baseUrl, data) => {
	const filteredData = {
		...data,
		additionalSalesChannels: data.additionalSalesChannels?.filter((channel) => channel !== "payByLink")
	};
	return httpPost({
		baseUrl,
		path: `legalEntities/${legalEntityId}/pci/signingRequired`
	}, filteredData);
};
var usePciStatus = (data, options) => {
	const { rootLegalEntityId, baseUrl } = useApiContext();
	return useQuery({
		queryKey: ["pciStatus", data],
		queryFn: () => getPciStatus(rootLegalEntityId.value, baseUrl.value, data),
		staleTime: 0,
		...options
	});
};
//#endregion
//#region src/components/Contract/hooks/useSalesChannels.ts
function useSalesChannels() {
	const { isSettingEnabled } = useSettingsContext();
	const { data: existingBusinessLines } = useBusinessLines(["paymentProcessing"]);
	return useMemo(() => {
		const settings = [];
		const businessLinesSalesChannels = [...new Set(existingBusinessLines?.flatMap((item) => item.salesChannels ?? []))];
		if (isSettingEnabled(SettingNames.RequirePciSignEcommerce)) settings.push("eCommerce");
		if (isSettingEnabled(SettingNames.RequirePciSignPos)) settings.push("pos");
		if (isSettingEnabled(SettingNames.RequirePciSignEcomMoto)) settings.push("ecomMoto");
		if (isSettingEnabled(SettingNames.RequirePciSignPosMoto)) settings.push("posMoto");
		return isSettingEnabled("allowBusinessLines") ? businessLinesSalesChannels : settings;
	}, [existingBusinessLines, isSettingEnabled]);
}
//#endregion
export { usePciStatus as n, useSalesChannels as t };
