@braze/web-sdk 6.5.0 → 6.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 (153) hide show
  1. package/index.d.ts +258 -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 -25
  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 -8
  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/defer-in-app-message.js +1 -1
  68. package/src/InAppMessage/display/html-message-display-utils.js +15 -15
  69. package/src/InAppMessage/display/html-message-to-html.js +36 -37
  70. package/src/InAppMessage/display/in-app-message-to-html.js +44 -44
  71. package/src/InAppMessage/display/modal-utils.js +10 -14
  72. package/src/InAppMessage/in-app-message-factory.js +16 -20
  73. package/src/InAppMessage/in-app-message-manager.js +116 -117
  74. package/src/InAppMessage/log-in-app-message-button-click.js +8 -8
  75. package/src/InAppMessage/log-in-app-message-click.js +7 -7
  76. package/src/InAppMessage/log-in-app-message-html-click.js +8 -8
  77. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  78. package/src/InAppMessage/models/control-message.js +4 -4
  79. package/src/InAppMessage/models/full-screen-message.js +56 -49
  80. package/src/InAppMessage/models/html-message.js +31 -27
  81. package/src/InAppMessage/models/in-app-message-button.js +12 -12
  82. package/src/InAppMessage/models/in-app-message.js +202 -256
  83. package/src/InAppMessage/models/modal-message.js +55 -49
  84. package/src/InAppMessage/models/slide-up-message.js +57 -51
  85. package/src/InAppMessage/models/templated-in-app-message.js +10 -10
  86. package/src/InAppMessage/shared-types.js +1 -0
  87. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  88. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  89. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
  90. package/src/InAppMessage/ui/show-in-app-message.js +43 -41
  91. package/src/Push/is-push-blocked.js +2 -2
  92. package/src/Push/is-push-permission-granted.js +2 -2
  93. package/src/Push/is-push-supported.js +2 -2
  94. package/src/Push/push-manager-factory.js +9 -9
  95. package/src/Push/push-manager.js +15 -15
  96. package/src/Push/utils/push-utils.js +15 -15
  97. package/src/User/user-manager.js +14 -14
  98. package/src/User/user.js +60 -59
  99. package/src/common/base-provider.js +1 -1
  100. package/src/common/constants.js +2 -1
  101. package/src/common/content-cards-display.js +38 -38
  102. package/src/common/event-logger.js +8 -8
  103. package/src/l10n/l10n-manager-factory.js +9 -9
  104. package/src/l10n/l10n-manager.js +2 -2
  105. package/src/managers/auth-manager.js +31 -31
  106. package/src/managers/braze-instance.js +197 -182
  107. package/src/managers/constants.js +1 -0
  108. package/src/managers/device-manager.js +25 -25
  109. package/src/managers/network-manager.js +155 -155
  110. package/src/managers/server-config-manager.js +106 -93
  111. package/src/managers/session-manager.js +37 -33
  112. package/src/managers/storage-manager-factory.js +33 -28
  113. package/src/managers/storage-manager.js +194 -175
  114. package/src/managers/subscription-manager.js +13 -13
  115. package/src/managers/utils.js +1 -1
  116. package/src/models/backend-errors.js +5 -5
  117. package/src/models/braze-event.js +13 -13
  118. package/src/models/device.js +3 -3
  119. package/src/models/identifier.js +12 -12
  120. package/src/models/push-token.js +9 -9
  121. package/src/models/request-result.js +4 -4
  122. package/src/models/server-config.js +29 -38
  123. package/src/request-controller.js +159 -163
  124. package/src/triggers/models/custom-event-data.js +7 -7
  125. package/src/triggers/models/custom-event-property-data.js +10 -10
  126. package/src/triggers/models/filter-set.js +12 -12
  127. package/src/triggers/models/filter.js +66 -66
  128. package/src/triggers/models/in-app-message-click-data.js +13 -13
  129. package/src/triggers/models/purchase-data.js +4 -4
  130. package/src/triggers/models/purchase-property-data.js +10 -10
  131. package/src/triggers/models/push-click-data.js +8 -8
  132. package/src/triggers/models/trigger-condition.js +58 -58
  133. package/src/triggers/models/trigger-events.js +3 -3
  134. package/src/triggers/models/trigger.js +44 -44
  135. package/src/triggers/triggers-provider-factory.js +5 -5
  136. package/src/triggers/triggers-provider.js +70 -70
  137. package/src/ui/js/attach-css.js +3 -3
  138. package/src/ui/js/feed-css.js +2 -2
  139. package/src/ui/js/iam-css.js +2 -2
  140. package/src/ui/js/load-font-awesome.js +2 -2
  141. package/src/util/base-device-parser.js +9 -9
  142. package/src/util/braze-actions.js +3 -3
  143. package/src/util/browser-detector.js +37 -37
  144. package/src/util/client-hints-parser.js +9 -9
  145. package/src/util/component-utils.js +3 -3
  146. package/src/util/dom-utils.js +2 -2
  147. package/src/util/html-display-utils.js +11 -11
  148. package/src/util/key-codes.js +1 -1
  149. package/src/util/net.js +8 -8
  150. package/src/util/request-header-utils.js +25 -25
  151. package/src/util/user-agent-parser.js +20 -20
  152. package/src/util/validation-utils.js +21 -21
  153. package/src/util/window-utils.js +3 -3
