"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf3=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_assertThisInitialized2=_interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),React=_interopRequireWildcard(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_withStyles=_interopRequireDefault(require("../../hoc/withStyles")),_ErrorBoundary=_interopRequireDefault(require("../../hoc/ErrorBoundary")),_styles=_interopRequireDefault(require("./styles")),FieldLabel=/*#__PURE__*/function(_React$Component){function FieldLabel(){var _getPrototypeOf2,_this;(0,_classCallCheck2.default)(this,FieldLabel);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _this=(0,_possibleConstructorReturn2.default)(this,(_getPrototypeOf2=(0,_getPrototypeOf3.default)(FieldLabel)).call.apply(_getPrototypeOf2,[this].concat(args))),(0,_defineProperty2.default)((0,_assertThisInitialized2.default)((0,_assertThisInitialized2.default)(_this)),"state",{}),_this}return(0,_inherits2.default)(FieldLabel,_React$Component),(0,_createClass2.default)(FieldLabel,[{key:"render",value:function render(){var _this$props=this.props,classes=_this$props.classes,label=_this$props.label,extraLinkWithLabel=_this$props.extraLinkWithLabel;return React.createElement(_ErrorBoundary.default,null,React.createElement("div",{className:classes.component},(!!label||!!extraLinkWithLabel)&&React.createElement("div",{className:classes.wrapper},!!label&&React.createElement("div",{className:classes.label},label),!!extraLinkWithLabel&&React.createElement("div",{"data-test":"extra-link-with-label-".concat(extraLinkWithLabel+""),className:classes.linkWithLabel,onClick:this.props.onExtraLinkClicked},extraLinkWithLabel))))}}]),FieldLabel}(React.Component);(0,_defineProperty2.default)(FieldLabel,"propTypes",{label:_propTypes.default.string.isRequired,labelColor:_propTypes.default.string,extraLinkWithLabel:_propTypes.default.string,onExtraLinkClicked:_propTypes.default.func,classes:_propTypes.default.object,theme:_propTypes.default.any}),(0,_defineProperty2.default)(FieldLabel,"defaultProps",{extraLinkWithLabel:"",onExtraLinkClicked:function onExtraLinkClicked(){}});var _default=(0,_withStyles.default)(_styles.default)(FieldLabel);exports.default=_default;