@braze/web-sdk 5.1.1 → 5.2.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 (76) hide show
  1. package/index.d.ts +14 -8
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +18 -18
  5. package/shared-lib/indexed-db-adapter.js +32 -32
  6. package/shared-lib/logger.js +2 -2
  7. package/shared-lib/supported-options.js +22 -21
  8. package/src/InAppMessage/display/html-message-to-html.js +38 -35
  9. package/src/InAppMessage/display/in-app-message-to-html.js +2 -2
  10. package/src/InAppMessage/display/modal-utils.js +2 -2
  11. package/src/InAppMessage/in-app-message-factory.js +21 -19
  12. package/src/InAppMessage/in-app-message-manager.js +58 -78
  13. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  14. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  15. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  16. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  17. package/src/InAppMessage/models/control-message.js +4 -2
  18. package/src/InAppMessage/models/full-screen-message.js +5 -2
  19. package/src/InAppMessage/models/html-message.js +6 -4
  20. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  21. package/src/InAppMessage/models/in-app-message.js +51 -46
  22. package/src/InAppMessage/models/modal-message.js +5 -2
  23. package/src/InAppMessage/models/slide-up-message.js +33 -8
  24. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  25. package/src/InAppMessage/ui/show-in-app-message.js +28 -34
  26. package/src/InAppMessage/utils/in-app-message-utils.js +18 -1
  27. package/src/Push/push-manager-factory.js +3 -3
  28. package/src/Push/push-manager.js +118 -110
  29. package/src/Push/utils/push-utils.js +4 -4
  30. package/src/User/user-manager.js +4 -4
  31. package/src/User/user.js +17 -17
  32. package/src/common/base-feed.js +1 -1
  33. package/src/common/feed-display.js +12 -12
  34. package/src/l10n/l10n-manager-factory.js +1 -1
  35. package/src/l10n/l10n-manager.js +4 -4
  36. package/src/managers/auth-manager.js +26 -26
  37. package/src/managers/braze-instance.js +59 -52
  38. package/src/managers/device-manager.js +15 -15
  39. package/src/managers/network-manager.js +98 -93
  40. package/src/managers/server-config-manager.js +9 -9
  41. package/src/managers/storage-manager.js +99 -96
  42. package/src/managers/utils.js +6 -0
  43. package/src/models/backend-errors.js +5 -5
  44. package/src/models/braze-event.js +20 -12
  45. package/src/models/device.js +3 -3
  46. package/src/models/identifier.js +33 -19
  47. package/src/models/push-token.js +4 -4
  48. package/src/models/server-config.js +6 -6
  49. package/src/request-controller.js +76 -73
  50. package/src/triggers/models/custom-event-data.js +2 -2
  51. package/src/triggers/models/custom-event-property-data.js +4 -4
  52. package/src/triggers/models/filter-set.js +5 -5
  53. package/src/triggers/models/filter.js +6 -6
  54. package/src/triggers/models/in-app-message-click-data.js +1 -1
  55. package/src/triggers/models/purchase-data.js +2 -2
  56. package/src/triggers/models/purchase-property-data.js +4 -4
  57. package/src/triggers/models/push-click-data.js +1 -1
  58. package/src/triggers/models/trigger-condition.js +41 -41
  59. package/src/triggers/models/trigger-events.js +1 -1
  60. package/src/triggers/models/trigger.js +36 -36
  61. package/src/triggers/triggers-provider-factory.js +1 -1
  62. package/src/triggers/triggers-provider.js +71 -82
  63. package/src/ui/js/attach-css.js +2 -2
  64. package/src/ui/js/load-font-awesome.js +1 -1
  65. package/src/util/base-device-parser.js +1 -1
  66. package/src/util/braze-actions.js +4 -4
  67. package/src/util/browser-detector.js +9 -8
  68. package/src/util/client-hints-parser.js +1 -1
  69. package/src/util/component-utils.js +2 -2
  70. package/src/util/device-constants.js +2 -2
  71. package/src/util/key-codes.js +1 -1
  72. package/src/util/net.js +1 -1
  73. package/src/util/request-header-utils.js +6 -6
  74. package/src/util/user-agent-parser.js +5 -5
  75. package/src/util/validation-utils.js +2 -0
  76. package/src/util/window-utils.js +3 -3
