import { jsxs as h, jsx as n } from "react/jsx-runtime";
import x from "../../utils/classNames.js";
const u = (e) => Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0, g = (e) => {
  const {
    text: s,
    suffixLength: i = 6,
    className: r = "",
    startClassName: l = "",
    endClassName: c = "",
    title: m,
    ...o
  } = e, t = u(i), a = t > 0 && s.length > t, f = a ? s.slice(0, -t) : s, d = a ? s.slice(-t) : "";
  return /* @__PURE__ */ h("span", { ...o, className: x("ellipsis-middle", r), title: m ?? s, children: [
    /* @__PURE__ */ n("span", { className: l, children: f }),
    /* @__PURE__ */ n("span", { className: c, children: d })
  ] });
};
export {
  g as default
};
//# sourceMappingURL=TextTruncateMiddle.js.map
