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