'use strict';

var REVK4LZT_cjs = require('./REVK4LZT.cjs');
var _4BP4CCPZ_cjs = require('./4BP4CCPZ.cjs');
var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
var console = require('console');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var console__namespace = /*#__PURE__*/_interopNamespace(console);

// src/core/version-resolver.ts
KHVGLVR5_cjs.init_cjs_shims();
var resolveTypeVersions = /* @__PURE__ */ KHVGLVR5_cjs.__name((context, userVersions) => {
  const versions = {};
  for (const tool of context.tools) {
    const defaultVersion = _4BP4CCPZ_cjs.getToolDefaultVersion(context, tool.name);
    const version = userVersions[tool.name] || defaultVersion;
    if (!version) {
      continue;
    }
    versions[tool.name] = version;
    if (version === defaultVersion) {
      continue;
    }
    const supportedVersions = _4BP4CCPZ_cjs.getToolSupportedVersions(context, tool.name);
    if (!supportedVersions.includes(version)) {
      console__namespace.warn(`\u26A0\uFE0F  Version ${version} for ${tool.name} is not in the supported list.`);
      console__namespace.warn(`   Supported versions: ${supportedVersions.join(", ")}`);
      console__namespace.warn(`   Continuing with Docker availability as final validation...`);
    }
  }
  const combination = context.versionCombinations.find((combination2) => Object.entries(_4BP4CCPZ_cjs.findToolVersionsForCombination(context, combination2)).every(([tool, version]) => versions[tool] === version));
  if (!combination) {
    throw new Error("Compatible combination of tool versions not found");
  }
  console__namespace.info(`\u2705 ${REVK4LZT_cjs.getCombinationId(context, combination)} ${combination.description ? `(${combination.description})` : ""}`);
  return versions;
}, "resolveTypeVersions");

exports.resolveTypeVersions = resolveTypeVersions;
//# sourceMappingURL=WFBRUQAF.cjs.map
//# sourceMappingURL=WFBRUQAF.cjs.map