@metamask-previews/notification-services-controller 0.1.0-preview-83ca56e → 0.1.0-preview-30646c8e

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 (138) hide show
  1. package/dist/NotificationServicesController/NotificationServicesController.js +7 -7
  2. package/dist/NotificationServicesController/NotificationServicesController.mjs +6 -6
  3. package/dist/NotificationServicesController/constants/constants.js +1 -1
  4. package/dist/NotificationServicesController/constants/constants.mjs +1 -1
  5. package/dist/NotificationServicesController/constants/index.js +6 -4
  6. package/dist/NotificationServicesController/constants/index.mjs +5 -3
  7. package/dist/NotificationServicesController/constants/notification-schema.js +5 -3
  8. package/dist/NotificationServicesController/constants/notification-schema.mjs +4 -2
  9. package/dist/NotificationServicesController/index.js +12 -12
  10. package/dist/NotificationServicesController/index.mjs +11 -11
  11. package/dist/NotificationServicesController/processors/index.js +5 -5
  12. package/dist/NotificationServicesController/processors/index.mjs +4 -4
  13. package/dist/NotificationServicesController/processors/process-feature-announcement.js +1 -1
  14. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +1 -1
  15. package/dist/NotificationServicesController/processors/process-notifications.js +4 -4
  16. package/dist/NotificationServicesController/processors/process-notifications.mjs +3 -3
  17. package/dist/NotificationServicesController/processors/process-onchain-notifications.js +1 -1
  18. package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +1 -1
  19. package/dist/NotificationServicesController/services/feature-announcements.js +2 -2
  20. package/dist/NotificationServicesController/services/feature-announcements.mjs +2 -2
  21. package/dist/NotificationServicesController/services/onchain-notifications.js +5 -5
  22. package/dist/NotificationServicesController/services/onchain-notifications.mjs +4 -4
  23. package/dist/NotificationServicesController/types/index.js +2 -2
  24. package/dist/NotificationServicesController/types/index.mjs +2 -2
  25. package/dist/NotificationServicesController/ui/constants.js +40 -0
  26. package/dist/NotificationServicesController/ui/constants.js.map +1 -0
  27. package/dist/NotificationServicesController/ui/constants.mjs +40 -0
  28. package/dist/NotificationServicesController/ui/constants.mjs.map +1 -0
  29. package/dist/NotificationServicesController/utils/utils.js +4 -4
  30. package/dist/NotificationServicesController/utils/utils.mjs +3 -3
  31. package/dist/NotificationServicesPushController/NotificationServicesPushController.js +15 -15
  32. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +14 -14
  33. package/dist/NotificationServicesPushController/constants.js +1 -1
  34. package/dist/NotificationServicesPushController/constants.mjs +1 -1
  35. package/dist/NotificationServicesPushController/index.js +18 -18
  36. package/dist/NotificationServicesPushController/index.mjs +17 -17
  37. package/dist/NotificationServicesPushController/services/endpoints.js +1 -1
  38. package/dist/NotificationServicesPushController/services/endpoints.mjs +1 -1
  39. package/dist/NotificationServicesPushController/services/push/push-web.js +13 -13
  40. package/dist/NotificationServicesPushController/services/push/push-web.mjs +12 -12
  41. package/dist/NotificationServicesPushController/services/services.js +14 -14
  42. package/dist/NotificationServicesPushController/services/services.mjs +13 -13
  43. package/dist/NotificationServicesPushController/utils/get-notification-data.js +1 -1
  44. package/dist/NotificationServicesPushController/utils/get-notification-data.mjs +1 -1
  45. package/dist/NotificationServicesPushController/utils/get-notification-message.js +13 -13
  46. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +12 -12
  47. package/dist/NotificationServicesPushController/utils/index.js +14 -14
  48. package/dist/NotificationServicesPushController/utils/index.mjs +13 -13
  49. package/dist/{chunk-NXXY4CAP.js → chunk-3RRAJSTZ.js} +9 -36
  50. package/dist/chunk-3RRAJSTZ.js.map +1 -0
  51. package/dist/{chunk-RYAHBEX2.mjs → chunk-54BC2GAN.mjs} +29 -9
  52. package/dist/chunk-54BC2GAN.mjs.map +1 -0
  53. package/dist/{chunk-GFAESVZA.js → chunk-5FUMSWDD.js} +3 -3
  54. package/dist/chunk-5SY7FJXH.mjs +925 -0
  55. package/dist/chunk-5SY7FJXH.mjs.map +1 -0
  56. package/dist/{chunk-ODZ6V4PH.mjs → chunk-5WMDB2VE.mjs} +4 -4
  57. package/dist/{chunk-SSWX2N73.mjs → chunk-6GUOLD7O.mjs} +2 -2
  58. package/dist/{chunk-NJBJIZLR.js → chunk-72H2V4J5.js} +6 -7
  59. package/dist/chunk-72H2V4J5.js.map +1 -0
  60. package/dist/{chunk-SMKJEA45.mjs → chunk-7S6524FI.mjs} +2 -2
  61. package/dist/{chunk-PIZCE3JD.js → chunk-7U22ZANC.js} +5 -5
  62. package/dist/{chunk-52NKJDI2.mjs → chunk-A5QFYBTR.mjs} +5 -6
  63. package/dist/chunk-A5QFYBTR.mjs.map +1 -0
  64. package/dist/{chunk-TT56I53C.mjs → chunk-ADYRLXWY.mjs} +2 -2
  65. package/dist/{chunk-LFD7J7KR.mjs → chunk-B3OMMG46.mjs} +6 -33
  66. package/dist/chunk-B3OMMG46.mjs.map +1 -0
  67. package/dist/{chunk-PGMXFZ6Y.js → chunk-BUT7X5F2.js} +3 -3
  68. package/dist/{chunk-JLHFZ2UG.mjs → chunk-DCADU5QI.mjs} +3 -3
  69. package/dist/{chunk-FFQNSBPU.js → chunk-ENRKCWJ6.js} +7 -7
  70. package/dist/{chunk-NMLYB3XT.js → chunk-GJHW5Z65.js} +4 -4
  71. package/dist/chunk-IGY2S5BC.js +36 -0
  72. package/dist/{chunk-VC6J62JI.mjs → chunk-J4D2NH6Y.mjs} +4 -2
  73. package/dist/chunk-J4D2NH6Y.mjs.map +1 -0
  74. package/dist/{chunk-RQWUD2FB.mjs → chunk-KCWTVLMK.mjs} +2 -2
  75. package/dist/{chunk-UPVIT75F.js → chunk-KWTSMLND.js} +6 -6
  76. package/dist/{chunk-UIRZIKC3.mjs → chunk-PI2RUC6X.mjs} +2 -2
  77. package/dist/chunk-QY4UST5V.js +37 -0
  78. package/dist/chunk-QY4UST5V.js.map +1 -0
  79. package/dist/{chunk-YRWUXGL3.js → chunk-TITJWXKP.js} +123 -103
  80. package/dist/chunk-TITJWXKP.js.map +1 -0
  81. package/dist/{chunk-VOZ7Y2OO.js → chunk-TPGIXSC2.js} +8 -8
  82. package/dist/chunk-U5UIDVOO.mjs +36 -0
  83. package/dist/{chunk-DKQBDI4C.js → chunk-UAVQ6J3W.js} +35 -35
  84. package/dist/{chunk-DY4ELDRQ.js → chunk-V6P5JEPT.js} +5 -3
  85. package/dist/chunk-V6P5JEPT.js.map +1 -0
  86. package/dist/{chunk-QTK2RMF7.mjs → chunk-X42WN3FE.mjs} +3 -3
  87. package/dist/chunk-YI2IXXU6.js +925 -0
  88. package/dist/chunk-YI2IXXU6.js.map +1 -0
  89. package/dist/{chunk-VE4DTN4R.mjs → chunk-ZHAD55AN.mjs} +5 -3
  90. package/dist/{chunk-VE4DTN4R.mjs.map → chunk-ZHAD55AN.mjs.map} +1 -1
  91. package/dist/index.js +18 -18
  92. package/dist/index.mjs +17 -17
  93. package/dist/tsconfig.build.tsbuildinfo +1 -1
  94. package/dist/types/NotificationServicesController/NotificationServicesController.d.ts +2 -0
  95. package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +1 -1
  96. package/dist/types/NotificationServicesController/__fixtures__/index.d.ts +0 -1
  97. package/dist/types/NotificationServicesController/__fixtures__/index.d.ts.map +1 -1
  98. package/dist/types/NotificationServicesController/constants/notification-schema.d.ts +14 -8
  99. package/dist/types/NotificationServicesController/constants/notification-schema.d.ts.map +1 -1
  100. package/dist/types/NotificationServicesController/ui/constants.d.ts +29 -0
  101. package/dist/types/NotificationServicesController/ui/constants.d.ts.map +1 -0
  102. package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts +0 -1
  103. package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts.map +1 -1
  104. package/package.json +1 -1
  105. package/dist/chunk-26CCETCM.mjs +0 -70
  106. package/dist/chunk-4KZO4UUC.js +0 -4300
  107. package/dist/chunk-4KZO4UUC.js.map +0 -1
  108. package/dist/chunk-52NKJDI2.mjs.map +0 -1
  109. package/dist/chunk-CQ6CGSKZ.js +0 -35
  110. package/dist/chunk-CQ6CGSKZ.js.map +0 -1
  111. package/dist/chunk-DY4ELDRQ.js.map +0 -1
  112. package/dist/chunk-HCOBC2R5.mjs +0 -4300
  113. package/dist/chunk-HCOBC2R5.mjs.map +0 -1
  114. package/dist/chunk-LFD7J7KR.mjs.map +0 -1
  115. package/dist/chunk-NJBJIZLR.js.map +0 -1
  116. package/dist/chunk-NXXY4CAP.js.map +0 -1
  117. package/dist/chunk-RYAHBEX2.mjs.map +0 -1
  118. package/dist/chunk-V46WVGWN.js +0 -70
  119. package/dist/chunk-VC6J62JI.mjs.map +0 -1
  120. package/dist/chunk-YRWUXGL3.js.map +0 -1
  121. /package/dist/{chunk-GFAESVZA.js.map → chunk-5FUMSWDD.js.map} +0 -0
  122. /package/dist/{chunk-ODZ6V4PH.mjs.map → chunk-5WMDB2VE.mjs.map} +0 -0
  123. /package/dist/{chunk-SSWX2N73.mjs.map → chunk-6GUOLD7O.mjs.map} +0 -0
  124. /package/dist/{chunk-SMKJEA45.mjs.map → chunk-7S6524FI.mjs.map} +0 -0
  125. /package/dist/{chunk-PIZCE3JD.js.map → chunk-7U22ZANC.js.map} +0 -0
  126. /package/dist/{chunk-TT56I53C.mjs.map → chunk-ADYRLXWY.mjs.map} +0 -0
  127. /package/dist/{chunk-PGMXFZ6Y.js.map → chunk-BUT7X5F2.js.map} +0 -0
  128. /package/dist/{chunk-JLHFZ2UG.mjs.map → chunk-DCADU5QI.mjs.map} +0 -0
  129. /package/dist/{chunk-FFQNSBPU.js.map → chunk-ENRKCWJ6.js.map} +0 -0
  130. /package/dist/{chunk-NMLYB3XT.js.map → chunk-GJHW5Z65.js.map} +0 -0
  131. /package/dist/{chunk-V46WVGWN.js.map → chunk-IGY2S5BC.js.map} +0 -0
  132. /package/dist/{chunk-RQWUD2FB.mjs.map → chunk-KCWTVLMK.mjs.map} +0 -0
  133. /package/dist/{chunk-UPVIT75F.js.map → chunk-KWTSMLND.js.map} +0 -0
  134. /package/dist/{chunk-UIRZIKC3.mjs.map → chunk-PI2RUC6X.mjs.map} +0 -0
  135. /package/dist/{chunk-VOZ7Y2OO.js.map → chunk-TPGIXSC2.js.map} +0 -0
  136. /package/dist/{chunk-26CCETCM.mjs.map → chunk-U5UIDVOO.mjs.map} +0 -0
  137. /package/dist/{chunk-DKQBDI4C.js.map → chunk-UAVQ6J3W.js.map} +0 -0
  138. /package/dist/{chunk-QTK2RMF7.mjs.map → chunk-X42WN3FE.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkGFAESVZAjs = require('./chunk-GFAESVZA.js');
3
+ var _chunk5FUMSWDDjs = require('./chunk-5FUMSWDD.js');
4
4
 
5
5
 
6
6
  var _chunkZMNXLHACjs = require('./chunk-ZMNXLHAC.js');
@@ -9,7 +9,7 @@ var _chunkZMNXLHACjs = require('./chunk-ZMNXLHAC.js');
9
9
 
10
10
 
11
11
 
12
- var _chunkVOZ7Y2OOjs = require('./chunk-VOZ7Y2OO.js');
12
+ var _chunkTPGIXSC2js = require('./chunk-TPGIXSC2.js');
13
13
 
14
14
 
15
15
 
@@ -17,7 +17,7 @@ var _chunkVOZ7Y2OOjs = require('./chunk-VOZ7Y2OO.js');
17
17
 
18
18
 
19
19
 
20
- var _chunkPIZCE3JDjs = require('./chunk-PIZCE3JD.js');
20
+ var _chunk7U22ZANCjs = require('./chunk-7U22ZANC.js');
21
21
 
22
22
 
23
23
  var _chunkTLX5QQK5js = require('./chunk-TLX5QQK5.js');
@@ -26,7 +26,7 @@ var _chunkTLX5QQK5js = require('./chunk-TLX5QQK5.js');
26
26
 
27
27
 
28
28
 
29
- var _chunkV46WVGWNjs = require('./chunk-V46WVGWN.js');
29
+ var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
30
30
 
31
31
  // src/NotificationServicesController/NotificationServicesController.ts
32
32
  var _basecontroller = require('@metamask/base-controller');
@@ -87,7 +87,7 @@ var defaultState = {
87
87
  isUpdatingMetamaskNotificationsAccount: [],
88
88
  isCheckingAccountsPresence: false
89
89
  };
90
- var _auth, _storage, _pushNotifications, _accounts, _featureAnnouncementEnv, _registerMessageHandlers, registerMessageHandlers_fn, _clearLoadingStates, clearLoadingStates_fn, _assertAuthEnabled, assertAuthEnabled_fn, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn, _performEnableProfileSyncing, _assertUserStorage, assertUserStorage_fn, _getUserStorage, getUserStorage_fn, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn;
90
+ var _isPushIntegrated, _auth, _storage, _pushNotifications, _accounts, _featureAnnouncementEnv, _registerMessageHandlers, registerMessageHandlers_fn, _clearLoadingStates, clearLoadingStates_fn, _assertAuthEnabled, assertAuthEnabled_fn, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn, _performEnableProfileSyncing, _assertUserStorage, assertUserStorage_fn, _getUserStorage, getUserStorage_fn, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn;
91
91
  var NotificationServicesController = class extends _basecontroller.BaseController {
92
92
  /**
93
93
  * Creates a NotificationServicesController instance.
@@ -97,6 +97,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
97
97
  * @param args.state - Initial state to set on this controller.
98
98
  * @param args.env - environment variables for a given controller.
99
99
  * @param args.env.featureAnnouncements - env variables for feature announcements.
100
+ * @param args.env.isPushIntegrated - toggle push notifications on/off if client has integrated them.
100
101
  */
101
102
  constructor({
102
103
  messenger,
@@ -109,11 +110,11 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
109
110
  name: controllerName,
110
111
  state: { ...defaultState, ...state }
111
112
  });
112
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _registerMessageHandlers);
113
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _clearLoadingStates);
114
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _assertAuthEnabled);
115
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _getValidStorageKeyAndBearerToken);
116
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _assertUserStorage);
113
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _registerMessageHandlers);
114
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _clearLoadingStates);
115
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _assertAuthEnabled);
116
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _getValidStorageKeyAndBearerToken);
117
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _assertUserStorage);
117
118
  /**
118
119
  * Retrieves and parses the user storage from the storage key.
119
120
  *
@@ -123,7 +124,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
123
124
  *
124
125
  * @returns The parsed user storage object or null
125
126
  */
