import { _ as recordChannelHistoryEntryWithMedia, d as clearChannelHistoryIfEnabled, g as recordChannelHistoryEntryIfEnabled, i as buildChannelPendingHistoryContext, r as buildChannelInboundHistory } from "./history-DQ4cc2Yy.js";
//#region src/channels/turn/history-window.ts
/** Creates a bounded channel history window over a caller-owned history map. */
function createChannelHistoryWindow(params) {
	const { historyMap } = params;
	return {
		record: (recordParams) => recordChannelHistoryEntryIfEnabled({
			historyMap,
			historyKey: recordParams.historyKey,
			limit: recordParams.limit,
			entry: recordParams.entry
		}),
		recordWithMedia: (recordParams) => recordChannelHistoryEntryWithMedia({
			historyMap,
			historyKey: recordParams.historyKey,
			limit: recordParams.limit,
			entry: recordParams.entry,
			media: recordParams.media,
			mediaLimit: recordParams.mediaLimit,
			messageId: recordParams.messageId,
			shouldRecord: recordParams.shouldRecord
		}),
		buildPendingContext: (contextParams) => buildChannelPendingHistoryContext({
			historyMap,
			historyKey: contextParams.historyKey,
			limit: contextParams.limit,
			currentMessage: contextParams.currentMessage,
			formatEntry: contextParams.formatEntry,
			lineBreak: contextParams.lineBreak
		}),
		buildInboundHistory: (historyParams) => buildChannelInboundHistory({
			historyMap,
			historyKey: historyParams.historyKey,
			limit: historyParams.limit
		}),
		clear: (clearParams) => clearChannelHistoryIfEnabled({
			historyMap,
			historyKey: clearParams.historyKey,
			limit: clearParams.limit
		})
	};
}
//#endregion
export { createChannelHistoryWindow as t };
