@braze/web-sdk 4.6.3 → 4.7.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.
Files changed (98) hide show
  1. package/index.d.ts +19 -14
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +2 -2
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +18 -17
  6. package/shared-lib/indexed-db-adapter.js +2 -2
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +17 -17
  9. package/src/Card/models/card.js +1 -1
  10. package/src/Core/handle-braze-action.js +40 -34
  11. package/src/Core/log-custom-event.js +2 -7
  12. package/src/Core/log-purchase.js +3 -3
  13. package/src/Core/wipe-data.js +2 -2
  14. package/src/FeatureFlags/feature-flag.js +33 -16
  15. package/src/FeatureFlags/feature-flags-provider.js +86 -75
  16. package/src/FeatureFlags/get-all-feature-flags.js +5 -5
  17. package/src/FeatureFlags/get-feature-flag.js +6 -6
  18. package/src/FeatureFlags/refresh-feature-flags.js +1 -1
  19. package/src/FeatureFlags/types.js +1 -0
  20. package/src/Feed/feed-provider.js +17 -17
  21. package/src/Feed/get-cached-feed.js +1 -1
  22. package/src/Feed/ui/show-feed.js +1 -1
  23. package/src/InAppMessage/display/html-message-to-html.js +135 -120
  24. package/src/InAppMessage/display/in-app-message-to-html.js +21 -21
  25. package/src/InAppMessage/display/modal-utils.js +6 -6
  26. package/src/InAppMessage/in-app-message-factory.js +3 -3
  27. package/src/InAppMessage/in-app-message-manager-factory.js +3 -3
  28. package/src/InAppMessage/in-app-message-manager.js +65 -65
  29. package/src/InAppMessage/log-in-app-message-button-click.js +4 -4
  30. package/src/InAppMessage/log-in-app-message-click.js +4 -4
  31. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  32. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  33. package/src/InAppMessage/models/full-screen-message.js +1 -1
  34. package/src/InAppMessage/models/html-message.js +1 -1
  35. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  36. package/src/InAppMessage/models/in-app-message.js +80 -80
  37. package/src/InAppMessage/models/modal-message.js +2 -2
  38. package/src/InAppMessage/models/slide-up-message.js +8 -8
  39. package/src/InAppMessage/models/templated-in-app-message.js +4 -4
  40. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  41. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  42. package/src/InAppMessage/ui/show-in-app-message.js +20 -20
  43. package/src/Push/push-manager.js +216 -209
  44. package/src/Push/utils/push-utils.js +4 -4
  45. package/src/User/user-manager.js +11 -8
  46. package/src/User/user.js +52 -41
  47. package/src/common/base-feed.js +1 -1
  48. package/src/common/base-provider.js +1 -1
  49. package/src/common/constants.js +2 -0
  50. package/src/common/feed-display.js +6 -6
  51. package/src/l10n/l10n-manager-factory.js +1 -1
  52. package/src/managers/auth-manager.js +24 -24
  53. package/src/managers/braze-instance.js +122 -122
  54. package/src/managers/device-manager.js +11 -11
  55. package/src/managers/network-manager.js +63 -54
  56. package/src/managers/server-config-manager.js +20 -20
  57. package/src/managers/session-manager.js +29 -29
  58. package/src/managers/storage-manager-factory.js +4 -4
  59. package/src/managers/storage-manager.js +104 -104
  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 +7 -7
  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 +15 -15
  67. package/src/request-controller.js +92 -88
  68. package/src/triggers/models/custom-event-data.js +4 -4
  69. package/src/triggers/models/custom-event-property-data.js +9 -9
  70. package/src/triggers/models/filter-set.js +9 -9
  71. package/src/triggers/models/filter.js +63 -63
  72. package/src/triggers/models/in-app-message-click-data.js +5 -5
  73. package/src/triggers/models/purchase-data.js +3 -3
  74. package/src/triggers/models/purchase-property-data.js +9 -9
  75. package/src/triggers/models/push-click-data.js +5 -5
  76. package/src/triggers/models/trigger-condition.js +48 -48
  77. package/src/triggers/models/trigger-events.js +1 -1
  78. package/src/triggers/models/trigger.js +29 -29
  79. package/src/triggers/triggers-provider-factory.js +2 -2
  80. package/src/triggers/triggers-provider.js +87 -89
  81. package/src/ui/js/attach-css.js +1 -1
  82. package/src/ui/js/feed-css.js +4 -4
  83. package/src/ui/js/iam-css.js +4 -4
  84. package/src/ui/js/load-font-awesome.js +1 -1
  85. package/src/util/base-device-parser.js +2 -2
  86. package/src/util/braze-actions.js +8 -8
  87. package/src/util/browser-detector.js +8 -8
  88. package/src/util/client-hints-parser.js +3 -3
  89. package/src/util/code-utils.js +10 -3
  90. package/src/util/component-utils.js +1 -1
  91. package/src/util/date-utils.js +2 -2
  92. package/src/util/device-constants.js +1 -1
  93. package/src/util/dom-utils.js +9 -9
  94. package/src/util/key-codes.js +1 -1
  95. package/src/util/net.js +3 -3
  96. package/src/util/user-agent-parser.js +4 -4
  97. package/src/util/validation-utils.js +155 -74
  98. package/src/util/window-utils.js +1 -1
