"use client";
import * as React from "react";
import { useTooltipPositionerContext } from "../positioner/TooltipPositionerContext.js";
import { popupStateMapping } from "../../utils/popupStateMapping.js";
import { useRenderElement } from "../../utils/useRenderElement.js";
import { useTooltipRootContext } from "../root/TooltipRootContext.js";
const TooltipArrow = /* @__PURE__ */ React.forwardRef(function TooltipArrow2(componentProps, forwardedRef) {
  const {
    className,
    render,
    ...elementProps
  } = componentProps;
  const store = useTooltipRootContext();
  const instantType = store.useState("instantType");
  const {
    open,
    arrowRef,
    side,
    align,
    arrowUncentered,
    arrowStyles
  } = useTooltipPositionerContext();
  const state = React.useMemo(() => ({
    open,
    side,
    align,
    uncentered: arrowUncentered,
    instant: instantType
  }), [open, side, align, arrowUncentered, instantType]);
  const element = useRenderElement("div", componentProps, {
    state,
    ref: [forwardedRef, arrowRef],
    props: [{
      style: arrowStyles,
      "aria-hidden": true
    }, elementProps],
    stateAttributesMapping: popupStateMapping
  });
  return element;
});
if (process.env.NODE_ENV !== "production") TooltipArrow.displayName = "TooltipArrow";
export {
  TooltipArrow
};
//# sourceMappingURL=TooltipArrow.js.map