126
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _getUserStorage);
127
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _getUserStorage);
127
128
  /**
128
129
  * Sets the state of notification creation process.
129
130
  *
@@ -134,7 +135,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
134
135
  *
135
136
  * @param isUpdatingMetamaskNotifications - A boolean value representing the new state of the notification creation process.
136
137
  */
137
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _setIsUpdatingMetamaskNotifications);
138
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _setIsUpdatingMetamaskNotifications);
138
139
  /**
139
140
  * Updates the state to indicate whether fetching of MetaMask notifications is in progress.
140
141
  *
@@ -143,7 +144,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
143
144
  *
144
145
  * @param isFetchingMetamaskNotifications - A boolean value representing the fetching state.
145
146
  */
146
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _setIsFetchingMetamaskNotifications);
147
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _setIsFetchingMetamaskNotifications);
147
148
  /**
148
149
  * Updates the state to indicate that the checking of accounts presence is in progress.
149
150
  *
@@ -153,21 +154,23 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
153
154
  *
154
155
  * @param isCheckingAccountsPresence - A boolean value indicating whether the account presence check is currently active.
155
156
  */
156
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _setIsCheckingAccountsPresence);
157
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _setIsCheckingAccountsPresence);
157
158
  /**
158
159
  * Updates the state to indicate that account updates are in progress.
159
160
  * Removes duplicate accounts before updating the state.
160
161
  *
161
162
  * @param accounts - The accounts being updated.
162
163
  */
