/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { h } from "@stencil/core";
import { Angle, Point } from "@vertexvis/geometry";
import classNames from "classnames";
import { cssTransformCenterAt } from "../../lib/dom";
export const DistanceMeasurementRenderer = ({ startPt, endPt, centerPt, indicatorPt, distance, anchorLabelOffset, lineCapLength, linePointerEvents, hideStartAnchor, hideEndAnchor, onStartAnchorPointerDown, onEndAnchorPointerDown, }) => {
    const angle = startPt != null && endPt != null
        ? Angle.fromPoints(startPt, endPt)
        : undefined;
    const startLabelPt = angle != null && startPt != null && anchorLabelOffset != null
        ? Point.add(startPt, Point.polar(-anchorLabelOffset, angle))
        : undefined;
    const endLabelPt = angle != null && endPt != null && anchorLabelOffset != null
        ? Point.add(endPt, Point.polar(anchorLabelOffset, angle))
        : undefined;
    return (h("div", null, startPt != null && endPt != null && (h("vertex-viewer-measurement-line", { class: classNames('line', {
            'hide-start-line-cap': hideStartAnchor,
            'hide-end-line-cap': hideEndAnchor,
        }), start: startPt, end: endPt, capLength: lineCapLength, pointerEvents: linePointerEvents })), !hideStartAnchor && startPt != null && (h("div", { id: "start-anchor", class: "anchor anchor-start", style: { transform: cssTransformCenterAt(startPt) }, onPointerDown: onStartAnchorPointerDown }, h("slot", { name: "start-anchor" }, h("div", { class: "anchor-placeholder" })))), !hideStartAnchor && startLabelPt && (h("div", { class: "anchor-label anchor-label-start", style: { transform: cssTransformCenterAt(startLabelPt) } }, h("slot", { name: "start-label" }))), !hideEndAnchor && endPt != null && (h("div", { id: "end-anchor", class: "anchor anchor-end", style: { transform: cssTransformCenterAt(endPt) }, onPointerDown: onEndAnchorPointerDown }, h("slot", { name: "end-anchor" }, h("div", { class: "anchor-placeholder" })))), !hideEndAnchor && endLabelPt && (h("div", { class: "anchor-label anchor-label-end", style: { transform: cssTransformCenterAt(endLabelPt) } }, h("slot", { name: "end-label" }))), centerPt != null && (h("div", { id: "label", class: "distance-label", style: { transform: cssTransformCenterAt(centerPt) } }, distance)), indicatorPt != null && (h("div", { class: "indicator", style: { transform: cssTransformCenterAt(indicatorPt) } }, h("slot", { name: "indicator" }, h("div", { class: "indicator-placeholder" }))))));
};
//# sourceMappingURL=viewer-measurement-distance-components.js.map
