import { r as encodeBase64, t as decodeBase64 } from "./base64-MBPo9ozB.mjs";

//#region src/database/repositories/types.ts
/** Encode a cursor from order value + id */
function encodeCursor(orderValue, id) {
	return encodeBase64(JSON.stringify({
		orderValue,
		id
	}));
}
/** Decode a cursor to order value + id. Returns null if invalid. */
function decodeCursor(cursor) {
	try {
		const parsed = JSON.parse(decodeBase64(cursor));
		if (typeof parsed.orderValue === "string" && typeof parsed.id === "string") return parsed;
		return null;
	} catch {
		return null;
	}
}
var EmDashValidationError = class extends Error {
	constructor(message, details) {
		super(message);
		this.details = details;
		this.name = "EmDashValidationError";
	}
};

//#endregion
export { decodeCursor as n, encodeCursor as r, EmDashValidationError as t };
//# sourceMappingURL=types-CMMN0pNg.mjs.map