import{r as i,h as t,H as o,g as s}from"./p-5a5f5509.js";import{c as a}from"./p-c608c6dc.js";import{s as e}from"./p-bf956c1d.js";const n=class{constructor(t){i(this,t),this.variant="informational",this.dismissible=!1,this.timeout=!1,this.close=()=>{this.opened=!1}}componentDidLoad(){this.hasSlotText=!!this.hostElement.querySelector("p[slot='text']")}componentDidRender(){this.timeout&&setTimeout(this.close,!0===this.timeout?3e3:this.timeout)}connectedCallback(){e({source:this.hostElement,type:"warn"})}async open(){this.opened=!0}handleIcons(){if(this.variant)switch(this.variant){case"success":return t("scale-notification-message-svg",{class:"notification-message__icon-success","accessibility-title":"success"});case"informational":return t("scale-icon-alert-information",{class:"notification-message__icon-information","accessibility-title":"information"});case"error":return t("scale-icon-alert-warning",{class:"notification-message__icon-error","accessibility-title":"error"});case"warning":return t("scale-icon-alert-information",{class:"notification-message__icon-information",color:"#AE461C","accessibility-title":"information"})}}render(){return this.opened?t(o,null,t("div",{part:this.getBasePartMap(),class:this.getCssClassMap(),tabindex:"0"},t("div",{part:"container",class:"notification-message__container"},this.handleIcons(),t("div",{part:"heading",class:"notification-message__heading"},t("slot",null," "),this.dismissible&&t("scale-icon-action-circle-close",{tabindex:"0",class:"notification-message__icon-close",onClick:()=>{this.close()},onKeyDown:i=>{"Enter"===i.key&&this.close()},"accessibility-title":"close"})),this.hasSlotText&&t("div",{part:"text",class:"notification-message__text"},t("slot",{name:"text"}))))):null}getBasePartMap(){return this.getCssOrBasePartMap("basePart")}getCssClassMap(){return this.getCssOrBasePartMap("css")}getCssOrBasePartMap(i){const t="notification-message";return a(t,this.variant&&`${"basePart"===i?"":`${t}--`}variant-${this.variant}`)}get hostElement(){return s(this)}};n.style=":host{--width:100%;--radius:var(--scl-radius-8);--border:1px solid var(--scl-color-white);--background-error:hsla(353.79999999999995, 100%, 88.6%, 0.35);--background-warning:hsla(33.5, 100%, 75.1%, 0.3);--background-informational:hsla(190.20000000000005, 100%, 92%, 0.75);--background-success:hsl(98.80000000000001, 49.7%, 61%, 0.2)}.notification-message{border:var(--border);border-radius:var(--radius);width:var(--width);position:relative}.notification-message--variant-error{background:var(--background-error)}.notification-message--variant-warning{background-color:var(--background-warning)}.notification-message--variant-informational{background-color:var(--background-informational)}.notification-message--variant-success{background-color:var(--background-success)}.notification-message__heading{margin:14px 48px 14px 48px;font-weight:var(--scl-font-weight-bold);line-height:var(--scl-font-line-height-125)}.notification-message__text{margin:8px 48px 15px 48px}::slotted(*){font-weight:var(--scl-font-weight-regular)}.notification-message__icon-close{position:absolute;top:8px;right:13.5px;color:black}.notification-message__icon-close svg{height:19px;width:19px;padding:6.5px;border-radius:20%}.notification-message__icon-close:hover svg{background-color:white;color:var(--scl-color-primary-hover)}.notification-message__icon-success{position:absolute;top:13.5px;left:17px;height:20px;width:20px;color:var(--scl-color-background-success)}.notification-message__icon-error{position:absolute;top:12px;left:17px;height:20px;width:20px;color:var(--scl-color-background-error)}.notification-message__icon-information{position:absolute;top:12px;left:17px;height:20px;width:20px;color:var(--scl-color-text-info)}@media screen and (forced-colors: active), (-ms-high-contrast: active){.notification-message__icon-close{color:white}}";export{n as scale_notification_message}