@braze/web-sdk 4.5.0 → 4.6.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 (86) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +49 -8
  3. package/package.json +1 -1
  4. package/shared-lib/braze-shared-lib.js +7 -7
  5. package/shared-lib/encoding-utils.js +3 -3
  6. package/shared-lib/event-types.js +14 -14
  7. package/shared-lib/guid.js +2 -2
  8. package/shared-lib/indexed-db-adapter.js +3 -3
  9. package/shared-lib/logger.js +18 -18
  10. package/shared-lib/supported-options.js +15 -15
  11. package/src/Card/index.js +1 -0
  12. package/src/Card/log-content-card-click.js +4 -0
  13. package/src/FeatureFlags/feature-flag-factory.js +13 -5
  14. package/src/FeatureFlags/feature-flag.js +36 -8
  15. package/src/FeatureFlags/feature-flags-provider.js +58 -33
  16. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  17. package/src/FeatureFlags/get-feature-flag.js +5 -5
  18. package/src/FeatureFlags/index.js +1 -0
  19. package/src/Feed/feed-provider-factory.js +8 -8
  20. package/src/Feed/feed-provider.js +3 -3
  21. package/src/Feed/get-cached-feed.js +2 -2
  22. package/src/Feed/log-feed-displayed.js +1 -1
  23. package/src/Feed/request-feed-refresh.js +2 -2
  24. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  25. package/src/Feed/ui/show-feed.js +2 -2
  26. package/src/InAppMessage/display/html-message-to-html.js +3 -3
  27. package/src/InAppMessage/display/in-app-message-to-html.js +101 -86
  28. package/src/InAppMessage/display/modal-utils.js +9 -9
  29. package/src/InAppMessage/in-app-message-factory.js +1 -1
  30. package/src/InAppMessage/in-app-message-manager-factory.js +3 -3
  31. package/src/InAppMessage/in-app-message-manager.js +52 -52
  32. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  33. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  34. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  35. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  36. package/src/InAppMessage/models/full-screen-message.js +1 -1
  37. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  38. package/src/InAppMessage/models/in-app-message.js +68 -68
  39. package/src/InAppMessage/models/modal-message.js +2 -2
  40. package/src/InAppMessage/models/slide-up-message.js +8 -8
  41. package/src/InAppMessage/models/templated-in-app-message.js +4 -4
  42. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  43. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  44. package/src/InAppMessage/ui/show-in-app-message.js +24 -21
  45. package/src/Push/push-manager.js +54 -54
  46. package/src/Push/utils/push-utils.js +4 -4
  47. package/src/User/user-manager.js +4 -4
  48. package/src/User/user.js +13 -13
  49. package/src/common/base-feed.js +1 -1
  50. package/src/common/feed-display.js +22 -22
  51. package/src/l10n/l10n-manager-factory.js +7 -7
  52. package/src/managers/auth-manager.js +23 -23
  53. package/src/managers/braze-instance.js +93 -93
  54. package/src/managers/device-manager.js +2 -2
  55. package/src/managers/network-manager.js +42 -42
  56. package/src/managers/server-config-manager.js +9 -9
  57. package/src/managers/session-manager.js +27 -27
  58. package/src/managers/storage-manager-factory.js +1 -1
  59. package/src/managers/storage-manager.js +61 -61
  60. package/src/managers/subscription-manager.js +6 -6
  61. package/src/models/backend-errors.js +5 -5
  62. package/src/models/braze-event.js +2 -2
  63. package/src/models/device.js +1 -1
  64. package/src/models/identifier.js +6 -6
  65. package/src/models/push-token.js +3 -3
  66. package/src/models/server-config.js +3 -3
  67. package/src/request-controller.js +52 -52
  68. package/src/triggers/models/filter-set.js +2 -2
  69. package/src/triggers/models/filter.js +34 -34
  70. package/src/triggers/models/in-app-message-click-data.js +6 -6
  71. package/src/triggers/models/push-click-data.js +1 -1
  72. package/src/triggers/models/trigger-condition.js +8 -8
  73. package/src/triggers/models/trigger-events.js +1 -1
  74. package/src/triggers/models/trigger.js +30 -30
  75. package/src/triggers/triggers-provider-factory.js +2 -2
  76. package/src/triggers/triggers-provider.js +37 -37
  77. package/src/ui/js/attach-css.js +1 -1
  78. package/src/ui/js/feed-css.js +1 -1
  79. package/src/ui/js/iam-css.js +1 -1
  80. package/src/ui/js/load-font-awesome.js +1 -1
  81. package/src/util/braze-actions.js +4 -4
  82. package/src/util/browser-detector.js +2 -2
  83. package/src/util/dom-utils.js +8 -8
  84. package/src/util/key-codes.js +1 -1
  85. package/src/util/net.js +3 -3
  86. package/src/util/window-utils.js +1 -1
