"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chunkAJT37TCScjs = require('./chunk-AJT37TCS.cjs');


var _chunkWF7Z2VITcjs = require('./chunk-WF7Z2VIT.cjs');


var _chunkGH54P25Bcjs = require('./chunk-GH54P25B.cjs');


var _chunkOBHJBBPCcjs = require('./chunk-OBHJBBPC.cjs');

// src/components/IconWithCircleBackground.tsx
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
var _jsxruntime = require('@emotion/react/jsx-runtime');
function IconWithCircleBackground({
  iconName = "WarningSign",
  iconWidth = 40,
  to,
  onClick,
  padding,
  darkBg = false,
  shouldRotate = false,
  noBg = false,
  hoverActiveBg = false,
  disabled = false,
  bgColor,
  iconColor,
  iconStrokeWidth,
  opaque = false,
  showNewTag = false
}) {
  const content = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, 
    _chunkAJT37TCScjs.Flex,
    {
      center: true,
      onClick,
      disabled,
      as: onClick ? "button" : "div",
      asButtonType: "button",
      position: "relative",
      children: [
        /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
          StyledIconWithCircleBackground,
          {
            size: iconWidth,
            padding,
            darkBg,
            hoverActiveBg,
            shouldRotate,
            noBg,
            bgColor,
            children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
              _chunkWF7Z2VITcjs.Icon,
              {
                name: iconName,
                width: iconWidth,
                color: iconColor ? iconColor : "secondary",
                iconProps: {
                  strokeWidth: iconStrokeWidth,
                  fill: opaque ? "currentColor" : "none"
                }
              }
            )
          }
        ),
        showNewTag && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NewTag, { "data-testid": "icon-new-tag", children: "NEW" })
      ]
    }
  );
  return to ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: { cursor: disabled ? "not-allowed" : void 0 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGH54P25Bcjs.Link, { to, disabled, children: content }) }) : content;
}
var StyledIconWithCircleBackground = _styled2.default.div`
  background: ${({ theme, darkBg, noBg, bgColor }) => darkBg ? `linear-gradient(291.4deg, #1C243F 0%, #21283A 100%)` : noBg ? "transparent" : bgColor ? _chunkOBHJBBPCcjs.getColor.call(void 0, theme, bgColor) : _chunkOBHJBBPCcjs.getColor.call(void 0, theme, "grayBlue94")};

  &:hover {
    ${({ theme, hoverActiveBg }) => hoverActiveBg ? `background: ${_chunkOBHJBBPCcjs.getColor.call(void 0, theme, "grayBlue94")}` : ""};
  }
  &:active {
    ${({ theme, hoverActiveBg }) => hoverActiveBg ? `background: ${_chunkOBHJBBPCcjs.getColor.call(void 0, theme, "grayBlue78")}` : ""};
  }

  border-radius: 50%;
  padding: ${({ size, padding }) => padding != null ? padding : getPadding(size)}px;
  display: flex;
  justify-content: center;
  ${({ size, padding }) => `width: ${size + (padding != null ? padding : getPadding(size)) * 2}px; height: ${size + (padding != null ? padding : getPadding(size)) * 2}px;`}

  @keyframes IconWithCircleBackgroundRotate {
    0% {
      transform: rotate(0);
    }
    35% {
      transform: rotate(360deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  ${({ shouldRotate }) => shouldRotate && `animation: IconWithCircleBackgroundRotate 10s ease infinite;`}
`;
function getPadding(size) {
  if (size === 48) {
    return 38;
  }
  if (size === 40) {
    return 20;
  }
  if (size === 36) {
    return 14;
  }
  if (size === 20) {
    return 10;
  }
  return 16;
}
var NewTag = _styled2.default.div`
  position: absolute;
  right: 8px;
  bottom: -4px;

  display: flex;
  padding: 2px 4px;
  justify-content: center;
  align-items: center;
  gap: 4px;

  border-radius: 4px;
  background: #179a1c;

  color: #f9f9f9;
  font-family: Manrope;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 12px; /* 133.333% */
  letter-spacing: 0.72px;
`;



exports.IconWithCircleBackground = IconWithCircleBackground;
