const f = (r, e) => {
  if (e <= 0)
    return "";
  if (r.length <= e)
    return r;
  const t = Math.floor(e / 2), o = e - t;
  return e === 1 ? `${r.slice(0, 1)}...` : `${r.slice(0, t)}...${r.slice(-o)}`;
}, l = (r, e) => {
  if (typeof e == "number")
    return f(r, e);
  if (e.mode === "auto") {
    const { totalVisible: s } = e;
    return f(r, s);
  }
  const { leftVisible: t, rightVisible: o } = e;
  if (t <= 0 && o <= 0)
    return "";
  if (r.length <= t + o)
    return r;
  const c = Math.floor(t), n = Math.floor(o);
  return t + o === 1 ? `${r.slice(0, 1)}...` : `${r.slice(0, c)}...${r.slice(-n)}`;
};
export {
  l as formatAddressTruncate
};
//# sourceMappingURL=formatAddressTruncate.js.map
