"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const ApplyStageLabelIcon = require("../../../common/icons/ApplyStageLabelIcon.vue.js");
const useMasterApplyControl = require("../../../../hooks/useMasterApplyControl.js");
const Avatar = require("../../../common/Avatar.vue.js");
const index = require("../../../common/base/Dialog/index.js");
const SvgIcon = require("../../../common/base/SvgIcon.vue.js");
const Button = require("../../../common/base/Button.vue.js");
require("../../../../services/main.js");
const roomService = require("../../../../services/roomService.js");
require("../../../../locales/index.js");
require("@tencentcloud/tuiroom-engine-js");
require("mitt");
require("../../../../services/manager/roomActionManager.js");
require("@tencentcloud/tui-core");
const _hoisted_1 = {
  key: 0,
  class: "apply-list"
};
const _hoisted_2 = { class: "apply-list-title" };
const _hoisted_3 = { class: "apply-list-name" };
const _hoisted_4 = { class: "apply-list-operate" };
const _hoisted_5 = { class: "user-info" };
const _hoisted_6 = ["title"];
const _hoisted_7 = { class: "control-container" };
const _hoisted_8 = {
  key: 1,
  class: "apply-nobody"
};
const _hoisted_9 = { class: "apply-text" };
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "MasterApplyControlPC",
  setup(__props) {
    const {
      t,
      showApplyUserList,
      hideApplyList,
      applyToAnchorUserCount,
      applyToAnchorList,
      handleAllUserApply,
      handleUserApply
    } = useMasterApplyControl.default();
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", null, [
        Vue.createVNode(Vue.unref(index.default), {
          modelValue: Vue.unref(showApplyUserList),
          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => Vue.isRef(showApplyUserList) ? showApplyUserList.value = $event : null),
          title: Vue.unref(t)("Member Onstage Application"),
          modal: true,
          "show-close": true,
          "close-on-click-modal": true,
          "before-close": Vue.unref(hideApplyList),
          width: "500px",
          "append-to-room-container": true
        }, {
          footer: Vue.withCtx(() => [
            Vue.createVNode(Button.default, {
              size: "default",
              disabled: Vue.unref(applyToAnchorUserCount) === 0,
              onClick: _cache[0] || (_cache[0] = ($event) => Vue.unref(handleAllUserApply)(true))
            }, {
              default: Vue.withCtx(() => [
                Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Agree All")), 1)
              ]),
              _: 1
            }, 8, ["disabled"]),
            Vue.createVNode(Button.default, {
              class: "cancel-button",
              size: "default",
              disabled: Vue.unref(applyToAnchorUserCount) === 0,
              onClick: _cache[1] || (_cache[1] = ($event) => Vue.unref(handleAllUserApply)(false))
            }, {
              default: Vue.withCtx(() => [
                Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Reject All")), 1)
              ]),
              _: 1
            }, 8, ["disabled"])
          ]),
          default: Vue.withCtx(() => [
            Vue.unref(applyToAnchorUserCount) ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
              Vue.createElementVNode("div", _hoisted_2, [
                Vue.createElementVNode("span", _hoisted_3, Vue.toDisplayString(Vue.unref(t)("Members")), 1),
                Vue.createElementVNode("span", _hoisted_4, Vue.toDisplayString(Vue.unref(t)("Operate")), 1)
              ]),
              (Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(Vue.unref(applyToAnchorList), (item) => {
                return Vue.openBlock(), Vue.createElementBlock("div", {
                  key: item.userId,
                  class: "apply-item"
                }, [
                  Vue.createElementVNode("div", _hoisted_5, [
                    Vue.createVNode(Avatar.default, {
                      class: "avatar-url",
                      "img-src": item.avatarUrl
                    }, null, 8, ["img-src"]),
                    Vue.createElementVNode("span", {
                      class: "user-name",
                      title: Vue.unref(roomService.roomService).getDisplayName(item)
                    }, Vue.toDisplayString(Vue.unref(roomService.roomService).getDisplayName(item)), 9, _hoisted_6)
                  ]),
                  Vue.createElementVNode("div", _hoisted_7, [
                    Vue.createVNode(Button.default, {
                      size: "default",
                      class: "agree",
                      onClick: ($event) => Vue.unref(handleUserApply)(item.userId, true)
                    }, {
                      default: Vue.withCtx(() => [
                        Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Agree to the stage")), 1)
                      ]),
                      _: 2
                    }, 1032, ["onClick"]),
                    Vue.createVNode(Button.default, {
                      size: "default",
                      class: "reject",
                      onClick: ($event) => Vue.unref(handleUserApply)(item.userId, false)
                    }, {
                      default: Vue.withCtx(() => [
                        Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Reject")), 1)
                      ]),
                      _: 2
                    }, 1032, ["onClick"])
                  ])
                ]);
              }), 128))
            ])) : (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_8, [
              Vue.createVNode(SvgIcon.default, { icon: ApplyStageLabelIcon.default }),
              Vue.createElementVNode("span", _hoisted_9, Vue.toDisplayString(Vue.unref(t)("Currently no member has applied to go on stage")), 1)
            ]))
          ]),
          _: 1
        }, 8, ["modelValue", "title", "before-close"])
      ]);
    };
  }
});
exports.default = _sfc_main;
