import { presetPrimaryColors as p } from "../../../@ant-design/colors/es/index.mjs";
function i(e) {
  return !e || e < 0 ? 0 : e > 100 ? 100 : e;
}
function g(e) {
  let {
    success: t,
    successPercent: n
  } = e, r = n;
  return t && "progress" in t && (r = t.progress), t && "percent" in t && (r = t.percent), r;
}
const v = (e) => {
  let {
    percent: t,
    success: n,
    successPercent: r
  } = e;
  const c = i(g({
    success: n,
    successPercent: r
  }));
  return [c, i(i(t) - c)];
}, h = (e) => {
  let {
    success: t = {},
    strokeColor: n
  } = e;
  const {
    strokeColor: r
  } = t;
  return [r || p.green, n || null];
}, a = (e, t, n) => {
  var r, c, s, u;
  let o = -1, l = -1;
  if (t === "step") {
    const f = n.steps, d = n.strokeWidth;
    typeof e == "string" || typeof e > "u" ? (o = e === "small" ? 2 : 14, l = d ?? 8) : typeof e == "number" ? [o, l] = [e, e] : [o = 14, l = 8] = e, o *= f;
  } else if (t === "line") {
    const f = n == null ? void 0 : n.strokeWidth;
    typeof e == "string" || typeof e > "u" ? l = f || (e === "small" ? 6 : 8) : typeof e == "number" ? [o, l] = [e, e] : [o = -1, l = 8] = e;
  } else
    (t === "circle" || t === "dashboard") && (typeof e == "string" || typeof e > "u" ? [o, l] = e === "small" ? [60, 60] : [120, 120] : typeof e == "number" ? [o, l] = [e, e] : (o = (c = (r = e[0]) !== null && r !== void 0 ? r : e[1]) !== null && c !== void 0 ? c : 120, l = (u = (s = e[0]) !== null && s !== void 0 ? s : e[1]) !== null && u !== void 0 ? u : 120));
  return [o, l];
};
export {
  v as getPercentage,
  a as getSize,
  h as getStrokeColor,
  g as getSuccessPercent,
  i as validProgress
};
