"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("styled-components"),d=require("./utils.js"),t=require("../../utils/index.js"),p=require("../Interactive/index.js");function C(e){return e&&e.__esModule?e:{default:e}}var n=C(o);const b=e=>{switch(e){case"ghost":return f;case"outlined":return h;case"primary":default:return $}},c=o.css`
  background: ${t.getColorAlias("interactivePrimary")};
  color: ${t.getColorAlias("contentInteractivePrimary")};
`,i=o.css`
  background: ${t.getColorAlias("disabled01")};
  &:hover {
    background: ${t.getDarkenColor("hover02","backgroundDefault")};
  }
`,g=o.css`
  display: flex;
  align-items: center;
  justify-content: center;
`,u=n.default.div`
  ${g};
`,v=e=>{const{selected:r,showClose:a,isLoading:s}=e;return r&&a?s?o.css`
        padding: ${t.getSpacing("s01")};
      `:o.css`
      padding: ${t.getSpacing("s01","s01","s01","s03")};
    `:o.css`
    padding: 6px 12px;
  `},l=n.default(p.Interactive).withConfig({shouldForwardProp:t.convertToTransientProps(["showClose","isLoading"])})`
  ${g};
  box-sizing: border-box;
  height: 32px;
  ${e=>v(e)};
  outline: 2px solid transparent;
  border-radius: ${e=>e.theme.radius.roundedD};
  text-align: center;
  ${t.getFontSize("size14")};
  font-family: ${e=>e.theme.font.familyPrimary};
  font-weight: ${e=>e.theme.font.weightExtrabold};
  ${t.getDefaultTransition()};

  ${({disabled:e})=>e?o.css`
          ${i};
          color: ${t.getColorAlias("contentDisabled")};
        `:o.css`
          background: ${t.getColorAlias("containerDefault")};
          color: ${t.getColorAlias("contentInteractiveSecondary")};
        `};

  svg {
    fill: ${({selected:e=!1,disabled:r=!1})=>d.getIconFill(e,r)};
  }

  &:hover {
    cursor: ${({disabled:e=!1,showClose:r=!1,selected:a=!1,isLoading:s=!1})=>d.getHoverCursor(e,r,a,s)};
  }

  &:focus,
  &:focus-within {
    outline-color: ${t.getColorAlias("focusOuter")};
  }
`,f=n.default(l)`
  ${({disabled:e,selected:r,isLoading:a})=>e?i:o.css`
          ${r?c:o.css`
                background: ${t.getColorAlias("containerDefault")};
                border: none;
                &:hover {
                  background: ${a?t.getColorAlias("containerDefault"):t.getDarkenColor("hover02","backgroundDefault")};
                }
                &:active {
                  background: ${a?t.getColorAlias("containerDefault"):t.getDarkenColor("active02","backgroundDefault")};
                }
              `}
        `};
`,h=n.default(l)`
  ${({disabled:e,selected:r,isLoading:a})=>e?i:o.css`
          ${r?c:o.css`
                background: ${t.getColorAlias("containerDefault")};
                border: 1px solid ${t.getColorAlias("borderDefault")};
                &:hover {
                  background: ${a?t.getColorAlias("containerDefault"):t.getDarkenColor("hover02","backgroundDefault")};
                }
                &:active {
                  background: ${a?t.getColorAlias("containerDefault"):t.getDarkenColor("active02","backgroundDefault")};
                }
              `}
        `};
`,$=n.default(l)`
  ${({disabled:e,selected:r,isLoading:a})=>e?i:o.css`
          ${r?c:o.css`
                background: ${t.getColorAlias("containerSubtle")};
                &:hover {
                  background: ${a?t.getColorAlias("containerSubtle"):t.getDarkenColor("hover02","backgroundDefault")};
                }
                &:active {
                  background: ${a?t.getColorAlias("containerSubtle"):t.getDarkenColor("active02","backgroundDefault")};
                }
              `}
        `};
`,k=n.default(u)`
  svg {
    height: 16px;
    width: 16px;
    margin-right: ${t.getSpacing("s02")};
  }
`,D=n.default.button.withConfig({shouldForwardProp:(e,r)=>e!=="showClose"&&e!=="isLoading"&&r(e)})`
  border: none;
  width: 21px;
  height: 21px;
  margin-left: ${t.getSpacing("s01")};
  padding: ${t.getSpacing("s00")};
  border-radius: ${e=>e.theme.radius.roundedE};
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;

  svg {
    height: 16px;
    width: 16px;
    fill: ${t.getColorAlias("interactiveSecondary")};

    &:hover {
      scale: 1.1;
    }
  }

  &:hover {
    cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
  }
`,x=n.default(u)`
  width: ${({width:e,selected:r})=>e-(r?20:22)}px;
  height: ${({selected:e})=>e?"24":"20"}px;

  svg {
    stroke: ${({selected:e})=>e?t.getColorAlias("contentInteractivePrimary"):t.getColorAlias("contentInteractiveSecondary")};
    height: 16px;
    width: 16px;
  }
`;exports.Chip=l;exports.CloseButton=D;exports.FlexDiv=u;exports.Ghost=f;exports.IconWrapper=k;exports.Outlined=h;exports.Primary=$;exports.SpinnerWrapper=x;exports.getChipVariant=b;
