import { defineComponent, ref, openBlock, createElementBlock, createVNode, unref, createCommentVNode } from "vue";
import IconButton from "../common/base/IconButton.vue.mjs";
import { useBasicStore } from "../../stores/basic.mjs";
import MoreIcon from "../common/icons/MoreIcon.vue.mjs";
import { storeToRefs } from "pinia";
import { useI18n } from "../../locales/index.mjs";
import { isMobile } from "../../utils/environment.mjs";
import Index from "../RoomMore/index.mjs";
const _hoisted_1 = { class: "more-control-container" };
const _hoisted_2 = {
  key: 0,
  class: "contact-container"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ContactControl",
  setup(__props) {
    const basicStore = useBasicStore();
    const { sidebarName } = storeToRefs(basicStore);
    const { t } = useI18n();
    const isShowContactTab = ref(false);
    const contactRef = ref();
    function toggleContactSidebar() {
      if (!isMobile) {
        if (basicStore.setSidebarOpenStatus && basicStore.sidebarName === "more") {
          basicStore.setSidebarOpenStatus(false);
          basicStore.setSidebarName("");
          return;
        }
        basicStore.setSidebarOpenStatus(true);
        basicStore.setSidebarName("more");
      } else {
        isShowContactTab.value = true;
        if (basicStore.sidebarName === "more") {
          basicStore.setSidebarName("");
          return;
        }
        basicStore.setSidebarName("more");
      }
    }
    function handleOnCloseContact() {
      isShowContactTab.value = false;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(IconButton, {
          icon: MoreIcon,
          "is-active": unref(sidebarName) === "more",
          title: unref(t)("Contact us"),
          onClickIcon: toggleContactSidebar
        }, null, 8, ["is-active", "title"]),
        isShowContactTab.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
          createVNode(unref(Index), {
            ref_key: "contactRef",
            ref: contactRef,
            onOnCloseContact: handleOnCloseContact
          }, null, 512)
        ])) : createCommentVNode("", true)
      ]);
    };
  }
});
export {
  _sfc_main as default
};
