@braze/web-sdk 4.7.2 → 4.8.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 (164) hide show
  1. package/index.d.ts +32 -26
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +5 -5
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +25 -25
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/indexed-db-adapter.js +74 -74
  8. package/shared-lib/logger.js +18 -18
  9. package/shared-lib/supported-options.js +18 -18
  10. package/src/Card/card-manager-factory.js +2 -2
  11. package/src/Card/card-manager.js +48 -42
  12. package/src/Card/display/card-display.js +70 -67
  13. package/src/Card/log-card-click.js +1 -1
  14. package/src/Card/log-card-dismissal.js +1 -1
  15. package/src/Card/log-card-impressions.js +3 -3
  16. package/src/Card/models/banner.js +3 -2
  17. package/src/Card/models/captioned-image.js +6 -5
  18. package/src/Card/models/card.js +107 -87
  19. package/src/Card/models/classic-card.js +5 -5
  20. package/src/Card/models/control-card.js +5 -21
  21. package/src/Card/types.js +1 -0
  22. package/src/Card/util/card-factory.js +32 -32
  23. package/src/ContentCards/content-cards-provider-factory.js +3 -3
  24. package/src/ContentCards/content-cards-provider.js +283 -175
  25. package/src/ContentCards/content-cards.js +2 -2
  26. package/src/ContentCards/get-cached-content-cards.js +1 -1
  27. package/src/ContentCards/log-content-cards-displayed.js +2 -2
  28. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  29. package/src/ContentCards/subscribe-to-content-cards-updates.js +9 -6
  30. package/src/ContentCards/types.js +1 -0
  31. package/src/ContentCards/ui/hide-content-cards.js +2 -2
  32. package/src/ContentCards/ui/show-content-cards.js +36 -34
  33. package/src/Core/add-sdk-metadata.js +17 -18
  34. package/src/Core/change-user.js +12 -14
  35. package/src/Core/destroy.js +1 -1
  36. package/src/Core/disable-sdk.js +8 -6
  37. package/src/Core/enable-sdk.js +4 -4
  38. package/src/Core/get-device-id.js +7 -6
  39. package/src/Core/get-user.js +1 -1
  40. package/src/Core/handle-braze-action.js +57 -40
  41. package/src/Core/is-disabled.js +2 -2
  42. package/src/Core/log-custom-event.js +22 -15
  43. package/src/Core/log-purchase.js +33 -33
  44. package/src/Core/open-session.js +17 -15
  45. package/src/Core/request-immediate-data-flush.js +4 -2
  46. package/src/Core/set-logger.js +1 -1
  47. package/src/Core/set-sdk-authentication-signature.js +5 -6
  48. package/src/Core/subscribe-to-sdk-authentication-failures.js +3 -1
  49. package/src/Core/toggle-logging.js +1 -1
  50. package/src/Core/types.js +1 -0
  51. package/src/Core/wipe-data.js +11 -10
  52. package/src/FeatureFlags/feature-flag-factory.js +6 -6
  53. package/src/FeatureFlags/feature-flag.js +17 -17
  54. package/src/FeatureFlags/feature-flags-provider-factory.js +2 -2
  55. package/src/FeatureFlags/feature-flags-provider.js +67 -65
  56. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  57. package/src/FeatureFlags/get-feature-flag.js +4 -4
  58. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -1
  59. package/src/Feed/feed-provider-factory.js +8 -8
  60. package/src/Feed/feed-provider.js +57 -46
  61. package/src/Feed/feed.js +1 -1
  62. package/src/Feed/get-cached-feed.js +2 -2
  63. package/src/Feed/log-feed-displayed.js +3 -1
  64. package/src/Feed/request-feed-refresh.js +2 -2
  65. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  66. package/src/Feed/types.js +1 -0
  67. package/src/Feed/ui/hide-feed.js +2 -2
  68. package/src/Feed/ui/show-feed.js +41 -37
  69. package/src/InAppMessage/display/html-message-to-html.js +125 -119
  70. package/src/InAppMessage/display/in-app-message-to-html.js +72 -69
  71. package/src/InAppMessage/display/modal-utils.js +18 -13
  72. package/src/InAppMessage/in-app-message-factory.js +9 -8
  73. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  74. package/src/InAppMessage/in-app-message-manager.js +130 -110
  75. package/src/InAppMessage/log-in-app-message-button-click.js +10 -10
  76. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  77. package/src/InAppMessage/log-in-app-message-html-click.js +10 -10
  78. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  79. package/src/InAppMessage/models/control-message.js +4 -1
  80. package/src/InAppMessage/models/full-screen-message.js +35 -37
  81. package/src/InAppMessage/models/html-message.js +34 -33
  82. package/src/InAppMessage/models/in-app-message-button.js +23 -16
  83. package/src/InAppMessage/models/in-app-message.js +147 -105
  84. package/src/InAppMessage/models/modal-message.js +34 -36
  85. package/src/InAppMessage/models/slide-up-message.js +25 -27
  86. package/src/InAppMessage/models/templated-in-app-message.js +12 -7
  87. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  88. package/src/InAppMessage/types.js +1 -0
  89. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
  90. package/src/InAppMessage/ui/show-in-app-message.js +95 -89
  91. package/src/InAppMessage/utils/in-app-message-utils.js +1 -0
  92. package/src/Push/is-push-blocked.js +2 -2
  93. package/src/Push/is-push-permission-granted.js +2 -2
  94. package/src/Push/is-push-supported.js +2 -2
  95. package/src/Push/push-manager-factory.js +20 -20
  96. package/src/Push/push-manager.js +193 -174
  97. package/src/Push/request-push-permission.js +4 -3
  98. package/src/Push/types.js +1 -0
  99. package/src/Push/unregister-push.js +2 -2
  100. package/src/Push/utils/push-utils.js +10 -10
  101. package/src/User/types.js +1 -0
  102. package/src/User/user-manager.js +24 -24
  103. package/src/User/user.js +117 -105
  104. package/src/common/base-feed.js +7 -7
  105. package/src/common/base-provider.js +2 -2
  106. package/src/common/constants.js +6 -0
  107. package/src/common/event-logger.js +6 -6
  108. package/src/common/feed-display.js +95 -85
  109. package/src/common/types.js +1 -0
  110. package/src/l10n/l10n-manager-factory.js +10 -10
  111. package/src/l10n/l10n-manager.js +1 -1
  112. package/src/managers/auth-manager.js +37 -34
  113. package/src/managers/braze-instance.js +209 -193
  114. package/src/managers/device-manager.js +43 -38
  115. package/src/managers/network-manager.js +119 -96
  116. package/src/managers/server-config-manager.js +68 -48
  117. package/src/managers/session-manager.js +52 -45
  118. package/src/managers/storage-manager-factory.js +29 -22
  119. package/src/managers/storage-manager.js +288 -273
  120. package/src/managers/subscription-manager.js +9 -6
  121. package/src/managers/types.js +1 -0
  122. package/src/models/backend-errors.js +5 -5
  123. package/src/models/braze-event.js +14 -8
  124. package/src/models/device.js +10 -18
  125. package/src/models/identifier.js +10 -11
  126. package/src/models/push-token.js +17 -12
  127. package/src/models/request-result.js +4 -4
  128. package/src/models/server-config.js +36 -20
  129. package/src/models/types.js +1 -0
  130. package/src/request-controller.js +176 -174
  131. package/src/triggers/models/custom-event-data.js +6 -6
  132. package/src/triggers/models/custom-event-property-data.js +9 -9
  133. package/src/triggers/models/filter-set.js +9 -9
  134. package/src/triggers/models/filter.js +64 -64
  135. package/src/triggers/models/in-app-message-click-data.js +12 -12
  136. package/src/triggers/models/purchase-data.js +3 -3
  137. package/src/triggers/models/purchase-property-data.js +9 -9
  138. package/src/triggers/models/push-click-data.js +7 -7
  139. package/src/triggers/models/trigger-condition.js +57 -57
  140. package/src/triggers/models/trigger-events.js +2 -2
  141. package/src/triggers/models/trigger.js +42 -42
  142. package/src/triggers/triggers-provider-factory.js +8 -8
  143. package/src/triggers/triggers-provider.js +173 -170
  144. package/src/types.js +1 -0
  145. package/src/ui/js/attach-css.js +3 -3
  146. package/src/ui/js/load-font-awesome.js +2 -2
  147. package/src/util/base-device-parser.js +2 -2
  148. package/src/util/braze-actions.js +20 -20
  149. package/src/util/browser-detector.js +22 -22
  150. package/src/util/client-hints-parser.js +7 -7
  151. package/src/util/code-utils.js +1 -1
  152. package/src/util/color-utils.js +2 -2
  153. package/src/util/component-utils.js +2 -2
  154. package/src/util/deprecation-utils.js +1 -1
  155. package/src/util/device-constants.js +3 -3
  156. package/src/util/dom-utils.js +7 -7
  157. package/src/util/error-utils.js +2 -0
  158. package/src/util/key-codes.js +1 -1
  159. package/src/util/net.js +11 -11
  160. package/src/util/request-header-utils.js +23 -0
  161. package/src/util/string-utils.js +1 -1
  162. package/src/util/user-agent-parser.js +21 -21
  163. package/src/util/validation-utils.js +44 -44
  164. package/src/util/window-utils.js +3 -3
