{ "version": 3, "sources": ["src/app/shared-dialogs/components/group-action-dialog/group-action-dialog.component.ts", "src/app/shared-dialogs/components/group-action-dialog/group-action-dialog.component.html", "src/app/core/_services/browser-notifications.service.ts"], "sourcesContent": ["import { Component, OnInit, Inject, Output, EventEmitter } from '@angular/core'\nimport { MatDialogRef, MAT_DIALOG_DATA, MatDialogConfig, MatDialog } from '@angular/material/dialog'\nimport { GroupMember } from '@app/core/_models/rest_api'\nimport { GroupService } from '@app/core/_services/group.service'\nimport { AnalyticsService } from '@app/core/_services/analytics.service'\n\n@Component({\n selector: 'app-group-action-dialog',\n templateUrl: './group-action-dialog.component.html',\n styleUrls: ['./group-action-dialog.component.scss'],\n standalone: false,\n})\nexport class GroupActionDialogComponent implements OnInit {\n @Output() actionTaken: EventEmitter = new EventEmitter()\n public member: GroupMember = new GroupMember()\n\n constructor(\n private analyticsService: AnalyticsService,\n public groupService: GroupService,\n public dialog: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public data: any,\n ) {}\n\n ngOnInit() {\n if (this.data.modalViewedEvent) {\n this.analyticsService.logViewedModalEvent(this.data.modalViewedEvent)\n }\n }\n\n actionTriggered(triggered: boolean) {\n this.actionTaken.emit(triggered)\n }\n}\n", "\n \n
{{ data.mainHeader }}
\n
\n\n
\n
\n
\n
{{ data.contentHeader }}
\n
{{ data.contentSubtext }}
\n\n {{ data.buttonLabel }}\n \n \n
\n
\n", "import { Injectable } from '@angular/core'\nimport { ReplaySubject } from 'rxjs'\nimport { AnalyticsService } from './analytics.service'\nimport { PlayToneService } from './play-tone.service'\nimport * as Sentry from '@sentry/angular'\n\nexport type NotificationsPermissionState = NotificationPermission | 'unsupported'\n\n@Injectable({\n providedIn: 'root',\n})\nexport class BrowserNotificationsService {\n public notificationsPermissionState: ReplaySubject =\n new ReplaySubject(1)\n\n constructor(\n private playToneService: PlayToneService,\n private analyticsService: AnalyticsService,\n ) {\n this.notificationsPermissionState.next(this.getCurrentNotificationsPermissionsState())\n }\n\n public async requestNotificationPermissions(): Promise {\n if (!('Notification' in window)) {\n return 'unsupported'\n }\n const state = await Notification.requestPermission()\n this.notificationsPermissionState.next(state)\n return state\n }\n\n public getCurrentNotificationsPermissionsState(): NotificationsPermissionState {\n if (!('Notification' in window)) {\n return 'unsupported'\n } else {\n return Notification.permission\n }\n }\n\n public async notify(title: string, options: NotificationOptions = {}) {\n const permissionsState = this.getCurrentNotificationsPermissionsState()\n let notificationSuccess = true\n try {\n const notification = new Notification(title, {\n icon: '../assets/images/f_logo_small.png',\n badge: '../assets/images/f_logo_small.png',\n ...options,\n })\n\n notification.onclick = () => {\n notification.close()\n window.focus()\n }\n } catch (e) {\n notificationSuccess = false\n console.error(e)\n Sentry.captureException(e)\n }\n\n let soundSuccess = true\n try {\n await this.playToneService.playAlertTone()\n } catch (e) {\n soundSuccess = false\n }\n\n this.analyticsService.logDesktopNotificationEvent(\n permissionsState,\n notificationSuccess,\n soundSuccess,\n )\n }\n}\n"], "mappings": "sTAYA,IAAaA,GAA0B,IAAA,CAAjC,IAAOA,EAAP,MAAOA,CAA0B,CAInCC,YACYC,EACDC,EACAC,EACyBC,EAAS,CAHjC,KAAAH,iBAAAA,EACD,KAAAC,aAAAA,EACA,KAAAC,OAAAA,EACyB,KAAAC,KAAAA,EAP1B,KAAAC,YAAqC,IAAIC,EAC5C,KAAAC,OAAsB,IAAIC,CAO9B,CAEHC,UAAQ,CACA,KAAKL,KAAKM,kBACV,KAAKT,iBAAiBU,oBAAoB,KAAKP,KAAKM,gBAAgB,CAE5E,CAEAE,gBAAgBC,EAAkB,CAC9B,KAAKR,YAAYS,KAAKD,CAAS,CACnC,yCAnBSd,GAA0BgB,EAAAC,CAAA,EAAAD,EAAAE,CAAA,EAAAF,EAAAG,CAAA,EAAAH,EAQvBI,CAAe,CAAA,CAAA,sBARlBpB,EAA0BqB,UAAA,CAAA,CAAA,yBAAA,CAAA,EAAAC,QAAA,CAAAhB,YAAA,aAAA,EAAAiB,WAAA,GAAAC,MAAA,GAA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AAa,CAC5C,MAAY,CACRD,EAAe,EACnB,CAEA,KAAK5B,iBAAiB8B,4BAClBf,EACAC,EACAY,CAAY,CAEpB,2CA5DS/B,GAA2BkC,EAAAC,CAAA,EAAAD,EAAAE,CAAA,CAAA,CAAA,wBAA3BpC,EAA2BqC,QAA3BrC,EAA2BsC,UAAAC,WAFxB,MAAM,CAAA,EAEhB,IAAOvC,EAAPwC,SAAOxC,CAA2B,GAAA", "names": ["GroupActionDialogComponent", "constructor", "analyticsService", "groupService", "dialog", "data", "actionTaken", "EventEmitter", "member", "GroupMember", "ngOnInit", "modalViewedEvent", "logViewedModalEvent", "actionTriggered", "triggered", "emit", "\u0275\u0275directiveInject", "AnalyticsService", "GroupService", "MatDialogRef", "MAT_DIALOG_DATA", "selectors", "outputs", "standalone", "decls", "vars", "consts", "template", "rf", "ctx", "\u0275\u0275elementStart", "\u0275\u0275text", "\u0275\u0275elementEnd", "\u0275\u0275element", "\u0275\u0275listener", "close", "\u0275\u0275advance", "\u0275\u0275textInterpolate", "mainHeader", "\u0275\u0275property", "photoUrl", "\u0275\u0275sanitizeUrl", "contentHeader", "contentSubtext", "buttonLabel", "buttonLoadingLabel", "_GroupActionDialogComponent", "BrowserNotificationsService", "constructor", "playToneService", "analyticsService", "notificationsPermissionState", "ReplaySubject", "next", "getCurrentNotificationsPermissionsState", "requestNotificationPermissions", "__async", "window", "state", "Notification", "requestPermission", "permission", "notify", "title", "options", "permissionsState", "notificationSuccess", "notification", "__spreadValues", "icon", "badge", "onclick", "close", "focus", "e", "console", "error", "captureException", "soundSuccess", "playAlertTone", "logDesktopNotificationEvent", "\u0275\u0275inject", "PlayToneService", "AnalyticsService", "factory", "\u0275fac", "providedIn", "_BrowserNotificationsService"] }