@braze/web-sdk 5.6.0 → 5.7.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 (121) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +14 -4
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +20 -20
  6. package/shared-lib/indexed-db-adapter.js +15 -15
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +14 -14
  9. package/src/Banner/banner-provider.js +53 -50
  10. package/src/Banner/banner.js +1 -1
  11. package/src/Banner/get-all-banners.js +2 -2
  12. package/src/Banner/get-banner.js +2 -2
  13. package/src/Banner/log-banner-click.js +1 -1
  14. package/src/Banner/log-banner-impressions.js +4 -4
  15. package/src/Banner/request-banners-refresh.js +2 -2
  16. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  17. package/src/Card/card-manager.js +10 -10
  18. package/src/Card/models/captioned-image.js +1 -1
  19. package/src/Card/models/card.js +3 -3
  20. package/src/Card/models/classic-card.js +1 -1
  21. package/src/Card/models/control-card.js +1 -1
  22. package/src/Card/models/image-only.js +1 -1
  23. package/src/ContentCards/content-cards-provider.js +139 -180
  24. package/src/ContentCards/get-cached-content-cards.js +1 -1
  25. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  26. package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
  27. package/src/ContentCards/ui/show-content-cards.js +3 -3
  28. package/src/Core/disable-sdk.js +3 -3
  29. package/src/Core/enable-sdk.js +3 -3
  30. package/src/Core/log-custom-event.js +3 -3
  31. package/src/Core/log-purchase.js +1 -1
  32. package/src/Core/open-session.js +6 -6
  33. package/src/Core/wipe-data.js +4 -4
  34. package/src/FeatureFlags/feature-flag.js +1 -1
  35. package/src/FeatureFlags/feature-flags-provider.js +81 -78
  36. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  37. package/src/FeatureFlags/get-feature-flag.js +2 -2
  38. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  39. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  40. package/src/Feed/feed-provider.js +34 -34
  41. package/src/Feed/get-cached-feed.js +1 -1
  42. package/src/Feed/request-feed-refresh.js +1 -1
  43. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  44. package/src/Feed/ui/show-feed.js +1 -1
  45. package/src/InAppMessage/defer-in-app-message.js +1 -1
  46. package/src/InAppMessage/display/html-message-to-html.js +9 -9
  47. package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
  48. package/src/InAppMessage/display/modal-utils.js +5 -5
  49. package/src/InAppMessage/in-app-message-factory.js +4 -4
  50. package/src/InAppMessage/in-app-message-manager.js +115 -91
  51. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  52. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  53. package/src/InAppMessage/log-in-app-message-html-click.js +4 -4
  54. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  55. package/src/InAppMessage/models/full-screen-message.js +5 -5
  56. package/src/InAppMessage/models/html-message.js +10 -10
  57. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  58. package/src/InAppMessage/models/in-app-message.js +37 -37
  59. package/src/InAppMessage/models/modal-message.js +5 -5
  60. package/src/InAppMessage/models/slide-up-message.js +7 -7
  61. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  62. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  63. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  64. package/src/InAppMessage/ui/show-in-app-message.js +14 -14
  65. package/src/Push/is-push-blocked.js +2 -2
  66. package/src/Push/is-push-permission-granted.js +2 -2
  67. package/src/Push/is-push-supported.js +2 -2
  68. package/src/Push/push-manager.js +88 -88
  69. package/src/Push/utils/push-utils.js +12 -12
  70. package/src/User/user-manager.js +10 -10
  71. package/src/User/user.js +46 -34
  72. package/src/common/constants.js +1 -1
  73. package/src/common/event-logger.js +3 -3
  74. package/src/common/feed-display.js +10 -10
  75. package/src/l10n/l10n-manager.js +1 -1
  76. package/src/managers/auth-manager.js +10 -10
  77. package/src/managers/braze-instance.js +110 -110
  78. package/src/managers/device-manager.js +17 -17
  79. package/src/managers/network-manager.js +180 -143
  80. package/src/managers/server-config-manager.js +65 -65
  81. package/src/managers/session-manager.js +22 -22
  82. package/src/managers/storage-manager-factory.js +9 -9
  83. package/src/managers/storage-manager.js +134 -134
  84. package/src/managers/subscription-manager.js +8 -8
  85. package/src/managers/utils.js +1 -1
  86. package/src/models/backend-errors.js +5 -5
  87. package/src/models/braze-event.js +8 -8
  88. package/src/models/device.js +2 -2
  89. package/src/models/identifier.js +10 -10
  90. package/src/models/push-token.js +8 -8
  91. package/src/models/server-config.js +31 -31
  92. package/src/request-controller.js +158 -146
  93. package/src/triggers/models/custom-event-data.js +5 -5
  94. package/src/triggers/models/custom-event-property-data.js +6 -6
  95. package/src/triggers/models/filter-set.js +6 -6
  96. package/src/triggers/models/filter.js +16 -16
  97. package/src/triggers/models/in-app-message-click-data.js +2 -2
  98. package/src/triggers/models/purchase-data.js +2 -2
  99. package/src/triggers/models/purchase-property-data.js +4 -4
  100. package/src/triggers/models/push-click-data.js +2 -2
  101. package/src/triggers/models/trigger-condition.js +36 -36
  102. package/src/triggers/models/trigger-events.js +1 -1
  103. package/src/triggers/models/trigger.js +11 -11
  104. package/src/triggers/triggers-provider-factory.js +2 -2
  105. package/src/triggers/triggers-provider.js +37 -37
  106. package/src/ui/js/attach-css.js +1 -1
  107. package/src/ui/js/iam-css.js +1 -1
  108. package/src/ui/js/load-font-awesome.js +1 -1
  109. package/src/util/base-device-parser.js +1 -1
  110. package/src/util/braze-actions.js +4 -4
  111. package/src/util/browser-detector.js +11 -10
  112. package/src/util/client-hints-parser.js +3 -3
  113. package/src/util/component-utils.js +2 -2
  114. package/src/util/dom-utils.js +3 -3
  115. package/src/util/html-display-utils.js +1 -0
  116. package/src/util/key-codes.js +1 -1
  117. package/src/util/net.js +22 -23
  118. package/src/util/request-header-utils.js +23 -20
  119. package/src/util/user-agent-parser.js +14 -14
  120. package/src/util/validation-utils.js +14 -14
  121. package/src/util/window-utils.js +2 -2
