@angular/service-worker 12.2.8 → 13.0.0-next.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/config/config.d.ts +1 -1
  2. package/config/package.json +5 -5
  3. package/{esm2015/config/config.js → esm2020/config/config.mjs} +0 -0
  4. package/{esm2015/config/index.js → esm2020/config/index.mjs} +0 -0
  5. package/{esm2015/config/public_api.js → esm2020/config/public_api.mjs} +0 -0
  6. package/{esm2015/config/src/duration.js → esm2020/config/src/duration.mjs} +0 -0
  7. package/{esm2015/config/src/filesystem.js → esm2020/config/src/filesystem.mjs} +0 -0
  8. package/esm2020/config/src/generator.mjs +147 -0
  9. package/{esm2015/config/src/glob.js → esm2020/config/src/glob.mjs} +0 -0
  10. package/{esm2015/config/src/in.js → esm2020/config/src/in.mjs} +0 -0
  11. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  12. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  13. package/esm2020/service-worker.mjs +5 -0
  14. package/{esm2015/src/index.js → esm2020/src/index.mjs} +0 -0
  15. package/esm2020/src/low_level.mjs +78 -0
  16. package/esm2020/src/module.mjs +128 -0
  17. package/esm2020/src/push.mjs +174 -0
  18. package/esm2020/src/update.mjs +61 -0
  19. package/fesm2015/{config.js → config.mjs} +2 -9
  20. package/fesm2015/config.mjs.map +1 -0
  21. package/fesm2015/{service-worker.js → service-worker.mjs} +23 -20
  22. package/fesm2015/service-worker.mjs.map +1 -0
  23. package/fesm2020/config.mjs +267 -0
  24. package/fesm2020/config.mjs.map +1 -0
  25. package/fesm2020/service-worker.mjs +463 -0
  26. package/fesm2020/service-worker.mjs.map +1 -0
  27. package/ngsw-config.js +169 -218
  28. package/ngsw-worker.js +1421 -1587
  29. package/package.json +36 -9
  30. package/service-worker.d.ts +29 -29
  31. package/bundles/service-worker-config.umd.js +0 -626
  32. package/bundles/service-worker-config.umd.js.map +0 -1
  33. package/bundles/service-worker.umd.js +0 -804
  34. package/bundles/service-worker.umd.js.map +0 -1
  35. package/config/config.metadata.json +0 -1
  36. package/config/index.ngfactory.d.ts +0 -2
  37. package/config/index.ngsummary.d.ts +0 -2
  38. package/config/public_api.ngfactory.d.ts +0 -2
  39. package/config/public_api.ngsummary.d.ts +0 -2
  40. package/config/src/duration.ngfactory.d.ts +0 -2
  41. package/config/src/duration.ngsummary.d.ts +0 -2
  42. package/config/src/filesystem.ngfactory.d.ts +0 -2
  43. package/config/src/filesystem.ngsummary.d.ts +0 -2
  44. package/config/src/generator.ngfactory.d.ts +0 -2
  45. package/config/src/generator.ngsummary.d.ts +0 -2
  46. package/config/src/glob.ngfactory.d.ts +0 -2
  47. package/config/src/glob.ngsummary.d.ts +0 -2
  48. package/config/src/in.ngfactory.d.ts +0 -2
  49. package/config/src/in.ngsummary.d.ts +0 -2
  50. package/config.d.ts +0 -7
  51. package/config.metadata.json +0 -1
  52. package/esm2015/config/config.externs.js +0 -6
  53. package/esm2015/config/src/generator.js +0 -150
  54. package/esm2015/service-worker.externs.js +0 -6
  55. package/esm2015/service-worker.js +0 -7
  56. package/esm2015/src/low_level.js +0 -75
  57. package/esm2015/src/module.js +0 -123
  58. package/esm2015/src/push.js +0 -173
  59. package/esm2015/src/update.js +0 -60
  60. package/fesm2015/config.js.map +0 -1
  61. package/fesm2015/service-worker.js.map +0 -1
  62. package/service-worker.metadata.json +0 -1
