function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
import React from 'react';
import styled from 'styled-components';
import { Button, Flexbox, Link, Typography } from '../../../../index';
import List from '../../../../Atoms/List';
var StyledCurrentPageBox = styled(Flexbox).withConfig({
  displayName: "LargeComponents__StyledCurrentPageBox",
  componentId: "sc-1aftlfa-0"
})(["background-color:", ";justify-content:center;align-items:center;height:", "px;width:", "px;border-radius:", ";"], function (t) {
  return t.theme.color.cta;
}, function (p) {
  return p.theme.spacing.unit(10);
}, function (p) {
  return p.theme.spacing.unit(10);
}, function (p) {
  return p.theme.borderRadius2;
});
var StyledTruncatedBox = styled.li.withConfig({
  displayName: "LargeComponents__StyledTruncatedBox",
  componentId: "sc-1aftlfa-1"
})(["display:flex;height:", "px;width:", "px;border:none;padding:0;justify-content:center;align-items:center;"], function (p) {
  return p.theme.spacing.unit(10);
}, function (p) {
  return p.theme.spacing.unit(5);
});
var getWidthForList = function getWidthForList(pageItemWith, truncatedItemWidth, numberOfPages) {
  var MAX_NUMBER_ITEMS = 7;
  var NUMBER_OF_CHEVRONS = 2;
  if (numberOfPages <= 5) {
    return numberOfPages * pageItemWith;
  }
  if (numberOfPages === 6) {
    return numberOfPages * pageItemWith - truncatedItemWidth;
  }
  return MAX_NUMBER_ITEMS * pageItemWith - NUMBER_OF_CHEVRONS * truncatedItemWidth;
};
var StyledList = styled(List).withConfig({
  displayName: "LargeComponents__StyledList",
  componentId: "sc-1aftlfa-2"
})(["display:flex;justify-content:center;", ""], function (p) {
  var PAGE_ITEM_WIDTH = p.theme.spacing.unit(10);
  var TRUNCATED_ITEM_WIDTH = p.theme.spacing.unit(5);
  return "width: ".concat(getWidthForList(PAGE_ITEM_WIDTH, TRUNCATED_ITEM_WIDTH, p.$numberOfPages), "px");
});
var TruncatedPageNumbers = function TruncatedPageNumbers() {
  return React.createElement(StyledTruncatedBox, null, React.createElement(Typography, {
    type: "primary",
    weight: "bold"
  }, "..."));
};
var _map = [Button, Link].map(function (elem) {
    return styled(elem).withConfig({
      displayName: "LargeComponents",
      componentId: "sc-1aftlfa-3"
    })(["display:flex;height:", "px;width:", "px;border:none;padding:0;justify-content:center;align-items:center;background-color:transparent;border-radius:", ";color:", ";", " &:hover{background-color:", ";color:", ";text-decoration:none;border-radius:", ";span{color:", ";}svg{fill:", ";}}"], function (p) {
      return p.theme.spacing.unit(10);
    }, function (p) {
      return p.theme.spacing.unit(10);
    }, function (p) {
      return p.theme.borderRadius2;
    }, function (t) {
      return t.theme.color.text;
    }, function (_ref) {
      var $type = _ref.$type,
        theme = _ref.theme;
      return $type === 'chevron' && "box-sizing: border-box; border: 1px solid ".concat(theme.color.inputBorder, ";");
    }, function (t) {
      return t.theme.color.ctaHover;
    }, function (t) {
      return t.theme.color.buttonText;
    }, function (p) {
      return p.theme.borderRadius2;
    }, function (t) {
      return t.theme.color.buttonText;
    }, function (t) {
      return t.theme.color.buttonText;
    });
  }),
  _map2 = _slicedToArray(_map, 2),
  StyledButton = _map2[0],
  StyledLink = _map2[1];
export { StyledCurrentPageBox, StyledList, TruncatedPageNumbers, StyledButton, StyledLink };