163
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _updateUpdatingAccountsState);
164
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _updateUpdatingAccountsState);
164
165
  /**
165
166
  * Clears the state indicating that account updates are complete.
166
167
  *
167
168
  * @param accounts - The accounts that have finished updating.
168
169
  */
169
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _clearUpdatingAccountsState);
170
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _auth, {
170
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _clearUpdatingAccountsState);
171
+ // Temporary boolean as push notifications are not yet enabled on mobile
172
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _isPushIntegrated, true);
173
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _auth, {
171
174
  getBearerToken: async () => {
172
175
  return await this.messagingSystem.call(
173
176
  "AuthenticationController:getBearerToken"
@@ -177,7 +180,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
177
180
  return this.messagingSystem.call("AuthenticationController:isSignedIn");
178
181
  }
179
182
  });
180
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _storage, {
183
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _storage, {
181
184
  enableProfileSyncing: async () => {
182
185
  return await this.messagingSystem.call(
183
186
  "UserStorageController:enableProfileSyncing"
@@ -200,26 +203,38 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
200
203
  );
201
204
  }
202
205
  });
203
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _pushNotifications, {
206
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _pushNotifications, {
204
207
  enablePushNotifications: async (UUIDs) => {
205
- return await this.messagingSystem.call(
208
+ if (!_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _isPushIntegrated)) {
209
+ return;
210
+ }
211
+ await this.messagingSystem.call(
206
212
  "NotificationServicesPushController:enablePushNotifications",
207
213
  UUIDs
208
214
  );
209
215
  },
210
216
  disablePushNotifications: async (UUIDs) => {
211
- return await this.messagingSystem.call(
217
+ if (!_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _isPushIntegrated)) {
218
+ return;
219
+ }
220
+ await this.messagingSystem.call(
212
221
  "NotificationServicesPushController:disablePushNotifications",
213
222
  UUIDs
214
223
  );
215
224
  },
216
225
  updatePushNotifications: async (UUIDs) => {
217
- return await this.messagingSystem.call(
226
+ if (!_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _isPushIntegrated)) {
227
+ return;
228
+ }
229
+ await this.messagingSystem.call(
218
230
  "NotificationServicesPushController:updateTriggerPushNotifications",
219
231
  UUIDs
220
232
  );
221
233
  },
222
234
  subscribe: () => {
235
+ if (!_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _isPushIntegrated)) {
236
+ return;
237
+ }
223
238
  this.messagingSystem.subscribe(
224
239
  "NotificationServicesPushController:onNewNotifications",
225
240
  (notification) => {
@@ -228,18 +243,21 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
228
243
  );
229
244
  },
230
245
  initializePushNotifications: async () => {
246
+ if (!_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _isPushIntegrated)) {
247
+ return;
248
+ }
231
249
  if (!this.state.isNotificationServicesEnabled) {
232
250
  return;
233
251
  }
234
- const storage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
252
+ const storage = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
235
253
  if (!storage) {
236
254
  return;
237
255
  }
238
- const uuids = _chunkPIZCE3JDjs.getAllUUIDs.call(void 0, storage);
239
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).enablePushNotifications(uuids);
256
+ const uuids = _chunk7U22ZANCjs.getAllUUIDs.call(void 0, storage);
257
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _pushNotifications).enablePushNotifications(uuids);
240
258
  }