@@ -3,7 +3,7 @@ import r from "../managers/braze-instance.js";
3
3
  import ve from "../models/braze-event.js";
4
4
  import E from "../models/request-result.js";
5
5
  const c = {
6
- ds: (e, o, t) => {
6
+ cs: (e, o, t) => {
7
7
  var n, s;
8
8
  const i = new E(),
9
9
  l = r.P();
@@ -14,7 +14,7 @@ const c = {
14
14
  ),
15
15
  i
16
16
  );
17
- const d = l.qo();
17
+ const d = l.Eo();
18
18
  return (
19
19
  i.fe.push(
20
20
  new ve(
@@ -26,7 +26,7 @@ const c = {
26
26
  ),
27
27
  ),
28
28
  (i.ss =
29
- (null === (s = r.j()) || void 0 === s ? void 0 : s.Eo(i.fe)) || !1),
29
+ (null === (s = r.j()) || void 0 === s ? void 0 : s.Go(i.fe)) || !1),
30
30
  i
31
31
  );
32
32
  },
@@ -7,14 +7,14 @@ 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 w } from "../util/code-utils.js";
10
- import { KeyCodes as bt } from "../util/key-codes.js";
10
+ import { KeyCodes as mt } 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
13
  import { logger as N, Guid as G } from "../../shared-lib/index.js";
14
14
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
15
15
  import {
16
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as vt,
17
- ineligibleBrazeActionURLErrorMessage as jt,
16
+ INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as jt,
17
+ ineligibleBrazeActionURLErrorMessage as dt,
18
18
  getDecodedBrazeAction as eo,
19
19
  containsUnknownBrazeAction as ft,
20
20
  } from "../util/braze-actions.js";
