{"version":3,"file":"ironsource-fusion-ui-components-notification-common-services.mjs","sources":["../../../projects/fusion-ui/components/notification/common/services/notification.service.ts","../../../projects/fusion-ui/components/notification/common/services/ironsource-fusion-ui-components-notification-common-services.ts"],"sourcesContent":["import {Injectable} from '@angular/core';\nimport {NotificationType, Notification} from '@ironsource/fusion-ui/components/notification/common/entities';\nimport {BehaviorSubject} from 'rxjs';\n\nconst NO_NOTIFICATION = {\n    type: NotificationType.Basic,\n    title: '',\n    content: '',\n    shown: false\n};\n\n@Injectable({\n    providedIn: 'root'\n})\nexport class NotificationService {\n    notification$ = new BehaviorSubject<Notification>(NO_NOTIFICATION);\n\n    showNotification(notificationOptions: Notification): void {\n        this.notification$.next({...notificationOptions, shown: true});\n    }\n\n    setPrimaryButtonLoadingState(state: boolean): void {\n        const currentButtons = this.notification$.getValue().buttons;\n        currentButtons.primary.loading = state;\n        this.notification$.next({...this.notification$.getValue(), buttons: currentButtons});\n    }\n\n    hideNotification() {\n        this.notification$.next(NO_NOTIFICATION);\n    }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAIA,MAAM,eAAe,GAAG;IACpB,IAAI,EAAE,gBAAgB,CAAC,KAAK;AAC5B,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,KAAK,EAAE,KAAK;CACf,CAAC;MAKW,mBAAmB,CAAA;AAHhC,IAAA,WAAA,GAAA;AAII,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,eAAe,CAAe,eAAe,CAAC,CAAC;AAetE,KAAA;AAbG,IAAA,gBAAgB,CAAC,mBAAiC,EAAA;AAC9C,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAC,GAAG,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;KAClE;AAED,IAAA,4BAA4B,CAAC,KAAc,EAAA;QACvC,MAAM,cAAc,GAAG,IAAI,CAAC,aA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