@braze/web-sdk 5.8.1 → 5.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 (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 +19 -19
  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 +86 -85
  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
@@ -1,136 +1,148 @@
1
1
  import { STORAGE_KEYS as s } from "./storage-manager.js";
2
2
  import u from "./subscription-manager.js";
3
- import Jt from "../models/server-config.js";
3
+ import Qt from "../models/server-config.js";
4
4
  import c from "../common/event-logger.js";
5
5
  import { EventTypes as d } from "../../shared-lib/index.js";
6
6
  export default class Mt {
7
7
  constructor(t) {
8
8
  (this.C = t),
9
9
  (this.C = t),
10
- (this.il = new u()),
11
10
  (this.sl = new u()),
12
11
  (this.rl = new u()),
12
+ (this.ul = new u()),
13
13
  (this.al = new u()),
14
14
  (this.hl = null),
15
- (this.ul = null);
15
+ (this.ol = null);
16
16
  }
17
- ol() {
18
- if (null == this.ul) {
19
- const t = this.C.ft(s.gt.cl);
20
- this.ul = null != t ? Jt.En(t) : new Jt();
17
+ cl() {
18
+ if (null == this.ol) {
19
+ const t = this.C.ft(s.gt.ml);
20
+ this.ol = null != t ? Qt.Rn(t) : new Qt();
21
21
  }
22
- return this.ul;
22
+ return this.ol;
23
23
  }
24
24
  Et() {
25
- return this.ol().ml;
25
+ return this.cl().dl;
26
26
  }
27
27
  gl(t) {
28
+ var i, e;
28
29
  if (null != t && null != t.config) {
29
- const e = t.config;
30
- if (e.time > this.ol().ml) {
31
- const t = (t) => (null == t ? this.ol().bl : t),
32
- i = new Jt(
33
- e.time,
34
- e.events_blacklist,
35
- e.attributes_blacklist,
36
- e.purchases_blacklist,
37
- e.messaging_session_timeout,
38
- e.vapid_public_key,
39
- e.content_cards,
40
- e.feature_flags,
41
- t(e.global_request_rate_limit),
42
- e.banners,
30
+ const n = t.config;
31
+ if (n.time > this.cl().dl) {
32
+ const t = (t) => (null == t ? this.cl().bl : t),
33
+ r = new Qt(
34
+ n.time,
35
+ n.events_blacklist,
36
+ n.attributes_blacklist,
37
+ n.purchases_blacklist,
38
+ n.messaging_session_timeout,
39
+ n.vapid_public_key,
40
+ n.content_cards,
41
+ n.feature_flags,
42
+ t(n.global_request_rate_limit),
43
+ n.banners,
43
44
  );
44
- let n = !1;
45
- null != i.fl && this.Tn() !== i.fl && (n = !0);
46
- let r = !1;
47
- null != i.dl.enabled && this.Ri() !== i.dl.enabled && (r = !0);
48
45
  let l = !1;
49
- null != i.De.enabled && this.Be() !== i.De.enabled && (l = !0);
46
+ null != r.fl && this.In() !== r.fl && (l = !0);
47
+ let u = !1;
48
+ null != r.vl.enabled && this.yi() !== r.vl.enabled && (u = !0);
50
49
  let a = !1;
51
- null != i.banners.enabled &&
52
- this.Dt() !== i.banners.enabled &&
53
- (a = !0),
54
- (this.ul = i),
55
- this.C.Bt(s.gt.cl, i.bt()),
56
- n && this.il.X(),
57
- r && this.sl.X(),
58
- l && this.rl.X(),
59
- a && this.al.X();
50
+ null != r.De.enabled && this.ke() !== r.De.enabled && (a = !0);
51
+ let h = !1;
52
+ null !=
53
+ (null === (i = r.banners) || void 0 === i ? void 0 : i.enabled) &&
54
+ this.zt() !==
55
+ (null === (e = r.banners) || void 0 === e ? void 0 : e.enabled) &&
56
+ (h = !0),
57
+ (this.ol = r),
58
+ this.C.Bt(s.gt.ml, r.bt()),
59
+ l && this.sl.X(),
60
+ u && this.rl.X(),
61
+ a && this.ul.X(),
62
+ h && this.al.X();
60
63
  }
61
64
  }
62
65
  }
63
- In(t) {
64
- const e = this.il.Ft(t);
65
- return this.hl && this.il.removeSubscription(this.hl), (this.hl = e), e;
66
+ Vn(t) {
67
+ const i = this.sl.Dt(t);
68
+ return this.hl && this.sl.removeSubscription(this.hl), (this.hl = i), i;
66
69
  }
67
- ji(t) {
68
- return this.sl.Ft(t);
70
+ gi(t) {
71
+ return this.rl.Dt(t);
69
72
  }
70
73
  Ke(t) {
71
- return this.rl.Ft(t);
74
+ return this.ul.Dt(t);
72
75
  }
73
76
  A(t) {
74
- return this.al.Ft(t);
77
+ return this.al.Dt(t);
75
78
  }
76
79
  je(t) {
77
- return -1 !== this.ol().Rl.indexOf(t);
80
+ return -1 !== this.cl().Rl.indexOf(t);
78
81
  }
79
82
  hu(t) {
80
- return -1 !== this.ol().Cl.indexOf(t);
83
+ return -1 !== this.cl().Cl.indexOf(t);
81
84
  }
82
85
  Dr(t) {
83
- return -1 !== this.ol().El.indexOf(t);
86
+ return -1 !== this.cl().El.indexOf(t);
84
87
  }
85
- vl() {
86
- return this.ol().wl;
88
+ wl() {
89
+ return this.cl().yl;
87
90
  }
88
- Tn() {
89
- return this.ol().fl;
91
+ In() {
92
+ return this.cl().fl;
90
93
  }
91
- Ri() {
92
- return this.ol().dl.enabled || !1;
94
+ yi() {
95
+ return this.cl().vl.enabled || !1;
93
96
  }
94
- yl() {
95
- const t = this.ol().bl;
97
+ Ll() {
98
+ const t = this.cl().bl;
96
99
  return !(!t || null == t.enabled) && t.enabled;
97
100
  }
98
- Vu() {
99
- if (!this.yl()) return -1;
100
- const t = this.ol().bl;
101
+ Zu() {
102
+ if (!this.Ll()) return -1;
103
+ const t = this.cl().bl;
101
104
  return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
102
105
  }
103
- Zu() {
104
- if (!this.yl()) return -1;
105
- const t = this.ol().bl;
106
+ tl() {
107
+ if (!this.Ll()) return -1;
108
+ const t = this.cl().bl;
106
109
  return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
107
110
  }
108
- Ll(t) {
109
- const e = this.ol().bl.endpoint_overrides;
110
- return null == e ? null : e[t];
111
- }
112
- tl(t) {
113
- const e = this.Ll(t);
114
- return null == e || isNaN(e.capacity) || e.capacity <= 0 ? -1 : e.capacity;
111
+ Bl(t) {
112
+ const i = this.cl().bl.endpoint_overrides;
113
+ return null == i ? null : i[t];
115
114
  }
116
115
  el(t) {
117
- const e = this.Ll(t);
118
- return null == e || isNaN(e.refill_rate) || e.refill_rate <= 0
116
+ const i = this.Bl(t);
117
+ return null == i || isNaN(i.capacity) || i.capacity <= 0 ? -1 : i.capacity;
118
+ }
119
+ il(t) {
120
+ const i = this.Bl(t);
121
+ return null == i || isNaN(i.refill_rate) || i.refill_rate <= 0
119
122
  ? -1
120
- : e.refill_rate;
123
+ : i.refill_rate;
121
124
  }
122
- Be() {
123
- return this.ol().De.enabled && null == this.Oe()
124
- ? (c.ut(d.bu, { e: "Missing feature flag refresh_rate_limit." }), !1)
125
- : this.ol().De.enabled || !1;
125
+ ke() {
126
+ return this.cl().De.enabled && null == this.Oe()
127
+ ? (c.ut(d.qu, { e: "Missing feature flag refresh_rate_limit." }), !1)
128
+ : this.cl().De.enabled || !1;
126
129
  }
127
130
  Oe() {
128
- return this.ol().De.refresh_rate_limit;
131
+ return this.cl().De.refresh_rate_limit;
129
132
  }
130
- Dt() {
131
- return this.ol().banners.enabled || !1;
133
+ zt() {
134
+ var t;
135
+ return (
136
+ (null === (t = this.cl().banners) || void 0 === t ? void 0 : t.enabled) ||
137
+ null
138
+ );
132
139
  }
133
140
  ne() {
134
- return this.ol().banners.max_placements || 0;
141
+ var t;
142
+ return (
143
+ (null === (t = this.cl().banners) || void 0 === t
144
+ ? void 0
145
+ : t.max_placements) || 0
146
+ );
135
147
  }
136
148
  }
@@ -1,10 +1,10 @@
1
1
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
2
2
  import ve from "../models/braze-event.js";
3
3
  import _t from "../models/identifier.js";
4
- import { convertMsToSeconds as L } from "../util/date-utils.js";
4
+ import { convertMsToSeconds as O } from "../util/date-utils.js";
5
5
  import {
6
6
  logger as N,
7
- Guid as G,
7
+ Guid as K,
8
8
  EventTypes as d,
9
9
  } from "../../shared-lib/index.js";
10
10
  export default class Wt {
@@ -30,7 +30,7 @@ export default class Wt {
30
30
  (this.Sl = e);
31
31
  }
32
32
  xl(s, t) {
33
- return new ve(this.Cs.getUserId(), d.Dl, s, t.eu, { d: L(s - t.Gl) });
33
+ return new ve(this.Cs.getUserId(), d.Dl, s, t.eu, { d: O(s - t.Gl) });
34
34
  }
35
35
  St() {
36
36
  const t = this.C.tu(s.iu.Nl);
@@ -38,7 +38,7 @@ export default class Wt {
38
38
  }
39
39
  zl() {
40
40
  const t = new Date().valueOf(),
41
- i = this.B.vl();
41
+ i = this.B.wl();
42
42
  if (null == i) return !1;
43
43
  const e = this.C.ft(s.gt.Hl),
44
44
  n = null == e || t - e > 1e3 * i;
@@ -60,16 +60,16 @@ export default class Wt {
60
60
  (n += " (old session ended " + s + ")");
61
61
  }
62
62
  (n += ". Will expire " + i.valueOf()), N.info(n);
63
- const o = new _t(G.ce(), i);
64
- this.C.Al(new ve(this.Cs.getUserId(), d.Bl, t, o.eu)),
63
+ const o = new _t(K.ce(), i);
64
+ this.C.Al(new ve(this.Cs.getUserId(), d.Fl, t, o.eu)),
65
65
  this.C.uu(s.iu.Nl, o);
66
66
  return null == this.C.ft(s.gt.Hl) && this.C.Bt(s.gt.Hl, t), o.eu;
67
67
  }
68
68
  if (null != e) return (e.ql = t), (e.kl = i), this.C.uu(s.iu.Nl, e), e.eu;
69
69
  }
70
- Fl() {
70
+ Il() {
71
71
  const t = this.C.tu(s.iu.Nl);
72
72
  null != t &&
73
- (this.C.Il(s.iu.Nl), this.C.Al(this.xl(new Date().valueOf(), t)));
73
+ (this.C.Jl(s.iu.Nl), this.C.Al(this.xl(new Date().valueOf(), t)));
74
74
  }
75
75
  }
@@ -1,7 +1,7 @@
1
1
  import ne, { STORAGE_KEYS as s } from "./storage-manager.js";
2
2
  import { logger as N } from "../../shared-lib/index.js";
3
3
  const Bt = {
4
- Ja: function (e, o = !1) {
4
+ Ya: function (e, o = !1) {
5
5
  let t = !1;
6
6
  try {
7
7
  if (localStorage && localStorage.getItem)
@@ -24,12 +24,12 @@ const Bt = {
24
24
  } catch (e) {
25
25
  N.info("Local Storage not supported!");
26
26
  }
27
- const r = Bt.nc(),
28
- a = new ne.cc(e, r && !o, t);
27
+ const r = Bt.cc(),
28
+ a = new ne.lc(e, r && !o, t);
29
29
  let n;
30
- return (n = t ? new ne.lc(e) : new ne.gc()), new ne(a, n);
30
+ return (n = t ? new ne.gc(e) : new ne.uc()), new ne(a, n);
31
31
  },
32
- nc: function () {
32
+ cc: function () {
33
33
  return (
34
34
  navigator.cookieEnabled ||
35
35
  ("cookie" in document &&
@@ -2,7 +2,7 @@ import ve from "../models/braze-event.js";
2
2
  import _t from "../models/identifier.js";
3
3
  import {
4
4
  isArray as z,
5
- keys as y,
5
+ keys as C,
6
6
  validateValueIsFromEnum as ta,
7
7
  values as Rt,
8
8
  } from "../util/code-utils.js";
@@ -13,7 +13,7 @@ import { getErrorMessage as si } from "../util/error-utils.js";
13
13
  export const STORAGE_KEYS = {
14
14
  iu: {
15
15
  su: "ab.storage.userId",
16
- Ia: "ab.storage.deviceId",
16
+ Na: "ab.storage.deviceId",
17
17
  Nl: "ab.storage.sessionId",
18
18
  },
19
19
  gt: {
@@ -21,42 +21,42 @@ export const STORAGE_KEYS = {
21
21
  tE: "ab.storage.events",
22
22
  eE: "ab.storage.attributes",
23
23
  sE: "ab.storage.attributes.anonymous_user",
24
- ic: "ab.storage.device",
25
- vu: "ab.storage.sdk_metadata",
26
- pu: "ab.storage.session_id_for_cached_metadata",
27
- qn: "ab.storage.pushToken",
24
+ oc: "ab.storage.device",
25
+ pu: "ab.storage.sdk_metadata",
26
+ Ru: "ab.storage.session_id_for_cached_metadata",
27
+ zn: "ab.storage.pushToken",
28
28
  qi: "ab.storage.newsFeed",
29
29
  zi: "ab.storage.lastNewsFeedRefresh",
30
30
  Zt: "ab.storage.cardImpressions",
31
- cl: "ab.storage.serverConfig",
31
+ ml: "ab.storage.serverConfig",
32
32
  rE: "ab.storage.triggers",
33
33
  oE: "ab.storage.triggers.ts",
34
34
  Hl: "ab.storage.messagingSessionStart",
35
- Is: "ab.storage.cc",
36
- Qs: "ab.storage.ccLastFullSync",
37
- Vs: "ab.storage.ccLastCardUpdated",
38
- xu: "ab.storage.globalRateLimitCurrentTokenCount",
39
- Gu: "ab.storage.dynamicRateLimitCurrentTokenCount",
35
+ Hs: "ab.storage.cc",
36
+ Os: "ab.storage.ccLastFullSync",
37
+ Qs: "ab.storage.ccLastCardUpdated",
38
+ Hu: "ab.storage.globalRateLimitCurrentTokenCount",
39
+ _u: "ab.storage.dynamicRateLimitCurrentTokenCount",
40
40
  Kt: "ab.storage.ccClicks",
41
41
  Yt: "ab.storage.ccImpressions",
42
42
  Vt: "ab.storage.ccDismissals",
43
43
  nE: "ab.storage.lastDisplayedTriggerTimesById",
44
44
  aE: "ab.storage.lastDisplayedTriggerTime",
45
45
  iE: "ab.storage.triggerFireInstancesById",
46
- xh: "ab.storage.signature",
46
+ qh: "ab.storage.signature",
47
47
  EE: "ab.storage.brazeSyncRetryCount",
48
- fi: "ab.storage.sdkVersion",
48
+ Zs: "ab.storage.sdkVersion",
49
49
  Xe: "ab.storage.ff",
50
50
  Ge: "ab.storage.ffImpressions",
51
51
  Ze: "ab.storage.ffLastRefreshAt",
52
52
  Ve: "ab.storage.ff.sessionId",
53
53
  lE: "ab.storage.lastReqToEndpoint",
54
54
  SE: "ab.storage.requestAttempts",
55
- Lr: "ab.storage.deferredIam",
56
- Eu: "ab.storage.lastSdkReq",
55
+ Kr: "ab.storage.deferredIam",
56
+ Ku: "ab.storage.lastSdkReq",
57
57
  _E: "ab.storage.alias",
58
58
  vt: "ab.storage.banners",
59
- kt: "ab.storage.banners.impressions",
59
+ Nt: "ab.storage.banners.impressions",
60
60
  yt: "ab.storage.banners.sessionId",
61
61
  },
62
62
  me: "ab.optOut",
@@ -65,8 +65,8 @@ export default class ne {
65
65
  constructor(t, e) {
66
66
  (this.uE = t), (this.cE = e), (this.uE = t), (this.cE = e);
67
67
  }
68
- Ya(t) {
69
- const e = y(STORAGE_KEYS.iu),
68
+ Ha(t) {
69
+ const e = C(STORAGE_KEYS.iu),
70
70
  s = new ne.se(t);
71
71
  for (const t of e) s.remove(STORAGE_KEYS.iu[t]);
72
72
  }
@@ -90,18 +90,18 @@ export default class ne {
90
90
  return e;
91
91
  })(e);
92
92
  let r;
93
- if (s) (r = _t.En(s) || null), r && this.uu(t, r);
93
+ if (s) (r = _t.Rn(s) || null), r && this.uu(t, r);
94
94
  else {
95
95
  const s = _t.hE(e);
96
- (r = _t.En(s) || null), s !== e && r && this.uu(t, r);
96
+ (r = _t.Rn(s) || null), s !== e && r && this.uu(t, r);
97
97
  }
98
98
  return r;
99
99
  }
100
- Il(t) {
100
+ Jl(t) {
101
101
  this.uE.remove(t);
102
102
  }
103
- Ha() {
104
- const t = y(STORAGE_KEYS.iu);
103
+ Xa() {
104
+ const t = C(STORAGE_KEYS.iu);
105
105
  let e;
106
106
  for (const s of t)
107
107
  (e = this.tu(STORAGE_KEYS.iu[s])),
@@ -127,7 +127,7 @@ export default class ne {
127
127
  r = null;
128
128
  if (z(t))
129
129
  for (let s = 0; s < t.length; s++)
130
- ve.RE(t[s]) ? e.push(ve.En(t[s])) : (r = s);
130
+ ve.RE(t[s]) ? e.push(ve.Rn(t[s])) : (r = s);
131
131
  else s = !0;
132
132
  if (s || null != r) {
133
133
  let o = "Stored events could not be deserialized as Events";
@@ -140,7 +140,7 @@ export default class ne {
140
140
  typeof t +
141
141
  ": " +
142
142
  JSON.stringify(t)),
143
- e.push(new ve(null, d.bu, new Date().valueOf(), null, { e: o }));
143
+ e.push(new ve(null, d.qu, new Date().valueOf(), null, { e: o }));
144
144
  }
145
145
  return e;
146
146
  }
@@ -175,8 +175,8 @@ export default class ne {
175
175
  );
176
176
  }
177
177
  clearData() {
178
- const t = y(STORAGE_KEYS.iu),
179
- e = y(STORAGE_KEYS.gt);
178
+ const t = C(STORAGE_KEYS.iu),
179
+ e = C(STORAGE_KEYS.gt);
180
180
  for (let e = 0; e < t.length; e++) {
181
181
  const s = t[e];
182
182
  this.uE.remove(STORAGE_KEYS.iu[s]);
@@ -189,15 +189,15 @@ export default class ne {
189
189
  gE(t) {
190
190
  return t || STORAGE_KEYS.gt.sE;
191
191
  }
192
- wu(t) {
192
+ Cu(t) {
193
193
  let e = this.cE.gr(STORAGE_KEYS.gt.eE);
194
194
  null == e && (e = {});
195
- const s = this.gE(t[User.Qn]),
195
+ const s = this.gE(t[User.Xn]),
196
196
  r = e[s];
197
197
  for (const o in t)
198
- o !== User.Qn &&
198
+ o !== User.Xn &&
199
199
  (null == e[s] || (r && null == r[o])) &&
200
- this.mu(t[User.Qn], o, t[o]);
200
+ this.mu(t[User.Xn], o, t[o]);
201
201
  }
202
202
  mu(t, e, s) {
203
203
  let r = this.cE.gr(STORAGE_KEYS.gt.eE);
@@ -205,7 +205,7 @@ export default class ne {
205
205
  const o = this.gE(t);
206
206
  let n = r[o];
207
207
  if (
208
- (null == n && ((n = {}), null != t && (n[User.Qn] = t)), e === User.lu)
208
+ (null == n && ((n = {}), null != t && (n[User.Xn] = t)), e === User.lu)
209
209
  ) {
210
210
  null == n[e] && (n[e] = {});
211
211
  for (const t in s) n[e][t] = s[t];
@@ -227,8 +227,8 @@ export default class ne {
227
227
  null != r &&
228
228
  ((e[s] = void 0),
229
229
  this.cE.store(STORAGE_KEYS.gt.eE, e),
230
- (r[User.Qn] = t),
231
- this.wu(r));
230
+ (r[User.Xn] = t),
231
+ this.Cu(r));
232
232
  }
233
233
  const s = this.tu(STORAGE_KEYS.iu.Nl);
234
234
  let r = null;
@@ -244,12 +244,12 @@ export default class ne {
244
244
  return this.cE.dE;
245
245
  }
246
246
  }
247
- (ne.lc = class {
247
+ (ne.gc = class {
248
248
  constructor(t) {
249
- (this.un = t), (this.un = t), (this.dE = ro.fE() ? 3 : 10);
249
+ (this.an = t), (this.an = t), (this.dE = ro.fE() ? 3 : 10);
250
250
  }
251
251
  bE(t) {
252
- return t + "." + this.un;
252
+ return t + "." + this.an;
253
253
  }
254
254
  store(t, e) {
255
255
  const s = { v: e };
@@ -276,7 +276,7 @@ export default class ne {
276
276
  }
277
277
  }
278
278
  }),
279
- (ne.gc = class {
279
+ (ne.uc = class {
280
280
  constructor() {
281
281
  (this.KE = {}), (this.mE = 5242880), (this.dE = 3);
282
282
  }
@@ -320,15 +320,15 @@ export default class ne {
320
320
  }),
321
321
  (ne.se = class {
322
322
  constructor(t, e) {
323
- (this.un = t),
323
+ (this.an = t),
324
324
  (this.NE = e),
325
- (this.un = t),
325
+ (this.an = t),
326
326
  (this.GE = this.DE()),
327
327
  (this.CE = 576e3),
328
328
  (this.NE = !!e);
329
329
  }
330
330
  bE(t) {
331
- return null != this.un ? t + "." + this.un : t;
331
+ return null != this.an ? t + "." + this.an : t;
332
332
  }
333
333
  DE() {
334
334
  let t = 0,
@@ -363,7 +363,7 @@ export default class ne {
363
363
  }
364
364
  if (o) {
365
365
  const t = r.split("=")[0];
366
- -1 === t.indexOf("." + this.un) && this.pE(t);
366
+ -1 === t.indexOf("." + this.an) && this.pE(t);
367
367
  }
368
368
  }
369
369
  }
@@ -419,13 +419,13 @@ export default class ne {
419
419
  (document.cookie = s), (document.cookie = s + ";path=/");
420
420
  }
421
421
  }),
422
- (ne.cc = class {
422
+ (ne.lc = class {
423
423
  constructor(t, e, s) {
424
- (this.un = t),
424
+ (this.an = t),
425
425
  (this.vE = []),
426
426
  e && this.vE.push(new ne.se(t)),
427
- s && this.vE.push(new ne.lc(t)),
428
- this.vE.push(new ne.gc());
427
+ s && this.vE.push(new ne.gc(t)),
428
+ this.vE.push(new ne.uc());
429
429
  }
430
430
  store(t, e) {
431
431
  let s = !0;
@@ -440,7 +440,7 @@ export default class ne {
440
440
  return null;
441
441
  }
442
442
  remove(t) {
443
- new ne.se(this.un).remove(t);
443
+ new ne.se(this.an).remove(t);
444
444
  for (let e = 0; e < this.vE.length; e++) this.vE[e].remove(t);
445
445
  }
446
446
  });
@@ -1,11 +1,11 @@
1
- import { Guid as G } from "../../shared-lib/index.js";
1
+ import { Guid as K } from "../../shared-lib/index.js";
2
2
  export default class u {
3
3
  constructor() {
4
4
  this.Mi = {};
5
5
  }
6
- Ft(t) {
6
+ Dt(t) {
7
7
  if ("function" != typeof t) return null;
8
- const i = G.ce();
8
+ const i = K.ce();
9
9
  return (this.Mi[i] = t), i;
10
10
  }
11
11
  removeSubscription(t) {
@@ -14,7 +14,7 @@ export default class u {
14
14
  removeAllSubscriptions() {
15
15
  this.Mi = {};
16
16
  }
17
- uc() {
17
+ hc() {
18
18
  return Object.keys(this.Mi).length;
19
19
  }
20
20
  X(t) {
@@ -1,8 +1,8 @@
1
1
  export default {
2
- Au: "invalid_api_key",
3
- Du: "blacklisted",
2
+ Du: "invalid_api_key",
3
+ Tu: "blacklisted",
4
4
  ku: "no_device_identifier",
5
- qu: "invalid_json_response",
6
- gu: "empty_response",
5
+ Au: "invalid_json_response",
6
+ bu: "empty_response",
7
7
  __: "sdk_auth_error",
8
8
  };
@@ -1,9 +1,9 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { getAlias as Ht } from "../managers/utils.js";
2
+ import { getAlias as Yt } from "../managers/utils.js";
3
3
  import { isObject as yt } from "../util/code-utils.js";
4
4
  import {
5
- convertMsToSeconds as L,
6
- timestampOrNow as Qt,
5
+ convertMsToSeconds as O,
6
+ timestampOrNow as Zt,
7
7
  } from "../util/date-utils.js";
8
8
  export default class ve {
9
9
  constructor(t, s, i, r, e) {
@@ -14,22 +14,22 @@ export default class ve {
14
14
  (this.data = e),
15
15
  (this.userId = t),
16
16
  (this.type = s),
17
- (this.time = Qt(i)),
17
+ (this.time = Zt(i)),
18
18
  (this.sessionId = r),
19
19
  (this.data = e);
20
20
  }
21
- $r() {
21
+ Nr() {
22
22
  var t;
23
23
  const s = {
24
24
  name: this.type,
25
- time: L(this.time),
25
+ time: O(this.time),
26
26
  data: this.data || {},
27
27
  session_id: this.sessionId,
28
28
  };
29
29
  null != this.userId && (s.user_id = this.userId);
30
- const i = (null === (t = r.Sr()) || void 0 === t ? void 0 : t.wh()) || !1;
30
+ const i = (null === (t = r.Sr()) || void 0 === t ? void 0 : t.jh()) || !1;
31
31
  if (!s.user_id && !i) {
32
- const t = Ht(r.j());
32
+ const t = Yt(r.j());
33
33
  t && (s.alias = t);
34
34
  }
35
35
  return s;
@@ -49,7 +49,7 @@ export default class ve {
49
49
  static RE(t) {
50
50
  return null != t && yt(t) && null != t.t && "" !== t.t;
51
51
  }
52
- static En(t) {
52
+ static Rn(t) {
53
53
  return new ve(t.u, t.t, t.ts, t.s, t.d);
54
54
  }
55
55
  }
@@ -2,11 +2,11 @@ export default class Gt {
2
2
  constructor(s) {
3
3
  (this.id = s), (this.id = s);
4
4
  }
5
- $r() {
5
+ Nr() {
6
6
  const s = {};
7
7
  return (
8
8
  null != this.browser && (s.browser = this.browser),
9
- null != this.Za && (s.browser_version = this.Za),
9
+ null != this.tc && (s.browser_version = this.tc),
10
10
  null != this.os && (s.os_version = this.os),
11
11
  null != this.resolution && (s.resolution = this.resolution),
12
12
  null != this.language && (s.locale = this.language),