"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const TUIRoomEngine = require("@tencentcloud/tuiroom-engine-js");
const uikitBaseComponentVue3 = require("@tencentcloud/uikit-base-component-vue3");
const room = require("tuikit-atomicx-vue3/room");
const roomEngine = room.useRoomEngine();
let isShowAutoPlayDialog = false;
function useCustomizedAutoPlayDialog() {
  const { t } = uikitBaseComponentVue3.useUIKit();
  TUIRoomEngine.once("ready", () => {
    var _a;
    (_a = roomEngine.instance) == null ? void 0 : _a.on(TUIRoomEngine.TUIRoomEvents.onAutoPlayFailed, () => {
      if (!isShowAutoPlayDialog) {
        isShowAutoPlayDialog = true;
        uikitBaseComponentVue3.TUIMessageBox.alert({
          title: t("RoomCommon.Attention"),
          content: t("RoomNotifications.AudioPlaybackFailed"),
          showClose: false,
          modal: false,
          confirmText: t("Confirm"),
          callback: () => {
            isShowAutoPlayDialog = false;
          }
        });
      }
    });
  });
}
exports.default = useCustomizedAutoPlayDialog;
exports.useCustomizedAutoPlayDialog = useCustomizedAutoPlayDialog;
