import { defineComponent, computed, unref, openBlock, createElementBlock, createVNode, createCommentVNode } from "vue";
import { storeToRefs } from "pinia";
import IconButton from "../common/base/IconButton.vue.mjs";
import ManageMemberIcon from "../common/icons/ManageMemberIcon.vue.mjs";
import { useBasicStore } from "../../stores/basic.mjs";
import { useRoomStore } from "../../stores/room.mjs";
import { useI18n } from "../../locales/index.mjs";
import "../../services/main.mjs";
import { roomService } from "../../services/roomService.mjs";
import "@tencentcloud/tuiroom-engine-js";
import "mitt";
import "../../services/manager/roomActionManager.mjs";
import "@tencentcloud/tui-core";
const _hoisted_1 = {
  key: 0,
  class: "manage-member-control-container"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ManageMemberControl",
  setup(__props) {
    const manageMemberControlConfig = roomService.getComponentConfig(
      "ManageMemberControl"
    );
    const { t } = useI18n();
    const basicStore = useBasicStore();
    const { sidebarName } = storeToRefs(basicStore);
    const roomStore = useRoomStore();
    const { userNumber } = storeToRefs(roomStore);
    const memberTitle = computed(() => `${t("Members")}(${userNumber.value})`);
    function toggleMangeMemberSidebar() {
      if (basicStore.setSidebarOpenStatus && sidebarName.value === "manage-member") {
        basicStore.setSidebarOpenStatus(false);
        basicStore.setSidebarName("");
        return;
      }
      basicStore.setSidebarOpenStatus(true);
      basicStore.setSidebarName("manage-member");
    }
    return (_ctx, _cache) => {
      return unref(manageMemberControlConfig).visible ? (openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(IconButton, {
          "is-active": unref(sidebarName) === "manage-member",
          title: memberTitle.value,
          icon: ManageMemberIcon,
          onClickIcon: toggleMangeMemberSidebar
        }, null, 8, ["is-active", "title"])
      ])) : createCommentVNode("", true);
    };
  }
});
export {
  _sfc_main as default
};
