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/pisellPercent/utils/rangeConverter.ts
var rangeConverter_exports = {};
__export(rangeConverter_exports, {
  convertFromPercent: () => convertFromPercent,
  convertToPercent: () => convertToPercent
});
module.exports = __toCommonJS(rangeConverter_exports);
function convertToPercent(value, range) {
  if (value === null || value === void 0) {
    return null;
  }
  const [min, max] = range;
  if (min === 0 && max === 100) {
    return value;
  }
  if (min === 0 && max === 1) {
    return value * 100;
  }
  if (max !== 0) {
    return value / max * 100;
  }
  return value;
}
function convertFromPercent(percent, range) {
  if (percent === null || percent === void 0) {
    return null;
  }
  const [min, max] = range;
  if (min === 0 && max === 100) {
    return percent;
  }
  if (min === 0 && max === 1) {
    return percent / 100;
  }
  return percent / 100 * max;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  convertFromPercent,
  convertToPercent
});
