{"version":3,"file":"keybinding-hints.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/keybinding-hints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAoC,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAYlF;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAEtD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,kBAAkB,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAEjF;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,kBAAkB,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1G;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEnE","sourcesContent":["/**\n * Utilities for formatting keybinding hints in the UI.\n */\n\nimport { type EditorAction, getEditorKeybindings, type KeyId } from \"open-pi-tui\";\nimport type { AppAction, KeybindingsManager } from \"../../../core/keybindings.js\";\nimport { theme } from \"../theme/theme.js\";\n\n/**\n * Format keys array as display string (e.g., [\"ctrl+c\", \"escape\"] -> \"ctrl+c/escape\").\n */\nfunction formatKeys(keys: KeyId[]): string {\n\tif (keys.length === 0) return \"\";\n\tif (keys.length === 1) return keys[0]!;\n\treturn keys.join(\"/\");\n}\n\n/**\n * Get display string for an editor action.\n */\nexport function editorKey(action: EditorAction): string {\n\treturn formatKeys(getEditorKeybindings().getKeys(action));\n}\n\n/**\n * Get display string for an app action.\n */\nexport function appKey(keybindings: KeybindingsManager, action: AppAction): string {\n\treturn formatKeys(keybindings.getKeys(action));\n}\n\n/**\n * Format a keybinding hint with consistent styling: dim key, muted description.\n * Looks up the key from editor keybindings automatically.\n *\n * @param action - Editor action name (e.g., \"selectConfirm\", \"expandTools\")\n * @param description - Description text (e.g., \"to expand\", \"cancel\")\n * @returns Formatted string with dim key and muted description\n */\nexport function keyHint(action: EditorAction, description: string): string {\n\treturn theme.fg(\"dim\", editorKey(action)) + theme.fg(\"muted\", ` ${description}`);\n}\n\n/**\n * Format a keybinding hint for app-level actions.\n * Requires the KeybindingsManager instance.\n *\n * @param keybindings - KeybindingsManager instance\n * @param action - App action name (e.g., \"interrupt\", \"externalEditor\")\n * @param description - Description text\n * @returns Formatted string with dim key and muted description\n */\nexport function appKeyHint(keybindings: KeybindingsManager, action: AppAction, description: string): string {\n\treturn theme.fg(\"dim\", appKey(keybindings, action)) + theme.fg(\"muted\", ` ${description}`);\n}\n\n/**\n * Format a raw key string with description (for non-configurable keys like ↑↓).\n *\n * @param key - Raw key string\n * @param description - Description text\n * @returns Formatted string with dim key and muted description\n */\nexport function rawKeyHint(key: string, description: string): string {\n\treturn theme.fg(\"dim\", key) + theme.fg(\"muted\", ` ${description}`);\n}\n"]}