var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
  ProHelpPopover: () => ProHelpPopover,
  proHelpPopoverProps: () => proHelpPopoverProps
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_pro_provider = require("@antdv/pro-provider");
var import_pro_utils = require("@antdv/pro-utils");
var import_ant_design_vue = require("ant-design-vue");
var import_popover = require("ant-design-vue/es/popover");
var import_context = require("ant-design-vue/lib/config-provider/context");
var import_vue2 = require("vue");
var import_ProHelpContentPanel = require("./ProHelpContentPanel");
var import_style = require("./style");
const proHelpPopoverProps = __spreadProps(__spreadValues({}, (0, import_pro_utils.omit)((0, import_popover.popoverProps)(), ["content"])), {
  /**
   * 悬浮提示文字的 CSS 类名
   */
  textClassName: (0, import_pro_utils.stringType)(),
  /**
   * Popover 内容的 content 的 CSS 类名
   */
  popoverContextClassName: (0, import_pro_utils.stringType)(),
  /**
   * 悬浮提示文字的 CSS 样式对象
   */
  textStyle: (0, import_pro_utils.objectType)(),
  /**
   * 当前选中的帮助文档的 key 值
   */
  selectedKey: (0, import_pro_utils.stringType)().isRequired,
  /**
   * 可选的悬浮提示 Popover 组件的 Props，用于自定义悬浮提示的样式和行为。
   * 该属性可以传递 Ant Design Popover 组件的 props，如位置、大小、触发方式等等
   * @see 注意，content 属性已经被从 PopoverProps 中删除，因为这个属性由 ProHelpPopover 内部控制。
   */
  popoverProps: (0, import_pro_utils.objectType)()
});
const ProHelpPopover = (0, import_vue2.defineComponent)({
  name: "ProHelpPopover",
  props: proHelpPopoverProps,
  setup(props, {
    slots
  }) {
    const {
      getPrefixCls
    } = (0, import_context.useConfigContextInject)();
    const className = (0, import_vue2.computed)(() => getPrefixCls("pro-help"));
    const {
      hashId
    } = import_pro_provider.ProProvider.useContext();
    const {
      wrapSSR
    } = (0, import_style.useStyle)(className);
    return () => {
      return wrapSSR((0, import_vue.createVNode)(import_ant_design_vue.Popover, (0, import_vue.mergeProps)({
        "overlayInnerStyle": {
          padding: 0
        },
        "content": (0, import_vue.createVNode)("div", {
          "class": (0, import_pro_utils.classNames)(`${className.value}-popover-content`, hashId, props.popoverContextClassName)
        }, [(0, import_vue.createVNode)(import_ProHelpContentPanel.ProHelpContentPanel, {
          "selectedKey": props.selectedKey
        }, null)])
      }, props.popoverProps), {
        default: () => {
          var _a;
          return [(0, import_vue.createVNode)("span", {
            "class": (0, import_pro_utils.classNames)(`${className.value}-popover-text`, hashId, props.textClassName)
          }, [props.children || ((_a = slots.default) == null ? void 0 : _a.call(slots))])];
        }
      }));
    };
  }
});
