@braze/web-sdk 4.8.3 → 4.9.0

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 (154) hide show
  1. package/index.d.ts +121 -6
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +7 -7
  4. package/shared-lib/encoding-utils.js +4 -4
  5. package/shared-lib/event-types.js +22 -21
  6. package/shared-lib/guid.js +7 -7
  7. package/shared-lib/indexed-db-adapter.js +172 -135
  8. package/shared-lib/logger.js +26 -26
  9. package/shared-lib/supported-options.js +15 -15
  10. package/shared-lib/types.js +1 -0
  11. package/src/Card/card-manager-factory.js +1 -1
  12. package/src/Card/card-manager.js +2 -2
  13. package/src/Card/display/card-display.js +5 -4
  14. package/src/Card/models/banner.js +10 -10
  15. package/src/Card/models/captioned-image.js +7 -7
  16. package/src/Card/models/card.js +37 -36
  17. package/src/Card/models/classic-card.js +7 -7
  18. package/src/Card/models/control-card.js +3 -3
  19. package/src/Card/models/image-only.js +32 -0
  20. package/src/Card/models/index.js +1 -0
  21. package/src/Card/util/card-factory.js +16 -16
  22. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  23. package/src/ContentCards/content-cards-provider.js +102 -102
  24. package/src/ContentCards/get-cached-content-cards.js +1 -1
  25. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  26. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  27. package/src/ContentCards/ui/show-content-cards.js +15 -12
  28. package/src/Core/add-sdk-metadata.js +2 -2
  29. package/src/Core/braze-sdk-metadata.js +1 -1
  30. package/src/Core/change-user.js +1 -1
  31. package/src/Core/device-properties.js +1 -1
  32. package/src/Core/disable-sdk.js +10 -7
  33. package/src/Core/enable-sdk.js +5 -2
  34. package/src/Core/get-device-id.js +3 -3
  35. package/src/Core/get-user.js +1 -1
  36. package/src/Core/handle-braze-action.js +14 -14
  37. package/src/Core/is-disabled.js +1 -1
  38. package/src/Core/log-custom-event.js +4 -4
  39. package/src/Core/log-purchase.js +9 -9
  40. package/src/Core/open-session.js +10 -10
  41. package/src/FeatureFlags/feature-flag-factory.js +5 -3
  42. package/src/FeatureFlags/feature-flag.js +17 -14
  43. package/src/FeatureFlags/feature-flags-provider-factory.js +1 -1
  44. package/src/FeatureFlags/feature-flags-provider.js +56 -43
  45. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  46. package/src/FeatureFlags/get-feature-flag.js +2 -2
  47. package/src/FeatureFlags/index.js +1 -0
  48. package/src/FeatureFlags/log-feature-flag-impression.js +23 -0
  49. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  50. package/src/Feed/feed-provider-factory.js +1 -1
  51. package/src/Feed/feed-provider.js +20 -20
  52. package/src/Feed/get-cached-feed.js +1 -1
  53. package/src/Feed/log-feed-displayed.js +1 -1
  54. package/src/Feed/request-feed-refresh.js +1 -1
  55. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  56. package/src/Feed/ui/show-feed.js +13 -10
  57. package/src/InAppMessage/defer-in-app-message.js +13 -0
  58. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  59. package/src/InAppMessage/display/html-message-to-html.js +47 -47
  60. package/src/InAppMessage/display/in-app-message-to-html.js +92 -91
  61. package/src/InAppMessage/display/modal-utils.js +16 -16
  62. package/src/InAppMessage/get-deferred-in-app-message.js +5 -0
  63. package/src/InAppMessage/in-app-message-factory.js +77 -57
  64. package/src/InAppMessage/in-app-message-manager-factory.js +6 -6
  65. package/src/InAppMessage/in-app-message-manager.js +121 -82
  66. package/src/InAppMessage/index.js +2 -0
  67. package/src/InAppMessage/log-in-app-message-button-click.js +17 -9
  68. package/src/InAppMessage/log-in-app-message-click.js +4 -4
  69. package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
  70. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  71. package/src/InAppMessage/models/full-screen-message.js +65 -29
  72. package/src/InAppMessage/models/html-message.js +32 -13
  73. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  74. package/src/InAppMessage/models/in-app-message.js +203 -134
  75. package/src/InAppMessage/models/modal-message.js +64 -29
  76. package/src/InAppMessage/models/slide-up-message.js +52 -24
  77. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  78. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  79. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +6 -6
  80. package/src/InAppMessage/ui/show-in-app-message.js +49 -47
  81. package/src/InAppMessage/utils/in-app-message-utils.js +1 -1
  82. package/src/Push/is-push-blocked.js +2 -2
  83. package/src/Push/is-push-permission-granted.js +2 -2
  84. package/src/Push/is-push-supported.js +2 -2
  85. package/src/Push/push-manager-factory.js +19 -19
  86. package/src/Push/push-manager.js +131 -131
  87. package/src/Push/request-push-permission.js +2 -2
  88. package/src/Push/unregister-push.js +2 -2
  89. package/src/Push/utils/push-utils.js +12 -10
  90. package/src/User/user-manager.js +4 -4
  91. package/src/User/user.js +57 -57
  92. package/src/common/base-feed.js +1 -1
  93. package/src/common/constants.js +1 -0
  94. package/src/common/event-logger.js +6 -6
  95. package/src/common/feed-display.js +34 -34
  96. package/src/common/translations.js +33 -33
  97. package/src/l10n/l10n-manager-factory.js +8 -8
  98. package/src/l10n/l10n-manager.js +6 -2
  99. package/src/l10n/types.js +1 -0
  100. package/src/managers/auth-manager.js +29 -29
  101. package/src/managers/braze-instance.js +125 -125
  102. package/src/managers/device-manager.js +20 -20
  103. package/src/managers/network-manager.js +100 -98
  104. package/src/managers/server-config-manager.js +23 -23
  105. package/src/managers/session-manager.js +5 -5
  106. package/src/managers/storage-manager-factory.js +9 -9
  107. package/src/managers/storage-manager.js +132 -129
  108. package/src/managers/subscription-manager.js +8 -8
  109. package/src/models/backend-errors.js +6 -6
  110. package/src/models/braze-event.js +11 -11
  111. package/src/models/braze-sdk-metadata.js +1 -1
  112. package/src/models/device.js +2 -2
  113. package/src/models/identifier.js +1 -1
  114. package/src/models/push-token.js +5 -5
  115. package/src/models/server-config.js +7 -7
  116. package/src/request-controller.js +191 -178
  117. package/src/triggers/models/custom-event-data.js +4 -4
  118. package/src/triggers/models/custom-event-property-data.js +7 -7
  119. package/src/triggers/models/filter-set.js +5 -5
  120. package/src/triggers/models/filter.js +64 -60
  121. package/src/triggers/models/in-app-message-click-data.js +9 -9
  122. package/src/triggers/models/purchase-data.js +4 -4
  123. package/src/triggers/models/purchase-property-data.js +6 -6
  124. package/src/triggers/models/push-click-data.js +6 -6
  125. package/src/triggers/models/trigger-condition.js +55 -59
  126. package/src/triggers/models/trigger-events.js +3 -3
  127. package/src/triggers/models/trigger.js +47 -35
  128. package/src/triggers/triggers-provider-factory.js +10 -6
  129. package/src/triggers/triggers-provider.js +203 -185
  130. package/src/triggers/types.js +1 -0
  131. package/src/ui/js/attach-css.js +5 -4
  132. package/src/ui/js/feed-css.js +5 -5
  133. package/src/ui/js/iam-css.js +5 -5
  134. package/src/ui/js/load-font-awesome.js +1 -1
  135. package/src/util/base-device-parser.js +1 -1
  136. package/src/util/braze-actions.js +35 -30
  137. package/src/util/browser-detector.js +30 -31
  138. package/src/util/client-hints-parser.js +30 -24
  139. package/src/util/code-utils.js +22 -21
  140. package/src/util/color-utils.js +19 -13
  141. package/src/util/component-utils.js +4 -4
  142. package/src/util/date-utils.js +4 -3
  143. package/src/util/device-constants.js +10 -10
  144. package/src/util/dom-utils.js +32 -28
  145. package/src/util/error-utils.js +1 -1
  146. package/src/util/key-codes.js +1 -1
  147. package/src/util/net.js +53 -57
  148. package/src/util/request-header-utils.js +34 -11
  149. package/src/util/string-utils.js +14 -14
  150. package/src/util/types.js +1 -0
  151. package/src/util/url-utils.js +1 -4
  152. package/src/util/user-agent-parser.js +39 -39
  153. package/src/util/validation-utils.js +32 -32
  154. package/src/util/window-utils.js +11 -12