241
259
  });
242
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _accounts, {
260
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _accounts, {
243
261
  /**
244
262
  * Used to get list of addresses from keyring (wallet addresses)
245
263
  *
@@ -278,7 +296,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
278
296
  * @returns result from list accounts
279
297
  */
280
298
  initialize: () => {
281
- return _chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).listAccounts();
299
+ return _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _accounts).listAccounts();
282
300
  },
283
301
  /**
284
302
  * Subscription to any state change in the keyring controller (aka wallet accounts).
@@ -293,7 +311,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
293
311
  if (!this.state.isNotificationServicesEnabled) {
294
312
  return;
295
313
  }
296
- const { accountsAdded, accountsRemoved } = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).listAccounts();
314
+ const { accountsAdded, accountsRemoved } = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _accounts).listAccounts();
297
315
  const promises = [];
298
316
  if (accountsAdded.length > 0) {
299
317
  promises.push(this.updateOnChainTriggersByAccount(accountsAdded));
@@ -306,22 +324,23 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
306
324
  );
307
325
  }
308
326
  });
309
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _featureAnnouncementEnv, void 0);
310
- _chunkV46WVGWNjs.__privateAdd.call(void 0, this, _performEnableProfileSyncing, async () => {
327
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _featureAnnouncementEnv, void 0);
328
+ _chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _performEnableProfileSyncing, async () => {
311
329
  try {
312
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).enableProfileSyncing();
330
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).enableProfileSyncing();
313
331
  } catch (e) {
314
332
  _loglevel2.default.error("Failed to enable profile syncing", e);
315
333
  throw new Error("Failed to enable profile syncing");
316
334
  }
317
335
  });
318
- _chunkV46WVGWNjs.__privateSet.call(void 0, this, _featureAnnouncementEnv, env.featureAnnouncements);
319
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _registerMessageHandlers, registerMessageHandlers_fn).call(this);
320
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _clearLoadingStates, clearLoadingStates_fn).call(this);
321
- _chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).initialize();
322
- _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).initializePushNotifications();
323
- _chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).subscribe();
324
- _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).subscribe();
336
+ _chunkIGY2S5BCjs.__privateSet.call(void 0, this, _isPushIntegrated, env.isPushIntegrated ?? true);
337
+ _chunkIGY2S5BCjs.__privateSet.call(void 0, this, _featureAnnouncementEnv, env.featureAnnouncements);
338
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _registerMessageHandlers, registerMessageHandlers_fn).call(this);
339
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _clearLoadingStates, clearLoadingStates_fn).call(this);
340
+ _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _accounts).initialize();
341
+ _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _pushNotifications).initializePushNotifications();
342
+ _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _accounts).subscribe();
343
+ _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _pushNotifications).subscribe();
325
344
  }
326
345
  /**
327
346
  * Retrieves the current enabled state of MetaMask notifications.
@@ -336,16 +355,16 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
336
355
  }
337
356
  async checkAccountsPresence(accounts) {
338
357
  try {
339
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn).call(this, true);
340
- const userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
341
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
342
- const presence = _chunkPIZCE3JDjs.checkAccountsPresence.call(void 0, userStorage, accounts);
358
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn).call(this, true);
359
+ const userStorage = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
360
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
361
+ const presence = _chunk7U22ZANCjs.checkAccountsPresence.call(void 0, userStorage, accounts);
343
362
  return presence;
344
363
  } catch (error) {
345
364
  _loglevel2.default.error("Failed to check accounts presence", error);
346
365
  throw error;
347
366
  } finally {
348
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn).call(this, false);
367
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn).call(this, false);
349
368
  }
350
369
  }
351
370
  /**
@@ -377,28 +396,28 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
377
396
  */
