"use strict";(self.webpackChunk_department_of_veterans_affairs_component_library=self.webpackChunk_department_of_veterans_affairs_component_library||[]).push([[1365],{1365:function(e,i,s){s.r(i),s.d(i,{va_banner:function(){return o}});var n=s(9213),t=function(e,i,s){if(s||2===arguments.length)for(var n,t=0,a=i.length;t<a;t++)!n&&t in i||(n||(n=Array.prototype.slice.call(i,0,t)),n[t]=i[t]);return e.concat(n||Array.prototype.slice.call(i))},a="DISMISSED_BANNERS",o=function(){function e(e){var i=this;(0,n.r)(this,e),this.componentLibraryAnalytics=(0,n.c)(this,"component-library-analytics",7),this.prepareBannerID=function(){return i.dismissedBannerId&&i.dismissedBannerId.length?i.dismissedBannerId:"".concat(i.headline,":").concat(i.el.innerHTML)},this.dismiss=function(){var e=i.prepareBannerID();if(!i.dismissedBanners.includes(e)&&i.showClose){if(!i.disableAnalytics&&i.el.shadowRoot){var s={componentName:"va-banner",action:"close",details:{headline:i.headline}};i.componentLibraryAnalytics.emit(s)}var n=t(t([],i.dismissedBanners,!0),[e],!1);(i.windowSession?window.sessionStorage:window.localStorage).setItem(a,JSON.stringify(n)),i.dismissedBanners=n}},this.disableAnalytics=!1,this.showClose=!1,this.headline=void 0,this.type="info",this.visible=!0,this.windowSession=!1,this.dataLabel=void 0,this.dismissedBannerId=void 0,this.dismissedBanners=[]}return e.prototype.componentWillLoad=function(){if(this.showClose){var e=(this.windowSession?window.sessionStorage:window.localStorage).getItem(a);this.dismissedBanners=e?JSON.parse(e):[]}},e.prototype.render=function(){var e,i=this.showClose&&(null===(e=this.dismissedBanners)||void 0===e?void 0:e.includes(this.prepareBannerID()));if(!this.visible||i)return null;var s=this.showClose?this.dismiss:void 0,t=this.dataLabel||"".concat(this.type[0].toUpperCase()).concat(this.type.slice(1)," banner");return(0,n.h)(n.H,null,(0,n.h)("va-alert",{id:"va-banner-alert",visible:!0,"full-width":!0,closeable:this.showClose,onCloseEvent:s,status:this.type,"data-role":"region","data-label":t},(0,n.h)("h3",{slot:"headline"},this.headline),(0,n.h)("slot",null)))},Object.defineProperty(e.prototype,"el",{get:function(){return(0,n.g)(this)},enumerable:!1,configurable:!0}),e}();o.style=".usa-sr-only{position:absolute;left:-999em;right:auto}:is(va-alert)>:is(h1,h2,h3,h4,h5,h6){font-size:1.33rem;margin-top:-2px;margin-bottom:8px;line-height:var(--vads-font-line-height-2)}"}}]);