"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
var _styles = require("@material-ui/core/styles");
var _reactIntl = require("react-intl");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
/* eslint-disable react/style-prop-object */
var useStyles = (0, _styles.makeStyles)(function (theme) {
  return {
    regular: {
      fontSize: theme.typography.fieldLabelSize,
      fontFamily: theme.typography.fontFamily,
      textDecoration: "line-through",
      display: "inline-block"
    },
    current: {
      fontSize: theme.typography.fontSize,
      fontFamily: theme.typography.fontFamily,
      display: "inline-block"
    },
    container: {
      display: "flex",
      flexDirection: "column"
    }
  };
});
var DiscountedPrice = function DiscountedPrice(_ref) {
  var regular = _ref.regular,
    current = _ref.current,
    currency = _ref.currency;
  var classes = useStyles();
  if (regular === current) {
    return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedNumber, {
      style: "currency",
      currency: currency,
      value: current
    });
  }
  var regularPrice = /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedNumber, {
    style: "currency",
    currency: currency,
    value: regular
  });
  var currentPrice = /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedNumber, {
    style: "currency",
    currency: currency,
    value: current
  });
  var discountedPrice = /*#__PURE__*/_react.default.createElement("div", {
    className: classes.container
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
    children: regularPrice,
    className: classes.regular
  }), /*#__PURE__*/_react.default.createElement(_Typography.default, {
    children: currentPrice,
    className: classes.current
  }));
  return discountedPrice;
};
__signature__(DiscountedPrice, "useStyles{classes}", function () {
  return [useStyles];
});
__signature__(DiscountedPrice, "useStyles{classes}", function () {
  return [useStyles];
});
var _default = DiscountedPrice;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js");
  reactHotLoader.register(DiscountedPrice, "DiscountedPrice", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js");
  reactHotLoader.register(DiscountedPrice, "DiscountedPrice", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();