import { jsx as o, jsxs as R } from "react/jsx-runtime";
import { createElement as l } from "react";
import { ResponsiveContainer as X, ComposedChart as Y, CartesianGrid as E, XAxis as H, YAxis as K, Legend as T, Area as U, Bar as $, Line as q, Brush as z } from "recharts";
import { isObject as f } from "es-toolkit/compat";
import { mapGridOptions as F, getColor as s } from "./chartHelper.js";
import I from "./ChartTooltip.js";
import { getLegendDefaultProps as J } from "./Legend.js";
import { renderAxis as M } from "./XAxis.js";
import { getBarDefaultProps as N } from "./Bar.js";
import { renderReferenceLine as Q } from "./ReferenceLine.js";
import { getLineDefaultProps as S } from "./Line.js";
import { getAreaDefaultProps as V } from "./Area.js";
const lr = (d) => {
  const {
    width: h,
    height: c,
    data: g = [],
    dataUnit: m = "",
    dataKey: u = "value",
    lines: C = [],
    bars: P = [],
    areas: x = [],
    referenceLines: k = [],
    xAxisOptions: A,
    yAxisOptions: y,
    additionalAxes: D = [],
    gridOptions: L,
    containerOptions: O,
    showXAxis: w = !0,
    showYAxis: b = !1,
    showGrid: B = !1,
    legend: n,
    brush: W = !1,
    tooltip: a = !0,
    ...j
  } = d, G = f(a) ? a.props : {}, v = f(n) ? { ...J(), ...n.props } : {};
  return /* @__PURE__ */ o(
    X,
    {
      minHeight: 100,
      minWidth: 100,
      initialDimension: { width: 100, height: 100 },
      ...O,
      children: /* @__PURE__ */ R(
        Y,
        {
          width: h,
          height: c,
          data: g,
          margin: { top: 15, right: 15, left: 15, bottom: 15 },
          ...j,
          children: [
            B && /* @__PURE__ */ o(E, { strokeDasharray: "3 3", ...F(L) }),
            /* @__PURE__ */ o(H, { hide: !w, dataKey: u, ...A }),
            /* @__PURE__ */ o(K, { hide: !b, unit: m, ...y }),
            D.map(M),
            a && /* @__PURE__ */ o(I, { ...G }),
            n && /* @__PURE__ */ o(T, { ...v }),
            x.map((r) => {
              const t = { ...V(), ...r.props }, { strokeColor: e, fill: i, ...p } = t;
              return /* @__PURE__ */ l(
                U,
                {
                  ...p,
                  key: r.key,
                  stroke: s(e),
                  fill: s(i)
                }
              );
            }),
            P.map((r) => {
              const t = { ...N(), ...r.props }, { color: e, ...i } = t, p = e && s(e);
              return /* @__PURE__ */ o($, { unit: m, ...i, fill: p }, r.key);
            }),
            C.map((r) => {
              const t = { ...S(), ...r.props }, { strokeColor: e, ...i } = t;
              return /* @__PURE__ */ l(
                q,
                {
                  ...i,
                  key: r.key,
                  stroke: s(e)
                }
              );
            }),
            k.map(Q),
            W && /* @__PURE__ */ o(z, { stroke: s("gray") })
          ]
        }
      )
    }
  );
};
export {
  lr as default
};
//# sourceMappingURL=ComposedChart.js.map