378
397
  async createOnChainTriggers() {
379
398
  try {
380
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
381
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _performEnableProfileSyncing).call(this);
382
- const { bearerToken, storageKey } = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
383
- const { accounts } = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).listAccounts();
384
- let userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
399
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
400
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _performEnableProfileSyncing).call(this);
401
+ const { bearerToken, storageKey } = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
402
+ const { accounts } = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _accounts).listAccounts();
403
+ let userStorage = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
385
404
  if (userStorage?.[_chunkTLX5QQK5js.USER_STORAGE_VERSION_KEY] === void 0) {
386
- userStorage = _chunkPIZCE3JDjs.initializeUserStorage.call(void 0,
405
+ userStorage = _chunk7U22ZANCjs.initializeUserStorage.call(void 0,
387
406
  accounts.map((account) => ({ address: account })),
388
407
  false
389
408
  );
390
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
409
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
391
410
  }
392
- const triggers = _chunkPIZCE3JDjs.traverseUserStorageTriggers.call(void 0, userStorage);
393
- await _chunkVOZ7Y2OOjs.createOnChainTriggers.call(void 0,
411
+ const triggers = _chunk7U22ZANCjs.traverseUserStorageTriggers.call(void 0, userStorage);
412
+ await _chunkTPGIXSC2js.createOnChainTriggers.call(void 0,
394
413
  userStorage,
395
414
  storageKey,
396
415
  bearerToken,
397
416
  triggers
398
417
  );
399
- const allUUIDS = _chunkPIZCE3JDjs.getAllUUIDs.call(void 0, userStorage);
400
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).enablePushNotifications(allUUIDS);
401
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
418
+ const allUUIDS = _chunk7U22ZANCjs.getAllUUIDs.call(void 0, userStorage);
419
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _pushNotifications).enablePushNotifications(allUUIDS);
420
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
402
421
  this.update((state) => {
403
422
  state.isNotificationServicesEnabled = true;
404
423
  state.isFeatureAnnouncementsEnabled = true;
@@ -409,7 +428,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
409
428
  _loglevel2.default.error("Failed to create On Chain triggers", err);
410
429
  throw new Error("Failed to create On Chain triggers");
411
430
  } finally {
412
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
431
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
413
432
  }
414
433
  }
