@braze/web-sdk 6.4.0 → 6.6.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 (155) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +11 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +3 -3
  5. package/shared-lib/event-types.js +30 -30
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/indexed-db-adapter.js +58 -58
  8. package/shared-lib/logger.js +7 -7
  9. package/shared-lib/supported-options.js +17 -16
  10. package/src/Banner/banner-provider.js +95 -81
  11. package/src/Banner/banner.js +9 -9
  12. package/src/Banner/constants.js +4 -0
  13. package/src/Banner/display/banner-to-html.js +1 -1
  14. package/src/Banner/display/destroy-banner-html.js +3 -3
  15. package/src/Banner/display/detect-banner-impressions.js +14 -14
  16. package/src/Banner/get-all-banners.js +4 -4
  17. package/src/Banner/get-banner.js +5 -4
  18. package/src/Banner/log-banner-click.js +2 -2
  19. package/src/Banner/log-banner-impressions.js +6 -6
  20. package/src/Banner/request-banners-refresh.js +18 -20
  21. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  22. package/src/Banner/ui/insert-banner.js +17 -14
  23. package/src/Card/card-manager-factory.js +3 -3
  24. package/src/Card/card-manager.js +32 -32
  25. package/src/Card/constants.js +1 -0
  26. package/src/Card/display/card-display.js +11 -11
  27. package/src/Card/log-card-dismissal.js +2 -2
  28. package/src/Card/log-content-card-click.js +2 -2
  29. package/src/Card/log-content-card-impressions.js +5 -5
  30. package/src/Card/models/captioned-image.js +3 -3
  31. package/src/Card/models/card.js +16 -16
  32. package/src/Card/models/classic-card.js +3 -3
  33. package/src/Card/models/control-card.js +3 -3
  34. package/src/Card/models/image-only.js +3 -3
  35. package/src/Card/util/card-factory.js +6 -6
  36. package/src/ContentCards/content-cards-provider-factory.js +11 -11
  37. package/src/ContentCards/content-cards-provider.js +110 -96
  38. package/src/ContentCards/get-cached-content-cards.js +2 -2
  39. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  40. package/src/ContentCards/subscribe-to-content-cards-updates.js +5 -5
  41. package/src/ContentCards/ui/show-content-cards.js +5 -5
  42. package/src/Core/add-sdk-metadata.js +2 -2
  43. package/src/Core/change-user.js +4 -4
  44. package/src/Core/disable-sdk.js +9 -8
  45. package/src/Core/enable-sdk.js +5 -5
  46. package/src/Core/get-device-id.js +2 -2
  47. package/src/Core/handle-braze-action.js +3 -3
  48. package/src/Core/is-disabled.js +1 -1
  49. package/src/Core/log-custom-event.js +13 -13
  50. package/src/Core/log-purchase.js +10 -10
  51. package/src/Core/open-session.js +7 -7
  52. package/src/Core/set-sdk-authentication-signature.js +2 -2
  53. package/src/Core/wipe-data.js +6 -6
  54. package/src/DUST/dust-connection-core.js +23 -0
  55. package/src/DUST/dust-provider-factory.js +10 -8
  56. package/src/DUST/dust-provider.js +408 -176
  57. package/src/DUST/dust-shared-worker-code.js +2 -0
  58. package/src/DUST/dust-shared-worker-impl.js +240 -0
  59. package/src/DUST/dust-worker-bridge.js +136 -0
  60. package/src/DUST/index.js +10 -0
  61. package/src/DUST/subscribe-to-dust.js +13 -13
  62. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  63. package/src/FeatureFlags/feature-flag.js +6 -6
  64. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  65. package/src/FeatureFlags/feature-flags-provider.js +98 -84
  66. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  67. package/src/FeatureFlags/get-feature-flag.js +3 -3
  68. package/src/FeatureFlags/log-feature-flag-impression.js +7 -7
  69. package/src/FeatureFlags/refresh-feature-flags.js +2 -2
  70. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  71. package/src/InAppMessage/constants.js +4 -0
  72. package/src/InAppMessage/defer-in-app-message.js +2 -2
  73. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  74. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  75. package/src/InAppMessage/display/in-app-message-to-html.js +40 -40
  76. package/src/InAppMessage/display/modal-utils.js +16 -16
  77. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  78. package/src/InAppMessage/in-app-message-factory.js +4 -4
  79. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  80. package/src/InAppMessage/in-app-message-manager.js +97 -97
  81. package/src/InAppMessage/log-in-app-message-button-click.js +14 -14
  82. package/src/InAppMessage/log-in-app-message-click.js +13 -13
  83. package/src/InAppMessage/log-in-app-message-html-click.js +11 -11
  84. package/src/InAppMessage/log-in-app-message-impression.js +8 -8
  85. package/src/InAppMessage/models/control-message.js +5 -5
  86. package/src/InAppMessage/models/full-screen-message.js +18 -18
  87. package/src/InAppMessage/models/html-message.js +19 -19
  88. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  89. package/src/InAppMessage/models/in-app-message.js +121 -119
  90. package/src/InAppMessage/models/modal-message.js +18 -18
  91. package/src/InAppMessage/models/slide-up-message.js +23 -23
  92. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  93. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  94. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  95. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +8 -8
  96. package/src/InAppMessage/ui/show-in-app-message.js +34 -34
  97. package/src/Push/push-manager-factory.js +14 -14
  98. package/src/Push/push-manager.js +90 -90
  99. package/src/Push/request-push-permission.js +1 -1
  100. package/src/Push/unregister-push.js +1 -1
  101. package/src/Push/utils/push-utils.js +9 -9
  102. package/src/User/user-manager.js +32 -32
  103. package/src/User/user.js +71 -71
  104. package/src/common/constants.js +8 -11
  105. package/src/common/content-cards-display.js +32 -32
  106. package/src/common/event-logger.js +10 -10
  107. package/src/common/properties-base.js +16 -16
  108. package/src/l10n/l10n-manager-factory.js +11 -11
  109. package/src/l10n/l10n-manager.js +2 -2
  110. package/src/managers/auth-manager.js +14 -14
  111. package/src/managers/braze-instance.js +163 -159
  112. package/src/managers/device-manager.js +11 -11
  113. package/src/managers/network-manager.js +154 -154
  114. package/src/managers/server-config-manager.js +116 -88
  115. package/src/managers/session-manager.js +41 -41
  116. package/src/managers/storage-manager-factory.js +13 -13
  117. package/src/managers/storage-manager.js +130 -131
  118. package/src/managers/subscription-manager.js +12 -12
  119. package/src/managers/utils.js +1 -1
  120. package/src/models/backend-errors.js +5 -5
  121. package/src/models/braze-event.js +10 -10
  122. package/src/models/device.js +2 -2
  123. package/src/models/identifier.js +17 -17
  124. package/src/models/push-token.js +14 -14
  125. package/src/models/request-result.js +4 -4
  126. package/src/models/server-config.js +41 -37
  127. package/src/request-controller.js +163 -160
  128. package/src/triggers/models/custom-event-data.js +5 -5
  129. package/src/triggers/models/custom-event-property-data.js +6 -6
  130. package/src/triggers/models/filter-set.js +8 -8
  131. package/src/triggers/models/filter.js +7 -7
  132. package/src/triggers/models/in-app-message-click-data.js +13 -13
  133. package/src/triggers/models/purchase-data.js +2 -2
  134. package/src/triggers/models/purchase-property-data.js +6 -6
  135. package/src/triggers/models/push-click-data.js +6 -6
  136. package/src/triggers/models/trigger-condition.js +47 -47
  137. package/src/triggers/models/trigger-events.js +2 -2
  138. package/src/triggers/models/trigger.js +42 -42
  139. package/src/triggers/triggers-provider-factory.js +5 -5
  140. package/src/triggers/triggers-provider.js +66 -66
  141. package/src/ui/js/attach-css.js +3 -3
  142. package/src/ui/js/load-font-awesome.js +2 -2
  143. package/src/util/base-device-parser.js +8 -8
  144. package/src/util/braze-actions.js +5 -5
  145. package/src/util/browser-detector.js +33 -33
  146. package/src/util/client-hints-parser.js +10 -10
  147. package/src/util/component-utils.js +5 -5
  148. package/src/util/dom-utils.js +13 -13
  149. package/src/util/html-display-utils.js +7 -7
  150. package/src/util/key-codes.js +1 -1
  151. package/src/util/net.js +6 -6
  152. package/src/util/request-header-utils.js +26 -26
  153. package/src/util/user-agent-parser.js +20 -20
  154. package/src/util/validation-utils.js +16 -16
  155. package/src/util/window-utils.js +3 -3
