"use client";
import * as h from "react";
import { clsx as j } from "../../../clsx/dist/clsx.js";
import { filterProps as d } from "../util/ReactUtils.js";
import { upperFirst as p } from "../util/DataUtils.js";
import w from "../../../d3-shape/src/symbol.js";
import S from "../../../d3-shape/src/symbol/wye.js";
import M from "../../../d3-shape/src/symbol/triangle.js";
import x from "../../../d3-shape/src/symbol/star.js";
import _ from "../../../d3-shape/src/symbol/square.js";
import D from "../../../d3-shape/src/symbol/diamond.js";
import q from "../../../d3-shape/src/symbol/cross.js";
import y from "../../../d3-shape/src/symbol/circle.js";
var E = ["type", "size", "sizeType"];
function u() {
  return u = Object.assign ? Object.assign.bind() : function(r) {
    for (var t = 1; t < arguments.length; t++) {
      var e = arguments[t];
      for (var o in e) ({}).hasOwnProperty.call(e, o) && (r[o] = e[o]);
    }
    return r;
  }, u.apply(null, arguments);
}
function l(r, t) {
  var e = Object.keys(r);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(r);
    t && (o = o.filter(function(a) {
      return Object.getOwnPropertyDescriptor(r, a).enumerable;
    })), e.push.apply(e, o);
  }
  return e;
}
function m(r) {
  for (var t = 1; t < arguments.length; t++) {
    var e = arguments[t] != null ? arguments[t] : {};
    t % 2 ? l(Object(e), !0).forEach(function(o) {
      T(r, o, e[o]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(e)) : l(Object(e)).forEach(function(o) {
      Object.defineProperty(r, o, Object.getOwnPropertyDescriptor(e, o));
    });
  }
  return r;
}
function T(r, t, e) {
  return (t = F(t)) in r ? Object.defineProperty(r, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = e, r;
}
function F(r) {
  var t = I(r, "string");
  return typeof t == "symbol" ? t : t + "";
}
function I(r, t) {
  if (typeof r != "object" || !r) return r;
  var e = r[Symbol.toPrimitive];
  if (e !== void 0) {
    var o = e.call(r, t);
    if (typeof o != "object") return o;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(r);
}
function N(r, t) {
  if (r == null) return {};
  var e, o, a = A(r, t);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(r);
    for (o = 0; o < n.length; o++) e = n[o], t.indexOf(e) === -1 && {}.propertyIsEnumerable.call(r, e) && (a[e] = r[e]);
  }
  return a;
}
function A(r, t) {
  if (r == null) return {};
  var e = {};
  for (var o in r) if ({}.hasOwnProperty.call(r, o)) {
    if (t.indexOf(o) !== -1) continue;
    e[o] = r[o];
  }
  return e;
}
var f = {
  symbolCircle: y,
  symbolCross: q,
  symbolDiamond: D,
  symbolSquare: _,
  symbolStar: x,
  symbolTriangle: M,
  symbolWye: S
}, W = Math.PI / 180, C = (r) => {
  var t = "symbol".concat(p(r));
  return f[t] || y;
}, K = (r, t, e) => {
  if (t === "area")
    return r;
  switch (e) {
    case "cross":
      return 5 * r * r / 9;
    case "diamond":
      return 0.5 * r * r / Math.sqrt(3);
    case "square":
      return r * r;
    case "star": {
      var o = 18 * W;
      return 1.25 * r * r * (Math.tan(o) - Math.tan(o * 2) * Math.tan(o) ** 2);
    }
    case "triangle":
      return Math.sqrt(3) * r * r / 4;
    case "wye":
      return (21 - 10 * Math.sqrt(3)) * r * r / 8;
    default:
      return Math.PI * r * r / 4;
  }
}, R = (r, t) => {
  f["symbol".concat(p(r))] = t;
}, k = (r) => {
  var {
    type: t = "circle",
    size: e = 64,
    sizeType: o = "area"
  } = r, a = N(r, E), n = m(m({}, a), {}, {
    type: t,
    size: e,
    sizeType: o
  }), i = "circle";
  typeof t == "string" && (i = t);
  var b = () => {
    var O = C(i), P = w().type(O).size(K(e, o, i));
    return P();
  }, {
    className: v,
    cx: c,
    cy: s
  } = n, g = d(n, !0);
  return c === +c && s === +s && e === +e ? /* @__PURE__ */ h.createElement("path", u({}, g, {
    className: j("recharts-symbols", v),
    transform: "translate(".concat(c, ", ").concat(s, ")"),
    d: b()
  })) : null;
};
k.registerSymbol = R;
export {
  k as Symbols
};