@@ -1,89 +1,93 @@
1
- import e, { OPTIONS as T } from "../../managers/braze-instance.js";
1
+ import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  import {
3
- destroyFeedHtml as z,
3
+ destroyFeedHtml as k,
4
4
  detectFeedImpressions as q,
5
5
  feedToHtml as I,
6
- LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as L,
7
- refreshFeed as M,
8
- registerFeedSubscriptionId as $,
9
- updateFeedCards as k
6
+ LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as M,
7
+ refreshFeed as $,
8
+ registerFeedSubscriptionId as A,
9
+ updateFeedCards as B
10
10
  } from "../../common/feed-display.js";
11
11
  import { Feed, logFeedDisplayed, subscribeToFeedUpdates } from "../index.js";
12
- import re from "../feed-provider-factory.js";
12
+ import ie from "../feed-provider-factory.js";
13
13
  import { intersection as te } from "../../util/code-utils.js";
14
- import { setCardHeight as A } from "../../Card/display/card-display.js";
15
- import { setupFeedUI as B } from "../../ui/js/index.js";
14
+ import { setCardHeight as F } from "../../Card/display/card-display.js";
15
+ import { setupFeedUI as G } from "../../ui/js/index.js";
16
16
  import r from "../../../shared-lib/braze-shared-lib.js";
