@braze/web-sdk 6.6.0 → 6.7.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 (152) hide show
  1. package/index.d.ts +253 -5
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +21 -20
  4. package/shared-lib/guid.js +3 -3
  5. package/shared-lib/indexed-db-adapter.js +70 -70
  6. package/shared-lib/logger.js +7 -7
  7. package/shared-lib/supported-options.js +26 -26
  8. package/src/Banner/banner-factory.js +11 -1
  9. package/src/Banner/banner-provider.js +244 -120
  10. package/src/Banner/banner.js +14 -12
  11. package/src/Banner/display/banner-to-html.js +23 -16
  12. package/src/Banner/display/detect-banner-impressions.js +13 -13
  13. package/src/Banner/get-all-banners.js +5 -5
  14. package/src/Banner/get-banner.js +4 -4
  15. package/src/Banner/log-banner-click.js +4 -4
  16. package/src/Banner/log-banner-dismissal.js +23 -0
  17. package/src/Banner/log-banner-impressions.js +7 -7
  18. package/src/Banner/request-banners-refresh.js +12 -16
  19. package/src/Banner/subscribe-to-banners-updates.js +6 -6
  20. package/src/Banner/ui/insert-banner.js +12 -12
  21. package/src/Card/card-manager-factory.js +5 -5
  22. package/src/Card/card-manager.js +33 -33
  23. package/src/Card/constants.js +1 -1
  24. package/src/Card/display/card-display.js +11 -11
  25. package/src/Card/log-card-dismissal.js +3 -3
  26. package/src/Card/log-content-card-click.js +3 -3
  27. package/src/Card/log-content-card-impressions.js +6 -6
  28. package/src/Card/models/captioned-image.js +21 -21
  29. package/src/Card/models/card.js +73 -73
  30. package/src/Card/models/classic-card.js +21 -21
  31. package/src/Card/models/control-card.js +11 -11
  32. package/src/Card/models/image-only.js +18 -18
  33. package/src/Card/util/card-factory.js +41 -41
  34. package/src/ContentCards/content-cards-provider-factory.js +12 -12
  35. package/src/ContentCards/content-cards-provider.js +151 -151
  36. package/src/ContentCards/content-cards.js +5 -5
  37. package/src/ContentCards/get-cached-content-cards.js +2 -2
  38. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  39. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  40. package/src/ContentCards/ui/show-content-cards.js +10 -10
  41. package/src/Core/add-sdk-metadata.js +2 -2
  42. package/src/Core/change-user.js +6 -6
  43. package/src/Core/disable-sdk.js +9 -9
  44. package/src/Core/enable-sdk.js +5 -5
  45. package/src/Core/get-user.js +1 -1
  46. package/src/Core/handle-braze-action.js +3 -3
  47. package/src/Core/is-disabled.js +2 -2
  48. package/src/Core/log-custom-event.js +8 -8
  49. package/src/Core/log-purchase.js +5 -5
  50. package/src/Core/open-session.js +7 -7
  51. package/src/Core/set-sdk-authentication-signature.js +3 -3
  52. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  53. package/src/Core/wipe-data.js +6 -6
  54. package/src/DUST/dust-provider-factory.js +11 -11
  55. package/src/DUST/dust-provider.js +255 -255
  56. package/src/DUST/dust-shared-worker-impl.js +100 -100
  57. package/src/DUST/dust-worker-bridge.js +27 -27
  58. package/src/DUST/subscribe-to-dust.js +9 -9
  59. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  60. package/src/FeatureFlags/feature-flag.js +9 -9
  61. package/src/FeatureFlags/feature-flags-provider.js +86 -86
  62. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  63. package/src/FeatureFlags/get-feature-flag.js +2 -2
  64. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  65. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  66. package/src/InAppMessage/constants.js +83 -2
  67. package/src/InAppMessage/display/html-message-display-utils.js +15 -15
  68. package/src/InAppMessage/display/html-message-to-html.js +36 -37
  69. package/src/InAppMessage/display/in-app-message-to-html.js +44 -44
  70. package/src/InAppMessage/display/modal-utils.js +10 -14
  71. package/src/InAppMessage/in-app-message-factory.js +16 -20
  72. package/src/InAppMessage/in-app-message-manager.js +115 -116
  73. package/src/InAppMessage/log-in-app-message-button-click.js +8 -8
  74. package/src/InAppMessage/log-in-app-message-click.js +7 -7
  75. package/src/InAppMessage/log-in-app-message-html-click.js +8 -8
  76. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  77. package/src/InAppMessage/models/control-message.js +4 -4
  78. package/src/InAppMessage/models/full-screen-message.js +56 -49
  79. package/src/InAppMessage/models/html-message.js +31 -27
  80. package/src/InAppMessage/models/in-app-message-button.js +12 -12
  81. package/src/InAppMessage/models/in-app-message.js +202 -256
  82. package/src/InAppMessage/models/modal-message.js +55 -49
  83. package/src/InAppMessage/models/slide-up-message.js +57 -51
  84. package/src/InAppMessage/models/templated-in-app-message.js +10 -10
  85. package/src/InAppMessage/shared-types.js +1 -0
  86. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  87. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  88. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
  89. package/src/InAppMessage/ui/show-in-app-message.js +43 -41
  90. package/src/Push/is-push-blocked.js +2 -2
  91. package/src/Push/is-push-permission-granted.js +2 -2
  92. package/src/Push/is-push-supported.js +2 -2
  93. package/src/Push/push-manager-factory.js +9 -9
  94. package/src/Push/push-manager.js +15 -15
  95. package/src/Push/utils/push-utils.js +15 -15
  96. package/src/User/user-manager.js +14 -14
  97. package/src/User/user.js +60 -59
  98. package/src/common/base-provider.js +1 -1
  99. package/src/common/constants.js +2 -1
  100. package/src/common/content-cards-display.js +38 -38
  101. package/src/common/event-logger.js +8 -8
  102. package/src/l10n/l10n-manager-factory.js +9 -9
  103. package/src/l10n/l10n-manager.js +2 -2
  104. package/src/managers/auth-manager.js +31 -31
  105. package/src/managers/braze-instance.js +197 -186
  106. package/src/managers/constants.js +1 -0
  107. package/src/managers/device-manager.js +25 -25
  108. package/src/managers/network-manager.js +155 -155
  109. package/src/managers/server-config-manager.js +106 -93
  110. package/src/managers/session-manager.js +37 -33
  111. package/src/managers/storage-manager-factory.js +33 -28
  112. package/src/managers/storage-manager.js +192 -170
  113. package/src/managers/subscription-manager.js +13 -13
  114. package/src/managers/utils.js +1 -1
  115. package/src/models/backend-errors.js +5 -5
  116. package/src/models/braze-event.js +13 -13
  117. package/src/models/device.js +3 -3
  118. package/src/models/identifier.js +12 -12
  119. package/src/models/push-token.js +9 -9
  120. package/src/models/request-result.js +4 -4
  121. package/src/models/server-config.js +29 -38
  122. package/src/request-controller.js +160 -164
  123. package/src/triggers/models/custom-event-data.js +7 -7
  124. package/src/triggers/models/custom-event-property-data.js +10 -10
  125. package/src/triggers/models/filter-set.js +12 -12
  126. package/src/triggers/models/filter.js +66 -66
  127. package/src/triggers/models/in-app-message-click-data.js +13 -13
  128. package/src/triggers/models/purchase-data.js +4 -4
  129. package/src/triggers/models/purchase-property-data.js +10 -10
  130. package/src/triggers/models/push-click-data.js +8 -8
  131. package/src/triggers/models/trigger-condition.js +58 -58
  132. package/src/triggers/models/trigger-events.js +3 -3
  133. package/src/triggers/models/trigger.js +44 -44
  134. package/src/triggers/triggers-provider-factory.js +5 -5
  135. package/src/triggers/triggers-provider.js +70 -70
  136. package/src/ui/js/attach-css.js +3 -3
  137. package/src/ui/js/feed-css.js +2 -2
  138. package/src/ui/js/iam-css.js +2 -2
  139. package/src/ui/js/load-font-awesome.js +2 -2
  140. package/src/util/base-device-parser.js +9 -9
  141. package/src/util/braze-actions.js +3 -3
  142. package/src/util/browser-detector.js +37 -37
  143. package/src/util/client-hints-parser.js +9 -9
  144. package/src/util/component-utils.js +3 -3
  145. package/src/util/dom-utils.js +2 -2
  146. package/src/util/html-display-utils.js +11 -11
  147. package/src/util/key-codes.js +1 -1
  148. package/src/util/net.js +8 -8
  149. package/src/util/request-header-utils.js +25 -25
  150. package/src/util/user-agent-parser.js +20 -20
  151. package/src/util/validation-utils.js +21 -21
  152. package/src/util/window-utils.js +3 -3
