import { jsx as e, jsxs as K } from "react/jsx-runtime";
import { LineChart as N, CartesianGrid as y, XAxis as z, YAxis as S, Line as T, LabelList as $ } from "recharts";
import { ChartContainer as w, ChartTooltip as G, ChartTooltipContent as I, ChartLegend as W, ChartLegendContent as X } from "../ChartPrimitive.js";
const Y = ({
  id: c,
  chartConfig: a,
  data: h,
  grid: C = !0,
  xAxisOptions: n,
  yAxisOptions: i,
  gridHorizontal: L,
  gridVertical: m = !1,
  displayFields: r,
  lineType: d = "natural",
  showLegend: u = !1,
  height: s = 300,
  tooltipContent: b,
  dot: p = !1,
  activeDot: g,
  showLabel: k,
  customLineLabel: o,
  hideLegendIcon: x = !1
}) => {
  const l = Object.keys(a), j = r ? l.filter((t) => r == null ? void 0 : r.includes(t)) : l;
  return /* @__PURE__ */ e(
    w,
    {
      id: c,
      config: a,
      className: "w-full",
      ...s && {
        style: { height: s }
      },
      children: /* @__PURE__ */ K(
        N,
        {
          accessibilityLayer: !0,
          data: h,
          margin: {
            top: 24,
            left: 24,
            right: 24
          },
          children: [
            C && /* @__PURE__ */ e(y, { opacity: 0.8, stroke: "var(--base-border)", vertical: m, horizontal: L }),
            n && /* @__PURE__ */ e(z, { tickLine: !1, axisLine: !1, ...n }),
            i && /* @__PURE__ */ e(S, { tickLine: !1, axisLine: !1, ...i }),
            /* @__PURE__ */ e(G, { cursor: !1, content: /* @__PURE__ */ e(I, { hideLabel: !0, ...b }) }),
            j.map((t) => /* @__PURE__ */ e(T, { dataKey: t, type: d, stroke: `var(--color-${t})`, strokeWidth: 2, dot: p, activeDot: g, children: (k || o) && /* @__PURE__ */ e(
              $,
              {
                position: "top",
                offset: 12,
                className: "fill-[--base-foreground]",
                fontSize: 12,
                ...o && {
                  dataKey: o.dataKey,
                  formatter: (v) => {
                    var f;
                    return (f = a[String(v)]) == null ? void 0 : f.label;
                  }
                }
              }
            ) }, t)),
            u && /* @__PURE__ */ e(W, { content: /* @__PURE__ */ e(X, { hideIcon: x }) })
          ]
        }
      )
    }
  );
};
Y.displayName = "LineChart";
export {
  Y as default
};
//# sourceMappingURL=LineChart.js.map
