@braze/web-sdk 5.8.1 → 5.9.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 (126) hide show
  1. package/index.d.ts +14 -9
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +19 -19
  5. package/shared-lib/guid.js +2 -2
  6. package/shared-lib/indexed-db-adapter.js +3 -3
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +11 -11
  9. package/src/Banner/banner-provider.js +22 -19
  10. package/src/Banner/display/banner-to-html.js +32 -27
  11. package/src/Banner/get-all-banners.js +11 -5
  12. package/src/Banner/get-banner.js +6 -3
  13. package/src/Banner/log-banner-click.js +2 -2
  14. package/src/Banner/log-banner-impressions.js +4 -4
  15. package/src/Banner/request-banners-refresh.js +5 -2
  16. package/src/Banner/subscribe-to-banners-updates.js +2 -2
  17. package/src/Banner/ui/insert-banner.js +2 -2
  18. package/src/Card/card-manager.js +9 -9
  19. package/src/Card/display/card-display.js +5 -5
  20. package/src/Card/log-card-click.js +2 -2
  21. package/src/Card/log-card-dismissal.js +2 -2
  22. package/src/Card/log-card-impressions.js +2 -2
  23. package/src/Card/models/captioned-image.js +17 -17
  24. package/src/Card/models/card.js +58 -58
  25. package/src/Card/models/classic-card.js +17 -17
  26. package/src/Card/models/control-card.js +8 -8
  27. package/src/Card/models/image-only.js +15 -15
  28. package/src/Card/util/card-factory.js +24 -24
  29. package/src/ContentCards/content-cards-provider.js +77 -75
  30. package/src/ContentCards/get-cached-content-cards.js +1 -1
  31. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  32. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  33. package/src/ContentCards/ui/show-content-cards.js +3 -3
  34. package/src/Core/change-user.js +1 -1
  35. package/src/Core/disable-sdk.js +4 -4
  36. package/src/Core/enable-sdk.js +3 -3
  37. package/src/Core/handle-braze-action.js +2 -2
  38. package/src/Core/is-initialized.js +1 -1
  39. package/src/Core/open-session.js +4 -4
  40. package/src/Core/request-immediate-data-flush.js +1 -1
  41. package/src/Core/wipe-data.js +7 -5
  42. package/src/FeatureFlags/feature-flag-factory.js +4 -4
  43. package/src/FeatureFlags/feature-flag.js +3 -3
  44. package/src/FeatureFlags/feature-flags-provider.js +17 -11
  45. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  46. package/src/FeatureFlags/get-feature-flag.js +2 -2
  47. package/src/FeatureFlags/log-feature-flag-impression.js +1 -1
  48. package/src/Feed/feed-provider-factory.js +1 -1
  49. package/src/Feed/feed-provider.js +12 -12
  50. package/src/Feed/get-cached-feed.js +1 -1
  51. package/src/Feed/request-feed-refresh.js +1 -1
  52. package/src/Feed/ui/show-feed.js +1 -1
  53. package/src/InAppMessage/display/html-message-to-html.js +8 -8
  54. package/src/InAppMessage/display/in-app-message-to-html.js +18 -18
  55. package/src/InAppMessage/display/modal-utils.js +7 -7
  56. package/src/InAppMessage/in-app-message-factory.js +6 -6
  57. package/src/InAppMessage/in-app-message-manager.js +70 -70
  58. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  59. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  60. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  61. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  62. package/src/InAppMessage/models/control-message.js +2 -2
  63. package/src/InAppMessage/models/full-screen-message.js +6 -6
  64. package/src/InAppMessage/models/html-message.js +7 -7
  65. package/src/InAppMessage/models/in-app-message-button.js +3 -3
  66. package/src/InAppMessage/models/in-app-message.js +36 -36
  67. package/src/InAppMessage/models/modal-message.js +6 -6
  68. package/src/InAppMessage/models/slide-up-message.js +8 -8
  69. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  70. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  71. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  72. package/src/InAppMessage/ui/show-in-app-message.js +13 -13
  73. package/src/Push/push-manager.js +81 -81
  74. package/src/Push/request-push-permission.js +1 -1
  75. package/src/Push/utils/push-utils.js +4 -4
  76. package/src/User/user-manager.js +10 -10
  77. package/src/User/user.js +15 -15
  78. package/src/common/constants.js +2 -0
  79. package/src/common/event-logger.js +2 -2
  80. package/src/common/feed-display.js +6 -6
  81. package/src/l10n/l10n-manager-factory.js +1 -1
  82. package/src/managers/auth-manager.js +30 -30
  83. package/src/managers/braze-instance.js +94 -93
  84. package/src/managers/device-manager.js +14 -14
  85. package/src/managers/network-manager.js +123 -117
  86. package/src/managers/server-config-manager.js +91 -79
  87. package/src/managers/session-manager.js +8 -8
  88. package/src/managers/storage-manager-factory.js +5 -5
  89. package/src/managers/storage-manager.js +48 -48
  90. package/src/managers/subscription-manager.js +4 -4
  91. package/src/models/backend-errors.js +4 -4
  92. package/src/models/braze-event.js +9 -9
  93. package/src/models/device.js +2 -2
  94. package/src/models/identifier.js +3 -3
  95. package/src/models/push-token.js +4 -4
  96. package/src/models/request-result.js +2 -2
  97. package/src/models/server-config.js +18 -18
  98. package/src/request-controller.js +86 -85
  99. package/src/triggers/models/custom-event-data.js +1 -1
  100. package/src/triggers/models/custom-event-property-data.js +2 -2
  101. package/src/triggers/models/filter-set.js +4 -4
  102. package/src/triggers/models/filter.js +6 -6
  103. package/src/triggers/models/in-app-message-click-data.js +1 -1
  104. package/src/triggers/models/purchase-data.js +1 -1
  105. package/src/triggers/models/purchase-property-data.js +2 -2
  106. package/src/triggers/models/push-click-data.js +1 -1
  107. package/src/triggers/models/trigger-condition.js +33 -33
  108. package/src/triggers/models/trigger-events.js +2 -2
  109. package/src/triggers/models/trigger.js +12 -12
  110. package/src/triggers/triggers-provider-factory.js +3 -3
  111. package/src/triggers/triggers-provider.js +17 -17
  112. package/src/ui/js/attach-css.js +1 -1
  113. package/src/ui/js/load-font-awesome.js +1 -1
  114. package/src/util/base-device-parser.js +1 -1
  115. package/src/util/braze-actions.js +4 -4
  116. package/src/util/browser-detector.js +5 -5
  117. package/src/util/client-hints-parser.js +1 -1
  118. package/src/util/component-utils.js +2 -2
  119. package/src/util/dom-utils.js +3 -3
  120. package/src/util/html-display-utils.js +14 -14
  121. package/src/util/key-codes.js +1 -1
  122. package/src/util/net.js +2 -2
  123. package/src/util/request-header-utils.js +13 -13
  124. package/src/util/user-agent-parser.js +1 -1
  125. package/src/util/validation-utils.js +2 -2
  126. package/src/util/window-utils.js +2 -2