415
434
  /**
@@ -424,13 +443,13 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
424
443
  */
425
444
  async enableMetamaskNotifications() {
426
445
  try {
427
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
446
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
428
447
  await this.createOnChainTriggers();
429
448
  } catch (e) {
430
449
  _loglevel2.default.error("Unable to enable notifications", e);
431
450
  throw new Error("Unable to enable notifications");
432
451
  } finally {
433
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
452
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
434
453
  }
435
454
  }
436
455
  /**
@@ -443,11 +462,11 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
443
462
  */
444
463
  async disableNotificationServices() {
445
464
  try {
446
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
447
- const userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
448
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
449
- const UUIDs = _chunkPIZCE3JDjs.getAllUUIDs.call(void 0, userStorage);
450
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).disablePushNotifications(UUIDs);
465
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
466
+ const userStorage = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
467
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
468
+ const UUIDs = _chunk7U22ZANCjs.getAllUUIDs.call(void 0, userStorage);
469
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _pushNotifications).disablePushNotifications(UUIDs);
451
470
  this.update((state) => {
452
471
  state.isNotificationServicesEnabled = false;
453
472
  state.isFeatureAnnouncementsEnabled = false;
@@ -457,7 +476,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
457
476
  _loglevel2.default.error("Unable to disable notifications", e);
458
477
  throw new Error("Unable to disable notifications");
459
478
  } finally {
460
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
479
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
461
480
  }
462
481
  }
463
482
  /**
@@ -476,28 +495,28 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
476
495
  */
477
496
  async deleteOnChainTriggersByAccount(accounts) {
478
497
  try {
479
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn).call(this, accounts);
480
- const { bearerToken, storageKey } = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
481
- const userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
482
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
483
- const UUIDs = accounts.map((a) => _chunkPIZCE3JDjs.getUUIDsForAccount.call(void 0, userStorage, a.toLowerCase())).flat();
498
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn).call(this, accounts);
499
+ const { bearerToken, storageKey } = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
500
+ const userStorage = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
501
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
502
+ const UUIDs = accounts.map((a) => _chunk7U22ZANCjs.getUUIDsForAccount.call(void 0, userStorage, a.toLowerCase())).flat();
484
503
  if (UUIDs.length === 0) {
485
504
  return userStorage;
486
505
  }