@@ -0,0 +1,174 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { Injectable } from '@angular/core';
9
+ import { merge, NEVER, Subject } from 'rxjs';
10
+ import { map, switchMap, take } from 'rxjs/operators';
11
+ import { ERR_SW_NOT_SUPPORTED, NgswCommChannel } from './low_level';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "./low_level";
14
+ /**
15
+ * Subscribe and listen to
16
+ * [Web Push
17
+ * Notifications](https://developer.mozilla.org/en-US/docs/Web/API/Push_API/Best_Practices) through
18
+ * Angular Service Worker.
19
+ *
20
+ * @usageNotes
21
+ *
22
+ * You can inject a `SwPush` instance into any component or service
23
+ * as a dependency.
24
+ *
25
+ * <code-example path="service-worker/push/module.ts" region="inject-sw-push"
26
+ * header="app.component.ts"></code-example>
27
+ *
28
+ * To subscribe, call `SwPush.requestSubscription()`, which asks the user for permission.
29
+ * The call returns a `Promise` with a new
30
+ * [`PushSubscription`](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription)
31
+ * instance.
32
+ *
33
+ * <code-example path="service-worker/push/module.ts" region="subscribe-to-push"
34
+ * header="app.component.ts"></code-example>
35
+ *
36
+ * A request is rejected if the user denies permission, or if the browser
37
+ * blocks or does not support the Push API or ServiceWorkers.
38
+ * Check `SwPush.isEnabled` to confirm status.
39
+ *
40
+ * Invoke Push Notifications by pushing a message with the following payload.
41
+ *
42
+ * ```ts
43
+ * {
44
+ * "notification": {
45
+ * "actions": NotificationAction[],
46
+ * "badge": USVString,
47
+ * "body": DOMString,
48
+ * "data": any,
49
+ * "dir": "auto"|"ltr"|"rtl",
50
+ * "icon": USVString,
51
+ * "image": USVString,
52
+ * "lang": DOMString,
53
+ * "renotify": boolean,
54
+ * "requireInteraction": boolean,
55
+ * "silent": boolean,
56
+ * "tag": DOMString,
57
+ * "timestamp": DOMTimeStamp,
58
+ * "title": DOMString,
59
+ * "vibrate": number[]
60
+ * }
61
+ * }
62
+ * ```
63
+ *
64
+ * Only `title` is required. See `Notification`
65
+ * [instance
66
+ * properties](https://developer.mozilla.org/en-US/docs/Web/API/Notification#Instance_properties).
67
+ *
68
+ * While the subscription is active, Service Worker listens for
69
+ * [PushEvent](https://developer.mozilla.org/en-US/docs/Web/API/PushEvent)
70
+ * occurrences and creates
71
+ * [Notification](https://developer.mozilla.org/en-US/docs/Web/API/Notification)
72
+ * instances in response.
73
+ *
74
+ * Unsubscribe using `SwPush.unsubscribe()`.
75
+ *
76
+ * An application can subscribe to `SwPush.notificationClicks` observable to be notified when a user
77
+ * clicks on a notification. For example:
78
+ *
79
+ * <code-example path="service-worker/push/module.ts" region="subscribe-to-notification-clicks"
80
+ * header="app.component.ts"></code-example>
81
+ *
82
+ * You can read more on handling notification clicks in the [Service worker notifications
83
+ * guide](guide/service-worker-notifications).
84
+ *
85
+ * @see [Push Notifications](https://developers.google.com/web/fundamentals/codelabs/push-notifications/)
86
+ * @see [Angular Push Notifications](https://blog.angular-university.io/angular-push-notifications/)
87
+ * @see [MDN: Push API](https://developer.mozilla.org/en-US/docs/Web/API/Push_API)
88
+ * @see [MDN: Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API)
89
+ * @see [MDN: Web Push API Notifications best practices](https://developer.mozilla.org/en-US/docs/Web/API/Push_API/Best_Practices)
90
+ *
91
+ * @publicApi
92
+ */
93
+ export class SwPush {
94
+ constructor(sw) {
95
+ this.sw = sw;
96
+ this.subscriptionChanges = new Subject();
97
+ if (!sw.isEnabled) {
98
+ this.messages = NEVER;
99
+ this.notificationClicks = NEVER;
100
+ this.subscription = NEVER;
101
+ return;
102
+ }
103
+ this.messages = this.sw.eventsOfType('PUSH').pipe(map(message => message.data));
104
+ this.notificationClicks =
105
+ this.sw.eventsOfType('NOTIFICATION_CLICK').pipe(map((message) => message.data));
106
+ this.pushManager = this.sw.registration.pipe(map(registration => registration.pushManager));
107
+ const workerDrivenSubscriptions = this.pushManager.pipe(switchMap(pm => pm.getSubscription()));
108
+ this.subscription = merge(workerDrivenSubscriptions, this.subscriptionChanges);
109
+ }
110
+ /**
111
+ * True if the Service Worker is enabled (supported by the browser and enabled via
112
+ * `ServiceWorkerModule`).
113
+ */
114
+ get isEnabled() {
115
+ return this.sw.isEnabled;
116
+ }
117
+ /**
118
+ * Subscribes to Web Push Notifications,
119
+ * after requesting and receiving user permission.
120
+ *
121
+ * @param options An object containing the `serverPublicKey` string.
122
+ * @returns A Promise that resolves to the new subscription object.
123
+ */
124
+ requestSubscription(options) {
125
+ if (!this.sw.isEnabled) {
126
+ return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));
127
+ }
128
+ const pushOptions = { userVisibleOnly: true };
129
+ let key = this.decodeBase64(options.serverPublicKey.replace(/_/g, '/').replace(/-/g, '+'));
130
+ let applicationServerKey = new Uint8Array(new ArrayBuffer(key.length));
131
+ for (let i = 0; i < key.length; i++) {
132
+ applicationServerKey[i] = key.charCodeAt(i);
133
+ }
134
+ pushOptions.applicationServerKey = applicationServerKey;
135
+ return this.pushManager.pipe(switchMap(pm => pm.subscribe(pushOptions)), take(1))
136
+ .toPromise()
137
+ .then(sub => {
138
+ this.subscriptionChanges.next(sub);
139
+ return sub;
140
+ });
141
+ }
142
+ /**
143
+ * Unsubscribes from Service Worker push notifications.
144
+ *
145
+ * @returns A Promise that is resolved when the operation succeeds, or is rejected if there is no
146
+ * active subscription or the unsubscribe operation fails.
147
+ */
148
+ unsubscribe() {
149
+ if (!this.sw.isEnabled) {
150
+ return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));
151
+ }
152
+ const doUnsubscribe = (sub) => {
153
+ if (sub === null) {
154
+ throw new Error('Not subscribed to push notifications.');
155
+ }
156
+ return sub.unsubscribe().then(success => {
157
+ if (!success) {
158
+ throw new Error('Unsubscribe failed!');
159
+ }
160
+ this.subscriptionChanges.next(null);
161
+ });
162
+ };
163
+ return this.subscription.pipe(take(1), switchMap(doUnsubscribe)).toPromise();
164
+ }
165
+ decodeBase64(input) {
166
+ return atob(input);
167
+ }
168
+ }
169
+ SwPush.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwPush, deps: [{ token: i1.NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
170
+ SwPush.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwPush });
171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwPush, decorators: [{
172
+ type: Injectable
173
+ }], ctorParameters: function () { return [{ type: i1.NgswCommChannel }]; } });
174
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3NlcnZpY2Utd29ya2VyL3NyYy9wdXNoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFDLEtBQUssRUFBRSxLQUFLLEVBQWMsT0FBTyxFQUFDLE1BQU0sTUFBTSxDQUFDO0FBQ3ZELE9BQU8sRUFBQyxHQUFHLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBRXBELE9BQU8sRUFBQyxvQkFBb0IsRUFBRSxlQUFlLEVBQVksTUFBTSxhQUFhLENBQUM7OztBQUc3RTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBOEVHO0FBRUgsTUFBTSxPQUFPLE1BQU07SUEyQ2pCLFlBQW9CLEVBQW1CO1FBQW5CLE9BQUUsR0FBRixFQUFFLENBQWlCO1FBRi9CLHdCQUFtQixHQUFHLElBQUksT0FBTyxFQUF5QixDQUFDO1FBR2pFLElBQUksQ0FBQyxFQUFFLENBQUMsU0FBUyxFQUFFO1lBQ2pCLElBQUksQ0FBQyxRQUFRLEdBQUcsS0FBSyxDQUFDO1lBQ3RCLElBQUksQ0FBQyxrQkFBa0IsR0FBRyxLQUFLLENBQUM7WUFDa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3JpYmUoKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgaWYgKCF0aGlzLnN3LmlzRW5hYmxlZCkge1xuICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KG5ldyBFcnJvcihFUlJfU1dfTk9UX1NVUFBPUlRFRCkpO1xuICAgIH1cblxuICAgIGNvbnN0IGRvVW5zdWJzY3JpYmUgPSAoc3ViOiBQdXNoU3Vic2NyaXB0aW9ufG51bGwpID0+IHtcbiAgICAgIGlmIChzdWIgPT09IG51bGwpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdOb3Qgc3Vic2NyaWJlZCB0byBwdXNoIG5vdGlmaWNhdGlvbnMuJyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzdWIudW5zdWJzY3JpYmUoKS50aGVuKHN1Y2Nlc3MgPT4ge1xuICAgICAgICBpZiAoIXN1Y2Nlc3MpIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1Vuc3Vic2NyaWJlIGZhaWxlZCEnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc3Vic2NyaXB0aW9uQ2hhbmdlcy5uZXh0KG51bGwpO1xuICAgICAgfSk7XG4gICAgfTtcblxuICAgIHJldHVybiB0aGlzLnN1YnNjcmlwdGlvbi5waXBlKHRha2UoMSksIHN3aXRjaE1hcChkb1Vuc3Vic2NyaWJlKSkudG9Qcm9taXNlKCk7XG4gIH1cblxuICBwcml2YXRlIGRlY29kZUJhc2U2NChpbnB1dDogc3RyaW5nKTogc3RyaW5nIHtcbiAgICByZXR1cm4gYXRvYihpbnB1dCk7XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { Injectable } from '@angular/core';
9
+ import { NEVER } from 'rxjs';
10
+ import { ERR_SW_NOT_SUPPORTED, NgswCommChannel } from './low_level';
11
+ import * as i0 from "@angular/core";
12
+ import * as i1 from "./low_level";
13
+ /**
14
+ * Subscribe to update notifications from the Service Worker, trigger update
15
+ * checks, and forcibly activate updates.
16
+ *
17
+ * @see {@link guide/service-worker-communications Service worker communication guide}
18
+ *
19
+ * @publicApi
20
+ */
21
+ export class SwUpdate {
22
+ constructor(sw) {
23
+ this.sw = sw;
24
+ if (!sw.isEnabled) {
25
+ this.available = NEVER;
26
+ this.activated = NEVER;
27
+ this.unrecoverable = NEVER;
28
+ return;
29
+ }
30
+ this.available = this.sw.eventsOfType('UPDATE_AVAILABLE');
31
+ this.activated = this.sw.eventsOfType('UPDATE_ACTIVATED');
32
+ this.unrecoverable = this.sw.eventsOfType('UNRECOVERABLE_STATE');
33
+ }
34
+ /**
35
+ * True if the Service Worker is enabled (supported by the browser and enabled via
36
+ * `ServiceWorkerModule`).
37
+ */
38
+ get isEnabled() {
39
+ return this.sw.isEnabled;
40
+ }
41
+ checkForUpdate() {
42
+ if (!this.sw.isEnabled) {
43
+ return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));
44
+ }
45
+ const statusNonce = this.sw.generateNonce();
46
+ return this.sw.postMessageWithStatus('CHECK_FOR_UPDATES', { statusNonce }, statusNonce);
47
+ }
48
+ activateUpdate() {
49
+ if (!this.sw.isEnabled) {
50
+ return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));
51
+ }
52
+ const statusNonce = this.sw.generateNonce();
53
+ return this.sw.postMessageWithStatus('ACTIVATE_UPDATE', { statusNonce }, statusNonce);
54
+ }
55
+ }
56
+ SwUpdate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwUpdate, deps: [{ token: i1.NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
57
+ SwUpdate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwUpdate });
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwUpdate, decorators: [{
59
+ type: Injectable
60
+ }], ctorParameters: function () { return [{ type: i1.NgswCommChannel }]; } });
61
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXBkYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvc2VydmljZS13b3JrZXIvc3JjL3VwZGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUMsVUFBVSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sRUFBQyxLQUFLLEVBQWEsTUFBTSxNQUFNLENBQUM7QUFFdkMsT0FBTyxFQUFDLG9CQUFvQixFQUFFLGVBQWUsRUFBc0UsTUFBTSxhQUFhLENBQUM7OztBQUl2STs7Ozs7OztHQU9HO0FBRUgsTUFBTSxPQUFPLFFBQVE7SUEwQm5CLFlBQW9CLEVBQW1CO1FBQW5CLE9BQUUsR0FBRixFQUFFLENBQWlCO1FBQ3JDLElBQUksQ0FBQyxFQUFFLENBQUMsU0FBUyxFQUFFO1lBQ2pCLElBQUksQ0FBQyxTQUFTLEdBQUcsS0FBSyxDQUFDO1lBQ3ZCLElBQUksQ0FBQyxTQUFTLEdBQUcsS0FBSyxDQUFDO1lBQ3ZCLElBQUksQ0FBQyxhQUFhLEdBQUcsS0FBSyxDQUFDO1lBQzNCLE9BQU87U0FDUjtRQUNELElBQUksQ0FBQyxTQUFTLEdBQUcsSUFBSSxDQUFDLEVBQUUsQ0FBQyxZQUFZLENBQXVCLGtCQUFrQixDQUFDLENBQUM7UUFDaEYsSUFBSSxDQUFDLFNBQVMsR0FBRyxJQUFJLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBdUIsa0JBQW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gICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgRXJyb3IoRVJSX1NXX05PVF9TVVBQT1JURUQpKTtcbiAgICB9XG4gICAgY29uc3Qgc3RhdHVzTm9uY2UgPSB0aGlzLnN3LmdlbmVyYXRlTm9uY2UoKTtcbiAgICByZXR1cm4gdGhpcy5zdy5wb3N0TWVzc2FnZVdpdGhTdGF0dXMoJ0FDVElWQVRFX1VQREFURScsIHtzdGF0dXNOb25jZX0sIHN0YXR1c05vbmNlKTtcbiAgfVxufVxuIl19
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.2.8
2
+ * @license Angular v13.0.0-next.11
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -100,13 +100,6 @@ function globToRegex(glob, literalQuestionMark = false) {
100
100
  return regex;
101
101
  }