@@ -1,9 +1,9 @@
1
- import { isArray as R, isEqual as ni } from "../util/code-utils.js";
1
+ import { isArray as g, isEqual as ni } from "../util/code-utils.js";
2
2
  import oi from "../models/push-token.js";
3
3
  import { logger as E, EncodingUtils as ui } from "../../shared-lib/index.js";
4
4
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
5
5
  import { User } from "../User/index.js";
6
- import vt from "./utils/push-utils.js";
6
+ import It from "./utils/push-utils.js";
7
7
  import { getErrorMessage as ai } 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) {
@@ -16,7 +16,7 @@ export default class na {
16
16
  (this.h = u),
17
17
  (this.ou = a),
18
18
  (this.uu = h),
19
- (this.B = c),
19
+ (this.C = c),
20
20
  (this.iu = i),
21
21
  (this.tu = t),
22
22
  (this.eu = e),
@@ -26,9 +26,9 @@ export default class na {
26
26
  (this.h = u),
27
27
  (this.ou = a || !1),
28
28
  (this.uu = h || !1),
29
- (this.B = c),
30
- (this.hu = vt.cu()),
31
- (this.fu = vt.lu());
29
+ (this.C = c),
30
+ (this.hu = It.cu()),
31
+ (this.fu = It.lu());
32
32
  }
33
33
  du() {
34
34
  return this.uu;
@@ -169,7 +169,7 @@ export default class na {
169
169
  this.yu(i, new Date(), e);
170
170
  })
171
171
  .catch((i) => {
172
- vt.isPushBlocked()
172
+ It.isPushBlocked()
173
173
  ? (E.info("Permission for push notifications was denied."),
174
174
  "function" == typeof s && s(!1))
175
175
  : (E.error("Push subscription failed: " + i),
@@ -197,7 +197,7 @@ export default class na {
197
197
  (i.unregister(), E.info("Service worker successfully unregistered."));
198
198
  }
199
199
  subscribe(i, t) {
200
- if (!vt.isPushSupported())
200
+ if (!It.isPushSupported())
201
201
  return E.info(na.Au), void ("function" == typeof t && t(!1));
202
202
  if (this.hu) {
203
203
  if (!this.ou && null != window.location) {
@@ -207,12 +207,12 @@ export default class na {
207
207
  -1 === i.indexOf(window.location.protocol) &&
208
208
  (i = window.location.protocol + "//" + i);
209
209
  }
210
- if (vt.isPushBlocked())
210
+ if (It.isPushBlocked())
211
211
  return void this.ku(
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.h && !this.h.ju() && 0 === this.h.xt())
215
+ if (this.h && !this.h.ju() && 0 === this.h.Ot())
216
216
  return (
217
217
  E.info(
218
218
  "Waiting for VAPID key from server config before subscribing to push.",
@@ -227,13 +227,13 @@ export default class na {
227
227
  },
228
228
  r = () => {
229
229
  let i = "Permission for push notifications was ignored.";
230
- vt.isPushBlocked() &&
230
+ It.isPushBlocked() &&
231
231
  (i +=
232
232
  " The browser has automatically blocked further permission requests for a period (probably 1 week)."),
233
233
  E.info(i),
234
234
  "function" == typeof t && t(!0);
235
235
  },
236
- n = vt.isPushPermissionGranted(),
236
+ n = It.isPushPermissionGranted(),
237
237
  o = () => {
238
238
  !n &&
239
239
  this.iu &&
@@ -264,7 +264,7 @@ export default class na {
264
264
  let n,
265
265
  u = null,
266
266
  a = null;
267
- if ((this.B && (n = this.B.dt(s.ft.Uu)), n && !R(n))) {
267
+ if ((this.C && (n = this.C.Rt(s.Tt.Uu)), n && !g(n))) {
268
268
  let i;
269
269
  try {
270
270
  i = oi._u(n).Wu;
@@ -299,7 +299,7 @@ export default class na {
299
299
  "Push subscription is expired, creating new subscription.",
300
300
  ),
301
301
  this.pu(r, e, o, i, t))
302
- : n && R(n)
302
+ : n && g(n)
303
303
  ? this.pu(r, e, o, i, t)
304
304
  : null == a
305
305
  ? (E.info(
@@ -339,7 +339,7 @@ export default class na {
339
339
  }
340
340
  }
341
341
  unsubscribe(i, t) {
342
- if (!vt.isPushSupported())
342
+ if (!It.isPushSupported())
343
343
  return E.info(na.Au), void ("function" == typeof t && t());
344
344
  this.hu
345
345
  ? navigator.serviceWorker.getRegistration(this.su).then((e) => {
@@ -1,4 +1,4 @@
1
- const vt = {
1
+ const It = {
2
2
  cu: () =>
3
3
  "serviceWorker" in navigator &&
4
4
  "undefined" != typeof ServiceWorkerRegistration &&
@@ -9,38 +9,38 @@ const vt = {
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.cu() || vt.lu(),
12
+ isPushSupported: () => It.cu() || It.lu(),
13
13
  isPushBlocked: () => {
14
14
  const o =
15
- vt.isPushSupported() &&
15
+ It.isPushSupported() &&
16
16
  "Notification" in window &&
17
17
  null != window.Notification &&
18
18
  null != window.Notification.permission &&
19
19
  "denied" === window.Notification.permission,
20
20
  i =
21
- vt.isPushSupported() &&
21
+ It.isPushSupported() &&
22
22
  (!("Notification" in window) || null == window.Notification);
23
23
  return o || i;
24
24
  },
25
25
  isPushPermissionGranted: () =>
26
- vt.isPushSupported() &&
26
+ It.isPushSupported() &&
27
27
  "Notification" in window &&
28
28
  null != window.Notification &&
29
29
  null != window.Notification.permission &&
30
30
  "granted" === window.Notification.permission,
31
- Gn: () =>
32
- vt.isPushBlocked()
33
- ? { Nn: !1, reason: "blocked" }
34
- : vt.isPushSupported()
35
- ? vt.isPushPermissionGranted()
36
- ? { Nn: !1, reason: "permissionGranted" }
37
- : { Nn: !0 }
38
- : { Nn: !1, reason: "unsupported" },
39
- $n: (o, i) =>
31
+ Vn: () =>
32
+ It.isPushBlocked()
33
+ ? { Wn: !1, reason: "blocked" }
34
+ : It.isPushSupported()
35
+ ? It.isPushPermissionGranted()
36
+ ? { Wn: !1, reason: "permissionGranted" }
37
+ : { Wn: !0 }
38
+ : { Wn: !1, reason: "unsupported" },
39
+ Yn: (o, i) =>
40
40
  "blocked" === o
41
41
  ? `${i} containing a push prompt is not being shown because the user has already declined push permission prompt.`
42
42
  : "unsupported" === o
43
43
  ? `${i} containing a push prompt is not being shown because the browser doesn't support push notifications.`
44
44
  : `${i} containing a push prompt is not being shown because the user has already accepted the permission prompt.`,
45
45
  };
46
- export default vt;
46
+ export default It;
@@ -1,27 +1,27 @@
1
1
  import _t from "../models/identifier.js";
2
- import { getByteLength as er } from "../util/string-utils.js";
2
+ import { getByteLength as ir } from "../util/string-utils.js";
3
3
  import oi from "../models/push-token.js";
4
4
  import { logger as E, IndexedDBAdapter as et } 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 Ut {
8
8
  constructor(t, s) {
9
- (this.h = t), (this.B = s), (this.h = t), (this.B = s);
9
+ (this.h = t), (this.C = s), (this.h = t), (this.C = s);
10
10
  }
11
11
  getUserId() {
12
- const t = this.B.$u(s.Ou.Cu);
12
+ const t = this.C.$u(s.Ou.Cu);
13
13
  if (null == t) return null;
14
14
  let i = t.Tu,
15
- e = er(i);
16
- if (e > User.mr) {
17
- for (; e > User.mr; ) (i = i.slice(0, i.length - 1)), (e = er(i));
18
- (t.Tu = i), this.B.Iu(s.Ou.Cu, t);
15
+ e = ir(i);
16
+ if (e > User.br) {
17
+ for (; e > User.br; ) (i = i.slice(0, i.length - 1)), (e = ir(i));
18
+ (t.Tu = i), this.C.Iu(s.Ou.Cu, t);
19
19
  }
20
20
  return i;
21
21
  }
22
22
  Ju(t) {
23
23
  const i = null == this.getUserId();
24
- this.B.Iu(s.Ou.Cu, new _t(t)), i && this.B.Lu(t);
24
+ this.C.Iu(s.Ou.Cu, new _t(t)), i && this.C.Lu(t);
25
25
  }
26
26
  setCustomUserAttribute(t, s) {
27
27
  if (this.h.qu(t))
@@ -32,7 +32,7 @@ export default class bt {
32
32
  return (i[t] = s), this.zu(User.Bu, i, !0);
33
33
  }
34
34
  zu(t, s, i = !1, e = !1) {
35
- const u = this.B.Eu(this.getUserId(), t, s);
35
+ const u = this.C.Eu(this.getUserId(), t, s);
36
36
  let o = "",
37
37
  r = t,
38
38
  h = s;
@@ -52,10 +52,10 @@ export default class bt {
52
52
  this.zu("custom_push_public_key", e, !1, !0),
53
53
  this.zu("custom_push_user_auth", u, !1, !0),
54
54
  this.zu("custom_push_vapid_public_key", o, !1, !0);
55
- const r = et.Us.Rs,
55
+ const r = et.Ps.$s,
56
56
  h = new et(r, E),
57
57
  n = new oi(t, i, e, u, o);
58
- this.B.bt(s.ft.Uu, n.gt()), h.setItem(r.Fs.Fu, r.ge, !0);
58
+ this.C.It(s.Tt.Uu, n.qt()), h.setItem(r.Os.Fu, r.be, !0);
59
59
  }
60
60
  wu(t) {
61
61
  if (
@@ -65,9 +65,9 @@ export default class bt {
65
65
  this.zu("custom_push_vapid_public_key", null, !1, !0),
66
66
  t)
67
67
  ) {
68
- const t = et.Us.Rs,
68
+ const t = et.Ps.$s,
69
69
  i = new et(t, E);
70
- this.B.bt(s.ft.Uu, !1), i.setItem(t.Fs.Fu, t.ge, !1);
70
+ this.C.It(s.Tt.Uu, !1), i.setItem(t.Os.Fu, t.be, !1);
71
71
  }
72
72
  }
73
73
  }
package/src/User/user.js CHANGED
@@ -1,27 +1,27 @@
1
1
  import {
2
- isArray as R,
2
+ isArray as g,
3
3
  isDate as Nt,
4
- isObject as yt,
4
+ isObject as Ct,
5
5
  validateValueIsFromEnum as ta,
6
6
  } from "../util/code-utils.js";
7
- import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
7
+ import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
8
8
  import {
9
- isValidEmail as It,
10
- validateCustomAttributeArrayType as Ct,
11
- validateCustomAttributeKey as St,
9
+ isValidEmail as At,
10
+ validateCustomAttributeArrayType as Dt,
11
+ validateCustomAttributeKey as Ft,
12
12
  validateCustomProperties as nt,
13
13
  validateCustomString as mt,
14
- validatePropertyType as Ut,
15
- validateStandardString as ir,
14
+ validatePropertyType as Lt,
15
+ validateStandardString as tr,
16
16
  } from "../util/validation-utils.js";
17
- import { CoreStrings as z } from "../common/constants.js";
18
- import { toValidBackendTimeString as Dt } from "../util/date-utils.js";
17
+ import { CoreStrings as R } from "../common/constants.js";
18
+ import { toValidBackendTimeString as $t } from "../util/date-utils.js";
19
19
  export default class User {
20
20
  constructor(t, e) {
21
- (this.vs = t), (this.Ru = e), (this.vs = t), (this.Ru = e);
21
+ (this.Ss = t), (this.Ru = e), (this.Ss = t), (this.Ru = e);
22
22
  }
23
23
  getUserId(t) {
24
- const e = this.vs.getUserId();
24
+ const e = this.Ss.getUserId();
25
25
  if ("function" != typeof t) return e;
26
26
  E.warn(
27
27
  "The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)",
@@ -29,26 +29,26 @@ export default class User {
29
29
  t(e);
30
30
  }
31
31
  addAlias(t, e) {
32
- return !ir(t, "add alias", "the alias", !1) || t.length <= 0
32
+ return !tr(t, "add alias", "the alias", !1) || t.length <= 0
33
33
  ? (E.error("addAlias requires a non-empty alias"), !1)
34
- : !ir(e, "add alias", "the label", !1) || e.length <= 0
34
+ : !tr(e, "add alias", "the label", !1) || e.length <= 0
35
35
  ? (E.error("addAlias requires a non-empty label"), !1)
36
- : this.Ru.Gu(t, e).W;
36
+ : this.Ru.Gu(t, e).lt;
37
37
  }
38
38
  setFirstName(t) {
39
39
  return (
40
- !!ir(t, "set first name", "the firstName", !0) &&
41
- this.vs.zu("first_name", t)
40
+ !!tr(t, "set first name", "the firstName", !0) &&
41
+ this.Ss.zu("first_name", t)
42
42
  );
43
43
  }
44
44
  setLastName(t) {
45
45
  return (
46
- !!ir(t, "set last name", "the lastName", !0) && this.vs.zu("last_name", t)
46
+ !!tr(t, "set last name", "the lastName", !0) && this.Ss.zu("last_name", t)
47
47
  );
48
48
  }
49
49
  setEmail(t) {
50
- return null === t || It(t)
51
- ? this.vs.zu("email", t)
50
+ return null === t || At(t)
51
+ ? this.Ss.zu("email", t)
52
52
  : (E.error(
53
53
  `Cannot set email address - "${t}" did not pass RFC-5322 validation.`,
54
54
  ),
@@ -65,12 +65,12 @@ export default class User {
65
65
  `Gender "${t}" is not a valid gender.`,
66
66
  "User.Genders",
67
67
  )
68
- ) && this.vs.zu("gender", t)
68
+ ) && this.Ss.zu("gender", t)
69
69
  );
70
70
  }
71
71
  setDateOfBirth(t, e, r) {
72
72
  return null === t && null === e && null === r
73
- ? this.vs.zu("dob", null)
73
+ ? this.Ss.zu("dob", null)
74
74
  : ((t = null != t ? parseInt(t.toString()) : null),
75
75
  (e = null != e ? parseInt(e.toString()) : null),
76
76
  (r = null != r ? parseInt(r.toString()) : null),
@@ -88,21 +88,21 @@ export default class User {
88
88
  "Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);",
89
89
  ),
90
90
  !1)
91
- : this.vs.zu("dob", `${t}-${e}-${r}`));
91
+ : this.Ss.zu("dob", `${t}-${e}-${r}`));
92
92
  }
93
93
  setCountry(t) {
94
94
  return (
95
- !!ir(t, "set country", "the country", !0) && this.vs.zu("country", t)
95
+ !!tr(t, "set country", "the country", !0) && this.Ss.zu("country", t)
96
96
  );
97
97
  }
98
98
  setHomeCity(t) {
99
99
  return (
100
- !!ir(t, "set home city", "the homeCity", !0) && this.vs.zu("home_city", t)
100
+ !!tr(t, "set home city", "the homeCity", !0) && this.Ss.zu("home_city", t)
101
101
  );
102
102
  }
103
103
  setLanguage(t) {
104
104
  return (
105
- !!ir(t, "set language", "the language", !0) && this.vs.zu("language", t)
105
+ !!tr(t, "set language", "the language", !0) && this.Ss.zu("language", t)
106
106
  );
107
107
  }
108
108
  setEmailNotificationSubscriptionType(t) {
@@ -112,7 +112,7 @@ export default class User {
112
112
  t,
113
113
  `Email notification setting "${t}" is not a valid subscription type.`,
114
114
  "User.NotificationSubscriptionTypes",
115
- ) && this.vs.zu("email_subscribe", t)
115
+ ) && this.Ss.zu("email_subscribe", t)
116
116
  );
117
117
  }
118
118
  setPushNotificationSubscriptionType(t) {
@@ -122,14 +122,14 @@ export default class User {
122
122
  t,
123
123
  `Push notification setting "${t}" is not a valid subscription type.`,
124
124
  "User.NotificationSubscriptionTypes",
125
- ) && this.vs.zu("push_subscribe", t)
125
+ ) && this.Ss.zu("push_subscribe", t)
126
126
  );
127
127
  }
128
128
  setPhoneNumber(t) {
129
129
  return (
130
- !!ir(t, "set phone number", "the phoneNumber", !0) &&
130
+ !!tr(t, "set phone number", "the phoneNumber", !0) &&
131
131
  (null === t || t.match(User.Hu)
132
- ? this.vs.zu("phone", t)
132
+ ? this.Ss.zu("phone", t)
133
133
  : (E.error(`Cannot set phone number - "${t}" did not pass validation.`),
134
134
  !1))
135
135
  );
@@ -164,32 +164,33 @@ export default class User {
164
164
  "Cannot set last-known location - accuracy and altitudeAccuracy may not be negative.",
165
165
  ),
166
166
  !1)
167
- : this.Ru.setLastKnownLocation(this.vs.getUserId(), t, e, s, r, n).W);
167
+ : this.Ru.setLastKnownLocation(this.Ss.getUserId(), t, e, s, r, n)
168
+ .lt);
168
169
  }
169
170
  setCustomUserAttribute(t, e, r) {
170
- if (!St(t)) return !1;
171
+ if (!Ft(t)) return !1;
171
172
  const s = (e) => {
172
173
  const [r] = nt(
173
174
  e,
174
- z.Ku,
175
+ R.Ku,
175
176
  "attribute value",
176
177
  `set custom user attribute "${t}"`,
177
178
  "custom user attribute",
178
179
  );
179
180
  return r;
180
181
  };
181
- if (R(e)) {
182
- const [r, n] = Ct(t, e);
182
+ if (g(e)) {
183
+ const [r, n] = Dt(t, e);
183
184
  if (!r && !n && 0 !== e.length) return !1;
184
- if (r || 0 === e.length) return this.Ru.Mu(f.Yu, t, e).W;
185
+ if (r || 0 === e.length) return this.Ru.Mu(p.Yu, t, e).lt;
185
186
  for (const t of e) if (!s(t)) return !1;
186
- } else if (yt(e)) {
187
+ } else if (Ct(e)) {
187
188
  if (!s(e)) return !1;
188
- if (r) return this.Ru.Mu(f.Vu, t, e).W;
189
+ if (r) return this.Ru.Mu(p.Vu, t, e).lt;
189
190
  } else {
190
- if (!(void 0 !== e && Ut(e))) return !1;
191
+ if (!(void 0 !== e && Lt(e))) return !1;
191
192
  if (
192
- (Nt(e) && (e = Dt(e)),
193
+ (Nt(e) && (e = $t(e)),
193
194
  "string" == typeof e &&
194
195
  !mt(
195
196
  e,
@@ -199,7 +200,7 @@ export default class User {
199
200
  )
200
201
  return !1;
201
202
  }
202
- return this.vs.setCustomUserAttribute(t, e);
203
+ return this.Ss.setCustomUserAttribute(t, e);
203
204
  }
204
205
  addToCustomAttributeArray(t, e) {
205
206
  return (
@@ -208,7 +209,7 @@ export default class User {
208
209
  null != e &&
209
210
  !mt(e, "add to custom user attribute array", "the given value")
210
211
  ) &&
211
- this.Ru.Mu(f.Qu, t, e).W
212
+ this.Ru.Mu(p.Qu, t, e).lt
212
213
  );
213
214
  }
214
215
  removeFromCustomAttributeArray(t, e) {
@@ -218,7 +219,7 @@ export default class User {
218
219
  null != e &&
219
220
  !mt(e, "remove from custom user attribute array", "the given value")
220
221
  ) &&
221
- this.Ru.Mu(f.Xu, t, e).W
222
+ this.Ru.Mu(p.Xu, t, e).lt
222
223
  );
223
224
  }
224
225
  incrementCustomUserAttribute(t, e) {
@@ -230,7 +231,7 @@ export default class User {
230
231
  `Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`,
231
232
  ),
232
233
  !1)
233
- : this.Ru.Mu(f.Zu, t, r).W;
234
+ : this.Ru.Mu(p.Zu, t, r).lt;
234
235
  }
235
236
  setCustomLocationAttribute(t, e, r) {
236
237
  return (
@@ -246,11 +247,11 @@ export default class User {
246
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.",
247
248
  ),
248
249
  !1)
249
- : this.Ru.Ra(t, e, r).W)
250
+ : this.Ru.Na(t, e, r).lt)
250
251
  );
251
252
  }
252
253
  addToSubscriptionGroup(t) {
253
- return !ir(
254
+ return !tr(
254
255
  t,
255
256
  "add user to subscription group",
256
257
  "subscription group ID",
@@ -260,10 +261,10 @@ export default class User {
260
261
  "addToSubscriptionGroup requires a non-empty subscription group ID",
261
262
  ),
262
263
  !1)
263
- : this.Ru.Pa(t, User.Oa.SUBSCRIBED).W;
264
+ : this.Ru.va(t, User.Ia.SUBSCRIBED).lt;
264
265
  }
265
266
  removeFromSubscriptionGroup(t) {
266
- return !ir(
267
+ return !tr(
267
268
  t,
268
269
  "remove user from subscription group",
269
270
  "subscription group ID",
@@ -273,24 +274,24 @@ export default class User {
273
274
  "removeFromSubscriptionGroup requires a non-empty subscription group ID",
274
275
  ),
275
276
  !1)
276
- : this.Ru.Pa(t, User.Oa.UNSUBSCRIBED).W;
277
+ : this.Ru.va(t, User.Ia.UNSUBSCRIBED).lt;
277
278
  }
278
279
  setLineId(t) {
279
- return ir(t, "set LINE user ID", "the ID", !0) &&
280
+ return tr(t, "set LINE user ID", "the ID", !0) &&
280
281
  0 !== (null == t ? void 0 : t.length)
281
- ? t && t.length > User.Ya
282
+ ? t && t.length > User.Ca
282
283
  ? (E.error(
283
- `Rejected LINE user ID ${t} because it is longer than ${User.Ya} characters.`,
284
+ `Rejected LINE user ID ${t} because it is longer than ${User.Ca} characters.`,
284
285
  ),
285
286
  !1)
286
- : this.vs.zu("native_line_id", t)
287
+ : this.Ss.zu("native_line_id", t)
287
288
  : (E.error("setLineId requires a non-empty ID"), !1);
288
289
  }
289
290
  gu(t, e, r, s, n) {
290
- this.vs.gu(t, e, r, s, n), this.Ru.Va();
291
+ this.Ss.gu(t, e, r, s, n), this.Ru.Ea();
291
292
  }
292
293
  wu(t) {
293
- this.vs.wu(t);
294
+ this.Ss.wu(t);
294
295
  }
295
296
  }
296
297
  (User.Genders = {
@@ -307,8 +308,8 @@ export default class User {
307
308
  UNSUBSCRIBED: "unsubscribed",
308
309
  }),
309
310
  (User.Hu = /^[0-9 .\\(\\)\\+\\-]+$/),
310
- (User.Oa = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
311
- (User.Wa = "user_id"),
311
+ (User.Ia = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
312
+ (User.Sa = "user_id"),
312
313
  (User.Bu = "custom"),
313
- (User.mr = 997),
314
- (User.Ya = 33);
314
+ (User.br = 997),
315
+ (User.Ca = 33);
@@ -1,6 +1,6 @@
1
1
  export default class t {
2
2
  constructor() {}
3
- N(a) {}
3
+ I(a) {}
4
4
  changeUser(a = !1) {}
5
5
  clearData(a = !1) {}
6
6
  }
@@ -5,11 +5,12 @@ export const GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT = 30;
5
5
  export const LAST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT = 72e5;
6
6
  export const MAX_RETRY_COUNT_PER_REQUEST = 15;
7
7
  export const REQUEST_ATTEMPT_DEFAULT = 1;
8
+ export const DISMISSALS_CACHE_SIZE_DEFAULT = 200;
8
9
  export const REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT = 1e4;
9
10
  export const REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT = 3;
10
11
  export const REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT = 3e5;
11
12
  export const CoreStrings = {
12
13
  ee: "Braze must be initialized before calling methods.",
13
- $e: "logCustomEvent",
14
+ je: "logCustomEvent",
14
15
  Ku: "setCustomUserAttribute",
15
16
  };