import { defineComponent, ref, watch, openBlock, createElementBlock, unref, withDirectives, createVNode, vShow } from "vue";
import MemberInfo from "../MemberItemCommon/MemberInfo.vue.mjs";
import MemberControl from "../MemberControl/index.mjs";
import MemberInvite from "../MemberInvite/MemberInvite.vue.mjs";
import useMemberItem from "./useMemberItemHooks.mjs";
import { USERS_STATUS } from "../../../constants/room.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "indexPC",
  props: {
    userInfo: {},
    userCurrentStatus: {}
  },
  setup(__props) {
    const props = __props;
    const { isMemberControlAccessible, openMemberControl, closeMemberControl } = useMemberItem(props.userInfo);
    const showMemberControl = ref(false);
    watch(isMemberControlAccessible, (accessible) => {
      showMemberControl.value = accessible;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "member-item-container",
        onMouseenter: _cache[0] || (_cache[0] = //@ts-ignore
        (...args) => unref(openMemberControl) && unref(openMemberControl)(...args)),
        onMouseleave: _cache[1] || (_cache[1] = //@ts-ignore
        (...args) => unref(closeMemberControl) && unref(closeMemberControl)(...args))
      }, [
        withDirectives(createVNode(MemberInfo, {
          "user-info": props.userInfo,
          "show-state-icon": !showMemberControl.value
        }, null, 8, ["user-info", "show-state-icon"]), [
          [vShow, props.userCurrentStatus !== unref(USERS_STATUS).NOT_ENTER]
        ]),
        withDirectives(createVNode(unref(MemberControl), {
          "show-member-control": showMemberControl.value,
          "user-info": props.userInfo
        }, null, 8, ["show-member-control", "user-info"]), [
          [
            vShow,
            showMemberControl.value && props.userCurrentStatus !== unref(USERS_STATUS).NOT_ENTER
          ]
        ]),
        withDirectives(createVNode(MemberInvite, {
          "user-info": props.userInfo
        }, null, 8, ["user-info"]), [
          [vShow, props.userCurrentStatus === unref(USERS_STATUS).NOT_ENTER]
        ])
      ], 32);
    };
  }
});
export {
  _sfc_main as default
};
