import { jsx as a, jsxs as l, Fragment as S } from "react/jsx-runtime";
import c from "../../utils/classNames.js";
import { markerColorMapping as j } from "../map/utils/mapTypes.js";
const B = 60, E = (s) => {
  const { moving: o, bearing: r, stateIconName: e } = s;
  if (!o && !e)
    return null;
  const i = c("rioglyph", `rioglyph-${e || "direction"}`), n = e ? {} : { transform: `rotate(${r}deg)` };
  return /* @__PURE__ */ a("div", { className: `rio-map-icon rio-map-marker-state ${e ? "" : "rio-map-direction"}`, children: /* @__PURE__ */ a("span", { className: i, style: n }) });
}, F = (s = []) => s.map((o, r) => /* @__PURE__ */ a("div", { className: "rio-map-icon", children: /* @__PURE__ */ a("span", { className: `rioglyph rioglyph-${o}` }) }, `rio-map-icon-${o}-${r}`)), G = (s) => {
  const {
    bearing: o = B,
    name: r,
    warningCount: e = 0,
    exceptionCount: i = 0,
    active: n = !1,
    clickable: N = !0,
    fixed: v = !1,
    moving: t = !1,
    pinging: b = !1,
    anchorIconName: m,
    stateIconName: f,
    iconNames: p,
    markerColor: g = "bg-map-marker-asset",
    textColor: k,
    anchorSize: u,
    markerOnHover: y = !1,
    anchorOnly: C = !r && !p,
    cursor: d = "cursor-pointer",
    className: x,
    style: $
  } = s, h = u === "lg", I = c(
    n && "active",
    "rio-map-marker",
    "rio-map-marker-bottom-center",
    !N && "not-clickable",
    x
  ), M = c("rio-map-anchor", h ? "rio-map-anchor-lg" : "", d), w = c(
    "rio-map-single",
    v && "fixed",
    t && "moving",
    k,
    y && "visible-on-hover",
    n && "active",
    b && "pinging",
    typeof r == "string" && r.length === 1 && "single-letter",
    d
  ), A = `var(${j[g]})`;
  return /* @__PURE__ */ a(
    "div",
    {
      className: I,
      style: { ...$, color: A },
      "data-marker-type": g.replace("bg-", "single-"),
      children: /* @__PURE__ */ l("div", { className: "rio-map-marker-translate", children: [
        !C && /* @__PURE__ */ l(S, { children: [
          /* @__PURE__ */ l("div", { className: w, children: [
            /* @__PURE__ */ a(E, { moving: t, bearing: o, stateIconName: f }),
            F(p),
            r && /* @__PURE__ */ a("div", { className: "rio-map-name", children: r }),
            i > 0 && /* @__PURE__ */ a("div", { className: "rio-map-bubble exception", children: i }),
            e > 0 && /* @__PURE__ */ a("div", { className: "rio-map-bubble warning", children: e })
          ] }),
          /* @__PURE__ */ a("div", { className: "rio-map-anchor-arrow" })
        ] }),
        /* @__PURE__ */ a("div", { className: M, children: m && h && /* @__PURE__ */ a("span", { className: `rioglyph rioglyph-${m}` }) })
      ] })
    }
  );
};
export {
  G as default
};
//# sourceMappingURL=SingleMapMarker.js.map
