@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
@@ -2,76 +2,76 @@ import l from "../util/net.js";
2
2
  import t from "../common/base-provider.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import ContentCards from "./content-cards.js";
5
- import { dateFromUnixTimestamp as V } from "../util/date-utils.js";
5
+ import { dateFromUnixTimestamp as Y } from "../util/date-utils.js";
6
6
  import { isURIJavascriptOrData as tt } from "../util/url-utils.js";
7
7
  import {
8
8
  newCardFromContentCardsJson as st,
9
9
  newCardFromSerializedValue as it,
10
10
  } from "../Card/util/card-factory.js";
11
11
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
12
- import m from "../managers/subscription-manager.js";
12
+ import f from "../managers/subscription-manager.js";
13
13
  import h from "../util/request-header-utils.js";
14
14
  import { randomInclusive as a } from "../util/math.js";
15
15
  import {
16
- REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT as u,
17
- REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT as c,
18
- REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT as d,
16
+ REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT as c,
17
+ REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT as d,
18
+ REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT as m,
19
19
  } from "../common/constants.js";
20
20
  import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
21
- export default class Z extends t {
21
+ export default class rr extends t {
22
22
  constructor(t, s, i, e, h) {
23
23
  super(),
24
- (this.vs = t),
25
- (this.B = s),
24
+ (this.Ss = t),
25
+ (this.C = s),
26
26
  (this.h = i),
27
- (this.Cs = e),
28
- (this.j = h),
29
- (this.vs = t),
30
- (this.B = s),
27
+ (this.Ts = e),
28
+ (this.B = h),
29
+ (this.Ss = t),
30
+ (this.C = s),
31
31
  (this.h = i),
32
- (this.Cs = e),
33
- (this.j = h),
34
- (this.ws = new m()),
35
- r.q(this.ws),
36
- (this.ys = 0),
37
- (this.Ss = 0),
32
+ (this.Ts = e),
33
+ (this.B = h),
34
+ (this.Rs = new f()),
35
+ r.S(this.Rs),
36
+ (this.Us = 0),
37
+ (this.Ns = 0),
38
38
  (this.cards = []),
39
- this.Ts();
40
- const n = et.Us.Rs;
41
- new et(n, E).Ds(n.Fs.As, (t) => {
42
- this.Ls(t);
39
+ this.Ms();
40
+ const n = et.Ps.$s;
41
+ new et(n, E).Xs(n.Os._s, (t) => {
42
+ this.Qs(t);
43
43
  }),
44
- (this.Ns = null),
45
- (this.D = null),
46
- (this.Js = null),
47
- (this.Ms = null),
48
- (this.$s = 10);
44
+ (this.Vs = null),
45
+ (this.T = null),
46
+ (this.Ws = null),
47
+ (this.Ys = null),
48
+ (this.Zs = 10);
49
49
  }
50
- Bs() {
51
- return this.Ns;
50
+ fi() {
51
+ return this.Vs;
52
52
  }
53
- Es(t) {
54
- this.Ns = t;
53
+ vi(t) {
54
+ this.Vs = t;
55
55
  }
56
- St() {
57
- return this.D;
56
+ Lt() {
57
+ return this.T;
58
58
  }
59
- wt(t) {
60
- this.D = t;
59
+ $t(t) {
60
+ this.T = t;
61
61
  }
62
- Ts() {
63
- if (!this.B) return;
64
- const t = this.B.dt(s.ft.Ps) || [],
62
+ Ms() {
63
+ if (!this.C) return;
64
+ const t = this.C.Rt(s.Tt.Ci) || [],
65
65
  i = [];
66
66
  for (let s = 0; s < t.length; s++) {
67
67
  const e = it(t[s]);
68
68
  null != e && i.push(e);
69
69
  }
70
- (this.cards = this.Xs(this._s(i, !1))),
71
- (this.ys = this.B.dt(s.ft.Gs) || this.ys),
72
- (this.Ss = this.B.dt(s.ft.Hs) || this.Ss);
70
+ (this.cards = this.bi(this.wi(i, !1))),
71
+ (this.Us = this.C.Rt(s.Tt.gi) || this.Us),
72
+ (this.Ns = this.C.Rt(s.Tt.ji) || this.Ns);
73
73
  }
74
- Is(t, i = !1, e = 0, h = 0) {
74
+ yi(t, i = !1, e = 0, h = 0) {
75
75
  let r;
76
76
  if (i) {
77
77
  r = [];
@@ -100,31 +100,31 @@ export default class Z extends t {
100
100
  }
101
101
  }
102
102
  }
103
- (this.cards = this.Xs(this._s(r, i))),
104
- this.Ks(),
105
- (this.ys = e),
106
- (this.Ss = h),
107
- this.B && (this.B.bt(s.ft.Gs, this.ys), this.B.bt(s.ft.Hs, this.Ss));
103
+ (this.cards = this.bi(this.wi(r, i))),
104
+ this.Ri(),
105
+ (this.Us = e),
106
+ (this.Ns = h),
107
+ this.C && (this.C.It(s.Tt.gi, this.Us), this.C.It(s.Tt.ji, this.Ns));
108
108
  }
109
- N(t) {
110
- if (this.Os() && null != t && t.cards) {
111
- this.B && this.B.bt(s.ft.Qs, r.Vs());
109
+ I(t) {
110
+ if (this.Ui() && null != t && t.cards) {
111
+ this.C && this.C.It(s.Tt.ki, r.zi());
112
112
  const i = t.full_sync;
113
- i || this.Ts(),
114
- this.Is(t.cards, i, t.last_full_sync_at, t.last_card_updated_at),
115
- this.ws.L(this.Ws(!0));
113
+ i || this.Ms(),
114
+ this.yi(t.cards, i, t.last_full_sync_at, t.last_card_updated_at),
115
+ this.Rs.A(this.qi(!0));
116
116
  }
117
117
  }
118
- Ys(t) {
119
- this.Zs(), (this.Js = t);
118
+ xi(t) {
119
+ this.Fi(), (this.Ws = t);
120
120
  }
121
- Ls(t) {
121
+ Qs(t) {
122
122
  var s;
123
- if (!this.Os()) return;
124
- this.Ts();
123
+ if (!this.Ui()) return;
124
+ this.Ms();
125
125
  const i = this.cards.slice();
126
126
  let e = null;
127
- e = null === (s = this.vs) || void 0 === s ? void 0 : s.getUserId();
127
+ e = null === (s = this.Ss) || void 0 === s ? void 0 : s.getUserId();
128
128
  for (let s = 0; s < t.length; s++)
129
129
  if (e === t[s].userId || (null == e && null == t[s].userId)) {
130
130
  const e = t[s].card;
@@ -146,16 +146,16 @@ export default class Z extends t {
146
146
  }
147
147
  }
148
148
  }
149
- (this.cards = this.Xs(this._s(i, !1))), this.Ks(), this.ws.L(this.Ws(!0));
149
+ (this.cards = this.bi(this.wi(i, !1))), this.Ri(), this.Rs.A(this.qi(!0));
150
150
  }
151
- _s(t, i) {
151
+ wi(t, i) {
152
152
  let e = {},
153
153
  h = {},
154
154
  r = {};
155
- this.B &&
156
- ((e = this.B.dt(s.ft.Jt) || {}),
157
- (h = this.B.dt(s.ft.Vt) || {}),
158
- (r = this.B.dt(s.ft.Pt) || {}));
155
+ this.C &&
156
+ ((e = this.C.Rt(s.Tt.ns) || {}),
157
+ (h = this.C.Rt(s.Tt.hs) || {}),
158
+ (r = this.C.Rt(s.Tt.us) || {}));
159
159
  const n = {},
160
160
  o = {},
161
161
  l = {};
@@ -168,20 +168,20 @@ export default class Z extends t {
168
168
  }
169
169
  return (
170
170
  i &&
171
- this.B &&
172
- (this.B.bt(s.ft.Jt, n), this.B.bt(s.ft.Vt, o), this.B.bt(s.ft.Pt, l)),
171
+ this.C &&
172
+ (this.C.It(s.Tt.ns, n), this.C.It(s.Tt.hs, o), this.C.It(s.Tt.us, l)),
173
173
  t
174
174
  );
175
175
  }
176
- Xs(t) {
176
+ bi(t) {
177
177
  const i = [],
178
178
  e = new Date();
179
179
  let h = {};
180
- this.B && (h = this.B.dt(s.ft.Pt) || {});
180
+ this.C && (h = this.C.Rt(s.Tt.us) || {});
181
181
  let r = !1;
182
182
  for (let s = 0; s < t.length; s++) {
183
183
  const n = t[s].url;
184
- if (!this.Cs && n && tt(n)) {
184
+ if (!this.Ts && n && tt(n)) {
185
185
  E.error(
186
186
  `Card with url ${n} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`,
187
187
  );
@@ -196,94 +196,94 @@ export default class Z extends t {
196
196
  i && (h[i] = !0), (r = !0);
197
197
  }
198
198
  }
199
- return r && this.B && this.B.bt(s.ft.Pt, h), i;
199
+ return r && this.C && this.C.It(s.Tt.us, h), i;
200
200
  }
201
- Ks() {
201
+ Ri() {
202
202
  var t;
203
203
  const i = [];
204
- for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].gt());
205
- null === (t = this.B) || void 0 === t || t.bt(s.ft.Ps, i);
204
+ for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].qt());
205
+ null === (t = this.C) || void 0 === t || t.It(s.Tt.Ci, i);
206
206
  }
207
- Zs() {
208
- this.Js && (clearTimeout(this.Js), (this.Js = null));
207
+ Fi() {
208
+ this.Ws && (clearTimeout(this.Ws), (this.Ws = null));
209
209
  }
210
- ar(t, i, e = !1) {
210
+ lr(t, i, e = !1) {
211
211
  var n;
212
- const o = this.j,
213
- f = this.B;
214
- if (!o || !f) return void ("function" == typeof i && i());
215
- if ((e && (h.fi(f, h.H.vi), this.Zs()), !this.Os()))
212
+ const o = this.B,
213
+ u = this.C;
214
+ if (!o || !u) return void ("function" == typeof i && i());
215
+ if ((e && (h.Li(u, h.it.Ji), this.Fi()), !this.Ui()))
216
216
  return void (
217
217
  null === (n = this.h) ||
218
218
  void 0 === n ||
219
- n.Ci(() => {
220
- this.ar(t, i, !0);
219
+ n.Mi(() => {
220
+ this.lr(t, i, !0);
221
221
  })
222
222
  );
223
- const m = o.$({}, !0);
224
- f.dt(s.ft.Qs) !== r.Vs() && this.bi(),
225
- (m.last_full_sync_at = this.ys),
226
- (m.last_card_updated_at = this.Ss);
227
- const p = o.A(m, h.H.vi, e);
223
+ const f = o.Z({}, !0);
224
+ u.Rt(s.Tt.ki) !== r.zi() && this.$i(),
225
+ (f.last_full_sync_at = this.Us),
226
+ (f.last_card_updated_at = this.Ns);
227
+ const p = o.tt(f, h.it.Ji, e);
228
228
  let v = !1;
229
- o.J(
230
- m,
229
+ o.et(
230
+ f,
231
231
  (s = -1) => {
232
- if (this.B) {
232
+ if (this.C) {
233
233
  const t = new Date().valueOf();
234
- h.K(this.B, h.H.vi, t);
234
+ h.nt(this.C, h.it.Ji, t);
235
235
  }
236
236
  -1 !== s && p.push(["X-Braze-Req-Tokens-Remaining", s.toString()]),
237
- l.O({
238
- url: `${o.V()}/content_cards/sync`,
239
- data: m,
237
+ l.ot({
238
+ url: `${o.ht()}/content_cards/sync`,
239
+ data: f,
240
240
  headers: p,
241
- W: (s) => {
242
- if (!o.Y(m, s, p))
241
+ lt: (s) => {
242
+ if (!o.ut(f, s, p))
243
243
  return (v = !0), void ("function" == typeof i && i());
244
- o.Z(), this.N(s), (v = !1), "function" == typeof t && t();
244
+ o.ct(), this.I(s), (v = !1), "function" == typeof t && t();
245
245
  },
246
246
  error: (t) => {
247
- o._(t, "retrieving content cards"),
247
+ o.dt(t, "retrieving content cards"),
248
248
  (v = !0),
249
249
  "function" == typeof i && i();
250
250
  },
251
- tt: (s, e) => {
251
+ ft: (s, e) => {
252
252
  var r, n, l;
253
- let f;
253
+ let u;
254
254
  if (v) {
255
255
  const t =
256
- (null === (r = this.h) || void 0 === r ? void 0 : r.st()) ||
257
- c,
258
- s =
259
- (null === (n = this.h) || void 0 === n ? void 0 : n.it()) ||
256
+ (null === (r = this.h) || void 0 === r ? void 0 : r.vt()) ||
260
257
  d,
258
+ s =
259
+ (null === (n = this.h) || void 0 === n ? void 0 : n.gt()) ||
260
+ m,
261
261
  i =
262
- (null === (l = this.h) || void 0 === l ? void 0 : l.nt()) ||
263
- u;
264
- let e = this.Ms;
265
- (null == e || e < t) && (e = t), (f = Math.min(i, a(t, e * s)));
262
+ (null === (l = this.h) || void 0 === l ? void 0 : l.bt()) ||
263
+ c;
264
+ let e = this.Ys;
265
+ (null == e || e < t) && (e = t), (u = Math.min(i, a(t, e * s)));
266
266
  }
267
- o.et(
267
+ o.yt(
268
268
  e,
269
269
  () => {
270
- this.ar(t, i, !1);
270
+ this.lr(t, i, !1);
271
271
  },
272
- h.H.vi,
273
- (t) => this.Ys(t),
274
- () => this.Zs(),
275
- f,
272
+ h.it.Ji,
273
+ (t) => this.xi(t),
274
+ () => this.Fi(),
275
+ u,
276
276
  );
277
277
  },
278
278
  });
279
279
  },
280
- h.H.vi,
280
+ h.it.Ji,
281
281
  i,
282
282
  );
283
283
  }
284
- Ws(t) {
285
- t || this.Ts();
286
- const i = this.Xs(this.cards);
284
+ qi(t) {
285
+ t || this.Ms();
286
+ const i = this.bi(this.cards);
287
287
  i.sort((t, s) =>
288
288
  t.pinned && !s.pinned
289
289
  ? -1
@@ -295,52 +295,52 @@ export default class Z extends t {
295
295
  ? 1
296
296
  : 0,
297
297
  );
298
- let e = Math.max(this.Ss || 0, this.ys || 0);
298
+ let e = Math.max(this.Ns || 0, this.Us || 0);
299
299
  return (
300
300
  0 === e && (e = void 0),
301
- this.B && this.B.dt(s.ft.Hs) === this.Ss && void 0 === e && (e = this.Ss),
302
- new ContentCards(i, V(e))
301
+ this.C && this.C.Rt(s.Tt.ji) === this.Ns && void 0 === e && (e = this.Ns),
302
+ new ContentCards(i, Y(e))
303
303
  );
304
304
  }
305
- It(t) {
306
- return this.ws.Rt(t);
305
+ zt(t) {
306
+ return this.Rs.Kt(t);
307
307
  }
308
- bi() {
309
- (this.ys = 0),
310
- (this.Ss = 0),
311
- this.B && (this.B.zt(s.ft.Gs), this.B.zt(s.ft.Hs));
308
+ $i() {
309
+ (this.Us = 0),
310
+ (this.Ns = 0),
311
+ this.C && (this.C.Qt(s.Tt.gi), this.C.Qt(s.Tt.ji));
312
312
  }
313
313
  changeUser(t) {
314
314
  t ||
315
315
  ((this.cards = []),
316
- this.ws.L(new ContentCards(this.cards.slice(), null)),
317
- this.B &&
318
- (this.B.zt(s.ft.Ps),
319
- this.B.zt(s.ft.Jt),
320
- this.B.zt(s.ft.Vt),
321
- this.B.zt(s.ft.Pt))),
322
- this.Zs(),
323
- this.bi();
316
+ this.Rs.A(new ContentCards(this.cards.slice(), null)),
317
+ this.C &&
318
+ (this.C.Qt(s.Tt.Ci),
319
+ this.C.Qt(s.Tt.ns),
320
+ this.C.Qt(s.Tt.hs),
321
+ this.C.Qt(s.Tt.us))),
322
+ this.Fi(),
323
+ this.$i();
324
324
  }
325
325
  clearData(t) {
326
- (this.ys = 0),
327
- (this.Ss = 0),
326
+ (this.Us = 0),
327
+ (this.Ns = 0),
328
328
  (this.cards = []),
329
- this.ws.L(new ContentCards(this.cards.slice(), null)),
329
+ this.Rs.A(new ContentCards(this.cards.slice(), null)),
330
330
  t &&
331
- this.B &&
332
- (this.B.zt(s.ft.Ps),
333
- this.B.zt(s.ft.Jt),
334
- this.B.zt(s.ft.Vt),
335
- this.B.zt(s.ft.Pt),
336
- this.B.zt(s.ft.Gs),
337
- this.B.zt(s.ft.Hs)),
338
- this.Zs();
331
+ this.C &&
332
+ (this.C.Qt(s.Tt.Ci),
333
+ this.C.Qt(s.Tt.ns),
334
+ this.C.Qt(s.Tt.hs),
335
+ this.C.Qt(s.Tt.us),
336
+ this.C.Qt(s.Tt.gi),
337
+ this.C.Qt(s.Tt.ji)),
338
+ this.Fi();
339
339
  }
340
- Os() {
341
- return !!this.h && (!!this.h.wi() || (0 !== this.h.xt() && this.gi(), !1));
340
+ Ui() {
341
+ return !!this.h && (!!this.h.Bi() || (0 !== this.h.Ot() && this.Pi(), !1));
342
342
  }
343
- gi() {
344
- this.ws.L(new ContentCards([], new Date())), this.B && this.B.zt(s.ft.Ps);
343
+ Pi() {
344
+ this.Rs.A(new ContentCards([], new Date())), this.C && this.C.Qt(s.Tt.Ci);
345
345
  }
346
346
  }
@@ -16,17 +16,17 @@ export default class ContentCards {
16
16
  for (const t of this.cards) t.viewed || t instanceof ControlCard || r++;
17
17
  return r;
18
18
  }
19
- sr(r) {
19
+ ur(r) {
20
20
  logContentCardImpressions(r);
21
21
  }
22
- dr(r) {
22
+ cr(r) {
23
23
  return logContentCardClick(r);
24
24
  }
25
- ur() {
25
+ Cr() {
26
26
  requestContentCardsRefresh();
27
27
  }
28
- cr() {
28
+ hr() {
29
29
  return !0;
30
30
  }
31
31
  }
32
- (ContentCards.Cr = 6e4), (ContentCards.hr = 500), (ContentCards.lr = 1e4);
32
+ (ContentCards.mr = 6e4), (ContentCards.gr = 500), (ContentCards.jr = 1e4);
@@ -1,5 +1,5 @@
1
- import rr from "./content-cards-provider-factory.js";
1
+ import er from "./content-cards-provider-factory.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  export function getCachedContentCards() {
4
- if (r.rr()) return rr.o().Ws(!1);
4
+ if (r.rr()) return er.o().qi(!1);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import rr from "./content-cards-provider-factory.js";
2
+ import er from "./content-cards-provider-factory.js";
3
3
  export function requestContentCardsRefresh(e, t) {
4
- if (r.rr()) return rr.o().ar(e, t, !0);
4
+ if (r.rr()) return er.o().lr(e, t, !0);
5
5
  }
@@ -1,16 +1,16 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import rr from "./content-cards-provider-factory.js";
2
+ import er from "./content-cards-provider-factory.js";
3
3
  export function subscribeToContentCardsUpdates(o) {
4
4
  if (!r.rr()) return;
5
- const t = rr.o(),
6
- n = t.It(o);
7
- if (!t.St()) {
5
+ const t = er.o(),
6
+ n = t.zt(o);
7
+ if (!t.Lt()) {
8
8
  const o = r.nn();
9
9
  if (o) {
10
10
  const r = o.rn(() => {
11
- t.ar(void 0, void 0, !0);
11
+ t.lr(void 0, void 0, !0);
12
12
  });
13
- r && t.wt(r);
13
+ r && t.$t(r);
14
14
  }
15
15
  }
16
16
  return n;
@@ -1,6 +1,6 @@
1
- import r, { OPTIONS as D } from "../../managers/braze-instance.js";
1
+ import r, { OPTIONS as U } from "../../managers/braze-instance.js";
2
2
  import { ContentCards, subscribeToContentCardsUpdates } from "../index.js";
3
- import rr from "../content-cards-provider-factory.js";
3
+ import er from "../content-cards-provider-factory.js";
4
4
  import { setCardHeight as tn } from "../../Card/display/card-display.js";
5
5
  import { logger as E } from "../../../shared-lib/index.js";
6
6
  import {
@@ -18,20 +18,20 @@ export function showContentCards(n, t) {
18
18
  fn();
19
19
  let e = !1;
20
20
  null == n && ((n = document.body), (e = !0));
21
- const o = r.re(D.tn) || !1,
22
- s = rr.o().Ws(!1);
21
+ const o = r.er(U.tn) || !1,
22
+ s = er.o().qi(!1);
23
23
  "function" == typeof t && cn(s, t(s.cards.slice()), s.lastUpdated, null, o);
24
24
  const a = on(s, o, e),
25
- i = rr.o(),
26
- c = i.Bs();
25
+ i = er.o(),
26
+ c = i.fi();
27
27
  (null == s.lastUpdated ||
28
- new Date().valueOf() - s.lastUpdated.valueOf() > ContentCards.Cr) &&
29
- (null == c || new Date().valueOf() - c > ContentCards.Cr) &&
28
+ new Date().valueOf() - s.lastUpdated.valueOf() > ContentCards.mr) &&
29
+ (null == c || new Date().valueOf() - c > ContentCards.mr) &&
30
30
  (E.info(
31
- `Cached content cards were older than max TTL of ${ContentCards.Cr} ms, requesting an update from the server.`,
31
+ `Cached content cards were older than max TTL of ${ContentCards.mr} ms, requesting an update from the server.`,
32
32
  ),
33
33
  sn(s, a),
34
- i.Es(new Date().valueOf()));
34
+ i.vi(new Date().valueOf()));
35
35
  const f = new Date().valueOf(),
36
36
  l = subscribeToContentCardsUpdates(function (n) {
37
37
  const e = a.querySelectorAll(".ab-refresh-button")[0];
@@ -1,7 +1,7 @@
1
1
  import aa from "../managers/braze-instance.js";
2
2
  import BrazeSdkMetadata from "./braze-sdk-metadata.js";
3
3
  import {
4
- isArray as R,
4
+ isArray as g,
5
5
  validateValueIsFromEnum as ta,
6
6
  } from "../util/code-utils.js";
7
7
  import { logger as E } from "../../shared-lib/index.js";
@@ -9,7 +9,7 @@ export function addSdkMetadata(a) {
9
9
  if (!aa.rr()) return;
10
10
  const t = aa.m();
11
11
  if (t) {
12
- if (!R(a))
12
+ if (!g(a))
13
13
  return (
14
14
  E.error("Cannot set SDK metadata because metadata is not an array."), !1
15
15
  );
@@ -1,17 +1,17 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { getByteLength as er } from "../util/string-utils.js";
2
+ import { getByteLength as ir } from "../util/string-utils.js";
3
3
  import { logger as E } from "../../shared-lib/index.js";
4
4
  import { User } from "../User/index.js";
5
- import { validateStandardString as ir } from "../util/validation-utils.js";
5
+ import { validateStandardString as tr } from "../util/validation-utils.js";
6
6
  export function changeUser(e, i) {
7
7
  if (!r.rr()) return;
8
8
  if (null == e || 0 === e.length || e != e)
9
9
  return void E.error("changeUser requires a non-empty userId.");
10
- if (er(e) > User.mr)
10
+ if (ir(e) > User.br)
11
11
  return void E.error(
12
- `Rejected user id "${e}" because it is longer than ${User.mr} bytes.`,
12
+ `Rejected user id "${e}" because it is longer than ${User.br} bytes.`,
13
13
  );
14
- if (null != i && !ir(i, "set signature for new user", "signature")) return;
14
+ if (null != i && !tr(i, "set signature for new user", "signature")) return;
15
15
  const t = r.nn();
16
- t && t.changeUser(e.toString(), r.gr(), i);
16
+ t && t.changeUser(e.toString(), r.vr(), i);
17
17
  }
@@ -1,16 +1,16 @@
1
- import r, { OPTIONS as D } from "../managers/braze-instance.js";
1
+ import r, { OPTIONS as U } from "../managers/braze-instance.js";
2
2
  import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
3
- import ee, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
3
+ import ne, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
4
4
  export function disableSDK() {
5
5
  const e = r.nn();
6
6
  e && e.requestImmediateDataFlush();
7
- const n = r.re(D.le),
8
- a = new ee.me(null, !0, n),
9
- i = "This-cookie-will-expire-in-" + a.pe();
10
- a.store(s.be, i);
11
- const o = et.Us.Rs;
12
- new et(o, E).setItem(o.Fs.fe, o.ge, !0),
7
+ const n = r.er(U.se),
8
+ a = new ne.le(null, !0, n),
9
+ i = "This-cookie-will-expire-in-" + a.me();
10
+ a.store(s.ce, i);
11
+ const o = et.Ps.$s;
12
+ new et(o, E).setItem(o.Os.pe, o.be, !0),
13
13
  E.info("disableSDK was called"),
14
14
  r.destroy(!1),
15
- r.we(!0);
15
+ r.fe(!0);
16
16
  }
@@ -1,11 +1,11 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
3
- import ee, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
3
+ import ne, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
- new ee.me(null, !0).remove(s.be);
6
- const e = et.Us.Rs;
7
- new et(e, E).je(e.Fs.fe, e.ge),
5
+ new ne.le(null, !0).remove(s.ce);
6
+ const e = et.Ps.$s;
7
+ new et(e, E).ge(e.Os.pe, e.be),
8
8
  E.info("enableSDK was called"),
9
9
  r.destroy(!1),
10
- r.we(!1);
10
+ r.fe(!1);
11
11
  }
@@ -1,4 +1,4 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  export function getUser() {
3
- if (r.rr()) return r.br();
3
+ if (r.rr()) return r.zr();
4
4
  }