import { init_esm_shims, __name } from './4RNWLMHM.js';

// src/display/formatters.ts
init_esm_shims();
function formatVersionCombination(combination, isDefault) {
  const versionPairs = Object.entries(combination.versions).filter(([_, version]) => version !== void 0).map(([tool, version]) => `${tool}:${version}`).join(", ");
  const patchInfo = combination.patch ? ` [patch: ${combination.patch}]` : "";
  const badges = [];
  if (isDefault === true) badges.push("\u{1F3AF} Default");
  else if (combination.isRecommended === true) badges.push("\u2705 Stable");
  if (combination.description != null && combination.description !== "") badges.push(`\u{1F4DD} ${combination.description}`);
  const badgeStr = badges.length > 0 ? ` (${badges.join(", ")})` : "";
  return `  ${combination.id}: ${versionPairs}${patchInfo}${badgeStr}`;
}
__name(formatVersionCombination, "formatVersionCombination");
function createUserFriendlyError(error, context) {
  let message = `\u274C ${error}
`;
  if (context?.toolName != null && context.toolName !== "" && context.requestedVersion != null && context.requestedVersion !== "" && context.availableVersions != null) {
    message += `
\u{1F4A1} Suggestions for ${context.toolName}:`;
    message += `
   Requested: ${context.requestedVersion}`;
    message += `
   Available: ${context.availableVersions.join(", ")}`;
  }
  if (context?.suggestedCombinations && context.suggestedCombinations.length > 0) {
    message += `

\u{1F3AF} Suggested options:`;
    context.suggestedCombinations.forEach((combo) => {
      message += `
   ${combo}`;
    });
  }
  message += `

\u{1F4DA} For more help: lz-tool --list-versions`;
  return message;
}
__name(createUserFriendlyError, "createUserFriendlyError");

export { createUserFriendlyError, formatVersionCombination };
//# sourceMappingURL=5OKX3IYN.js.map
//# sourceMappingURL=5OKX3IYN.js.map