@braze/web-sdk 4.9.0 → 5.0.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 (111) hide show
  1. package/index.d.ts +2204 -2230
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +1 -1
  4. package/shared-lib/event-types.js +9 -9
  5. package/shared-lib/indexed-db-adapter.js +13 -13
  6. package/shared-lib/logger.js +2 -2
  7. package/shared-lib/supported-options.js +8 -8
  8. package/src/Card/models/captioned-image.js +19 -19
  9. package/src/Card/models/card.js +95 -94
  10. package/src/Card/models/classic-card.js +19 -19
  11. package/src/Card/models/control-card.js +9 -9
  12. package/src/Card/models/image-only.js +21 -22
  13. package/src/Card/models/index.js +0 -1
  14. package/src/Card/util/card-factory.js +39 -39
  15. package/src/ContentCards/content-cards-provider.js +114 -114
  16. package/src/ContentCards/get-cached-content-cards.js +1 -1
  17. package/src/ContentCards/index.js +0 -1
  18. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  19. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  20. package/src/ContentCards/ui/hide-content-cards.js +2 -2
  21. package/src/ContentCards/ui/show-content-cards.js +14 -14
  22. package/src/Core/add-sdk-metadata.js +2 -2
  23. package/src/Core/change-user.js +2 -2
  24. package/src/Core/disable-sdk.js +4 -4
  25. package/src/Core/enable-sdk.js +4 -4
  26. package/src/Core/get-device-id.js +9 -7
  27. package/src/Core/handle-braze-action.js +14 -14
  28. package/src/Core/is-disabled.js +2 -2
  29. package/src/Core/open-session.js +5 -5
  30. package/src/Core/set-sdk-authentication-signature.js +2 -2
  31. package/src/Core/wipe-data.js +4 -4
  32. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  33. package/src/FeatureFlags/feature-flag.js +7 -7
  34. package/src/FeatureFlags/feature-flags-provider.js +50 -50
  35. package/src/FeatureFlags/get-all-feature-flags.js +1 -1
  36. package/src/FeatureFlags/get-feature-flag.js +3 -5
  37. package/src/Feed/feed-provider-factory.js +8 -8
  38. package/src/Feed/feed-provider.js +15 -15
  39. package/src/Feed/get-cached-feed.js +2 -2
  40. package/src/Feed/request-feed-refresh.js +2 -2
  41. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  42. package/src/Feed/ui/hide-feed.js +2 -2
  43. package/src/Feed/ui/show-feed.js +13 -13
  44. package/src/InAppMessage/display/html-message-to-html.js +11 -12
  45. package/src/InAppMessage/display/in-app-message-to-html.js +15 -15
  46. package/src/InAppMessage/display/modal-utils.js +8 -8
  47. package/src/InAppMessage/in-app-message-factory.js +4 -4
  48. package/src/InAppMessage/in-app-message-manager.js +38 -38
  49. package/src/InAppMessage/models/full-screen-message.js +31 -31
  50. package/src/InAppMessage/models/html-message.js +16 -16
  51. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  52. package/src/InAppMessage/models/in-app-message.js +46 -46
  53. package/src/InAppMessage/models/modal-message.js +30 -30
  54. package/src/InAppMessage/models/slide-up-message.js +26 -26
  55. package/src/InAppMessage/ui/show-in-app-message.js +9 -9
  56. package/src/Push/is-push-blocked.js +2 -2
  57. package/src/Push/is-push-permission-granted.js +2 -2
  58. package/src/Push/is-push-supported.js +2 -2
  59. package/src/Push/push-manager.js +31 -31
  60. package/src/Push/utils/push-utils.js +9 -9
  61. package/src/User/user-manager.js +8 -8
  62. package/src/User/user.js +38 -37
  63. package/src/common/base-feed.js +15 -14
  64. package/src/common/base-provider.js +1 -1
  65. package/src/common/event-logger.js +2 -2
  66. package/src/common/feed-display.js +32 -32
  67. package/src/l10n/l10n-manager-factory.js +9 -9
  68. package/src/managers/auth-manager.js +6 -6
  69. package/src/managers/braze-instance.js +84 -92
  70. package/src/managers/device-manager.js +9 -9
  71. package/src/managers/network-manager.js +72 -69
  72. package/src/managers/server-config-manager.js +13 -13
  73. package/src/managers/session-manager.js +9 -9
  74. package/src/managers/storage-manager-factory.js +11 -11
  75. package/src/managers/storage-manager.js +110 -110
  76. package/src/managers/subscription-manager.js +3 -3
  77. package/src/models/backend-errors.js +5 -5
  78. package/src/models/braze-event.js +7 -7
  79. package/src/models/identifier.js +1 -1
  80. package/src/models/push-token.js +1 -1
  81. package/src/models/server-config.js +6 -6
  82. package/src/request-controller.js +129 -125
  83. package/src/triggers/models/custom-event-data.js +1 -1
  84. package/src/triggers/models/custom-event-property-data.js +6 -6
  85. package/src/triggers/models/filter-set.js +8 -8
  86. package/src/triggers/models/filter.js +31 -31
  87. package/src/triggers/models/in-app-message-click-data.js +1 -1
  88. package/src/triggers/models/purchase-data.js +1 -1
  89. package/src/triggers/models/purchase-property-data.js +4 -4
  90. package/src/triggers/models/push-click-data.js +3 -3
  91. package/src/triggers/models/trigger-condition.js +30 -30
  92. package/src/triggers/models/trigger-events.js +1 -1
  93. package/src/triggers/models/trigger.js +32 -32
  94. package/src/triggers/triggers-provider.js +55 -55
  95. package/src/ui/js/attach-css.js +1 -1
  96. package/src/ui/js/feed-css.js +5 -5
  97. package/src/ui/js/iam-css.js +4 -4
  98. package/src/ui/js/load-font-awesome.js +1 -1
  99. package/src/util/braze-actions.js +4 -4
  100. package/src/util/browser-detector.js +11 -11
  101. package/src/util/client-hints-parser.js +5 -5
  102. package/src/util/component-utils.js +2 -2
  103. package/src/util/date-utils.js +2 -2
  104. package/src/util/device-constants.js +4 -5
  105. package/src/util/dom-utils.js +5 -5
  106. package/src/util/net.js +1 -1
  107. package/src/util/request-header-utils.js +17 -17
  108. package/src/util/user-agent-parser.js +11 -16
  109. package/src/util/validation-utils.js +9 -9
  110. package/src/Card/models/banner.js +0 -31
  111. package/src/ContentCards/log-content-cards-displayed.js +0 -5
