import { defineComponent, getCurrentInstance, inject, ref, computed, openBlock, createElementBlock, normalizeClass, renderSlot } from 'vue';
import getPrefixCls from '../_util/getPrefixCls';
import { noop } from '../_util/utils';
import { COMPONENT_NAME, LAYOUT_PROVIDE_KEY } from './const';

const prefixCls = getPrefixCls('layout');
const layoutFooterProps = {
  embedded: {
    type: Boolean,
    default: false
  },
  bordered: {
    type: Boolean,
    default: false
  },
  fixed: {
    type: Boolean,
    default: false
  }
};
var script = defineComponent({
  name: COMPONENT_NAME.FOOTER,
  props: layoutFooterProps,
  setup(props) {
    const vm = getCurrentInstance();
    if (!vm.parent || !vm.parent.type || vm.parent.type.name !== COMPONENT_NAME.LAYOUT) {
      console.warn(`[${COMPONENT_NAME.FOOTER}] must be a child of ${COMPONENT_NAME.LAYOUT}`);
    }
    const {
      addChild,
      embedded
    } = inject(LAYOUT_PROVIDE_KEY, {
      addChild: noop,
      embedded: ref(false)
    });
    addChild({
      type: COMPONENT_NAME.FOOTER
    });
    const classList = computed(() => [`${prefixCls}-footer`, props.bordered && 'is-bordered', (embedded.value || props.embedded) && 'is-embedded', props.fixed && 'is-fixed'].filter(Boolean));
    return {
      classList
    };
  }
});

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("footer", {
    class: normalizeClass(_ctx.classList)
  }, [renderSlot(_ctx.$slots, "default")], 2 /* CLASS */);
}

script.render = render;
script.__file = "components/layout/footer.vue";

export { script as default, layoutFooterProps };
