Liferay.Loader.define("frontend-js-web@5.0.45/liferay/toast/commands/OpenToast.es",["module","exports","require","@frontend-taglib-clay$clayui/alert","@liferay/frontend-js-react-web","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dom","../../util/build_fragment","../../../css/notification.scss"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.openToast=f,t.default=void 0;var a=s(n("@frontend-taglib-clay$clayui/alert")),r=n("@liferay/frontend-js-react-web"),o=s(n("liferay!frontend-js-react-web$classnames")),i=s(n("liferay!frontend-js-react-web$react")),c=n("liferay!frontend-js-react-web$react-dom"),l=s(n("../../util/build_fragment"));function s(e){return e&&e.__esModule?e:{default:e}}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}n("../../../css/notification.scss");const e="ToastAlertContainer",m={portletId:"UNKNOWN_PORTLET_ID"},y={danger:Liferay.Language.get("error"),info:Liferay.Language.get("info"),success:Liferay.Language.get("success"),warning:Liferay.Language.get("warning")},g=5e3,p='\n\t<div class="alert-container cadmin container">\n\t\t<div class="alert-notifications alert-notifications-fixed" id='.concat(e,"></div>\n\t</div>\n"),v=({container:t,containerId:n})=>{if((t||n)&&(t=t||document.getElementById(n))){const e=document.createElement("div");return t.appendChild(e),e}let a=document.getElementById(e);a||(a=(0,l.default)(p).querySelector(".alert-container.container"),a=document.body.appendChild(a)),t=document.createElement("div");return document.querySelector(".alert-notifications.alert-notifications-fixed").appendChild(t),t};function f({autoClose:e=g,container:t,containerId:n,message:l="",onClick:s=(()=>{}),onClose:f=(()=>{}),renderData:u=m,title:p,toastProps:b={},type:w="success",variant:C}){const j=v({container:t,containerId:n});(0,c.unmountComponentAtNode)(j);const L=e=>{f&&f({event:e}),e&&e.defaultPrevented||(t&&n||j.parentNode.removeChild(j),(0,c.unmountComponentAtNode)(j))};let _=void 0===p?y[w]:p;_?(_=_.replace(/:$/,""),_='<strong class="lead">'.concat(_,":</strong>")):_="",(0,r.render)(i.default.createElement(a.default,d({autoClose:e,displayType:w,onClick:e=>s({event:e,onClose:L}),onClose:L,variant:C},b,{className:(0,o.default)("mb-3",null==b?void 0:b.className)}),i.default.createElement("div",{dangerouslySetInnerHTML:{__html:"".concat(_).concat(l)}})),u,j)}var u=f;t.default=u}}));
//# sourceMappingURL=OpenToast.es.js.map