@@ -1,22 +1,22 @@
1
1
  import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  import {
3
- destroyFeedHtml as k,
3
+ destroyFeedHtml as z,
4
4
  detectFeedImpressions as q,
5
5
  feedToHtml as I,
6
6
  LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as M,
7
7
  refreshFeed as $,
8
- registerFeedSubscriptionId as A,
9
- updateFeedCards as B,
8
+ registerFeedSubscriptionId as k,
9
+ updateFeedCards as A,
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
- import { setCardHeight as F } from "../../Card/display/card-display.js";
15
- import { setupFeedUI as G } from "../../ui/js/index.js";
14
+ import { setCardHeight as B } from "../../Card/display/card-display.js";
15
+ import { setupFeedUI as F } 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
- G();
19
+ F();
20
20
  const s = (e, t) => {
21
21
  if (null == t) return e;
22
22
  const n = [];
@@ -36,8 +36,8 @@ export function showFeed(t, n, o) {
36
36
  let a,
37
37
  f = !1;
38
38
  null == n
39
- ? ((a = ie.er().Hi()),
40
- B(a, s(a.cards, o), a.lastUpdated, null, i),
39
+ ? ((a = re.er().Hi()),
40
+ A(a, s(a.cards, o), a.lastUpdated, null, i),
41
41
  (f = !0))
42
42
  : (a = new Feed(s(n, o), new Date()));
43
43
  const u = I(a, i, l);
@@ -66,16 +66,16 @@ export function showFeed(t, n, o) {
66
66
  Math.max(t, 0),
67
67
  );
68
68
  }
69
- B(a, s(t.cards, o), t.lastUpdated, u, i);
69
+ A(a, s(t.cards, o), t.lastUpdated, u, i);
70
70
  });
71
- A(t, u);
71
+ k(t, u);
72
72
  }
