import * as i0 from '@angular/core';
import { Injectable } from '@angular/core';
import { NotificationType } from '@ironsource/fusion-ui/components/notification/common/entities';
import { BehaviorSubject } from 'rxjs';

const NO_NOTIFICATION = {
    type: NotificationType.Basic,
    title: '',
    content: '',
    shown: false
};
class NotificationService {
    constructor() {
        this.notification$ = new BehaviorSubject(NO_NOTIFICATION);
    }
    showNotification(notificationOptions) {
        this.notification$.next({ ...notificationOptions, shown: true });
    }
    setPrimaryButtonLoadingState(state) {
        const currentButtons = this.notification$.getValue().buttons;
        currentButtons.primary.loading = state;
        this.notification$.next({ ...this.notification$.getValue(), buttons: currentButtons });
    }
    hideNotification() {
        this.notification$.next(NO_NOTIFICATION);
    }
    static { this.ɵfac = function NotificationService_Factory(t) { return new (t || NotificationService)(); }; }
    static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NotificationService, factory: NotificationService.ɵfac, providedIn: 'root' }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NotificationService, [{
        type: Injectable,
        args: [{
                providedIn: 'root'
            }]
    }], null, null); })();

/**
 * Generated bundle index. Do not edit.
 */

export { NotificationService };
//# sourceMappingURL=ironsource-fusion-ui-components-notification-common-services.mjs.map
