@braze/web-sdk 5.0.0 → 5.0.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.
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v5.0.0
2
+ * Type definitions for @braze/web-sdk v5.0.1
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2023 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
@@ -2389,6 +2389,8 @@ export type InitializationOptions = {
2389
2389
  /**
2390
2390
  * A numerical app version value which can be used for user segmentation. This value must be sent with four fields, such as
2391
2391
  * "1.2.3.4", otherwise it will be ignored.
2392
+ *
2393
+ * Note: `appVersion` must also be set, either with the same value or a unique name for this version.
2392
2394
  */
2393
2395
  appVersionNumber?: string;
2394
2396
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -24,13 +24,13 @@ const Ue = {
24
24
  },
25
25
  warn: function (n) {
26
26
  if (Ue.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v5.0.0)";
27
+ const o = "Braze SDK Warning: " + n + " (v5.0.1)";
28
28
  null != Ue.j ? Ue.j(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
32
  if (Ue.zg) {
33
- const o = "Braze SDK Error: " + n + " (v5.0.0)";
33
+ const o = "Braze SDK Error: " + n + " (v5.0.1)";
34
34
  null != Ue.j ? Ue.j(o) : console.error(o);
35
35
  }
36
36
  },
@@ -71,7 +71,7 @@ class Bt {
71
71
  (this.Go = []),
72
72
  (this.Ko = []),
73
73
  (this.Ve = []),
74
- (this.jo = "5.0.0");
74
+ (this.jo = "5.0.1");
75
75
  }
76
76
  $o(t) {
77
77
  this.zo.It(t);
@@ -187,6 +187,7 @@ class Bt {
187
187
  this.$t,
188
188
  )),
189
189
  this.ki.initialize(),
190
+ a || this.u.Ho(),
190
191
  r.j.info(
191
192
  `Initialized for the Braze backend at "${this.nn(
192
193
  L._o,
@@ -241,7 +242,7 @@ class Bt {
241
242
  }
242
243
  }
243
244
  rr() {
244
- return !this.Ho() && (!!this.fe() || (console.warn(P), !1));
245
+ return !this.Xo() && (!!this.fe() || (console.warn(P), !1));
245
246
  }
246
247
  Ma() {
247
248
  return this.cn;
@@ -310,7 +311,7 @@ class Bt {
310
311
  fe() {
311
312
  return this.Bo;
312
313
  }
313
- Ho() {
314
+ Xo() {
314
315
  return this.Wo;
315
316
  }
316
317
  As() {
@@ -15,8 +15,8 @@ export default class Ot {
15
15
  (this.Qo = e);
16
16
  }
17
17
  ce(t = !0) {
18
- let e = this.u.tu(i.eu.Xo);
19
- null == e && ((e = new _t(r.Z.Y())), t && this.u.uu(i.eu.Xo, e));
18
+ let e = this.u.tu(i.eu.Zo);
19
+ null == e && ((e = new _t(r.Z.Y())), t && this.u.uu(i.eu.Zo, e));
20
20
  const s = new xt(e.iu);
21
21
  for (let t = 0; t < this.Qo.length; t++) {
22
22
  switch (this.Qo[t]) {
@@ -24,19 +24,19 @@ export default class Ot {
24
24
  s.browser = Q.browser;
25
25
  break;
26
26
  case DeviceProperties.BROWSER_VERSION:
27
- s.Zo = Q.version;
27
+ s.Ia = Q.version;
28
28
  break;
29
29
  case DeviceProperties.OS:
30
- s.os = this.Ia();
30
+ s.os = this.Ta();
31
31
  break;
32
32
  case DeviceProperties.RESOLUTION:
33
- s.Ta = screen.width + "x" + screen.height;
33
+ s.Da = screen.width + "x" + screen.height;
34
34
  break;
35
35
  case DeviceProperties.LANGUAGE:
36
36
  s.language = Q.language;
37
37
  break;
38
38
  case DeviceProperties.TIME_ZONE:
39
- s.timeZone = this.Da(new Date());
39
+ s.timeZone = this.Oa(new Date());
40
40
  break;
41
41
  case DeviceProperties.USER_AGENT:
42
42
  s.userAgent = Q.userAgent;
@@ -44,12 +44,12 @@ export default class Ot {
44
44
  }
45
45
  return s;
46
46
  }
47
- Ia() {
48
- if (Q.Oa()) return Q.Oa();
49
- const t = this.u.v(i.k.Ca);
50
- return t && t.os_version ? t.os_version : Q.Ia();
47
+ Ta() {
48
+ if (Q.Ca()) return Q.Ca();
49
+ const t = this.u.v(i.k.Fa);
50
+ return t && t.os_version ? t.os_version : Q.Ta();
51
51
  }
52
- Da(t) {
52
+ Oa(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 s = t.getTimezoneOffset();
69
- return this.Fa(s);
69
+ return this.Ga(s);
70
70
  }
71
- Fa(t) {
71
+ Ga(t) {
72
72
  const e = Math.trunc(t / 60),
73
73
  r = Math.trunc(t % 60);
74
74
  let s = "GMT";
@@ -41,7 +41,7 @@ export default class Rt {
41
41
  Bs(t, e = !1, s = !1) {
42
42
  const r = this.fn.ce(!s),
43
43
  o = r.Kr(),
44
- n = this.u.v(i.k.Ca);
44
+ n = this.u.v(i.k.Fa);
45
45
  ii(n, o) || (t.device = o),
46
46
  (t.api_key = this.cn),
47
47
  (t.time = h(new Date().valueOf(), !0));
@@ -24,12 +24,12 @@ const Mt = {
24
24
  } catch (e) {
25
25
  r.j.info("Local Storage not supported!");
26
26
  }
27
- const a = Mt.Ga(),
28
- n = new J.Ja(e, a && !o, t);
27
+ const a = Mt.Ja(),
28
+ n = new J.Va(e, a && !o, t);
29
29
  let c;
30
- return (c = t ? new J.Va(e) : new J.Ya()), new J(n, c);
30
+ return (c = t ? new J.Ya(e) : new J.Za()), new J(n, c);
31
31
  },
32
- Ga: function () {
32
+ Ja: function () {
33
33
  return (
34
34
  navigator.cookieEnabled ||
35
35
  ("cookie" in document &&
@@ -13,15 +13,15 @@ import { getErrorMessage as ei } from "../util/error-utils.js";
13
13
  export const STORAGE_KEYS = {
14
14
  eu: {
15
15
  su: "ab.storage.userId",
16
- Xo: "ab.storage.deviceId",
16
+ Zo: "ab.storage.deviceId",
17
17
  Dl: "ab.storage.sessionId",
18
18
  },
19
19
  k: {
20
20
  Qa: "ab.test",
21
- Za: "ab.storage.events",
22
- tE: "ab.storage.attributes",
23
- eE: "ab.storage.attributes.anonymous_user",
24
- Ca: "ab.storage.device",
21
+ tE: "ab.storage.events",
22
+ eE: "ab.storage.attributes",
23
+ sE: "ab.storage.attributes.anonymous_user",
24
+ Fa: "ab.storage.device",
25
25
  Kh: "ab.storage.sdk_metadata",
26
26
  Wh: "ab.storage.session_id_for_cached_metadata",
27
27
  Bn: "ab.storage.pushToken",
@@ -29,8 +29,8 @@ export const STORAGE_KEYS = {
29
29
  Ei: "ab.storage.lastNewsFeedRefresh",
30
30
  L: "ab.storage.cardImpressions",
31
31
  hl: "ab.storage.serverConfig",
32
- sE: "ab.storage.triggers",
33
- rE: "ab.storage.triggers.ts",
32
+ rE: "ab.storage.triggers",
33
+ oE: "ab.storage.triggers.ts",
34
34
  zl: "ab.storage.messagingSessionStart",
35
35
  gs: "ab.storage.cc",
36
36
  js: "ab.storage.ccLastFullSync",
@@ -40,24 +40,24 @@ export const STORAGE_KEYS = {
40
40
  C: "ab.storage.ccClicks",
41
41
  K: "ab.storage.ccImpressions",
42
42
  G: "ab.storage.ccDismissals",
43
- oE: "ab.storage.lastDisplayedTriggerTimesById",
44
- nE: "ab.storage.lastDisplayedTriggerTime",
45
- iE: "ab.storage.triggerFireInstancesById",
43
+ nE: "ab.storage.lastDisplayedTriggerTimesById",
44
+ iE: "ab.storage.lastDisplayedTriggerTime",
45
+ aE: "ab.storage.triggerFireInstancesById",
46
46
  xh: "ab.storage.signature",
47
47
  zs: "ab.storage.brazeSyncRetryCount",
48
48
  Us: "ab.storage.sdkVersion",
49
49
  Ri: "ab.storage.ff",
50
50
  qi: "ab.storage.ffImpressions",
51
51
  Ui: "ab.storage.ffLastRefreshAt",
52
- aE: "ab.storage.lastReqToEndpoint",
53
- EE: "ab.storage.requestAttempts",
52
+ EE: "ab.storage.lastReqToEndpoint",
53
+ lE: "ab.storage.requestAttempts",
54
54
  rn: "ab.storage.deferredIam",
55
55
  },
56
56
  re: "ab.optOut",
57
57
  };
58
58
  export default class J {
59
59
  constructor(t, e) {
60
- (this.lE = t), (this.SE = e), (this.lE = t), (this.SE = e);
60
+ (this.SE = t), (this._E = e), (this.SE = t), (this._E = e);
61
61
  }
62
62
  Jo(t) {
63
63
  const e = oo(STORAGE_KEYS.eu),
@@ -66,39 +66,46 @@ export default class J {
66
66
  }
67
67
  uu(t, e) {
68
68
  let s = null;
69
- null != e && e instanceof _t && (s = e.tt()), this.lE.store(t, s);
69
+ null != e && e instanceof _t && (s = e.tt()), this.SE.store(t, s);
70
70
  }
71
- _E(t) {
71
+ uE(t) {
72
72
  const e = this.tu(t);
73
73
  null != e && ((e.Nl = new Date().valueOf()), this.uu(t, e));
74
74
  }
75
75
  tu(t) {
76
- return _t.Yn(this.lE.jr(t));
76
+ return _t.Yn(this.SE.jr(t));
77
77
  }
78
78
  ql(t) {
79
- this.lE.remove(t);
79
+ this.SE.remove(t);
80
+ }
81
+ Ho() {
82
+ const t = oo(STORAGE_KEYS.eu);
83
+ let e;
84
+ for (const s of t)
85
+ (e = this.tu(STORAGE_KEYS.eu[s])),
86
+ null != e && this.uu(STORAGE_KEYS.eu[s], e);
80
87
  }
81
88
  bo(t) {
82
89
  let e;
83
90
  if (null == t || 0 === t.length) return !1;
84
91
  e = p(t) ? t : [t];
85
- let s = this.SE.jr(STORAGE_KEYS.k.Za);
92
+ let s = this._E.jr(STORAGE_KEYS.k.tE);
86
93
  (null != s && p(s)) || (s = []);
87
94
  for (let t = 0; t < e.length; t++) s.push(e[t].tt());
88
- return this.SE.store(STORAGE_KEYS.k.Za, s);
95
+ return this._E.store(STORAGE_KEYS.k.tE, s);
89
96
  }
90
97
  Hl(t) {
91
98
  return null != t && this.bo([t]);
92
99
  }
93
- uE() {
94
- let t = this.SE.jr(STORAGE_KEYS.k.Za);
95
- this.SE.remove(STORAGE_KEYS.k.Za), null == t && (t = []);
100
+ cE() {
101
+ let t = this._E.jr(STORAGE_KEYS.k.tE);
102
+ this._E.remove(STORAGE_KEYS.k.tE), null == t && (t = []);
96
103
  const e = [];
97
104
  let s = !1,
98
105
  o = null;
99
106
  if (p(t))
100
107
  for (let s = 0; s < t.length; s++)
101
- ue.cE(t[s]) ? e.push(ue.Yn(t[s])) : (o = s);
108
+ ue.TE(t[s]) ? e.push(ue.Yn(t[s])) : (o = s);
102
109
  else s = !0;
103
110
  if (s || null != o) {
104
111
  let n = "Stored events could not be deserialized as Events";
@@ -122,7 +129,7 @@ export default class J {
122
129
  t,
123
130
  "StorageManager cannot store object.",
124
131
  "STORAGE_KEYS.OBJECTS",
125
- ) && this.SE.store(t, e)
132
+ ) && this._E.store(t, e)
126
133
  );
127
134
  }
128
135
  v(t) {
@@ -132,7 +139,7 @@ export default class J {
132
139
  t,
133
140
  "StorageManager cannot retrieve object.",
134
141
  "STORAGE_KEYS.OBJECTS",
135
- ) && this.SE.jr(t)
142
+ ) && this._E.jr(t)
136
143
  );
137
144
  }
138
145
  ni(t) {
@@ -142,7 +149,7 @@ export default class J {
142
149
  t,
143
150
  "StorageManager cannot remove object.",
144
151
  "STORAGE_KEYS.OBJECTS",
145
- ) && (this.SE.remove(t), !0)
152
+ ) && (this._E.remove(t), !0)
146
153
  );
147
154
  }
148
155
  clearData() {
@@ -150,20 +157,20 @@ export default class J {
150
157
  e = oo(STORAGE_KEYS.k);
151
158
  for (let e = 0; e < t.length; e++) {
152
159
  const s = t[e];
153
- this.lE.remove(STORAGE_KEYS.eu[s]);
160
+ this.SE.remove(STORAGE_KEYS.eu[s]);
154
161
  }
155
162
  for (let t = 0; t < e.length; t++) {
156
163
  const s = e[t];
157
- this.SE.remove(STORAGE_KEYS.k[s]);
164
+ this._E.remove(STORAGE_KEYS.k[s]);
158
165
  }
159
166
  }
160
- TE(t) {
161
- return t || STORAGE_KEYS.k.eE;
167
+ hE(t) {
168
+ return t || STORAGE_KEYS.k.sE;
162
169
  }
163
170
  Ha(t) {
164
- let e = this.SE.jr(STORAGE_KEYS.k.tE);
171
+ let e = this._E.jr(STORAGE_KEYS.k.eE);
165
172
  null == e && (e = {});
166
- const s = this.TE(t[User.bu]),
173
+ const s = this.hE(t[User.bu]),
167
174
  r = e[s];
168
175
  for (const o in t)
169
176
  o !== User.bu &&
@@ -171,61 +178,61 @@ export default class J {
171
178
  this.mu(t[User.bu], o, t[o]);
172
179
  }
173
180
  mu(t, e, s) {
174
- let r = this.SE.jr(STORAGE_KEYS.k.tE);
181
+ let r = this._E.jr(STORAGE_KEYS.k.eE);
175
182
  null == r && (r = {});
176
- const o = this.TE(t);
183
+ const o = this.hE(t);
177
184
  let n = r[o];
178
185
  if (
179
186
  (null == n && ((n = {}), null != t && (n[User.bu] = t)), e === User.lu)
180
187
  ) {
181
188
  null == n[e] && (n[e] = {});
182
189
  for (const t in s) n[e][t] = s[t];
183
- } else null != s && (n[e] = s);
184
- return (r[o] = n), this.SE.store(STORAGE_KEYS.k.tE, r);
190
+ } else n[e] = s;
191
+ return (r[o] = n), this._E.store(STORAGE_KEYS.k.eE, r);
185
192
  }
186
- hE() {
187
- const t = this.SE.jr(STORAGE_KEYS.k.tE);
188
- this.SE.remove(STORAGE_KEYS.k.tE);
193
+ AE() {
194
+ const t = this._E.jr(STORAGE_KEYS.k.eE);
195
+ this._E.remove(STORAGE_KEYS.k.eE);
189
196
  const e = [];
190
197
  for (const s in t) null != t[s] && e.push(t[s]);
191
198
  return e;
192
199
  }
193
200
  ou(t) {
194
- const e = this.SE.jr(STORAGE_KEYS.k.tE);
201
+ const e = this._E.jr(STORAGE_KEYS.k.eE);
195
202
  if (null != e) {
196
- const s = this.TE(null),
203
+ const s = this.hE(null),
197
204
  r = e[s];
198
205
  null != r &&
199
206
  ((e[s] = void 0),
200
- this.SE.store(STORAGE_KEYS.k.tE, e),
207
+ this._E.store(STORAGE_KEYS.k.eE, e),
201
208
  (r[User.bu] = t),
202
209
  this.Ha(r));
203
210
  }
204
211
  const s = this.tu(STORAGE_KEYS.eu.Dl);
205
212
  let r = null;
206
213
  null != s && (r = s.iu);
207
- const o = this.uE();
214
+ const o = this.cE();
208
215
  if (null != o)
209
216
  for (let e = 0; e < o.length; e++) {
210
217
  const s = o[e];
211
218
  null == s.userId && s.sessionId == r && (s.userId = t), this.Hl(s);
212
219
  }
213
220
  }
214
- AE() {
215
- return this.SE.RE;
221
+ RE() {
222
+ return this._E.OE;
216
223
  }
217
224
  }
218
- (J.Va = class {
225
+ (J.Ya = class {
219
226
  constructor(t) {
220
- (this.cn = t), (this.cn = t), (this.RE = Q.gE() ? 3 : 10);
227
+ (this.cn = t), (this.cn = t), (this.OE = Q.gE() ? 3 : 10);
221
228
  }
222
- OE(t) {
229
+ dE(t) {
223
230
  return t + "." + this.cn;
224
231
  }
225
232
  store(t, e) {
226
233
  const s = { v: e };
227
234
  try {
228
- return localStorage.setItem(this.OE(t), JSON.stringify(s)), !0;
235
+ return localStorage.setItem(this.dE(t), JSON.stringify(s)), !0;
229
236
  } catch (t) {
230
237
  return r.j.info("Storage failure: " + ei(t)), !1;
231
238
  }
@@ -233,7 +240,7 @@ export default class J {
233
240
  jr(t) {
234
241
  try {
235
242
  let e = null;
236
- const s = localStorage.getItem(this.OE(t));
243
+ const s = localStorage.getItem(this.dE(t));
237
244
  return null != s && (e = JSON.parse(s)), null == e ? null : e.v;
238
245
  } catch (t) {
239
246
  return r.j.info("Storage retrieval failure: " + ei(t)), null;
@@ -241,30 +248,30 @@ export default class J {
241
248
  }
242
249
  remove(t) {
243
250
  try {
244
- localStorage.removeItem(this.OE(t));
251
+ localStorage.removeItem(this.dE(t));
245
252
  } catch (t) {
246
253
  return r.j.info("Storage removal failure: " + ei(t)), !1;
247
254
  }
248
255
  }
249
256
  }),
250
- (J.Ya = class {
257
+ (J.Za = class {
251
258
  constructor() {
252
- (this.dE = {}), (this.fE = 5242880), (this.RE = 3);
259
+ (this.fE = {}), (this.bE = 5242880), (this.OE = 3);
253
260
  }
254
261
  store(t, e) {
255
262
  const s = { value: e },
256
- o = this.bE(e);
257
- return o > this.fE
263
+ o = this.IE(e);
264
+ return o > this.bE
258
265
  ? (r.j.info(
259
266
  "Storage failure: object is ≈" +
260
267
  o +
261
268
  " bytes which is greater than the max of " +
262
- this.fE,
269
+ this.bE,
263
270
  ),
264
271
  !1)
265
- : ((this.dE[t] = s), !0);
272
+ : ((this.fE[t] = s), !0);
266
273
  }
267
- bE(t) {
274
+ IE(t) {
268
275
  const e = [],
269
276
  s = [t];
270
277
  let r = 0;
@@ -282,26 +289,26 @@ export default class J {
282
289
  return r;
283
290
  }
284
291
  jr(t) {
285
- const e = this.dE[t];
292
+ const e = this.fE[t];
286
293
  return null == e ? null : e.value;
287
294
  }
288
295
  remove(t) {
289
- this.dE[t] = null;
296
+ this.fE[t] = null;
290
297
  }
291
298
  }),
292
299
  (J.ee = class {
293
300
  constructor(t, e) {
294
301
  (this.cn = t),
295
- (this.IE = e),
302
+ (this.mE = e),
296
303
  (this.cn = t),
297
- (this.mE = this.KE()),
298
- (this.YE = 576e3),
299
- (this.IE = !!e);
304
+ (this.KE = this.YE()),
305
+ (this.NE = 576e3),
306
+ (this.mE = !!e);
300
307
  }
301
- OE(t) {
308
+ dE(t) {
302
309
  return null != this.cn ? t + "." + this.cn : t;
303
310
  }
304
- KE() {
311
+ YE() {
305
312
  let t = 0,
306
313
  e = document.location.hostname;
307
314
  const s = e.split("."),
@@ -318,9 +325,9 @@ export default class J {
318
325
  }
319
326
  ae() {
320
327
  const t = new Date();
321
- return t.setTime(t.getTime() + 60 * this.YE * 1e3), t.getFullYear();
328
+ return t.setTime(t.getTime() + 60 * this.NE * 1e3), t.getFullYear();
322
329
  }
323
- NE() {
330
+ DE() {
324
331
  const t = Pt(STORAGE_KEYS.eu),
325
332
  e = document.cookie.split(";");
326
333
  for (let s = 0; s < e.length; s++) {
@@ -334,19 +341,19 @@ export default class J {
334
341
  }
335
342
  if (o) {
336
343
  const t = r.split("=")[0];
337
- -1 === t.indexOf("." + this.cn) && this.DE(t);
344
+ -1 === t.indexOf("." + this.cn) && this.GE(t);
338
345
  }
339
346
  }
340
347
  }
341
348
  store(t, e) {
342
- this.NE();
349
+ this.DE();
343
350
  const s = new Date();
344
- s.setTime(s.getTime() + 60 * this.YE * 1e3);
351
+ s.setTime(s.getTime() + 60 * this.NE * 1e3);
345
352
  const o = "expires=" + s.toUTCString(),
346
- n = "domain=" + this.mE;
353
+ n = "domain=" + this.KE;
347
354
  let i;
348
- i = this.IE ? e : encodeURIComponent(JSON.stringify(e));
349
- const a = this.OE(t) + "=" + i + ";" + o + ";" + n + ";path=/";
355
+ i = this.mE ? e : encodeURIComponent(JSON.stringify(e));
356
+ const a = this.dE(t) + "=" + i + ";" + o + ";" + n + ";path=/";
350
357
  return a.length >= 4093
351
358
  ? (r.j.info(
352
359
  "Storage failure: string is " +
@@ -358,7 +365,7 @@ export default class J {
358
365
  }
359
366
  jr(t) {
360
367
  const e = [],
361
- s = this.OE(t) + "=",
368
+ s = this.dE(t) + "=",
362
369
  o = document.cookie.split(";");
363
370
  for (let n = 0; n < o.length; n++) {
364
371
  let i = o[n];
@@ -366,7 +373,7 @@ export default class J {
366
373
  if (0 === i.indexOf(s))
367
374
  try {
368
375
  let t;
369
- (t = this.IE
376
+ (t = this.mE
370
377
  ? i.substring(s.length, i.length)
371
378
  : JSON.parse(
372
379
  decodeURIComponent(i.substring(s.length, i.length)),
@@ -383,22 +390,22 @@ export default class J {
383
390
  return e.length > 0 ? e[e.length - 1] : null;
384
391
  }
385
392
  remove(t) {
386
- this.DE(this.OE(t));
393
+ this.GE(this.dE(t));
387
394
  }
388
- DE(t) {
395
+ GE(t) {
389
396
  const e = t + "=;expires=" + new Date(0).toUTCString();
390
397
  (document.cookie = e), (document.cookie = e + ";path=/");
391
- const s = e + ";domain=" + this.mE;
398
+ const s = e + ";domain=" + this.KE;
392
399
  (document.cookie = s), (document.cookie = s + ";path=/");
393
400
  }
394
401
  }),
395
- (J.Ja = class {
402
+ (J.Va = class {
396
403
  constructor(t, e, s) {
397
404
  (this.cn = t),
398
405
  (this.CE = []),
399
406
  e && this.CE.push(new J.ee(t)),
400
- s && this.CE.push(new J.Va(t)),
401
- this.CE.push(new J.Ya());
407
+ s && this.CE.push(new J.Ya(t)),
408
+ this.CE.push(new J.Za());
402
409
  }
403
410
  store(t, e) {
404
411
  let s = !0;
@@ -38,7 +38,7 @@ export default class ue {
38
38
  static fromJson(t) {
39
39
  return new ue(t.user_id, t.name, t.time, t.session_id, t.data);
40
40
  }
41
- static cE(t) {
41
+ static TE(t) {
42
42
  return null != t && Nt(t) && null != t.t && "" !== t.t;
43
43
  }
44
44
  static Yn(t) {
@@ -6,7 +6,7 @@ export default class xt {
6
6
  const s = {};
7
7
  return (
8
8
  null != this.browser && (s.browser = this.browser),
9
- null != this.Zo && (s.browser_version = this.Zo),
9
+ null != this.Ia && (s.browser_version = this.Ia),
10
10
  null != this.os && (s.os_version = this.os),
11
11
  null != this.resolution && (s.resolution = this.resolution),
12
12
  null != this.language && (s.locale = this.language),
@@ -28,7 +28,7 @@ export default class Kt {
28
28
  }
29
29
  tt() {
30
30
  return {
31
- s: "5.0.0",
31
+ s: "5.0.1",
32
32
  l: this.ol,
33
33
  e: this.cl,
34
34
  a: this.gl,
@@ -42,7 +42,7 @@ export default class Kt {
42
42
  static Yn(t) {
43
43
  let i = t.l;
44
44
  return (
45
- "5.0.0" !== t.s && (i = 0), new Kt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
45
+ "5.0.1" !== t.s && (i = 0), new Kt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
46
46
  );
47
47
  }
48
48
  }
@@ -23,7 +23,7 @@ export default class Lt {
23
23
  (this.cn = t),
24
24
  (this.baseUrl = i),
25
25
  (this.gu = 0),
26
- (this.RE = n.AE() || 0),
26
+ (this.OE = n.RE() || 0),
27
27
  (this.vu = null),
28
28
  (this._e = s),
29
29
  (this.fn = e),
@@ -54,8 +54,8 @@ export default class Lt {
54
54
  }
55
55
  qu(t = !1, s = !1, e = !0, h, o, n, u = !1, l = !1) {
56
56
  e && this.Au();
57
- const a = this.u.uE(),
58
- c = this.u.hE();
57
+ const a = this.u.cE(),
58
+ c = this.u.AE();
59
59
  let d = !1;
60
60
  const f = (t, s) => {
61
61
  let r = !1;
@@ -73,7 +73,7 @@ export default class Lt {
73
73
  this.yt.ul(e),
74
74
  (null != t.respond_with &&
75
75
  t.respond_with.user_id != this.wt.getUserId()) ||
76
- (null != t.device && this.u.D(i.k.Ca, t.device),
76
+ (null != t.device && this.u.D(i.k.Fa, t.device),
77
77
  null != t.sdk_metadata &&
78
78
  (this.u.D(i.k.Kh, t.sdk_metadata),
79
79
  this.u.D(i.k.Wh, this._e.Yh())),
@@ -95,8 +95,8 @@ export default class Lt {
95
95
  else {
96
96
  T.hi(this.u, T.Os.Na);
97
97
  let t = this.vu;
98
- (null == t || t < 1e3 * this.RE) && (t = 1e3 * this.RE),
99
- this.Cu(Math.min(3e5, D(1e3 * this.RE, 3 * t)));
98
+ (null == t || t < 1e3 * this.OE) && (t = 1e3 * this.OE),
99
+ this.Cu(Math.min(3e5, D(1e3 * this.OE, 3 * t)));
100
100
  }
101
101
  d = !0;
102
102
  }
@@ -124,7 +124,7 @@ export default class Lt {
124
124
  Du() {
125
125
  return this.gu > 0;
126
126
  }
127
- Cu(t = 1e3 * this.RE) {
127
+ Cu(t = 1e3 * this.OE) {
128
128
  this.ju ||
129
129
  (this.Au(),
130
130
  (this.ku = window.setTimeout(() => {
@@ -158,7 +158,7 @@ export default class Lt {
158
158
  }
159
159
  openSession() {
160
160
  const t = this._e.Yh() !== this._e.co();
161
- t && (this.u._E(i.eu.Xo), this.u._E(i.eu.su)),
161
+ t && (this.u.uE(i.eu.Zo), this.u.uE(i.eu.su)),
162
162
  this.qu(void 0, !1, void 0, void 0, void 0),
163
163
  this.pu(),
164
164
  t &&
@@ -201,7 +201,7 @@ export default class Lt {
201
201
  e ? this.Mo.setSdkAuthenticationSignature(e) : this.Mo.yh();
202
202
  for (let t = 0; t < s.length; t++) s[t].changeUser(null == h);
203
203
  null != h && this.u.ni(i.k.L),
204
- this.u.ni(i.k.Ca),
204
+ this.u.ni(i.k.Fa),
205
205
  this.openSession(),
206
206
  r.j.info('Changed user to "' + t + '".');
207
207
  } else {
@@ -37,9 +37,9 @@ export default class gr extends y {
37
37
  }
38
38
  fg() {
39
39
  if (this.u) {
40
- (this.hg = this.u.v(i.k.nE) || this.hg),
41
- (this.ng = this.u.v(i.k.iE) || this.ng),
42
- (this.og = this.u.v(i.k.oE) || this.og);
40
+ (this.hg = this.u.v(i.k.iE) || this.hg),
41
+ (this.ng = this.u.v(i.k.aE) || this.ng),
42
+ (this.og = this.u.v(i.k.nE) || this.og);
43
43
  for (let t = 0; t < this.triggers.length; t++) {
44
44
  const i = this.triggers[t];
45
45
  i.id && null != this.og[i.id] && i.Wu(this.og[i.id]);
@@ -48,8 +48,8 @@ export default class gr extends y {
48
48
  }
49
49
  lg() {
50
50
  if (!this.u) return;
51
- this.ag = this.u.v(i.k.rE) || 0;
52
- const t = this.u.v(i.k.sE) || [],
51
+ this.ag = this.u.v(i.k.oE) || 0;
52
+ const t = this.u.v(i.k.rE) || [],
53
53
  s = [];
54
54
  for (let i = 0; i < t.length; i++) s.push(pt.Yn(t[i]));
55
55
  (this.triggers = s), this.fg();
@@ -76,7 +76,7 @@ export default class gr extends y {
76
76
  let t, r;
77
77
  h.push(n),
78
78
  null != n.ug && (t = n.ug),
79
- null != n.dg && ue.cE(n.dg) && (r = ue.Yn(n.dg));
79
+ null != n.dg && ue.TE(n.dg) && (r = ue.Yn(n.dg));
80
80
  const a = [];
81
81
  if (n.pg && p(n.pg))
82
82
  for (let t = 0; t < n.pg.length; t++) {
@@ -92,7 +92,7 @@ export default class gr extends y {
92
92
  0 === this.ng[i.id].length && delete this.ng[i.id]);
93
93
  }
94
94
  }
95
- r && this.u && this.u.D(i.k.iE, this.ng);
95
+ r && this.u && this.u.D(i.k.aE, this.ng);
96
96
  }
97
97
  mg() {
98
98
  if (!this.u) return;
@@ -100,12 +100,12 @@ export default class gr extends y {
100
100
  for (let i = 0; i < this.triggers.length; i++)
101
101
  t.push(this.triggers[i].tt());
102
102
  (this.ag = new Date().valueOf()),
103
- this.u.D(i.k.sE, t),
104
- this.u.D(i.k.rE, this.ag);
103
+ this.u.D(i.k.rE, t),
104
+ this.u.D(i.k.oE, this.ag);
105
105
  }
106
106
  bg() {
107
107
  if (!this.u) return;
108
- (this.u.v(i.k.rE) || 0) > this.ag ? this.lg() : this.fg();
108
+ (this.u.v(i.k.oE) || 0) > this.ag ? this.lg() : this.fg();
109
109
  }
110
110
  Ss(t) {
111
111
  let s = !1;
@@ -129,8 +129,8 @@ export default class gr extends y {
129
129
  this.triggers.push(r);
130
130
  }
131
131
  }
132
- ii(this.og, e) || ((this.og = e), this.u && this.u.D(i.k.oE, this.og)),
133
- ii(this.ng, h) || ((this.ng = h), this.u && this.u.D(i.k.iE, this.ng)),
132
+ ii(this.og, e) || ((this.og = e), this.u && this.u.D(i.k.nE, this.og)),
133
+ ii(this.ng, h) || ((this.ng = h), this.u && this.u.D(i.k.aE, this.ng)),
134
134
  this.mg(),
135
135
  s &&
136
136
  (r.j.info("Trigger with test condition found, firing test."),
@@ -281,11 +281,11 @@ export default class gr extends y {
281
281
  ));
282
282
  }
283
283
  changeUser(t = !1) {
284
- if (((this.triggers = []), this.u && this.u.ni(i.k.sE), !t)) {
284
+ if (((this.triggers = []), this.u && this.u.ni(i.k.rE), !t)) {
285
285
  (this.sg = []), (this.hg = null), (this.og = {}), (this.ng = {});
286
286
  for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
287
287
  (this.eg = []),
288
- this.u && (this.u.ni(i.k.nE), this.u.ni(i.k.oE), this.u.ni(i.k.iE));
288
+ this.u && (this.u.ni(i.k.iE), this.u.ni(i.k.nE), this.u.ni(i.k.aE));
289
289
  }
290
290
  }
291
291
  clearData() {
@@ -314,13 +314,13 @@ export default class gr extends y {
314
314
  for (const t of h) t.id && a.push(t.id);
315
315
  (n.pg = a),
316
316
  t.id && this.ng[t.id].push(n),
317
- this.u && this.u.D(i.k.iE, this.ng);
317
+ this.u && this.u.D(i.k.aE, this.ng);
318
318
  }
319
319
  yg(t, s) {
320
320
  this.fg(),
321
321
  t.Wu(s),
322
322
  (this.hg = s),
323
323
  t.id && (this.og[t.id] = s),
324
- this.u && (this.u.D(i.k.nE, s), this.u.D(i.k.oE, this.og));
324
+ this.u && (this.u.D(i.k.iE, s), this.u.D(i.k.nE, this.og));
325
325
  }
326
326
  }
@@ -1,7 +1,7 @@
1
1
  import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  export function attachCSS(n, t, o) {
3
3
  const c = n || document.querySelector("head"),
4
- s = `ab-${t}-css-definitions-${"5.0.0".replace(/\./g, "-")}`;
4
+ s = `ab-${t}-css-definitions-${"5.0.1".replace(/\./g, "-")}`;
5
5
  if (!c) return;
6
6
  const a = c.ownerDocument || document;
7
7
  if (null == a.getElementById(s)) {
@@ -3,7 +3,7 @@ export default class ge {
3
3
  constructor() {}
4
4
  tf() {}
5
5
  ef() {}
6
- Ia(t) {}
6
+ Ta(t) {}
7
7
  static rf(t, e) {
8
8
  if (t && e)
9
9
  if (((t = t.toLowerCase()), p(e.if))) {
@@ -9,7 +9,7 @@ class gi {
9
9
  (this.browser = this.Sg.tf()),
10
10
  (this.version = this.Sg.ef()),
11
11
  (this.OS = null),
12
- this.Ia().then((t) => (this.OS = t));
12
+ this.Ta().then((t) => (this.OS = t));
13
13
  const i = navigator;
14
14
  (this.language = (
15
15
  i.userLanguage ||
@@ -23,13 +23,13 @@ class gi {
23
23
  gE() {
24
24
  return this.browser === oi.Bg;
25
25
  }
26
- Oa() {
26
+ Ca() {
27
27
  return this.OS || null;
28
28
  }
29
- Ia() {
29
+ Ta() {
30
30
  return this.OS
31
31
  ? Promise.resolve(this.OS)
32
- : this.Sg.Ia(gi.Og).then((t) => ((this.OS = t), t));
32
+ : this.Sg.Ta(gi.Og).then((t) => ((this.OS = t), t));
33
33
  }
34
34
  static vg(t) {
35
35
  t = t.toLowerCase();
@@ -21,7 +21,7 @@ export default class ni extends ge {
21
21
  ef() {
22
22
  return this.version;
23
23
  }
24
- Ia(t) {
24
+ Ta(t) {
25
25
  if (this.OS) return Promise.resolve(this.OS);
26
26
  const s = (s) => {
27
27
  for (let r = 0; r < t.length; r++) {
@@ -3,16 +3,16 @@ import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
3
3
  const T = {
4
4
  Os: { Na: "d", Ks: "cc", Si: "ff", Lr: "t" },
5
5
  rm: (e) => {
6
- if (e) return e.v(i.k.aE);
6
+ if (e) return e.v(i.k.EE);
7
7
  },
8
8
  sm: (e) => {
9
- if (e) return e.v(i.k.EE);
9
+ if (e) return e.v(i.k.lE);
10
10
  },
11
11
  nm: (e, t) => {
12
- e && e.D(i.k.aE, t);
12
+ e && e.D(i.k.EE, t);
13
13
  },
14
14
  um: (e, t) => {
15
- e && e.D(i.k.EE, t);
15
+ e && e.D(i.k.lE, t);
16
16
  },
17
17
  La: (e, t) => {
18
18
  if (!e || !t) return -1;
@@ -10,7 +10,7 @@ export default class ai extends ge {
10
10
  ef() {
11
11
  return this.rd[1] || "Unknown Version";
12
12
  }
13
- Ia(r) {
13
+ Ta(r) {
14
14
  for (let n = 0; n < r.length; n++) {
15
15
  const e = r[n].string;
16
16
  let i = ai.rf(e, r[n]);