"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const uikitBaseComponentVue3 = require("@tencentcloud/uikit-base-component-vue3");
const room = require("tuikit-atomicx-vue3/room");
const IconButtonH5 = require("../base/IconButtonH5.vue2.js");
const PopUpArrowDown = require("../base/PopUpArrowDown.vue2.js");
const _hoisted_1 = { class: "participant-list-content" };
const _hoisted_2 = { class: "participant-list-header" };
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "index",
  setup(__props) {
    const { t } = uikitBaseComponentVue3.useUIKit();
    const { currentRoom } = room.useRoomState();
    const isPopupVisible = vue.ref(false);
    const title = vue.computed(() => {
      var _a;
      if (!currentRoom.value) {
        return t("Participant.Title");
      }
      return `${t("Participant.Title")}(${(_a = currentRoom.value) == null ? void 0 : _a.participantCount})`;
    });
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
        vue.createVNode(IconButtonH5.default, {
          title: title.value,
          onClick: _cache[0] || (_cache[0] = ($event) => isPopupVisible.value = true)
        }, {
          default: vue.withCtx(() => [
            vue.createVNode(vue.unref(uikitBaseComponentVue3.IconManageMember), { size: "24" })
          ]),
          _: 1
        }, 8, ["title"]),
        vue.createVNode(vue.unref(uikitBaseComponentVue3.TUIPopup), {
          visible: isPopupVisible.value,
          "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => isPopupVisible.value = $event),
          height: "90%"
        }, {
          default: vue.withCtx(() => [
            vue.createElementVNode("div", _hoisted_1, [
              vue.createVNode(PopUpArrowDown.default, {
                onClick: _cache[1] || (_cache[1] = ($event) => isPopupVisible.value = false)
              }),
              vue.createElementVNode("div", _hoisted_2, vue.toDisplayString(title.value), 1),
              vue.createVNode(vue.unref(room.RoomParticipantListH5))
            ])
          ]),
          _: 1
        }, 8, ["visible"])
      ], 64);
    };
  }
});
exports.default = _sfc_main;