@@ -1,27 +1,35 @@
1
- export default class Ae {
1
+ export default class Oe {
2
2
  constructor(t, e) {
3
- (this.nd = "undefined" == typeof window ? self : window),
4
- (this.od = t),
5
- (this.sd = e);
3
+ (this.database = t),
4
+ (this.j = e),
5
+ (this.parent = "undefined" == typeof window ? self : window),
6
+ (this.database = t),
7
+ (this.j = e);
6
8
  }
7
- dd() {
8
- if ("indexedDB" in this.nd) return this.nd.indexedDB;
9
+ td() {
10
+ if ("indexedDB" in this.parent) return this.parent.indexedDB;
9
11
  }
10
- ud() {
12
+ isSupported() {
13
+ var t;
11
14
  try {
12
- if (null == this.dd()) return !1;
15
+ if (null == this.td()) return !1;
13
16
  {
14
- const t = this.dd().open("Braze IndexedDB Support Test");
17
+ const e =
18
+ null === (t = this.td()) || void 0 === t
19
+ ? void 0
20
+ : t.open("Braze IndexedDB Support Test");
15
21
  if (
16
- ((t.onupgradeneeded = () => t.result.close()),
17
- (t.onsuccess = () => t.result.close()),
22
+ (e &&
23
+ ((e.onupgradeneeded = () => e.result.close()),
24
+ (e.onsuccess = () => e.result.close())),
18
25
  "undefined" != typeof window)
19
26
  ) {
20
- const t = window.chrome || window.browser || window.msBrowser;
21
- if (t && t.runtime && t.runtime.id)
27
+ const t = window,
28
+ e = t.chrome || t.browser || t.ed;
29
+ if (e && e.runtime && e.runtime.id)
22
30
  return (
23
- this.sd.info(
24
- "Not using IndexedDB for storage because we are running inside an extension"
31
+ this.j.info(
32
+ "Not using IndexedDB for storage because we are running inside an extension",
25
33
  ),
26
34
  !1
27
35
  );
@@ -30,85 +38,101 @@ export default class Ae {
30
38
  }
31
39
  } catch (t) {
32
40
  return (
33
- this.sd.info(
34
- "Not using IndexedDB for storage due to following error: " + t
41
+ this.j.info(
42
+ "Not using IndexedDB for storage due to following error: " + t,
35
43
  ),
36
44
  !1
37
45
  );
38
46
  }
39
47
  }
40
- fd(t, e) {
41
- const n = this.dd().open(this.od.ad, this.od.VERSION);
42
- if (null == n) return "function" == typeof e && e(), !1;
43
- const o = this;
48
+ nd(t, e) {
49
+ var n;
50
+ const o =
51
+ null === (n = this.td()) || void 0 === n
52
+ ? void 0
53
+ : n.open(this.database.od, this.database.VERSION);
54
+ if (null == o) return "function" == typeof e && e(), !1;
55
+ const i = this;
44
56
  return (
45
- (n.onupgradeneeded = t => {
46
- o.sd.info(
47
- "Upgrading indexedDB " + o.od.ad + " to v" + o.od.VERSION + "..."
57
+ (o.onupgradeneeded = (t) => {
58
+ var e;
59
+ i.j.info(
60
+ "Upgrading indexedDB " +
61
+ i.database.od +
62
+ " to v" +
63
+ i.database.VERSION +
64
+ "...",
48
65
  );
49
- const e = t.target.result;
50
- for (const t in o.od.Jt)
51
- o.od.Jt.hasOwnProperty(t) &&
52
- !e.objectStoreNames.contains(o.od.Jt[t]) &&
53
- e.createObjectStore(o.od.Jt[t]);
66
+ const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
67
+ for (const t in i.database.Jt) {
68
+ const e = t;
69
+ i.database.Jt.hasOwnProperty(t) &&
70
+ !n.objectStoreNames.contains(i.database.Jt[e]) &&
71
+ n.createObjectStore(i.database.Jt[e]);
72
+ }
54
73
  }),
55
- (n.onsuccess = n => {
56
- const i = n.target.result;
57
- (i.onversionchange = () => {
58
- i.close(),
74
+ (o.onsuccess = (n) => {
75
+ var o;
76
+ const r = null === (o = n.target) || void 0 === o ? void 0 : o.result;
77
+ (r.onversionchange = () => {
78
+ r.close(),
59
79
  "function" == typeof e && e(),
60
- o.sd.error(
61
- "Needed to close the database unexpectedly because of an upgrade in another tab"
80
+ i.j.error(
81
+ "Needed to close the database unexpectedly because of an upgrade in another tab",
62
82
  );
63
83
  }),
64
- t(i);
84
+ t(r);
85
+ }),
86
+ (o.onerror = (t) => {
87
+ var n;
88
+ const o = t;
89
+ return (
90
+ i.j.info(
91
+ "Could not open indexedDB " +
92
+ i.database.od +
93
+ " v" +
94
+ i.database.VERSION +
95
+ ": " +
96
+ (null === (n = o.target) || void 0 === n ? void 0 : n.errorCode),
97
+ ),
98
+ "function" == typeof e && e(),
99
+ !0
100
+ );
65
101
  }),
66
- (n.onerror = t => (
67
- o.sd.info(
68
- "Could not open indexedDB " +
69
- o.od.ad +
70
- " v" +
71
- o.od.VERSION +
72
- ": " +
73
- t.target.errorCode
74
- ),
75
- "function" == typeof e && e(),
76
- !0
77
- )),
78
102
  !0
79
103
  );
80
104
  }
81
105
  setItem(t, e, n, o, i) {
82
- if (!this.ud()) return "function" == typeof i && i(), !1;
106
+ if (!this.isSupported()) return "function" == typeof i && i(), !1;
83
107
  const r = this;
84
- return this.fd(s => {
85
- if (!s.objectStoreNames.contains(t))
108
+ return this.nd((d) => {
109
+ if (!d.objectStoreNames.contains(t))
86
110
  return (
87
- r.sd.error(
111
+ r.j.error(
88
112
  "Could not store object " +
89
113
  e +
90
114
  " in " +
91
115
  t +
92
116
  " on indexedDB " +
93
- r.od.ad +
117
+ r.database.od +
94
118
  " - " +
95
119
  t +
96
- " is not a valid objectStore"
120
+ " is not a valid objectStore",
97
121
  ),
98
122
  "function" == typeof i && i(),
99
- void s.close()
123
+ void d.close()
100
124
  );
101
- const d = s.transaction([t], "readwrite");
102
- d.oncomplete = () => s.close();
103
- const u = d.objectStore(t).put(n, e);
125
+ const s = d.transaction([t], "readwrite");
126
+ s.oncomplete = () => d.close();
127
+ const u = s.objectStore(t).put(n, e);
104
128
  (u.onerror = () => {
105
- r.sd.error(
129
+ r.j.error(
106
130
  "Could not store object " +
107
131
  e +
108
132
  " in " +
109
133
  t +
110
134
  " on indexedDB " +
111
- r.od.ad
135
+ r.database.od,
112
136
  ),
113
137
  "function" == typeof i && i();
114
138
  }),
@@ -118,198 +142,211 @@ export default class Ae {
118
142
  }, i);
119
143
  }
120
144
  getItem(t, e, n) {
121
- if (!this.ud()) return !1;
145
+ if (!this.isSupported()) return !1;
122
146
  const o = this;
123
- return this.fd(i => {
147
+ return this.nd((i) => {
124
148
  if (!i.objectStoreNames.contains(t))
125
149
  return (
126
- o.sd.error(
150
+ o.j.error(
127
151
  "Could not retrieve object " +
128
152
  e +
129
153
  " in " +
130
154
  t +
131
155
  " on indexedDB " +
132
- o.od.ad +
156
+ o.database.od +
133
157
  " - " +
134
158
  t +
135
- " is not a valid objectStore"
159
+ " is not a valid objectStore",
136
160
  ),
137
161
  void i.close()
138
162
  );
139
163
  const r = i.transaction([t], "readonly");
140
164
  r.oncomplete = () => i.close();
141
- const s = r.objectStore(t).get(e);
142
- (s.onerror = () => {
143
- o.sd.error(
165
+ const d = r.objectStore(t).get(e);
166
+ (d.onerror = () => {
167
+ o.j.error(
144
168
  "Could not retrieve object " +
145
169
  e +
146
170
  " in " +
147
171
  t +
148
172
  " on indexedDB " +
149
- o.od.ad
173
+ o.database.od,
150
174
  );
151
175
  }),
152
- (s.onsuccess = t => {
153
- const e = t.target.result;
154
- null != e && n(e);
176
+ (d.onsuccess = (t) => {
177
+ var e;
178
+ const o = null === (e = t.target) || void 0 === e ? void 0 : e.result;
179
+ null != o && n(o);
155
180
  });
156
181
  });
157
182
  }
158
183
  hr(t, e, n) {
159
- if (!this.ud()) return "function" == typeof n && n(), !1;
184
+ if (!this.isSupported()) return "function" == typeof n && n(), !1;
160
185
  const o = this;
161
- return this.fd(i => {
186
+ return this.nd((i) => {
162
187
  if (!i.objectStoreNames.contains(t))
163
188
  return (
164
- o.sd.error(
189
+ o.j.error(
165
190
  "Could not retrieve last record from " +
166
191
  t +
167
192
  " on indexedDB " +
168
- o.od.ad +
193
+ o.database.od +
169
194
  " - " +
170
195
  t +
171
- " is not a valid objectStore"
196
+ " is not a valid objectStore",
172
197
  ),
173
198
  "function" == typeof n && n(),
174
199
  void i.close()
175
200
  );
176
201
  const r = i.transaction([t], "readonly");
177
202
  r.oncomplete = () => i.close();
178
- const s = r.objectStore(t).openCursor(null, "prev");
179
- (s.onerror = () => {
180
- o.sd.error(
181
- "Could not open cursor for " + t + " on indexedDB " + o.od.ad
203
+ const d = r.objectStore(t).openCursor(null, "prev");
204
+ (d.onerror = () => {
205
+ o.j.error(
206
+ "Could not open cursor for " + t + " on indexedDB " + o.database.od,
182
207
  ),
183
208
  "function" == typeof n && n();
184
209
  }),
185
- (s.onsuccess = t => {
186
- const o = t.target.result;
187
- null != o && null != o.value && null != o.key
188
- ? e(o.key, o.value)
210
+ (d.onsuccess = (t) => {
211
+ var o;
212
+ const i = null === (o = t.target) || void 0 === o ? void 0 : o.result;
213
+ null != i && null != i.value && null != i.key
214
+ ? e(i.key, i.value)
189
215
  : "function" == typeof n && n();
190
216
  });
191
217
  }, n);
192
218
  }
193
- br(t, e) {
194
- if (!this.ud()) return !1;
219
+ oe(t, e) {
220
+ if (!this.isSupported()) return !1;
195
221
  const n = this;
196
- return this.fd(o => {
222
+ return this.nd((o) => {
197
223
  if (!o.objectStoreNames.contains(t))
198
224
  return (
199
- n.sd.error(
225
+ n.j.error(
200
226
  "Could not delete record " +
201
227
  e +
202
228
  " from " +
203
229
  t +
204
230
  " on indexedDB " +
205
- n.od.ad +
231
+ n.database.od +
206
232
  " - " +
207
233
  t +
208
- " is not a valid objectStore"
234
+ " is not a valid objectStore",
209
235
  ),
210
236
  void o.close()
211
237
  );
212
238
  const i = o.transaction([t], "readwrite");
213
239
  i.oncomplete = () => o.close();
214
240
  i.objectStore(t).delete(e).onerror = () => {
215
- n.sd.error(
241
+ n.j.error(
216
242
  "Could not delete record " +
217
243
  e +
218
244
  " from " +
219
245
  t +
220
246
  " on indexedDB " +
221
- n.od.ad
247
+ n.database.od,
222
248
  );
223
249
  };
224
250
  });
225
251
  }
226
252
  Mt(t, e) {
227
- if (!this.ud()) return !1;
253
+ if (!this.isSupported()) return !1;
228
254
  const n = this;
229
- return this.fd(o => {
255
+ return this.nd((o) => {
230
256
  if (!o.objectStoreNames.contains(t))
231
257
  return (
232
- n.sd.error(
258
+ n.j.error(
233
259
  "Could not retrieve objects from " +
234
260
  t +
235
261
  " on indexedDB " +
236
- n.od.ad +
262
+ n.database.od +
237
263
  " - " +
238
264
  t +
239
- " is not a valid objectStore"
265
+ " is not a valid objectStore",
240
266
  ),
241
267
  void o.close()
242
268
  );
243
269
  const i = o.transaction([t], "readwrite");
244
270
  i.oncomplete = () => o.close();
245
271
  const r = i.objectStore(t),
246
- s = r.openCursor(),
247
- d = [];
248
- (s.onerror = () => {
249
- d.length > 0
250
- ? (n.sd.info(
272
+ d = r.openCursor(),
273
+ s = [];
274
+ (d.onerror = () => {
275
+ s.length > 0
276
+ ? (n.j.info(
251
277
  "Cursor closed midway through for " +
252
278
  t +
253
279
  " on indexedDB " +
254
- n.od.ad
280
+ n.database.od,
255
281
  ),
256
- e(d))
257
- : n.sd.error(
258
- "Could not open cursor for " + t + " on indexedDB " + n.od.ad
282
+ e(s))
283
+ : n.j.error(
284
+ "Could not open cursor for " +
285
+ t +
286
+ " on indexedDB " +
287
+ n.database.od,
259
288
  );
260
289
  }),
261
- (s.onsuccess = t => {
262
- const n = t.target.result;
263
- if (null != n) {
264
- if (null != n.value && null != n.key) {
265
- r.delete(n.key).onsuccess = () => {
266
- d.push(n.value);
290
+ (d.onsuccess = (t) => {
291
+ var n;
292
+ const o = null === (n = t.target) || void 0 === n ? void 0 : n.result;
293
+ if (null != o) {
294
+ if (null != o.value && null != o.key) {
295
+ r.delete(o.key).onsuccess = () => {
296
+ s.push(o.value);
267
297
  };
268
298
  }
269
- n.continue();
270
- } else d.length > 0 && e(d);
299
+ "function" == typeof o.continue && o.continue();
300
+ } else s.length > 0 && e(s);
271
301
  });
272
302
  });
273
303
  }
274
304
  clearData() {
275
- if (!this.ud()) return !1;
305
+ if (!this.isSupported()) return !1;
276
306
  const t = [];
277
- for (const e in this.od.Jt)
278
- this.od.Jt.hasOwnProperty(e) &&
279
- this.od.Jt[e] !== this.od.Jt.oe &&
280
- t.push(this.od.Jt[e]);
307
+ for (const e in this.database.Jt) {
308
+ const n = e;
309
+ this.database.Jt.hasOwnProperty(e) &&
310
+ this.database.Jt[n] !== this.database.Jt.se &&
311
+ t.push(this.database.Jt[n]);
312
+ }
281
313
  const e = this;
282
- return this.fd(function(n) {
314
+ return this.nd(function (n) {
283
315
  const o = n.transaction(t, "readwrite");
284
316
  o.oncomplete = () => n.close();
285
317
  for (let n = 0; n < t.length; n++) {
286
318
  const i = t[n];
287
- o.objectStore(i).clear().onerror = function() {
288
- e.sd.error(
289
- "Could not clear " + this.source.name + " on indexedDB " + e.od.ad
319
+ o.objectStore(i).clear().onerror = function () {
320
+ e.j.error(
321
+ "Could not clear " +
322
+ this.source.name +
323
+ " on indexedDB " +
324
+ e.database.od,
290
325
  );
291
326
  };
292
327
  }
293
- o.onerror = function() {
294
- e.sd.error("Could not clear object stores on indexedDB " + e.od.ad);
328
+ o.onerror = function () {
329
+ e.j.error(
330
+ "Could not clear object stores on indexedDB " + e.database.od,
331
+ );
295
332
  };
296
333
  });
297
334
  }
298
335
  }
299
- Ae.ep = {
336
+ Oe.ep = {
300
337
  Ft: {
301
- ad: "AppboyServiceWorkerAsyncStorage",
338
+ od: "AppboyServiceWorkerAsyncStorage",
302
339
  VERSION: 6,
303
340
  Jt: {
304
- Sa: "data",
341
+ Ja: "data",
305
342
  kr: "pushClicks",
306
343
  cu: "pushSubscribed",
307
- hd: "fallbackDevice",
344
+ dd: "fallbackDevice",
308
345
  qt: "cardUpdates",
309
- oe: "optOut",
310
- yr: "pendingData",
311
- kh: "sdkAuthenticationSignature"
346
+ se: "optOut",
347
+ wr: "pendingData",
348
+ qh: "sdkAuthenticationSignature",
312
349
  },
313
- se: 1
314
- }
350
+ ie: 1,
351
+ },
315
352
  };
@@ -1,38 +1,38 @@
1
- const Ge = {
2
- init: function(n) {
3
- (void 0 === n && void 0 !== Ge.zg) || (Ge.zg = !!n), Ge.Eg || (Ge.Eg = !0);
1
+ const Ue = {
2
+ init: function (n) {
3
+ (void 0 === n && void 0 !== Ue.zg) || (Ue.zg = !!n), Ue.t || (Ue.t = !0);
4
4
  },
5
- destroy: function() {
6
- (Ge.Eg = !1), (Ge.zg = void 0), (Ge.sd = void 0);
5
+ destroy: function () {
6
+ (Ue.t = !1), (Ue.zg = void 0), (Ue.j = void 0);
7
7
  },
8
- setLogger: function(n) {
8
+ setLogger: function (n) {
9
9
  "function" == typeof n
10
- ? (Ge.init(), (Ge.sd = n))
11
- : Ge.info("Ignoring setLogger call since logger is not a function");
10
+ ? (Ue.init(), (Ue.j = n))
11
+ : Ue.info("Ignoring setLogger call since logger is not a function");
12
12
  },
13
- toggleLogging: function() {
14
- Ge.init(),
15
- Ge.zg
16
- ? (console.log("Disabling Braze logging"), (Ge.zg = !1))
17
- : (console.log("Enabled Braze logging"), (Ge.zg = !0));
13
+ toggleLogging: function () {
14
+ Ue.init(),
15
+ Ue.zg
16
+ ? (console.log("Disabling Braze logging"), (Ue.zg = !1))
17
+ : (console.log("Enabled Braze logging"), (Ue.zg = !0));
18
18
  },
19
- info: function(n) {
20
- if (Ge.zg) {
19
+ info: function (n) {
20
+ if (Ue.zg) {
21
21
  const o = "Braze: " + n;
22
- null != Ge.sd ? Ge.sd(o) : console.log(o);
22
+ null != Ue.j ? Ue.j(o) : console.log(o);
23
23
  }
24
24
  },
25
- warn: function(n) {
26
- if (Ge.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v4.8.3)";
28
- null != Ge.sd ? Ge.sd(o) : console.warn(o);
25
+ warn: function (n) {
26
+ if (Ue.zg) {
27
+ const o = "Braze SDK Warning: " + n + " (v4.9.0)";
28
+ null != Ue.j ? Ue.j(o) : console.warn(o);
29
29
  }
30
30
  },
31
- error: function(n) {
32
- if (Ge.zg) {
33
- const o = "Braze SDK Error: " + n + " (v4.8.3)";
34
- null != Ge.sd ? Ge.sd(o) : console.error(o);
31
+ error: function (n) {
32
+ if (Ue.zg) {
33
+ const o = "Braze SDK Error: " + n + " (v4.9.0)";
34
+ null != Ue.j ? Ue.j(o) : console.error(o);
35
35
  }
36
- }
36
+ },
37
37
  };
38
- export default Ge;
38
+ export default Ue;
@@ -3,24 +3,24 @@ export default {
3
3
  Eo: "baseUrl",
4
4
  _o: "noCookies",
5
5
  Io: "devicePropertyAllowlist",
6
- ia: "disablePushTokenMaintenance",
6
+ Aa: "disablePushTokenMaintenance",
7
7
  Ao: "enableLogging",
8
8
  So: "enableSdkAuthentication",
9
- ta: "manageServiceWorkerExternally",
9
+ qa: "manageServiceWorkerExternally",
10
10
  No: "minimumIntervalBetweenTriggerActionsInSeconds",
11
11
  wo: "sessionTimeoutInSeconds",
12
- To: "appVersion",
13
- na: "serviceWorkerLocation",
14
- ra: "safariWebsitePushId",
15
- Mn: "localization",
16
- lo: "contentSecurityNonce",
17
- Oo: "enableHtmlInAppMessages",
18
- Co: "allowUserSuppliedJavascript",
19
- mo: "inAppMessageZIndex",
20
- po: "openInAppMessagesInNewTab",
12
+ Oo: "appVersion",
13
+ _a: "serviceWorkerLocation",
14
+ ka: "safariWebsitePushId",
15
+ Ba: "localization",
16
+ po: "contentSecurityNonce",
17
+ Co: "enableHtmlInAppMessages",
18
+ Lo: "allowUserSuppliedJavascript",
19
+ lo: "inAppMessageZIndex",
20
+ fo: "openInAppMessagesInNewTab",
21
21
  en: "openNewsFeedCardsInNewTab",
22
- Lh: "requireExplicitInAppMessageDismissal",
23
- Lo: "doNotLoadFontAwesome",
24
- Po: "sdkFlavor",
25
- tn: "openCardsInNewTab"
22
+ mh: "requireExplicitInAppMessageDismissal",
23
+ Po: "doNotLoadFontAwesome",
24
+ Ro: "sdkFlavor",
25
+ tn: "openCardsInNewTab",
26
26
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -9,6 +9,6 @@ const n = {
9
9
  },
10
10
  destroy: () => {
11
11
  (n.i = null), (n.t = !1);
12
- }
12
+ },
13
13
  };
14
14
  export default n;
@@ -12,7 +12,7 @@ export default class a {
12
12
  if ((n.p(), null == n.url || "" === n.url))
13
13
  return (
14
14
  r.j.info(
15
- `Card ${n.id} has no url. Not logging click to Braze servers.`
15
+ `Card ${n.id} has no url. Not logging click to Braze servers.`,
16
16
  ),
17
17
  e
18
18
  );
@@ -30,7 +30,7 @@ export default class a {
30
30
  if (!n.F())
31
31
  return (
32
32
  r.j.info(
33
- `Card ${n.id} refused this dismissal. Ignoring analytics event.`
33
+ `Card ${n.id} refused this dismissal. Ignoring analytics event.`,
34
34
  ),
35
35
  o
36
36
  );
@@ -44,13 +44,14 @@ export function setCardHeight(t, o) {
44
44
  export function cardToHtml(t, logCardClick, e) {
45
45
  const a = document.createElement("div");
46
46
  (a.className = "ab-card ab-effect-card " + t.U),
47
- t.id && a.setAttribute("data-ab-card-id", t.id),
47
+ t.id &&
48
+ (a.setAttribute("data-ab-card-id", t.id), a.setAttribute("id", t.id)),
48
49
  a.setAttribute("role", "article"),
49
50
  a.setAttribute("tabindex", "0");
50
51
  let n = "",
51
52
  i = !1;
52
53
  t.url && "" !== t.url && ((n = t.url), (i = !0));
53
- const s = o => (markCardAsRead(a), i && (logCardClick(t), m(n, e, o)), !1);
54
+ const s = (o) => (markCardAsRead(a), i && (logCardClick(t), m(n, e, o)), !1);
54
55
  if (t.pinned) {
55
56
  const t = document.createElement("div");
56
57
  t.className = "ab-pinned-indicator";
@@ -83,10 +84,10 @@ export function cardToHtml(t, logCardClick, e) {
83
84
  t.logCardDismissal = () => logCardDismissal(t);
84
85
  const e = o("Dismiss Card", void 0, t.dismissCard.bind(t));
85
86
  a.appendChild(e),
86
- d(u, c.W, t => {
87
+ d(u, c.W, (t) => {
87
88
  (a.className += " ab-swiped-left"), e.onclick(t);
88
89
  }),
89
- d(u, c.X, t => {
90
+ d(u, c.X, (t) => {
90
91
  (a.className += " ab-swiped-right"), e.onclick(t);
91
92
  });
92
93
  }