import { defineComponent, inject, openBlock, createElementBlock, createElementVNode, createVNode, unref, withDirectives, vShow } from "vue";
import UserInfo from "../UserInfo/index.mjs";
import _sfc_main$2 from "../../common/Language.vue.mjs";
import _sfc_main$1 from "../../common/SwitchTheme.vue.mjs";
import RoomInfo from "../RoomInfo/index.mjs";
import LayoutControl from "./LayoutControl.vue.mjs";
import NetworkInfo from "./NetworkInfo.vue.mjs";
import { useBasicStore } from "../../../stores/basic.mjs";
import { storeToRefs } from "pinia";
const _hoisted_1 = { class: "header-container" };
const _hoisted_2 = { class: "left-container" };
const _hoisted_3 = { class: "center-container" };
const _hoisted_4 = { class: "right-container" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  emits: ["log-out"],
  setup(__props) {
    const basicStore = useBasicStore();
    const { userId, userName, avatarUrl } = storeToRefs(basicStore);
    const showHeaderInfo = inject("showHeaderInfo", true);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          createVNode(_sfc_main$1, { class: "header-item" }),
          createVNode(LayoutControl, { class: "header-item" }),
          createVNode(NetworkInfo, { class: "header-item" })
        ]),
        createElementVNode("div", _hoisted_3, [
          createVNode(unref(RoomInfo), { class: "header-item" })
        ]),
        createElementVNode("div", _hoisted_4, [
          withDirectives(createVNode(_sfc_main$2, { class: "header-item" }, null, 512), [
            [vShow, unref(showHeaderInfo)]
          ]),
          withDirectives(createVNode(unref(UserInfo), {
            class: "header-item",
            "user-id": unref(userId),
            "user-name": unref(userName),
            "avatar-url": unref(avatarUrl),
            onLogOut: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("log-out"))
          }, null, 8, ["user-id", "user-name", "avatar-url"]), [
            [vShow, unref(showHeaderInfo)]
          ])
        ])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
