'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var container = require('./container.js');

var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{
    name: "GmContainer"
  },
  __name: "Container",
  props: container.containerProps,
  setup(__props, { expose: __expose }) {
    const slots = vue.useSlots();
    const props = __props;
    const isVertical = vue.computed(() => {
      if (props.direction === "vertical") {
        return true;
      } else if (props.direction === "horizontal") {
        return false;
      }
      if (slots && slots.default) {
        const vNodes = slots.default();
        return vNodes.some((vNode) => {
          const tag = vNode.type.name || "";
          return ["ElHeader", "ElFooter", "GmHeader", "GmFooter"].includes(tag);
        });
      } else {
        return false;
      }
    });
    const direction = vue.computed(() => {
      return isVertical.value ? "vertical" : "horizontal";
    });
    const elRef = vue.ref();
    __expose({
      elRef
    });
    return (_ctx, _cache) => {
      const _component_el_container = vue.resolveComponent("el-container");
      return vue.openBlock(), vue.createBlock(_component_el_container, {
        ref_key: "elRef",
        ref: elRef,
        direction: direction.value
      }, vue.createSlots({
        _: 2
        /* DYNAMIC */
      }, [
        vue.unref(slots).default ? {
          name: "default",
          fn: vue.withCtx(() => [
            vue.renderSlot(_ctx.$slots, "default")
          ]),
          key: "0"
        } : void 0
      ]), 1032, ["direction"]);
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=Container.vue2.js.map