@@ -1,98 +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 $t, 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
- Vh: "noCookies",
33
- Kh: "devicePropertyAllowlist",
34
- La: "disablePushTokenMaintenance",
35
- $h: "enableLogging",
36
- Yh: "enableSdkAuthentication",
37
- Ka: "manageServiceWorkerExternally",
38
- Xh: "minimumIntervalBetweenTriggerActionsInSeconds",
39
- Zh: "sessionTimeoutInSeconds",
40
- Qh: "appVersion",
41
- Xa: "appVersionNumber",
42
- Ga: "serviceWorkerLocation",
43
- Ia: "safariWebsitePushId",
44
- Wa: "localization",
45
- er: "contentSecurityNonce",
46
- te: "allowUserSuppliedJavascript",
47
- $a: "inAppMessageZIndex",
48
- 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",
49
50
  tn: "openCardsInNewTab",
50
- Oh: "requireExplicitInAppMessageDismissal",
51
- Za: "doNotLoadFontAwesome",
52
- tl: "deviceId",
53
- Ha: "serviceWorkerScope",
54
- Ne: "dustHost",
55
- il: "sdkFlavor",
51
+ oh: "requireExplicitInAppMessageDismissal",
52
+ Uh: "doNotLoadFontAwesome",
53
+ Wh: "deviceId",
54
+ ya: "serviceWorkerScope",
55
+ Qe: "dustHost",
56
+ Bh: "sdkFlavor",
56
57
  };
