@braze/web-sdk 6.6.0 → 6.7.1

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