1 | {"version":3,"file":"angular-fire-messaging.js","sources":["../../../src/messaging/messaging.ts","../../../src/messaging/messaging.module.ts","../../../src/messaging/overrides.ts","../../../src/messaging/firebase.ts","../../../src/messaging/angular-fire-messaging.ts"],"sourcesContent":["import { Messaging as FirebaseMessaging } from 'firebase/messaging';\nimport { ɵgetAllInstancesOf } from '@angular/fire';\nimport { from, timer } from 'rxjs';\nimport { concatMap, distinct } from 'rxjs/operators';\n\n// see notes in core/firebase.app.module.ts for why we're building the class like this\n// tslint:disable-next-line:no-empty-interface\nexport interface Messaging extends FirebaseMessaging {}\n\nexport class Messaging {\n constructor(messaging: FirebaseMessaging) {\n return messaging;\n }\n}\n\nexport const MESSAGING_PROVIDER_NAME = 'messaging';\n\n// tslint:disable-next-line:no-empty-interface\nexport interface MessagingInstances extends Array<FirebaseMessaging> {}\n\nexport class MessagingInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseMessaging>(MESSAGING_PROVIDER_NAME);\n }\n}\n\nexport const messagingInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseMessaging>(MESSAGING_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector, APP_INITIALIZER } from '@angular/core';\nimport { Messaging as FirebaseMessaging } from 'firebase/messaging';\nimport { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION, ɵisMessagingSupportedFactory } from '@angular/fire';\nimport { Messaging, MessagingInstances, MESSAGING_PROVIDER_NAME } from './messaging';\nimport { FirebaseApps, FirebaseApp } from '@angular/fire/app';\nimport { registerVersion } from 'firebase/app';\n\nconst PROVIDED_MESSAGING_INSTANCES = new InjectionToken<Messaging[]>('angularfire2.messaging-instances');\n\nexport function defaultMessagingInstanceFactory(provided: FirebaseMessaging[]|undefined, defaultApp: FirebaseApp) {\n if (!ɵisMessagingSupportedFactory.sync()) { return null; }\n const defaultMessaging = ɵgetDefaultInstanceOf<FirebaseMessaging>(MESSAGING_PROVIDER_NAME, provided, defaultApp);\n return defaultMessaging && new Messaging(defaultMessaging);\n}\n\nexport function messagingInstanceFactory(fn: (injector: Injector) => FirebaseMessaging) {\n return (zone: NgZone, injector: Injector) => {\n if (!ɵisMessagingSupportedFactory.sync()) { return null; }\n const messaging = zone.runOutsideAngular(() => fn(injector));\n return new Messaging(messaging);\n };\n}\n\nconst MESSAGING_INSTANCES_PROVIDER = {\n provide: MessagingInstances,\n deps: [\n [new Optional(), PROVIDED_MESSAGING_INSTANCES ],\n ]\n};\n\nconst DEFAULT_MESSAGING_INSTANCE_PROVIDER = {\n provide: Messaging,\n useFactory: defaultMessagingInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_MESSAGING_INSTANCES ],\n FirebaseApp,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_MESSAGING_INSTANCE_PROVIDER,\n MESSAGING_INSTANCES_PROVIDER,\n {\n provide: APP_INITIALIZER,\n useValue: ɵisMessagingSupportedFactory.async,\n multi: true,\n },\n ]\n})\nexport class MessagingModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'fcm');\n }\n}\n\nexport function provideMessaging(fn: () => FirebaseMessaging, ...deps: any[]): ModuleWithProviders<MessagingModule> {\n return {\n ngModule: MessagingModule,\n providers: [{\n provide: PROVIDED_MESSAGING_INSTANCES,\n useFactory: messagingInstanceFactory(fn),\n multi: true,\n deps: [\n NgZone,\n Injector,\n ɵAngularFireSchedulers,\n FirebaseApps,\n ...deps,\n ],\n }]\n };\n}\n","import { ɵisMessagingSupportedFactory } from '@angular/fire';\n\nexport const isSupported = ɵisMessagingSupportedFactory.async;\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nexport * from 'firebase/messaging';\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n deleteToken as _deleteToken,\n getMessaging as _getMessaging,\n getToken as _getToken,\n onMessage as _onMessage\n} from 'firebase/messaging';\n\nexport {\n isSupported\n} from './overrides';\n\nexport const deleteToken = ɵzoneWrap(_deleteToken, true);\nexport const getMessaging = ɵzoneWrap(_getMessaging, true);\nexport const getToken = ɵzoneWrap(_getToken, true);\nexport const onMessage = ɵzoneWrap(_onMessage, false);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["_deleteToken","_getMessaging","_getToken","_onMessage"],"mappings":";;;;;;;;;;MASa,SAAS;IACpB,YAAY,SAA4B;QACtC,OAAO,SAAS,CAAC;KAClB;CACF;AAEM,MAAM,uBAAuB,GAAG,WAAW,CAAC;MAKtC,kBAAkB;IAC7B;QACE,OAAO,kBAAkB,CAAoB,uBAAuB,CAAC,CAAC;KACvE;CACF;MAEY,kBAAkB,GAAG,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAClD,SAAS,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAoB,uBAAuB,CAAC,CAAC,CAAC,EACrF,QAAQ,EAAE;;ACrBZ,MAAM,4BAA4B,GAAG,IAAI,cAAc,CAAc,kCAAkC,CAAC,CAAC;SAEzF,+BAA+B,CAAC,QAAuC,EAAE,UAAuB;IAC9G,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IAC1D,MAAM,gBAAgB,GAAG,qBAAqB,CAAoB,uBAAuB,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IACjH,OAAO,gBAAgB,IAAI,IAAI,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAC7D,CAAC;SAEe,wBAAwB,CAAC,EAA6C;IACpF,OAAO,CAAC,IAAY,EAAE,QAAkB;QACtC,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,EAAE;YAAE,OAAO,IAAI,CAAC;SAAE;QAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7D,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,CAAC;KACjC,CA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