import React from "react";
import { Layer } from "react-map-gl/maplibre";
import { buildCircleStickToDistanceExpression } from "./functions/build-stick-to-distance-expressions.js";
import { useSizeInterpolation } from "./hooks/use-size-interpolation.js";
import {
  BUBBLE_DEFAULT_OPACITY,
  BUBBLE_STROKE,
  DEFAULT_RADIUS_EXPRESSION,
  LEGEND_DIM_OPACITY,
  SHAPE_OPACITY
} from "../../constants.js";
const BubbleCircleLayer = ({
  id,
  source
}) => {
  const sizeInterpolation = useSizeInterpolation();
  const radiusExpression = sizeInterpolation === "fixed" ? DEFAULT_RADIUS_EXPRESSION : buildCircleStickToDistanceExpression();
  return /* @__PURE__ */ React.createElement(
    Layer,
    {
      type: "circle",
      id,
      source,
      paint: {
        "circle-color": [
          "case",
          ["boolean", ["feature-state", "hover"], false],
          ["get", "__hoveredColor"],
          ["get", "__color"]
        ],
        "circle-radius": radiusExpression,
        "circle-opacity": [
          "case",
          ["boolean", ["feature-state", "legendHover"], true],
          BUBBLE_DEFAULT_OPACITY,
          LEGEND_DIM_OPACITY
        ],
        "circle-stroke-width": BUBBLE_STROKE,
        "circle-stroke-color": [
          "case",
          ["boolean", ["feature-state", "hover"], false],
          ["get", "__hoveredColor"],
          ["get", "__color"]
        ],
        "circle-stroke-opacity": [
          "case",
          ["boolean", ["feature-state", "legendHover"], true],
          SHAPE_OPACITY,
          LEGEND_DIM_OPACITY
        ]
      }
    }
  );
};
export {
  BubbleCircleLayer
};
//# sourceMappingURL=BubbleCircleLayer.js.map
