import { defineComponent, useTemplateRef, createElementBlock, createCommentVNode, openBlock, createBlock } from "vue";
import { useIntersection } from "../../../hooks/use-intersection.js";
import ClassicLayout from "./components/ClassicLayout.vue.js";
import _sfc_main$1 from "./components/ModernLayout.vue.js";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Model",
  props: {
    id: {},
    name: {},
    options: {},
    schema: {},
    isCollapsed: { type: Boolean },
    eventBus: {}
  },
  setup(__props) {
    const section = useTemplateRef("section");
    useIntersection(section, () => __props.eventBus?.emit("intersecting:nav-item", { id: __props.id }));
    return (_ctx, _cache) => {
      return _ctx.schema ? (openBlock(), createElementBlock("div", {
        key: 0,
        ref_key: "section",
        ref: section
      }, [
        _ctx.options.layout === "classic" ? (openBlock(), createBlock(ClassicLayout, {
          key: 0,
          id: _ctx.id,
          eventBus: _ctx.eventBus,
          isCollapsed: _ctx.isCollapsed,
          name: _ctx.name,
          options: _ctx.options,
          schema: _ctx.schema
        }, null, 8, ["id", "eventBus", "isCollapsed", "name", "options", "schema"])) : (openBlock(), createBlock(_sfc_main$1, {
          key: 1,
          id: _ctx.id,
          eventBus: _ctx.eventBus,
          isCollapsed: _ctx.isCollapsed,
          name: _ctx.name,
          options: _ctx.options,
          schema: _ctx.schema
        }, null, 8, ["id", "eventBus", "isCollapsed", "name", "options", "schema"]))
      ], 512)) : createCommentVNode("", true);
    };
  }
});
export {
  _sfc_main as default
};