17
17
  export function showFeed(t, n, o) {
18
18
  if (!e.rr()) return;
19
- B();
19
+ G();
20
20
  const s = (e, t) => {
21
21
  if (null == t) return e;
22
22
  const n = [];
23
23
  for (let e = 0; e < t.length; e++) n.push(t[e].toLowerCase());
24
24
  const o = [];
25
25
  for (let t = 0; t < e.length; t++) {
26
- const r = [];
27
- for (let n = 0; n < e[t].categories.length; n++)
28
- r.push(e[t].categories[n].toLowerCase());
26
+ const r = [],
27
+ s = e[t].categories || [];
28
+ for (let e = 0; e < s.length; e++) r.push(s[e].toLowerCase());
29
29
  te(r, n).length > 0 && o.push(e[t]);
30
30
  }
31
31
  return o;
32
32
  },
33
- i = e.nn(T.tn) || e.nn(T.en) || !1;
33
+ i = e.nn(L.tn) || e.nn(L.en) || !1;
34
34
  let l = !1;
35
35
  null == t && ((t = document.body), (l = !0));
36
36
  let a = !1,
37
37
  f = null;
38
38
  null == n
39
- ? ((f = re.er().Ti()),
40
- k(f, s(f.cards, o), f.lastUpdated, null, i),
39
+ ? ((f = ie.er().Ei()),
40
+ B(f, s(f.cards, o), f.lastUpdated, null, i),
41
41
  (a = !0))
42
42
  : (f = new Feed(s(n, o), new Date()));
43
- const u = I(f, i);
43
+ const u = I(f, i, l);
44
44
  if (a) {
45
45
  (null == f.lastUpdated ||
46
- new Date().valueOf() - f.lastUpdated.valueOf() > Feed.ur) &&
47
- (r.D.info(
48
- `Cached feed was older than max TTL of ${Feed.ur} ms, requesting an update from the server.`
46
+ new Date().valueOf() - f.lastUpdated.valueOf() > Feed.mr) &&
47
+ (r.j.info(
48
+ `Cached feed was older than max TTL of ${Feed.mr} ms, requesting an update from the server.`
49
49
  ),
50
- M(f, u));
50
+ $(f, u));
51
51
  const e = new Date().valueOf(),
52
52
  t = subscribeToFeedUpdates(function(t) {
53
53
  const n = u.querySelectorAll(".ab-refresh-button")[0];
54
54
  if (null != n) {
55
55
  let t = 500;
56
- const o = parseInt(u.getAttribute(L));
57
- isNaN(o)
58
- ? (t -= new Date().valueOf() - e)
59
- : (t -= new Date().valueOf() - o),
60
- setTimeout(function() {
61
- n.className = n.className.replace(/fa-spin/g, "");
62
- }, Math.max(t, 0));
56
+ t -= new Date().valueOf() - e;
57
+ const o = u.getAttribute(M);
58
+ if (o) {
59
+ const e = parseInt(o);
60
+ isNaN(e) || (t -= new Date().valueOf() - e);
61
+ }
62
+ setTimeout(function() {
63
+ n.className = n.className.replace(/fa-spin/g, "");
64
+ }, Math.max(t, 0));
63
65
  }
64
- k(f, s(t.cards, o), t.lastUpdated, u, i);
66
+ B(f, s(t.cards, o), t.lastUpdated, u, i);
65
67
  });
66
- $(t, u);
68
+ A(t, u);
67
69
  }
68
- const m = e => {
70
+ const d = e => {
69
71
  const t = e.querySelectorAll(".ab-feed");
70
72
  let n = null;
71
73
  for (let o = 0; o < t.length; o++) t[o].parentNode === e && (n = t[o]);
72
- null != n ? (z(n), n.parentNode.replaceChild(u, n)) : e.appendChild(u),
74
+ null != n
75
+ ? (k(n), n.parentNode && n.parentNode.replaceChild(u, n))
76
+ : e.appendChild(u),
73
77
  setTimeout(function() {
74
78
  u.className = u.className.replace("ab-hide", "ab-show");
75
79
  }, 0),
76
80
  l && u.focus(),
77
81
  logFeedDisplayed(),
78
82
  q(f, u),
79
- A(f.cards, e);
83
+ f && F(f.cards, e);
80
84
  };
81
- var c;
85
+ var m;
82
86
  null != t
83
- ? m(t)
87
+ ? d(t)
84
88
  : (window.onload =
85
- ((c = window.onload),
89
+ ((m = window.onload),
86
90
  function() {
87
- "function" == typeof c && c(), m(document.body);
91
+ "function" == typeof m && m(new Event("oldLoad")), d(document.body);
88
92
  }));
89
93
  }
@@ -1,91 +1,94 @@
1
- import { attachInAppMessageCSS as nt } from "../../ui/js/iam-css.js";
2
- import ot from "../../util/browser-detector.js";
1
+ import { attachInAppMessageCSS as ut } from "../../ui/js/iam-css.js";
2
+ import V from "../../util/browser-detector.js";
3
3
  import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
4
- import { getUser as Q } from "../../Core/get-user.js";
4
+ import { getUser as ee } from "../../Core/get-user.js";
5
5
  import { InAppMessage } from "../index.js";
6
- import { keys as or } from "../../util/code-utils.js";
7
- import { OperatingSystems as rt } from "../../util/device-constants.js";
8
- import { parseQueryStringKeyValues as ut } from "../../util/url-utils.js";
9
- import { WindowUtils as H } from "../../util/window-utils.js";
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"),
6
+ import { keys as oo } from "../../util/code-utils.js";
7
+ import { OperatingSystems as W } from "../../util/device-constants.js";
8
+ import { parseQueryStringKeyValues as ct } from "../../util/url-utils.js";
9
+ import { WindowUtils as Z } from "../../util/window-utils.js";
10
+ import e from "../../managers/braze-instance.js";
11
+ import r from "../../../shared-lib/braze-shared-lib.js";
12
+ import { BRAZE_MUST_BE_INITIALIZED_ERROR as P } from "../../common/constants.js";
13
+ export default function at(t, o, n, s, i, u) {
14
+ const c = document.createElement("iframe");
15
+ c.setAttribute("title", "Modal Message"),
16
+ i && (c.style.zIndex = (i + 1).toString());
17
+ const a = e => {
18
+ const o = e.getAttribute("href"),
15
19
  r = e.onclick;
16
- return s => {
17
- if (null != r && "function" == typeof r && !1 === r()) return;
18
- let i = ut(n).abButtonId;
20
+ return n => {
21
+ if (null != r && "function" == typeof r && !1 === r.bind(e)(n)) return;
22
+ let i = ct(o).abButtonId;
19
23
  if (
20
- ((null != i && "" !== i) || (i = e.getAttribute("id")),
21
- null != n && "" !== n && 0 !== n.indexOf("#"))
24
+ ((null != i && "" !== i) || (i = e.getAttribute("id") || void 0),
25
+ null != o && "" !== o && 0 !== o.indexOf("#"))
22
26
  ) {
23
27
  const r =
24
28
  "blank" ===
25
29
  (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);
30
+ u = s || t.openTarget === InAppMessage.OpenTarget.BLANK || r,
31
+ a = () => {
32
+ logInAppMessageHtmlClick(t, i, o), Z.openUri(o, u, n);
29
33
  };
30
- c ? l() : t.he(u, l);
31
- } else logInAppMessageHtmlClick(t, i, n);
32
- return s.stopPropagation(), !1;
34
+ u ? a() : t.he(c, a);
35
+ } else logInAppMessageHtmlClick(t, i, o || void 0);
36
+ return n.stopPropagation(), !1;
33
37
  };
34
38
  },
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
39
+ m = (t, e, o) => {
40
+ const r = `([\\w]+)\\s*=\\s*document.createElement\\(['"]${o}['"]\\)`,
41
+ n = t.match(new RegExp(r));
42
+ if (n) {
43
+ const o = `${n[1]}.setAttribute("nonce", "${e}")`;
44
+ return `${t.slice(0, n.index + n[0].length)};${o};${t.slice(
45
+ n.index + n[0].length
42
46
  )}`;
43
47
  }
44
48
  return null;
45
49
  };
46
50
  if (
47
- ((u.onload = () => {
48
- let o = null;
49
- if (null != s) {
50
- (o = document.createElement("html")), (o.innerHTML = t.message);
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(
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(
57
61
  /<style>/g,
58
- `<style nonce='${s}'>`
62
+ `<style nonce='${u}'>`
59
63
  ));
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
+ const e = m(o[t].innerHTML, u, "script");
65
+ e && (o[t].innerHTML = e);
66
+ const r = m(o[t].innerHTML, u, "style");
67
+ r && (o[t].innerHTML = r);
64
68
  }
65
69
  }
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())) {
70
+ const i = c.contentWindow;
71
+ i.focus(), i.document.write(s ? s.innerHTML : t.message || "");
72
+ const l = i.document.getElementsByTagName("head")[0];
73
+ if (null != l) {
74
+ if ((ut(l), t.ye())) {
71
75
  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
+ (e.innerHTML = t.css || ""),
77
+ (e.id = t.Ae() || ""),
78
+ null != u && e.setAttribute("nonce", u),
79
+ l.appendChild(e);
76
80
  }
77
- const e = u.contentWindow.document.createElement("base");
78
- e.setAttribute("target", "_parent"), r.appendChild(e);
81
+ const e = i.document.createElement("base");
82
+ null != e && (e.setAttribute("target", "_parent"), l.appendChild(e));
79
83
  }
80
- const l = u.contentWindow.document.getElementsByTagName("title");
81
- l.length > 0 && u.setAttribute("title", l[0].textContent);
82
- const a = {
84
+ const f = i.document.getElementsByTagName("title");
85
+ f && f.length > 0 && c.setAttribute("title", f[0].textContent || "");
86
+ const d = {
83
87
  closeMessage: function() {
84
- t.he(u);
88
+ t.he(c);
85
89
  },
86
90
  logClick: function() {
87
- const e = [t, ...arguments];
88
- logInAppMessageHtmlClick.apply(t, Array.prototype.slice.call(e));
91
+ logInAppMessageHtmlClick(t, ...arguments);
89
92
  },
90
93
  display: {},
91
94
  web: {}
@@ -93,23 +96,21 @@ export default function ct(t, e, n, o, r, s) {
93
96
  requestPushPermission = function() {
94
97
  return function() {
95
98
  const t = arguments;
96
- import("../../Push/request-push-permission.js").then(e => {
97
- e.requestPushPermission.apply(
98
- null,
99
- Array.prototype.slice.call(t)
100
- );
99
+ import("../../Push/request-push-permission.js").then(o => {
100
+ e.ue()
101
+ ? o.requestPushPermission(...Array.prototype.slice.call(t))
102
+ : r.j.error(P);
101
103
  });
102
104
  };
103
105
  },
104
- m = {
106
+ p = {
105
107
  requestImmediateDataFlush: function() {
106
108
  const t = arguments;
107
109
  import("../../Core/request-immediate-data-flush.js").then(
108
110
  ({ requestImmediateDataFlush: requestImmediateDataFlush }) => {
109
- requestImmediateDataFlush.apply(
110
- null,
111
- Array.prototype.slice.call(t)
112
- );
111
+ e.ue()
112
+ ? requestImmediateDataFlush(...Array.prototype.slice.call(t))
113
+ : r.j.error(P);
113
114
  }
114
115
  );
115
116
  },
@@ -117,7 +118,8 @@ export default function ct(t, e, n, o, r, s) {
117
118
  const t = arguments;
118
119
  import("../../Core/log-custom-event.js").then(
119
120
  ({ logCustomEvent: logCustomEvent }) => {
120
- logCustomEvent.apply(null, Array.prototype.slice.call(t));
121
+ if (!e.ue()) return void r.j.error(P);
122
+ logCustomEvent(...Array.prototype.slice.call(t));
121
123
  }
122
124
  );
123
125
  },
@@ -125,7 +127,8 @@ export default function ct(t, e, n, o, r, s) {
125
127
  const t = arguments;
126
128
  import("../../Core/log-purchase.js").then(
127
129
  ({ logPurchase: logPurchase }) => {
128
- logPurchase.apply(null, Array.prototype.slice.call(t));
130
+ if (!e.ue()) return void r.j.error(P);
131
+ logPurchase(...Array.prototype.slice.call(t));
129
132
  }
130
133
  );
131
134
  },
@@ -133,7 +136,9 @@ export default function ct(t, e, n, o, r, s) {
133
136
  const t = arguments;
134
137
  import("../../Push/unregister-push.js").then(
135
138
  ({ unregisterPush: unregisterPush }) => {
136
- unregisterPush.apply(null, Array.prototype.slice.call(t));
139
+ e.ue()
140
+ ? unregisterPush(...Array.prototype.slice.call(t))
141
+ : r.j.error(P);
137
142
  }
138
143
  );
139
144
  },
@@ -142,18 +147,19 @@ export default function ct(t, e, n, o, r, s) {
142
147
  const t = arguments;
143
148
  import("../../Core/change-user.js").then(
144
149
  ({ changeUser: changeUser }) => {
145
- changeUser.apply(null, Array.prototype.slice.call(t));
150
+ if (!e.ue()) return void r.j.error(P);
151
+ changeUser(...Array.prototype.slice.call(t));
146
152
  }
147
153
  );
148
154
  }
149
155
  },
150
- f = function(t) {
156
+ h = function(t) {
151
157
  return function() {
152
- m[t].apply(null, Array.prototype.slice.call(arguments));
158
+ p[t](...Array.prototype.slice.call(arguments));
153
159
  };
154
160
  };
155
- for (const t of or(m)) a[t] = f(t);
156
- const p = [
161
+ for (const t of oo(p)) d[t] = h(t);
162
+ const b = [
157
163
  "setFirstName",
158
164
  "setLastName",
159
165
  "setEmail",
@@ -174,65 +180,65 @@ export default function ct(t, e, n, o, r, s) {
174
180
  "addToSubscriptionGroup",
175
181
  "removeFromSubscriptionGroup"
176
182
  ],
177
- d = function(t) {
183
+ g = function(t) {
178
184
  return function() {
179
- const e = Q();
180
- e[t].apply(e, Array.prototype.slice.call(arguments));
185
+ const e = ee();
186
+ e && e[t](...Array.prototype.slice.call(arguments));
181
187
  };
182
188
  },
183
- g = {};
184
- for (let t = 0; t < p.length; t++) g[p[t]] = d(p[t]);
185
- a.getUser = function() {
186
- return g;
189
+ y = {};
190
+ for (let t = 0; t < b.length; t++) y[b[t]] = g(b[t]);
191
+ d.getUser = function() {
192
+ return y;
187
193
  };
188
- const h = { showFeed: e },
189
- b = function(e) {
194
+ const A = { showFeed: o },
195
+ j = function(e) {
190
196
  return function() {
191
- const n = arguments;
192
- t.he(u, function() {
193
- h[e].apply(null, Array.prototype.slice.call(n));
197
+ const o = arguments;
198
+ t.he(c, function() {
199
+ A[e](...Array.prototype.slice.call(o));
194
200
  });
195
201
  };
196
- };
197
- for (const t of or(h)) a.display[t] = b(t);
198
- const y = { registerAppboyPushMessages: requestPushPermission() },
199
- A = function(t) {
202
+ },
203
+ C = d.display;
204
+ for (const t of oo(A)) C[t] = j(t);
205
+ const v = { registerAppboyPushMessages: requestPushPermission() },
206
+ w = function(t) {
200
207
  return function() {
201
- y[t].apply(null, Array.prototype.slice.call(arguments));
208
+ v[t](...Array.prototype.slice.call(arguments));
202
209
  };
203
- };
204
- for (const t of or(y)) a.web[t] = A(t);
210
+ },
211
+ E = d.web;
212
+ for (const t of oo(v)) E[t] = w(t);
205
213
  if (
206
- ((u.contentWindow.appboyBridge = a),
207
- (u.contentWindow.brazeBridge = a),
208
- t.Ce !== InAppMessage.es.Pe)
214
+ ((i.appboyBridge = d), (i.brazeBridge = d), t.Ce !== InAppMessage.Ee.Pe)
209
215
  ) {
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]);
216
+ const t = i.document.getElementsByTagName("a");
217
+ for (let e = 0; e < t.length; e++) t[e].onclick = a(t[e]);
218
+ const e = i.document.getElementsByTagName("button");
219
+ for (let t = 0; t < e.length; t++) e[t].onclick = a(e[t]);
214
220
  }
215
- const j = u.contentWindow.document.body;
216
- if (null != j) {
217
- t.Ee() && (j.id = t.htmlId);
221
+ const $ = i.document.body;
222
+ if (null != $) {
223
+ t.$e() && ($.id = t.htmlId || "");
218
224
  const e = document.createElement("hidden");
219
- (e.onclick = a.closeMessage),
225
+ (e.onclick = d.closeMessage),
220
226
  (e.className = "ab-programmatic-close-button"),
221
- j.appendChild(e);
227
+ $.appendChild(e);
222
228
  }
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();
229
+ i.dispatchEvent(new CustomEvent("ab.BridgeReady")),
230
+ -1 !== c.className.indexOf("ab-start-hidden") &&
231
+ ((c.className = c.className.replace("ab-start-hidden", "")), n(c)),
232
+ document.activeElement !== c && c.focus();
227
233
  }),
228
- (u.className =
234
+ (c.className =
229
235
  "ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
230
- ot.OS === rt.$e)
236
+ V.OS === W.fe)
231
237
  ) {
232
238
  const e = document.createElement("div");
233
239
  return (
234
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(u), (t.qe = e), e
240
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.qe = e), e
235
241
  );
236
242
  }
237
- return (t.qe = u), u;
243
+ return (t.qe = c), c;
238
244
  }