"use strict";

Liferay.Loader.define("@frontend-taglib-clay$clayui/pagination@3.58.0/lib/Ellipsis", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/button', '@frontend-taglib-clay$clayui/drop-down', 'frontend-js-react-web$react'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

    var _button = _interopRequireDefault(require("@frontend-taglib-clay$clayui/button"));

    var _dropDown = require("@frontend-taglib-clay$clayui/drop-down");

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    /**
     * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
     * SPDX-License-Identifier: BSD-3-Clause
     */
    var ClayPaginationEllipsis = function ClayPaginationEllipsis(_ref) {
      var alignmentPosition = _ref.alignmentPosition,
          _ref$disabled = _ref.disabled,
          disabled = _ref$disabled === void 0 ? false : _ref$disabled,
          _ref$disabledPages = _ref.disabledPages,
          disabledPages = _ref$disabledPages === void 0 ? [] : _ref$disabledPages,
          hrefConstructor = _ref.hrefConstructor,
          _ref$items = _ref.items,
          items = _ref$items === void 0 ? [] : _ref$items,
          onPageChange = _ref.onPageChange;
      var pages = disabled ? [] : items.map(function (page) {
        return {
          disabled: disabledPages.includes(page),
          href: hrefConstructor ? hrefConstructor(page) : undefined,
          label: String(page),
          onClick: function onClick() {
            return onPageChange && onPageChange(page);
          }
        };
      });
      return (/*#__PURE__*/_react.default.createElement(_dropDown.ClayDropDownWithItems, {
          alignmentPosition: alignmentPosition,
          className: "page-item",
          containerElement: "li",
          items: pages,
          trigger: /*#__PURE__*/_react.default.createElement(_button.default, {
            className: "page-link",
            disabled: disabled,
            displayType: "unstyled"
          }, "...")
        })
      );
    };

    var _default = ClayPaginationEllipsis;
    exports.default = _default;
  }
});
//# sourceMappingURL=Ellipsis.js.map