import { _ as uniqueStrings } from "./string-normalization-B8G0vlWE.js";
import { t as CHANNEL_IDS } from "./ids-COH3O_8T.js";
import { i as listRegisteredChannelPluginIds } from "./registry-Cf1bcJgW.js";
import { i as INTERNAL_MESSAGE_CHANNEL, n as normalizeMessageChannel$1 } from "./message-channel-core-wRX3WslK.js";
//#region src/utils/message-channel-normalize.ts
function normalizeMessageChannel(raw) {
	return normalizeMessageChannel$1(raw);
}
const listPluginChannelIds = () => {
	return listRegisteredChannelPluginIds();
};
const listDeliverableMessageChannels = () => uniqueStrings([...CHANNEL_IDS, ...listPluginChannelIds()]);
const listGatewayMessageChannels = () => [...listDeliverableMessageChannels(), INTERNAL_MESSAGE_CHANNEL];
function isGatewayMessageChannel(value) {
	return listGatewayMessageChannels().includes(value);
}
function isDeliverableMessageChannel(value) {
	return listDeliverableMessageChannels().includes(value);
}
function resolveGatewayMessageChannel(raw) {
	const normalized = normalizeMessageChannel(raw);
	if (!normalized) return;
	return isGatewayMessageChannel(normalized) ? normalized : void 0;
}
function resolveMessageChannel(primary, fallback) {
	return normalizeMessageChannel(primary) ?? normalizeMessageChannel(fallback);
}
//#endregion
export { resolveGatewayMessageChannel as a, normalizeMessageChannel as i, isGatewayMessageChannel as n, resolveMessageChannel as o, listDeliverableMessageChannels as r, isDeliverableMessageChannel as t };