57
- class qt {
58
+ class li {
58
59
  constructor() {
59
60
  (this.tu = ""),
60
- (this.sl = ""),
61
- (this.rl = void 0),
62
- (this.hl = null),
61
+ (this.Vh = ""),
62
+ (this.Kh = void 0),
63
+ (this.Gh = null),
63
64
  (this.eu = null),
64
- (this.j = null),
65
+ (this.B = null),
65
66
  (this.Ru = null),
66
67
  (this.h = null),
68
+ (this.j = null),
67
69
  (this.C = null),
68
- (this.B = null),
69
- (this.vs = null),
70
- (this.al = ""),
70
+ (this.Ss = null),
71
+ (this.Yh = ""),
71
72
  (this.isInitialized = !1),
72
- (this.ul = !1),
73
- (this.cl = new m()),
74
- (this.fl = new m()),
73
+ (this.$h = !1),
74
+ (this.qh = new f()),
75
+ (this.Hh = new f()),
75
76
  (this.options = {}),
76
- (this.ml = []),
77
- (this.dl = []),
78
- (this.jn = []),
79
- (this.sl = "6.5.0");
77
+ (this.Jh = []),
78
+ (this.Xh = []),
79
+ (this.In = []),
80
+ (this.Vh = "6.7.0");
80
81
  }
81
- El(t) {
82
- this.cl.Rt(t);
82
+ Zh(t) {
83
+ this.qh.Kt(t);
83
84
  }
84
- mh(t) {
85
- this.fl.Rt(t);
85
+ uh(t) {
86
+ this.Hh.Kt(t);
86
87
  }
87
88
  initialize(t, i) {
89
+ var e, r, o;
88
90
  if (this.ao())
89
91
  return E.info("Braze has already been initialized with an API key."), !0;
90
92
  this.options = i || {};
91
- let e = this.re(D.$h);
92
- const r = ll(no.gl());
93
+ let n = this.er(U.Rh);
94
+ const h = lt(no.Qh());
93
95
  if (
94
- (r && "true" === r.brazeLogging && (e = !0),
95
- E.init(e),
96
+ (h && "true" === h.brazeLogging && (n = !0),
97
+ E.init(n),
96
98
  E.info(
97
99
  `Initialization Options: ${JSON.stringify(this.options, null, 2)}`,
98
100
  ),
@@ -100,113 +102,116 @@ class qt {
100
102
  )
101
103
  return E.error("Braze requires a valid API key to be initialized."), !1;
102
104
  this.tu = t;
103
- let o = this.re(D.Wh);
104
- if (null == o || "" === o || "string" != typeof o)
105
+ let l = this.er(U.Nh);
106
+ if (null == l || "" === l || "string" != typeof l)
105
107
  return E.error("Braze requires a valid baseUrl to be initialized."), !1;
106
- !1 === /^https?:/.test(o) && (o = `https://${o}`);
107
- const n = o;
108
+ !1 === /^https?:/.test(l) && (l = `https://${l}`);
109
+ const a = l;
108
110
  if (
109
- ((o = document.createElement("a")),
110
- (o.href = n),
111
- "/" === o.pathname && (o = `${o}api/v3`),
112
- (this.al = o.toString()),
113
- ro.Il && !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))
114
116
  )
115
117
  return (
116
118
  E.info("Ignoring activity from crawler bot " + navigator.userAgent),
117
- (this.ul = !0),
119
+ (this.$h = !0),
118
120
  !1
119
121
  );
120
- const h = this.re(D.Vh) || !1;
122
+ const u = this.er(U.Oh) || !1,
123
+ c = this.er(U.se),
124
+ m = Zt.sl();
121
125
  if (
122
- ((this.B = Kt._l(t, h)), h && this.B.Sl(t), new ee.le(null, !0).jr(s.pe))
126
+ ((this.C = Zt.rl(t, u, c)),
127
+ u && this.C.hl(t),
128
+ new ne.le(null, !0).wr(s.ce))
123
129
  )
124
130
  return (
125
131
  E.info("Ignoring all activity due to previous opt out"),
126
- (this.ul = !0),
132
+ (this.$h = !0),
127
133
  !1
128
134
  );
129
- for (const t of C(this.options))
130
- -1 === Pt($t).indexOf(t) &&
135
+ for (const t of D(this.options))
136
+ -1 === Wt(hi).indexOf(t) &&
131
137
  E.warn(`Ignoring unknown initialization option '${t}'.`);
132
- const a = ["mparticle", "wordpress", "tealium"];
133
- if (null != this.re(D.il)) {
134
- const t = this.re(D.il);
135
- -1 !== a.indexOf(t)
136
- ? (this.rl = 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)
137
143
  : E.error("Invalid sdk flavor passed: " + t);
138
144
  }
139
- let l = this.re($t.Kh);
140
- if (null != l)
141
- if (R(l)) {
145
+ let d = this.er(hi.Th);
146
+ if (null != d)
147
+ if (g(d)) {
142
148
  const t = [];
143
- for (let i = 0; i < l.length; i++)
149
+ for (let i = 0; i < d.length; i++)
144
150
  ta(
145
151
  DeviceProperties,
146
- l[i],
152
+ d[i],
147
153
  "devicePropertyAllowlist contained an invalid value.",
148
154
  "DeviceProperties",
149
- ) && t.push(l[i]);
150
- l = t;
155
+ ) && t.push(d[i]);
156
+ d = t;
151
157
  } else
152
158
  E.error(
153
159
  "devicePropertyAllowlist must be an array. Defaulting to all properties.",
154
160
  ),
155
- (l = null);
156
- const u = this.re(D.tl);
157
- if (u) {
158
- const t = new _t(u);
159
- this.B.Iu(s.Ou.tl, 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);
160
166
  }
161
- (this.eu = new Ot(this.B, l)),
162
- (this.h = new Bt(this.B)),
163
- (this.vs = new bt(this.h, this.B)),
164
- (this.C = new Vt(this.B, this.vs, this.h, this.re(D.Zh)));
165
- const c = new m();
166
- return (
167
- (this.hl = new kt(this.B, this.re(D.Yh), c)),
168
- this.q(c),
169
- (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(
170
175
  this.eu,
171
- this.B,
172
- this.hl,
173
- this.vs,
174
176
  this.C,
177
+ this.Gh,
178
+ this.Ss,
179
+ this.j,
175
180
  this.h,
176
181
  this.tu,
177
- this.al,
178
- this.sl,
179
- this.rl || "",
180
- this.re(D.Qh),
181
- this.re(D.Xa),
182
+ this.Yh,
183
+ this.Vh,
184
+ this.Kh || "",
185
+ this.er(U.yh),
186
+ this.er(U.Mh),
182
187
  )),
183
- (this.Ru = new Wt(
188
+ (this.Ru = new Kt(
184
189
  this.tu,
185
- this.al,
186
- this.C,
190
+ this.Yh,
191
+ this.j,
187
192
  this.eu,
188
- this.vs,
193
+ this.Ss,
189
194
  this.h,
190
- this.B,
195
+ this.C,
191
196
  (t) => {
192
- 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);
193
198
  },
194
- this.hl,
195
- this.j,
199
+ this.Gh,
200
+ this.B,
196
201
  )),
197
202
  this.Ru.initialize(),
198
- h || this.B.Al(),
203
+ u || this.C.ll(),
199
204
  E.info(
200
- `Initialized for the Braze backend at "${this.re(
201
- D.Wh,
205
+ `Initialized for the Braze backend at "${this.er(
206
+ U.Nh,
202
207
  )}" with API key "${this.tu}".`,
203
208
  ),
204
209
  rt.t(),
205
- Gt(),
206
- this.h.jo(() => {
210
+ Qt(),
211
+ this.h.bo(() => {
207
212
  var t;
208
213
  this.isInitialized &&
209
- (null === (t = this.h) || void 0 === t ? void 0 : t.Yr()) &&
214
+ (null === (t = this.h) || void 0 === t ? void 0 : t.lo()) &&
210
215
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
211
216
  if (!this.isInitialized) return;
212
217
  (0, t.default)();
@@ -215,66 +220,76 @@ class qt {
215
220
  this.Ru.rn(() => {
216
221
  var t;
217
222
  this.isInitialized &&
218
- (null === (t = this.h) || void 0 === t ? void 0 : t.Yr()) &&
223
+ (null === (t = this.h) || void 0 === t ? void 0 : t.lo()) &&
219
224
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
220
225
  if (!this.isInitialized) return;
221
226
  (0, t.default)(void 0, void 0, !0);
222
227
  });
223
228
  }),
224
- this.cl.L(this.options),
229
+ this.qh.A(this.options),
225
230
  (this.isInitialized = !0),
226
- 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(),
227
242
  !0
228
243
  );
229
244
  }
230
245
  destroy(t) {
231
246
  if ((E.destroy(), this.ao())) {
232
- this.fl.L(), this.fl.removeAllSubscriptions();
233
- for (const t of this.ml) t.destroy();
234
- this.ml = [];
235
- for (const t of this.dl) t.clearData(!1);
236
- this.j && this.j.fo(),
237
- (this.dl = []),
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 = []),
238
253
  this.removeAllSubscriptions(),
239
- (this.jn = []),
254
+ (this.In = []),
240
255
  null != this.Ru && this.Ru.destroy(),
241
256
  (this.Ru = null),
242
- (this.hl = null),
257
+ (this.Gh = null),
243
258
  (this.eu = null),
244
- (this.j = null),
259
+ (this.B = null),
245
260
  (this.h = null),
246
- (this.C = null),
247
- (this.vs = null),
261
+ (this.j = null),
262
+ (this.Ss = null),
248
263
  (this.options = {}),
249
- (this.rl = void 0),
264
+ (this.Kh = void 0),
250
265
  (this.isInitialized = !1),
251
- (this.ul = !1),
252
- t && (this.B = null);
266
+ (this.$h = !1),
267
+ t && (this.C = null);
253
268
  }
254
269
  }
255
270
  rr() {
256
- return !this.Nl() && (!!this.ao() || (console.warn(z.ee), !1));
271
+ return !this.cl() && (!!this.ao() || (console.warn(R.ee), !1));
257
272
  }
258
- _a() {
273
+ za() {
259
274
  return this.tu;
260
275
  }
261
- Sr() {
262
- return this.hl;
276
+ Br() {
277
+ return this.Gh;
263
278
  }
264
- V() {
265
- return this.al;
279
+ ht() {
280
+ return this.Yh;
266
281
  }
267
282
  ue() {
268
283
  return this.eu;
269
284
  }
270
285
  m() {
271
- return this.j;
286
+ return this.B;
272
287
  }
273
- re(t) {
288
+ er(t) {
274
289
  return this.options[t];
275
290
  }
276
- gr() {
277
- return this.dl;
291
+ vr() {
292
+ return this.Xh;
278
293
  }
279
294
  nn() {
280
295
  return this.Ru;
@@ -283,55 +298,55 @@ class qt {
283
298
  return this.h;
284
299
  }
285
300
  u() {
286
- return this.C;
301
+ return this.j;
287
302
  }
288
303
  p() {
289
- return this.B;
304
+ return this.C;
290
305
  }
291
- br() {
292
- 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);
293
308
  }
294
309
  ir() {
295
- return this.vs;
310
+ return this.Ss;
296
311
  }
297
- nr() {
298
- return !0 === this.re(D.te);
312
+ ar() {
313
+ return !0 === this.er(U.nr);
299
314
  }
300
315
  g(t) {
301
316
  let i = !1;
302
- for (const s of this.ml) s === t && (i = !0);
303
- i || this.ml.push(t);
317
+ for (const s of this.Jh) s === t && (i = !0);
318
+ i || this.Jh.push(t);
304
319
  }
305
320
  v(i) {
306
321
  let s = !1;
307
- for (const t of this.dl) t.constructor === i.constructor && (s = !0);
308
- i instanceof t && !s && this.dl.push(i);
322
+ for (const t of this.Xh) t.constructor === i.constructor && (s = !0);
323
+ i instanceof t && !s && this.Xh.push(i);
309
324
  }
310
- q(t) {
311
- t instanceof m && this.jn.push(t);
325
+ S(t) {
326
+ t instanceof f && this.In.push(t);
312
327
  }
313
328
  removeAllSubscriptions() {
314
- if (this.rr()) for (const t of this.jn) t.removeAllSubscriptions();
329
+ if (this.rr()) for (const t of this.In) t.removeAllSubscriptions();
315
330
  }
316
331
  removeSubscription(t) {
317
- if (this.rr()) for (const i of this.jn) i.removeSubscription(t);
332
+ if (this.rr()) for (const i of this.In) i.removeSubscription(t);
318
333
  }
319
- ge(t) {
320
- this.ul = t;
334
+ fe(t) {
335
+ this.$h = t;
321
336
  }
322
337
  ao() {
323
338
  return this.isInitialized;
324
339
  }
325
- Nl() {
326
- return this.ul;
340
+ cl() {
341
+ return this.$h;
327
342
  }
328
- tr(t, i) {
343
+ dr(t, i) {
329
344
  if (!this.rr()) return null;
330
- return nr.o().Be(t, i);
345
+ return sr.o().Ze(t, i);
331
346
  }
332
- Vs() {
333
- return this.sl;
347
+ zi() {
348
+ return this.Vh;
334
349
  }
335
350
  }
336
- const r = new qt();
337
- export { r as default, qt 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.tl);
19
- null == e && ((e = new _t(P.se())), t && this.B.Iu(s.Ou.tl, 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";