"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=exports.propTypes=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));require("core-js/modules/es6.regexp.replace");var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_objectSpread2=_interopRequireDefault(require("@babel/runtime/helpers/objectSpread")),_react=_interopRequireWildcard(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_classnames=_interopRequireDefault(require("classnames")),_componentHelper=require("../../shared/component-helper"),_IconPrimary=_interopRequireDefault(require("../../components/icon-primary/IconPrimary")),renderProps={},propTypes={notification_amount:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.number]),title_text:_propTypes.default.string,class:_propTypes.default.string,className:_propTypes.default.string,children:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.node,_propTypes.default.func])};exports.propTypes=propTypes;var defaultProps=(0,_objectSpread2.default)({notification_amount:0,title_text:null,class:null,className:null,children:null},renderProps);exports.defaultProps=defaultProps;var _ref=_react.default.createElement("span",{className:"dnb-notification__icon"},_react.default.createElement(_IconPrimary.default,{className:"dnb-notification__icon",icon:"bell"})),Notification=function(e){function t(){return(0,_classCallCheck2.default)(this,t),(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(t).apply(this,arguments))}return(0,_inherits2.default)(t,e),(0,_createClass2.default)(t,[{key:"render",value:function(){var e=this.props,t=e.notification_amount,r=e.title_text,a=e.className,i=e.class,n={className:(0,_classnames.default)("dnb-notification",a,i,0<t?"dnb-notification--has-notification":null)},o={title:r.replace(/{amount}/,t)};return(0,_componentHelper.validateDOMAttributes)(this.props,n),_react.default.createElement("div",n,_react.default.createElement("button",(0,_extends2.default)({className:"dnb-notification__button"},o),_react.default.createElement("span",{className:"dnb-notification__inner"},_ref,0<t&&_react.default.createElement("span",{className:"dnb-notification__amount"},_react.default.createElement("span",{className:"dnb-notification__amount__inner"},t)))))}}],[{key:"enableWebComponent",value:function(){(0,_componentHelper.registerElement)(t.tagName,t,defaultProps)}}]),t}(_react.PureComponent);exports.default=Notification,(0,_defineProperty2.default)(Notification,"tagName","dnb-notification"),(0,_defineProperty2.default)(Notification,"defaultProps",defaultProps),Notification.propTypes="production"!==process.env.NODE_ENV?propTypes:{};
//# sourceMappingURL=Notification.js.map