@@ -2,13 +2,13 @@ import y from "../common/base-provider.js";
2
2
  import e from "../managers/braze-instance.js";
3
3
  import Feed from "./feed.js";
4
4
  import {
5
- newCardFromFeedJson as st,
5
+ newCardFromFeedJson as it,
6
6
  newCardFromSerializedValue as S
7
7
  } from "../Card/util/card-factory.js";
8
8
  import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
9
9
  import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
10
10
  import u from "../managers/subscription-manager.js";
11
- export default class re extends y {
11
+ export default class ee extends y {
12
12
  constructor(t, s) {
13
13
  super(),
14
14
  (this.h = t),
@@ -33,7 +33,7 @@ export default class re extends y {
33
33
  r = {};
34
34
  for (let h = 0; h < t.length; h++) {
35
35
  i = t[h];
36
- const o = st(i);
36
+ const o = it(i);
37
37
  null != o && (e[o.id] && ((o.viewed = !0), (r[o.id] = !0)), s.push(o));
38
38
  }
39
39
  this.h.B(o.q.P, r),
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import ie from "./feed-provider-factory.js";
2
+ import re from "./feed-provider-factory.js";
3
3
  export function getCachedFeed() {
4
- if (e.rr()) return ie.er().ai();
4
+ if (e.rr()) return re.er().ai();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import r from "../../shared-lib/braze-shared-lib.js";
3
3
  export function logFeedDisplayed() {
4
- if (e.rr()) return e.nr().yr(r.qr.Fr).S;
4
+ if (e.rr()) return e.nr().Fr(r.Ar.qr).S;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import ie from "./feed-provider-factory.js";
2
+ import re from "./feed-provider-factory.js";
3
3
  export function requestFeedRefresh() {
4
- if (e.rr()) return ie.er().Is();
4
+ if (e.rr()) return re.er().Is();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import ie from "./feed-provider-factory.js";
2
+ import re from "./feed-provider-factory.js";
3
3
  export function subscribeToFeedUpdates(r) {
4
- if (e.rr()) return ie.er().Ws(r);
4
+ if (e.rr()) return re.er().Ws(r);
5
5
  }
@@ -9,7 +9,7 @@ import {
9
9
  updateFeedCards as k
10
10
  } from "../../common/feed-display.js";
11
11
  import { Feed, logFeedDisplayed, subscribeToFeedUpdates } from "../index.js";
12
- import ie from "../feed-provider-factory.js";
12
+ import re from "../feed-provider-factory.js";
13
13
  import { intersection as te } from "../../util/code-utils.js";
14
14
  import { setCardHeight as A } from "../../Card/display/card-display.js";
15
15
  import { setupFeedUI as B } from "../../ui/js/index.js";
@@ -36,7 +36,7 @@ export function showFeed(t, n, o) {
36
36
  let a = !1,
37
37
  f = null;
38
38
  null == n
39
- ? ((f = ie.er().ai()),
39
+ ? ((f = re.er().ai()),
40
40
  k(f, s(f.cards, o), f.lastUpdated, null, i),
41
41
  (a = !0))
42
42
  : (f = new Feed(s(n, o), new Date()));
@@ -5,9 +5,9 @@ import { getUser as Q } from "../../Core/get-user.js";
5
5
  import { InAppMessage } from "../index.js";
6
6
  import { keys as rr } from "../../util/code-utils.js";
7
7
  import { OperatingSystems as rt } from "../../util/device-constants.js";
8
- import { parseQueryStringKeyValues as it } from "../../util/url-utils.js";
8
+ import { parseQueryStringKeyValues as ut } from "../../util/url-utils.js";
9
9
  import { WindowUtils as H } from "../../util/window-utils.js";
10
- export default function ut(t, n, e, o, s, r) {
10
+ export default function ct(t, n, e, o, s, r) {
11
11
  const i = document.createElement("iframe");
12
12
  i.setAttribute("title", "Modal Message"), s && (i.style.zIndex = s + 1);
13
13
  const u = n => {
@@ -15,7 +15,7 @@ export default function ut(t, n, e, o, s, r) {
15
15
  s = n.onclick;
16
16
  return r => {
17
17
  if (null != s && "function" == typeof s && !1 === s()) return;
18
- let u = it(e).abButtonId;
18
+ let u = ut(e).abButtonId;
19
19
  if (
20
20
  ((null != u && "" !== u) || (u = n.getAttribute("id")),
21
21
  null != e && "" !== e && 0 !== e.indexOf("#"))
@@ -5,7 +5,7 @@ import {
5
5
  DIRECTIONS as c
6
6
  } from "../../util/dom-utils.js";
7
7
  import { createCloseButton as i } from "../../util/component-utils.js";
8
- import { isTransparent as ne, toRgba as me } from "../../util/color-utils.js";
8
+ import { isTransparent as ie, toRgba as ne } from "../../util/color-utils.js";
9
9
  import FullScreenMessage from "../models/full-screen-message.js";
10
10
  import HtmlMessage from "../models/html-message.js";
11
11
  import InAppMessage from "../models/in-app-message.js";
@@ -13,140 +13,155 @@ 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
15
  import { _handleBrazeAction as m } from "../../Core/handle-braze-action.js";
16
- import ut from "./html-message-to-html.js";
17
- import ce from "./modal-utils.js";
16
+ import ct from "./html-message-to-html.js";
17
+ import me from "./modal-utils.js";
18
18
  import r from "../../../shared-lib/braze-shared-lib.js";
19
- export default function le(e, o, s, t, a, n) {
20
- if (((e.ke = document.activeElement), e instanceof HtmlMessage))
21
- return ut(e, o, s, t, a, n);
22
- const l = (function(e, o, s, t, a) {
23
- const n = document.createElement("div");
24
- (n.className = "ab-in-app-message ab-start-hidden ab-background"),
25
- a && (n.style.zIndex = a + 1),
26
- e.Me() &&
27
- ((n.className += " ab-modal-interactions"),
28
- n.setAttribute("tabindex", "-1")),
19
+ export default function ce(e, o, a, s, t, n, l) {
20
+ if (((e.Le = document.activeElement), e instanceof HtmlMessage))
21
+ return ct(e, o, a, t, n, l);
22
+ const b = (function(e, o, a, s, t, n) {
23
+ const c = document.createElement("div");
24
+ (c.className = "ab-in-app-message ab-start-hidden ab-background"),
25
+ n && (c.style.zIndex = n + 1),
26
+ e.Ie() &&
27
+ ((c.className += " ab-modal-interactions"),
28
+ c.setAttribute("tabindex", "-1")),
29
29
  e.sn() ||
30
- ((n.style.color = me(e.textColor)),
31
- (n.style.backgroundColor = me(e.backgroundColor)),
32
- ne(e.backgroundColor) && (n.className += " ab-no-shadow"));
33
- const c = () => {
34
- -1 !== n.className.indexOf("ab-start-hidden") &&
35
- ((n.className = n.className.replace("ab-start-hidden", "")), s(n));
36
- };
30
+ ((c.style.color = ne(e.textColor)),
31
+ (c.style.backgroundColor = ne(e.backgroundColor)),
32
+ ie(e.backgroundColor) && (c.className += " ab-no-shadow"));
33
+ const d = () => {
34
+ -1 !== c.className.indexOf("ab-start-hidden") &&
35
+ ((c.className = c.className.replace("ab-start-hidden", "")),
36
+ document.querySelectorAll(".ab-iam-img-loading").length > 0
37
+ ? s(
38
+ `Cannot show in-app message ${e.message} because another message is being shown.`,
39
+ InAppMessage.Ge.Ee
40
+ )
41
+ : a(c));
42
+ },
43
+ l = () => {
44
+ const e = document.querySelectorAll(".ab-iam-root");
45
+ e && e.length > 0 && (e[0].classList.remove("ab-iam-img-loading"), d());
46
+ };
37
47
  e.imageStyle === InAppMessage.ImageStyle.GRAPHIC &&
38
- (n.className += " graphic"),
48
+ (c.className += " graphic"),
39
49
  e.orientation === InAppMessage.Orientation.LANDSCAPE &&
40
- (n.className += " landscape"),
50
+ (c.className += " landscape"),
41
51
  0 === e.buttons.length &&
42
52
  (e.clickAction !== InAppMessage.ClickAction.NONE &&
43
- (n.className += " ab-clickable"),
44
- (n.onclick = s => (
45
- e.on(n, () => {
53
+ (c.className += " ab-clickable"),
54
+ (c.onclick = a => (
55
+ e.on(c, () => {
46
56
  logInAppMessageClick(e),
47
57
  e.clickAction === InAppMessage.ClickAction.URI
48
58
  ? m(
49
59
  e.uri,
50
- s,
60
+ a,
51
61
  t || e.openTarget === InAppMessage.OpenTarget.BLANK
52
62
  )
53
63
  : e.clickAction === InAppMessage.ClickAction.NEWS_FEED && o();
54
64
  }),
55
- s.stopPropagation(),
65
+ a.stopPropagation(),
56
66
  !1
57
67
  )));
58
- const l = i(
68
+ const b = i(
59
69
  "Close Message",
60
- e.sn() ? void 0 : me(e.closeButtonColor),
70
+ e.sn() ? void 0 : ne(e.closeButtonColor),
61
71
  () => {
62
- e.on(n);
72
+ e.on(c);
63
73
  }
64
74
  );
65
- n.appendChild(l), a && (l.style.zIndex = a + 2);
66
- const d = document.createElement("div");
67
- d.className = "ab-message-text";
68
- const u = (e.messageAlignment || e.Ce).toLowerCase();
69
- d.className += " " + u + "-aligned";
70
- let b = !1;
71
- const f = document.createElement("div");
72
- if (((f.className = "ab-image-area"), e.imageUrl)) {
75
+ c.appendChild(b), n && (b.style.zIndex = n + 2);
76
+ const u = document.createElement("div");
77
+ u.className = "ab-message-text";
78
+ const p = (e.messageAlignment || e.He).toLowerCase();
79
+ u.className += " " + p + "-aligned";
80
+ let f = !1;
81
+ const g = document.createElement("div");
82
+ if (((g.className = "ab-image-area"), e.imageUrl)) {
73
83
  if (e.cropType === InAppMessage.CropType.CENTER_CROP) {
74
84
  const o = document.createElement("span");
75
85
  (o.className = "ab-center-cropped-img"),
76
86
  (o.style.backgroundImage = "url(" + e.imageUrl + ")"),
77
87
  o.setAttribute("role", "img"),
78
88
  o.setAttribute("aria-label", "Modal Image"),
79
- e.Le(o),
80
- f.appendChild(o);
89
+ e.Je(o),
90
+ g.appendChild(o);
81
91
  } else {
82
92
  const o = document.createElement("img");
83
- o.setAttribute("src", e.imageUrl),
84
- e.Le(o),
85
- (b = !0),
86
- (o.onload = c),
87
- setTimeout(c, 1e3),
88
- f.appendChild(o);
93
+ if (
94
+ (o.setAttribute("src", e.imageUrl),
95
+ e.Je(o),
96
+ 0 === document.querySelectorAll(".ab-iam-img-loading").length)
97
+ ) {
98
+ f = !0;
99
+ const e = document.querySelectorAll(".ab-iam-root");
100
+ e && e.length > 0 && e[0].classList.add("ab-iam-img-loading"),
101
+ (o.onload = l);
102
+ }
103
+ setTimeout(d, 1e3), g.appendChild(o);
89
104
  }
90
- n.appendChild(f), (d.className += " ab-with-image");
105
+ c.appendChild(g), (u.className += " ab-with-image");
91
106
  } else if (e.icon) {
92
- f.className += " ab-icon-area";
107
+ g.className += " ab-icon-area";
93
108
  const o = document.createElement("span");
94
109
  (o.className = "ab-icon"),
95
110
  e.sn() ||
96
- ((o.style.backgroundColor = me(e.iconBackgroundColor)),
97
- (o.style.color = me(e.iconColor)));
98
- const s = document.createElement("i");
99
- (s.className = "fa"),
100
- s.appendChild(document.createTextNode(e.icon)),
101
- s.setAttribute("aria-hidden", !0),
102
- o.appendChild(s),
103
- f.appendChild(o),
104
- n.appendChild(f),
105
- (d.className += " ab-with-icon");
111
+ ((o.style.backgroundColor = ne(e.iconBackgroundColor)),
112
+ (o.style.color = ne(e.iconColor)));
113
+ const a = document.createElement("i");
114
+ (a.className = "fa"),
115
+ a.appendChild(document.createTextNode(e.icon)),
116
+ a.setAttribute("aria-hidden", !0),
117
+ o.appendChild(a),
118
+ g.appendChild(o),
119
+ c.appendChild(g),
120
+ (u.className += " ab-with-icon");
106
121
  }
107
- if ((oe(d, "touchstart", function() {}), e.header && e.header.length > 0)) {
122
+ if ((oe(u, "touchstart", function() {}), e.header && e.header.length > 0)) {
108
123
  const o = document.createElement("h1");
109
- (o.className = "ab-message-header"), (e.Ie = r.it.nt()), (o.id = e.Ie);
110
- const s = (
124
+ (o.className = "ab-message-header"), (e.Ke = r.it.nt()), (o.id = e.Ke);
125
+ const a = (
111
126
  e.headerAlignment || InAppMessage.TextAlignment.CENTER
112
127
  ).toLowerCase();
113
- (o.className += " " + s + "-aligned"),
114
- e.sn() || (o.style.color = me(e.headerTextColor)),
128
+ (o.className += " " + a + "-aligned"),
129
+ e.sn() || (o.style.color = ne(e.headerTextColor)),
115
130
  o.appendChild(document.createTextNode(e.header)),
116
- d.appendChild(o);
131
+ u.appendChild(o);
117
132
  }
118
- return d.appendChild(e.Ae()), n.appendChild(d), b || c(), (e.mn = n), n;
119
- })(e, o, s, t, a);
133
+ return u.appendChild(e.Oe()), c.appendChild(u), f || d(), (e.mn = c), c;
134
+ })(e, o, a, s, t, n);
120
135
  if (e instanceof FullScreenMessage || e instanceof ModalMessage) {
121
- const s = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
122
- (l.className += ` ${s} ab-centered`),
123
- ce.Be(e, o, l, t),
124
- ce.Ee(l),
125
- ce.Ge(e.Ie, l);
136
+ const a = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
137
+ (b.className += ` ${a} ab-centered`),
138
+ me.Pe(e, o, b, t),
139
+ me.Qe(b),
140
+ me.Ve(e.Ke, b);
126
141
  } else if (e instanceof SlideUpMessage) {
127
- l.className += " ab-slideup";
128
- const o = l.getElementsByClassName("ab-close-button")[0];
142
+ b.className += " ab-slideup";
143
+ const o = b.getElementsByClassName("ab-close-button")[0];
129
144
  if (null != o) {
130
- const s = ae(
145
+ const a = ae(
131
146
  "0 0 11.38 19.44",
132
147
  "M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z",
133
- e.sn() ? void 0 : me(e.closeButtonColor)
148
+ e.sn() ? void 0 : ne(e.closeButtonColor)
134
149
  );
135
- s.setAttribute("class", "ab-chevron"), o.appendChild(s);
150
+ a.setAttribute("class", "ab-chevron"), o.appendChild(a);
136
151
  }
137
- let s, t;
138
- d(l, c.ot, e => {
139
- (l.className += " ab-swiped-left"), o.onclick(e);
152
+ let a, s;
153
+ d(b, c.ot, e => {
154
+ (b.className += " ab-swiped-left"), o.onclick(e);
140
155
  }),
141
- d(l, c.et, e => {
142
- (l.className += " ab-swiped-right"), o.onclick(e);
156
+ d(b, c.et, e => {
157
+ (b.className += " ab-swiped-right"), o.onclick(e);
143
158
  }),
144
159
  e.slideFrom === InAppMessage.SlideFrom.TOP
145
- ? ((s = c.He), (t = " ab-swiped-up"))
146
- : ((s = c.Je), (t = " ab-swiped-down")),
147
- d(l, s, e => {
148
- (l.className += t), o.onclick(e);
160
+ ? ((a = c.We), (s = " ab-swiped-up"))
161
+ : ((a = c.Xe), (s = " ab-swiped-down")),
162
+ d(b, a, e => {
163
+ (b.className += s), o.onclick(e);
149
164
  });
150
165
  }
151
- return l;
166
+ return b;
152
167
  }
@@ -1,11 +1,11 @@
1
1
  import InAppMessage from "../models/in-app-message.js";
2
2
  import { _handleBrazeAction as m } from "../../Core/handle-braze-action.js";
3
3
  import { logInAppMessageButtonClick } from "../log-in-app-message-button-click.js";
4
- import { toRgba as me } from "../../util/color-utils.js";
4
+ import { toRgba as ne } from "../../util/color-utils.js";
5
5
  import { addPassiveEventListener as oe } from "../../util/dom-utils.js";
6
6
  import { KeyCodes as at } from "../../util/key-codes.js";
7
- const ce = {
8
- Ee: t => {
7
+ const me = {
8
+ Qe: t => {
9
9
  const o = t.querySelectorAll(
10
10
  ".ab-close-button, .ab-message-text, .ab-message-button"
11
11
  );
@@ -24,13 +24,13 @@ const ce = {
24
24
  });
25
25
  }
26
26
  },
27
- Ge: (t, o) => {
27
+ Ve: (t, o) => {
28
28
  o.setAttribute("role", "dialog"),
29
29
  o.setAttribute("aria-modal", !0),
30
30
  o.setAttribute("aria-label", "Modal Message"),
31
31
  t && o.setAttribute("aria-labelledby", t);
32
32
  },
33
- Be: (t, o, e, s) => {
33
+ Pe: (t, o, e, s) => {
34
34
  if (t.buttons.length > 0) {
35
35
  const a = document.createElement("div");
36
36
  (a.className = "ab-message-buttons"), e.appendChild(a);
@@ -56,13 +56,13 @@ const ce = {
56
56
  "" === e.text && (l = " "),
57
57
  s.appendChild(document.createTextNode(l)),
58
58
  t.sn() ||
59
- ((s.style.backgroundColor = me(e.backgroundColor)),
60
- (s.style.color = me(e.textColor)),
61
- (s.style.borderColor = me(e.borderColor))),
59
+ ((s.style.backgroundColor = ne(e.backgroundColor)),
60
+ (s.style.color = ne(e.textColor)),
61
+ (s.style.borderColor = ne(e.borderColor))),
62
62
  (s.onclick = n(e)),
63
63
  a.appendChild(s);
64
64
  }
65
65
  }
66
66
  }
67
67
  };
68
- export default ce;
68
+ export default me;
@@ -46,7 +46,7 @@ export function newInAppMessageFromJson(e) {
46
46
  if (
47
47
  ((null != C && "" !== C && null != D && "" !== D) ||
48
48
  ((C = void 0), (D = void 0)),
49
- s === ModalMessage.es || s === InAppMessage.es.Ke)
49
+ s === ModalMessage.es || s === InAppMessage.es.Ye)
50
50
  )
51
51
  B = new ModalMessage(
52
52
  o,
@@ -1,16 +1,16 @@
1
1
  import ge from "./in-app-message-manager.js";
2
2
  import e from "../managers/braze-instance.js";
3
3
  const pe = {
4
- Oe: null,
4
+ Ze: null,
5
5
  t: !1,
6
6
  m: () => (
7
- pe.o(), pe.Oe || (pe.Oe = new ge(e.nr(), e.g(), e.l(), e.p())), pe.Oe
7
+ pe.o(), pe.Ze || (pe.Ze = new ge(e.nr(), e.g(), e.l(), e.p())), pe.Ze
8
8
  ),
9
9
  o: () => {
10
10
  pe.t || (e.u(pe), (pe.t = !0));
11
11
  },
12
12
  destroy: () => {
13
- (pe.Oe = null), (pe.t = !1);
13
+ (pe.Ze = null), (pe.t = !1);
14
14
  }
15
15
  };
16
16
  export default pe;
@@ -6,16 +6,16 @@ import InAppMessage from "./models/in-app-message.js";
6
6
  import InAppMessageButton from "./models/in-app-message-button.js";
7
7
  import s from "../common/event-logger.js";
8
8
  import { newInAppMessageFromJson as lt } from "./in-app-message-factory.js";
9
- import { randomInclusive as pt } from "../util/math.js";
9
+ import { randomInclusive as tt } from "../util/math.js";
10
10
  import t from "../models/request-result.js";
11
11
  import r from "../../shared-lib/braze-shared-lib.js";
12
12
  import u from "../managers/subscription-manager.js";
13
- import mt from "../triggers/models/trigger.js";
13
+ import pt from "../triggers/models/trigger.js";
14
14
  import { validateValueIsFromEnum as F } from "../util/code-utils.js";
15
15
  import { BRAZE_ACTION_URI_REGEX as O } from "../util/validation-utils.js";
16
16
  import {
17
- containsPushPrimerBrazeAction as gt,
18
- containsUnknownBrazeAction as ct,
17
+ containsPushPrimerBrazeAction as mt,
18
+ containsUnknownBrazeAction as gt,
19
19
  getDecodedBrazeAction as J,
20
20
  ineligibleBrazeActionURLErrorMessage as ht,
21
21
  INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as ft
@@ -27,27 +27,27 @@ export default class ge {
27
27
  (this.j = s),
28
28
  (this.h = i),
29
29
  (this.v = r),
30
- (this.Pe = new u()),
31
- e.jt(this.Pe),
32
- (this.Qe = 1e3),
33
- (this.Ue = 6e4);
30
+ (this.ni = new u()),
31
+ e.jt(this.ni),
32
+ (this.li = 1e3),
33
+ (this.ui = 6e4);
34
34
  }
35
- Ve() {
36
- return this.Pe;
35
+ pi() {
36
+ return this.ni;
37
37
  }
38
- We(t) {
39
- return this.Pe.ut(t);
38
+ mi(t) {
39
+ return this.ni.ut(t);
40
40
  }
41
- Xe() {
42
- return this.Ye;
41
+ gi() {
42
+ return this.ci;
43
43
  }
44
- Ze(t) {
45
- this.Ye = t;
44
+ fi(t) {
45
+ this.ci = t;
46
46
  }
47
- ni(e, i) {
47
+ di(e, i) {
48
48
  if (
49
49
  !F(
50
- InAppMessage.li,
50
+ InAppMessage.Ge,
51
51
  i,
52
52
  `${i} is not a valid in-app message display failure`,
53
53
  "InAppMessage.DisplayFailures"
@@ -55,14 +55,14 @@ export default class ge {
55
55
  )
56
56
  return new t();
57
57
  const n = { trigger_ids: [e], error_code: i };
58
- return s.G(r.A.ui, n);
58
+ return s.G(r.A.vi, n);
59
59
  }
60
60
  G(e, i, n, o) {
61
61
  const a = new t();
62
62
  let l;
63
63
  if (e instanceof ControlMessage) l = { trigger_ids: [e.triggerId] };
64
64
  else {
65
- if (i === r.A.pi || (e instanceof HtmlMessage && i === r.A.mi)) {
65
+ if (i === r.A.yi || (e instanceof HtmlMessage && i === r.A.ji)) {
66
66
  if (!e.k(o))
67
67
  return (
68
68
  r.D.info(
@@ -70,7 +70,7 @@ export default class ge {
70
70
  ),
71
71
  a
72
72
  );
73
- } else if (i === r.A.gi) {
73
+ } else if (i === r.A.bi) {
74
74
  if (!e.R())
75
75
  return (
76
76
  r.D.info(
@@ -79,11 +79,11 @@ export default class ge {
79
79
  a
80
80
  );
81
81
  }
82
- l = this.ci(e);
82
+ l = this.Ii(e);
83
83
  }
84
84
  return null == l ? a : (null != n && (l.bid = n), s.G(i, l));
85
85
  }
86
- fi(e, i) {
86
+ Ai(e, i) {
87
87
  const n = new t();
88
88
  if (!e.k())
89
89
  return (
@@ -92,24 +92,24 @@ export default class ge {
92
92
  ),
93
93
  n
94
94
  );
95
- const o = this.ci(i);
95
+ const o = this.Ii(i);
96
96
  return null == o
97
97
  ? n
98
- : e.id === InAppMessageButton.di
98
+ : e.id === InAppMessageButton.Mi
99
99
  ? (r.D.info(
100
100
  "This in-app message button does not have a tracking id. Not logging event to Braze servers."
101
101
  ),
102
102
  n)
103
- : (null != e.id && (o.bid = e.id), s.G(r.A.mi, o));
103
+ : (null != e.id && (o.bid = e.id), s.G(r.A.ji, o));
104
104
  }
105
- vi(t) {
105
+ zi(t) {
106
106
  if (!(t instanceof InAppMessage)) return;
107
107
  const s = t => {
108
108
  const s = J(t);
109
- return ct(s)
110
- ? ht(ft.yi, "In-App Message")
111
- : gt(s) && !dt.ji()
112
- ? ht(ft.bi, "In-App Message")
109
+ return gt(s)
110
+ ? ht(ft.Di, "In-App Message")
111
+ : mt(s) && !dt.Ti()
112
+ ? ht(ft._i, "In-App Message")
113
113
  : void 0;
114
114
  },
115
115
  e = t.buttons;
@@ -125,11 +125,11 @@ export default class ge {
125
125
  ? s(t.uri)
126
126
  : void 0;
127
127
  }
128
- Ii(t, s, e, i) {
129
- let n = this.vt.Ai(!1, !1);
128
+ ki(t, s, e, i) {
129
+ let n = this.vt.wi(!1, !1);
130
130
  (n = this.vt.Ps(n)),
131
131
  (n.template = { trigger_id: t.triggerId, trigger_event_type: s }),
132
- null != e && (n.template.data = e.Mi());
132
+ null != e && (n.template.data = e.Si());
133
133
  const o = this.vt.Bs(n);
134
134
  this.vt.Gs(n, () => {
135
135
  b.Hs({
@@ -139,35 +139,35 @@ export default class ge {
139
139
  S: async s => {
140
140
  if (!this.vt.Os(n, s, o))
141
141
  return (
142
- this.ni(t.triggerId, InAppMessage.li.zi),
143
- void ("function" == typeof t.Di && t.Di())
142
+ this.di(t.triggerId, InAppMessage.Ge.$i),
143
+ void ("function" == typeof t.Bi && t.Bi())
144
144
  );
145
145
  if ((this.vt.Qs(), null == s || null == s.templated_message))
146
- return void this.ni(t.triggerId, InAppMessage.li.zi);
146
+ return void this.di(t.triggerId, InAppMessage.Ge.$i);
147
147
  const e = s.templated_message;
148
- if (e.type !== mt._i.Ti)
149
- return void this.ni(t.triggerId, InAppMessage.li.ki);
148
+ if (e.type !== pt.Fi.Ei)
149
+ return void this.di(t.triggerId, InAppMessage.Ge.Gi);
150
150
  const i = lt(e.data);
151
- if (null == i) return void this.ni(t.triggerId, InAppMessage.li.ki);
152
- let a = this.vi(i);
151
+ if (null == i) return void this.di(t.triggerId, InAppMessage.Ge.Gi);
152
+ let a = this.zi(i);
153
153
  if (a)
154
- return r.D.error(a), void ("function" == typeof t.Di && t.Di());
155
- "function" == typeof t.wi
156
- ? t.wi(i)
157
- : this.ni(t.triggerId, InAppMessage.li.zi);
154
+ return r.D.error(a), void ("function" == typeof t.Bi && t.Bi());
155
+ "function" == typeof t.Ni
156
+ ? t.Ni(i)
157
+ : this.di(t.triggerId, InAppMessage.Ge.$i);
158
158
  },
159
159
  error: r => {
160
160
  let n = `getting user personalization for message ${t.triggerId}`;
161
- if (new Date().valueOf() - t.Si > t.$i)
162
- this.ni(t.triggerId, InAppMessage.li.zi);
161
+ if (new Date().valueOf() - t.qi > t.xi)
162
+ this.di(t.triggerId, InAppMessage.Ge.$i);
163
163
  else {
164
- const r = Math.min(t.$i, this.Ue),
165
- o = this.Qe;
164
+ const r = Math.min(t.xi, this.ui),
165
+ o = this.li;
166
166
  null == i && (i = o);
167
- const a = Math.min(r, pt(o, 3 * i));
167
+ const a = Math.min(r, tt(o, 3 * i));
168
168
  (n += `. Retrying in ${a} ms`),
169
169
  setTimeout(() => {
170
- this.Ii(t, s, e, a);
170
+ this.ki(t, s, e, a);
171
171
  }, a);
172
172
  }
173
173
  this.vt.Vs(r, n);
@@ -175,7 +175,7 @@ export default class ge {
175
175
  });
176
176
  });
177
177
  }
178
- ci(t) {
178
+ Ii(t) {
179
179
  if (null == t.triggerId)
180
180
  return (
181
181
  r.D.info(
@@ -11,9 +11,9 @@ export function logInAppMessageButtonClick(t, o) {
11
11
  if (!(t instanceof InAppMessageButton))
12
12
  return r.D.error("button must be an InAppMessageButton object"), !1;
13
13
  if (!(o instanceof InAppMessage)) return r.D.error(or), !1;
14
- const s = pe.m().fi(t, o);
14
+ const s = pe.m().Ai(t, o);
15
15
  if (s.S)
16
16
  for (let r = 0; r < s.ve.length; r++)
17
- W.er().je(V.Ar, [o.triggerId, t.id], s.ve[r]);
17
+ W.er().je(V.Br, [o.triggerId, t.id], s.ve[r]);
18
18
  return s.S;
19
19
  }