@braze/web-sdk 5.9.0 → 5.9.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.9.0
2
+ * Type definitions for @braze/web-sdk v5.9.1
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2025 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "5.9.0",
3
+ "version": "5.9.1",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  const d = {
2
2
  CustomEvent: "ce",
3
3
  Pr: "p",
4
- bc: "pc",
4
+ wc: "pc",
5
5
  Ac: "ca",
6
6
  Su: "i",
7
7
  qu: "ie",
@@ -16,12 +16,12 @@ const d = {
16
16
  Qi: "sbc",
17
17
  Mc: "sfe",
18
18
  Do: "iec",
19
- vc: "lr",
20
- fc: "uae",
19
+ bc: "lr",
20
+ vc: "uae",
21
21
  ss: "ci",
22
22
  Ot: "cc",
23
- yc: "lcaa",
24
- kc: "lcar",
23
+ Sc: "lcaa",
24
+ yc: "lcar",
25
25
  Hn: "inc",
26
26
  On: "add",
27
27
  Gn: "rem",
@@ -32,5 +32,5 @@ const d = {
32
32
  ro: "bi",
33
33
  ct: "bc",
34
34
  },
35
- dr = { Fr: "feed_displayed", Sc: "content_cards_displayed" };
35
+ dr = { Fr: "feed_displayed", Dc: "content_cards_displayed" };
36
36
  export { d as EventTypes, dr as InternalEventTypes };
@@ -24,13 +24,13 @@ const N = {
24
24
  },
25
25
  warn: function (n) {
26
26
  if (N.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v5.9.0)";
27
+ const o = "Braze SDK Warning: " + n + " (v5.9.1)";
28
28
  null != N.vd ? N.vd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
32
  if (N.zg) {
33
- const o = "Braze SDK Error: " + n + " (v5.9.0)";
33
+ const o = "Braze SDK Error: " + n + " (v5.9.1)";
34
34
  null != N.vd ? N.vd(o) : console.error(o);
35
35
  }
36
36
  },
@@ -74,7 +74,7 @@ class Vt {
74
74
  (this.Fa = []),
75
75
  (this.Ka = []),
76
76
  (this.Mi = []),
77
- (this.Ta = "5.9.0");
77
+ (this.Ta = "5.9.1");
78
78
  }
79
79
  Ga(t) {
80
80
  this.Wa.Dt(t);
@@ -38,7 +38,7 @@ export default class Qt {
38
38
  }
39
39
  bt() {
40
40
  return {
41
- s: "5.9.0",
41
+ s: "5.9.1",
42
42
  l: this.dl,
43
43
  e: this.Rl,
44
44
  a: this.Cl,
@@ -54,7 +54,7 @@ export default class Qt {
54
54
  static Rn(t) {
55
55
  let i = t.l;
56
56
  return (
57
- "5.9.0" !== t.s && (i = 0),
57
+ "5.9.1" !== t.s && (i = 0),
58
58
  new Qt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
59
59
  );
60
60
  }
@@ -122,16 +122,16 @@ export default class Lt {
122
122
  },
123
123
  });
124
124
  },
125
- p = this.Xl(d),
126
- v = i || p;
127
- if (this.Kl(u, p))
125
+ v = this.Xl(d),
126
+ p = i || v;
127
+ if (this.Kl(u, v))
128
128
  return void N.info(
129
129
  "Declining to flush data due to 50 consecutive authentication failures",
130
130
  );
131
- if (e && !this.S.yu(d, m, t, v))
131
+ if (e && !this.S.yu(d, m, t, p))
132
132
  return this.Zl(), void ("function" == typeof r && r(!0));
133
- const b = this.S.wu(t, v, d, m, c);
134
- v && this.Tl++;
133
+ const b = this.S.wu(t, p, d, m, c);
134
+ p && this.Tl++;
135
135
  let w = !1;
136
136
  if (b)
137
137
  for (const t of b)
@@ -144,7 +144,7 @@ export default class Lt {
144
144
  (w = !0);
145
145
  this.Pa.jh() && e && !w
146
146
  ? this.Zl()
147
- : p && (N.info("Invoking new session subscriptions"), this.Pl.X());
147
+ : v && (N.info("Invoking new session subscriptions"), this.Pl.X());
148
148
  }
149
149
  dc() {
150
150
  return this.Tl > 0;
@@ -218,6 +218,16 @@ export default class Lt {
218
218
  mc() {
219
219
  this.C.Ut(s.gt.Xe), this.C.Ut(s.gt.Hs), this.C.Ut(s.gt.Kr);
220
220
  }
221
+ fc() {
222
+ var t, i;
223
+ this.C.Ut(s.gt.Ku), this.C.Ut(s.gt.lE);
224
+ const e = h.O;
225
+ for (const i in e) {
226
+ const s = e[i];
227
+ this.S.Ou(s, null === (t = this.B) || void 0 === t ? void 0 : t.el(s));
228
+ }
229
+ this.S.xu(null === (i = this.B) || void 0 === i ? void 0 : i.Zu());
230
+ }
221
231
  changeUser(t, i, e) {
222
232
  const h = this.Cs.getUserId();
223
233
  if (h !== t) {
@@ -231,6 +241,7 @@ export default class Lt {
231
241
  null != h && this.C.Ut(s.gt.Zt),
232
242
  this.C.Ut(s.gt.oc),
233
243
  this.C.Ut(s.gt._E),
244
+ this.fc(),
234
245
  this.openSession(),
235
246
  N.info('Changed user to "' + t + '".');
236
247
  } else {
@@ -265,7 +276,7 @@ export default class Lt {
265
276
  this.Ql(void 0, !0, void 0, t, i);
266
277
  }
267
278
  Cn(t, i) {
268
- const e = d.fc,
279
+ const e = d.vc,
269
280
  h = { a: t, l: i },
270
281
  o = c.ut(e, h);
271
282
  return (
@@ -291,7 +302,7 @@ export default class Lt {
291
302
  null != e && (n.altitude = e),
292
303
  null != h && (n.ll_accuracy = h),
293
304
  null != o && (n.alt_accuracy = o);
294
- const r = c.ut(d.vc, n, t || void 0);
305
+ const r = c.ut(d.bc, n, t || void 0);
295
306
  return (
296
307
  r &&
297
308
  N.info(`Set user last known location as ${JSON.stringify(n, null, 2)}`),
@@ -300,14 +311,14 @@ export default class Lt {
300
311
  }
301
312
  lr(t, i) {
302
313
  const s = this.T.Qo();
303
- return new ve(this.Cs.getUserId(), d.bc, t, s, { cid: i });
314
+ return new ve(this.Cs.getUserId(), d.wc, t, s, { cid: i });
304
315
  }
305
- wc(t, i) {
316
+ kc(t, i) {
306
317
  return new st(t, i);
307
318
  }
308
319
  Qn() {
309
320
  const t = st.Ls.Fs;
310
- this.wc(t, N).setItem(t.Ms.Nu, 1, {
321
+ this.kc(t, N).setItem(t.Ms.Nu, 1, {
311
322
  baseUrl: this.baseUrl,
312
323
  data: { api_key: this.an, device_id: this.hn.ve().id },
313
324
  userId: this.Cs.getUserId(),
@@ -330,8 +341,8 @@ export default class Lt {
330
341
  let e, h;
331
342
  return (
332
343
  null === i && null === s
333
- ? ((e = d.kc), (h = { key: t }))
334
- : ((e = d.yc), (h = { key: t, latitude: i, longitude: s })),
344
+ ? ((e = d.yc), (h = { key: t }))
345
+ : ((e = d.Sc), (h = { key: t, latitude: i, longitude: s })),
335
346
  c.ut(e, h)
336
347
  );
337
348
  }
@@ -1,7 +1,7 @@
1
1
  import r, { OPTIONS as w } from "../../managers/braze-instance.js";
2
2
  export function attachCSS(n, t, o) {
3
3
  const c = n || document.querySelector("head"),
4
- e = `ab-${t}-css-definitions-${"5.9.0".replace(/\./g, "-")}`;
4
+ e = `ab-${t}-css-definitions-${"5.9.1".replace(/\./g, "-")}`;
5
5
  if (!c) return;
6
6
  const s = c.ownerDocument || document;
7
7
  if (null == s.getElementById(e)) {