// Canonical SF shortcut definitions used by registration, help text, and overlays.
import { formatShortcut } from "./files.js";
export const SF_SHORTCUTS = {
	dashboard: {
		key: "g",
		action: "Open SF dashboard",
		command: "/status",
		hasFallback: true,
	},
	notifications: {
		key: "n",
		action: "Open notification history",
		command: "/notifications",
		hasFallback: true,
	},
	parallel: {
		key: "p",
		action: "Open parallel worker monitor",
		command: "/parallel watch",
		hasFallback: false, // Ctrl+Shift+P conflicts with cycleModelBackward
	},
};
function combo(prefix, key) {
	return `${prefix}${key.toUpperCase()}`;
}
export function primaryShortcutCombo(id) {
	return combo("Ctrl+Alt+", SF_SHORTCUTS[id].key);
}
export function fallbackShortcutCombo(id) {
	return combo("Ctrl+Shift+", SF_SHORTCUTS[id].key);
}
export function shortcutPair(id, formatter = (combo) => combo) {
	const primary = formatter(primaryShortcutCombo(id));
	if (!SF_SHORTCUTS[id].hasFallback) return primary;
	return `${primary} / ${formatter(fallbackShortcutCombo(id))}`;
}
export function formattedShortcutPair(id) {
	return shortcutPair(id, formatShortcut);
}
