@braze/web-sdk 5.8.1 → 5.9.1

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 (126) hide show
  1. package/index.d.ts +14 -9
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +20 -20
  5. package/shared-lib/guid.js +2 -2
  6. package/shared-lib/indexed-db-adapter.js +3 -3
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +11 -11
  9. package/src/Banner/banner-provider.js +22 -19
  10. package/src/Banner/display/banner-to-html.js +32 -27
  11. package/src/Banner/get-all-banners.js +11 -5
  12. package/src/Banner/get-banner.js +6 -3
  13. package/src/Banner/log-banner-click.js +2 -2
  14. package/src/Banner/log-banner-impressions.js +4 -4
  15. package/src/Banner/request-banners-refresh.js +5 -2
  16. package/src/Banner/subscribe-to-banners-updates.js +2 -2
  17. package/src/Banner/ui/insert-banner.js +2 -2
  18. package/src/Card/card-manager.js +9 -9
  19. package/src/Card/display/card-display.js +5 -5
  20. package/src/Card/log-card-click.js +2 -2
  21. package/src/Card/log-card-dismissal.js +2 -2
  22. package/src/Card/log-card-impressions.js +2 -2
  23. package/src/Card/models/captioned-image.js +17 -17
  24. package/src/Card/models/card.js +58 -58
  25. package/src/Card/models/classic-card.js +17 -17
  26. package/src/Card/models/control-card.js +8 -8
  27. package/src/Card/models/image-only.js +15 -15
  28. package/src/Card/util/card-factory.js +24 -24
  29. package/src/ContentCards/content-cards-provider.js +77 -75
  30. package/src/ContentCards/get-cached-content-cards.js +1 -1
  31. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  32. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  33. package/src/ContentCards/ui/show-content-cards.js +3 -3
  34. package/src/Core/change-user.js +1 -1
  35. package/src/Core/disable-sdk.js +4 -4
  36. package/src/Core/enable-sdk.js +3 -3
  37. package/src/Core/handle-braze-action.js +2 -2
  38. package/src/Core/is-initialized.js +1 -1
  39. package/src/Core/open-session.js +4 -4
  40. package/src/Core/request-immediate-data-flush.js +1 -1
  41. package/src/Core/wipe-data.js +7 -5
  42. package/src/FeatureFlags/feature-flag-factory.js +4 -4
  43. package/src/FeatureFlags/feature-flag.js +3 -3
  44. package/src/FeatureFlags/feature-flags-provider.js +17 -11
  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/log-feature-flag-impression.js +1 -1
  48. package/src/Feed/feed-provider-factory.js +1 -1
  49. package/src/Feed/feed-provider.js +12 -12
  50. package/src/Feed/get-cached-feed.js +1 -1
  51. package/src/Feed/request-feed-refresh.js +1 -1
  52. package/src/Feed/ui/show-feed.js +1 -1
  53. package/src/InAppMessage/display/html-message-to-html.js +8 -8
  54. package/src/InAppMessage/display/in-app-message-to-html.js +18 -18
  55. package/src/InAppMessage/display/modal-utils.js +7 -7
  56. package/src/InAppMessage/in-app-message-factory.js +6 -6
  57. package/src/InAppMessage/in-app-message-manager.js +70 -70
  58. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  59. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  60. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  61. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  62. package/src/InAppMessage/models/control-message.js +2 -2
  63. package/src/InAppMessage/models/full-screen-message.js +6 -6
  64. package/src/InAppMessage/models/html-message.js +7 -7
  65. package/src/InAppMessage/models/in-app-message-button.js +3 -3
  66. package/src/InAppMessage/models/in-app-message.js +36 -36
  67. package/src/InAppMessage/models/modal-message.js +6 -6
  68. package/src/InAppMessage/models/slide-up-message.js +8 -8
  69. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  70. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  71. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  72. package/src/InAppMessage/ui/show-in-app-message.js +13 -13
  73. package/src/Push/push-manager.js +81 -81
  74. package/src/Push/request-push-permission.js +1 -1
  75. package/src/Push/utils/push-utils.js +4 -4
  76. package/src/User/user-manager.js +10 -10
  77. package/src/User/user.js +15 -15
  78. package/src/common/constants.js +2 -0
  79. package/src/common/event-logger.js +2 -2
  80. package/src/common/feed-display.js +6 -6
  81. package/src/l10n/l10n-manager-factory.js +1 -1
  82. package/src/managers/auth-manager.js +30 -30
  83. package/src/managers/braze-instance.js +94 -93
  84. package/src/managers/device-manager.js +14 -14
  85. package/src/managers/network-manager.js +123 -117
  86. package/src/managers/server-config-manager.js +91 -79
  87. package/src/managers/session-manager.js +8 -8
  88. package/src/managers/storage-manager-factory.js +5 -5
  89. package/src/managers/storage-manager.js +48 -48
  90. package/src/managers/subscription-manager.js +4 -4
  91. package/src/models/backend-errors.js +4 -4
  92. package/src/models/braze-event.js +9 -9
  93. package/src/models/device.js +2 -2
  94. package/src/models/identifier.js +3 -3
  95. package/src/models/push-token.js +4 -4
  96. package/src/models/request-result.js +2 -2
  97. package/src/models/server-config.js +18 -18
  98. package/src/request-controller.js +100 -88
  99. package/src/triggers/models/custom-event-data.js +1 -1
  100. package/src/triggers/models/custom-event-property-data.js +2 -2
  101. package/src/triggers/models/filter-set.js +4 -4
  102. package/src/triggers/models/filter.js +6 -6
  103. package/src/triggers/models/in-app-message-click-data.js +1 -1
  104. package/src/triggers/models/purchase-data.js +1 -1
  105. package/src/triggers/models/purchase-property-data.js +2 -2
  106. package/src/triggers/models/push-click-data.js +1 -1
  107. package/src/triggers/models/trigger-condition.js +33 -33
  108. package/src/triggers/models/trigger-events.js +2 -2
  109. package/src/triggers/models/trigger.js +12 -12
  110. package/src/triggers/triggers-provider-factory.js +3 -3
  111. package/src/triggers/triggers-provider.js +17 -17
  112. package/src/ui/js/attach-css.js +1 -1
  113. package/src/ui/js/load-font-awesome.js +1 -1
  114. package/src/util/base-device-parser.js +1 -1
  115. package/src/util/braze-actions.js +4 -4
  116. package/src/util/browser-detector.js +5 -5
  117. package/src/util/client-hints-parser.js +1 -1
  118. package/src/util/component-utils.js +2 -2
  119. package/src/util/dom-utils.js +3 -3
  120. package/src/util/html-display-utils.js +14 -14
  121. package/src/util/key-codes.js +1 -1
  122. package/src/util/net.js +2 -2
  123. package/src/util/request-header-utils.js +13 -13
  124. package/src/util/user-agent-parser.js +1 -1
  125. package/src/util/validation-utils.js +2 -2
  126. package/src/util/window-utils.js +2 -2
