import { jsx as e, jsxs as p, Fragment as L } from "react/jsx-runtime";
import { noop as G } from "es-toolkit/compat";
import h from "../../utils/classNames.js";
import x from "../overlay/OverlayTrigger.js";
import E from "../tooltip/Tooltip.js";
import { TEXT_ALIGNMENT as t } from "../../values/TextAlignment.js";
import { PLACEMENT as o } from "../../values/Placement.js";
const T = (O) => {
  const {
    id: c,
    show: r = !1,
    placement: m = o.BOTTOM,
    title: l,
    content: i,
    onHide: s = G,
    children: a,
    textAlignment: N = t.LEFT,
    useInDialog: _ = !1,
    showCloseIcon: A = !0,
    className: n = "",
    width: f,
    preventOverflow: g = !0,
    popperConfig: R
  } = O, d = h(_ && "z-index-max", n && n), I = /* @__PURE__ */ e(
    E,
    {
      className: d,
      tooltipStyle: E.STYLE_ONBOARDING,
      id: c,
      onClick: s,
      width: f,
      textAlignment: N,
      allowOnTouch: !0,
      children: /* @__PURE__ */ p("div", { className: "display-flex", children: [
        /* @__PURE__ */ p("div", { className: "display-flex flex-column flex-1-1", children: [
          l && /* @__PURE__ */ e("div", { className: "tooltip-title", children: l }),
          i && /* @__PURE__ */ e("div", { className: "tooltip-content", children: i })
        ] }),
        A && /* @__PURE__ */ e("span", { className: "tooltip-close rioglyph rioglyph-remove" })
      ] })
    }
  );
  return r ? /* @__PURE__ */ e(
    x,
    {
      placement: m,
      trigger: "click",
      overlay: I,
      onToggle: s,
      show: r,
      rootClose: !1,
      popperConfig: R || {
        strategy: "fixed",
        modifiers: [
          {
            name: "preventOverflow",
            // Popper.js default is false but we enable it by default
            options: { altAxis: g }
          },
          // Use an arrow modifier, the arrow ref will be injected in OverlayTrigger with the right props
          { name: "arrow", options: {} }
        ]
      },
      children: a
    }
  ) : /* @__PURE__ */ e(L, { children: a });
};
T.AUTO_START = o.AUTO_START;
T.AUTO = o.AUTO;
T.AUTO_END = o.AUTO_END;
T.TOP_START = o.TOP_START;
T.TOP = o.TOP;
T.TOP_END = o.TOP_END;
T.BOTTOM_START = o.BOTTOM_START;
T.BOTTOM = o.BOTTOM;
T.BOTTOM_END = o.BOTTOM_END;
T.RIGHT_START = o.RIGHT_START;
T.RIGHT = o.RIGHT;
T.RIGHT_END = o.RIGHT_END;
T.LEFT_START = o.LEFT_START;
T.LEFT = o.LEFT;
T.LEFT_END = o.LEFT_END;
T.TEXT_ALIGNMENT_LEFT = t.LEFT;
T.TEXT_ALIGNMENT_CENTER = t.CENTER;
T.TEXT_ALIGNMENT_RIGHT = t.RIGHT;
export {
  T as default
};
//# sourceMappingURL=OnboardingTip.js.map
