import { a as shouldLogVerbose } from "./globals-CHNs9cIE.js";
import { a as chunkText } from "./chunk-Zq6EJkPq.js";
import "./runtime-env-B53_WH7U.js";
import "./reply-chunking-RWwsoQE_.js";
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-B2v6D2C8.js";
import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-DuxxoyiJ.js";
import { t as createWhatsAppOutboundBase } from "./outbound-base-BSehbHTo.js";
//#region extensions/whatsapp/src/outbound-adapter.ts
let whatsAppSendModulePromise;
function loadWhatsAppSendModule() {
	whatsAppSendModulePromise ??= import("./send-BS_ZBd4q.js");
	return whatsAppSendModulePromise;
}
function normalizeOutboundText(text) {
	return normalizeWhatsAppPayloadText(text);
}
const whatsappOutbound = createWhatsAppOutboundBase({
	chunker: chunkText,
	sendMessageWhatsApp: async (to, text, options) => await (await loadWhatsAppSendModule()).sendMessageWhatsApp(to, normalizeOutboundText(text), { ...options }),
	sendPollWhatsApp: async (to, poll, options) => await (await loadWhatsAppSendModule()).sendPollWhatsApp(to, poll, options),
	shouldLogVerbose: () => shouldLogVerbose(),
	resolveTarget: ({ to, allowFrom, mode }) => resolveWhatsAppOutboundTarget({
		to,
		allowFrom,
		mode
	}),
	normalizeText: normalizeOutboundText,
	skipEmptyText: true
});
//#endregion
export { whatsappOutbound as t };
