"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const room = require("tuikit-atomicx-vue3/room");
const StandardLeave = require("./StandardLeave.vue2.js");
const WebinarLeave = require("./WebinarLeave.vue2.js");
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "index",
  emits: ["leave", "end"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const { currentRoom } = room.useRoomState();
    const frozenIsWebinar = vue.ref(null);
    vue.watch(
      () => {
        var _a;
        return (_a = currentRoom.value) == null ? void 0 : _a.roomType;
      },
      (roomType) => {
        if (frozenIsWebinar.value === null && roomType !== void 0) {
          frozenIsWebinar.value = roomType === room.RoomType.Webinar;
        }
      },
      { immediate: true }
    );
    return (_ctx, _cache) => {
      return !frozenIsWebinar.value ? (vue.openBlock(), vue.createBlock(StandardLeave.default, {
        key: 0,
        emitFunction: emit
      })) : (vue.openBlock(), vue.createBlock(WebinarLeave.default, {
        key: 1,
        "emit-function": emit
      }));
    };
  }
});
exports.default = _sfc_main;
