var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/appVersionControl/utils.ts
var utils_exports = {};
__export(utils_exports, {
  compareVersions: () => compareVersions,
  getMaxVersion: () => getMaxVersion
});
module.exports = __toCommonJS(utils_exports);
var compareVersions = (version1, version2) => {
  const v1Parts = version1.split(".").map(Number);
  const v2Parts = version2.split(".").map(Number);
  for (let i = 0; i < Math.max(v1Parts.length, v2Parts.length); i++) {
    const v1Part = v1Parts[i] || 0;
    const v2Part = v2Parts[i] || 0;
    if (v1Part > v2Part)
      return 1;
    if (v1Part < v2Part)
      return -1;
  }
  return 0;
};
var getMaxVersion = (versions) => {
  if (!versions || versions.length === 0)
    return void 0;
  return versions.reduce((max, current) => {
    if (!max)
      return current;
    return compareVersions(current, max) > 0 ? current : max;
  }, versions[0]);
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  compareVersions,
  getMaxVersion
});