73
73
  const d = (e) => {
74
74
  const t = e.querySelectorAll(".ab-feed");
75
75
  let n = null;
76
76
  for (let o = 0; o < t.length; o++) t[o].parentNode === e && (n = t[o]);
77
77
  null != n
78
- ? (k(n), n.parentNode && n.parentNode.replaceChild(u, n))
78
+ ? (z(n), n.parentNode && n.parentNode.replaceChild(u, n))
79
79
  : e.appendChild(u),
80
80
  setTimeout(function () {
81
81
  u.className = u.className.replace("ab-hide", "ab-show");
@@ -83,7 +83,7 @@ export function showFeed(t, n, o) {
83
83
  l && u.focus(),
84
84
  logFeedDisplayed(),
85
85
  q(a, u),
86
- a && F(a.cards, e);
86
+ a && B(a.cards, e);
87
87
  };
88
88
  var m;
89
89
  null != t
@@ -1,16 +1,15 @@
1
- import { attachInAppMessageCSS as ut } from "../../ui/js/iam-css.js";
2
- import V from "../../util/browser-detector.js";
1
+ import Q from "../../util/browser-detector.js";
3
2
  import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
4
- import { getUser as ee } from "../../Core/get-user.js";
3
+ import { getUser as Z } from "../../Core/get-user.js";
5
4
  import { InAppMessage } from "../index.js";
6
5
  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";
6
+ import { OperatingSystems as V } from "../../util/device-constants.js";
7
+ import { parseQueryStringKeyValues as ut } from "../../util/url-utils.js";
8
+ import { WindowUtils as Y } from "../../util/window-utils.js";
10
9
  import e from "../../managers/braze-instance.js";
11
10
  import r from "../../../shared-lib/braze-shared-lib.js";
12
11
  import { BRAZE_MUST_BE_INITIALIZED_ERROR as P } from "../../common/constants.js";
13
- export default function at(t, o, n, s, i, u) {
12
+ export default function ct(t, o, n, s, i, u) {
14
13
  const c = document.createElement("iframe");
15
14
  c.setAttribute("title", "Modal Message"),
16
15
  i && (c.style.zIndex = (i + 1).toString());
@@ -19,7 +18,7 @@ export default function at(t, o, n, s, i, u) {
19
18
  r = e.onclick;
20
19
  return (n) => {
21
20
  if (null != r && "function" == typeof r && !1 === r.bind(e)(n)) return;
22
- let i = ct(o).abButtonId;
21
+ let i = ut(o).abButtonId;
23
22
  if (
24
23
  ((null != i && "" !== i) || (i = e.getAttribute("id") || void 0),
25
24
  null != o && "" !== o && 0 !== o.indexOf("#"))
@@ -29,7 +28,7 @@ export default function at(t, o, n, s, i, u) {
29
28
  (e.getAttribute("target") || "").toLowerCase().replace("_", ""),
30
29
  u = s || t.openTarget === InAppMessage.OpenTarget.BLANK || r,
31
30
  a = () => {
32
- logInAppMessageHtmlClick(t, i, o), Z.openUri(o, u, n);
31
+ logInAppMessageHtmlClick(t, i, o), Y.openUri(o, u, n);
33
32
  };
34
33
  u ? a() : t.ye(c, a);
35
34
  } else logInAppMessageHtmlClick(t, i, o || void 0);
@@ -71,7 +70,7 @@ export default function at(t, o, n, s, i, u) {
71
70
  i.focus(), i.document.write(s ? s.innerHTML : t.message || "");
72
71
  const l = i.document.getElementsByTagName("head")[0];
73
72
  if (null != l) {
74
- if ((ut(l), t.Ae())) {
73
+ if (t.Ae()) {
75
74
  const e = document.createElement("style");
76
75
  (e.innerHTML = t.css || ""),
77
76
  (e.id = t.Ce() || ""),
@@ -182,7 +181,7 @@ export default function at(t, o, n, s, i, u) {
182
181
  ],
183
182
  g = function (t) {
184
183
  return function () {
185
- const e = ee();
184
+ const e = Z();
186
185
  e && e[t](...Array.prototype.slice.call(arguments));
187
186
  };
188
187
  },
@@ -233,7 +232,7 @@ export default function at(t, o, n, s, i, u) {
233
232
  }),
234
233
  (c.className =
235
234
  "ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
236
- V.OS === W.de)
235
+ Q.OS === V.de)
237
236
  ) {
238
237
  const e = document.createElement("div");
239
238
  return (
@@ -5,7 +5,7 @@ import {
5
5
  DIRECTIONS as c,
6
6
  } from "../../util/dom-utils.js";
7
7
  import { createCloseButton as o } from "../../util/component-utils.js";
8
- import { isTransparent as ne, toRgba as le } from "../../util/color-utils.js";
8
+ import { isTransparent as ne, toRgba as ie } 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,12 +13,12 @@ import ModalMessage from "../models/modal-message.js";
13
13
  import SlideUpMessage from "../models/slide-up-message.js";
14
14
  import { logInAppMessageClick } from "../log-in-app-message-click.js";
15
15
  import { _handleBrazeAction as m } from "../../Core/handle-braze-action.js";
16
- import at from "./html-message-to-html.js";
17
- import ce from "./modal-utils.js";
16
+ import ct from "./html-message-to-html.js";
17
+ import le from "./modal-utils.js";
18
18
  import r from "../../../shared-lib/braze-shared-lib.js";
19
- export default function de(e, a, t, n, s, i, l, u = document.body) {
19
+ export default function ce(e, a, t, n, s, i, l, u = document.body) {
20
20
  if (((e.ke = document.activeElement), e instanceof HtmlMessage))
21
- return at(e, a, t, s, i, l);
21
+ return ct(e, a, t, s, i, l);
22
22
  const b = (function (e, a, t, n, s, i, l = document.body) {
23
23
  let c = null;
24
24
  const d = document.createElement("div");
@@ -28,8 +28,8 @@ export default function de(e, a, t, n, s, i, l, u = document.body) {
28
28
  ((d.className += " ab-modal-interactions"),
29
29
  d.setAttribute("tabindex", "-1")),
30
30
  e.Ae() ||
31
- ((d.style.color = le(e.textColor)),
32
- (d.style.backgroundColor = le(e.backgroundColor)),
31
+ ((d.style.color = ie(e.textColor)),
32
+ (d.style.backgroundColor = ie(e.backgroundColor)),
33
33
  ne(e.backgroundColor) && (d.className += " ab-no-shadow"));
34
34
  const u = () => {
35
35
  -1 !== d.className.indexOf("ab-start-hidden") &&
@@ -78,7 +78,7 @@ export default function de(e, a, t, n, s, i, l, u = document.body) {
78
78
  )));
79
79
  const p = o(
80
80
  "Close Message",
81
- e.Ae() ? void 0 : le(e.closeButtonColor),
81
+ e.Ae() ? void 0 : ie(e.closeButtonColor),
82
82
  () => {
83
83
  e.ye(d);
84
84
  },
@@ -127,8 +127,8 @@ export default function de(e, a, t, n, s, i, l, u = document.body) {
127
127
  const o = document.createElement("span");
128
128
  (o.className = "ab-icon"),
129
129
  e.Ae() ||
130
- ((o.style.backgroundColor = le(e.iconBackgroundColor)),
131
- (o.style.color = le(e.iconColor)));
130
+ ((o.style.backgroundColor = ie(e.iconBackgroundColor)),
131
+ (o.style.color = ie(e.iconColor)));
132
132
  const a = document.createElement("i");
133
133
  (a.className = "fa"),
134
134
  a.appendChild(document.createTextNode(e.icon)),
@@ -145,7 +145,7 @@ export default function de(e, a, t, n, s, i, l, u = document.body) {
145
145
  e.headerAlignment || InAppMessage.TextAlignment.CENTER
146
146
  ).toLowerCase();
147
147
  (o.className += " " + a + "-aligned"),
148
- e.Ae() || (o.style.color = le(e.headerTextColor)),
148
+ e.Ae() || (o.style.color = ie(e.headerTextColor)),
149
149
  o.appendChild(document.createTextNode(e.header)),
150
150
  g.appendChild(o);
151
151
  }
@@ -154,9 +154,9 @@ export default function de(e, a, t, n, s, i, l, u = document.body) {
154
154
  if (e instanceof FullScreenMessage || e instanceof ModalMessage) {
155
155
  const o = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
156
156
  (b.className += ` ${o} ab-centered`),
157
- ce.He(e, a, b, s),
158
- ce.Je(b),
159
- ce.Ke(e.De, b);
157
+ le.He(e, a, b, s),
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 de(e, a, t, n, s, i, l, u = 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.Ae() ? void 0 : le(e.closeButtonColor),
167
+ e.Ae() ? void 0 : ie(e.closeButtonColor),
168
168
  );
169
169
  a.setAttribute("class", "ab-chevron"), o.appendChild(a);
170
170
  }
@@ -1,10 +1,10 @@
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 le } from "../../util/color-utils.js";
4
+ import { toRgba as ie } from "../../util/color-utils.js";
5
5
  import { addPassiveEventListener as oe } from "../../util/dom-utils.js";
6
- import { KeyCodes as lt } from "../../util/key-codes.js";
7
- const ce = {
6
+ import { KeyCodes as at } from "../../util/key-codes.js";
7
+ const le = {
8
8
  Je: (t) => {
9
9
  const o = t.querySelectorAll(
10
10
  ".ab-close-button, .ab-message-text, .ab-message-button",
@@ -16,7 +16,7 @@ const ce = {
16
16
  s = o[o.length - 1];
17
17
  t.addEventListener("keydown", (o) => {
18
18
  const a = document.activeElement;
19
- o.keyCode === lt.oo &&
19
+ o.keyCode === at.oo &&
20
20
  (o.shiftKey || (a !== s && a !== t)
21
21
  ? !o.shiftKey ||
22
22
  (a !== e && a !== t) ||
@@ -61,13 +61,13 @@ const ce = {
61
61
  "" === e.text && (l = " "),
62
62
  s.appendChild(document.createTextNode(l)),
63
63
  t.Ae() ||
64
- ((s.style.backgroundColor = le(e.backgroundColor)),
65
- (s.style.color = le(e.textColor)),
66
- (s.style.borderColor = le(e.borderColor))),
64
+ ((s.style.backgroundColor = ie(e.backgroundColor)),
65
+ (s.style.color = ie(e.textColor)),
66
+ (s.style.borderColor = ie(e.borderColor))),
67
67
  (s.onclick = n(e)),
68
68
  a.appendChild(s);
69
69
  }
70
70
  }
71
71
  },
72
72
  };
73
- export default ce;
73
+ export default le;
@@ -47,7 +47,7 @@ export function newInAppMessageFromJson(e) {
47
47
  if (
48
48
  ((null != B && "" !== B && null != C && "" !== C) ||
49
49
  ((B = void 0), (C = void 0)),
50
- s === ModalMessage.es || s === InAppMessage.qe.Se)
50
+ s === ModalMessage.et || s === InAppMessage.qe.Se)
51
51
  )
52
52
  q = new ModalMessage(
53
53
  o,
@@ -78,7 +78,7 @@ export function newInAppMessageFromJson(e) {
78
78
  B,
79
79
  C,
80
80
  );
81
- else if (s === FullScreenMessage.es)
81
+ else if (s === FullScreenMessage.et)
82
82
  q = new FullScreenMessage(
83
83
  o,
84
84
  n,
@@ -109,7 +109,7 @@ export function newInAppMessageFromJson(e) {
109
109
  B,
110
110
  C,
111
111
  );
112
- else if (s === SlideUpMessage.es)
112
+ else if (s === SlideUpMessage.et)
113
113
  q = new SlideUpMessage(
114
114
  o,
115
115
  n,
@@ -135,7 +135,7 @@ export function newInAppMessageFromJson(e) {
135
135
  );
136
136
  else {
137
137
  if (
138
- s !== HtmlMessage.es &&
138
+ s !== HtmlMessage.et &&
139
139
  s !== InAppMessage.qe.Ee &&
140
140
  s !== InAppMessage.qe.Ue
141
141
  )
@@ -5,37 +5,37 @@ import HtmlMessage from "./models/html-message.js";
5
5
  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
- import { newInAppMessageFromJson as pt } from "./in-app-message-factory.js";
8
+ import { newInAppMessageFromJson as lt } from "./in-app-message-factory.js";
9
9
  import { randomInclusive as D } 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 E from "../managers/subscription-manager.js";
13
- import mt from "../triggers/models/trigger.js";
14
- import { validateValueIsFromEnum as H } from "../util/code-utils.js";
15
- import { BRAZE_ACTION_URI_REGEX as X } from "../util/validation-utils.js";
13
+ import pt from "../triggers/models/trigger.js";
14
+ import { validateValueIsFromEnum as G } from "../util/code-utils.js";
15
+ import { BRAZE_ACTION_URI_REGEX as W } from "../util/validation-utils.js";
16
16
  import {
17
- containsPushPrimerBrazeAction as gt,
18
- containsUnknownBrazeAction as ft,
19
- getDecodedBrazeAction as Q,
20
- ineligibleBrazeActionURLErrorMessage as dt,
21
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as vt,
17
+ containsPushPrimerBrazeAction as mt,
18
+ containsUnknownBrazeAction as gt,
19
+ getDecodedBrazeAction as O,
20
+ ineligibleBrazeActionURLErrorMessage as ft,
21
+ INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as dt,
22
22
  } from "../util/braze-actions.js";
23
- import jt from "../Push/utils/push-utils.js";
23
+ import vt from "../Push/utils/push-utils.js";
24
24
  import T from "../util/request-header-utils.js";
25
25
  import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
26
26
  import { FullScreenMessage, ModalMessage, SlideUpMessage } from "./index.js";
27
27
  export default class aa {
28
28
  constructor(t, s, i, r) {
29
- (this.gt = t),
29
+ (this.$t = t),
30
30
  (this._e = s),
31
31
  (this.u = i),
32
- (this.ft = r),
33
- (this.gt = t),
32
+ (this.wt = r),
33
+ (this.$t = t),
34
34
  (this._e = s),
35
35
  (this.u = i),
36
- (this.ft = r),
36
+ (this.wt = r),
37
37
  (this.Ve = new E()),
38
- e.jt(this.Ve),
38
+ e.Ht(this.Ve),
39
39
  (this.We = 1e3),
40
40
  (this.Xe = 6e4),
41
41
  (this.Ye = null);
@@ -44,7 +44,7 @@ export default class aa {
44
44
  return this.Ve;
45
45
  }
46
46
  _i(t) {
47
- return this.Ve.lt(t);
47
+ return this.Ve.It(t);
48
48
  }
49
49
  Pi() {
50
50
  return this.Ye;
@@ -55,7 +55,7 @@ export default class aa {
55
55
  Ji(e, i) {
56
56
  if (!e) return new t();
57
57
  if (
58
- !H(
58
+ !G(
59
59
  InAppMessage.Ie,
60
60
  i,
61
61
  `${i} is not a valid in-app message display failure`,
@@ -119,14 +119,14 @@ export default class aa {
119
119
  if (!(t instanceof InAppMessage)) return;
120
120
  const e = (t) => {
121
121
  if (!t) return;
122
- const e = Q(t);
123
- return ft(e)
124
- ? dt(vt._r, "In-App Message")
125
- : gt(e) && !jt.Gr()
126
- ? dt(vt.Or, "In-App Message")
122
+ const e = O(t);
123
+ return gt(e)
124
+ ? ft(dt._r, "In-App Message")
125
+ : mt(e) && !vt.Gr()
126
+ ? ft(dt.Or, "In-App Message")
127
127
  : void 0;
128
128
  };
129
- if (this.Zi(t) && !jt.Gr())
129
+ if (this.Zi(t) && !vt.Gr())
130
130
  return "In-App Message contains a push prompt, but is not eligible for a push prompt. Ignoring.";
131
131
  const s = t.buttons || [];
132
132
  let i;
@@ -134,42 +134,42 @@ export default class aa {
134
134
  if (
135
135
  t.clickAction === InAppMessage.ClickAction.URI &&
136
136
  t.uri &&
137
- X.test(t.uri) &&
137
+ W.test(t.uri) &&
138
138
  ((i = e(t.uri)), i)
139
139
  )
140
140
  return i;
141
141
  return t.clickAction === InAppMessage.ClickAction.URI &&
142
142
  t.uri &&
143
- X.test(t.uri)
143
+ W.test(t.uri)
144
144
  ? e(t.uri)
145
145
  : void 0;
146
146
  }
147
147
  Hr(t, e, s, i) {
148
- if (!this.gt) return;
149
- const n = this.gt.Jr(!1, !1),
150
- o = this.gt.Bs(n);
148
+ if (!this.$t) return;
149
+ const n = this.$t.Jr(!1, !1),
150
+ o = this.$t.Bs(n);
151
151
  (o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
152
152
  null != s && (o.template.data = s.Kr());
153
- const a = this.gt.Hs(o, T.Os.Lr);
154
- this.gt.Qs(o, () => {
155
- this.gt &&
153
+ const a = this.$t.Hs(o, T.Os.Lr);
154
+ this.$t.Qs(o, () => {
155
+ this.$t &&
156
156
  (T.Ws(this.u, T.Os.Lr, new Date().valueOf()),
157
157
  C.Xs({
158
- url: `${this.gt.Ys()}/template/`,
158
+ url: `${this.$t.Ys()}/template/`,
159
159
  data: o,
160
160
  headers: a,
161
161
  O: (e) => {
162
- if ((T.si(this.u, T.Os.Lr, 1), !this.gt.Zs(o, e, a)))
162
+ if ((T.si(this.u, T.Os.Lr, 1), !this.$t.Zs(o, e, a)))
163
163
  return (
164
164
  this.Ji(t.triggerId, InAppMessage.Ie.Qr),
165
165
  void ("function" == typeof t.Ur && t.Ur())
166
166
  );
167
- if ((this.gt.ti(), null == e || null == e.templated_message))
167
+ if ((this.$t.ti(), null == e || null == e.templated_message))
168
168
  return void this.Ji(t.triggerId, InAppMessage.Ie.Qr);
169
169
  const s = e.templated_message;
170
- if (s.type !== mt.Wr.Vr)
170
+ if (s.type !== pt.Wr.Vr)
171
171
  return void this.Ji(t.triggerId, InAppMessage.Ie.Xr);
172
- const i = pt(s.data);
172
+ const i = lt(s.data);
173
173
  if (null == i) return void this.Ji(t.triggerId, InAppMessage.Ie.Xr);
174
174
  const n = this.Mr(i);
175
175
  if (n)
@@ -193,7 +193,7 @@ export default class aa {
193
193
  this.Hr(t, e, s, a);
194
194
  }, a);
195
195
  }
196
- this.gt.ii(r, n);
196
+ this.$t.ii(r, n);
197
197
  },
198
198
  }));
199
199
  });
@@ -216,7 +216,7 @@ export default class aa {
216
216
  !(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
217
217
  t instanceof ControlMessage
218
218
  ) &&
219
- this.u.D(i.k.rn, t.ss())
219
+ this.u.D(i.k.rn, t.tt())
220
220
  );
221
221
  }
222
222
  Re() {
@@ -66,40 +66,40 @@ export default class FullScreenMessage extends InAppMessage {
66
66
  ),
67
67
  (this.Te = InAppMessage.TextAlignment.CENTER);
68
68
  }
69
- ss() {
70
- return super.ss(FullScreenMessage.es);
69
+ tt() {
70
+ return super.tt(FullScreenMessage.et);
71
71
  }
72
72
  static an(e) {
73
73
  return new FullScreenMessage(
74
- e[InAppMessage.hs.ea],
75
- e[InAppMessage.hs.ra],
76
- e[InAppMessage.hs.xs],
77
- e[InAppMessage.hs.sa],
78
- e[InAppMessage.hs.ta],
79
- e[InAppMessage.hs.URI],
80
- e[InAppMessage.hs.ia],
81
- e[InAppMessage.hs.oa],
82
- e[InAppMessage.hs.pa],
83
- e[InAppMessage.hs.ma],
84
- e[InAppMessage.hs.os],
85
- e[InAppMessage.hs.na],
86
- e[InAppMessage.hs.ua],
87
- e[InAppMessage.hs.ca],
88
- e[InAppMessage.hs.fa],
89
- e[InAppMessage.hs.da],
90
- e[InAppMessage.hs.la],
91
- e[InAppMessage.hs.ga],
92
- e[InAppMessage.hs.ja],
93
- e[InAppMessage.hs.xa],
94
- e[InAppMessage.hs.za],
95
- e[InAppMessage.hs.ha],
96
- e[InAppMessage.hs.va],
97
- pe(e[InAppMessage.hs.wa]),
98
- e[InAppMessage.hs.ya],
99
- e[InAppMessage.hs.Sa],
100
- e[InAppMessage.hs.ba],
101
- e[InAppMessage.hs.CSS],
74
+ e[InAppMessage.it.ea],
75
+ e[InAppMessage.it.ra],
76
+ e[InAppMessage.it.jt],
77
+ e[InAppMessage.it.sa],
78
+ e[InAppMessage.it.ta],
79
+ e[InAppMessage.it.URI],
80
+ e[InAppMessage.it.ia],
81
+ e[InAppMessage.it.oa],
82
+ e[InAppMessage.it.pa],
83
+ e[InAppMessage.it.ma],
84
+ e[InAppMessage.it.nt],
85
+ e[InAppMessage.it.na],
86
+ e[InAppMessage.it.ua],
87
+ e[InAppMessage.it.ca],
88
+ e[InAppMessage.it.fa],
89
+ e[InAppMessage.it.da],
90
+ e[InAppMessage.it.la],
91
+ e[InAppMessage.it.ga],
92
+ e[InAppMessage.it.ja],
93
+ e[InAppMessage.it.xa],
94
+ e[InAppMessage.it.za],
95
+ e[InAppMessage.it.ha],
96
+ e[InAppMessage.it.va],
97
+ pe(e[InAppMessage.it.wa]),
98
+ e[InAppMessage.it.ya],
99
+ e[InAppMessage.it.Sa],
100
+ e[InAppMessage.it.ba],
101
+ e[InAppMessage.it.CSS],
102
102
  );
103
103
  }
104
104
  }
105
- FullScreenMessage.es = InAppMessage.qe.on;
105
+ FullScreenMessage.et = InAppMessage.qe.on;
@@ -43,26 +43,26 @@ export default class HtmlMessage extends InAppMessage {
43
43
  if (this.do) return !1;
44
44
  this.do = !0;
45
45
  }
46
- return this.ht.Et(i), !0;
46
+ return this.Et.Dt(i), !0;
47
47
  }
48
- ss() {
49
- const i = super.ss(HtmlMessage.es);
50
- return (i[InAppMessage.hs.vo] = this.messageFields), i;
48
+ tt() {
49
+ const i = super.tt(HtmlMessage.et);
50
+ return (i[InAppMessage.it.vo] = this.messageFields), i;
51
51
  }
52
52
  static an(i) {
53
53
  return new HtmlMessage(
54
- i[InAppMessage.hs.ea],
55
- i[InAppMessage.hs.xs],
56
- i[InAppMessage.hs.sa],
57
- i[InAppMessage.hs.oa],
58
- i[InAppMessage.hs.pa],
59
- i[InAppMessage.hs.ga],
60
- i[InAppMessage.hs.ja],
61
- i[InAppMessage.hs.va],
62
- i[InAppMessage.hs.ba],
63
- i[InAppMessage.hs.CSS],
64
- i[InAppMessage.hs.vo],
54
+ i[InAppMessage.it.ea],
55
+ i[InAppMessage.it.jt],
56
+ i[InAppMessage.it.sa],
57
+ i[InAppMessage.it.oa],
58
+ i[InAppMessage.it.pa],
59
+ i[InAppMessage.it.ga],
60
+ i[InAppMessage.it.ja],
61
+ i[InAppMessage.it.va],
62
+ i[InAppMessage.it.ba],
63
+ i[InAppMessage.it.CSS],
64
+ i[InAppMessage.it.vo],
65
65
  );
66
66
  }
67
67
  }
68
- HtmlMessage.es = InAppMessage.qe.ln;
68
+ HtmlMessage.et = InAppMessage.qe.ln;
@@ -18,19 +18,19 @@ export default class InAppMessageButton {
18
18
  null == n && (n = InAppMessageButton.Yi),
19
19
  (this.id = n),
20
20
  (this.do = !1),
21
- (this.ht = new E());
21
+ (this.Et = new E());
22
22
  }
23
23
  subscribeToClickedEvent(s) {
24
- return this.ht.lt(s);
24
+ return this.Et.It(s);
25
25
  }
26
26
  removeSubscription(s) {
27
- this.ht.removeSubscription(s);
27
+ this.Et.removeSubscription(s);
28
28
  }
29
29
  removeAllSubscriptions() {
30
- this.ht.removeAllSubscriptions();
30
+ this.Et.removeAllSubscriptions();
31
31
  }
32
32
  p() {
33
- return !this.do && ((this.do = !0), this.ht.Et(), !0);
33
+ return !this.do && ((this.do = !0), this.Et.Dt(), !0);
34
34
  }
35
35
  static fromJson(s) {
36
36
  return new InAppMessageButton(