import*as t from"lit/directives/style-map.js";import*as e from"lit";import*as s from"@momentum-ui/utils/lib/getColorValue";import*as r from"lit/directives/if-defined.js";import*as i from"lit/directives/class-map.js";import*as o from"mobx";import*as a from"lit/decorators.js";import*as n from"@momentum-ui/icons/data/momentumUiIconsNames.json";var l,p,c={1156(e,s,r){var i,o;e.exports=(i={styleMap:()=>t.styleMap},o={},r.d(o,i),o)},2927(t,s,r){var i,o;t.exports=(i={LitElement:()=>e.LitElement,css:()=>e.css,html:()=>e.html,nothing:()=>e.nothing},o={},r.d(o,i),o)},3496(t,e,r){var i,o;t.exports=(i={default:()=>s.default},o={},r.d(o,i),o)},3517(t,e,s){var i,o;t.exports=(i={ifDefined:()=>r.ifDefined},o={},s.d(o,i),o)},4955(t,e,s){var r,o;t.exports=(r={classMap:()=>i.classMap},o={},s.d(o,r),o)},4980(t,e,s){var r,i;t.exports=(r={action:()=>o.action,observable:()=>o.observable},i={},s.d(i,r),i)},8899(t,e,s){var r,i;t.exports=(r={property:()=>a.property,query:()=>a.query,state:()=>a.state},i={},s.d(i,r),i)},9144(t,e,s){s.d(e,{$_:()=>m,ZT:()=>d,wH:()=>h}),s(5983),s(1821);var r=s(9609),i=s(7154),o=s(4084),a=s(2927),n=s(8899),l=s(4955),p=s(4839),c=function(t,e,s,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,r);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(a=(o<3?i(a):o>3?i(e,s,a):i(e,s))||a);return o>3&&a&&Object.defineProperty(e,s,a),a};const m=["default","accent","warning","error","success","default-momentum","promotional"],h=["center","leading"];var d;!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.type="",this.titleText="",this.message="",this.closable=!1,this.show=!1,this.closeAriaLabel="Close Banner",this.showBannerTypeIcon=!1,this.showRefreshButton=!1,this.alignment="center"}connectedCallback(){super.connectedCallback()}onHide(){this.show=!this.show,this.dispatchEvent(new CustomEvent("alertBanner-hide"))}onRefreshClick(){this.dispatchEvent(new CustomEvent("alertBanner-refresh-button-click"))}handleKeyDown(t){const{code:e}=t;(0,i.o)(e)&&this.onHide()}get isLeadingAlignment(){return"leading"===this.alignment}static get styles(){return[o.A,p.A]}getIconForType(){switch(this.type){case"error":return"error-legacy-bold";case"warning":return"warning-bold";case"success":return"check-circle-bold";default:return"info-circle-bold"}}get alertBannerClassMap(){return{"md-alert-banner":!0,[`md-alert-banner--${this.type}`]:this.type,"md-alert-banner--leading":this.isLeadingAlignment||this.titleText,closable:this.closable,"with-title":!!this.titleText}}get alertBannerTextClassMap(){return{"md-alert-banner__text":!0,"md-alert-banner__with-title":!!this.titleText,leading:this.isLeadingAlignment||this.titleText}}get alertBannerRightClassMap(){return{trailing:this.isLeadingAlignment||this.titleText}}get closeButtonTemplate(){const t=this.titleText?"close-div with-title":"close-div";return a.html`
        <div class="${t}">
          <md-button
            class="md-alert-banner__close"
            hasRemoveStyle
            circle
            ariaLabel=${this.closeAriaLabel}
            @click=${this.onHide}
            @keydown=${this.handleKeyDown}
          >
            <md-icon name="cancel-bold" size="16" iconSet="momentumDesign"></md-icon>
          </md-button>
        </div>
      `}get titleTemplate(){return this.titleText?a.html`<div class="md-alert-banner__title">${this.titleText}</div>`:a.nothing}render(){const t=this.closable?a.html` ${this.closeButtonTemplate} `:a.nothing,e=this.showBannerTypeIcon||this.titleText?"with-icon":"",s=this.showBannerTypeIcon?a.html`
            <md-icon
              class=${(0,l.classMap)({"md-alert-banner__icon":!0,"with-title":!!this.titleText})}
              name="${this.getIconForType()}"
              iconSet="momentumDesign"
              size="20"
            >
            </md-icon>
          `:a.html`<slot name="left"></slot>`,r=this.titleText?"refresh-button-with-title":"refresh-button",i=this.showRefreshButton?a.html` <md-button
            class="${r}"
            @click=${this.onRefreshClick}
            variant="ghostInheritTextColor"
            circle
            size="20"
          >
            <md-icon name="refresh-bold" iconSet="momentumDesign" size="16"></md-icon>
          </md-button>`:a.nothing;return this.titleText?a.html`
          ${this.show?a.html`
                <div class="${(0,l.classMap)(this.alertBannerClassMap)}" role="alert">
                  <div class="${(0,l.classMap)(this.alertBannerTextClassMap)}">
                    <div class="md-alert-banner__text-content ${e}">
                      ${s} ${this.titleTemplate}
                      <slot><span>${this.message}</span></slot>
                    </div>
                  </div>
                  <div class="md-alert-banner__top-right-centered">
                    <div class="md-alert-banner__top-right-centered-content">
                      ${i}
                      <div class="md-alert-banner__right ${(0,l.classMap)(this.alertBannerRightClassMap)}">
                        <slot name="right"></slot>
                      </div>
                      ${t}
                    </div>
                  </div>
                </div>
              `:a.nothing}
        `:a.html`
          ${this.show?a.html`
                <div class="${(0,l.classMap)(this.alertBannerClassMap)}" role="alert">
                  <div class="${(0,l.classMap)(this.alertBannerTextClassMap)}">
                    ${s}
                    <slot><span>${this.message}</span></slot>
                    ${i}
                  </div>
                  <div class="md-alert-banner__right ${(0,l.classMap)(this.alertBannerRightClassMap)}">
                    <slot name="right"></slot>
                  </div>
                  ${t}
                </div>
              `:a.nothing}
        `}};c([(0,n.property)({type:String})],e.prototype,"type",void 0),c([(0,n.property)({type:String})],e.prototype,"titleText",void 0),c([(0,n.property)({type:String})],e.prototype,"message",void 0),c([(0,n.property)({type:Boolean})],e.prototype,"closable",void 0),c([(0,n.property)({type:Boolean})],e.prototype,"show",void 0),c([(0,n.property)({type:String,attribute:"close-aria-label"})],e.prototype,"closeAriaLabel",void 0),c([(0,n.property)({type:Boolean})],e.prototype,"showBannerTypeIcon",void 0),c([(0,n.property)({type:Boolean})],e.prototype,"showRefreshButton",void 0),c([(0,n.property)({type:String})],e.prototype,"alignment",void 0),e=c([(0,r.w)("md-alert-banner")],e),t.ELEMENT=e}(d||(d={}))},9500(t,e,s){var r,i;t.exports=(r={default:()=>n.default},i={},s.d(i,r),i)}},m={};function h(t){var e=m[t];if(void 0!==e)return e.exports;var s=m[t]={exports:{}};return c[t](s,s.exports,h),s.exports}h.m=c,l=[],h.O=(t,e,s,r)=>{if(!e){var i=1/0;for(p=0;p<l.length;p++){for(var[e,s,r]=l[p],o=!0,a=0;a<e.length;a++)(!1&r||i>=r)&&Object.keys(h.O).every(t=>h.O[t](e[a]))?e.splice(a--,1):(o=!1,r<i&&(i=r));if(o){l.splice(p--,1);var n=s();void 0!==n&&(t=n)}}return t}r=r||0;for(var p=l.length;p>0&&l[p-1][2]>r;p--)l[p]=l[p-1];l[p]=[e,s,r]},h.d=(t,e)=>{for(var s in e)h.o(e,s)&&!h.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},h.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{h as __webpack_require__};p={502:0,1745:0,4545:0,4928:0,5369:0,6029:0,6060:0,6920:0,8111:0,8442:0},h.C=t=>{var e,s,{__webpack_esm_ids__:r,__webpack_esm_modules__:i,__webpack_esm_runtime__:o}=t,a=0;for(e in i)h.o(i,e)&&(h.m[e]=i[e]);for(o&&o(h);a<r.length;a++)s=r[a],h.o(p,s)&&p[s]&&p[s][0](),p[r[a]]=0;h.O()},h.O.j=t=>0===p[t];import*as d from"../9609.js";h.C(d);import*as v from"../4084.js";h.C(v);import*as g from"../3305.js";h.C(g);import*as f from"../4739.js";h.C(f);import*as u from"../7154.js";h.C(u);import*as y from"../9773.js";h.C(y);import*as b from"../5983.js";h.C(b);import*as _ from"../9488.js";h.C(_);import*as w from"../1821.js";h.C(w);import*as x from"../519.js";h.C(x);import*as T from"../4839.js";h.C(T);var $=h.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,4839],()=>h(9144));const C=($=h.O($)).ZT,B=$.wH,j=$.$_;export{C as AlertBanner,B as alertBannerAlignment,j as alertBannerType};