@braze/web-sdk 5.3.0 → 5.3.2

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 (63) hide show
  1. package/index.d.ts +1 -1
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +3 -3
  4. package/shared-lib/logger.js +2 -2
  5. package/src/InAppMessage/display/html-message-display-utils.js +172 -0
  6. package/src/InAppMessage/display/html-message-to-html.js +54 -219
  7. package/src/InAppMessage/display/in-app-message-to-html.js +21 -21
  8. package/src/InAppMessage/display/modal-utils.js +7 -7
  9. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  10. package/src/InAppMessage/in-app-message-factory.js +4 -4
  11. package/src/InAppMessage/in-app-message-manager.js +56 -56
  12. package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
  13. package/src/InAppMessage/log-in-app-message-click.js +1 -1
  14. package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
  15. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  16. package/src/InAppMessage/models/full-screen-message.js +2 -2
  17. package/src/InAppMessage/models/html-message.js +2 -2
  18. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  19. package/src/InAppMessage/models/in-app-message.js +26 -26
  20. package/src/InAppMessage/models/modal-message.js +2 -2
  21. package/src/InAppMessage/models/slide-up-message.js +4 -4
  22. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  23. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  24. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  25. package/src/InAppMessage/ui/show-in-app-message.js +10 -10
  26. package/src/InAppMessage/utils/in-app-message-utils.js +1 -18
  27. package/src/Push/is-push-blocked.js +2 -2
  28. package/src/Push/is-push-permission-granted.js +2 -2
  29. package/src/Push/is-push-supported.js +2 -2
  30. package/src/Push/push-manager.js +10 -10
  31. package/src/Push/utils/push-utils.js +10 -10
  32. package/src/User/user-manager.js +1 -1
  33. package/src/User/user.js +15 -15
  34. package/src/common/feed-display.js +8 -8
  35. package/src/managers/auth-manager.js +1 -1
  36. package/src/managers/braze-instance.js +13 -13
  37. package/src/managers/device-manager.js +2 -2
  38. package/src/managers/network-manager.js +17 -17
  39. package/src/managers/server-config-manager.js +3 -3
  40. package/src/managers/storage-manager-factory.js +3 -3
  41. package/src/managers/storage-manager.js +1 -1
  42. package/src/models/braze-event.js +7 -7
  43. package/src/models/device.js +2 -2
  44. package/src/models/server-config.js +7 -7
  45. package/src/request-controller.js +3 -3
  46. package/src/triggers/models/custom-event-data.js +2 -2
  47. package/src/triggers/models/custom-event-property-data.js +4 -4
  48. package/src/triggers/models/filter-set.js +3 -3
  49. package/src/triggers/models/filter.js +6 -6
  50. package/src/triggers/models/purchase-data.js +2 -2
  51. package/src/triggers/models/purchase-property-data.js +4 -4
  52. package/src/triggers/models/trigger-condition.js +38 -38
  53. package/src/triggers/models/trigger.js +12 -12
  54. package/src/triggers/triggers-provider-factory.js +1 -1
  55. package/src/triggers/triggers-provider.js +12 -12
  56. package/src/ui/js/attach-css.js +1 -1
  57. package/src/util/braze-actions.js +4 -4
  58. package/src/util/component-utils.js +2 -2
  59. package/src/util/date-utils.js +2 -2
  60. package/src/util/dom-utils.js +3 -3
  61. package/src/util/net.js +2 -2
  62. package/src/util/request-header-utils.js +1 -1
  63. package/src/util/validation-utils.js +17 -17
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v5.3.0
2
+ * Type definitions for @braze/web-sdk v5.3.2
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2024 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "5.3.0",
3
+ "version": "5.3.2",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -11,9 +11,9 @@ const i = {
11
11
  F: "ccd",
12
12
  ql: "ss",
13
13
  xl: "se",
14
- Oi: "si",
15
- Ei: "sc",
16
- Gi: "sbc",
14
+ Gi: "si",
15
+ $i: "sc",
16
+ Ei: "sbc",
17
17
  Cc: "sfe",
18
18
  mo: "iec",
19
19
  Uu: "lr",
@@ -24,13 +24,13 @@ const r = {
24
24
  },
25
25
  warn: function (n) {
26
26
  if (r.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v5.3.0)";
27
+ const o = "Braze SDK Warning: " + n + " (v5.3.2)";
28
28
  null != r.vd ? r.vd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
32
  if (r.zg) {
33
- const o = "Braze SDK Error: " + n + " (v5.3.0)";
33
+ const o = "Braze SDK Error: " + n + " (v5.3.2)";
34
34
  null != r.vd ? r.vd(o) : console.error(o);
35
35
  }
36
36
  },
@@ -0,0 +1,172 @@
1
+ import { getUser as ro } from "../../Core/get-user.js";
2
+ import { keys as to } from "../../util/code-utils.js";
3
+ import { parseQueryStringKeyValues as ut } from "../../util/url-utils.js";
4
+ import { WindowUtils as eo } from "../../util/window-utils.js";
5
+ import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
6
+ import InAppMessage from "../models/in-app-message.js";
7
+ import e from "../../managers/braze-instance.js";
8
+ import { logger as r } from "../../../shared-lib/index.js";
9
+ import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../../common/constants.js";
10
+ export const buildHtmlClickHandler = (t, r, e, o) => {
11
+ const s = e.getAttribute("href"),
12
+ n = e.onclick;
13
+ return (i) => {
14
+ if (null != n && "function" == typeof n && !1 === n.bind(e)(i)) return;
15
+ let u = ut(s).abButtonId;
16
+ if (
17
+ ((null != u && "" !== u) || (u = e.getAttribute("id") || void 0),
18
+ null != s && "" !== s && 0 !== s.indexOf("#"))
19
+ ) {
20
+ const n =
21
+ "blank" ===
22
+ (e.getAttribute("target") || "").toLowerCase().replace("_", ""),
23
+ c = o || t.openTarget === InAppMessage.OpenTarget.BLANK || n,
24
+ a = () => {
25
+ logInAppMessageHtmlClick(t, u, s), eo.openUri(s, c, i);
26
+ };
27
+ c ? a() : t.Cr(r, a);
28
+ } else logInAppMessageHtmlClick(t, u, s || void 0);
29
+ return i.stopPropagation(), !1;
30
+ };
31
+ };
32
+ export const applyNonceToDynamicallyCreatedTags = (t, r, e) => {
33
+ const o = `([\\w]+)\\s*=\\s*document.createElement\\(['"]${e}['"]\\)`,
34
+ s = t.match(new RegExp(o));
35
+ if (s) {
36
+ const e = `${s[1]}.setAttribute("nonce", "${r}")`;
37
+ return `${t.slice(0, s.index + s[0].length)};${e};${t.slice(
38
+ s.index + s[0].length,
39
+ )}`;
40
+ }
41
+ return null;
42
+ };
43
+ export const buildBrazeBridge = (t, o, s) => {
44
+ const n = {
45
+ closeMessage: function () {
46
+ t.Cr(o);
47
+ },
48
+ logClick: function () {
49
+ logInAppMessageHtmlClick(t, ...arguments);
50
+ },
51
+ display: {},
52
+ web: {},
53
+ },
54
+ requestPushPermission = function () {
55
+ return function () {
56
+ const t = arguments;
57
+ import("../../Push/request-push-permission.js").then((o) => {
58
+ e.so()
59
+ ? o.requestPushPermission(...Array.prototype.slice.call(t))
60
+ : r.error(_);
61
+ });
62
+ };
63
+ },
64
+ i = {
65
+ requestImmediateDataFlush: function () {
66
+ const t = arguments;
67
+ import("../../Core/request-immediate-data-flush.js").then(
68
+ ({ requestImmediateDataFlush: requestImmediateDataFlush }) => {
69
+ e.so()
70
+ ? requestImmediateDataFlush(...Array.prototype.slice.call(t))
71
+ : r.error(_);
72
+ },
73
+ );
74
+ },
75
+ logCustomEvent: function () {
76
+ const t = arguments;
77
+ import("../../Core/log-custom-event.js").then(
78
+ ({ logCustomEvent: logCustomEvent }) => {
79
+ if (!e.so()) return void r.error(_);
80
+ logCustomEvent(...Array.prototype.slice.call(t));
81
+ },
82
+ );
83
+ },
84
+ logPurchase: function () {
85
+ const t = arguments;
86
+ import("../../Core/log-purchase.js").then(
87
+ ({ logPurchase: logPurchase }) => {
88
+ if (!e.so()) return void r.error(_);
89
+ logPurchase(...Array.prototype.slice.call(t));
90
+ },
91
+ );
92
+ },
93
+ unregisterPush: function () {
94
+ const t = arguments;
95
+ import("../../Push/unregister-push.js").then(
96
+ ({ unregisterPush: unregisterPush }) => {
97
+ e.so()
98
+ ? unregisterPush(...Array.prototype.slice.call(t))
99
+ : r.error(_);
100
+ },
101
+ );
102
+ },
103
+ requestPushPermission: requestPushPermission(),
104
+ changeUser: function () {
105
+ const t = arguments;
106
+ import("../../Core/change-user.js").then(
107
+ ({ changeUser: changeUser }) => {
108
+ if (!e.so()) return void r.error(_);
109
+ changeUser(...Array.prototype.slice.call(t));
110
+ },
111
+ );
112
+ },
113
+ },
114
+ u = function (t) {
115
+ return function () {
116
+ i[t](...Array.prototype.slice.call(arguments));
117
+ };
118
+ };
119
+ for (const t of to(i)) n[t] = u(t);
120
+ const c = [
121
+ "setFirstName",
122
+ "setLastName",
123
+ "setEmail",
124
+ "setGender",
125
+ "setDateOfBirth",
126
+ "setCountry",
127
+ "setHomeCity",
128
+ "setEmailNotificationSubscriptionType",
129
+ "setLanguage",
130
+ "addAlias",
131
+ "setPushNotificationSubscriptionType",
132
+ "setPhoneNumber",
133
+ "setCustomUserAttribute",
134
+ "addToCustomAttributeArray",
135
+ "removeFromCustomAttributeArray",
136
+ "incrementCustomUserAttribute",
137
+ "setCustomLocationAttribute",
138
+ "addToSubscriptionGroup",
139
+ "removeFromSubscriptionGroup",
140
+ ],
141
+ a = function (t) {
142
+ return function () {
143
+ const r = ro();
144
+ r && r[t](...Array.prototype.slice.call(arguments));
145
+ };
146
+ },
147
+ m = {};
148
+ for (let t = 0; t < c.length; t++) m[c[t]] = a(c[t]);
149
+ n.getUser = function () {
150
+ return m;
151
+ };
152
+ const l = { showFeed: s },
153
+ f = function (r) {
154
+ return function () {
155
+ const e = arguments;
156
+ t.Cr(o, function () {
157
+ l[r](...Array.prototype.slice.call(e));
158
+ });
159
+ };
160
+ },
161
+ p = n.display;
162
+ for (const t of to(l)) p[t] = f(t);
163
+ const d = { registerAppboyPushMessages: requestPushPermission() },
164
+ g = function (t) {
165
+ return function () {
166
+ d[t](...Array.prototype.slice.call(arguments));
167
+ };
168
+ },
169
+ h = n.web;
170
+ for (const t of to(d)) h[t] = g(t);
171
+ return n;
172
+ };
@@ -1,237 +1,72 @@
1
1
  import X from "../../util/browser-detector.js";
2
- import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
3
- import { getUser as ro } from "../../Core/get-user.js";
4
2
  import { InAppMessage } from "../index.js";
5
- import { keys as to } from "../../util/code-utils.js";
6
3
  import { OperatingSystems as Y } from "../../util/device-constants.js";
7
- import { parseQueryStringKeyValues as ut } from "../../util/url-utils.js";
8
- import { WindowUtils as eo } from "../../util/window-utils.js";
9
- import e from "../../managers/braze-instance.js";
10
- import { logger as r } from "../../../shared-lib/index.js";
11
- import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../../common/constants.js";
12
- import { nodeScriptReplace as ct } from "../utils/in-app-message-utils.js";
13
- export default function at(t, o, n, s, i, u) {
4
+ import {
5
+ applyNonceToDynamicallyCreatedTags as lt,
6
+ buildBrazeBridge as ct,
7
+ buildHtmlClickHandler as at,
8
+ } from "./html-message-display-utils.js";
9
+ export default function dt(t, e, n, o, s, l) {
14
10
  const c = document.createElement("iframe");
15
11
  c.setAttribute("title", "Modal Message"),
16
- i && (c.style.zIndex = (i + 1).toString());
17
- const a = (e) => {
18
- const o = e.getAttribute("href"),
19
- n = e.onclick;
20
- return (r) => {
21
- if (null != n && "function" == typeof n && !1 === n.bind(e)(r)) return;
22
- let i = ut(o).abButtonId;
23
- if (
24
- ((null != i && "" !== i) || (i = e.getAttribute("id") || void 0),
25
- null != o && "" !== o && 0 !== o.indexOf("#"))
26
- ) {
27
- const n =
28
- "blank" ===
29
- (e.getAttribute("target") || "").toLowerCase().replace("_", ""),
30
- u = s || t.openTarget === InAppMessage.OpenTarget.BLANK || n,
31
- a = () => {
32
- logInAppMessageHtmlClick(t, i, o), eo.openUri(o, u, r);
33
- };
34
- u ? a() : t.Ae(c, a);
35
- } else logInAppMessageHtmlClick(t, i, o || void 0);
36
- return r.stopPropagation(), !1;
37
- };
38
- },
39
- m = (t, e, o) => {
40
- const n = `([\\w]+)\\s*=\\s*document.createElement\\(['"]${o}['"]\\)`,
41
- r = t.match(new RegExp(n));
42
- if (r) {
43
- const o = `${r[1]}.setAttribute("nonce", "${e}")`;
44
- return `${t.slice(0, r.index + r[0].length)};${o};${t.slice(
45
- r.index + r[0].length,
46
- )}`;
47
- }
48
- return null;
49
- };
12
+ s && (c.style.zIndex = (s + 1).toString());
13
+ let r = null;
14
+ if (null != l) {
15
+ (r = document.createElement("html")), (r.innerHTML = t.message || "");
16
+ const e = r.getElementsByTagName("style");
17
+ for (let t = 0; t < e.length; t++) e[t].setAttribute("nonce", l);
18
+ const n = r.getElementsByTagName("script");
19
+ for (let t = 0; t < n.length; t++) {
20
+ n[t].setAttribute("nonce", l),
21
+ (n[t].innerHTML = n[t].innerHTML.replace(
22
+ /<style>/g,
23
+ `<style nonce='${l}'>`,
24
+ ));
25
+ const e = lt(n[t].innerHTML, l, "script");
26
+ e && (n[t].innerHTML = e);
27
+ const o = lt(n[t].innerHTML, l, "style");
28
+ o && (n[t].innerHTML = o);
29
+ }
30
+ }
50
31
  if (
51
- ((c.onload = () => {
52
- let s = null;
53
- if (null != u) {
54
- (s = document.createElement("html")), (s.innerHTML = t.message || "");
55
- const e = s.getElementsByTagName("style");
56
- for (let t = 0; t < e.length; t++) e[t].setAttribute("nonce", u);
57
- const o = s.getElementsByTagName("script");
58
- for (let t = 0; t < o.length; t++) {
59
- o[t].setAttribute("nonce", u),
60
- (o[t].innerHTML = o[t].innerHTML.replace(
61
- /<style>/g,
62
- `<style nonce='${u}'>`,
63
- ));
64
- const e = m(o[t].innerHTML, u, "script");
65
- e && (o[t].innerHTML = e);
66
- const n = m(o[t].innerHTML, u, "style");
67
- n && (o[t].innerHTML = n);
68
- }
69
- }
70
- const i = c.contentWindow;
71
- i.focus();
72
- const l = i.document.querySelector("html");
73
- l && ((l.innerHTML = s ? s.innerHTML : t.message || ""), ct(l));
74
- const f = i.document.getElementsByTagName("head")[0];
75
- if (null != f) {
76
- if (t.Ce()) {
32
+ ((c.srcdoc = r ? r.innerHTML : t.message || ""),
33
+ (c.onload = () => {
34
+ const s = c.contentWindow;
35
+ s.focus();
36
+ const r = s.document.getElementsByTagName("head")[0];
37
+ if (null != r) {
38
+ if (t.ve()) {
77
39
  const e = document.createElement("style");
78
40
  (e.innerHTML = t.css || ""),
79
- (e.id = t.ve() || ""),
80
- null != u && e.setAttribute("nonce", u),
81
- f.appendChild(e);
41
+ (e.id = t.we() || ""),
42
+ null != l && e.setAttribute("nonce", l),
43
+ r.appendChild(e);
82
44
  }
83
- const e = i.document.createElement("base");
84
- null != e && (e.setAttribute("target", "_parent"), f.appendChild(e));
45
+ const e = s.document.createElement("base");
46
+ null != e && (e.setAttribute("target", "_parent"), r.appendChild(e));
85
47
  }
86
- const d = i.document.getElementsByTagName("title");
87
- d && d.length > 0 && c.setAttribute("title", d[0].textContent || "");
88
- const p = {
89
- closeMessage: function () {
90
- t.Ae(c);
91
- },
92
- logClick: function () {
93
- logInAppMessageHtmlClick(t, ...arguments);
94
- },
95
- display: {},
96
- web: {},
97
- },
98
- requestPushPermission = function () {
99
- return function () {
100
- const t = arguments;
101
- import("../../Push/request-push-permission.js").then((o) => {
102
- e.so()
103
- ? o.requestPushPermission(...Array.prototype.slice.call(t))
104
- : r.error(_);
105
- });
106
- };
107
- },
108
- g = {
109
- requestImmediateDataFlush: function () {
110
- const t = arguments;
111
- import("../../Core/request-immediate-data-flush.js").then(
112
- ({ requestImmediateDataFlush: requestImmediateDataFlush }) => {
113
- e.so()
114
- ? requestImmediateDataFlush(...Array.prototype.slice.call(t))
115
- : r.error(_);
116
- },
117
- );
118
- },
119
- logCustomEvent: function () {
120
- const t = arguments;
121
- import("../../Core/log-custom-event.js").then(
122
- ({ logCustomEvent: logCustomEvent }) => {
123
- if (!e.so()) return void r.error(_);
124
- logCustomEvent(...Array.prototype.slice.call(t));
125
- },
126
- );
127
- },
128
- logPurchase: function () {
129
- const t = arguments;
130
- import("../../Core/log-purchase.js").then(
131
- ({ logPurchase: logPurchase }) => {
132
- if (!e.so()) return void r.error(_);
133
- logPurchase(...Array.prototype.slice.call(t));
134
- },
135
- );
136
- },
137
- unregisterPush: function () {
138
- const t = arguments;
139
- import("../../Push/unregister-push.js").then(
140
- ({ unregisterPush: unregisterPush }) => {
141
- e.so()
142
- ? unregisterPush(...Array.prototype.slice.call(t))
143
- : r.error(_);
144
- },
145
- );
146
- },
147
- requestPushPermission: requestPushPermission(),
148
- changeUser: function () {
149
- const t = arguments;
150
- import("../../Core/change-user.js").then(
151
- ({ changeUser: changeUser }) => {
152
- if (!e.so()) return void r.error(_);
153
- changeUser(...Array.prototype.slice.call(t));
154
- },
155
- );
156
- },
157
- },
158
- h = function (t) {
159
- return function () {
160
- g[t](...Array.prototype.slice.call(arguments));
161
- };
162
- };
163
- for (const t of to(g)) p[t] = h(t);
164
- const b = [
165
- "setFirstName",
166
- "setLastName",
167
- "setEmail",
168
- "setGender",
169
- "setDateOfBirth",
170
- "setCountry",
171
- "setHomeCity",
172
- "setEmailNotificationSubscriptionType",
173
- "setLanguage",
174
- "addAlias",
175
- "setPushNotificationSubscriptionType",
176
- "setPhoneNumber",
177
- "setCustomUserAttribute",
178
- "addToCustomAttributeArray",
179
- "removeFromCustomAttributeArray",
180
- "incrementCustomUserAttribute",
181
- "setCustomLocationAttribute",
182
- "addToSubscriptionGroup",
183
- "removeFromSubscriptionGroup",
184
- ],
185
- y = function (t) {
186
- return function () {
187
- const e = ro();
188
- e && e[t](...Array.prototype.slice.call(arguments));
189
- };
190
- },
191
- A = {};
192
- for (let t = 0; t < b.length; t++) A[b[t]] = y(b[t]);
193
- p.getUser = function () {
194
- return A;
195
- };
196
- const j = { showFeed: o },
197
- C = function (e) {
198
- return function () {
199
- const o = arguments;
200
- t.Ae(c, function () {
201
- j[e](...Array.prototype.slice.call(o));
202
- });
203
- };
204
- },
205
- v = p.display;
206
- for (const t of to(j)) v[t] = C(t);
207
- const P = { registerAppboyPushMessages: requestPushPermission() },
208
- w = function (t) {
209
- return function () {
210
- P[t](...Array.prototype.slice.call(arguments));
211
- };
212
- },
213
- E = p.web;
214
- for (const t of to(P)) E[t] = w(t);
48
+ const i = s.document.getElementsByTagName("title");
49
+ i && i.length > 0 && c.setAttribute("title", i[0].textContent || "");
50
+ const a = ct(t, c, e);
215
51
  if (
216
- ((i.appboyBridge = p), (i.brazeBridge = p), t.we !== InAppMessage.qe.$e)
52
+ ((s.appboyBridge = a), (s.brazeBridge = a), t.xe !== InAppMessage.Be.Me)
217
53
  ) {
218
- const t = i.document.getElementsByTagName("a");
219
- for (let e = 0; e < t.length; e++) t[e].onclick = a(t[e]);
220
- const e = i.document.getElementsByTagName("button");
221
- for (let t = 0; t < e.length; t++) e[t].onclick = a(e[t]);
54
+ const e = s.document.getElementsByTagName("a");
55
+ for (let n = 0; n < e.length; n++) e[n].onclick = at(t, c, e[n], o);
56
+ const n = s.document.getElementsByTagName("button");
57
+ for (let e = 0; e < n.length; e++) n[e].onclick = at(t, c, n[e], o);
222
58
  }
223
- const $ = i.document.body;
224
- if (null != $) {
225
- t.xe() && ($.id = t.htmlId || "");
59
+ const d = s.document.body;
60
+ if (null != d) {
61
+ t.Ce() && (d.id = t.htmlId || "");
226
62
  const e = document.createElement("hidden");
227
- (e.onclick = p.closeMessage),
63
+ (e.onclick = a.closeMessage),
228
64
  (e.className = "ab-programmatic-close-button"),
229
- $.appendChild(e);
65
+ d.appendChild(e);
230
66
  }
231
- i.dispatchEvent(new CustomEvent("ab.BridgeReady")),
67
+ s.dispatchEvent(new CustomEvent("ab.BridgeReady")),
232
68
  -1 !== c.className.indexOf("ab-start-hidden") &&
233
- ((c.className = c.className.replace("ab-start-hidden", "")), n(c)),
234
- document.activeElement !== c && c.focus();
69
+ ((c.className = c.className.replace("ab-start-hidden", "")), n(c));
235
70
  }),
236
71
  (c.className =
237
72
  "ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
@@ -239,8 +74,8 @@ export default function at(t, o, n, s, i, u) {
239
74
  ) {
240
75
  const e = document.createElement("div");
241
76
  return (
242
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Me = e), e
77
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Re = e), e
243
78
  );
244
79
  }
245
- return (t.Me = c), c;
80
+ return (t.Re = c), c;
246
81
  }
@@ -13,21 +13,21 @@ 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 u } from "../../Core/handle-braze-action.js";
16
- import at from "./html-message-to-html.js";
16
+ import dt from "./html-message-to-html.js";
17
17
  import le from "./modal-utils.js";
18
18
  import { logger as r, Guid as p } from "../../../shared-lib/index.js";
19
19
  export default function ce(e, o, a, t, n, s, i, l = document.body) {
20
20
  if (((e.ke = document.activeElement), e instanceof HtmlMessage))
21
- return at(e, o, a, n, s, i);
21
+ return dt(e, o, a, n, s, i);
22
22
  const b = (function (e, o, a, t, n, s, i = document.body) {
23
23
  let m = null;
24
24
  const l = document.createElement("div");
25
25
  (l.className = "ab-in-app-message ab-start-hidden ab-background"),
26
26
  s && (l.style.zIndex = (s + 1).toString()),
27
- e.ze() &&
27
+ e.$e() &&
28
28
  ((l.className += " ab-modal-interactions"),
29
29
  l.setAttribute("tabindex", "-1")),
30
- e.Ce() ||
30
+ e.ve() ||
31
31
  ((l.style.color = ie(e.textColor)),
32
32
  (l.style.backgroundColor = ie(e.backgroundColor)),
33
33
  ne(e.backgroundColor) && (l.className += " ab-no-shadow"));
@@ -37,7 +37,7 @@ export default function ce(e, o, a, t, n, s, i, l = document.body) {
37
37
  document.querySelectorAll(".ab-iam-img-loading").length > 0
38
38
  ? t(
39
39
  `Cannot show in-app message ${e.message} because another message is being shown.`,
40
- InAppMessage.Be.Le,
40
+ InAppMessage.Le.ze,
41
41
  )
42
42
  : a(l));
43
43
  },
@@ -63,7 +63,7 @@ export default function ce(e, o, a, t, n, s, i, l = document.body) {
63
63
  (e.clickAction !== InAppMessage.ClickAction.NONE &&
64
64
  (l.className += " ab-clickable"),
65
65
  (l.onclick = (a) => (
66
- e.Ae(l, () => {
66
+ e.Cr(l, () => {
67
67
  logInAppMessageClick(e),
68
68
  e.clickAction === InAppMessage.ClickAction.URI
69
69
  ? u(
@@ -78,15 +78,15 @@ export default function ce(e, o, a, t, n, s, i, l = document.body) {
78
78
  )));
79
79
  const g = d(
80
80
  "Close Message",
81
- e.Ce() ? void 0 : ie(e.closeButtonColor),
81
+ e.ve() ? void 0 : ie(e.closeButtonColor),
82
82
  () => {
83
- e.Ae(l);
83
+ e.Cr(l);
84
84
  },
85
85
  );
86
86
  l.appendChild(g), s && (g.style.zIndex = (s + 2).toString());
87
87
  const f = document.createElement("div");
88
88
  f.className = "ab-message-text";
89
- const h = (e.messageAlignment || e.De).toLowerCase();
89
+ const h = (e.messageAlignment || e.qe).toLowerCase();
90
90
  f.className += " " + h + "-aligned";
91
91
  let j = !1;
92
92
  const w = document.createElement("div");
@@ -97,13 +97,13 @@ export default function ce(e, o, a, t, n, s, i, l = document.body) {
97
97
  (o.style.backgroundImage = "url(" + e.imageUrl + ")"),
98
98
  o.setAttribute("role", "img"),
99
99
  o.setAttribute("aria-label", "Modal Image"),
100
- e.Ge(o),
100
+ e.Ae(o),
101
101
  w.appendChild(o);
102
102
  } else {
103
103
  const o = document.createElement("img");
104
104
  if (
105
105
  (o.setAttribute("src", e.imageUrl),
106
- e.Ge(o),
106
+ e.Ae(o),
107
107
  0 === document.querySelectorAll(".ab-iam-img-loading").length)
108
108
  ) {
109
109
  j = !0;
@@ -126,7 +126,7 @@ export default function ce(e, o, a, t, n, s, i, l = document.body) {
126
126
  w.className += " ab-icon-area";
127
127
  const o = document.createElement("span");
128
128
  (o.className = "ab-icon"),
129
- e.Ce() ||
129
+ e.ve() ||
130
130
  ((o.style.backgroundColor = ie(e.iconBackgroundColor)),
131
131
  (o.style.color = ie(e.iconColor)));
132
132
  const a = document.createElement("i");
@@ -140,23 +140,23 @@ export default function ce(e, o, a, t, n, s, i, l = document.body) {
140
140
  }
141
141
  if ((oe(f, "touchstart"), e.header && e.header.length > 0)) {
142
142
  const o = document.createElement("h1");
143
- (o.className = "ab-message-header"), (e.He = p.W()), (o.id = e.He);
143
+ (o.className = "ab-message-header"), (e.De = p.W()), (o.id = e.De);
144
144
  const a = (
145
145
  e.headerAlignment || InAppMessage.TextAlignment.CENTER
146
146
  ).toLowerCase();
147
147
  (o.className += " " + a + "-aligned"),
148
- e.Ce() || (o.style.color = ie(e.headerTextColor)),
148
+ e.ve() || (o.style.color = ie(e.headerTextColor)),
149
149
  o.appendChild(document.createTextNode(e.header)),
150
150
  f.appendChild(o);
151
151
  }
152
- return f.appendChild(e.Je()), l.appendChild(f), j || c(), (e.Me = l), l;
152
+ return f.appendChild(e.Ge()), l.appendChild(f), j || c(), (e.Re = l), l;
153
153
  })(e, o, a, t, n, s, l);
154
154
  if (e instanceof FullScreenMessage || e instanceof ModalMessage) {
155
155
  const a = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
156
156
  (b.className += ` ${a} ab-centered`),
157
- le.Ke(e, o, b, n),
158
- le.Oe(b),
159
- le.Qe(e.He, b);
157
+ le.He(e, o, b, n),
158
+ le.Je(b),
159
+ le.Ke(e.De, b);
160
160
  } else if (e instanceof SlideUpMessage) {
161
161
  b.className += " ab-slideup";
162
162
  const o = b.getElementsByClassName("ab-close-button")[0];
@@ -164,7 +164,7 @@ export default function ce(e, o, a, t, n, s, i, l = document.body) {
164
164
  const a = ae(
165
165
  "0 0 11.38 19.44",
166
166
  "M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z",
167
- e.Ce() ? void 0 : ie(e.closeButtonColor),
167
+ e.ve() ? void 0 : ie(e.closeButtonColor),
168
168
  );
169
169
  a.setAttribute("class", "ab-chevron"), o.appendChild(a);
170
170
  }
@@ -178,8 +178,8 @@ export default function ce(e, o, a, t, n, s, i, l = document.body) {
178
178
  null != o && null != o.onclick && o.onclick(e);
179
179
  }),
180
180
  e.slideFrom === InAppMessage.SlideFrom.TOP
181
- ? ((a = m.Re), (t = " ab-swiped-up"))
182
- : ((a = m.Se), (t = " ab-swiped-down")),
181
+ ? ((a = m.Oe), (t = " ab-swiped-up"))
182
+ : ((a = m.Qe), (t = " ab-swiped-down")),
183
183
  c(b, a, (e) => {
184
184
  (b.className += t), null != o && null != o.onclick && o.onclick(e);
185
185
  });