@@ -63,7 +63,7 @@ export function generateFeedBody(e, t) {
63
63
  for (const r of e.cards) {
64
64
  const i = r instanceof ControlCard;
65
65
  !i || e.ur()
66
- ? (s.appendChild(Fe(r, logCardClick, t, o.So())), (n = n || !i))
66
+ ? (s.appendChild(Fe(r, logCardClick, t, o.Fo())), (n = n || !i))
67
67
  : N.error(
68
68
  "Received a control card for a legacy news feed. Control cards are only supported with content cards.",
69
69
  );
@@ -82,12 +82,12 @@ export function detectFeedImpressions(e, t) {
82
82
  if (null != e && null != t) {
83
83
  const o = [],
84
84
  s = t.querySelectorAll(".ab-card");
85
- e.Fo || (e.Fo = {});
85
+ e._o || (e._o = {});
86
86
  for (let t = 0; t < s.length; t++) {
87
87
  const n = be(s[t]),
88
88
  r = x(s[t]),
89
89
  i = B(s[t]);
90
- if (e.Fo[n]) {
90
+ if (e._o[n]) {
91
91
  r || i || ye(s[t]);
92
92
  continue;
93
93
  }
@@ -101,7 +101,7 @@ export function detectFeedImpressions(e, t) {
101
101
  if (l && c) continue;
102
102
  for (const t of e.cards)
103
103
  if (t.id === n) {
104
- (e.Fo[t.id] = !0), o.push(t);
104
+ (e._o[t.id] = !0), o.push(t);
105
105
  break;
106
106
  }
107
107
  }
@@ -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 !== bt.To && e.keyCode !== bt._o) || i(e);
156
+ (e.keyCode !== mt.Ro && e.keyCode !== mt.Lo) || 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 !== bt.To && e.keyCode !== bt._o) || d(e);
169
+ (e.keyCode !== mt.Ro && e.keyCode !== mt.Lo) || d(e);
170
170
  }),
171
171
  (a.onclick = d),
172
172
  n.appendChild(a),
@@ -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(jt(vt.Qr, "Content Card"));
191
+ N.error(dt(jt.Nr, "Content Card"));
192
192
  continue;
193
193
  }
194
194
  }