@@ -1,9 +1,9 @@
1
- import Zt from "./custom-event-data.js";
2
- import is from "./custom-event-property-data.js";
3
- import ts from "./filter-set.js";
1
+ import ts from "./custom-event-data.js";
2
+ import rs from "./custom-event-property-data.js";
3
+ import is from "./filter-set.js";
4
4
  import ni from "./in-app-message-click-data.js";
5
- import rs from "./purchase-data.js";
6
- import ns from "./purchase-property-data.js";
5
+ import ns from "./purchase-data.js";
6
+ import hs from "./purchase-property-data.js";
7
7
  import ur from "./push-click-data.js";
8
8
  import tt from "./trigger-events.js";
9
9
  import { logger as r } from "../../../shared-lib/index.js";
@@ -15,7 +15,7 @@ export default class ri {
15
15
  sc(e, t) {
16
16
  return ri.cc[this.type] === e && (null == this.data || this.data.Jl(t));
17
17
  }
18
- static Ku(e, t) {
18
+ static Gu(e, t) {
19
19
  let s = null;
20
20
  try {
21
21
  s = window.atob(e);
@@ -28,25 +28,25 @@ export default class ri {
28
28
  const t = e.type;
29
29
  let r = null;
30
30
  switch (t) {
31
- case ri.Kr.OPEN:
32
- case ri.Kr.kt:
31
+ case ri.Or.OPEN:
32
+ case ri.Or.kt:
33
33
  break;
34
- case ri.Kr.Rr:
35
- r = rs.fromJson(e.data);
36
- break;
37
- case ri.Kr.nc:
34
+ case ri.Or.Rr:
38
35
  r = ns.fromJson(e.data);
39
36
  break;
40
- case ri.Kr.vr:
37
+ case ri.Or.nc:
38
+ r = hs.fromJson(e.data);
39
+ break;
40
+ case ri.Or.vr:
41
41
  r = ur.fromJson(e.data);
42
42
  break;
43
- case ri.Kr.ue:
44
- r = Zt.fromJson(e.data);
43
+ case ri.Or.ue:
44
+ r = ts.fromJson(e.data);
45
45
  break;
46
- case ri.Kr.lc:
47
- r = is.fromJson(e.data);
46
+ case ri.Or.lc:
47
+ r = rs.fromJson(e.data);
48
48
  break;
49
- case ri.Kr.mo:
49
+ case ri.Or.Zr:
50
50
  r = ni.fromJson(e.data);
51
51
  }
52
52
  return new ri(t, r);
@@ -54,50 +54,50 @@ export default class ri {
54
54
  Y() {
55
55
  return { t: this.type, d: this.data ? this.data.Y() : null };
56
56
  }
57
- static En(e) {
57
+ static qn(e) {
58
58
  let t,
59
59
  r = null;
60
60
  switch (e.t) {
61
- case ri.Kr.OPEN:
62
- case ri.Kr.kt:
61
+ case ri.Or.OPEN:
62
+ case ri.Or.kt:
63
63
  break;
64
- case ri.Kr.Rr:
65
- r = new rs(e.d);
64
+ case ri.Or.Rr:
65
+ r = new ns(e.d);
66
66
  break;
67
- case ri.Kr.nc:
68
- (t = e.d || {}), (r = new ns(t.id, ts.En(t.pf || [])));
67
+ case ri.Or.nc:
68
+ (t = e.d || {}), (r = new hs(t.id, is.qn(t.pf || [])));
69
69
  break;
70
- case ri.Kr.vr:
70
+ case ri.Or.vr:
71
71
  r = new ur(e.d);
72
72
  break;
73
- case ri.Kr.ue:
74
- r = new Zt(e.d);
73
+ case ri.Or.ue:
74
+ r = new ts(e.d);
75
75
  break;
76
- case ri.Kr.lc:
77
- (t = e.d || {}), (r = new is(t.e, ts.En(t.pf || [])));
76
+ case ri.Or.lc:
77
+ (t = e.d || {}), (r = new rs(t.e, is.qn(t.pf || [])));
78
78
  break;
79
- case ri.Kr.mo:
79
+ case ri.Or.Zr:
80
80
  r = new ni(e.d);
81
81
  }
82
82
  return new ri(e.t, r);
83
83
  }
84
84
  }
85
- (ri.Kr = {
85
+ (ri.Or = {
86
86
  OPEN: "open",
87
87
  Rr: "purchase",
88
88
  nc: "purchase_property",
89
89
  vr: "push_click",
90
90
  ue: "custom_event",
91
91
  lc: "custom_event_property",
92
- mo: "iam_click",
92
+ Zr: "iam_click",
93
93
  kt: "test",
94
94
  }),
95
95
  (ri.cc = {}),
96
- (ri.cc[ri.Kr.OPEN] = tt.OPEN),
97
- (ri.cc[ri.Kr.Rr] = tt.Rr),
98
- (ri.cc[ri.Kr.nc] = tt.Rr),
99
- (ri.cc[ri.Kr.vr] = tt.vr),
100
- (ri.cc[ri.Kr.ue] = tt.ue),
101
- (ri.cc[ri.Kr.lc] = tt.ue),
102
- (ri.cc[ri.Kr.mo] = tt.mo),
103
- (ri.cc[ri.Kr.kt] = tt.kt);
96
+ (ri.cc[ri.Or.OPEN] = tt.OPEN),
97
+ (ri.cc[ri.Or.Rr] = tt.Rr),
98
+ (ri.cc[ri.Or.nc] = tt.Rr),
99
+ (ri.cc[ri.Or.vr] = tt.vr),
100
+ (ri.cc[ri.Or.ue] = tt.ue),
101
+ (ri.cc[ri.Or.lc] = tt.ue),
102
+ (ri.cc[ri.Or.Zr] = tt.Zr),
103
+ (ri.cc[ri.Or.kt] = tt.kt);
@@ -3,6 +3,6 @@ export default {
3
3
  Rr: "purchase",
4
4
  vr: "push_click",
5
5
  ue: "custom_event",
6
- mo: "iam_click",
6
+ Zr: "iam_click",
7
7
  kt: "test",
8
8
  };
@@ -5,55 +5,55 @@ import {
5
5
  import { logger as r } from "../../../shared-lib/index.js";
6
6
  import ri from "./trigger-condition.js";
7
7
  import { validateValueIsFromEnum as J } from "../../util/code-utils.js";
8
- export default class pt {
9
- constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = pt.Vu, a, u, d) {
8
+ export default class mt {
9
+ constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = mt.Vu, a, u, d) {
10
10
  (this.id = t),
11
- (this.Wu = i),
11
+ (this.Ku = i),
12
12
  (this.startTime = s),
13
13
  (this.endTime = e),
14
14
  (this.priority = r),
15
15
  (this.type = h),
16
16
  (this.data = l),
17
- (this.Yu = o),
18
- (this.Zu = n),
19
- (this.Vr = a),
20
- (this.td = u),
21
- (this.sd = d),
17
+ (this.Wu = o),
18
+ (this.Yu = n),
19
+ (this.Kr = a),
20
+ (this.Zu = u),
21
+ (this.td = d),
22
22
  (this.id = t),
23
- (this.Wu = i || []),
23
+ (this.Ku = i || []),
24
24
  void 0 === s && (s = null),
25
25
  (this.startTime = s),
26
26
  void 0 === e && (e = null),
27
27
  (this.endTime = e),
28
28
  (this.priority = r || 0),
29
29
  (this.type = h),
30
- (this.Yu = o || 0),
31
- null == a && (a = 1e3 * (this.Yu + 30)),
32
- (this.Vr = a),
30
+ (this.Wu = o || 0),
31
+ null == a && (a = 1e3 * (this.Wu + 30)),
32
+ (this.Kr = a),
33
33
  (this.data = l),
34
- null != n && (this.Zu = n),
35
- (this.td = u),
36
- (this.sd = d || null);
34
+ null != n && (this.Yu = n),
35
+ (this.Zu = u),
36
+ (this.td = d || null);
37
37
  }
38
- ed(t) {
38
+ sd(t) {
39
39
  return (
40
- null == this.sd || (this.Zu !== pt.Vu && t - this.sd >= 1e3 * this.Zu)
40
+ null == this.td || (this.Yu !== mt.Vu && t - this.td >= 1e3 * this.Yu)
41
41
  );
42
42
  }
43
- rd(t) {
44
- this.sd = t;
43
+ ed(t) {
44
+ this.td = t;
45
45
  }
46
- hd(t) {
47
- const i = t + 1e3 * this.Yu;
46
+ rd(t) {
47
+ const i = t + 1e3 * this.Wu;
48
48
  return Math.max(i - new Date().valueOf(), 0);
49
49
  }
50
- od(t) {
50
+ hd(t) {
51
51
  const i = new Date().valueOf() - t,
52
- s = null == t || isNaN(i) || null == this.Vr || i < this.Vr;
52
+ s = null == t || isNaN(i) || null == this.Kr || i < this.Kr;
53
53
  return (
54
54
  s ||
55
55
  r.info(
56
- `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Vr}ms.`,
56
+ `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Kr}ms.`,
57
57
  ),
58
58
  !s
59
59
  );
@@ -73,17 +73,17 @@ export default class pt {
73
73
  d = t.data,
74
74
  m = t.min_seconds_since_last_trigger;
75
75
  return J(
76
- pt.Kr,
76
+ mt.Or,
77
77
  o,
78
78
  "Could not construct Trigger from server data",
79
79
  "Trigger.Types",
80
80
  )
81
- ? new pt(i, s, e, r, h, o, d, n, a, u, m)
81
+ ? new mt(i, s, e, r, h, o, d, n, a, u, m)
82
82
  : null;
83
83
  }
84
84
  Y() {
85
85
  const t = [];
86
- for (let i = 0; i < this.Wu.length; i++) t.push(this.Wu[i].Y());
86
+ for (let i = 0; i < this.Ku.length; i++) t.push(this.Ku[i].Y());
87
87
  return {
88
88
  i: this.id,
89
89
  c: t,
@@ -92,18 +92,18 @@ export default class pt {
92
92
  p: this.priority,
93
93
  t: this.type,
94
94
  da: this.data,
95
- d: this.Yu,
96
- r: this.Zu,
97
- tm: this.Vr,
98
- ss: this.td,
99
- ld: this.sd,
95
+ d: this.Wu,
96
+ r: this.Yu,
97
+ tm: this.Kr,
98
+ ss: this.Zu,
99
+ ld: this.td,
100
100
  };
101
101
  }
102
- static En(t) {
102
+ static qn(t) {
103
103
  const i = [],
104
104
  s = t.c || [];
105
- for (let t = 0; t < s.length; t++) i.push(ri.En(s[t]));
106
- return new pt(
105
+ for (let t = 0; t < s.length; t++) i.push(ri.qn(s[t]));
106
+ return new mt(
107
107
  t.i,
108
108
  i,
109
109
  w(t.s),
@@ -119,4 +119,4 @@ export default class pt {
119
119
  );
120
120
  }
121
121
  }
122
- (pt.Kr = { Jr: "inapp", nd: "templated_iam" }), (pt.Vu = -1);
122
+ (mt.Or = { Cr: "inapp", od: "templated_iam" }), (mt.Vu = -1);
@@ -11,7 +11,7 @@ export const TriggersProviderFactory = {
11
11
  ),
12
12
  rg: () => {
13
13
  if (!TriggersProviderFactory.provider) {
14
- const r = e.nn(L.Po);
14
+ const r = e.nn(L.Oo);
15
15
  (TriggersProviderFactory.provider = new gr(
16
16
  null != r ? r : 30,
17
17
  se.m().He(),
@@ -1,7 +1,6 @@
1
1
  import y from "../common/base-provider.js";
2
- import { newInAppMessageFromJson as lt } from "../InAppMessage/in-app-message-factory.js";
2
+ import { newInAppMessageFromJson as pt } from "../InAppMessage/in-app-message-factory.js";
3
3
  import ue from "../models/braze-event.js";
4
- import { InAppMessage } from "../InAppMessage/index.js";
5
4
  import {
6
5
  isArray as j,
7
6
  isEqual as ii,
@@ -9,7 +8,7 @@ import {
9
8
  } from "../util/code-utils.js";
10
9
  import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
11
10
  import wt from "../InAppMessage/models/templated-in-app-message.js";
12
- import pt from "./models/trigger.js";
11
+ import mt from "./models/trigger.js";
13
12
  import tt from "./models/trigger-events.js";
14
13
  import { logger as r } from "../../shared-lib/index.js";
15
14
  export default class gr extends y {
@@ -31,8 +30,8 @@ export default class gr extends y {
31
30
  (this.ng = {}),
32
31
  (this.og = {}),
33
32
  (this.triggers = []),
34
- (this.ag = 0),
35
- this.lg(),
33
+ (this.lg = 0),
34
+ this.ag(),
36
35
  this.gg();
37
36
  }
38
37
  fg() {
@@ -42,16 +41,16 @@ export default class gr extends y {
42
41
  (this.og = this.u.j(o.C.nE) || this.og);
43
42
  for (let t = 0; t < this.triggers.length; t++) {
44
43
  const i = this.triggers[t];
45
- i.id && null != this.og[i.id] && i.rd(this.og[i.id]);
44
+ i.id && null != this.og[i.id] && i.ed(this.og[i.id]);
46
45
  }
47
46
  }
48
47
  }
49
- lg() {
48
+ ag() {
50
49
  if (!this.u) return;
51
- this.ag = this.u.j(o.C.oE) || 0;
50
+ this.lg = this.u.j(o.C.oE) || 0;
52
51
  const t = this.u.j(o.C.rE) || [],
53
52
  i = [];
54
- for (let s = 0; s < t.length; s++) i.push(pt.En(t[s]));
53
+ for (let s = 0; s < t.length; s++) i.push(mt.qn(t[s]));
55
54
  (this.triggers = i), this.fg();
56
55
  }
57
56
  gg() {
@@ -71,19 +70,19 @@ export default class gr extends y {
71
70
  h = [];
72
71
  for (let e = 0; e < t.length; e++) {
73
72
  const n = t[e],
74
- o = r.hd(n.Ur || 0);
73
+ o = r.rd(n.Jr || 0);
75
74
  if (o > 0) {
76
75
  let t, e;
77
76
  h.push(n),
78
77
  null != n.ug && (t = n.ug),
79
- null != n.dg && ue.cE(n.dg) && (e = ue.En(n.dg));
80
- const a = [];
78
+ null != n.dg && ue.AE(n.dg) && (e = ue.qn(n.dg));
79
+ const l = [];
81
80
  if (n.pg && j(n.pg))
82
81
  for (let t = 0; t < n.pg.length; t++) {
83
82
  const i = s[n.pg[t]];
84
- null != i && a.push(i);
83
+ null != i && l.push(i);
85
84
  }
86
- this.eg.push(window.setTimeout(i(r, n.Ur || 0, t, e, a), o));
85
+ this.eg.push(window.setTimeout(i(r, n.Jr || 0, t, e, l), o));
87
86
  }
88
87
  }
89
88
  this.ng[r.id].length > h.length &&
@@ -98,30 +97,30 @@ export default class gr extends y {
98
97
  if (!this.u) return;
99
98
  const t = [];
100
99
  for (let i = 0; i < this.triggers.length; i++) t.push(this.triggers[i].Y());
101
- (this.ag = new Date().valueOf()),
100
+ (this.lg = new Date().valueOf()),
102
101
  this.u.k(o.C.rE, t),
103
- this.u.k(o.C.oE, this.ag);
102
+ this.u.k(o.C.oE, this.lg);
104
103
  }
105
104
  bg() {
106
105
  if (!this.u) return;
107
- (this.u.j(o.C.oE) || 0) > this.ag ? this.lg() : this.fg();
106
+ (this.u.j(o.C.oE) || 0) > this.lg ? this.ag() : this.fg();
108
107
  }
109
108
  Rs(t) {
110
109
  let i = !1;
111
110
  if (null != t && t.triggers) {
112
- this.ig.on(), this.fg();
111
+ this.ig.Yr(), this.fg();
113
112
  const s = {},
114
113
  e = {};
115
114
  this.triggers = [];
116
115
  for (let r = 0; r < t.triggers.length; r++) {
117
- const h = pt.fromJson(t.triggers[r]);
116
+ const h = mt.fromJson(t.triggers[r]);
118
117
  if (h) {
119
118
  h.id &&
120
119
  null != this.og[h.id] &&
121
- (h.rd(this.og[h.id]), (s[h.id] = this.og[h.id])),
120
+ (h.ed(this.og[h.id]), (s[h.id] = this.og[h.id])),
122
121
  h.id && null != this.ng[h.id] && (e[h.id] = this.ng[h.id]);
123
- for (let t = 0; t < h.Wu.length; t++)
124
- if (h.Wu[t].sc(tt.kt, null)) {
122
+ for (let t = 0; t < h.Ku.length; t++)
123
+ if (h.Ku[t].sc(tt.kt, null)) {
125
124
  i = !0;
126
125
  break;
127
126
  }
@@ -146,40 +145,33 @@ export default class gr extends y {
146
145
  const n = (e) => {
147
146
  this.fg();
148
147
  const h = new Date().valueOf();
149
- if (!t.od(i))
150
- return !1 === navigator.onLine && t.type === pt.Kr.Jr && e.imageUrl
151
- ? (r.info(
148
+ t.hd(i) ||
149
+ (!1 === navigator.onLine && t.type === mt.Or.Cr && e.imageUrl
150
+ ? r.info(
152
151
  `Not showing ${t.type} trigger action ${t.id} due to offline state.`,
153
- ),
154
- void this.ig.Ve(t.id, InAppMessage.Me.Uh))
155
- : void (t.ed(h) && this.wg(t, h, s)
156
- ? 0 === this.Jt.ic()
157
- ? r.info(
158
- `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,
159
- )
160
- : (this.Jt.Dt([e]), this.yg(t, h))
161
- : r.info(
162
- `Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`,
163
- ));
164
- t.type === pt.Kr.nd
165
- ? this.ig.Ve(t.id, InAppMessage.Me.Or)
166
- : this.ig.Ve(t.id, InAppMessage.Me.bh);
152
+ )
153
+ : t.sd(h) && this.wg(t, h, s)
154
+ ? 0 === this.Jt.ic()
155
+ ? r.info(
156
+ `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,
157
+ )
158
+ : (this.Jt.Dt([e]), this.yg(t, h))
159
+ : r.info(
160
+ `Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`,
161
+ ));
167
162
  },
168
163
  o = () => {
169
164
  this.fg();
170
165
  const n = h.pop();
171
166
  if (null != n)
172
- if ((this.Tg(n, i, s, e, h), n.od(i))) {
167
+ if ((this.Tg(n, i, s, e, h), n.hd(i))) {
173
168
  let t = `Server aborted in-app message display, but the timeout on fallback trigger ${n.id} has already elapsed.`;
174
- h.length > 0 && (t += " Continuing to fall back."),
175
- r.info(t),
176
- this.ig.Ve(n.id, InAppMessage.Me.bh),
177
- o();
169
+ h.length > 0 && (t += " Continuing to fall back."), r.info(t), o();
178
170
  } else {
179
171
  r.info(
180
172
  `Server aborted in-app message display. Falling back to lower priority ${n.type} trigger action ${t.id}.`,
181
173
  );
182
- const o = 1e3 * n.Yu - (new Date().valueOf() - i);
174
+ const o = 1e3 * n.Wu - (new Date().valueOf() - i);
183
175
  o > 0
184
176
  ? this.eg.push(
185
177
  window.setTimeout(() => {
@@ -189,40 +181,37 @@ export default class gr extends y {
189
181
  : this.cg(n, i, s, e, h);
190
182
  }
191
183
  };
192
- let a, l, g;
184
+ let l, a, g;
193
185
  switch (t.type) {
194
- case pt.Kr.Jr:
195
- if (((a = lt(t.data)), null == a)) {
186
+ case mt.Or.Cr:
187
+ if (((l = pt(t.data)), null == l)) {
196
188
  r.error(
197
189
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
198
- ),
199
- this.ig.Ve(t.id, InAppMessage.Me.Lr);
190
+ );
200
191
  break;
201
192
  }
202
- if (((l = this.ig.Wi(a)), l)) {
203
- r.error(l), o();
193
+ if (((a = this.ig.Qi(l)), a)) {
194
+ r.error(a), o();
204
195
  break;
205
196
  }
206
- n(a);
197
+ n(l);
207
198
  break;
208
- case pt.Kr.nd:
209
- if (((g = wt.fromJson(t.data, n, o, i, t.Vr || 0)), null == g)) {
199
+ case mt.Or.od:
200
+ if (((g = wt.fromJson(t.data, n, o, i, t.Kr || 0)), null == g)) {
210
201
  r.error(
211
202
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
212
- ),
213
- this.ig.Ve(t.id, InAppMessage.Me.Lr);
203
+ );
214
204
  break;
215
205
  }
216
- this.ig.Mr(g, s, e);
206
+ this.ig.Yi(g, s, e);
217
207
  break;
218
208
  default:
219
- r.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`),
220
- this.ig.Ve(t.id, InAppMessage.Me.Lr);
209
+ r.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`);
221
210
  }
222
211
  }
223
212
  fe(t, i = null, s) {
224
213
  if (!J(tt, t, "Cannot fire trigger action.", "TriggerEvents")) return;
225
- if (this.Ei && this.Ei.Lu())
214
+ if (this.Ei && this.Ei.Tu())
226
215
  return (
227
216
  r.info(
228
217
  "Trigger sync is currently in progress, awaiting sync completion before firing trigger event.",
@@ -234,22 +223,22 @@ export default class gr extends y {
234
223
  h = e - (this.hg || 0);
235
224
  let n = !0,
236
225
  o = !0;
237
- const a = [];
226
+ const l = [];
238
227
  for (let s = 0; s < this.triggers.length; s++) {
239
228
  const r = this.triggers[s],
240
- h = e + 1e3 * r.Yu;
229
+ h = e + 1e3 * r.Wu;
241
230
  if (
242
- r.ed(h) &&
231
+ r.sd(h) &&
243
232
  (null == r.startTime || r.startTime.valueOf() <= e) &&
244
233
  (null == r.endTime || r.endTime.valueOf() >= e)
245
234
  ) {
246
235
  let s = !1;
247
- for (let e = 0; e < r.Wu.length; e++)
248
- if (r.Wu[e].sc(t, i)) {
236
+ for (let e = 0; e < r.Ku.length; e++)
237
+ if (r.Ku[e].sc(t, i)) {
249
238
  s = !0;
250
239
  break;
251
240
  }
252
- s && ((n = !1), this.wg(r, h, t) && ((o = !1), a.push(r)));
241
+ s && ((n = !1), this.wg(r, h, t) && ((o = !1), l.push(r)));
253
242
  }
254
243
  }
255
244
  if (n)
@@ -262,19 +251,19 @@ export default class gr extends y {
262
251
  h / 1e3
263
252
  }s ago.`,
264
253
  );
265
- a.sort((t, i) => t.priority - i.priority);
266
- const l = a.pop();
267
- null != l &&
254
+ l.sort((t, i) => t.priority - i.priority);
255
+ const a = l.pop();
256
+ null != a &&
268
257
  (r.info(
269
- `Firing ${l.type} trigger action ${l.id} from trigger event ${t}.`,
258
+ `Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`,
270
259
  ),
271
- this.Tg(l, e, t, s, a),
272
- 0 === l.Yu
273
- ? this.cg(l, e, t, s, a)
260
+ this.Tg(a, e, t, s, l),
261
+ 0 === a.Wu
262
+ ? this.cg(a, e, t, s, l)
274
263
  : this.eg.push(
275
264
  window.setTimeout(() => {
276
- this.cg(l, e, t, s, a);
277
- }, 1e3 * l.Yu),
265
+ this.cg(a, e, t, s, l);
266
+ }, 1e3 * a.Wu),
278
267
  ));
279
268
  }
280
269
  changeUser(t = !1) {
@@ -299,23 +288,23 @@ export default class gr extends y {
299
288
  ),
300
289
  !0
301
290
  );
302
- let e = t.td;
291
+ let e = t.Zu;
303
292
  return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
304
293
  }
305
294
  Tg(t, i, s, e, r) {
306
295
  this.fg(), t.id && (this.ng[t.id] = this.ng[t.id] || []);
307
296
  const h = {};
308
297
  let n;
309
- (h.Ur = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n);
310
- const a = [];
311
- for (const t of r) t.id && a.push(t.id);
312
- (h.pg = a),
298
+ (h.Jr = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n);
299
+ const l = [];
300
+ for (const t of r) t.id && l.push(t.id);
301
+ (h.pg = l),
313
302
  t.id && this.ng[t.id].push(h),
314
303
  this.u && this.u.k(o.C.iE, this.ng);
315
304
  }
316
305
  yg(t, i) {
317
306
  this.fg(),
318
- t.rd(i),
307
+ t.ed(i),
319
308
  (this.hg = i),
320
309
  t.id && (this.og[t.id] = i),
321
310
  this.u && (this.u.k(o.C.aE, i), this.u.k(o.C.nE, this.og));
@@ -1,13 +1,13 @@
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.1.1".replace(/\./g, "-")}`;
4
+ s = `ab-${t}-css-definitions-${"5.2.0".replace(/\./g, "-")}`;
5
5
  if (!c) return;
6
6
  const a = c.ownerDocument || document;
7
7
  if (null == a.getElementById(s)) {
8
8
  const n = a.createElement("style");
9
9
  (n.innerHTML = o || ""), (n.id = s);
10
- const t = e.nn(L.wo);
10
+ const t = e.nn(L.ho);
11
11
  null != t && n.setAttribute("nonce", t), c.appendChild(n);
12
12
  }
13
13
  }
@@ -1,6 +1,6 @@
1
1
  import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  export function loadFontAwesome() {
3
- if (e.nn(L.Uo)) return;
3
+ if (e.nn(L.Mo)) return;
4
4
  const t = "https://use.fontawesome.com/7f85a56ba4.css";
5
5
  if (
6
6
  !(null !== document.querySelector('link[rel=stylesheet][href="' + t + '"]'))
@@ -3,7 +3,7 @@ export default class ge {
3
3
  constructor() {}
4
4
  tf() {}
5
5
  ef() {}
6
- Oa(t) {}
6
+ Da(t) {}
7
7
  static rf(t, e) {
8
8
  if (t && e)
9
9
  if (((t = t.toLowerCase()), j(e.if))) {
@@ -25,14 +25,14 @@ export const BRAZE_ACTIONS = {
25
25
  properties: { type: "type", oo: "steps", eo: "args" },
26
26
  };
27
27
  export const INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES = {
28
- Xi: "unknownBrazeAction",
29
- Zi: "noPushPrompt",
28
+ Vi: "unknownBrazeAction",
29
+ Xi: "noPushPrompt",
30
30
  };
31
31
  export const ineligibleBrazeActionURLErrorMessage = (t, o) => {
32
32
  switch (t) {
33
- case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Xi:
33
+ case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Vi:
34
34
  return `${o} contains an unknown braze action type and will not be displayed.`;
35
- case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Zi:
35
+ case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Xi:
36
36
  return `${o} contains a push prompt braze action, but is not eligible for a push prompt. Ignoring.`;
37
37
  default:
38
38
  return "";