487
- await _chunkVOZ7Y2OOjs.deleteOnChainTriggers.call(void 0,
506
+ await _chunkTPGIXSC2js.deleteOnChainTriggers.call(void 0,
488
507
  userStorage,
489
508
  storageKey,
490
509
  bearerToken,
491
510
  UUIDs
492
511
  );
493
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).disablePushNotifications(UUIDs);
494
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
512
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _pushNotifications).disablePushNotifications(UUIDs);
513
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
495
514
  return userStorage;
496
515
  } catch (err) {
497
516
  _loglevel2.default.error("Failed to delete OnChain triggers", err);
498
517
  throw new Error("Failed to delete OnChain triggers");
499
518
  } finally {
500
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn).call(this, accounts);
519
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn).call(this, accounts);
501
520
  }
502
521
  }
503
522
  /**
@@ -517,12 +536,12 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
517
536
  */
518
537
  async updateOnChainTriggersByAccount(accounts) {
519
538
  try {
520
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn).call(this, accounts);
521
- const { bearerToken, storageKey } = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
522
- const userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
523
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
524
- accounts.forEach((a) => _chunkPIZCE3JDjs.upsertAddressTriggers.call(void 0, a, userStorage));
525
- const newTriggers = _chunkPIZCE3JDjs.traverseUserStorageTriggers.call(void 0, userStorage, {
539
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn).call(this, accounts);
540
+ const { bearerToken, storageKey } = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
541
+ const userStorage = await _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
542
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
543
+ accounts.forEach((a) => _chunk7U22ZANCjs.upsertAddressTriggers.call(void 0, a, userStorage));
544
+ const newTriggers = _chunk7U22ZANCjs.traverseUserStorageTriggers.call(void 0, userStorage, {
526
545
  mapTrigger: (t) => {
527
546
  if (!t.enabled) {
528
547
  return t;
@@ -531,8 +550,8 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
531
550
  }
532
551
  });
533
552
  if (newTriggers.length > 0) {
534
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
535
- const triggers = _chunkPIZCE3JDjs.traverseUserStorageTriggers.call(void 0, userStorage, {
553
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
554
+ const triggers = _chunk7U22ZANCjs.traverseUserStorageTriggers.call(void 0, userStorage, {
536
555
  mapTrigger: (t) => {
537
556
  if (accounts.some((a) => a.toLowerCase() === t.address.toLowerCase())) {
538
557
  return t;
@@ -540,22 +559,22 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
540
559
  return void 0;
541
560
  }
542
561
  });
543
- await _chunkVOZ7Y2OOjs.createOnChainTriggers.call(void 0,
562
+ await _chunkTPGIXSC2js.createOnChainTriggers.call(void 0,
544
563
  userStorage,
545
564
  storageKey,
546
565
  bearerToken,
547
566
  triggers
548
567
  );
549
568
  }
550
- const UUIDs = _chunkPIZCE3JDjs.getAllUUIDs.call(void 0, userStorage);
551
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).updatePushNotifications(UUIDs);
552
- await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
569
+ const UUIDs = _chunk7U22ZANCjs.getAllUUIDs.call(void 0, userStorage);
570
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _pushNotifications).updatePushNotifications(UUIDs);
571
+ await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
553
572
  return userStorage;
554
573
  } catch (err) {
555
574
  _loglevel2.default.error("Failed to update OnChain triggers", err);
556
575
  throw new Error("Failed to update OnChain triggers");
557
576
  } finally {
558
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn).call(this, accounts);
577
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn).call(this, accounts);
559
578
  }
560
579
  }
561
580
  /**
@@ -568,15 +587,15 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
568
587
  */
569
588
  async fetchAndUpdateMetamaskNotifications() {
570
589
  try {
571
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, true);
590
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, true);
572
591
  const rawFeatureAnnouncementNotifications = this.state.isFeatureAnnouncementsEnabled ? await _chunkZMNXLHACjs.getFeatureAnnouncementNotifications.call(void 0,
573
- _chunkV46WVGWNjs.__privateGet.call(void 0, this, _featureAnnouncementEnv)
592
+ _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _featureAnnouncementEnv)
574
593
  ).catch(() => []) : [];
575
594
  const rawOnChainNotifications = [];
