import { jsx as e } from "react/jsx-runtime";
import L from "react";
import { union as g, isEmpty as v, map as M } from "es-toolkit/compat";
import { noop as f } from "es-toolkit/function";
import d from "../MapSettingsPanel.js";
import I from "../MapSettingsTile.js";
import { MapIcon as c } from "../../../../icons/MapIcon.js";
const A = (s) => {
  const {
    activeBuiltinLayers: o = [],
    activeLayers: p = [],
    layers: t = [],
    onMapLayerChange: m = f,
    ...l
  } = s, y = g(o, p), r = !!t.at(0)?.props.label, a = !v(y), n = M(
    t,
    (i) => L.cloneElement(i, {
      key: i?.key ?? `MapLayerSettings_${crypto.randomUUID()}`,
      activeBuiltinLayers: o,
      onMapLayerChange: m
    })
  );
  return /* @__PURE__ */ e(
    I,
    {
      className: "MapLayerSettings",
      isActive: a,
      activeIcon: a ? /* @__PURE__ */ e(c, { name: "rioglyph-construction text-color-primary", className: "MapLayerIcon" }) : void 0,
      inactiveIcon: a ? void 0 : /* @__PURE__ */ e(c, { name: "rioglyph-construction text-color-gray", className: "MapLayerIconInactive" }),
      items: r ? n : void 0,
      panel: !r && /* @__PURE__ */ e(d, { children: n }),
      ...l
    }
  );
};
export {
  A as default
};
//# sourceMappingURL=MapLayerSettings.js.map
