import { defineComponent as g, watch as i, openBlock as p, createBlock as l, normalizeClass as S, withCtx as t, unref as d, isRef as k, createCommentVNode as h, createElementVNode as M, createVNode as c, renderSlot as b } from "vue";
import { useMediaQuery as w } from "@vueuse/core";
import y from "../ApiReferenceLayout.vue.js";
import D from "../MobileHeader.vue.js";
import v from "../SearchButton.vue.js";
import B from "../DarkModeToggle/DarkModeToggle.vue.js";
import { useSidebar as C } from "../../hooks/useSidebar.js";
import { useNavState as N } from "../../hooks/useNavState.js";
const H = { class: "scalar-api-references-standalone-search" }, E = /* @__PURE__ */ g({
  __name: "ModernLayout",
  props: {
    configuration: {},
    parsedSpec: {},
    rawSpec: {},
    isDark: { type: Boolean }
  },
  emits: ["toggleDarkMode"],
  setup(f) {
    const n = f, u = w("(max-width: 1000px)"), { isSidebarOpen: r } = C();
    i(u, (e, o) => {
      e && !o && (r.value = !1);
    });
    const { hash: m } = N();
    return i(m, (e, o) => {
      e && e !== o && (r.value = !1);
    }), (e, o) => (p(), l(y, {
      class: S({
        "scalar-api-references-standalone-mobile": e.configuration.showSidebar
      }),
      configuration: e.configuration,
      parsedSpec: e.parsedSpec,
      rawSpec: e.rawSpec
    }, {
      header: t(() => [
        n.configuration.showSidebar ? (p(), l(D, {
          key: 0,
          open: d(r),
          "onUpdate:open": o[0] || (o[0] = (a) => k(r) ? r.value = a : null)
        }, null, 8, ["open"])) : h("", !0)
      ]),
      "sidebar-start": t(({ spec: a }) => {
        var s;
        return [
          M("div", H, [
            c(v, {
              searchHotKey: (s = n.configuration) == null ? void 0 : s.searchHotKey,
              spec: a
            }, null, 8, ["searchHotKey", "spec"])
          ])
        ];
      }),
      "sidebar-end": t(() => [
        c(d(B), {
          isDarkMode: e.isDark,
          onToggleDarkMode: o[1] || (o[1] = (a) => e.$emit("toggleDarkMode"))
        }, null, 8, ["isDarkMode"])
      ]),
      "content-end": t(() => [
        b(e.$slots, "footer", {}, void 0, !0)
      ]),
      _: 3
    }, 8, ["class", "configuration", "parsedSpec", "rawSpec"]));
  }
});
export {
  E as default
};
