import { existsSync, readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
function resolveVersion() {
  if (typeof MAPX_BUILD_VERSION !== "undefined") {
    return MAPX_BUILD_VERSION;
  }
  const base = dirname(fileURLToPath(import.meta.url));
  for (const candidate of [
    join(base, "VERSION"),
    join(base, "..", "VERSION"),
    join(base, "..", "..", "VERSION")
  ]) {
    if (existsSync(candidate)) {
      return readFileSync(candidate, "utf-8").trim();
    }
  }
  return "0.0.0";
}
const VERSION = resolveVersion();
export {
  VERSION
};
