globalThis.process ??= {};
globalThis.process.env ??= {};
import { r as __exportAll } from "./rolldown-runtime_-UtK6b3T.mjs";
import { d as mapContentError, u as jsonOk } from "./crypto_CY2zBtG3.mjs";
import { f as createDbNotificationStore } from "./db_DCN9iNkm.mjs";
import { a as requireEditor } from "./auth_B0DWM0G6.mjs";
import { r as getNotificationsDb } from "./notifications_BOfD9oTI.mjs";
import { env } from "cloudflare:workers";
//#region src/pages/api/admin/notifications/unread-count.ts
var unread_count_exports = /* @__PURE__ */ __exportAll({
	GET: () => GET,
	prerender: () => false
});
var GET = async ({ request, cookies }) => {
	try {
		const { actor } = await requireEditor(request, env, cookies);
		const count = await createDbNotificationStore(getNotificationsDb(env)).unreadCount(actor.id);
		return jsonOk({ count });
	} catch (error) {
		return mapContentError(error);
	}
};
//#endregion
//#region \0virtual:astro:page:src/pages/api/admin/notifications/unread-count@_@ts
var page = () => unread_count_exports;
//#endregion
export { page };
