import { jsx } from '@emotion/core';
import { Badge } from '../Badge/Badge.esm.js';
import '../icons/BlogIcon.esm.js';
import '../icons/CheckIcon.esm.js';
import '../icons/PortfolioIcon.esm.js';
import '../icons/EcommerceIcon.esm.js';
import '../icons/CheckCircleIcon.esm.js';
import '../icons/EllipsisIcon.esm.js';
import '../icons/InProgressIcon.esm.js';
import '../icons/CloseCircleIcon.esm.js';
import '../icons/SuccessIcon.esm.js';
import '../icons/GeneralIcon.esm.js';
import '../icons/ReportsIcon.esm.js';
import '../icons/SkullIcon.esm.js';
import '../icons/BuildsIcon.esm.js';
import '../icons/IntegrationsIcon.esm.js';
import FreePlanIcon from '../icons/FreePlanIcon.esm.js';
import ProfessionalPlanIcon from '../icons/ProfessionalPlanIcon.esm.js';
import BusinessPlanIcon from '../icons/BusinessPlanIcon.esm.js';
import EnterprisePlanIcon from '../icons/EnterprisePlanIcon.esm.js';
import '../icons/BitbucketIcon.esm.js';
import '../icons/GitHubIcon.esm.js';
import '../icons/GitLabIcon.esm.js';
import '../icons/FeaturesIcon.esm.js';
import '../icons/CollaborationIcon.esm.js';
import '../icons/LoginIcon.esm.js';
import '../icons/ProviderIcon.esm.js';
import '../icons/DeployIcon.esm.js';
import '../icons/CampaignIcon.esm.js';
import IndividualPlanIcon from '../icons/IndividualPlanIcon.esm.js';
import TeamPlanIcon from '../icons/TeamPlanIcon.esm.js';
import '../icons/MonogramIcon.esm.js';
import '../icons/GatsbyCloudIcon.esm.js';

/** @jsx jsx */

var baseCss = function baseCss(_theme) {
  return {
    fontWeight: 500
  };
};

var planTypeFreeCss = function planTypeFreeCss(theme) {
  return {
    borderColor: theme.colors.blue[10],
    backgroundColor: theme.colors.blue[10],
    color: theme.colors.blue[80]
  };
};

var planTypeIndividualCss = function planTypeIndividualCss(theme) {
  return {
    borderColor: theme.colors.orange[10],
    backgroundColor: theme.colors.orange[10],
    color: theme.colors.red[70]
  };
};

var planTypeTeamCss = function planTypeTeamCss(theme) {
  return {
    borderColor: theme.colors.magenta[10],
    backgroundColor: theme.colors.magenta[10],
    color: theme.colors.magenta[70]
  };
};

var planTypeEnterpriseCss = function planTypeEnterpriseCss(theme) {
  return {
    borderColor: theme.colors.purple[80],
    backgroundColor: theme.colors.purple[80],
    color: theme.colors.white
  };
};

var planTypeProfessionalCss = function planTypeProfessionalCss(theme) {
  return {
    borderColor: theme.colors.blue[10],
    backgroundColor: theme.colors.blue[10],
    color: theme.colors.blue[90]
  };
};

var planTypeBusinessCss = function planTypeBusinessCss(theme) {
  return {
    borderColor: theme.colors.purple[10],
    backgroundColor: theme.colors.purple[10],
    color: theme.colors.purple[70]
  };
};

var trialingCss = function trialingCss(theme) {
  return {
    borderColor: theme.colors.green[10],
    backgroundColor: theme.colors.green[10],
    color: theme.colors.green[90]
  };
};

var planTypeCss = {
  FREE: planTypeFreeCss,
  INDIVIDUAL: planTypeIndividualCss,
  TEAM: planTypeTeamCss,
  ENTERPRISE: planTypeEnterpriseCss,
  PROFESSIONAL: planTypeProfessionalCss,
  BUSINESS: planTypeBusinessCss
};
var planTypeIcons = {
  FREE: FreePlanIcon,
  INDIVIDUAL: IndividualPlanIcon,
  TEAM: TeamPlanIcon,
  ENTERPRISE: EnterprisePlanIcon,
  PROFESSIONAL: ProfessionalPlanIcon,
  BUSINESS: BusinessPlanIcon
};
function PlanIndicator(_ref) {
  var planType = _ref.planType,
      _ref$isTrialling = _ref.isTrialling,
      isTrialling = _ref$isTrialling === void 0 ? false : _ref$isTrialling,
      children = _ref.children,
      ariaLabel = _ref["aria-label"];
  var Icon = planTypeIcons[planType];
  return jsx(Badge, {
    size: "M",
    textVariant: "DEFAULT",
    Icon: isTrialling ? undefined : Icon,
    "aria-label": ariaLabel,
    css: function css(theme) {
      return [baseCss(), isTrialling ? trialingCss(theme) : planTypeCss[planType](theme)];
    }
  }, children);
}
PlanIndicator.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "PlanIndicator",
  "props": {
    "isTrialling": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "required": false,
      "tsType": {
        "name": "boolean"
      },
      "description": ""
    },
    "planType": {
      "required": true,
      "tsType": {
        "name": "union",
        "raw": "`FREE`\n| `INDIVIDUAL`\n| `TEAM`\n| `ENTERPRISE`\n// backwards compatibility for older plans\n| `PROFESSIONAL`\n| `BUSINESS`",
        "elements": [{
          "name": "literal",
          "value": "undefined"
        }, {
          "name": "literal",
          "value": "undefined"
        }, {
          "name": "literal",
          "value": "undefined"
        }, {
          "name": "literal",
          "value": "undefined"
        }, {
          "name": "literal",
          "value": "undefined"
        }, {
          "name": "literal",
          "value": "undefined"
        }]
      },
      "description": ""
    },
    "children": {
      "required": true,
      "tsType": {
        "name": "ReactReactNode",
        "raw": "React.ReactNode"
      },
      "description": ""
    },
    "aria-label": {
      "required": true,
      "tsType": {
        "name": "string"
      },
      "description": ""
    }
  }
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/PlanIndicator/PlanIndicator.tsx"] = {
    name: "PlanIndicator",
    docgenInfo: PlanIndicator.__docgenInfo,
    path: "src/components/PlanIndicator/PlanIndicator.tsx"
  };
}

export { PlanIndicator };
//# sourceMappingURL=PlanIndicator.esm.js.map
