"use strict";const r=require("./InfoIcon-57b0b7a1.js"),s=require("./Alert-dec85153.js"),p=require("classnames"),e=require("react"),_=require("react-feather"),l=require("./Button-44f4db23.js"),f="alert _alert_d2ea0",h="messageContainer _messageContainer_f6faf",v="icon _icon_e9371",w="close _close_46ec6",y="success _success_ff70d",A="danger _danger_73506",E="info _info_45cec",N="warning _warning_6de68",B="help _help_7ffec",C="withoutBackground _withoutBackground_67988",I="message _message_99b18",n={alert:f,messageContainer:h,icon:v,close:w,success:y,danger:A,info:E,warning:N,help:B,withoutBackground:C,message:I};class o extends e.Component{render(){const{className:u,children:t,type:a,onDismiss:c,dataQa:m=null,dismissDataQa:g=null}=this.props;return e.createElement("div",{className:p(n.alert,u,a&&n[a]),role:"alert","data-qa-id":m},e.createElement("div",{className:n.messageContainer},e.createElement("span",{className:n.icon},d(a)),e.createElement("span",{className:n.message},typeof t=="function"?t():t)),!!c&&e.createElement(l.Button,{className:n.close,"data-qa-id":g,buttonStyle:l.ButtonStyle.NONE,buttonType:l.ButtonType.PLAIN,onClick:()=>{c&&c()}},e.createElement(_.X,{size:"1em"})))}}o.defaultProps={};o.className={withoutBackground:n.withoutBackground};function d(i){switch(i){case s.AlertType.success:return e.createElement(_.CheckCircle,null);case s.AlertType.danger:return e.createElement(r.DangerIcon,null);case s.AlertType.warning:return e.createElement(_.AlertCircle,null);case s.AlertType.info:return e.createElement(r.InfoIcon,null);case s.AlertType.help:return e.createElement(r.HelpIcon,null);default:return null}}exports.Alert=o;exports.getAlertIcon=d;