@@ -7,37 +7,37 @@ import vt from "./utils/push-utils.js";
7
7
  import { getErrorMessage as si } from "../util/error-utils.js";
8
8
  export default class na {
9
9
  constructor(i, t, e, s, r, n, o, u, a, h, c) {
10
- (this.on = i),
11
- (this.un = t),
12
- (this.an = e),
13
- (this.hn = r),
14
- (this.cn = n),
15
- (this.fn = o),
10
+ (this.un = i),
11
+ (this.an = t),
12
+ (this.hn = e),
13
+ (this.cn = r),
14
+ (this.fn = n),
15
+ (this.ln = o),
16
16
  (this.B = u),
17
- (this.ln = a),
18
- (this.dn = h),
17
+ (this.dn = a),
18
+ (this.pn = h),
19
19
  (this.C = c),
20
- (this.on = i),
21
- (this.un = t),
22
- (this.an = e),
23
- (this.pn = s + "/safari/" + t),
24
- (this.hn = r || "/service-worker.js"),
25
- (this.fn = o),
20
+ (this.un = i),
21
+ (this.an = t),
22
+ (this.hn = e),
23
+ (this.bn = s + "/safari/" + t),
24
+ (this.cn = r || "/service-worker.js"),
25
+ (this.ln = o),
26
26
  (this.B = u),
27
- (this.ln = a || !1),
28
- (this.dn = h || !1),
27
+ (this.dn = a || !1),
28
+ (this.pn = h || !1),
29
29
  (this.C = c),
30
- (this.bn = vt.yn()),
31
- (this.mn = vt.gn());
30
+ (this.yn = vt.mn()),
31
+ (this.gn = vt.vn());
32
32
  }
33
- vn() {
34
- return this.dn;
33
+ wn() {
34
+ return this.pn;
35
35
  }
36
- wn(i, t, e, s, r) {
36
+ kn(i, t, e, s, r) {
37
37
  i.unsubscribe()
38
38
  .then((i) => {
39
39
  i
40
- ? this.kn(t, e, s, r)
40
+ ? this.Pn(t, e, s, r)
41
41
  : (N.error("Failed to unsubscribe device from push."),
42
42
  "function" == typeof r && r(!1));
43
43
  })
@@ -46,7 +46,7 @@ export default class na {
46
46
  "function" == typeof r && r(!1);
47
47
  });
48
48
  }
49
- Pn(i, t, e) {
49
+ Dn(i, t, e) {
50
50
  var s;
51
51
  const r = ((i) => {
52
52
  if ("string" == typeof i) return i;
@@ -55,9 +55,9 @@ export default class na {
55
55
  let t = i.endpoint;
56
56
  const e = i;
57
57
  return (
58
- e.Dn &&
59
- -1 === i.endpoint.indexOf(e.Dn) &&
60
- (t = i.endpoint + "/" + e.Dn),
58
+ e.Sn &&
59
+ -1 === i.endpoint.indexOf(e.Sn) &&
60
+ (t = i.endpoint + "/" + e.Sn),
61
61
  t
62
62
  );
63
63
  })(i);
@@ -84,53 +84,53 @@ export default class na {
84
84
  .replace(/\//g, "_")
85
85
  : null;
86
86
  })(u);
87
- null === (s = this.on) || void 0 === s || s.Sn(r, t, n, o, a),
87
+ null === (s = this.un) || void 0 === s || s.An(r, t, n, o, a),
88
88
  r && "function" == typeof e && e(r, n, o);
89
89
  }
90
- An() {
90
+ jn() {
91
91
  var i;
92
- null === (i = this.on) || void 0 === i || i.jn(!0);
92
+ null === (i = this.un) || void 0 === i || i.xn(!0);
93
93
  }
94
- xn(i, t) {
94
+ Nn(i, t) {
95
95
  var e;
96
- null === (e = this.on) || void 0 === e || e.jn(!1),
96
+ null === (e = this.un) || void 0 === e || e.xn(!1),
97
97
  N.info(i),
98
98
  "function" == typeof t && t(!1);
99
99
  }
100
- Nn(i, t, e, s) {
100
+ Un(i, t, e, s) {
101
101
  var r;
102
102
  if ("default" === t.permission)
103
103
  try {
104
104
  window.safari.pushNotification.requestPermission(
105
- this.pn,
105
+ this.bn,
106
106
  i,
107
107
  {
108
- api_key: this.un,
108
+ api_key: this.an,
109
109
  device_id:
110
- (null === (r = this.an) || void 0 === r ? void 0 : r.ve().id) ||
110
+ (null === (r = this.hn) || void 0 === r ? void 0 : r.ve().id) ||
111
111
  "",
112
112
  },
113
113
  (t) => {
114
114
  "granted" === t.permission &&
115
- this.on &&
116
- this.on.setPushNotificationSubscriptionType(
115
+ this.un &&
116
+ this.un.setPushNotificationSubscriptionType(
117
117
  User.NotificationSubscriptionTypes.OPTED_IN,
118
118
  ),
119
- this.Nn(i, t, e, s);
119
+ this.Un(i, t, e, s);
120
120
  },
121
121
  );
122
122
  } catch (i) {
123
- this.xn("Could not request permission for push: " + i, s);
123
+ this.Nn("Could not request permission for push: " + i, s);
124
124
  }
125
125
  else
126
126
  "denied" === t.permission
127
- ? this.xn(
127
+ ? this.Nn(
128
128
  "The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",
129
129
  s,
130
130
  )
131
131
  : "granted" === t.permission &&
132
132
  (N.info("Device successfully subscribed to push."),
133
- this.Pn(t.deviceToken, new Date(), e));
133
+ this.Dn(t.deviceToken, new Date(), e));
134
134
  }
135
135
  requestPermission(i, t, e) {
136
136
  const s = (s) => {
@@ -159,14 +159,14 @@ export default class na {
159
159
  : (r = !0);
160
160
  }
161
161
  }
162
- kn(i, t, e, s) {
162
+ Pn(i, t, e, s) {
163
163
  const r = { userVisibleOnly: !0 };
164
164
  null != t && (r.applicationServerKey = t),
165
165
  i.pushManager
166
166
  .subscribe(r)
167
167
  .then((i) => {
168
168
  N.info("Device successfully subscribed to push."),
169
- this.Pn(i, new Date(), e);
169
+ this.Dn(i, new Date(), e);
170
170
  })
171
171
  .catch((i) => {
172
172
  vt.isPushBlocked()
@@ -176,10 +176,10 @@ export default class na {
176
176
  "function" == typeof s && s(!0));
177
177
  });
178
178
  }
179
- Un() {
180
- if (this.ln) return navigator.serviceWorker.getRegistration(this.hn);
181
- const i = this.cn ? { scope: this.cn } : void 0;
182
- return navigator.serviceWorker.register(this.hn, i).then(() =>
179
+ Wn() {
180
+ if (this.dn) return navigator.serviceWorker.getRegistration(this.cn);
181
+ const i = this.fn ? { scope: this.fn } : void 0;
182
+ return navigator.serviceWorker.register(this.cn, i).then(() =>
183
183
  navigator.serviceWorker.ready.then(
184
184
  (i) => (
185
185
  i &&
@@ -192,32 +192,32 @@ export default class na {
192
192
  ),
193
193
  );
194
194
  }
195
- Wn(i) {
196
- this.ln ||
195
+ _n(i) {
196
+ this.dn ||
197
197
  (i.unregister(), N.info("Service worker successfully unregistered."));
198
198
  }
199
199
  subscribe(i, t) {
200
200
  if (!vt.isPushSupported())
201
- return N.info(na._n), void ("function" == typeof t && t(!1));
202
- if (this.bn) {
203
- if (!this.ln && null != window.location) {
204
- let i = this.hn;
201
+ return N.info(na.Tn), void ("function" == typeof t && t(!1));
202
+ if (this.yn) {
203
+ if (!this.dn && null != window.location) {
204
+ let i = this.cn;
205
205
  -1 === i.indexOf(window.location.host) &&
206
206
  (i = window.location.host + i),
207
207
  -1 === i.indexOf(window.location.protocol) &&
208
208
  (i = window.location.protocol + "//" + i);
209
209
  }
210
210
  if (vt.isPushBlocked())
211
- return void this.xn(
211
+ return void this.Nn(
212
212
  "Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",
213
213
  t,
214
214
  );
215
- if (this.B && !this.B.Tn() && 0 === this.B.Et())
215
+ if (this.B && !this.B.In() && 0 === this.B.Et())
216
216
  return (
217
217
  N.info(
218
218
  "Waiting for VAPID key from server config before subscribing to push.",
219
219
  ),
220
- void this.B.In(() => {
220
+ void this.B.Vn(() => {
221
221
  this.subscribe(i, t);
222
222
  })
223
223
  );
@@ -236,11 +236,11 @@ export default class na {
236
236
  n = vt.isPushPermissionGranted(),
237
237
  o = () => {
238
238
  !n &&
239
- this.on &&
240
- this.on.setPushNotificationSubscriptionType(
239
+ this.un &&
240
+ this.un.setPushNotificationSubscriptionType(
241
241
  User.NotificationSubscriptionTypes.OPTED_IN,
242
242
  ),
243
- this.Un()
243
+ this.Wn()
244
244
  .then((e) => {
245
245
  if (null == e)
246
246
  return (
@@ -258,16 +258,16 @@ export default class na {
258
258
  (null !=
259
259
  (null === (n = this.B) || void 0 === n
260
260
  ? void 0
261
- : n.Tn()) && (o = ei.Vn(this.B.Tn())),
261
+ : n.In()) && (o = ei.qn(this.B.In())),
262
262
  r)
263
263
  ) {
264
264
  let n,
265
265
  u = null,
266
266
  a = null;
267
- if ((this.C && (n = this.C.ft(s.gt.qn)), n && !z(n))) {
267
+ if ((this.C && (n = this.C.ft(s.gt.zn)), n && !z(n))) {
268
268
  let i;
269
269
  try {
270
- i = ti.En(n).zn;
270
+ i = ti.Rn(n).En;
271
271
  } catch (t) {
272
272
  i = null;
273
273
  }
@@ -291,31 +291,31 @@ export default class na {
291
291
  : N.info(
292
292
  "Attempting to upgrade a gcm_sender_id-based push registration to VAPID - depending on the browser this may or may not result in the same gcm_sender_id-based subscription.",
293
293
  ),
294
- this.wn(r, e, o, i, t))
294
+ this.kn(r, e, o, i, t))
295
295
  : r.expirationTime &&
296
296
  new Date(r.expirationTime).valueOf() <=
297
297
  new Date().valueOf()
298
298
  ? (N.info(
299
299
  "Push subscription is expired, creating new subscription.",
300
300
  ),
301
- this.wn(r, e, o, i, t))
301
+ this.kn(r, e, o, i, t))
302
302
  : n && z(n)
303
- ? this.wn(r, e, o, i, t)
303
+ ? this.kn(r, e, o, i, t)
304
304
  : null == a
305
305
  ? (N.info(
306
306
  "No push subscription creation date found, creating new subscription.",
307
307
  ),
308
- this.wn(r, e, o, i, t))
308
+ this.kn(r, e, o, i, t))
309
309
  : a.valueOf() <= new Date().valueOf()
310
310
  ? (N.info(
311
311
  "Push subscription older than 6 months, creating new subscription.",
312
312
  ),
313
- this.wn(r, e, o, i, t))
313
+ this.kn(r, e, o, i, t))
314
314
  : (N.info(
315
315
  "Device already subscribed to push, sending existing subscription to backend.",
316
316
  ),
317
- this.Pn(r, u, i));
318
- } else this.kn(e, o, i, t);
317
+ this.Dn(r, u, i));
318
+ } else this.Pn(e, o, i, t);
319
319
  })
320
320
  .catch((i) => {
321
321
  N.error("Error checking current push subscriptions: " + i);
@@ -326,29 +326,29 @@ export default class na {
326
326
  });
327
327
  };
328
328
  this.requestPermission(o, r, e);
329
- } else if (this.mn) {
330
- if (null == this.fn || "" === this.fn)
329
+ } else if (this.gn) {
330
+ if (null == this.ln || "" === this.ln)
331
331
  return (
332
332
  N.error(
333
333
  "You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari",
334
334
  ),
335
335
  void ("function" == typeof t && t(!0))
336
336
  );
337
- const e = window.safari.pushNotification.permission(this.fn);
338
- this.Nn(this.fn, e, i, t);
337
+ const e = window.safari.pushNotification.permission(this.ln);
338
+ this.Un(this.ln, e, i, t);
339
339
  }
340
340
  }
341
341
  unsubscribe(i, t) {
342
342
  if (!vt.isPushSupported())
343
- return N.info(na._n), void ("function" == typeof t && t());
344
- this.bn
345
- ? navigator.serviceWorker.getRegistration(this.hn).then((e) => {
343
+ return N.info(na.Tn), void ("function" == typeof t && t());
344
+ this.yn
345
+ ? navigator.serviceWorker.getRegistration(this.cn).then((e) => {
346
346
  e
347
347
  ? e.pushManager
348
348
  .getSubscription()
349
349
  .then((s) => {
350
350
  s
351
- ? (this.An(),
351
+ ? (this.jn(),
352
352
  s
353
353
  .unsubscribe()
354
354
  .then((s) => {
@@ -361,7 +361,7 @@ export default class na {
361
361
  "Failed to unsubscribe device from push.",
362
362
  ),
363
363
  "function" == typeof t && t()),
364
- this.Wn(e);
364
+ this._n(e);
365
365
  })
366
366
  .catch((i) => {
367
367
  N.error("Push unsubscription error: " + i),
@@ -377,10 +377,10 @@ export default class na {
377
377
  : (N.info("Device already unsubscribed from push."),
378
378
  "function" == typeof i && i());
379
379
  })
380
- : this.mn &&
381
- (this.An(),
380
+ : this.gn &&
381
+ (this.jn(),
382
382
  N.info("Device unsubscribed from push."),
383
383
  "function" == typeof i && i());
384
384
  }
385
385
  }
386
- na._n = "Push notifications are not supported in this browser.";
386
+ na.Tn = "Push notifications are not supported in this browser.";
@@ -3,7 +3,7 @@ import ra from "./push-manager-factory.js";
3
3
  export function requestPushPermission(n, o) {
4
4
  if (r.rr())
5
5
  return ra.ea().subscribe((o, t, e) => {
6
- const s = r.nn();
6
+ const s = r.rn();
7
7
  s && s.requestImmediateDataFlush(), "function" == typeof n && n(o, t, e);
8
8
  }, o);
9
9
  }
@@ -1,15 +1,15 @@
1
1
  const vt = {
2
- yn: () =>
2
+ mn: () =>
3
3
  "serviceWorker" in navigator &&
4
4
  "undefined" != typeof ServiceWorkerRegistration &&
5
5
  "showNotification" in ServiceWorkerRegistration.prototype &&
6
6
  "PushManager" in window,
7
- gn: () =>
7
+ vn: () =>
8
8
  "safari" in window &&
9
9
  "pushNotification" in window.safari &&
10
10
  "function" == typeof window.safari.pushNotification.permission &&
11
11
  "function" == typeof window.safari.pushNotification.requestPermission,
12
- isPushSupported: () => vt.yn() || vt.gn(),
12
+ isPushSupported: () => vt.mn() || vt.vn(),
13
13
  isPushBlocked: () => {
14
14
  const i =
15
15
  vt.isPushSupported() &&
@@ -28,7 +28,7 @@ const vt = {
28
28
  null != window.Notification &&
29
29
  null != window.Notification.permission &&
30
30
  "granted" === window.Notification.permission,
31
- wr: () =>
31
+ Tr: () =>
32
32
  !vt.isPushBlocked() &&
33
33
  vt.isPushSupported() &&
34
34
  !vt.isPushPermissionGranted(),
@@ -1,10 +1,10 @@
1
1
  import _t from "../models/identifier.js";
2
2
  import { getByteLength as er } from "../util/string-utils.js";
3
3
  import ti from "../models/push-token.js";
4
- import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
4
+ import { logger as N, IndexedDBAdapter as st } from "../../shared-lib/index.js";
5
5
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
6
6
  import { User } from "../User/index.js";
7
- export default class bt {
7
+ export default class kt {
8
8
  constructor(t, s) {
9
9
  (this.B = t), (this.C = s), (this.B = t), (this.C = s);
10
10
  }
@@ -47,17 +47,17 @@ export default class bt {
47
47
  u
48
48
  );
49
49
  }
50
- Sn(t, i, e, u, o) {
50
+ An(t, i, e, u, o) {
51
51
  this.nu("push_token", t, !1, !0),
52
52
  this.nu("custom_push_public_key", e, !1, !0),
53
53
  this.nu("custom_push_user_auth", u, !1, !0),
54
54
  this.nu("custom_push_vapid_public_key", o, !1, !0);
55
- const r = tt.Ls.Fs,
56
- h = new tt(r, N),
55
+ const r = st.Ls.Fs,
56
+ h = new st(r, N),
57
57
  n = new ti(t, i, e, u, o);
58
- this.C.Bt(s.gt.qn, n.bt()), h.setItem(r.Ms.cu, r.be, !0);
58
+ this.C.Bt(s.gt.zn, n.bt()), h.setItem(r.Ms.cu, r.be, !0);
59
59
  }
60
- jn(t) {
60
+ xn(t) {
61
61
  if (
62
62
  (this.nu("push_token", null, !1, !0),
63
63
  this.nu("custom_push_public_key", null, !1, !0),
@@ -65,9 +65,9 @@ export default class bt {
65
65
  this.nu("custom_push_vapid_public_key", null, !1, !0),
66
66
  t)
67
67
  ) {
68
- const t = tt.Ls.Fs,
69
- i = new tt(t, N);
70
- this.C.Bt(s.gt.qn, !1), i.setItem(t.Ms.cu, t.be, !1);
68
+ const t = st.Ls.Fs,
69
+ i = new st(t, N);
70
+ this.C.Bt(s.gt.zn, !1), i.setItem(t.Ms.cu, t.be, !1);
71
71
  }
72
72
  }
73
73
  }
package/src/User/user.js CHANGED
@@ -209,7 +209,7 @@ export default class User {
209
209
  null != e &&
210
210
  !nt(e, "add to custom user attribute array", "the given value")
211
211
  ) &&
212
- this.Fi.Ln(d.Rn, t, e).tt
212
+ this.Fi.Ln(d.On, t, e).tt
213
213
  );
214
214
  }
215
215
  removeFromCustomAttributeArray(t, e) {
@@ -219,7 +219,7 @@ export default class User {
219
219
  null != e &&
220
220
  !nt(e, "remove from custom user attribute array", "the given value")
221
221
  ) &&
222
- this.Fi.Ln(d.On, t, e).tt
222
+ this.Fi.Ln(d.Gn, t, e).tt
223
223
  );
224
224
  }
225
225
  incrementCustomUserAttribute(t, e) {
@@ -231,7 +231,7 @@ export default class User {
231
231
  `Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`,
232
232
  ),
233
233
  !1)
234
- : this.Fi.Ln(d.Gn, t, r).tt;
234
+ : this.Fi.Ln(d.Hn, t, r).tt;
235
235
  }
236
236
  setCustomLocationAttribute(t, e, r) {
237
237
  return (
@@ -247,7 +247,7 @@ export default class User {
247
247
  "Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by ±90 and ±180 respectively, or must both be null for removal.",
248
248
  ),
249
249
  !1)
250
- : this.Fi.Hn(t, e, r).tt)
250
+ : this.Fi.Kn(t, e, r).tt)
251
251
  );
252
252
  }
253
253
  addToSubscriptionGroup(t) {
@@ -261,7 +261,7 @@ export default class User {
261
261
  "addToSubscriptionGroup requires a non-empty subscription group ID",
262
262
  ),
263
263
  !1)
264
- : this.Fi.Kn(t, User.Mn.SUBSCRIBED).tt;
264
+ : this.Fi.Mn(t, User.Yn.SUBSCRIBED).tt;
265
265
  }
266
266
  removeFromSubscriptionGroup(t) {
267
267
  return !ir(
@@ -274,24 +274,24 @@ export default class User {
274
274
  "removeFromSubscriptionGroup requires a non-empty subscription group ID",
275
275
  ),
276
276
  !1)
277
- : this.Fi.Kn(t, User.Mn.UNSUBSCRIBED).tt;
277
+ : this.Fi.Mn(t, User.Yn.UNSUBSCRIBED).tt;
278
278
  }
279
279
  setLineId(t) {
280
280
  return ir(t, "set LINE user ID", "the ID", !0) &&
281
281
  0 !== (null == t ? void 0 : t.length)
282
- ? t && t.length > User.Yn
282
+ ? t && t.length > User.Jn
283
283
  ? (N.error(
284
- `Rejected LINE user ID ${t} because it is longer than ${User.Yn} characters.`,
284
+ `Rejected LINE user ID ${t} because it is longer than ${User.Jn} characters.`,
285
285
  ),
286
286
  !1)
287
287
  : this.Cs.nu("native_line_id", t)
288
288
  : (N.error("setLineId requires a non-empty ID"), !1);
289
289
  }
290
- Sn(t, e, r, s, n) {
291
- this.Cs.Sn(t, e, r, s, n), this.Fi.Jn();
290
+ An(t, e, r, s, n) {
291
+ this.Cs.An(t, e, r, s, n), this.Fi.Qn();
292
292
  }
293
- jn(t) {
294
- this.Cs.jn(t);
293
+ xn(t) {
294
+ this.Cs.xn(t);
295
295
  }
296
296
  }
297
297
  (User.Genders = {
@@ -308,8 +308,8 @@ export default class User {
308
308
  UNSUBSCRIBED: "unsubscribed",
309
309
  }),
310
310
  (User.Fn = /^[0-9 .\\(\\)\\+\\-]+$/),
311
- (User.Mn = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
312
- (User.Qn = "user_id"),
311
+ (User.Yn = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
312
+ (User.Xn = "user_id"),
313
313
  (User.lu = "custom"),
314
314
  (User.ur = 997),
315
- (User.Yn = 33);
315
+ (User.Jn = 33);
@@ -13,3 +13,5 @@ export const LAST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT = 72e5;
13
13
  export const MAX_RETRY_COUNT_PER_REQUEST = 15;
14
14
  export const REQUEST_ATTEMPT_DEFAULT = 1;
15
15
  export const SUBSCRIPTION_ID_DATA_ATTRIBUTE = "data-update-subscription-id";
16
+ export const BANNERS_DISABLED_MESSAGE =
17
+ "Banners are disabled. Make sure you have at least one campaign and relaunch the app.";
@@ -1,11 +1,11 @@
1
1
  import { logger as N } from "../../shared-lib/index.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import ve from "../models/braze-event.js";
4
- import E from "../models/request-result.js";
4
+ import F from "../models/request-result.js";
5
5
  const c = {
6
6
  ut: (e, o, t) => {
7
7
  var n, s;
8
- const i = new E(),
8
+ const i = new F(),
9
9
  l = r.P();
10
10
  if (!l)
11
11
  return (
@@ -7,10 +7,10 @@ import { bottomIsInView as B, topIsInView as x } from "../util/dom-utils.js";
7
7
  import { Card, ControlCard } from "../Card/index.js";
8
8
  import { cardToHtml as Fe } from "../Card/display/card-display.js";
9
9
  import { isArray as z } from "../util/code-utils.js";
10
- import { KeyCodes as mt } from "../util/key-codes.js";
10
+ import { KeyCodes as bt } from "../util/key-codes.js";
11
11
  import ge from "../l10n/l10n-manager-factory.js";
12
12
  import { removeSubscription } from "../Core/remove-subscription.js";
13
- import { logger as N, Guid as G } from "../../shared-lib/index.js";
13
+ import { logger as N, Guid as K } from "../../shared-lib/index.js";
14
14
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
15
15
  import {
16
16
  INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as jt,
@@ -153,7 +153,7 @@ export function feedToHtml(e, t, o) {
153
153
  destroyFeedHtml(s), e.stopPropagation();
154
154
  };
155
155
  r.addEventListener("keydown", (e) => {
156
- (e.keyCode !== mt.Wo && e.keyCode !== mt.Xo) || i(e);
156
+ (e.keyCode !== bt.Wo && e.keyCode !== bt.Xo) || i(e);
157
157
  }),
158
158
  (r.onclick = i);
159
159
  const a = document.createElement("i");
@@ -166,7 +166,7 @@ export function feedToHtml(e, t, o) {
166
166
  refreshFeed(e, s), t.stopPropagation();
167
167
  };
168
168
  a.addEventListener("keydown", (e) => {
169
- (e.keyCode !== mt.Wo && e.keyCode !== mt.Xo) || d(e);
169
+ (e.keyCode !== bt.Wo && e.keyCode !== bt.Xo) || d(e);
170
170
  }),
171
171
  (a.onclick = d),
172
172
  n.appendChild(a),
@@ -175,7 +175,7 @@ export function feedToHtml(e, t, o) {
175
175
  const l = () => detectFeedImpressions(e, s);
176
176
  if ((s.addEventListener("scroll", l), !o)) {
177
177
  window.addEventListener("scroll", l);
178
- const e = G.ce();
178
+ const e = K.ce();
179
179
  (scrollListeners[e] = l), s.setAttribute("data-listener-id", e);
180
180
  }
181
181
  return s;
@@ -188,7 +188,7 @@ export function updateFeedCards(e, t, o, s, n) {
188
188
  if (e.url && to.test(e.url)) {
189
189
  const t = eo(e.url);
190
190
  if (ft(t)) {
191
- N.error(dt(jt.Tr, "Content Card"));
191
+ N.error(dt(jt.Mr, "Content Card"));
192
192
  continue;
193
193
  }
194
194
  }
@@ -8,7 +8,7 @@ const ge = {
8
8
  if ((ge.p(), !ge.aa)) {
9
9
  let e = ro.language,
10
10
  t = !1;
11
- r.ee(w.Xn) && ((e = r.ee(w.Xn)), (t = !0)), (ge.aa = new lr(e, t));
11
+ r.ee(w.Zn) && ((e = r.ee(w.Zn)), (t = !0)), (ge.aa = new lr(e, t));
12
12
  }
13
13
  return ge.aa;
14
14
  },