@@ -5,7 +5,7 @@ const ie = {
5
5
  provider: null,
6
6
  m: () => (
7
7
  ie.p(),
8
- ie.provider || ((ie.provider = new re(r.j(), r.nn())), r._(ie.provider)),
8
+ ie.provider || ((ie.provider = new re(r.j(), r.rn())), r._(ie.provider)),
9
9
  ie.provider
10
10
  ),
11
11
  p: () => {
@@ -2,8 +2,8 @@ import t from "../common/base-provider.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import Feed from "./feed.js";
4
4
  import {
5
- newCardFromFeedJson as at,
6
- newCardFromSerializedValue as Z,
5
+ newCardFromFeedJson as lt,
6
+ newCardFromSerializedValue as tt,
7
7
  } from "../Card/util/card-factory.js";
8
8
  import { rehydrateDateAfterJsonization as V } from "../util/date-utils.js";
9
9
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
@@ -18,7 +18,7 @@ export default class re extends t {
18
18
  (this.C = t),
19
19
  (this.Fi = s),
20
20
  (this.Ts = new u()),
21
- r.N(this.Ts),
21
+ r.F(this.Ts),
22
22
  this.Ds();
23
23
  }
24
24
  Ds() {
@@ -26,12 +26,12 @@ export default class re extends t {
26
26
  this.C && (t = this.C.ft(s.gt.qi) || []);
27
27
  const i = [];
28
28
  for (let s = 0; s < t.length; s++) {
29
- const e = Z(t[s]);
29
+ const e = tt(t[s]);
30
30
  null != e && i.push(e);
31
31
  }
32
32
  (this.cards = i), this.C && (this.xi = V(this.C.ft(s.gt.zi)));
33
33
  }
34
- ki(t) {
34
+ Ui(t) {
35
35
  const i = [];
36
36
  let e = null,
37
37
  r = {};
@@ -39,18 +39,18 @@ export default class re extends t {
39
39
  const h = {};
40
40
  for (let s = 0; s < t.length; s++) {
41
41
  e = t[s];
42
- const o = at(e);
42
+ const o = lt(e);
43
43
  if (null != o) {
44
44
  const t = o.id;
45
45
  t && r[t] && ((o.viewed = !0), (h[t] = !0)), i.push(o);
46
46
  }
47
47
  }
48
48
  (this.cards = i),
49
- this.Ys(),
49
+ this.Ws(),
50
50
  (this.xi = new Date()),
51
51
  this.C && (this.C.Bt(s.gt.Zt, h), this.C.Bt(s.gt.zi, this.xi));
52
52
  }
53
- Ys() {
53
+ Ws() {
54
54
  var t;
55
55
  const i = [];
56
56
  for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].bt());
@@ -60,10 +60,10 @@ export default class re extends t {
60
60
  null != t &&
61
61
  t.feed &&
62
62
  (this.Ds(),
63
- this.ki(t.feed),
63
+ this.Ui(t.feed),
64
64
  this.Ts.X(new Feed(this.cards.slice(), this.xi)));
65
65
  }
66
- Bi() {
66
+ ki() {
67
67
  this.Ds();
68
68
  const t = [],
69
69
  s = new Date();
@@ -74,11 +74,11 @@ export default class re extends t {
74
74
  }
75
75
  return new Feed(t, this.xi);
76
76
  }
77
- vi() {
77
+ bi() {
78
78
  this.Fi && this.Fi.requestFeedRefresh();
79
79
  }
80
80
  qt(t) {
81
- return this.Ts.Ft(t);
81
+ return this.Ts.Dt(t);
82
82
  }
83
83
  clearData(t) {
84
84
  null == t && (t = !1),
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import ie from "./feed-provider-factory.js";
3
3
  export function getCachedFeed() {
4
- if (r.rr()) return ie.m().Bi();
4
+ if (r.rr()) return ie.m().ki();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import ie from "./feed-provider-factory.js";
3
3
  export function requestFeedRefresh() {
4
- if (r.rr()) return ie.m().vi();
4
+ if (r.rr()) return ie.m().bi();
5
5
  }
@@ -36,7 +36,7 @@ export function showFeed(e, t, n) {
36
36
  let l,
37
37
  f = !1;
38
38
  null == t
39
- ? ((l = ie.m().Bi()),
39
+ ? ((l = ie.m().ki()),
40
40
  an(l, o(l.cards, n), l.lastUpdated, null, i),
41
41
  (f = !0))
42
42
  : (l = new Feed(o(t, n), new Date()));
@@ -1,10 +1,10 @@
1
1
  import ro from "../../util/browser-detector.js";
2
2
  import { InAppMessage, logInAppMessageHtmlClick } from "../index.js";
3
3
  import { OperatingSystems as so } from "../../util/device-constants.js";
4
- import { buildHtmlClickHandler as lt } from "./html-message-display-utils.js";
4
+ import { buildHtmlClickHandler as ct } from "./html-message-display-utils.js";
5
5
  import { attachHtmlToIframeWithNonce as m } from "../../util/html-display-utils.js";
6
6
  import { buildBrazeBridge as b } from "../../util/html-display-utils.js";
7
- export default function ct(t, e, o, s, n, i) {
7
+ export default function mt(t, e, o, s, n, i) {
8
8
  const l = document.createElement("iframe");
9
9
  l.setAttribute("title", "Modal Message"),
10
10
  n && (l.style.zIndex = (n + 1).toString());
@@ -42,16 +42,16 @@ export default function ct(t, e, o, s, n, i) {
42
42
  },
43
43
  );
44
44
  if (
45
- ((n.appboyBridge = c), (n.brazeBridge = c), t.uo !== InAppMessage.po.fo)
45
+ ((n.appboyBridge = c), (n.brazeBridge = c), t.uo !== InAppMessage.bo.po)
46
46
  ) {
47
47
  const e = n.document.getElementsByTagName("a");
48
- for (let o = 0; o < e.length; o++) e[o].onclick = lt(t, l, e[o], s);
48
+ for (let o = 0; o < e.length; o++) e[o].onclick = ct(t, l, e[o], s);
49
49
  const o = n.document.getElementsByTagName("button");
50
- for (let e = 0; e < o.length; e++) o[e].onclick = lt(t, l, o[e], s);
50
+ for (let e = 0; e < o.length; e++) o[e].onclick = ct(t, l, o[e], s);
51
51
  }
52
52
  const m = n.document.body;
53
53
  if (null != m) {
54
- t.bo() && (m.id = t.htmlId || "");
54
+ t.ho() && (m.id = t.htmlId || "");
55
55
  const e = document.createElement("hidden");
56
56
  (e.onclick = c.closeMessage),
57
57
  (e.className = "ab-programmatic-close-button"),
@@ -67,8 +67,8 @@ export default function ct(t, e, o, s, n, i) {
67
67
  ) {
68
68
  const e = document.createElement("div");
69
69
  return (
70
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(l), (t.ho = e), e
70
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(l), (t.jo = e), e
71
71
  );
72
72
  }
73
- return (t.ho = l), l;
73
+ return (t.jo = l), l;
74
74
  }
@@ -12,20 +12,20 @@ import InAppMessage from "../models/in-app-message.js";
12
12
  import ModalMessage from "../models/modal-message.js";
13
13
  import SlideUpMessage from "../models/slide-up-message.js";
14
14
  import { logInAppMessageClick } from "../log-in-app-message-click.js";
15
- import { _handleBrazeAction as F } from "../../Core/handle-braze-action.js";
16
- import ct from "./html-message-to-html.js";
15
+ import { _handleBrazeAction as G } from "../../Core/handle-braze-action.js";
16
+ import mt from "./html-message-to-html.js";
17
17
  import ce from "./modal-utils.js";
18
- import { logger as N, Guid as G } from "../../../shared-lib/index.js";
18
+ import { logger as N, Guid as K } from "../../../shared-lib/index.js";
19
19
  export default function de(e, o, a, t, n, s, i, m = document.body, l = "ltr") {
20
- if (((e.jo = document.activeElement), e instanceof HtmlMessage))
21
- return ct(e, o, a, n, s, i);
20
+ if (((e.wo = document.activeElement), e instanceof HtmlMessage))
21
+ return mt(e, o, a, n, s, i);
22
22
  const c = (function (e, o, a, t, n, s, i = document.body, m = "ltr") {
23
23
  let l = null;
24
24
  const c = document.createElement("div");
25
25
  (c.dir = m),
26
26
  (c.className = "ab-in-app-message ab-start-hidden ab-background"),
27
27
  s && (c.style.zIndex = (s + 1).toString()),
28
- e.wo() &&
28
+ e.vo() &&
29
29
  ((c.className += " ab-modal-interactions"),
30
30
  c.setAttribute("tabindex", "-1")),
31
31
  e.lo() ||
@@ -38,7 +38,7 @@ export default function de(e, o, a, t, n, s, i, m = document.body, l = "ltr") {
38
38
  document.querySelectorAll(".ab-iam-img-loading").length > 0
39
39
  ? t(
40
40
  `Cannot show in-app message ${e.message} because another message is being shown.`,
41
- InAppMessage.xo.vo,
41
+ InAppMessage.Co.xo,
42
42
  )
43
43
  : a(c));
44
44
  },
@@ -67,7 +67,7 @@ export default function de(e, o, a, t, n, s, i, m = document.body, l = "ltr") {
67
67
  e.ll(c, () => {
68
68
  logInAppMessageClick(e),
69
69
  e.clickAction === InAppMessage.ClickAction.URI
70
- ? F(
70
+ ? G(
71
71
  e.uri || "",
72
72
  n || e.openTarget === InAppMessage.OpenTarget.BLANK,
73
73
  a,
@@ -88,7 +88,7 @@ export default function de(e, o, a, t, n, s, i, m = document.body, l = "ltr") {
88
88
  c.appendChild(u), s && (u.style.zIndex = (s + 2).toString());
89
89
  const b = document.createElement("div");
90
90
  (b.className = "ab-message-text"), (b.dir = m);
91
- const p = (e.messageAlignment || e.Co).toLowerCase();
91
+ const p = (e.messageAlignment || e.$o).toLowerCase();
92
92
  b.className += " " + p + "-aligned";
93
93
  let g = !1;
94
94
  const f = document.createElement("div");
@@ -99,13 +99,13 @@ export default function de(e, o, a, t, n, s, i, m = document.body, l = "ltr") {
99
99
  (o.style.backgroundImage = "url(" + e.imageUrl + ")"),
100
100
  o.setAttribute("role", "img"),
101
101
  o.setAttribute("aria-label", "Modal Image"),
102
- e.$o(o),
102
+ e.ko(o),
103
103
  f.appendChild(o);
104
104
  } else {
105
105
  const o = document.createElement("img");
106
106
  if (
107
107
  (o.setAttribute("src", e.imageUrl),
108
- e.$o(o),
108
+ e.ko(o),
109
109
  0 === document.querySelectorAll(".ab-iam-img-loading").length)
110
110
  ) {
111
111
  g = !0;
@@ -142,7 +142,7 @@ export default function de(e, o, a, t, n, s, i, m = document.body, l = "ltr") {
142
142
  }
143
143
  if ((J(b, "touchstart"), e.header && e.header.length > 0)) {
144
144
  const o = document.createElement("h1");
145
- (o.className = "ab-message-header"), (e.ko = G.ce()), (o.id = e.ko);
145
+ (o.className = "ab-message-header"), (e.Mo = K.ce()), (o.id = e.Mo);
146
146
  const a = (
147
147
  e.headerAlignment || InAppMessage.TextAlignment.CENTER
148
148
  ).toLowerCase();
@@ -151,14 +151,14 @@ export default function de(e, o, a, t, n, s, i, m = document.body, l = "ltr") {
151
151
  o.appendChild(document.createTextNode(e.header)),
152
152
  b.appendChild(o);
153
153
  }
154
- return b.appendChild(e.Mo()), c.appendChild(b), g || d(), (e.ho = c), c;
154
+ return b.appendChild(e.zo()), c.appendChild(b), g || d(), (e.jo = c), c;
155
155
  })(e, o, a, t, n, s, m, l);
156
156
  if (e instanceof FullScreenMessage || e instanceof ModalMessage) {
157
157
  const a = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
158
158
  (c.className += ` ${a} ab-centered`),
159
- ce.zo(e, o, c, n),
160
- ce.Lo(c),
161
- ce.Io(e.ko, c);
159
+ ce.Lo(e, o, c, n),
160
+ ce.Io(c),
161
+ ce.To(e.Mo, c);
162
162
  } else if (e instanceof SlideUpMessage) {
163
163
  c.className += " ab-slideup";
164
164
  const o = c.getElementsByClassName("ab-close-button")[0];
@@ -180,8 +180,8 @@ export default function de(e, o, a, t, n, s, i, m = document.body, l = "ltr") {
180
180
  null != o && null != o.onclick && o.onclick(e);
181
181
  }),
182
182
  e.slideFrom === InAppMessage.SlideFrom.TOP
183
- ? ((a = R.To), (t = " ab-swiped-up"))
184
- : ((a = R.qo), (t = " ab-swiped-down")),
183
+ ? ((a = R.qo), (t = " ab-swiped-up"))
184
+ : ((a = R.yo), (t = " ab-swiped-down")),
185
185
  H(c, a, (e) => {
186
186
  (c.className += t), null != o && null != o.onclick && o.onclick(e);
187
187
  });
@@ -1,11 +1,11 @@
1
1
  import InAppMessage from "../models/in-app-message.js";
2
- import { _handleBrazeAction as F } from "../../Core/handle-braze-action.js";
2
+ import { _handleBrazeAction as G } from "../../Core/handle-braze-action.js";
3
3
  import { logInAppMessageButtonClick } from "../log-in-app-message-button-click.js";
4
4
  import { toRgba as le } from "../../util/color-utils.js";
5
5
  import { addPassiveEventListener as J } from "../../util/dom-utils.js";
6
- import { KeyCodes as mt } from "../../util/key-codes.js";
6
+ import { KeyCodes as bt } from "../../util/key-codes.js";
7
7
  const ce = {
8
- Lo: (t) => {
8
+ Io: (t) => {
9
9
  const o = t.querySelectorAll(
10
10
  ".ab-close-button, .ab-message-text, .ab-message-button",
11
11
  );
@@ -16,7 +16,7 @@ const ce = {
16
16
  s = o[o.length - 1];
17
17
  t.addEventListener("keydown", (o) => {
18
18
  const a = document.activeElement;
19
- o.keyCode === mt.yo &&
19
+ o.keyCode === bt.Ao &&
20
20
  (o.shiftKey || (a !== s && a !== t)
21
21
  ? !o.shiftKey ||
22
22
  (a !== e && a !== t) ||
@@ -25,13 +25,13 @@ const ce = {
25
25
  });
26
26
  }
27
27
  },
28
- Io: (t, o) => {
28
+ To: (t, o) => {
29
29
  o.setAttribute("role", "dialog"),
30
30
  o.setAttribute("aria-modal", "true"),
31
31
  o.setAttribute("aria-label", "Modal Message"),
32
32
  t && o.setAttribute("aria-labelledby", t);
33
33
  },
34
- zo: (t, o, e, s) => {
34
+ Lo: (t, o, e, s) => {
35
35
  if (t.buttons && t.buttons.length > 0) {
36
36
  const a = document.createElement("div");
37
37
  (a.className = "ab-message-buttons"), e.appendChild(a);
@@ -41,7 +41,7 @@ const ce = {
41
41
  t.ll(e, () => {
42
42
  logInAppMessageButtonClick(a, t),
43
43
  a.clickAction === InAppMessage.ClickAction.URI
44
- ? F(
44
+ ? G(
45
45
  a.uri || "",
46
46
  s || t.openTarget === InAppMessage.OpenTarget.BLANK,
47
47
  l,
@@ -47,7 +47,7 @@ export function newInAppMessageFromJson(e) {
47
47
  ((S = void 0), (q = void 0));
48
48
  const B = e.message_extras;
49
49
  let C;
50
- if (o === ModalMessage.ds || o === InAppMessage.po.Ao)
50
+ if (o === ModalMessage.cs || o === InAppMessage.bo.Fo)
51
51
  C = new ModalMessage(
52
52
  s,
53
53
  n,
@@ -78,7 +78,7 @@ export function newInAppMessageFromJson(e) {
78
78
  q,
79
79
  B,
80
80
  );
81
- else if (o === FullScreenMessage.ds)
81
+ else if (o === FullScreenMessage.cs)
82
82
  C = new FullScreenMessage(
83
83
  s,
84
84
  n,
@@ -110,7 +110,7 @@ export function newInAppMessageFromJson(e) {
110
110
  q,
111
111
  B,
112
112
  );
113
- else if (o === SlideUpMessage.ds)
113
+ else if (o === SlideUpMessage.cs)
114
114
  C = new SlideUpMessage(
115
115
  s,
116
116
  n,
@@ -137,9 +137,9 @@ export function newInAppMessageFromJson(e) {
137
137
  );
138
138
  else {
139
139
  if (
140
- o !== HtmlMessage.ds &&
141
- o !== InAppMessage.po.fo &&
142
- o !== InAppMessage.po.Fo
140
+ o !== HtmlMessage.cs &&
141
+ o !== InAppMessage.bo.po &&
142
+ o !== InAppMessage.bo.Jo
143
143
  )
144
144
  return void N.error("Ignoring message with unknown type " + o);
145
145
  {
@@ -7,7 +7,7 @@ import InAppMessageButton from "./models/in-app-message-button.js";
7
7
  import c from "../common/event-logger.js";
8
8
  import { newInAppMessageFromJson as ut } from "./in-app-message-factory.js";
9
9
  import { randomInclusive as a } from "../util/math.js";
10
- import E from "../models/request-result.js";
10
+ import F from "../models/request-result.js";
11
11
  import { logger as N, EventTypes as d } from "../../shared-lib/index.js";
12
12
  import u from "../managers/subscription-manager.js";
13
13
  import pt from "../triggers/models/trigger.js";
@@ -34,37 +34,37 @@ export default class ea {
34
34
  (this.C = s),
35
35
  (this.Cs = i),
36
36
  (this.Mi = new u()),
37
- r.N(this.Mi),
38
- (this._i = 1e3),
39
- (this.Pi = 6e4),
37
+ r.F(this.Mi),
38
+ (this.Bi = 1e3),
39
+ (this._i = 6e4),
40
+ (this.Pi = null),
40
41
  (this.Gi = null),
41
- (this.$i = null),
42
- (this.Oi = null);
42
+ (this.$i = null);
43
43
  }
44
- Xi() {
44
+ Oi() {
45
45
  return this.Mi;
46
46
  }
47
- Hi(t) {
48
- return this.Mi.Ft(t);
47
+ Xi(t) {
48
+ return this.Mi.Dt(t);
49
49
  }
50
- Ji() {
51
- return this.Gi;
50
+ Hi() {
51
+ return this.Pi;
52
52
  }
53
- Ki(t) {
54
- this.Gi = t;
53
+ Ji(t) {
54
+ this.Pi = t;
55
55
  }
56
56
  ut(t, e, s, i) {
57
- const r = new E();
57
+ const r = new F();
58
58
  let n;
59
- if (e === d.Li || t instanceof ControlMessage) {
60
- if (!t.ts())
59
+ if (e === d.Ki || t instanceof ControlMessage) {
60
+ if (!t._t())
61
61
  return (
62
62
  N.info(
63
63
  "This in-app message has already received an impression. Ignoring analytics event.",
64
64
  ),
65
65
  r
66
66
  );
67
- } else if (e === d.Qi || (t instanceof HtmlMessage && e === d.Vi)) {
67
+ } else if (e === d.Li || (t instanceof HtmlMessage && e === d.Qi)) {
68
68
  if (!t.$t(i))
69
69
  return (
70
70
  N.info(
@@ -77,7 +77,7 @@ export default class ea {
77
77
  (n =
78
78
  t instanceof ControlMessage
79
79
  ? { trigger_ids: [t.triggerId] }
80
- : this.Wi(t)),
80
+ : this.Vi(t)),
81
81
  null == n
82
82
  ? r
83
83
  : (t.messageExtras && (n.message_extras = t.messageExtras),
@@ -85,8 +85,8 @@ export default class ea {
85
85
  c.ut(e, n))
86
86
  );
87
87
  }
88
- Yi(t, e) {
89
- const s = new E();
88
+ Wi(t, e) {
89
+ const s = new F();
90
90
  if (!t.$t())
91
91
  return (
92
92
  N.info(
@@ -94,32 +94,32 @@ export default class ea {
94
94
  ),
95
95
  s
96
96
  );
97
- const i = this.Wi(e);
97
+ const i = this.Vi(e);
98
98
  return null == i
99
99
  ? s
100
- : t.id === InAppMessageButton.Zi
100
+ : t.id === InAppMessageButton.Yi
101
101
  ? (N.info(
102
102
  "This in-app message button does not have a tracking id. Not logging event to Braze servers.",
103
103
  ),
104
104
  s)
105
- : (null != t.id && (i.bid = t.id), c.ut(d.Vi, i));
105
+ : (null != t.id && (i.bid = t.id), c.ut(d.Qi, i));
106
106
  }
107
- Ir(t) {
107
+ Zi(t) {
108
108
  const e = t.messageFields;
109
109
  return (null != e && e.is_push_primer) || !1;
110
110
  }
111
- Mr(t) {
111
+ Ir(t) {
112
112
  if (!(t instanceof InAppMessage)) return;
113
113
  const e = (t) => {
114
114
  if (!t) return;
115
115
  const e = eo(t);
116
116
  return ft(e)
117
- ? dt(jt.Tr, "In-App Message")
118
- : gt(e) && !vt.wr()
119
- ? dt(jt.Br, "In-App Message")
117
+ ? dt(jt.Mr, "In-App Message")
118
+ : gt(e) && !vt.Tr()
119
+ ? dt(jt.wr, "In-App Message")
120
120
  : void 0;
121
121
  };
122
- if (this.Ir(t) && !vt.wr())
122
+ if (this.Zi(t) && !vt.Tr())
123
123
  return "In-App Message contains a push prompt, but is not eligible for a push prompt. Ignoring.";
124
124
  const s = t.buttons || [];
125
125
  let i;
@@ -137,29 +137,29 @@ export default class ea {
137
137
  ? e(t.uri)
138
138
  : void 0;
139
139
  }
140
- _r(t, e) {
141
- e !== this.Oi && this.qr(), (this.$i = t), (this.Oi = e);
140
+ Br(t, e) {
141
+ e !== this.$i && this._r(), (this.Gi = t), (this.$i = e);
142
142
  }
143
- qr() {
144
- null != this.$i &&
145
- (clearTimeout(this.$i), (this.$i = null), (this.Oi = null));
143
+ _r() {
144
+ null != this.Gi &&
145
+ (clearTimeout(this.Gi), (this.Gi = null), (this.$i = null));
146
146
  }
147
- Er(t, e, s, i) {
147
+ qr(t, e, s, i) {
148
148
  const r = this.S;
149
149
  if (!r) return;
150
- this.Oi && t.triggerId !== this.Oi && (this.qr(), h.wi(this.C, h.O.Gr));
151
- const n = r.Nr(!1, !1),
150
+ this.$i && t.triggerId !== this.$i && (this._r(), h.vi(this.C, h.O.Er));
151
+ const n = r.Gr(!1, !1),
152
152
  o = r.H(n);
153
153
  (o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
154
- null != s && (o.template.data = s.$r());
155
- const u = r.J(o, h.O.Gr);
154
+ null != s && (o.template.data = s.Nr());
155
+ const u = r.J(o, h.O.Er);
156
156
  r.V(
157
157
  o,
158
158
  (r = -1) => {
159
159
  const n = this.S;
160
160
  if (!n) return;
161
161
  const p = new Date().valueOf();
162
- h.W(this.C, h.O.Gr, p),
162
+ h.W(this.C, h.O.Er, p),
163
163
  -1 !== r && u.push(["X-Braze-Req-Tokens-Remaining", r.toString()]);
164
164
  let m,
165
165
  c,
@@ -170,16 +170,16 @@ export default class ea {
170
170
  headers: u,
171
171
  tt: (e) => {
172
172
  if (!n.st(o, e, u))
173
- return void ("function" == typeof t.Cr && t.Cr());
173
+ return void ("function" == typeof t.$r && t.$r());
174
174
  if ((n.it(), null == e || null == e.templated_message)) return;
175
175
  const s = e.templated_message;
176
- if (s.type !== pt.Xr.Or) return;
176
+ if (s.type !== pt.Or.Cr) return;
177
177
  const i = ut(s.data);
178
178
  if (null == i) return;
179
- const r = this.Mr(i);
179
+ const r = this.Ir(i);
180
180
  if (r)
181
- return N.error(r), void ("function" == typeof t.Cr && t.Cr());
182
- "function" == typeof t.Hr && t.Hr(i);
181
+ return N.error(r), void ("function" == typeof t.$r && t.$r());
182
+ "function" == typeof t.Xr && t.Xr(i);
183
183
  },
184
184
  error: (e) => {
185
185
  (g = !0),
@@ -187,21 +187,21 @@ export default class ea {
187
187
  (c = `getting user personalization for message ${t.triggerId}.`);
188
188
  },
189
189
  nt: (r, o) => {
190
- if (new Date().valueOf() - t.Jr < t.Kr) {
190
+ if (new Date().valueOf() - t.Hr < t.Jr) {
191
191
  let r = 0;
192
192
  if (g) {
193
- const e = Math.min(t.Kr, this.Pi),
194
- s = this._i;
193
+ const e = Math.min(t.Jr, this._i),
194
+ s = this.Bi;
195
195
  null == i && (i = s), (r = Math.min(e, a(s, 3 * i)));
196
196
  }
197
197
  n.rt(
198
198
  o,
199
199
  () => {
200
- this.Er(t, e, s, r);
200
+ this.qr(t, e, s, r);
201
201
  },
202
- h.O.Gr,
203
- (e) => this._r(e, t.triggerId),
204
- () => this.qr(),
202
+ h.O.Er,
203
+ (e) => this.Br(e, t.triggerId),
204
+ () => this._r(),
205
205
  r,
206
206
  );
207
207
  }
@@ -209,10 +209,10 @@ export default class ea {
209
209
  },
210
210
  });
211
211
  },
212
- h.O.Gr,
212
+ h.O.Er,
213
213
  );
214
214
  }
215
- Wi(t) {
215
+ Vi(t) {
216
216
  if (null == t.triggerId)
217
217
  return (
218
218
  N.info(
@@ -230,33 +230,33 @@ export default class ea {
230
230
  !(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
231
231
  t instanceof ControlMessage
232
232
  ) &&
233
- this.C.Bt(s.gt.Lr, t.bt())
233
+ this.C.Bt(s.gt.Kr, t.bt())
234
234
  );
235
235
  }
236
236
  Ar() {
237
237
  if (!this.C) return null;
238
- const t = this.C.ft(s.gt.Lr);
238
+ const t = this.C.ft(s.gt.Kr);
239
239
  if (!t) return null;
240
240
  let e;
241
241
  switch (t.type) {
242
- case InAppMessage.po.Qr:
243
- e = FullScreenMessage.Ur(t);
242
+ case InAppMessage.bo.Lr:
243
+ e = FullScreenMessage.Qr(t);
244
244
  break;
245
- case InAppMessage.po.Vr:
246
- case InAppMessage.po.fo:
247
- case InAppMessage.po.Fo:
248
- e = HtmlMessage.Ur(t);
245
+ case InAppMessage.bo.Ur:
246
+ case InAppMessage.bo.po:
247
+ case InAppMessage.bo.Jo:
248
+ e = HtmlMessage.Qr(t);
249
249
  break;
250
- case InAppMessage.po.Wr:
251
- case InAppMessage.po.Ao:
252
- e = ModalMessage.Ur(t);
250
+ case InAppMessage.bo.Vr:
251
+ case InAppMessage.bo.Fo:
252
+ e = ModalMessage.Qr(t);
253
253
  break;
254
- case InAppMessage.po.Yr:
255
- e = SlideUpMessage.Ur(t);
254
+ case InAppMessage.bo.Wr:
255
+ e = SlideUpMessage.Qr(t);
256
256
  }
257
- return e && this.Zr(), e;
257
+ return e && this.Yr(), e;
258
258
  }
259
- Zr() {
260
- this.C && this.C.Ut(s.gt.Lr);
259
+ Yr() {
260
+ this.C && this.C.Ut(s.gt.Kr);
261
261
  }
262
262
  }
@@ -12,11 +12,11 @@ export function logInAppMessageButtonClick(o, t) {
12
12
  if (!(o instanceof InAppMessageButton))
13
13
  return N.error("button must be an InAppMessageButton object"), !1;
14
14
  if (!(t instanceof InAppMessage)) return N.error(sr), !1;
15
- const s = se.ea().Yi(o, t);
15
+ const s = se.ea().Wi(o, t);
16
16
  if (s.tt)
17
17
  for (let r = 0; r < s.$e.length; r++)
18
18
  ot.m().Ce(
19
- et.Bo,
19
+ et.Zr,
20
20
  [
21
21
  t.triggerId,
22
22
  null === (e = o.id) || void 0 === e ? void 0 : e.toString(),
@@ -9,11 +9,11 @@ import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-fac
9
9
  export function logInAppMessageClick(o) {
10
10
  if (!r.rr()) return !1;
11
11
  if (!(o instanceof InAppMessage)) return N.error(sr), !1;
12
- const s = se.ea().ut(o, d.Qi);
12
+ const s = se.ea().ut(o, d.Li);
13
13
  if (s) {
14
- o.Do() || logInAppMessageImpression(o);
14
+ o.Bo() || logInAppMessageImpression(o);
15
15
  for (let r = 0; r < s.$e.length; r++)
16
- ot.m().Ce(et.Bo, [o.triggerId], s.$e[r]);
16
+ ot.m().Ce(et.Zr, [o.triggerId], s.$e[r]);
17
17
  }
18
18
  return s.tt;
19
19
  }