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