text: "use strict";
  
  exports.__esModule = true;
  exports.default = void 0;
  
  var _react = _interopRequireDefault(require("react"));
  
  var _propTypes = _interopRequireDefault(require("prop-types"));
  
  var _constants = require("../../constants");
  
  var _Price = _interopRequireDefault(require("../Price"));
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
  
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  
  /** Display multiple amounts across different currencies. Supports all props in `Price`. */
  class PriceGroup extends _react.default.PureComponent {
    render() {
      const _this$props = this.props,
            {
        amounts,
        divider
      } = _this$props,
            restProps = _objectWithoutPropertiesLoose(_this$props, ["amounts", "divider"]);
  
      const {
        USD
      } = amounts,
            amountsWithoutUSD = _objectWithoutPropertiesLoose(amounts, ["USD"]); // Sort the currencies so that USD is last
  
  
      const currencies = Object.keys(amountsWithoutUSD);
      currencies.sort((a, b) => a.localeCompare(b));
  
      if (typeof USD !== 'undefined') {
        currencies.push(_constants.DEFAULT_CURRENCY);
      } // Loop through and generate the prices
  
  
      const output = [];
      currencies.forEach((currency, i) => {
        if (i > 0) {
          output.push(_react.default.createElement("span", {
            key: "divider-" + currency
          }, divider));
        }
  
        output.push(_react.default.createElement(_Price.default, _extends({
          key: currency
        }, restProps, {
          amount: amounts[currency],
          currency: currency
        })));
      });
      return _react.default.createElement("span", null, output);
    }
  
  }
  
  exports.default = PriceGroup;
  
  _defineProperty(PriceGroup, "propTypes", {
    divider: _propTypes.default.string,
    amounts: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number])).isRequired
  });
  
  _defineProperty(PriceGroup, "defaultProps", {
    divider: ', '
  });