import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, toDisplayString, createBlock, createCommentVNode } from "vue";
import useRoomInfo from "../RoomHeader/RoomInfo/useRoomInfoHooks.mjs";
import copyIcon from "../common/icons/CopyIcon.vue.mjs";
import SvgIcon from "../common/base/SvgIcon.vue.mjs";
import { isWeChat, isMobile } from "../../utils/environment.mjs";
import { useI18n } from "../../locales/index.mjs";
import { getUrlWithRoomId } from "../../utils/utils.mjs";
const _hoisted_1 = { class: "invite-member-title" };
const _hoisted_2 = ["title"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "InvitePanel",
  props: {
    scheduleInviteList: {},
    shareLinkData: {}
  },
  setup(__props) {
    const { t } = useI18n();
    const props = __props;
    const { onCopy } = useRoomInfo();
    const scheduleInviteList = computed(() => {
      var _a;
      const roomId = (_a = props == null ? void 0 : props.shareLinkData) == null ? void 0 : _a.roomId;
      if (!roomId) return props.scheduleInviteList;
      return [
        {
          title: `${t("Room ID")}`,
          content: roomId,
          isShowCopyIcon: true,
          isVisible: true
        },
        {
          title: `${t("Room Link")}`,
          content: getUrlWithRoomId(roomId),
          isShowCopyIcon: true,
          isVisible: !isWeChat
        }
      ];
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["invite-member", unref(isMobile) ? "h5" : ""])
      }, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(scheduleInviteList.value, (item, index) => {
          return openBlock(), createElementBlock(Fragment, null, [
            item.isVisible ? (openBlock(), createElementBlock("div", {
              class: "invite-member-container",
              key: index
            }, [
              createElementVNode("span", _hoisted_1, toDisplayString(unref(t)(item.title)), 1),
              createElementVNode("span", {
                class: "invite-member-content",
                title: item.content
              }, toDisplayString(item.content), 9, _hoisted_2),
              item.isShowCopyIcon ? (openBlock(), createBlock(SvgIcon, {
                key: 0,
                class: "copy",
                icon: copyIcon,
                onClick: ($event) => unref(onCopy)(item.content)
              }, null, 8, ["onClick"])) : createCommentVNode("", true)
            ])) : createCommentVNode("", true)
          ], 64);
        }), 256))
      ], 2);
    };
  }
});
export {
  _sfc_main as default
};