@@ -3,89 +3,89 @@ import ot from "../../util/browser-detector.js";
3
3
  import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
4
4
  import { getUser as Q } from "../../Core/get-user.js";
5
5
  import { InAppMessage } from "../index.js";
6
- import { keys as rr } from "../../util/code-utils.js";
6
+ import { keys as or } from "../../util/code-utils.js";
7
7
  import { OperatingSystems as rt } from "../../util/device-constants.js";
8
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 ct(t, n, e, o, s, r) {
11
- const i = document.createElement("iframe");
12
- i.setAttribute("title", "Modal Message"), s && (i.style.zIndex = s + 1);
13
- const u = n => {
14
- const e = n.getAttribute("href"),
15
- s = n.onclick;
16
- return r => {
17
- if (null != s && "function" == typeof s && !1 === s()) return;
18
- let u = ut(e).abButtonId;
10
+ export default function ct(t, e, n, o, r, s) {
11
+ const u = document.createElement("iframe");
12
+ u.setAttribute("title", "Modal Message"), r && (u.style.zIndex = r + 1);
13
+ const i = e => {
14
+ const n = e.getAttribute("href"),
15
+ r = e.onclick;
16
+ return s => {
17
+ if (null != r && "function" == typeof r && !1 === r()) return;
18
+ let i = ut(n).abButtonId;
19
19
  if (
20
- ((null != u && "" !== u) || (u = n.getAttribute("id")),
21
- null != e && "" !== e && 0 !== e.indexOf("#"))
20
+ ((null != i && "" !== i) || (i = e.getAttribute("id")),
21
+ null != n && "" !== n && 0 !== n.indexOf("#"))
22
22
  ) {
23
- const s =
23
+ const r =
24
24
  "blank" ===
25
- (n.getAttribute("target") || "").toLowerCase().replace("_", ""),
26
- c = o || t.openTarget === InAppMessage.OpenTarget.BLANK || s,
27
- a = () => {
28
- logInAppMessageHtmlClick(t, u, e), H.openUri(e, c, r);
25
+ (e.getAttribute("target") || "").toLowerCase().replace("_", ""),
26
+ c = o || t.openTarget === InAppMessage.OpenTarget.BLANK || r,
27
+ l = () => {
28
+ logInAppMessageHtmlClick(t, i, n), H.openUri(n, c, s);
29
29
  };
30
- c ? a() : t.on(i, a);
31
- } else logInAppMessageHtmlClick(t, u, e);
32
- return r.stopPropagation(), !1;
30
+ c ? l() : t.he(u, l);
31
+ } else logInAppMessageHtmlClick(t, i, n);
32
+ return s.stopPropagation(), !1;
33
33
  };
34
34
  },
35
- c = (t, n, e) => {
36
- const o = `([\\w]+)\\s*=\\s*document.createElement\\(['"]${e}['"]\\)`,
37
- s = t.match(new RegExp(o));
38
- if (s) {
39
- const e = `${s[1]}.setAttribute("nonce", "${n}")`;
40
- return `${t.slice(0, s.index + s[0].length)};${e};${t.slice(
41
- s.index + s[0].length
35
+ c = (t, e, n) => {
36
+ const o = `([\\w]+)\\s*=\\s*document.createElement\\(['"]${n}['"]\\)`,
37
+ r = t.match(new RegExp(o));
38
+ if (r) {
39
+ const n = `${r[1]}.setAttribute("nonce", "${e}")`;
40
+ return `${t.slice(0, r.index + r[0].length)};${n};${t.slice(
41
+ r.index + r[0].length
42
42
  )}`;
43
43
  }
44
44
  return null;
45
45
  };
46
46
  if (
47
- ((i.onload = () => {
47
+ ((u.onload = () => {
48
48
  let o = null;
49
- if (null != r) {
49
+ if (null != s) {
50
50
  (o = document.createElement("html")), (o.innerHTML = t.message);
51
- const n = o.getElementsByTagName("style");
52
- for (let t = 0; t < n.length; t++) n[t].setAttribute("nonce", r);
53
- const e = o.getElementsByTagName("script");
54
- for (let t = 0; t < e.length; t++) {
55
- e[t].setAttribute("nonce", r),
56
- (e[t].innerHTML = e[t].innerHTML.replace(
51
+ const e = o.getElementsByTagName("style");
52
+ for (let t = 0; t < e.length; t++) e[t].setAttribute("nonce", s);
53
+ const n = o.getElementsByTagName("script");
54
+ for (let t = 0; t < n.length; t++) {
55
+ n[t].setAttribute("nonce", s),
56
+ (n[t].innerHTML = n[t].innerHTML.replace(
57
57
  /<style>/g,
58
- `<style nonce='${r}'>`
58
+ `<style nonce='${s}'>`
59
59
  ));
60
- const n = c(e[t].innerHTML, r, "script");
61
- n && (e[t].innerHTML = n);
62
- const o = c(e[t].innerHTML, r, "style");
63
- o && (e[t].innerHTML = o);
60
+ const e = c(n[t].innerHTML, s, "script");
61
+ e && (n[t].innerHTML = e);
62
+ const o = c(n[t].innerHTML, s, "style");
63
+ o && (n[t].innerHTML = o);
64
64
  }
65
65
  }
66
- i.contentWindow.focus(),
67
- i.contentWindow.document.write(o ? o.innerHTML : t.message);
68
- const s = i.contentWindow.document.getElementsByTagName("head")[0];
69
- if (null != s) {
70
- if ((nt(s), t.sn())) {
71
- const n = document.createElement("style");
72
- (n.innerHTML = t.css),
73
- (n.id = t.rn()),
74
- null != r && n.setAttribute("nonce", r),
75
- s.appendChild(n);
66
+ u.contentWindow.focus(),
67
+ u.contentWindow.document.write(o ? o.innerHTML : t.message);
68
+ const r = u.contentWindow.document.getElementsByTagName("head")[0];
69
+ if (null != r) {
70
+ if ((nt(r), t.ye())) {
71
+ const e = document.createElement("style");
72
+ (e.innerHTML = t.css),
73
+ (e.id = t.Ae()),
74
+ null != s && e.setAttribute("nonce", s),
75
+ r.appendChild(e);
76
76
  }
77
- const n = i.contentWindow.document.createElement("base");
78
- n.setAttribute("target", "_parent"), s.appendChild(n);
77
+ const e = u.contentWindow.document.createElement("base");
78
+ e.setAttribute("target", "_parent"), r.appendChild(e);
79
79
  }
80
- const a = i.contentWindow.document.getElementsByTagName("title");
81
- a.length > 0 && i.setAttribute("title", a[0].textContent);
82
- const l = {
80
+ const l = u.contentWindow.document.getElementsByTagName("title");
81
+ l.length > 0 && u.setAttribute("title", l[0].textContent);
82
+ const a = {
83
83
  closeMessage: function() {
84
- t.on(i);
84
+ t.he(u);
85
85
  },
86
86
  logClick: function() {
87
- const n = [t, ...arguments];
88
- logInAppMessageHtmlClick.apply(t, Array.prototype.slice.call(n));
87
+ const e = [t, ...arguments];
88
+ logInAppMessageHtmlClick.apply(t, Array.prototype.slice.call(e));
89
89
  },
90
90
  display: {},
91
91
  web: {}
@@ -93,8 +93,8 @@ export default function ct(t, n, e, o, s, r) {
93
93
  requestPushPermission = function() {
94
94
  return function() {
95
95
  const t = arguments;
96
- import("../../Push/request-push-permission.js").then(n => {
97
- n.requestPushPermission.apply(
96
+ import("../../Push/request-push-permission.js").then(e => {
97
+ e.requestPushPermission.apply(
98
98
  null,
99
99
  Array.prototype.slice.call(t)
100
100
  );
@@ -102,34 +102,49 @@ export default function ct(t, n, e, o, s, r) {
102
102
  };
103
103
  },
104
104
  m = {
105
- requestImmediateDataFlush: async function() {
106
- const t = arguments,
107
- n = await import("../../Core/request-immediate-data-flush.js");
108
- n.requestImmediateDataFlush.apply(
109
- null,
110
- Array.prototype.slice.call(t)
105
+ requestImmediateDataFlush: function() {
106
+ const t = arguments;
107
+ import("../../Core/request-immediate-data-flush.js").then(
108
+ ({ requestImmediateDataFlush: requestImmediateDataFlush }) => {
109
+ requestImmediateDataFlush.apply(
110
+ null,
111
+ Array.prototype.slice.call(t)
112
+ );
113
+ }
111
114
  );
112
115
  },
113
- logCustomEvent: async function() {
114
- const t = arguments,
115
- n = await import("../../Core/log-custom-event.js");
116
- n.logCustomEvent.apply(null, Array.prototype.slice.call(t));
116
+ logCustomEvent: function() {
117
+ const t = arguments;
118
+ import("../../Core/log-custom-event.js").then(
119
+ ({ logCustomEvent: logCustomEvent }) => {
120
+ logCustomEvent.apply(null, Array.prototype.slice.call(t));
121
+ }
122
+ );
117
123
  },
118
- logPurchase: async function() {
119
- const t = arguments,
120
- n = await import("../../Core/log-purchase.js");
121
- n.logPurchase.apply(null, Array.prototype.slice.call(t));
124
+ logPurchase: function() {
125
+ const t = arguments;
126
+ import("../../Core/log-purchase.js").then(
127
+ ({ logPurchase: logPurchase }) => {
128
+ logPurchase.apply(null, Array.prototype.slice.call(t));
129
+ }
130
+ );
122
131
  },
123
- unregisterPush: async function() {
124
- const t = arguments,
125
- n = await import("../../Push/unregister-push.js");
126
- n.unregisterPush.apply(null, Array.prototype.slice.call(t));
132
+ unregisterPush: function() {
133
+ const t = arguments;
134
+ import("../../Push/unregister-push.js").then(
135
+ ({ unregisterPush: unregisterPush }) => {
136
+ unregisterPush.apply(null, Array.prototype.slice.call(t));
137
+ }
138
+ );
127
139
  },
128
140
  requestPushPermission: requestPushPermission(),
129
- changeUser: async function() {
130
- const t = arguments,
131
- n = await import("../../Core/change-user.js");
132
- n.changeUser.apply(null, Array.prototype.slice.call(t));
141
+ changeUser: function() {
142
+ const t = arguments;
143
+ import("../../Core/change-user.js").then(
144
+ ({ changeUser: changeUser }) => {
145
+ changeUser.apply(null, Array.prototype.slice.call(t));
146
+ }
147
+ );
133
148
  }
134
149
  },
135
150
  f = function(t) {
@@ -137,7 +152,7 @@ export default function ct(t, n, e, o, s, r) {
137
152
  m[t].apply(null, Array.prototype.slice.call(arguments));
138
153
  };
139
154
  };
140
- for (const t of rr(m)) l[t] = f(t);
155
+ for (const t of or(m)) a[t] = f(t);
141
156
  const p = [
142
157
  "setFirstName",
143
158
  "setLastName",
@@ -161,63 +176,63 @@ export default function ct(t, n, e, o, s, r) {
161
176
  ],
162
177
  d = function(t) {
163
178
  return function() {
164
- const n = Q();
165
- n[t].apply(n, Array.prototype.slice.call(arguments));
179
+ const e = Q();
180
+ e[t].apply(e, Array.prototype.slice.call(arguments));
166
181
  };
167
182
  },
168
- y = {};
169
- for (let t = 0; t < p.length; t++) y[p[t]] = d(p[t]);
170
- l.getUser = function() {
171
- return y;
183
+ g = {};
184
+ for (let t = 0; t < p.length; t++) g[p[t]] = d(p[t]);
185
+ a.getUser = function() {
186
+ return g;
172
187
  };
173
- const b = { showFeed: n },
174
- g = function(n) {
188
+ const h = { showFeed: e },
189
+ b = function(e) {
175
190
  return function() {
176
- const e = arguments;
177
- t.on(i, function() {
178
- b[n].apply(null, Array.prototype.slice.call(e));
191
+ const n = arguments;
192
+ t.he(u, function() {
193
+ h[e].apply(null, Array.prototype.slice.call(n));
179
194
  });
180
195
  };
181
196
  };
182
- for (const t of rr(b)) l.display[t] = g(t);
183
- const h = { registerAppboyPushMessages: requestPushPermission() },
197
+ for (const t of or(h)) a.display[t] = b(t);
198
+ const y = { registerAppboyPushMessages: requestPushPermission() },
184
199
  A = function(t) {
185
200
  return function() {
186
- h[t].apply(null, Array.prototype.slice.call(arguments));
201
+ y[t].apply(null, Array.prototype.slice.call(arguments));
187
202
  };
188
203
  };
189
- for (const t of rr(h)) l.web[t] = A(t);
204
+ for (const t of or(y)) a.web[t] = A(t);
190
205
  if (
191
- ((i.contentWindow.appboyBridge = l),
192
- (i.contentWindow.brazeBridge = l),
193
- t.un !== InAppMessage.es.cn)
206
+ ((u.contentWindow.appboyBridge = a),
207
+ (u.contentWindow.brazeBridge = a),
208
+ t.Ce !== InAppMessage.es.Pe)
194
209
  ) {
195
- const t = i.contentWindow.document.getElementsByTagName("a");
196
- for (let n = 0; n < t.length; n++) t[n].onclick = u(t[n]);
197
- const n = i.contentWindow.document.getElementsByTagName("button");
198
- for (let t = 0; t < n.length; t++) n[t].onclick = u(n[t]);
210
+ const t = u.contentWindow.document.getElementsByTagName("a");
211
+ for (let e = 0; e < t.length; e++) t[e].onclick = i(t[e]);
212
+ const e = u.contentWindow.document.getElementsByTagName("button");
213
+ for (let t = 0; t < e.length; t++) e[t].onclick = i(e[t]);
199
214
  }
200
- const j = i.contentWindow.document.body;
215
+ const j = u.contentWindow.document.body;
201
216
  if (null != j) {
202
- t.an() && (j.id = t.htmlId);
203
- const n = document.createElement("hidden");
204
- (n.onclick = l.closeMessage),
205
- (n.className = "ab-programmatic-close-button"),
206
- j.appendChild(n);
217
+ t.Ee() && (j.id = t.htmlId);
218
+ const e = document.createElement("hidden");
219
+ (e.onclick = a.closeMessage),
220
+ (e.className = "ab-programmatic-close-button"),
221
+ j.appendChild(e);
207
222
  }
208
- i.contentWindow.dispatchEvent(new CustomEvent("ab.BridgeReady")),
209
- -1 !== i.className.indexOf("ab-start-hidden") &&
210
- ((i.className = i.className.replace("ab-start-hidden", "")), e(i)),
211
- document.activeElement !== i && i.focus();
223
+ u.contentWindow.dispatchEvent(new CustomEvent("ab.BridgeReady")),
224
+ -1 !== u.className.indexOf("ab-start-hidden") &&
225
+ ((u.className = u.className.replace("ab-start-hidden", "")), n(u)),
226
+ document.activeElement !== u && u.focus();
212
227
  }),
213
- (i.className =
228
+ (u.className =
214
229
  "ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
215
- ot.OS === rt.ln)
230
+ ot.OS === rt.$e)
216
231
  ) {
217
- const n = document.createElement("div");
232
+ const e = document.createElement("div");
218
233
  return (
219
- (n.className = "ab-ios-scroll-wrapper"), n.appendChild(i), (t.mn = n), n
234
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(u), (t.qe = e), e
220
235
  );
221
236
  }
222
- return (t.mn = i), i;
237
+ return (t.qe = u), u;
223
238
  }
@@ -17,16 +17,16 @@ import ct from "./html-message-to-html.js";
17
17
  import me from "./modal-utils.js";
18
18
  import r from "../../../shared-lib/braze-shared-lib.js";
19
19
  export default function ce(e, o, a, s, t, n, l) {
20
- if (((e.Le = document.activeElement), e instanceof HtmlMessage))
20
+ if (((e.ke = document.activeElement), e instanceof HtmlMessage))
21
21
  return ct(e, o, a, t, n, l);
22
22
  const b = (function(e, o, a, s, t, n) {
23
23
  const c = document.createElement("div");
24
24
  (c.className = "ab-in-app-message ab-start-hidden ab-background"),
25
25
  n && (c.style.zIndex = n + 1),
26
- e.Ie() &&
26
+ e.xe() &&
27
27
  ((c.className += " ab-modal-interactions"),
28
28
  c.setAttribute("tabindex", "-1")),
29
- e.sn() ||
29
+ e.ye() ||
30
30
  ((c.style.color = ne(e.textColor)),
31
31
  (c.style.backgroundColor = ne(e.backgroundColor)),
32
32
  ie(e.backgroundColor) && (c.className += " ab-no-shadow"));
@@ -36,7 +36,7 @@ export default function ce(e, o, a, s, t, n, l) {
36
36
  document.querySelectorAll(".ab-iam-img-loading").length > 0
37
37
  ? s(
38
38
  `Cannot show in-app message ${e.message} because another message is being shown.`,
39
- InAppMessage.Ge.Ee
39
+ InAppMessage.Me.ze
40
40
  )
41
41
  : a(c));
42
42
  },
@@ -52,7 +52,7 @@ export default function ce(e, o, a, s, t, n, l) {
52
52
  (e.clickAction !== InAppMessage.ClickAction.NONE &&
53
53
  (c.className += " ab-clickable"),
54
54
  (c.onclick = a => (
55
- e.on(c, () => {
55
+ e.he(c, () => {
56
56
  logInAppMessageClick(e),
57
57
  e.clickAction === InAppMessage.ClickAction.URI
58
58
  ? m(
@@ -67,15 +67,15 @@ export default function ce(e, o, a, s, t, n, l) {
67
67
  )));
68
68
  const b = i(
69
69
  "Close Message",
70
- e.sn() ? void 0 : ne(e.closeButtonColor),
70
+ e.ye() ? void 0 : ne(e.closeButtonColor),
71
71
  () => {
72
- e.on(c);
72
+ e.he(c);
73
73
  }
74
74
  );
75
75
  c.appendChild(b), n && (b.style.zIndex = n + 2);
76
76
  const u = document.createElement("div");
77
77
  u.className = "ab-message-text";
78
- const p = (e.messageAlignment || e.He).toLowerCase();
78
+ const p = (e.messageAlignment || e.Le).toLowerCase();
79
79
  u.className += " " + p + "-aligned";
80
80
  let f = !1;
81
81
  const g = document.createElement("div");
@@ -86,13 +86,13 @@ export default function ce(e, o, a, s, t, n, l) {
86
86
  (o.style.backgroundImage = "url(" + e.imageUrl + ")"),
87
87
  o.setAttribute("role", "img"),
88
88
  o.setAttribute("aria-label", "Modal Image"),
89
- e.Je(o),
89
+ e.Ie(o),
90
90
  g.appendChild(o);
91
91
  } else {
92
92
  const o = document.createElement("img");
93
93
  if (
94
94
  (o.setAttribute("src", e.imageUrl),
95
- e.Je(o),
95
+ e.Ie(o),
96
96
  0 === document.querySelectorAll(".ab-iam-img-loading").length)
97
97
  ) {
98
98
  f = !0;
@@ -107,7 +107,7 @@ export default function ce(e, o, a, s, t, n, l) {
107
107
  g.className += " ab-icon-area";
108
108
  const o = document.createElement("span");
109
109
  (o.className = "ab-icon"),
110
- e.sn() ||
110
+ e.ye() ||
111
111
  ((o.style.backgroundColor = ne(e.iconBackgroundColor)),
112
112
  (o.style.color = ne(e.iconColor)));
113
113
  const a = document.createElement("i");
@@ -119,25 +119,25 @@ export default function ce(e, o, a, s, t, n, l) {
119
119
  c.appendChild(g),
120
120
  (u.className += " ab-with-icon");
121
121
  }
122
- if ((oe(u, "touchstart", function() {}), e.header && e.header.length > 0)) {
122
+ if ((oe(u, "touchstart"), e.header && e.header.length > 0)) {
123
123
  const o = document.createElement("h1");
124
- (o.className = "ab-message-header"), (e.Ke = r.it.nt()), (o.id = e.Ke);
124
+ (o.className = "ab-message-header"), (e.Te = r.it.nt()), (o.id = e.Te);
125
125
  const a = (
126
126
  e.headerAlignment || InAppMessage.TextAlignment.CENTER
127
127
  ).toLowerCase();
128
128
  (o.className += " " + a + "-aligned"),
129
- e.sn() || (o.style.color = ne(e.headerTextColor)),
129
+ e.ye() || (o.style.color = ne(e.headerTextColor)),
130
130
  o.appendChild(document.createTextNode(e.header)),
131
131
  u.appendChild(o);
132
132
  }
133
- return u.appendChild(e.Oe()), c.appendChild(u), f || d(), (e.mn = c), c;
133
+ return u.appendChild(e.Be()), c.appendChild(u), f || d(), (e.qe = c), c;
134
134
  })(e, o, a, s, t, n);
135
135
  if (e instanceof FullScreenMessage || e instanceof ModalMessage) {
136
136
  const a = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
137
137
  (b.className += ` ${a} ab-centered`),
138
- me.Pe(e, o, b, t),
139
- me.Qe(b),
140
- me.Ve(e.Ke, b);
138
+ me.De(e, o, b, t),
139
+ me.Ge(b),
140
+ me.He(e.Te, b);
141
141
  } else if (e instanceof SlideUpMessage) {
142
142
  b.className += " ab-slideup";
143
143
  const o = b.getElementsByClassName("ab-close-button")[0];
@@ -145,7 +145,7 @@ export default function ce(e, o, a, s, t, n, l) {
145
145
  const a = ae(
146
146
  "0 0 11.38 19.44",
147
147
  "M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z",
148
- e.sn() ? void 0 : ne(e.closeButtonColor)
148
+ e.ye() ? void 0 : ne(e.closeButtonColor)
149
149
  );
150
150
  a.setAttribute("class", "ab-chevron"), o.appendChild(a);
151
151
  }
@@ -157,8 +157,8 @@ export default function ce(e, o, a, s, t, n, l) {
157
157
  (b.className += " ab-swiped-right"), o.onclick(e);
158
158
  }),
159
159
  e.slideFrom === InAppMessage.SlideFrom.TOP
160
- ? ((a = c.We), (s = " ab-swiped-up"))
161
- : ((a = c.Xe), (s = " ab-swiped-down")),
160
+ ? ((a = c.Je), (s = " ab-swiped-up"))
161
+ : ((a = c.Ke), (s = " ab-swiped-down")),
162
162
  d(b, a, e => {
163
163
  (b.className += s), o.onclick(e);
164
164
  });
@@ -5,7 +5,7 @@ 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
7
  const me = {
8
- Qe: t => {
8
+ Ge: t => {
9
9
  const o = t.querySelectorAll(
10
10
  ".ab-close-button, .ab-message-text, .ab-message-button"
11
11
  );
@@ -24,20 +24,20 @@ const me = {
24
24
  });
25
25
  }
26
26
  },
27
- Ve: (t, o) => {
27
+ He: (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
- Pe: (t, o, e, s) => {
33
+ De: (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);
37
37
  const l = e.getElementsByClassName("ab-message-text")[0];
38
38
  null != l && (l.className += " ab-with-buttons");
39
39
  const n = a => l => (
40
- t.on(e, () => {
40
+ t.he(e, () => {
41
41
  logInAppMessageButtonClick(a, t),
42
42
  a.clickAction === InAppMessage.ClickAction.URI
43
43
  ? m(a.uri, l, s || t.openTarget === InAppMessage.OpenTarget.BLANK)
@@ -51,11 +51,11 @@ const me = {
51
51
  s = document.createElement("button");
52
52
  (s.className = "ab-message-button"),
53
53
  s.setAttribute("type", "button"),
54
- oe(s, "touchstart", function() {});
54
+ oe(s, "touchstart");
55
55
  let l = e.text;
56
56
  "" === e.text && (l = " "),
57
57
  s.appendChild(document.createTextNode(l)),
58
- t.sn() ||
58
+ t.ye() ||
59
59
  ((s.style.backgroundColor = ne(e.backgroundColor)),
60
60
  (s.style.color = ne(e.textColor)),
61
61
  (s.style.borderColor = ne(e.borderColor))),
@@ -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.Ye)
49
+ s === ModalMessage.es || s === InAppMessage.es.Ne)
50
50
  )
51
51
  B = new ModalMessage(
52
52
  o,
@@ -133,7 +133,7 @@ export function newInAppMessageFromJson(e) {
133
133
  D
134
134
  );
135
135
  else {
136
- if (s !== HtmlMessage.es && s !== InAppMessage.es.cn)
136
+ if (s !== HtmlMessage.es && s !== InAppMessage.es.Pe)
137
137
  return void r.D.error("Ignoring message with unknown type " + s);
138
138
  {
139
139
  const s = e.message_fields;
@@ -141,5 +141,5 @@ export function newInAppMessageFromJson(e) {
141
141
  (B.trusted = e.trusted || !1);
142
142
  }
143
143
  }
144
- return (B.un = s), B;
144
+ return (B.Ce = s), B;
145
145
  }
@@ -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
- Ze: null,
4
+ _e: null,
5
5
  t: !1,
6
6
  m: () => (
7
- pe.o(), pe.Ze || (pe.Ze = new ge(e.nr(), e.g(), e.l(), e.p())), pe.Ze
7
+ pe.o(), pe._e || (pe._e = new ge(e.nr(), e.g(), e.l(), e.p())), pe._e
8
8
  ),
9
9
  o: () => {
10
10
  pe.t || (e.u(pe), (pe.t = !0));
11
11
  },
12
12
  destroy: () => {
13
- (pe.Ze = null), (pe.t = !1);
13
+ (pe._e = null), (pe.t = !1);
14
14
  }
15
15
  };
16
16
  export default pe;