@@ -1,15 +1,15 @@
1
1
  import { STORAGE_KEYS as s } from "./storage-manager.js";
2
- import u from "./subscription-manager.js";
3
- import { logger as E, IndexedDBAdapter as it } from "../../shared-lib/index.js";
4
- export default class Bt {
2
+ import m from "./subscription-manager.js";
3
+ import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
4
+ export default class kt {
5
5
  constructor(t, i, s) {
6
- (this.j = t),
6
+ (this.B = t),
7
7
  (this.gh = i),
8
8
  (this.ph = s),
9
- (this.j = t),
9
+ (this.B = t),
10
10
  (this.gh = i || !1),
11
11
  (this.ph = s),
12
- (this.Fh = new u()),
12
+ (this.Fh = new m()),
13
13
  (this.kh = 0),
14
14
  (this.fh = 1);
15
15
  }
@@ -17,21 +17,21 @@ export default class Bt {
17
17
  return this.gh;
18
18
  }
19
19
  jh() {
20
- return this.j.lt(s.ct.xh);
20
+ return this.B.dt(s.ft.xh);
21
21
  }
22
22
  setSdkAuthenticationSignature(t) {
23
23
  const i = this.jh();
24
- this.j.ft(s.ct.xh, t);
25
- const e = it.Us.Rs;
26
- new it(e, E).setItem(e.Fs.qh, this.fh, t), i !== t && this.Z();
24
+ this.B.bt(s.ft.xh, t);
25
+ const e = et.Us.Rs;
26
+ new et(e, E).setItem(e.Fs.qh, this.fh, t), i !== t && this.Z();
27
27
  }
28
28
  yh() {
29
- this.j.Nt(s.ct.xh);
30
- const t = it.Us.Rs;
31
- new it(t, E).be(t.Fs.qh, this.fh);
29
+ this.B.zt(s.ft.xh);
30
+ const t = et.Us.Rs;
31
+ new et(t, E).je(t.Fs.qh, this.fh);
32
32
  }
33
33
  subscribeToSdkAuthenticationFailures(t) {
34
- return this.ph.wt(t);
34
+ return this.ph.Rt(t);
35
35
  }
36
36
  Bh(t) {
37
37
  this.ph.L(t);
@@ -1,95 +1,96 @@
1
- import Bt from "./auth-manager.js";
1
+ import kt from "./auth-manager.js";
2
2
  import t from "../common/base-provider.js";
3
3
  import ro from "../util/browser-detector.js";
4
4
  import Ot from "./device-manager.js";
5
5
  import DeviceProperties from "../Core/device-properties.js";
6
6
  import {
7
- isArray as z,
7
+ isArray as R,
8
8
  keys as C,
9
9
  validateValueIsFromEnum as ta,
10
10
  values as Pt,
11
11
  } from "../util/code-utils.js";
12
12
  import Mt from "./network-manager.js";
13
13
  import Wt from "../request-controller.js";
14
- import Vt from "./server-config-manager.js";
15
- import Kt from "./session-manager.js";
14
+ import Bt from "./server-config-manager.js";
15
+ import Vt from "./session-manager.js";
16
16
  import ee, { STORAGE_KEYS as s } from "./storage-manager.js";
17
- import Gt from "./storage-manager-factory.js";
18
- import u from "./subscription-manager.js";
19
- import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js";
20
- import ir from "../DUST/dust-provider-factory.js";
21
- import { subscribeToDust as $t } from "../DUST/subscribe-to-dust.js";
17
+ import Kt from "./storage-manager-factory.js";
18
+ import m from "./subscription-manager.js";
19
+ import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
20
+ import nr from "../DUST/dust-provider-factory.js";
21
+ import { subscribeToDust as Gt } from "../DUST/subscribe-to-dust.js";
22
22
  import bt from "../User/user-manager.js";
23
23
  import { User } from "../User/index.js";
24
24
  import { parseQueryStringKeyValues as ll } from "../util/url-utils.js";
25
25
  import { WindowUtils as no } from "../util/window-utils.js";
26
- import { BRAZE_MUST_BE_INITIALIZED_ERROR as w } from "../common/constants.js";
27
- import { SupportedOptions as Jt, logger as E } from "../../shared-lib/index.js";
26
+ import { CoreStrings as z } from "../common/constants.js";
27
+ import { SupportedOptions as Yt, logger as E } from "../../shared-lib/index.js";
28
28
  import _t from "../models/identifier.js";
29
- const q = {
29
+ const D = {
30
30
  Ph: "allowCrawlerActivity",
31
31
  Wh: "baseUrl",
32
+ le: "cookieExpiryInDays",
32
33
  Vh: "noCookies",
33
34
  Kh: "devicePropertyAllowlist",
34
- Da: "disablePushTokenMaintenance",
35
- $h: "enableLogging",
36
- Yh: "enableSdkAuthentication",
37
- Ca: "manageServiceWorkerExternally",
35
+ Na: "disablePushTokenMaintenance",
36
+ Yh: "enableLogging",
37
+ $h: "enableSdkAuthentication",
38
+ La: "manageServiceWorkerExternally",
38
39
  Xh: "minimumIntervalBetweenTriggerActionsInSeconds",
39
40
  Zh: "sessionTimeoutInSeconds",
40
41
  Qh: "appVersion",
41
- Ia: "appVersionNumber",
42
- _a: "serviceWorkerLocation",
43
- Ba: "safariWebsitePushId",
44
- Ea: "localization",
42
+ Za: "appVersionNumber",
43
+ Ha: "serviceWorkerLocation",
44
+ Ka: "safariWebsitePushId",
45
+ Xa: "localization",
45
46
  er: "contentSecurityNonce",
46
- re: "allowUserSuppliedJavascript",
47
- Jo: "inAppMessageZIndex",
48
- To: "openInAppMessagesInNewTab",
47
+ te: "allowUserSuppliedJavascript",
48
+ $a: "inAppMessageZIndex",
49
+ Ja: "openInAppMessagesInNewTab",
49
50
  tn: "openCardsInNewTab",
50
51
  Oh: "requireExplicitInAppMessageDismissal",
51
- Na: "doNotLoadFontAwesome",
52
- Oa: "deviceId",
53
- Aa: "serviceWorkerScope",
54
- zi: "dustHost",
55
- Ta: "sdkFlavor",
52
+ tl: "doNotLoadFontAwesome",
53
+ il: "deviceId",
54
+ Ia: "serviceWorkerScope",
55
+ Te: "dustHost",
56
+ sl: "sdkFlavor",
56
57
  };
57
- class Yt {
58
+ class $t {
58
59
  constructor() {
59
- (this.Pn = ""),
60
- (this.Ra = ""),
61
- (this.Pa = void 0),
62
- (this.La = null),
63
- (this.Dn = null),
64
- (this.B = null),
65
- (this.au = null),
60
+ (this.tu = ""),
61
+ (this.rl = ""),
62
+ (this.hl = void 0),
63
+ (this.al = null),
64
+ (this.eu = null),
65
+ (this.j = null),
66
+ (this.Ru = null),
66
67
  (this.h = null),
67
68
  (this.C = null),
68
- (this.j = null),
69
- (this.Cs = null),
70
- (this.Ua = ""),
69
+ (this.B = null),
70
+ (this.vs = null),
71
+ (this.ul = ""),
71
72
  (this.isInitialized = !1),
72
- (this.Wa = !1),
73
- (this.Va = new u()),
74
- (this.Fa = new u()),
73
+ (this.cl = !1),
74
+ (this.fl = new m()),
75
+ (this.ml = new m()),
75
76
  (this.options = {}),
76
- (this.Ka = []),
77
- (this.Ga = []),
78
- (this.Mr = []),
79
- (this.Ra = "6.4.0");
77
+ (this.El = []),
78
+ (this.Il = []),
79
+ (this.vn = []),
80
+ (this.rl = "6.6.0");
80
81
  }
81
- $a(t) {
82
- this.Va.wt(t);
82
+ dl(t) {
83
+ this.fl.Rt(t);
83
84
  }
84
- Lh(t) {
85
- this.Fa.wt(t);
85
+ mh(t) {
86
+ this.ml.Rt(t);
86
87
  }
87
88
  initialize(t, i) {
88
89
  if (this.ao())
89
90
  return E.info("Braze has already been initialized with an API key."), !0;
90
91
  this.options = i || {};
91
- let e = this.ee(q.$h);
92
- const r = ll(no.Ha());
92
+ let e = this.re(D.Yh);
93
+ const r = ll(no._l());
93
94
  if (
94
95
  (r && "true" === r.brazeLogging && (e = !0),
95
96
  E.init(e),
@@ -99,8 +100,8 @@ class Yt {
99
100
  null == t || "" === t || "string" != typeof t)
100
101
  )
101
102
  return E.error("Braze requires a valid API key to be initialized."), !1;
102
- this.Pn = t;
103
- let o = this.ee(q.Wh);
103
+ this.tu = t;
104
+ let o = this.re(D.Wh);
104
105
  if (null == o || "" === o || "string" != typeof o)
105
106
  return E.error("Braze requires a valid baseUrl to be initialized."), !1;
106
107
  !1 === /^https?:/.test(o) && (o = `https://${o}`);
@@ -109,119 +110,122 @@ class Yt {
109
110
  ((o = document.createElement("a")),
110
111
  (o.href = n),
111
112
  "/" === o.pathname && (o = `${o}api/v3`),
112
- (this.Ua = o.toString()),
113
- ro.Ja && !this.ee(q.Ph))
113
+ (this.ul = o.toString()),
114
+ ro.gl && !this.re(D.Ph))
114
115
  )
115
116
  return (
116
117
  E.info("Ignoring activity from crawler bot " + navigator.userAgent),
117
- (this.Wa = !0),
118
+ (this.cl = !0),
118
119
  !1
119
120
  );
120
- const h = this.ee(q.Vh) || !1;
121
+ const h = this.re(D.Vh) || !1,
122
+ a = this.re(D.le);
121
123
  if (
122
- ((this.j = Gt.Ya(t, h)), h && this.j.Xa(t), new ee.ne(null, !0).jr(s.ie))
124
+ ((this.B = Kt.Sl(t, h, a)),
125
+ h && this.B.Al(t),
126
+ new ee.me(null, !0).jr(s.be))
123
127
  )
124
128
  return (
125
129
  E.info("Ignoring all activity due to previous opt out"),
126
- (this.Wa = !0),
130
+ (this.cl = !0),
127
131
  !1
128
132
  );
129
133
  for (const t of C(this.options))
130
- -1 === Pt(Jt).indexOf(t) &&
134
+ -1 === Pt(Yt).indexOf(t) &&
131
135
  E.warn(`Ignoring unknown initialization option '${t}'.`);
132
- const a = ["mparticle", "wordpress", "tealium"];
133
- if (null != this.ee(q.Ta)) {
134
- const t = this.ee(q.Ta);
135
- -1 !== a.indexOf(t)
136
- ? (this.Pa = t)
136
+ const l = ["mparticle", "wordpress", "tealium"];
137
+ if (null != this.re(D.sl)) {
138
+ const t = this.re(D.sl);
139
+ -1 !== l.indexOf(t)
140
+ ? (this.hl = t)
137
141
  : E.error("Invalid sdk flavor passed: " + t);
138
142
  }
139
- let l = this.ee(Jt.Kh);
140
- if (null != l)
141
- if (z(l)) {
143
+ let u = this.re(Yt.Kh);
144
+ if (null != u)
145
+ if (R(u)) {
142
146
  const t = [];
143
- for (let i = 0; i < l.length; i++)
147
+ for (let i = 0; i < u.length; i++)
144
148
  ta(
145
149
  DeviceProperties,
146
- l[i],
150
+ u[i],
147
151
  "devicePropertyAllowlist contained an invalid value.",
148
152
  "DeviceProperties",
149
- ) && t.push(l[i]);
150
- l = t;
153
+ ) && t.push(u[i]);
154
+ u = t;
151
155
  } else
152
156
  E.error(
153
157
  "devicePropertyAllowlist must be an array. Defaulting to all properties.",
154
158
  ),
155
- (l = null);
156
- const c = this.ee(q.Oa);
159
+ (u = null);
160
+ const c = this.re(D.il);
157
161
  if (c) {
158
162
  const t = new _t(c);
159
- this.j.uu(s.iu.Oa, t);
163
+ this.B.Iu(s.Ou.il, t);
160
164
  }
161
- (this.Dn = new Ot(this.j, l)),
162
- (this.h = new Vt(this.j)),
163
- (this.Cs = new bt(this.h, this.j)),
164
- (this.C = new Kt(this.j, this.Cs, this.h, this.ee(q.Zh)));
165
- const f = new u();
165
+ (this.eu = new Ot(this.B, u)),
166
+ (this.h = new Bt(this.B)),
167
+ (this.vs = new bt(this.h, this.B)),
168
+ (this.C = new Vt(this.B, this.vs, this.h, this.re(D.Zh)));
169
+ const f = new m();
166
170
  return (
167
- (this.La = new Bt(this.j, this.ee(q.Yh), f)),
171
+ (this.al = new kt(this.B, this.re(D.$h), f)),
168
172
  this.q(f),
169
- (this.B = new Mt(
170
- this.Dn,
171
- this.j,
172
- this.La,
173
- this.Cs,
173
+ (this.j = new Mt(
174
+ this.eu,
175
+ this.B,
176
+ this.al,
177
+ this.vs,
174
178
  this.C,
175
179
  this.h,
176
- this.Pn,
177
- this.Ua,
178
- this.Ra,
179
- this.Pa || "",
180
- this.ee(q.Qh),
181
- this.ee(q.Ia),
180
+ this.tu,
181
+ this.ul,
182
+ this.rl,
183
+ this.hl || "",
184
+ this.re(D.Qh),
185
+ this.re(D.Za),
182
186
  )),
183
- (this.au = new Wt(
184
- this.Pn,
185
- this.Ua,
187
+ (this.Ru = new Wt(
188
+ this.tu,
189
+ this.ul,
186
190
  this.C,
187
- this.Dn,
188
- this.Cs,
191
+ this.eu,
192
+ this.vs,
189
193
  this.h,
190
- this.j,
194
+ this.B,
191
195
  (t) => {
192
196
  if (this.ao()) for (const i of this.gr()) i.N(t);
193
197
  },
194
- this.La,
195
- this.B,
198
+ this.al,
199
+ this.j,
196
200
  )),
197
- this.au.initialize(),
198
- h || this.j.Za(),
201
+ this.Ru.initialize(),
202
+ h || this.B.Nl(),
199
203
  E.info(
200
- `Initialized for the Braze backend at "${this.ee(
201
- q.Wh,
202
- )}" with API key "${this.Pn}".`,
204
+ `Initialized for the Braze backend at "${this.re(
205
+ D.Wh,
206
+ )}" with API key "${this.tu}".`,
203
207
  ),
204
- ot.t(),
205
- $t(),
206
- this.h.$e(() => {
208
+ rt.t(),
209
+ Gt(),
210
+ this.h.jo(() => {
207
211
  var t;
208
212
  this.isInitialized &&
209
- (null === (t = this.h) || void 0 === t ? void 0 : t.Te()) &&
213
+ (null === (t = this.h) || void 0 === t ? void 0 : t.Yr()) &&
210
214
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
211
215
  if (!this.isInitialized) return;
212
216
  (0, t.default)();
213
217
  });
214
218
  }),
215
- this.au.rn(() => {
219
+ this.Ru.rn(() => {
216
220
  var t;
217
221
  this.isInitialized &&
218
- (null === (t = this.h) || void 0 === t ? void 0 : t.Te()) &&
222
+ (null === (t = this.h) || void 0 === t ? void 0 : t.Yr()) &&
219
223
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
220
224
  if (!this.isInitialized) return;
221
225
  (0, t.default)(void 0, void 0, !0);
222
226
  });
223
227
  }),
224
- this.Va.L(this.options),
228
+ this.fl.L(this.options),
225
229
  (this.isInitialized = !0),
226
230
  window.dispatchEvent(new CustomEvent("braze.initialized")),
227
231
  !0
@@ -229,55 +233,55 @@ class Yt {
229
233
  }
230
234
  destroy(t) {
231
235
  if ((E.destroy(), this.ao())) {
232
- this.Fa.L(), this.Fa.removeAllSubscriptions();
233
- for (const t of this.Ka) t.destroy();
234
- this.Ka = [];
235
- for (const t of this.Ga) t.clearData(!1);
236
- this.B && this.B.fo(),
237
- (this.Ga = []),
236
+ this.ml.L(), this.ml.removeAllSubscriptions();
237
+ for (const t of this.El) t.destroy();
238
+ this.El = [];
239
+ for (const t of this.Il) t.clearData(!1);
240
+ this.j && this.j.fo(),
241
+ (this.Il = []),
238
242
  this.removeAllSubscriptions(),
239
- (this.Mr = []),
240
- null != this.au && this.au.destroy(),
241
- (this.au = null),
242
- (this.La = null),
243
- (this.Dn = null),
244
- (this.B = null),
243
+ (this.vn = []),
244
+ null != this.Ru && this.Ru.destroy(),
245
+ (this.Ru = null),
246
+ (this.al = null),
247
+ (this.eu = null),
248
+ (this.j = null),
245
249
  (this.h = null),
246
250
  (this.C = null),
247
- (this.Cs = null),
251
+ (this.vs = null),
248
252
  (this.options = {}),
249
- (this.Pa = void 0),
253
+ (this.hl = void 0),
250
254
  (this.isInitialized = !1),
251
- (this.Wa = !1),
252
- t && (this.j = null);
255
+ (this.cl = !1),
256
+ t && (this.B = null);
253
257
  }
254
258
  }
255
259
  rr() {
256
- return !this.Qa() && (!!this.ao() || (console.warn(w), !1));
260
+ return !this.vl() && (!!this.ao() || (console.warn(z.ee), !1));
257
261
  }
258
- Ma() {
259
- return this.Pn;
262
+ _a() {
263
+ return this.tu;
260
264
  }
261
265
  Sr() {
262
- return this.La;
266
+ return this.al;
263
267
  }
264
268
  V() {
265
- return this.Ua;
269
+ return this.ul;
266
270
  }
267
- de() {
268
- return this.Dn;
271
+ ue() {
272
+ return this.eu;
269
273
  }
270
274
  m() {
271
- return this.B;
275
+ return this.j;
272
276
  }
273
- ee(t) {
277
+ re(t) {
274
278
  return this.options[t];
275
279
  }
276
280
  gr() {
277
- return this.Ga;
281
+ return this.Il;
278
282
  }
279
283
  nn() {
280
- return this.au;
284
+ return this.Ru;
281
285
  }
282
286
  l() {
283
287
  return this.h;
@@ -286,52 +290,52 @@ class Yt {
286
290
  return this.C;
287
291
  }
288
292
  p() {
289
- return this.j;
293
+ return this.B;
290
294
  }
291
295
  br() {
292
- if (this.Cs && this.au) return new User(this.Cs, this.au);
296
+ if (this.vs && this.Ru) return new User(this.vs, this.Ru);
293
297
  }
294
298
  ir() {
295
- return this.Cs;
299
+ return this.vs;
296
300
  }
297
301
  nr() {
298
- return !0 === this.ee(q.re);
302
+ return !0 === this.re(D.te);
299
303
  }
300
304
  g(t) {
301
305
  let i = !1;
302
- for (const s of this.Ka) s === t && (i = !0);
303
- i || this.Ka.push(t);
306
+ for (const s of this.El) s === t && (i = !0);
307
+ i || this.El.push(t);
304
308
  }
305
309
  v(i) {
306
310
  let s = !1;
307
- for (const t of this.Ga) t.constructor === i.constructor && (s = !0);
308
- i instanceof t && !s && this.Ga.push(i);
311
+ for (const t of this.Il) t.constructor === i.constructor && (s = !0);
312
+ i instanceof t && !s && this.Il.push(i);
309
313
  }
310
314
  q(t) {
311
- t instanceof u && this.Mr.push(t);
315
+ t instanceof m && this.vn.push(t);
312
316
  }
313
317
  removeAllSubscriptions() {
314
- if (this.rr()) for (const t of this.Mr) t.removeAllSubscriptions();
318
+ if (this.rr()) for (const t of this.vn) t.removeAllSubscriptions();
315
319
  }
316
320
  removeSubscription(t) {
317
- if (this.rr()) for (const i of this.Mr) i.removeSubscription(t);
321
+ if (this.rr()) for (const i of this.vn) i.removeSubscription(t);
318
322
  }
319
- ce(t) {
320
- this.Wa = t;
323
+ we(t) {
324
+ this.cl = t;
321
325
  }
322
326
  ao() {
323
327
  return this.isInitialized;
324
328
  }
325
- Qa() {
326
- return this.Wa;
329
+ vl() {
330
+ return this.cl;
327
331
  }
328
332
  tr(t, i) {
329
333
  if (!this.rr()) return null;
330
- return ir.o().Ki(t, i);
334
+ return nr.o().Ge(t, i);
331
335
  }
332
336
  Vs() {
333
- return this.Ra;
337
+ return this.rl;
334
338
  }
335
339
  }
336
- const r = new Yt();
337
- export { r as default, Yt as BrazeSdkInstance, q as OPTIONS };
340
+ const r = new $t();
341
+ export { r as default, $t as BrazeSdkInstance, D as OPTIONS };
@@ -1,23 +1,23 @@
1
1
  import ro from "../util/browser-detector.js";
2
- import Qt from "../models/device.js";
2
+ import Jt from "../models/device.js";
3
3
  import DeviceProperties from "../Core/device-properties.js";
4
4
  import _t from "../models/identifier.js";
5
- import { logger as E, Guid as L } from "../../shared-lib/index.js";
5
+ import { logger as E, Guid as P } from "../../shared-lib/index.js";
6
6
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
7
7
  import { values as Pt } from "../util/code-utils.js";
8
- import { getErrorMessage as si } from "../util/error-utils.js";
8
+ import { getErrorMessage as ai } from "../util/error-utils.js";
9
9
  export default class Ot {
10
10
  constructor(t, e) {
11
- (this.j = t),
11
+ (this.B = t),
12
12
  (this.tc = e),
13
- (this.j = t),
13
+ (this.B = t),
14
14
  null == e && (e = Pt(DeviceProperties)),
15
15
  (this.tc = e);
16
16
  }
17
- fe(t = !0) {
18
- let e = this.j.tu(s.iu.Oa);
19
- null == e && ((e = new _t(L.oe())), t && this.j.uu(s.iu.Oa, e));
20
- const r = new Qt(e.eu);
17
+ ve(t = !0) {
18
+ let e = this.B.$u(s.Ou.il);
19
+ null == e && ((e = new _t(P.se())), t && this.B.Iu(s.Ou.il, e));
20
+ const r = new Jt(e.Tu);
21
21
  for (let t = 0; t < this.tc.length; t++) {
22
22
  switch (this.tc[t]) {
23
23
  case DeviceProperties.BROWSER:
@@ -46,7 +46,7 @@ export default class Ot {
46
46
  }
47
47
  rc() {
48
48
  if (ro.nc()) return ro.nc();
49
- const t = this.j.lt(s.ct.ac);
49
+ const t = this.B.dt(s.ft.ac);
50
50
  return t && t.os_version ? t.os_version : ro.rc();
51
51
  }
52
52
  oc(t) {
@@ -60,7 +60,7 @@ export default class Ot {
60
60
  } catch (t) {
61
61
  E.info(
62
62
  "Intl.DateTimeFormat threw an error, cannot detect user's time zone:" +
63
- si(t),
63
+ ai(t),
64
64
  ),
65
65
  (e = !0);
66
66
  }