import { defineComponent, computed, toRef, createVNode, createTextVNode } from 'vue';
import { RightOutlined, LeftOutlined, DoubleRightOutlined, DoubleLeftOutlined } from '@ant-design/icons-vue';
import '../../../utils/index.mjs';
import '../../../locale/index.mjs';
import '../../../vue-components/index.mjs';
import '../../../hooks/index.mjs';
import useConfigInject from '../../config-provider/src/hooks/useConfigInject.mjs';
import '../../locale-provider/index.mjs';
import useStyle from '../style/index.mjs';
import { paginationProps } from './props.mjs';
import { MiniSelect, MiddleSelect } from './Select.mjs';
import { useBreakpoint } from '../../../hooks/use-breakpoint/index.mjs';
import { useLocaleReceiver } from '../../locale-provider/src/useLocaleReceiver.mjs';
import localeValues from '../../../locale/lang/en_US.mjs';
import { classNames } from '../../../utils/dom/class.mjs';
import VcPagination from '../../../vue-components/vc-pagination/src/Pagination.mjs';

var pagination = /* @__PURE__ */ defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "APagination",
  inheritAttrs: false,
  props: paginationProps(),
  // emits: ['change', 'showSizeChange', 'update:current', 'update:pageSize'],
  setup(props, {
    slots,
    attrs
  }) {
    const {
      prefixCls,
      configProvider,
      direction,
      size
    } = useConfigInject("pagination", props);
    const [wrapSSR, hashId] = useStyle(prefixCls);
    const selectPrefixCls = computed(() => configProvider.getPrefixCls("select", props.selectPrefixCls));
    const breakpoint = useBreakpoint();
    const [locale] = useLocaleReceiver("Pagination", localeValues.Pagination, toRef(props, "locale"));
    const getIconsProps = (pre) => {
      const ellipsis = createVNode("span", {
        "class": `${pre}-item-ellipsis`
      }, [createTextVNode("\u2022\u2022\u2022")]);
      const prevIcon = createVNode("button", {
        "class": `${pre}-item-link`,
        "type": "button",
        "tabindex": -1
      }, [direction.value === "rtl" ? createVNode(RightOutlined, null, null) : createVNode(LeftOutlined, null, null)]);
      const nextIcon = createVNode("button", {
        "class": `${pre}-item-link`,
        "type": "button",
        "tabindex": -1
      }, [direction.value === "rtl" ? createVNode(LeftOutlined, null, null) : createVNode(RightOutlined, null, null)]);
      const jumpPrevIcon = createVNode("a", {
        "rel": "nofollow",
        "class": `${pre}-item-link`
      }, [createVNode("div", {
        "class": `${pre}-item-container`
      }, [direction.value === "rtl" ? createVNode(DoubleRightOutlined, {
        "class": `${pre}-item-link-icon`
      }, null) : createVNode(DoubleLeftOutlined, {
        "class": `${pre}-item-link-icon`
      }, null), ellipsis])]);
      const jumpNextIcon = createVNode("a", {
        "rel": "nofollow",
        "class": `${pre}-item-link`
      }, [createVNode("div", {
        "class": `${pre}-item-container`
      }, [direction.value === "rtl" ? createVNode(DoubleLeftOutlined, {
        "class": `${pre}-item-link-icon`
      }, null) : createVNode(DoubleRightOutlined, {
        "class": `${pre}-item-link-icon`
      }, null), ellipsis])]);
      return {
        prevIcon,
        nextIcon,
        jumpPrevIcon,
        jumpNextIcon
      };
    };
    return () => {
      var _a;
      const {
        itemRender = slots.itemRender,
        buildOptionText = slots.buildOptionText,
        selectComponentClass,
        responsive,
        ...restProps
      } = props;
      const isSmall = size.value === "small" || !!(((_a = breakpoint.value) == null ? void 0 : _a.xs) && !size.value && responsive);
      const paginationProps2 = {
        ...restProps,
        ...getIconsProps(prefixCls.value),
        prefixCls: prefixCls.value,
        selectPrefixCls: selectPrefixCls.value,
        selectComponentClass: selectComponentClass || (isSmall ? MiniSelect : MiddleSelect),
        locale: locale.value,
        buildOptionText,
        ...attrs,
        class: classNames({
          [`${prefixCls.value}-mini`]: isSmall,
          [`${prefixCls.value}-rtl`]: direction.value === "rtl"
        }, attrs.class, hashId.value),
        itemRender
      };
      return wrapSSR(createVNode(VcPagination, paginationProps2, null));
    };
  }
});

export { pagination as default };
//# sourceMappingURL=Pagination.mjs.map
