import{r as t,h as i}from"./p-1a7a8b00.js";import{k as s}from"./p-a44cd541.js";import{s as n}from"./p-b4467cc2.js";const o=class{constructor(i){t(this,i),this.handleSubscriptions=()=>{this.storeUnsubscribe&&this.storeUnsubscribe(),n.mapDispatchToProps(this,{removeNotification:s}),this.storeUnsubscribe=n.mapStateToProps(this,this.mapStateToProps)},this.mapStateToProps=t=>({notifications:t.notifications}),this.handleRemoveNotification=t=>{this.removeNotification(t)},this.notifications=void 0,this.useExternal=!1}resetState(){this.notifications=[]}connectedCallback(){this.resetState(),this.handleSubscriptions()}componentWillLoad(){this.useExternal=!!customElements.get("bp-sdk-external-notifications-container"),customElements.whenDefined("bp-sdk-external-notifications-container").then((()=>{this.useExternal=!0})),this.handleSubscriptions()}render(){return[this.useExternal&&this.renderExternal(),!this.useExternal&&this.renderInternal()]}renderExternal(){return i("bp-sdk-external-notifications-container",{notifications:this.notifications})}renderInternal(){if(this.notifications.length>0)return i("div",{class:"bp-sdk-notifications-container__container"},this.notifications.map((t=>this.renderNotifications(t))))}renderNotifications(t){return i("bp-sdk-notification",{notification:t,removeNotification:this.handleRemoveNotification})}};o.style="";export{o as bp_sdk_notifications_container}