"use strict";

exports.__esModule = true;
exports.default = void 0;
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _provider = _interopRequireWildcard(require("../../../atom/provider"));
var _range = _interopRequireDefault(require("../../../atom/range"));
var _style = _interopRequireDefault(require("./style.css"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const QuestionRange = (props, legacyContext) => {
  const {
    title,
    minLabel,
    maxLabel,
    groupAriaLabel,
    ...rangeProps
  } = props;
  const skin = (0, _provider.GetSkinFromContext)(legacyContext);
  const defaultColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
  const titleStyle = {
    color: defaultColor
  };
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.wrapper,
    role: "group",
    "aria-label": groupAriaLabel,
    title: groupAriaLabel
  }, /*#__PURE__*/_react.default.createElement("span", {
    style: titleStyle,
    className: (0, _classnames.default)(_style.default.title, _style.default.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: title
    }
  }), /*#__PURE__*/_react.default.createElement(_range.default, rangeProps), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.labelWrapper
  }, /*#__PURE__*/_react.default.createElement("span", {
    className: (0, _classnames.default)(_style.default.label, _style.default.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: minLabel
    }
  }), /*#__PURE__*/_react.default.createElement("span", {
    className: (0, _classnames.default)(_style.default.label, _style.default.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: maxLabel
    }
  })));
};
QuestionRange.contextTypes = {
  skin: _provider.default.childContextTypes.skin
};
QuestionRange.propTypes = process.env.NODE_ENV !== "production" ? {
  ..._range.default.propTypes,
  title: _propTypes.default.string,
  minLabel: _propTypes.default.string,
  maxLabel: _propTypes.default.string,
  groupAriaLabel: _propTypes.default.string
} : {};
var _default = exports.default = QuestionRange;
//# sourceMappingURL=index.js.map