576
- const userStorage = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).getNotificationStorage().then((s) => s && JSON.parse(s)).catch(() => null);
577
- const bearerToken = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _auth).getBearerToken().catch(() => null);
595
+ const userStorage = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).getNotificationStorage().then((s) => s && JSON.parse(s)).catch(() => null);
596
+ const bearerToken = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _auth).getBearerToken().catch(() => null);
578
597
  if (userStorage && bearerToken) {
579
- const notifications = await _chunkVOZ7Y2OOjs.getOnChainNotifications.call(void 0,
598
+ const notifications = await _chunkTPGIXSC2js.getOnChainNotifications.call(void 0,
580
599
  userStorage,
581
600
  bearerToken
582
601
  ).catch(() => []);
@@ -584,7 +603,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
584
603
  }
585
604
  const readIds = this.state.metamaskNotificationsReadList;
586
605
  const isNotUndefined = (t) => Boolean(t);
587
- const processAndFilter = (ns) => ns.map((n) => _chunkGFAESVZAjs.safeProcessNotification.call(void 0, n, readIds)).filter(isNotUndefined);
606
+ const processAndFilter = (ns) => ns.map((n) => _chunk5FUMSWDDjs.safeProcessNotification.call(void 0, n, readIds)).filter(isNotUndefined);
588
607
  const featureAnnouncementNotifications = processAndFilter(
589
608
  rawFeatureAnnouncementNotifications
590
609
  );
@@ -599,10 +618,10 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
599
618
  this.update((state) => {
600
619
  state.metamaskNotificationsList = metamaskNotifications;
601
620
  });
602
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, false);
621
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, false);
603
622
  return metamaskNotifications;
604
623
  } catch (err) {
605
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, false);
624
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, false);
606
625
  _loglevel2.default.error("Failed to fetch notifications", err);
607
626
  throw new Error("Failed to fetch notifications");
608
627
  }
@@ -624,12 +643,12 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
624
643
  (notification) => notification.type === "features_announcement" /* FEATURES_ANNOUNCEMENT */ && !notification.isRead
625
644
  );
626
645
  if (onChainNotifications.length > 0) {
627
- const bearerToken = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _auth).getBearerToken();
646
+ const bearerToken = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _auth).getBearerToken();
628
647
  if (bearerToken) {
629
648
  onchainNotificationIds = onChainNotifications.map(
630
649
  (notification) => notification.id
631
650
  );
632
- await _chunkVOZ7Y2OOjs.markNotificationsAsRead.call(void 0,
651
+ await _chunkTPGIXSC2js.markNotificationsAsRead.call(void 0,
633
652
  bearerToken,
634
653
  onchainNotificationIds
635
654
  ).catch(() => {
@@ -673,7 +692,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
673
692
  if (this.state.metamaskNotificationsList.some((n) => n.id === notification.id)) {
674
693
  return;
675
694
  }
676
- const processedNotification = _chunkGFAESVZAjs.safeProcessNotification.call(void 0, notification);
695
+ const processedNotification = _chunk5FUMSWDDjs.safeProcessNotification.call(void 0, notification);
677
696
  if (processedNotification) {
678
697
  this.update((state) => {
679
698
  const existingNotificationIds = new Set(
@@ -689,6 +708,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
689
708
  }
690
709
  }
691
710
  };
711
+ _isPushIntegrated = new WeakMap();
692
712
  _auth = new WeakMap();
693
713
  _storage = new WeakMap();
694
714
  _pushNotifications = new WeakMap();
@@ -720,7 +740,7 @@ clearLoadingStates_fn = function() {
720
740
  };
721
741
  _assertAuthEnabled = new WeakSet();
722
742
  assertAuthEnabled_fn = function() {
723
- if (!_chunkV46WVGWNjs.__privateGet.call(void 0, this, _auth).isSignedIn()) {
743
+ if (!_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _auth).isSignedIn()) {
724
744
  this.update((state) => {
725
745
  state.isNotificationServicesEnabled = false;
726
746
  });
@@ -729,9 +749,9 @@ assertAuthEnabled_fn = function() {
729
749
  };
730
750
  _getValidStorageKeyAndBearerToken = new WeakSet();
731
751
  getValidStorageKeyAndBearerToken_fn = async function() {
732
- _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertAuthEnabled, assertAuthEnabled_fn).call(this);
733
- const bearerToken = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _auth).getBearerToken();
734
- const storageKey = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).getStorageKey();
752
+ _chunkIGY2S5BCjs.__privateMethod.call(void 0, this, _assertAuthEnabled, assertAuthEnabled_fn).call(this);
753
+ const bearerToken = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _auth).getBearerToken();
754
+ const storageKey = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).getStorageKey();
735
755
  if (!bearerToken || !storageKey) {
736
756
  throw new Error("Missing BearerToken or storage key");
737
757
  }
@@ -746,7 +766,7 @@ assertUserStorage_fn = function(storage) {
746
766
  };
747
767
  _getUserStorage = new WeakSet();
748
768
  getUserStorage_fn = async function() {
749
- const userStorageString = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).getNotificationStorage();
769
+ const userStorageString = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).getNotificationStorage();
750
770
  if (!userStorageString) {
751
771
  return null;
752
772
  }
@@ -799,4 +819,4 @@ clearUpdatingAccountsState_fn = function(accounts) {
799
819
 
800
820
 
801
821
  exports.defaultState = defaultState; exports.NotificationServicesController = NotificationServicesController;
802
- //# sourceMappingURL=chunk-YRWUXGL3.js.map
822
+ //# sourceMappingURL=chunk-TITJWXKP.js.map