102
102
 
103
- /**
104
- * @license
105
- * Copyright Google LLC All Rights Reserved.
106
- *
107
- * Use of this source code is governed by an MIT-style license that can be
108
- * found in the LICENSE file at https://angular.io/license
109
- */
110
103
  const DEFAULT_NAVIGATION_URLS = [
111
104
  '/**',
112
105
  '!/**/*.*',
@@ -268,4 +261,4 @@ function buildCacheQueryOptions(inOptions) {
268
261
  */
269
262
 
270
263
  export { Generator };
271
- //# sourceMappingURL=config.js.map
264
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","sources":["../../../../../../packages/service-worker/config/src/duration.ts","../../../../../../packages/service-worker/config/src/glob.ts","../../../../../../packages/service-worker/config/src/generator.ts","../../../../../../packages/service-worker/config/public_api.ts","../../../../../../packages/service-worker/config/index.ts","../../../../../../packages/service-worker/config/config.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nconst PARSE_TO_PAIRS = /([0-9]+[^0-9]+)/g;\nconst PAIR_SPLIT = /^([0-9]+)([dhmsu]+)$/;\n\nexport function parseDurationToMs(duration: string): number {\n const matches: string[] = [];\n\n let array: RegExpExecArray|null;\n while ((array = PARSE_TO_PAIRS.exec(duration)) !== null) {\n matches.push(array[0]);\n }\n return matches\n .map(match => {\n const res = PAIR_SPLIT.exec(match);\n if (res === null) {\n throw new Error(`Not a valid duration: ${match}`);\n }\n let factor: number = 0;\n switch (res[2]) {\n case 'd':\n factor = 86400000;\n break;\n case 'h':\n factor = 3600000;\n break;\n case 'm':\n factor = 60000;\n break;\n case 's':\n factor = 1000;\n break;\n case 'u':\n factor = 1;\n break;\n default:\n throw new Error(`Not a valid duration unit: ${res[2]}`);\n }\n return parseInt(res[1]) * factor;\n })\n .reduce((total, value) => total + value, 0);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nconst QUESTION_MARK = '[^/]';\nconst WILD_SINGLE = '[^/]*';\nconst WILD_OPEN = '(?:.+\\\\/)?';\n\nconst TO_ESCAPE_BASE = [\n {replace: /\\./g, with: '\\\\.'},\n {replace: /\\+/g, with: '\\\\+'},\n {replace: /\\*/g, with: WILD_SINGLE},\n];\nconst TO_ESCAPE_WILDCARD_QM = [\n ...TO_ESCAPE_BASE,\n {replace: /\\?/g, with: QUESTION_MARK},\n];\nconst TO_ESCAPE_LITERAL_QM = [\n ...TO_ESCAPE_BASE,\n {replace: /\\?/g, with: '\\\\?'},\n];\n\nexport function globToRegex(glob: string, literalQuestionMark = false): string {\n const toEscape = literalQuestionMark ? TO_ESCAPE_LITERAL_QM : TO_ESCAPE_WILDCARD_QM;\n const segments = glob.split('/').reverse();\n let regex: string = '';\n while (segments.length > 0) {\n const segment = segments.pop()!;\n if (segment === '**') {\n if (segments.length > 0) {\n regex += WILD_OPEN;\n } else {\n regex += '.*';\n }\n } else {\n const processed = toEscape.reduce(\n (segment, escape) => segment.replace(escape.replace, escape.with), segment);\n regex += processed;\n if (segments.length > 0) {\n regex += '\\\\/';\n }\n }\n }\n return regex;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {parseDurationToMs} from './duration';\nimport {Filesystem} from './filesystem';\nimport {globToRegex} from './glob';\nimport {Config} from './in';\n\nconst DEFAULT_NAVIGATION_URLS = [\n '/**', // Include all URLs.\n '!/**/*.*', // Exclude URLs to files (containing a file extension in the last segment).\n '!/**/*__*', // Exclude URLs containing `__` in the last segment.\n '!/**/*__*/**', // Exclude URLs containing `__` in any other segment.\n];\n\n/**\n * Consumes service worker configuration files and processes them into control files.\n *\n * @publicApi\n */\nexport class Generator {\n constructor(readonly fs: Filesystem, private baseHref: string) {}\n\n async process(config: Config): Promise<Object> {\n const unorderedHashTable = {};\n const assetGroups = await this.processAssetGroups(config, unorderedHashTable);\n\n return {\n configVersion: 1,\n timestamp: Date.now(),\n appData: config.appData,\n index: joinUrls(this.baseHref, config.index),\n assetGroups,\n dataGroups: this.processDataGroups(config),\n hashTable: withOrderedKeys(unorderedHashTable),\n navigationUrls: processNavigationUrls(this.baseHref, config.navigationUrls),\n navigationRequestStrategy: config.navigationRequestStrategy ?? 'performance',\n };\n }\n\n private async processAssetGroups(config: Config, hashTable: {[file: string]: string|undefined}):\n Promise<Object[]> {\n const seenMap = new Set<string>();\n return Promise.all((config.assetGroups || []).map(async (group) => {\n if ((group.resources as any).versionedFiles) {\n throw new Error(\n `Asset-group '${group.name}' in 'ngsw-config.json' uses the 'versionedFiles' option, ` +\n 'which is no longer supported. Use \\'files\\' instead.');\n }\n\n const fileMatcher = globListToMatcher(group.resources.files || []);\n const allFiles = await this.fs.list('/');\n\n const matchedFiles = allFiles.filter(fileMatcher).filter(file => !seenMap.has(file)).sort();\n matchedFiles.forEach(file => seenMap.add(file));\n\n // Add the hashes.\n await matchedFiles.reduce(async (previous, file) => {\n await previous;\n const hash = await this.fs.hash(file);\n hashTable[joinUrls(this.baseHref, file)] = hash;\n }, Promise.resolve());\n\n return {\n name: group.name,\n installMode: group.installMode || 'prefetch',\n updateMode: group.updateMode || group.installMode || 'prefetch',\n cacheQueryOptions: buildCacheQueryOptions(group.cacheQueryOptions),\n urls: matchedFiles.map(url => joinUrls(this.baseHref, url)),\n patterns: (group.resources.urls || []).map(url => urlToRegex(url, this.baseHref, true)),\n };\n }));\n }\n\n private processDataGroups(config: Config): Object[] {\n return (config.dataGroups || []).map(group => {\n return {\n name: group.name,\n patterns: group.urls.map(url => urlToRegex(url, this.baseHref, true)),\n strategy: group.cacheConfig.strategy || 'performance',\n maxSize: group.cacheConfig.maxSize,\n maxAge: parseDurationToMs(group.cacheConfig.maxAge),\n timeoutMs: group.cacheConfig.timeout && parseDurationToMs(group.cacheConfig.timeout),\n cacheQueryOptions: buildCacheQueryOptions(group.cacheQueryOptions),\n version: group.version !== undefined ? group.version : 1,\n };\n });\n }\n}\n\nexport function processNavigationUrls(\n baseHref: string, urls = DEFAULT_NAVIGATION_URLS): {positive: boolean, regex: string}[] {\n return urls.map(url => {\n const positive = !url.startsWith('!');\n url = positive ? url : url.substr(1);\n return {positive, regex: `^${urlToRegex(url, baseHref)}$`};\n });\n}\n\nfunction globListToMatcher(globs: string[]): (file: string) => boolean {\n const patterns = globs.map(pattern => {\n if (pattern.startsWith('!')) {\n return {\n positive: false,\n regex: new RegExp('^' + globToRegex(pattern.substr(1)) + '$'),\n };\n } else {\n return {\n positive: true,\n regex: new RegExp('^' + globToRegex(pattern) + '$'),\n };\n }\n });\n return (file: string) => matches(file, patterns);\n}\n\nfunction matches(file: string, patterns: {positive: boolean, regex: RegExp}[]): boolean {\n const res = patterns.reduce((isMatch, pattern) => {\n if (pattern.positive) {\n return isMatch || pattern.regex.test(file);\n } else {\n return isMatch && !pattern.regex.test(file);\n }\n }, false);\n return res;\n}\n\nfunction urlToRegex(url: string, baseHref: string, literalQuestionMark?: boolean): string {\n if (!url.startsWith('/') && url.indexOf('://') === -1) {\n // Prefix relative URLs with `baseHref`.\n // Strip a leading `.` from a relative `baseHref` (e.g. `./foo/`), since it would result in an\n // incorrect regex (matching a literal `.`).\n url = joinUrls(baseHref.replace(/^\\.(?=\\/)/, ''), url);\n }\n\n return globToRegex(url, literalQuestionMark);\n}\n\nfunction joinUrls(a: string, b: string): string {\n if (a.endsWith('/') && b.startsWith('/')) {\n return a + b.substr(1);\n } else if (!a.endsWith('/') && !b.startsWith('/')) {\n return a + '/' + b;\n }\n return a + b;\n}\n\nfunction withOrderedKeys<T extends {[key: string]: any}>(unorderedObj: T): T {\n const orderedObj = {} as {[key: string]: any};\n Object.keys(unorderedObj).sort().forEach(key => orderedObj[key] = unorderedObj[key]);\n return orderedObj as T;\n}\n\nfunction buildCacheQueryOptions(inOptions?: Pick<CacheQueryOptions, 'ignoreSearch'>):\n CacheQueryOptions {\n return {\n ignoreVary: true,\n ...inOptions,\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {Filesystem} from './src/filesystem';\nexport {Generator} from './src/generator';\nexport {AssetGroup, Config, DataGroup, Duration, Glob} from './src/in';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;AAQA,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,MAAM,UAAU,GAAG,sBAAsB,CAAC;SAE1B,iBAAiB,CAAC,QAAgB;IAChD,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,IAAI,KAA2B,CAAC;IAChC,OAAO,CAAC,K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GAAG,EAAE,mBAAmB,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS;IACpC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACxC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACxB;SAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACjD,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;KACpB;IACD,OAAO,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,SAAS,eAAe,CAAiC,YAAe;IACtE,MAAM,UAAU,GAAG,EAA0B,CAAC;IAC9C,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IACrF,OAAO,UAAe,CAAC;AACzB,CAAC;AAED,SAAS,sBAAsB,CAAC,SAAmD;IAEjF,uBACE,UAAU,EAAE,IAAI,IACb,SAAS,EACZ;AACJ;;ACpKA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;"}
@@ -1,10 +1,11 @@
1
1
  /**
2
- * @license Angular v12.2.8
2
+ * @license Angular v13.0.0-next.11
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { isPlatformBrowser } from '@angular/common';
8
+ import * as i0 from '@angular/core';
8
9
  import { Injectable, InjectionToken, NgZone, ApplicationRef, PLATFORM_ID, APP_INITIALIZER, Injector, NgModule } from '@angular/core';
9
10
  import { defer, throwError, fromEvent, of, concat, Subject, NEVER, merge } from 'rxjs';
10
11
  import { map, filter, switchMap, publish, take, tap, delay } from 'rxjs/operators';
@@ -244,12 +245,11 @@ class SwPush {
244
245
  return atob(input);
245
246
  }
246
247
  }
247
- SwPush.decorators = [
248
- { type: Injectable }
249
- ];
250
- SwPush.ctorParameters = () => [
251
- { type: NgswCommChannel }
252
- ];
248
+ SwPush.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwPush, deps: [{ token: NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
249
+ SwPush.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwPush });
250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwPush, decorators: [{
251
+ type: Injectable
252
+ }], ctorParameters: function () { return [{ type: NgswCommChannel }]; } });
253
253
 
254
254
  /**
255
255
  * @license
@@ -301,12 +301,11 @@ class SwUpdate {
301
301
  return this.sw.postMessageWithStatus('ACTIVATE_UPDATE', { statusNonce }, statusNonce);
302
302
  }
303
303
  }
304
- SwUpdate.decorators = [
305
- { type: Injectable }
306
- ];
307
- SwUpdate.ctorParameters = () => [
308
- { type: NgswCommChannel }
309
- ];
304
+ SwUpdate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwUpdate, deps: [{ token: NgswCommChannel }], target: i0.ɵɵFactoryTarget.Injectable });
305
+ SwUpdate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwUpdate });
306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: SwUpdate, decorators: [{
307
+ type: Injectable
308
+ }], ctorParameters: function () { return [{ type: NgswCommChannel }]; } });
310
309
 
311
310
  /**
312
311
  * @license
@@ -418,11 +417,15 @@ class ServiceWorkerModule {
418
417
  };
419
418
  }
420
419
  }
421
- ServiceWorkerModule.decorators = [
422
- { type: NgModule, args: [{
423
- providers: [SwPush, SwUpdate],
424
- },] }
425
- ];
420
+ ServiceWorkerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: ServiceWorkerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
421
+ ServiceWorkerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: ServiceWorkerModule });
422
+ ServiceWorkerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: ServiceWorkerModule, providers: [SwPush, SwUpdate] });
423
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.11", ngImport: i0, type: ServiceWorkerModule, decorators: [{
424
+ type: NgModule,
425
+ args: [{
426
+ providers: [SwPush, SwUpdate],
427
+ }]
428
+ }] });
426
429
 
427
430
  /**
428
431
  * @license
@@ -453,5 +456,5 @@ ServiceWorkerModule.decorators = [
453
456
  * Generated bundle index. Do not edit.
454
457
  */
455
458
 
456
- export { ServiceWorkerModule, SwPush, SwRegistrationOptions, SwUpdate, NgswCommChannel as ɵangular_packages_service_worker_service_worker_a, SCRIPT as ɵangular_packages_service_worker_service_worker_b, ngswAppInitializer as ɵangular_packages_service_worker_service_worker_c, ngswCommChannelFactory as ɵangular_packages_service_worker_service_worker_d };
457
- //# sourceMappingURL=service-worker.js.map
459
+ export { ServiceWorkerModule, SwPush, SwRegistrationOptions, SwUpdate };
460
+ //# sourceMappingURL=service-worker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-worker.mjs","sources":["../../../../../../packages/service-worker/src/low_level.ts","../../../../../../packages/service-worker/src/push.ts","../../../../../../packages/service-worker/src/update.ts","../../../../../../packages/service-worker/src/module.ts","../../../../../../packages/service-worker/src/index.ts","../../../../../../packages/service-worker/public_api.ts","../../../../../../packages/service-worker/index.ts","../../../../../../packages/service-worker/service-worker.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {concat, ConnectableObservable, defer, fromEvent, Observable, of, throwError} from 'rxjs';\nimport {filter, map, publish, switchMap, take, tap} from 'rxjs/operators';\n\nexport const ERR_SW_NOT_SUPPORTED = 'Service workers are disabled or not supported by this browser';\n\n/**\n * An event emitted when a new version of the app is available.\n *\n * @see {@link guide/service-worker-communications Service worker communication guide}\n *\n * @publicApi\n */\nexport interface UpdateAvailableEvent {\n type: 'UPDATE_AVAILABLE';\n current: {hash: string, appData?: Object};\n available: {hash: string, appData?: Object};\n}\n\n/**\n * An event emitted when a new version of the app has been downloaded and activated.\n *\n * @see {@link guide/service-worker-communications Service worker communication guide}\n *\n * @publicApi\n */\nexport interface UpdateActivatedEvent {\n type: 'UPDATE_ACTIVATED';\n previous?: {hash: string, appData?: Object};\n current: {hash: string, appData?: Object};\n}\n\n/**\n * An event emitted when the version of the app used by the service worker to serve this client is\n * in a broken state that cannot be recovered from and a full page reload is required.\n *\n * For example, the service worker may not be able to retrieve a required resource, neither from the\n * cache nor from the server. This could happen if a new version is deployed to the server and the\n * service worker cache has been partially cleaned by the browser, removing some files of a previous\n * app version but not all.\n *\n * @see {@link guide/service-worker-communications Service worker communication guide}\n *\n * @publicApi\n */\nexport interface UnrecoverableStateEvent {\n type: 'UNRECOVERABLE_STATE';\n reason: string;\n}\n\n/**\n * An event emitted when a `PushEvent` is received by the service worker.\n */\nexport interface PushEvent {\n type: 'PUSH';\n data: any;\n}\n\nexport type IncomingEvent = UpdateAvailableEvent|UpdateActivatedEvent|UnrecoverableStateEvent;\n\nexport interface TypedEvent {\n type: string;\n}\n\ninterface StatusEvent {\n type: 'STATUS';\n nonce: number;\n status: boolean;\n error?: string;\n}\n\n\nfunction errorObservable(message: string): Observable<any> {\n return defer(() => throwError(new Error(message)));\n}\n\n/**\n * @publicApi\n */\nexport class NgswCommChannel {\n readonly worker: Observable<ServiceWorker>;\n\n readonly registration: Observable<ServiceWorkerRegistration>;\n\n readonly events: Observable<TypedEvent>;\n\n constructor(private serviceWorker: ServiceWorkerContainer|undefined) {\n if (!serviceWorker) {\n this.worker = this.events = this.registration = errorObservable(ERR_SW_NOT_SUPPORTED);\n } else {\n const controllerChangeEvents = fromEvent(serviceWorker, 'controllerchange');\n const controllerChanges = controllerChangeEvents.pipe(map(() => serviceWorker.controller));\n const currentController = defer(() => of(serviceWorker.controller));\n const controllerWithChanges = concat(currentController, controllerChanges);\n\n this.worker = controllerWithChanges.pipe(filter((c): c is ServiceWorker => !!c));\n\n this.registration = <Observable<ServiceWorkerRegistration>>(\n this.worker.pipe(switchMap(() => serviceWorker.getRegistration())));\n\n const rawEvents = fromEvent<MessageEvent>(serviceWorker, 'message');\n const rawEventPayload = rawEvents.pipe(map(event => event.data));\n const eventsUnconnected = rawEventPayload.pipe(filter(event => event && event.type));\n const events = eventsUnconnected.pipe(publish()) as ConnectableObservable<IncomingEvent>;\n events.connect();\n\n this.events = events;\n }\n }\n\n postMessage(action: string, payload: Object): Promise<void> {\n return this.worker\n .pipe(take(1), tap((sw: ServiceWorker) => {\n sw.postMessage({\n action,\n ...payload,\n });\n }))\n .toPromise()\n .then(() => undefined);\n }\n\n postMessageWithStatus(type: string, payload: Object, nonce: number): Promise<void> {\n const waitForStatus = this.waitForStatus(nonce);\n const postMessage = this.postMessage(type, payload);\n return Promise.all([waitForStatus, postMessage]).then(() => undefined);\n }\n\n generateNonce(): number {\n return Math.round(Math.random() * 10000000);\n }\n\n eventsOfType<T extends TypedEvent>(type: T['type']): Observable<T> {\n const filterFn = (event: TypedEvent): event is T => event.type === type;\n return this.events.pipe(filter(filterFn));\n }\n\n nextEventOfType<T extends TypedEvent>(type: T['type']): Observable<T> {\n return this.eventsOfType(type).pipe(take(1));\n }\n\n waitForStatus(nonce: number): Promise<void> {\n return this.eventsOfType<StatusEvent>('STATUS')\n .pipe(filter(event => event.nonce === nonce), take(1), map(event => {\n if (event.status) {\n return undefined;\n }\n throw new Error(event.error!);\n }))\n .toPromise();\n }\n\n get isEnabled(): boolean {\n return !!this.serviceWorker;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '@angular/core';\nimport {merge, NEVER, Observable, Subject} from 'rxjs';\nimport {map, switchMap, take} from 'rxjs/operators';\n\nimport {ERR_SW_NOT_SUPPORTED, NgswCommChannel, PushEvent} from './low_level';\n\n\n/**\n * Subscribe and listen to\n * [Web Push\n * Notifications](https://developer.mozilla.org/en-US/docs/Web/API/Push_API/Best_Practices) through\n * Angular Service Worker.\n *\n * @usageNotes\n *\n * You can inject a `SwPush` instance into any component or service\n * as a dependency.\n *\n * <code-example path=\"service-worker/push/module.ts\" region=\"inject-sw-push\"\n * header=\"app.component.ts\"></code-example>\n *\n * To subscribe, call `SwPush.requestSubscription()`, which asks the user for permission.\n * The call returns a `Promise` with a new\n * [`PushSubscription`](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription)\n * instance.\n *\n * <code-example path=\"service-worker/push/module.ts\" region=\"subscribe-to-push\"\n * header=\"app.component.ts\"></code-example>\n *\n * A request is rejected if the user denies permission, or if the browser\n * blocks or does not support the Push API or ServiceWorkers.\n * Check `SwPush.isEnabled` to confirm status.\n *\n * Invoke Push Notifications by pushing a message with the following payload.\n *\n * ```ts\n * {\n * \"notification\": {\n * \"actions\": NotificationAction[],\n * \"badge\": USVString,\n * \"body\": DOMString,\n * \"data\": any,\n * \"dir\": \"auto\"|\"ltr\"|\"rtl\",\n * \"icon\": USVString,\n * \"image\": USVString,\n * \"lang\": DOMString,\n * \"renotify\": boolean,\n * \"requireInteraction\": boolean,\n * \"silent\": boolean,\n * \"tag\": DOMString,\n * \"timestamp\": DOMTimeStamp,\n * \"title\": DOMString,\n * \"vibrate\": number[]\n * }\n * }\n * ```\n *\n * Only `title` is required. See `Notification`\n * [instance\n * properties](https://developer.mozilla.org/en-US/docs/Web/API/Notification#Instance_properties).\n *\n * While the subscription is active, Service Worker listens for\n * [PushEvent](https://developer.mozilla.org/en-US/docs/Web/API/PushEvent)\n * occurrences and creates\n * [Notification](https://developer.mozilla.org/en-US/docs/Web/API/Notification)\n * instances in response.\n *\n * Unsubscribe using `SwPush.unsubscribe()`.\n *\n * An application can subscribe to `SwPush.notificationClicks` observable to be notified when a user\n * clicks on a notification. For example:\n *\n * <code-example path=\"service-worker/push/module.ts\" region=\"subscribe-to-notification-clicks\"\n * header=\"app.component.ts\"></code-example>\n *\n * You can read more on handling notification clicks in the [Service worker notifications\n * guide](guide/service-worker-notifications).\n *\n * @see [Push Notifications](https://developers.google.com/web/fundamentals/codelabs/push-notifications/)\n * @see [Angular Push Notifications](https://blog.angular-university.io/angular-push-notifications/)\n * @see [MDN: Push API](https://developer.mozilla.org/en-US/docs/Web/API/Push_API)\n * @see [MDN: Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API)\n * @see [MDN: Web Push API Notifications best practices](https://developer.mozilla.org/en-US/docs/Web/API/Push_API/Best_Practices)\n *\n * @publicApi\n */\n@Injectable()\nexport class SwPush {\n /**\n * Emits the payloads of the received push notification messages.\n */\n readonly messages: Observable<object>;\n\n /**\n * Emits the payloads of the received push notification messages as well as the action the user\n * interacted with. If no action was used the `action` property contains an empty string `''`.\n *\n * Note that the `notification` property does **not** contain a\n * [Notification][Mozilla Notification] object but rather a\n * [NotificationOptions](https://notifications.spec.whatwg.org/#dictdef-notificationoptions)\n * object that also includes the `title` of the [Notification][Mozilla Notification] object.\n *\n * [Mozilla Notification]: https://developer.mozilla.org/en-US/docs/Web/API/Notification\n */\n readonly notificationClicks: Observable<{\n action: string; notification: NotificationOptions &\n {\n title: string\n }\n }>;\n\n /**\n * Emits the currently active\n * [PushSubscription](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription)\n * associated to the Service Worker registration or `null` if there is no subscription.\n */\n readonly subscription: Observable<PushSubscription|null>;\n\n /**\n * True if the Service Worker is enabled (supported by the browser and enabled via\n * `ServiceWorkerModule`).\n */\n get isEnabled(): boolean {\n return this.sw.isEnabled;\n }\n\n // TODO(issue/24571): remove '!'.\n private pushManager!: Observable<PushManager>;\n private subscriptionChanges = new Subject<PushSubscription|null>();\n\n constructor(private sw: NgswCommChannel) {\n if (!sw.isEnabled) {\n this.messages = NEVER;\n this.notificationClicks = NEVER;\n this.subscription = NEVER;\n return;\n }\n\n this.messages = this.sw.eventsOfType<PushEvent>('PUSH').pipe(map(message => message.data));\n\n this.notificationClicks =\n this.sw.eventsOfType('NOTIFICATION_CLICK').pipe(map((message: any) => message.data));\n\n this.pushManager = this.sw.registration.pipe(map(registration => registration.pushManager));\n\n const workerDrivenSubscriptions = this.pushManager.pipe(switchMap(pm => pm.getSubscription()));\n this.subscription = merge(workerDrivenSubscriptions, this.subscriptionChanges);\n }\n\n /**\n * Subscribes to Web Push Notifications,\n * after requesting and receiving user permission.\n *\n * @param options An object containing the `serverPublicKey` string.\n * @returns A Promise that resolves to the new subscription object.\n */\n requestSubscription(options: {serverPublicKey: string}): Promise<PushSubscription> {\n if (!this.sw.isEnabled) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n const pushOptions: PushSubscriptionOptionsInit = {userVisibleOnly: true};\n let key = this.decodeBase64(options.serverPublicKey.replace(/_/g, '/').replace(/-/g, '+'));\n let applicationServerKey = new Uint8Array(new ArrayBuffer(key.length));\n for (let i = 0; i < key.length; i++) {\n applicationServerKey[i] = key.charCodeAt(i);\n }\n pushOptions.applicationServerKey = applicationServerKey;\n\n return this.pushManager.pipe(switchMap(pm => pm.subscribe(pushOptions)), take(1))\n .toPromise()\n .then(sub => {\n this.subscriptionChanges.next(sub);\n return sub;\n });\n }\n\n /**\n * Unsubscribes from Service Worker push notifications.\n *\n * @returns A Promise that is resolved when the operation succeeds, or is rejected if there is no\n * active subscription or the unsubscribe operation fails.\n */\n unsubscribe(): Promise<void> {\n if (!this.sw.isEnabled) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n\n const doUnsubscribe = (sub: PushSubscription|null) => {\n if (sub === null) {\n throw new Error('Not subscribed to push notifications.');\n }\n\n return sub.unsubscribe().then(success => {\n if (!success) {\n throw new Error('Unsubscribe failed!');\n }\n\n this.subscriptionChanges.next(null);\n });\n };\n\n return this.subscription.pipe(take(1), switchMap(doUnsubscribe)).toPromise();\n }\n\n private decodeBase64(input: string): string {\n return atob(input);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '@angular/core';\nimport {NEVER, Observable} from 'rxjs';\n\nimport {ERR_SW_NOT_SUPPORTED, NgswCommChannel, UnrecoverableStateEvent, UpdateActivatedEvent, UpdateAvailableEvent} from './low_level';\n\n\n\n/**\n * Subscribe to update notifications from the Service Worker, trigger update\n * checks, and forcibly activate updates.\n *\n * @see {@link guide/service-worker-communications Service worker communication guide}\n *\n * @publicApi\n */\n@Injectable()\nexport class SwUpdate {\n /**\n * Emits an `UpdateAvailableEvent` event whenever a new app version is available.\n */\n readonly available: Observable<UpdateAvailableEvent>;\n\n /**\n * Emits an `UpdateActivatedEvent` event whenever the app has been updated to a new version.\n */\n readonly activated: Observable<UpdateActivatedEvent>;\n\n /**\n * Emits an `UnrecoverableStateEvent` event whenever the version of the app used by the service\n * worker to serve this client is in a broken state that cannot be recovered from without a full\n * page reload.\n */\n readonly unrecoverable: Observable<UnrecoverableStateEvent>;\n\n /**\n * True if the Service Worker is enabled (supported by the browser and enabled via\n * `ServiceWorkerModule`).\n */\n get isEnabled(): boolean {\n return this.sw.isEnabled;\n }\n\n constructor(private sw: NgswCommChannel) {\n if (!sw.isEnabled) {\n this.available = NEVER;\n this.activated = NEVER;\n this.unrecoverable = NEVER;\n return;\n }\n this.available = this.sw.eventsOfType<UpdateAvailableEvent>('UPDATE_AVAILABLE');\n this.activated = this.sw.eventsOfType<UpdateActivatedEvent>('UPDATE_ACTIVATED');\n this.unrecoverable = this.sw.eventsOfType<UnrecoverableStateEvent>('UNRECOVERABLE_STATE');\n }\n\n checkForUpdate(): Promise<void> {\n if (!this.sw.isEnabled) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n const statusNonce = this.sw.generateNonce();\n return this.sw.postMessageWithStatus('CHECK_FOR_UPDATES', {statusNonce}, statusNonce);\n }\n\n activateUpdate(): Promise<void> {\n if (!this.sw.isEnabled) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n const statusNonce = this.sw.generateNonce();\n return this.sw.postMessageWithStatus('ACTIVATE_UPDATE', {statusNonce}, statusNonce);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isPlatformBrowser} from '@angular/common';\nimport {APP_INITIALIZER, ApplicationRef, InjectionToken, Injector, ModuleWithProviders, NgModule, NgZone, PLATFORM_ID} from '@angular/core';\nimport {merge, Observable, of} from 'rxjs';\nimport {delay, filter, take} from 'rxjs/operators';\n\nimport {NgswCommChannel} from './low_level';\nimport {SwPush} from './push';\nimport {SwUpdate} from './update';\n\n/**\n * Token that can be used to provide options for `ServiceWorkerModule` outside of\n * `ServiceWorkerModule.register()`.\n *\n * You can use this token to define a provider that generates the registration options at runtime,\n * for example via a function call:\n *\n * {@example service-worker/registration-options/module.ts region=\"registration-options\"\n * header=\"app.module.ts\"}\n *\n * @publicApi\n */\nexport abstract class SwRegistrationOptions {\n /**\n * Whether the ServiceWorker will be registered and the related services (such as `SwPush` and\n * `SwUpdate`) will attempt to communicate and interact with it.\n *\n * Default: true\n */\n enabled?: boolean;\n\n /**\n * A URL that defines the ServiceWorker's registration scope; that is, what range of URLs it can\n * control. It will be used when calling\n * [ServiceWorkerContainer#register()](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register).\n */\n scope?: string;\n\n /**\n * Defines the ServiceWorker registration strategy, which determines when it will be registered\n * with the browser.\n *\n * The default behavior of registering once the application stabilizes (i.e. as soon as there are\n * no pending micro- and macro-tasks) is designed to register the ServiceWorker as soon as\n * possible but without affecting the application's first time load.\n *\n * Still, there might be cases where you want more control over when the ServiceWorker is\n * registered (for example, there might be a long-running timeout or polling interval, preventing\n * the app from stabilizing). The available option are:\n *\n * - `registerWhenStable:<timeout>`: Register as soon as the application stabilizes (no pending\n * micro-/macro-tasks) but no later than `<timeout>` milliseconds. If the app hasn't\n * stabilized after `<timeout>` milliseconds (for example, due to a recurrent asynchronous\n * task), the ServiceWorker will be registered anyway.\n * If `<timeout>` is omitted, the ServiceWorker will only be registered once the app\n * stabilizes.\n * - `registerImmediately`: Register immediately.\n * - `registerWithDelay:<timeout>`: Register with a delay of `<timeout>` milliseconds. For\n * example, use `registerWithDelay:5000` to register the ServiceWorker after 5 seconds. If\n * `<timeout>` is omitted, is defaults to `0`, which will register the ServiceWorker as soon\n * as possible but still asynchronously, once all pending micro-tasks are completed.\n * - An [Observable](guide/observables) factory function: A function that returns an `Observable`.\n * The function will be used at runtime to obtain and subscribe to the `Observable` and the\n * ServiceWorker will be registered as soon as the first value is emitted.\n *\n * Default: 'registerWhenStable:30000'\n */\n registrationStrategy?: string|(() => Observable<unknown>);\n}\n\nexport const SCRIPT = new InjectionToken<string>('NGSW_REGISTER_SCRIPT');\n\nexport function ngswAppInitializer(\n injector: Injector, script: string, options: SwRegistrationOptions,\n platformId: string): Function {\n const initializer = () => {\n if (!(isPlatformBrowser(platformId) && ('serviceWorker' in navigator) &&\n options.enabled !== false)) {\n return;\n }\n\n // Wait for service worker controller changes, and fire an INITIALIZE action when a new SW\n // becomes active. This allows the SW to initialize itself even if there is no application\n // traffic.\n navigator.serviceWorker.addEventListener('controllerchange', () => {\n if (navigator.serviceWorker.controller !== null) {\n navigator.serviceWorker.controller.postMessage({action: 'INITIALIZE'});\n }\n });\n\n let readyToRegister$: Observable<unknown>;\n\n if (typeof options.registrationStrategy === 'function') {\n readyToRegister$ = options.registrationStrategy();\n } else {\n const [strategy, ...args] =\n (options.registrationStrategy || 'registerWhenStable:30000').split(':');\n\n switch (strategy) {\n case 'registerImmediately':\n readyToRegister$ = of(null);\n break;\n case 'registerWithDelay':\n readyToRegister$ = delayWithTimeout(+args[0] || 0);\n break;\n case 'registerWhenStable':\n readyToRegister$ = !args[0] ? whenStable(injector) :\n merge(whenStable(injector), delayWithTimeout(+args[0]));\n break;\n default:\n // Unknown strategy.\n throw new Error(\n `Unknown ServiceWorker registration strategy: ${options.registrationStrategy}`);\n }\n }\n\n // Don't return anything to avoid blocking the application until the SW is registered.\n // Also, run outside the Angular zone to avoid preventing the app from stabilizing (especially\n // given that some registration strategies wait for the app to stabilize).\n // Catch and log the error if SW registration fails to avoid uncaught rejection warning.\n const ngZone = injector.get(NgZone);\n ngZone.runOutsideAngular(\n () => readyToRegister$.pipe(take(1)).subscribe(\n () =>\n navigator.serviceWorker.register(script, {scope: options.scope})\n .catch(err => console.error('Service worker registration failed with:', err))));\n };\n return initializer;\n}\n\nfunction delayWithTimeout(timeout: number): Observable<unknown> {\n return of(null).pipe(delay(timeout));\n}\n\nfunction whenStable(injector: Injector): Observable<unknown> {\n const appRef = injector.get(ApplicationRef);\n return appRef.isStable.pipe(filter(stable => stable));\n}\n\nexport function ngswCommChannelFactory(\n opts: SwRegistrationOptions, platformId: string): NgswCommChannel {\n return new NgswCommChannel(\n isPlatformBrowser(platformId) && opts.enabled !== false ? navigator.serviceWorker :\n undefined);\n}\n\n/**\n * @publicApi\n */\n@NgModule({\n providers: [SwPush, SwUpdate],\n})\nexport class ServiceWorkerModule {\n /**\n * Register the given Angular Service Worker script.\n *\n * If `enabled` is set to `false` in the given options, the module will behave as if service\n * workers are not supported by the browser, and the service worker will not be registered.\n */\n static register(script: string, opts: SwRegistrationOptions = {}):\n ModuleWithProviders<ServiceWorkerModule> {\n return {\n ngModule: ServiceWorkerModule,\n providers: [\n {provide: SCRIPT, useValue: script},\n {provide: SwRegistrationOptions, useValue: opts},\n {\n provide: NgswCommChannel,\n useFactory: ngswCommChannelFactory,\n deps: [SwRegistrationOptions, PLATFORM_ID]\n },\n {\n provide: APP_INITIALIZER,\n useFactory: ngswAppInitializer,\n deps: [Injector, SCRIPT, SwRegistrationOptions, PLATFORM_ID],\n multi: true,\n },\n ],\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {UnrecoverableStateEvent, UpdateActivatedEvent, UpdateAvailableEvent} from './low_level';\nexport {ServiceWorkerModule, SwRegistrationOptions} from './module';\nexport {SwPush} from './push';\nexport {SwUpdate} from './update';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/index';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;AAWO,MAAM,oBAAoB,GAAG,+DAA+D,CAAC;AAoEpG,SAAS,eAAe,CAAC,OAAe;IACtC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