import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import { computed, defineComponent, Teleport, createVNode as _createVNode } from 'vue';
import { unrefElement } from '../_util/hooks/_vueuse/unrefElement';
export const borderBeamEffectProps = () => ({
  prefixCls: String,
  hostDom: {
    type: Object,
    default: null
  },
  className: String,
  style: Object
});
const supportPortalHost = hostDom => {
  const el = unrefElement(hostDom);
  return typeof HTMLElement !== 'undefined' && el instanceof HTMLElement;
};
const BorderBeamEffectElement = defineComponent({
  name: 'BorderBeamEffectElement',
  props: {
    prefixCls: String,
    className: String,
    style: Object
  },
  setup(props, {
    attrs
  }) {
    return () => {
      return _createVNode("div", _objectSpread({
        "aria-hidden": "true",
        "class": [props.prefixCls, props.className],
        "style": props.style
      }, attrs), null);
    };
  }
});
const BorderBeamEffect = defineComponent({
  name: 'BorderBeamEffect',
  inheritAttrs: false,
  props: borderBeamEffectProps(),
  setup(props) {
    const targetDom = computed(() => unrefElement(props.hostDom));
    const canPortal = computed(() => supportPortalHost(props.hostDom));
    return () => {
      const {
        prefixCls,
        className,
        style
      } = props;
      if (!targetDom.value || !canPortal.value) {
        return null;
      }
      return _createVNode(Teleport, {
        "to": targetDom.value
      }, {
        default: () => [_createVNode(BorderBeamEffectElement, {
          "prefixCls": prefixCls,
          "className": className,
          "style": style
        }, null)]
      });
    };
  }
});
export default BorderBeamEffect;