import type { IChatRepository } from "./interfaces/ichat_repository";

/**
 * Loads the browser-only chat repository behind an explicit async boundary.
 *
 * The repository owns the Dexie-backed history and media stores. Keeping this
 * loader separate prevents those stores from entering every route's eager
 * client graph through shared providers.
 */
export async function loadChatRepository(): Promise<IChatRepository> {
  const { getChatRepository } = await import("./chat_repository");
  return getChatRepository();
}
