import k from "../../../@babel/runtime/helpers/esm/extends.mjs";
import m from "../../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import v from "../../../@babel/runtime/helpers/esm/defineProperty.mjs";
import D from "../../../@babel/runtime/helpers/esm/objectWithoutProperties.mjs";
import { useContext as O } from "../../../@rc-component/context/es/context.mjs";
import * as n from "react";
import "../../../rc-util/node_modules/react-is/index.mjs";
import u from "../../../classnames/index.mjs";
import T from "../Cell/index.mjs";
import q, { responseImmutable as z } from "../context/TableContext.mjs";
import A from "../hooks/useRowInfo.mjs";
import F from "./VirtualCell.mjs";
var G = ["data", "index", "className", "rowKey", "style", "extra", "getHeight"], J = /* @__PURE__ */ n.forwardRef(function(e, w) {
  var s = e.data, i = e.index, _ = e.className, I = e.rowKey, b = e.style, c = e.extra, P = e.getHeight, H = D(e, G), l = s.record, a = s.indent, S = s.index, d = O(q, ["prefixCls", "flattenColumns", "fixColumn", "componentWidth", "scrollX"]), W = d.scrollX, B = d.flattenColumns, r = d.prefixCls, y = d.fixColumn, K = d.componentWidth, t = A(l, I, i, a), p = t.rowSupportExpand, C = t.expanded, o = t.rowProps, L = t.expandedRowRender, x = t.expandedRowClassName, N;
  if (p && C) {
    var X = L(l, i, a + 1, C), j = x == null ? void 0 : x(l, i, a), R = {};
    y && (R = {
      style: v({}, "--virtual-width", "".concat(K, "px"))
    });
    var h = "".concat(r, "-expanded-row-cell");
    N = /* @__PURE__ */ n.createElement("div", {
      className: u("".concat(r, "-expanded-row"), "".concat(r, "-expanded-row-level-").concat(a + 1), j)
    }, /* @__PURE__ */ n.createElement(T, {
      component: "div",
      prefixCls: r,
      className: u(h, v({}, "".concat(h, "-fixed"), y)),
      additionalProps: R
    }, X));
  }
  var f = m(m({}, b), {}, {
    width: W
  });
  c && (f.position = "absolute", f.pointerEvents = "none");
  var E = /* @__PURE__ */ n.createElement("div", k({}, o, H, {
    ref: p ? null : w,
    className: u(_, "".concat(r, "-row"), o == null ? void 0 : o.className, v({}, "".concat(r, "-row-extra"), c)),
    style: m(m({}, f), o == null ? void 0 : o.style)
  }), B.map(function(V, g) {
    return /* @__PURE__ */ n.createElement(F, {
      key: g,
      rowInfo: t,
      column: V,
      colIndex: g,
      indent: a,
      index: i,
      renderIndex: S,
      record: l,
      inverse: c,
      getHeight: P
    });
  }));
  return p ? /* @__PURE__ */ n.createElement("div", {
    ref: w
  }, E, N) : E;
}), M = z(J);
process.env.NODE_ENV !== "production" && (M.displayName = "BodyLine");
export {
  M as default
};
