"use strict";
/* Socket Lib - Built with esbuild */
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);
var versions_exports = {};
__export(versions_exports, {
  coerceVersion: () => coerceVersion,
  compareVersions: () => compareVersions,
  filterVersions: () => filterVersions,
  getMajorVersion: () => getMajorVersion,
  getMinorVersion: () => getMinorVersion,
  getPatchVersion: () => getPatchVersion,
  incrementVersion: () => incrementVersion,
  isEqual: () => isEqual,
  isGreaterThan: () => isGreaterThan,
  isGreaterThanOrEqual: () => isGreaterThanOrEqual,
  isLessThan: () => isLessThan,
  isLessThanOrEqual: () => isLessThanOrEqual,
  isValidVersion: () => isValidVersion,
  maxVersion: () => maxVersion,
  minVersion: () => minVersion,
  parseVersion: () => parseVersion,
  satisfiesVersion: () => satisfiesVersion,
  sortVersions: () => sortVersions,
  sortVersionsDesc: () => sortVersionsDesc,
  versionDiff: () => versionDiff
});
module.exports = __toCommonJS(versions_exports);
let _semver;
// @__NO_SIDE_EFFECTS__
function getSemver() {
  if (_semver === void 0) {
    _semver = require("./external/semver");
  }
  return _semver;
}
function coerceVersion(version) {
  const coerced = (/* @__PURE__ */ getSemver()).coerce(version);
  return coerced?.version;
}
function compareVersions(v1, v2) {
  try {
    return (/* @__PURE__ */ getSemver()).compare(v1, v2);
  } catch {
    return void 0;
  }
}
function filterVersions(versions, range) {
  return versions.filter((v) => (/* @__PURE__ */ getSemver()).satisfies(v, range));
}
function getMajorVersion(version) {
  const parsed = (/* @__PURE__ */ getSemver()).parse(version);
  return parsed?.major;
}
function getMinorVersion(version) {
  const parsed = (/* @__PURE__ */ getSemver()).parse(version);
  return parsed?.minor;
}
function getPatchVersion(version) {
  const parsed = (/* @__PURE__ */ getSemver()).parse(version);
  return parsed?.patch;
}
function incrementVersion(version, release, identifier) {
  return (/* @__PURE__ */ getSemver()).inc(version, release, identifier) || void 0;
}
function isEqual(version1, version2) {
  return (/* @__PURE__ */ getSemver()).eq(version1, version2);
}
function isGreaterThan(version1, version2) {
  return (/* @__PURE__ */ getSemver()).gt(version1, version2);
}
function isGreaterThanOrEqual(version1, version2) {
  return (/* @__PURE__ */ getSemver()).gte(version1, version2);
}
function isLessThan(version1, version2) {
  return (/* @__PURE__ */ getSemver()).lt(version1, version2);
}
function isLessThanOrEqual(version1, version2) {
  return (/* @__PURE__ */ getSemver()).lte(version1, version2);
}
function isValidVersion(version) {
  return (/* @__PURE__ */ getSemver()).valid(version) !== null;
}
function maxVersion(versions) {
  return (/* @__PURE__ */ getSemver()).maxSatisfying(versions, "*") || void 0;
}
function minVersion(versions) {
  return (/* @__PURE__ */ getSemver()).minSatisfying(versions, "*") || void 0;
}
function parseVersion(version) {
  const parsed = (/* @__PURE__ */ getSemver()).parse(version);
  if (!parsed) {
    return void 0;
  }
  return {
    major: parsed.major,
    minor: parsed.minor,
    patch: parsed.patch,
    prerelease: parsed.prerelease,
    build: parsed.build
  };
}
function satisfiesVersion(version, range) {
  return (/* @__PURE__ */ getSemver()).satisfies(version, range);
}
function sortVersions(versions) {
  return (/* @__PURE__ */ getSemver()).sort([...versions]);
}
function sortVersionsDesc(versions) {
  return (/* @__PURE__ */ getSemver()).rsort([...versions]);
}
function versionDiff(version1, version2) {
  try {
    return (/* @__PURE__ */ getSemver()).diff(version1, version2) || void 0;
  } catch {
    return void 0;
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  coerceVersion,
  compareVersions,
  filterVersions,
  getMajorVersion,
  getMinorVersion,
  getPatchVersion,
  incrementVersion,
  isEqual,
  isGreaterThan,
  isGreaterThanOrEqual,
  isLessThan,
  isLessThanOrEqual,
  isValidVersion,
  maxVersion,
  minVersion,
  parseVersion,
  satisfiesVersion,
  sortVersions,
  sortVersionsDesc,
  versionDiff
});