@@ -22,7 +22,7 @@ export default class lr {
22
22
  get(t) {
23
23
  return xt[this.language][t];
24
24
  }
25
- So() {
25
+ Fo() {
26
26
  switch (this.language) {
27
27
  case "ar":
28
28
  case "he":
@@ -1,7 +1,7 @@
1
1
  import { STORAGE_KEYS as t } from "./storage-manager.js";
2
2
  import u from "./subscription-manager.js";
3
- import { logger as N, IndexedDBAdapter as it } from "../../shared-lib/index.js";
4
- export default class qt {
3
+ import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
4
+ export default class kt {
5
5
  constructor(t, i, s) {
6
6
  (this.C = t),
7
7
  (this.gh = i),
@@ -17,21 +17,21 @@ export default class qt {
17
17
  return this.gh;
18
18
  }
19
19
  xh() {
20
- return this.C.ps(t.bs.qh);
20
+ return this.C.vs(t.gs.qh);
21
21
  }
22
22
  setSdkAuthenticationSignature(i) {
23
23
  const s = this.xh();
24
- this.C.js(t.bs.qh, i);
25
- const e = it.Gs._s;
26
- new it(e, N).setItem(e.Os.yh, this.wh, i), s !== i && this.es();
24
+ this.C.Bs(t.gs.qh, i);
25
+ const e = tt._s.Xs;
26
+ new tt(e, N).setItem(e.Ks.yh, this.wh, i), s !== i && this.es();
27
27
  }
28
28
  Bh() {
29
- this.C.Ls(t.bs.qh);
30
- const i = it.Gs._s;
31
- new it(i, N).me(i.Os.yh, this.wh);
29
+ this.C.Es(t.gs.qh);
30
+ const i = tt._s.Xs;
31
+ new tt(i, N).me(i.Ks.yh, this.wh);
32
32
  }
33
33
  subscribeToSdkAuthenticationFailures(t) {
34
- return this.Fh.Ns(t);
34
+ return this.Fh.Fs(t);
35
35
  }
36
36
  Gh(t) {
37
37
  this.Fh.X(t);
@@ -1,4 +1,4 @@
1
- import qt from "./auth-manager.js";
1
+ import kt from "./auth-manager.js";
2
2
  import s from "../common/base-provider.js";
3
3
  import ro from "../util/browser-detector.js";
4
4
  import Ot from "./device-manager.js";
@@ -11,13 +11,13 @@ import {
11
11
  } from "../util/code-utils.js";
12
12
  import Pt from "./network-manager.js";
13
13
  import Lt from "../request-controller.js";
14
- import Dt from "./server-config-manager.js";
15
- import Mt from "./session-manager.js";
14
+ import Mt from "./server-config-manager.js";
15
+ import Wt from "./session-manager.js";
16
16
  import ne, { STORAGE_KEYS as t } from "./storage-manager.js";
17
- import Wt from "./storage-manager-factory.js";
17
+ import Bt from "./storage-manager-factory.js";
18
18
  import u from "./subscription-manager.js";
19
19
  import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js";
20
- import kt from "../User/user-manager.js";
20
+ import bt from "../User/user-manager.js";
21
21
  import { User } from "../User/index.js";
22
22
  import { parseQueryStringKeyValues as ll } from "../util/url-utils.js";
23
23
  import { WindowUtils as no } from "../util/window-utils.js";
@@ -26,68 +26,68 @@ import { SupportedOptions as zt, logger as N } from "../../shared-lib/index.js";
26
26
  import _t from "../models/identifier.js";
27
27
  const z = {
28
28
  Oo: "allowCrawlerActivity",
29
- Ro: "baseUrl",
30
- Lo: "noCookies",
31
- Wo: "devicePropertyAllowlist",
29
+ Wo: "baseUrl",
30
+ Vo: "noCookies",
31
+ Ko: "devicePropertyAllowlist",
32
32
  Da: "disablePushTokenMaintenance",
33
- Vo: "enableLogging",
34
- Ko: "enableSdkAuthentication",
33
+ Yo: "enableLogging",
34
+ Ho: "enableSdkAuthentication",
35
35
  Ca: "manageServiceWorkerExternally",
36
- Go: "minimumIntervalBetweenTriggerActionsInSeconds",
37
- Yo: "sessionTimeoutInSeconds",
38
- Ho: "appVersion",
39
- Xo: "appVersionNumber",
36
+ Xo: "minimumIntervalBetweenTriggerActionsInSeconds",
37
+ Zo: "sessionTimeoutInSeconds",
38
+ Qo: "appVersion",
39
+ Wh: "appVersionNumber",
40
40
  _a: "serviceWorkerLocation",
41
41
  Ba: "safariWebsitePushId",
42
42
  Ea: "localization",
43
43
  ir: "contentSecurityNonce",
44
44
  er: "allowUserSuppliedJavascript",
45
- Jo: "inAppMessageZIndex",
46
- Do: "openInAppMessagesInNewTab",
45
+ Do: "inAppMessageZIndex",
46
+ To: "openInAppMessagesInNewTab",
47
47
  tn: "openCardsInNewTab",
48
48
  en: "openNewsFeedCardsInNewTab",
49
49
  mh: "requireExplicitInAppMessageDismissal",
50
- Zo: "doNotLoadFontAwesome",
51
- Qo: "deviceId",
50
+ Vh: "doNotLoadFontAwesome",
51
+ $h: "deviceId",
52
52
  Aa: "serviceWorkerScope",
53
- Wh: "sdkFlavor",
53
+ Yh: "sdkFlavor",
54
54
  };
55
55
  class Vt {
56
56
  constructor() {
57
- (this.yn = ""),
58
- (this.Vh = ""),
59
- (this.$h = void 0),
60
- (this.Yh = null),
61
- (this.wn = null),
57
+ (this.fn = ""),
58
+ (this.Xh = ""),
59
+ (this.Zh = void 0),
60
+ (this.Qh = null),
61
+ (this.dn = null),
62
62
  (this.S = null),
63
- (this.Ue = null),
63
+ (this.Bi = null),
64
64
  (this.B = null),
65
65
  (this.T = null),
66
66
  (this.C = null),
67
67
  (this.As = null),
68
- (this.Xh = ""),
68
+ (this.Ia = ""),
69
69
  (this.isInitialized = !1),
70
- (this.Zh = !1),
71
- (this.Qh = new u()),
72
- (this.Ia = new u()),
70
+ (this.Na = !1),
71
+ (this.Oa = new u()),
72
+ (this.Ta = new u()),
73
73
  (this.options = {}),
74
- (this.Na = []),
75
- (this.Oa = []),
76
- (this.Ir = []),
77
- (this.Vh = "5.6.0");
74
+ (this.Ra = []),
75
+ (this.Pa = []),
76
+ (this._i = []),
77
+ (this.Xh = "5.7.0");
78
78
  }
79
- Ta(t) {
80
- this.Qh.Ns(t);
79
+ La(t) {
80
+ this.Oa.Fs(t);
81
81
  }
82
82
  Nh(t) {
83
- this.Ia.Ns(t);
83
+ this.Ta.Fs(t);
84
84
  }
85
85
  initialize(i, s) {
86
86
  if (this.nt())
87
87
  return N.info("Braze has already been initialized with an API key."), !0;
88
88
  this.options = s || {};
89
- let e = this.sr(z.Vo);
90
- const r = ll(no.Ra());
89
+ let e = this.sr(z.Yo);
90
+ const r = ll(no.Ua());
91
91
  if (
92
92
  (r && "true" === r.brazeLogging && (e = !0),
93
93
  N.init(e),
@@ -97,8 +97,8 @@ class Vt {
97
97
  null == i || "" === i || "string" != typeof i)
98
98
  )
99
99
  return N.error("Braze requires a valid API key to be initialized."), !1;
100
- this.yn = i;
101
- let n = this.sr(z.Ro);
100
+ this.fn = i;
101
+ let n = this.sr(z.Wo);
102
102
  if (null == n || "" === n || "string" != typeof n)
103
103
  return N.error("Braze requires a valid baseUrl to be initialized."), !1;
104
104
  !1 === /^https?:/.test(n) && (n = `https://${n}`);
@@ -107,34 +107,34 @@ class Vt {
107
107
  ((n = document.createElement("a")),
108
108
  (n.href = o),
109
109
  "/" === n.pathname && (n = `${n}api/v3`),
110
- (this.Xh = n.toString()),
111
- ro.Pa && !this.sr(z.Oo))
110
+ (this.Ia = n.toString()),
111
+ ro.Wa && !this.sr(z.Oo))
112
112
  )
113
113
  return (
114
114
  N.info("Ignoring activity from crawler bot " + navigator.userAgent),
115
- (this.Zh = !0),
115
+ (this.Na = !0),
116
116
  !1
117
117
  );
118
- const h = this.sr(z.Lo) || !1;
118
+ const h = this.sr(z.Vo) || !1;
119
119
  if (
120
- ((this.C = Wt.La(i, h)), h && this.C.Ua(i), new ne.ne(null, !0).gr(t.ae))
120
+ ((this.C = Bt.Va(i, h)), h && this.C.Fa(i), new ne.ne(null, !0).gr(t.ae))
121
121
  )
122
122
  return (
123
123
  N.info("Ignoring all activity due to previous opt out"),
124
- (this.Zh = !0),
124
+ (this.Na = !0),
125
125
  !1
126
126
  );
127
127
  for (const t of y(this.options))
128
128
  -1 === Rt(zt).indexOf(t) &&
129
129
  N.warn(`Ignoring unknown initialization option '${t}'.`);
130
130
  const a = ["mparticle", "wordpress", "tealium"];
131
- if (null != this.sr(z.Wh)) {
132
- const t = this.sr(z.Wh);
131
+ if (null != this.sr(z.Yh)) {
132
+ const t = this.sr(z.Yh);
133
133
  -1 !== a.indexOf(t)
134
- ? (this.$h = t)
134
+ ? (this.Zh = t)
135
135
  : N.error("Invalid sdk flavor passed: " + t);
136
136
  }
137
- let l = this.sr(zt.Wo);
137
+ let l = this.sr(zt.Ko);
138
138
  if (null != l)
139
139
  if (w(l)) {
140
140
  const t = [];
@@ -151,74 +151,74 @@ class Vt {
151
151
  "devicePropertyAllowlist must be an array. Defaulting to all properties.",
152
152
  ),
153
153
  (l = null);
154
- const c = this.sr(z.Qo);
154
+ const c = this.sr(z.$h);
155
155
  if (c) {
156
156
  const i = new _t(c);
157
- this.C.uu(t.iu.Qo, i);
157
+ this.C.uu(t.iu.$h, i);
158
158
  }
159
- (this.wn = new Ot(this.C, l)),
160
- (this.B = new Dt(this.C)),
161
- (this.As = new kt(this.B, this.C)),
162
- (this.T = new Mt(this.C, this.As, this.B, this.sr(z.Yo)));
159
+ (this.dn = new Ot(this.C, l)),
160
+ (this.B = new Mt(this.C)),
161
+ (this.As = new bt(this.B, this.C)),
162
+ (this.T = new Wt(this.C, this.As, this.B, this.sr(z.Zo)));
163
163
  const f = new u();
164
164
  return (
165
- (this.Yh = new qt(this.C, this.sr(z.Ko), f)),
165
+ (this.Qh = new kt(this.C, this.sr(z.Ho), f)),
166
166
  this.N(f),
167
167
  (this.S = new Pt(
168
- this.wn,
168
+ this.dn,
169
169
  this.C,
170
- this.Yh,
170
+ this.Qh,
171
171
  this.As,
172
172
  this.T,
173
173
  this.B,
174
- this.yn,
174
+ this.fn,
175
+ this.Ia,
175
176
  this.Xh,
176
- this.Vh,
177
- this.$h || "",
178
- this.sr(z.Ho),
179
- this.sr(z.Xo),
177
+ this.Zh || "",
178
+ this.sr(z.Qo),
179
+ this.sr(z.Wh),
180
180
  )),
181
- (this.Ue = new Lt(
182
- this.yn,
183
- this.Xh,
181
+ (this.Bi = new Lt(
182
+ this.fn,
183
+ this.Ia,
184
184
  this.T,
185
- this.wn,
185
+ this.dn,
186
186
  this.As,
187
187
  this.B,
188
188
  this.C,
189
189
  (t) => {
190
190
  if (this.nt()) for (const i of this.lr()) i.U(t);
191
191
  },
192
- this.Yh,
192
+ this.Qh,
193
193
  this.S,
194
194
  )),
195
- this.Ue.initialize(),
196
- h || this.C.Wa(),
195
+ this.Bi.initialize(),
196
+ h || this.C.Ka(),
197
197
  N.info(
198
198
  `Initialized for the Braze backend at "${this.sr(
199
- z.Ro,
200
- )}" with API key "${this.yn}".`,
199
+ z.Wo,
200
+ )}" with API key "${this.fn}".`,
201
201
  ),
202
202
  ot.p(),
203
- this.B.Re(() => {
203
+ this.B.Me(() => {
204
204
  var t;
205
205
  this.isInitialized &&
206
- (null === (t = this.B) || void 0 === t ? void 0 : t.Qi()) &&
206
+ (null === (t = this.B) || void 0 === t ? void 0 : t.De()) &&
207
207
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
208
208
  if (!this.isInitialized) return;
209
209
  (0, t.default)();
210
210
  });
211
211
  }),
212
- this.Ue.rn(() => {
212
+ this.Bi.rn(() => {
213
213
  var t;
214
214
  this.isInitialized &&
215
- (null === (t = this.B) || void 0 === t ? void 0 : t.Qi()) &&
215
+ (null === (t = this.B) || void 0 === t ? void 0 : t.De()) &&
216
216
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
217
217
  if (!this.isInitialized) return;
218
218
  (0, t.default)(void 0, void 0, !0);
219
219
  });
220
220
  }),
221
- this.Qh.X(this.options),
221
+ this.Oa.X(this.options),
222
222
  (this.isInitialized = !0),
223
223
  window.dispatchEvent(new CustomEvent("braze.initialized")),
224
224
  !0
@@ -226,42 +226,42 @@ class Vt {
226
226
  }
227
227
  destroy(t) {
228
228
  if ((N.destroy(), this.nt())) {
229
- this.Ia.X(), this.Ia.removeAllSubscriptions();
230
- for (const t of this.Na) t.destroy();
231
- this.Na = [];
232
- for (const t of this.Oa) t.clearData(!1);
233
- (this.Oa = []),
229
+ this.Ta.X(), this.Ta.removeAllSubscriptions();
230
+ for (const t of this.Ra) t.destroy();
231
+ this.Ra = [];
232
+ for (const t of this.Pa) t.clearData(!1);
233
+ (this.Pa = []),
234
234
  this.removeAllSubscriptions(),
235
- (this.Ir = []),
236
- null != this.Ue && this.Ue.destroy(),
237
- (this.Ue = null),
238
- (this.Yh = null),
239
- (this.wn = null),
235
+ (this._i = []),
236
+ null != this.Bi && this.Bi.destroy(),
237
+ (this.Bi = null),
238
+ (this.Qh = null),
239
+ (this.dn = null),
240
240
  (this.S = null),
241
241
  (this.B = null),
242
242
  (this.T = null),
243
243
  (this.As = null),
244
244
  (this.options = {}),
245
- (this.$h = void 0),
245
+ (this.Zh = void 0),
246
246
  (this.isInitialized = !1),
247
- (this.Zh = !1),
247
+ (this.Na = !1),
248
248
  t && (this.C = null);
249
249
  }
250
250
  }
251
251
  rr() {
252
- return !this.Va() && (!!this.nt() || (console.warn(p), !1));
252
+ return !this.Ga() && (!!this.nt() || (console.warn(p), !1));
253
253
  }
254
254
  Ma() {
255
- return this.yn;
255
+ return this.fn;
256
256
  }
257
257
  Sr() {
258
- return this.Yh;
258
+ return this.Qh;
259
259
  }
260
260
  Z() {
261
- return this.Xh;
261
+ return this.Ia;
262
262
  }
263
263
  te() {
264
- return this.wn;
264
+ return this.dn;
265
265
  }
266
266
  g() {
267
267
  return this.S;
@@ -270,10 +270,10 @@ class Vt {
270
270
  return this.options[t];
271
271
  }
272
272
  lr() {
273
- return this.Oa;
273
+ return this.Pa;
274
274
  }
275
275
  nn() {
276
- return this.Ue;
276
+ return this.Bi;
277
277
  }
278
278
  v() {
279
279
  return this.B;
@@ -285,7 +285,7 @@ class Vt {
285
285
  return this.C;
286
286
  }
287
287
  cr() {
288
- if (this.As && this.Ue) return new User(this.As, this.Ue);
288
+ if (this.As && this.Bi) return new User(this.As, this.Bi);
289
289
  }
290
290
  tr() {
291
291
  return this.As;
@@ -295,34 +295,34 @@ class Vt {
295
295
  }
296
296
  h(t) {
297
297
  let i = !1;
298
- for (const s of this.Na) s === t && (i = !0);
299
- i || this.Na.push(t);
298
+ for (const s of this.Ra) s === t && (i = !0);
299
+ i || this.Ra.push(t);
300
300
  }
301
301
  _(t) {
302
302
  let i = !1;
303
- for (const s of this.Oa) s.constructor === t.constructor && (i = !0);
304
- t instanceof s && !i && this.Oa.push(t);
303
+ for (const s of this.Pa) s.constructor === t.constructor && (i = !0);
304
+ t instanceof s && !i && this.Pa.push(t);
305
305
  }
306
306
  N(t) {
307
- t instanceof u && this.Ir.push(t);
307
+ t instanceof u && this._i.push(t);
308
308
  }
309
309
  removeAllSubscriptions() {
310
- if (this.rr()) for (const t of this.Ir) t.removeAllSubscriptions();
310
+ if (this.rr()) for (const t of this._i) t.removeAllSubscriptions();
311
311
  }
312
312
  removeSubscription(t) {
313
- if (this.rr()) for (const i of this.Ir) i.removeSubscription(t);
313
+ if (this.rr()) for (const i of this._i) i.removeSubscription(t);
314
314
  }
315
315
  re(t) {
316
- this.Zh = t;
316
+ this.Na = t;
317
317
  }
318
318
  nt() {
319
319
  return this.isInitialized;
320
320
  }
321
- Va() {
322
- return this.Zh;
321
+ Ga() {
322
+ return this.Na;
323
323
  }
324
- Ui() {
325
- return this.Vh;
324
+ Si() {
325
+ return this.Xh;
326
326
  }
327
327
  }
328
328
  const r = new Vt();
@@ -9,34 +9,34 @@ import { getErrorMessage as si } from "../util/error-utils.js";
9
9
  export default class Ot {
10
10
  constructor(t, e) {
11
11
  (this.C = t),
12
- (this.Fa = e),
12
+ (this.Ja = e),
13
13
  (this.C = t),
14
14
  null == e && (e = Rt(DeviceProperties)),
15
- (this.Fa = e);
15
+ (this.Ja = e);
16
16
  }
17
17
  ce(e = !0) {
18
- let r = this.C.tu(t.iu.Qo);
19
- null == r && ((r = new _t(G.Rt())), e && this.C.uu(t.iu.Qo, r));
18
+ let r = this.C.tu(t.iu.$h);
19
+ null == r && ((r = new _t(G.Rt())), e && this.C.uu(t.iu.$h, r));
20
20
  const s = new Gt(r.eu);
21
- for (let t = 0; t < this.Fa.length; t++) {
22
- switch (this.Fa[t]) {
21
+ for (let t = 0; t < this.Ja.length; t++) {
22
+ switch (this.Ja[t]) {
23
23
  case DeviceProperties.BROWSER:
24
24
  s.browser = ro.browser;
25
25
  break;
26
26
  case DeviceProperties.BROWSER_VERSION:
27
- s.Ga = ro.version;
27
+ s.Ha = ro.version;
28
28
  break;
29
29
  case DeviceProperties.OS:
30
- s.os = this.Ja();
30
+ s.os = this.Qa();
31
31
  break;
32
32
  case DeviceProperties.RESOLUTION:
33
- s.Ha = screen.width + "x" + screen.height;
33
+ s.Xa = screen.width + "x" + screen.height;
34
34
  break;
35
35
  case DeviceProperties.LANGUAGE:
36
36
  s.language = ro.language;
37
37
  break;
38
38
  case DeviceProperties.TIME_ZONE:
39
- s.timeZone = this.Ka(new Date());
39
+ s.timeZone = this.Ya(new Date());
40
40
  break;
41
41
  case DeviceProperties.USER_AGENT:
42
42
  s.userAgent = ro.userAgent;
@@ -44,12 +44,12 @@ export default class Ot {
44
44
  }
45
45
  return s;
46
46
  }
47
- Ja() {
48
- if (ro.Qa()) return ro.Qa();
49
- const e = this.C.ps(t.bs.Xa);
50
- return e && e.os_version ? e.os_version : ro.Ja();
47
+ Qa() {
48
+ if (ro.Za()) return ro.Za();
49
+ const e = this.C.vs(t.gs.$a);
50
+ return e && e.os_version ? e.os_version : ro.Qa();
51
51
  }
52
- Ka(t) {
52
+ Ya(t) {
53
53
  let e = !1;
54
54
  if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)
55
55
  try {
@@ -66,9 +66,9 @@ export default class Ot {
66
66
  }
67
67
  if (e) return "";
68
68
  const r = t.getTimezoneOffset();
69
- return this.Ya(r);
69
+ return this.tc(r);
70
70
  }
71
- Ya(t) {
71
+ tc(t) {
72
72
  const e = Math.trunc(t / 60),
73
73
  r = Math.trunc(t % 60);
74
74
  let s = "GMT";