@braze/web-sdk 4.8.3 → 4.9.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 (154) hide show
  1. package/index.d.ts +121 -6
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +7 -7
  4. package/shared-lib/encoding-utils.js +4 -4
  5. package/shared-lib/event-types.js +22 -21
  6. package/shared-lib/guid.js +7 -7
  7. package/shared-lib/indexed-db-adapter.js +172 -135
  8. package/shared-lib/logger.js +26 -26
  9. package/shared-lib/supported-options.js +15 -15
  10. package/shared-lib/types.js +1 -0
  11. package/src/Card/card-manager-factory.js +1 -1
  12. package/src/Card/card-manager.js +2 -2
  13. package/src/Card/display/card-display.js +5 -4
  14. package/src/Card/models/banner.js +10 -10
  15. package/src/Card/models/captioned-image.js +7 -7
  16. package/src/Card/models/card.js +37 -36
  17. package/src/Card/models/classic-card.js +7 -7
  18. package/src/Card/models/control-card.js +3 -3
  19. package/src/Card/models/image-only.js +32 -0
  20. package/src/Card/models/index.js +1 -0
  21. package/src/Card/util/card-factory.js +16 -16
  22. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  23. package/src/ContentCards/content-cards-provider.js +102 -102
  24. package/src/ContentCards/get-cached-content-cards.js +1 -1
  25. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  26. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  27. package/src/ContentCards/ui/show-content-cards.js +15 -12
  28. package/src/Core/add-sdk-metadata.js +2 -2
  29. package/src/Core/braze-sdk-metadata.js +1 -1
  30. package/src/Core/change-user.js +1 -1
  31. package/src/Core/device-properties.js +1 -1
  32. package/src/Core/disable-sdk.js +10 -7
  33. package/src/Core/enable-sdk.js +5 -2
  34. package/src/Core/get-device-id.js +3 -3
  35. package/src/Core/get-user.js +1 -1
  36. package/src/Core/handle-braze-action.js +14 -14
  37. package/src/Core/is-disabled.js +1 -1
  38. package/src/Core/log-custom-event.js +4 -4
  39. package/src/Core/log-purchase.js +9 -9
  40. package/src/Core/open-session.js +10 -10
  41. package/src/FeatureFlags/feature-flag-factory.js +5 -3
  42. package/src/FeatureFlags/feature-flag.js +17 -14
  43. package/src/FeatureFlags/feature-flags-provider-factory.js +1 -1
  44. package/src/FeatureFlags/feature-flags-provider.js +56 -43
  45. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  46. package/src/FeatureFlags/get-feature-flag.js +2 -2
  47. package/src/FeatureFlags/index.js +1 -0
  48. package/src/FeatureFlags/log-feature-flag-impression.js +23 -0
  49. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  50. package/src/Feed/feed-provider-factory.js +1 -1
  51. package/src/Feed/feed-provider.js +20 -20
  52. package/src/Feed/get-cached-feed.js +1 -1
  53. package/src/Feed/log-feed-displayed.js +1 -1
  54. package/src/Feed/request-feed-refresh.js +1 -1
  55. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  56. package/src/Feed/ui/show-feed.js +13 -10
  57. package/src/InAppMessage/defer-in-app-message.js +13 -0
  58. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  59. package/src/InAppMessage/display/html-message-to-html.js +47 -47
  60. package/src/InAppMessage/display/in-app-message-to-html.js +92 -91
  61. package/src/InAppMessage/display/modal-utils.js +16 -16
  62. package/src/InAppMessage/get-deferred-in-app-message.js +5 -0
  63. package/src/InAppMessage/in-app-message-factory.js +77 -57
  64. package/src/InAppMessage/in-app-message-manager-factory.js +6 -6
  65. package/src/InAppMessage/in-app-message-manager.js +121 -82
  66. package/src/InAppMessage/index.js +2 -0
  67. package/src/InAppMessage/log-in-app-message-button-click.js +17 -9
  68. package/src/InAppMessage/log-in-app-message-click.js +4 -4
  69. package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
  70. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  71. package/src/InAppMessage/models/full-screen-message.js +65 -29
  72. package/src/InAppMessage/models/html-message.js +32 -13
  73. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  74. package/src/InAppMessage/models/in-app-message.js +203 -134
  75. package/src/InAppMessage/models/modal-message.js +64 -29
  76. package/src/InAppMessage/models/slide-up-message.js +52 -24
  77. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  78. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  79. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +6 -6
  80. package/src/InAppMessage/ui/show-in-app-message.js +49 -47
  81. package/src/InAppMessage/utils/in-app-message-utils.js +1 -1
  82. package/src/Push/is-push-blocked.js +2 -2
  83. package/src/Push/is-push-permission-granted.js +2 -2
  84. package/src/Push/is-push-supported.js +2 -2
  85. package/src/Push/push-manager-factory.js +19 -19
  86. package/src/Push/push-manager.js +131 -131
  87. package/src/Push/request-push-permission.js +2 -2
  88. package/src/Push/unregister-push.js +2 -2
  89. package/src/Push/utils/push-utils.js +12 -10
  90. package/src/User/user-manager.js +4 -4
  91. package/src/User/user.js +57 -57
  92. package/src/common/base-feed.js +1 -1
  93. package/src/common/constants.js +1 -0
  94. package/src/common/event-logger.js +6 -6
  95. package/src/common/feed-display.js +34 -34
  96. package/src/common/translations.js +33 -33
  97. package/src/l10n/l10n-manager-factory.js +8 -8
  98. package/src/l10n/l10n-manager.js +6 -2
  99. package/src/l10n/types.js +1 -0
  100. package/src/managers/auth-manager.js +29 -29
  101. package/src/managers/braze-instance.js +125 -125
  102. package/src/managers/device-manager.js +20 -20
  103. package/src/managers/network-manager.js +100 -98
  104. package/src/managers/server-config-manager.js +23 -23
  105. package/src/managers/session-manager.js +5 -5
  106. package/src/managers/storage-manager-factory.js +9 -9
  107. package/src/managers/storage-manager.js +132 -129
  108. package/src/managers/subscription-manager.js +8 -8
  109. package/src/models/backend-errors.js +6 -6
  110. package/src/models/braze-event.js +11 -11
  111. package/src/models/braze-sdk-metadata.js +1 -1
  112. package/src/models/device.js +2 -2
  113. package/src/models/identifier.js +1 -1
  114. package/src/models/push-token.js +5 -5
  115. package/src/models/server-config.js +7 -7
  116. package/src/request-controller.js +191 -178
  117. package/src/triggers/models/custom-event-data.js +4 -4
  118. package/src/triggers/models/custom-event-property-data.js +7 -7
  119. package/src/triggers/models/filter-set.js +5 -5
  120. package/src/triggers/models/filter.js +64 -60
  121. package/src/triggers/models/in-app-message-click-data.js +9 -9
  122. package/src/triggers/models/purchase-data.js +4 -4
  123. package/src/triggers/models/purchase-property-data.js +6 -6
  124. package/src/triggers/models/push-click-data.js +6 -6
  125. package/src/triggers/models/trigger-condition.js +55 -59
  126. package/src/triggers/models/trigger-events.js +3 -3
  127. package/src/triggers/models/trigger.js +47 -35
  128. package/src/triggers/triggers-provider-factory.js +10 -6
  129. package/src/triggers/triggers-provider.js +203 -185
  130. package/src/triggers/types.js +1 -0
  131. package/src/ui/js/attach-css.js +5 -4
  132. package/src/ui/js/feed-css.js +5 -5
  133. package/src/ui/js/iam-css.js +5 -5
  134. package/src/ui/js/load-font-awesome.js +1 -1
  135. package/src/util/base-device-parser.js +1 -1
  136. package/src/util/braze-actions.js +35 -30
  137. package/src/util/browser-detector.js +30 -31
  138. package/src/util/client-hints-parser.js +30 -24
  139. package/src/util/code-utils.js +22 -21
  140. package/src/util/color-utils.js +19 -13
  141. package/src/util/component-utils.js +4 -4
  142. package/src/util/date-utils.js +4 -3
  143. package/src/util/device-constants.js +10 -10
  144. package/src/util/dom-utils.js +32 -28
  145. package/src/util/error-utils.js +1 -1
  146. package/src/util/key-codes.js +1 -1
  147. package/src/util/net.js +53 -57
  148. package/src/util/request-header-utils.js +34 -11
  149. package/src/util/string-utils.js +14 -14
  150. package/src/util/types.js +1 -0
  151. package/src/util/url-utils.js +1 -4
  152. package/src/util/user-agent-parser.js +39 -39
  153. package/src/util/validation-utils.js +32 -32
  154. package/src/util/window-utils.js +11 -12
@@ -2,7 +2,7 @@ import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  import V from "../../util/browser-detector.js";
3
3
  import {
4
4
  clickElement as Et,
5
- supportsPassive as Tt
5
+ supportsPassive as Tt,
6
6
  } from "../../util/dom-utils.js";
7
7
  import { KeyCodes as lt } from "../../util/key-codes.js";
8
8
  import E from "../../managers/subscription-manager.js";
@@ -15,29 +15,29 @@ export default class InAppMessage {
15
15
  h,
16
16
  e,
17
17
  n,
18
+ T,
18
19
  o,
19
20
  r,
20
21
  l,
21
22
  u,
22
- T,
23
23
  a,
24
- m,
25
- c,
26
24
  I,
27
- L,
25
+ c,
26
+ O,
28
27
  A,
29
- N,
30
- d,
28
+ L,
31
29
  _,
32
- O,
30
+ m,
31
+ N,
32
+ R,
33
33
  S,
34
34
  D,
35
35
  M,
36
- R,
37
- b,
38
- p,
36
+ C,
37
+ d,
39
38
  U,
40
- P
39
+ b,
40
+ P,
41
41
  ) {
42
42
  (this.message = t),
43
43
  (this.messageAlignment = s),
@@ -45,85 +45,85 @@ export default class InAppMessage {
45
45
  (this.extras = h),
46
46
  (this.triggerId = e),
47
47
  (this.clickAction = n),
48
- (this.uri = o),
49
- (this.openTarget = r),
50
- (this.dismissType = l),
51
- (this.duration = u),
52
- (this.icon = T),
48
+ (this.uri = T),
49
+ (this.openTarget = o),
50
+ (this.dismissType = r),
51
+ (this.duration = l),
52
+ (this.icon = u),
53
53
  (this.imageUrl = a),
54
- (this.imageStyle = m),
54
+ (this.imageStyle = I),
55
55
  (this.iconColor = c),
56
- (this.iconBackgroundColor = I),
57
- (this.backgroundColor = L),
58
- (this.textColor = A),
59
- (this.closeButtonColor = N),
60
- (this.animateIn = d),
61
- (this.animateOut = _),
62
- (this.header = O),
56
+ (this.iconBackgroundColor = O),
57
+ (this.backgroundColor = A),
58
+ (this.textColor = L),
59
+ (this.closeButtonColor = _),
60
+ (this.animateIn = m),
61
+ (this.animateOut = N),
62
+ (this.header = R),
63
63
  (this.headerAlignment = S),
64
64
  (this.headerTextColor = D),
65
65
  (this.frameColor = M),
66
- (this.buttons = R),
67
- (this.cropType = b),
68
- (this.orientation = p),
69
- (this.htmlId = U),
66
+ (this.buttons = C),
67
+ (this.cropType = d),
68
+ (this.orientation = U),
69
+ (this.htmlId = b),
70
70
  (this.css = P),
71
71
  (this.message = t),
72
72
  (this.messageAlignment = s || InAppMessage.TextAlignment.CENTER),
73
- (this.duration = u || 5e3),
73
+ (this.duration = l || 5e3),
74
74
  (this.slideFrom = i || InAppMessage.SlideFrom.BOTTOM),
75
75
  (this.extras = h || {}),
76
76
  (this.triggerId = e),
77
77
  (this.clickAction = n || InAppMessage.ClickAction.NONE),
78
- (this.uri = o),
79
- (this.openTarget = r || InAppMessage.OpenTarget.NONE),
80
- (this.dismissType = l || InAppMessage.DismissType.AUTO_DISMISS),
81
- (this.icon = T),
78
+ (this.uri = T),
79
+ (this.openTarget = o || InAppMessage.OpenTarget.NONE),
80
+ (this.dismissType = r || InAppMessage.DismissType.AUTO_DISMISS),
81
+ (this.icon = u),
82
82
  (this.imageUrl = a),
83
- (this.imageStyle = m || InAppMessage.ImageStyle.TOP),
84
- (this.iconColor = c || InAppMessage.Vr.Wr),
85
- (this.iconBackgroundColor = I || InAppMessage.Vr.Ur),
86
- (this.backgroundColor = L || InAppMessage.Vr.Wr),
87
- (this.textColor = A || InAppMessage.Vr.th),
88
- (this.closeButtonColor = N || InAppMessage.Vr.sh),
89
- (this.animateIn = d),
83
+ (this.imageStyle = I || InAppMessage.ImageStyle.TOP),
84
+ (this.iconColor = c || InAppMessage.th.ih),
85
+ (this.iconBackgroundColor = O || InAppMessage.th.sh),
86
+ (this.backgroundColor = A || InAppMessage.th.ih),
87
+ (this.textColor = L || InAppMessage.th.hh),
88
+ (this.closeButtonColor = _ || InAppMessage.th.eh),
89
+ (this.animateIn = m),
90
90
  null == this.animateIn && (this.animateIn = !0),
91
- (this.animateOut = _),
91
+ (this.animateOut = N),
92
92
  null == this.animateOut && (this.animateOut = !0),
93
- (this.header = O),
93
+ (this.header = R),
94
94
  (this.headerAlignment = S || InAppMessage.TextAlignment.CENTER),
95
- (this.headerTextColor = D || InAppMessage.Vr.th),
96
- (this.frameColor = M || InAppMessage.Vr.ih),
97
- (this.buttons = R || []),
98
- (this.cropType = b || InAppMessage.CropType.FIT_CENTER),
99
- (this.orientation = p),
100
- (this.htmlId = U),
95
+ (this.headerTextColor = D || InAppMessage.th.hh),
96
+ (this.frameColor = M || InAppMessage.th.Eh),
97
+ (this.buttons = C || []),
98
+ (this.cropType = d || InAppMessage.CropType.FIT_CENTER),
99
+ (this.orientation = U),
100
+ (this.htmlId = b),
101
101
  (this.css = P),
102
102
  (this.isControl = !1),
103
- (this.hh = !1),
104
- (this.eh = !1),
105
- (this.vo = !1),
106
103
  (this.nh = !1),
107
- (this.qe = null),
104
+ (this.Th = !1),
105
+ (this.do = !1),
106
+ (this.oh = !1),
107
+ (this.Me = null),
108
108
  (this.ke = null),
109
109
  (this.ht = new E()),
110
- (this.oh = new E()),
111
- (this.Le = InAppMessage.TextAlignment.CENTER);
110
+ (this.rh = new E()),
111
+ (this.Te = InAppMessage.TextAlignment.CENTER);
112
112
  }
113
113
  subscribeToClickedEvent(t) {
114
114
  return this.ht.lt(t);
115
115
  }
116
116
  subscribeToDismissedEvent(t) {
117
- return this.oh.lt(t);
117
+ return this.rh.lt(t);
118
118
  }
119
119
  removeSubscription(t) {
120
- this.ht.removeSubscription(t), this.oh.removeSubscription(t);
120
+ this.ht.removeSubscription(t), this.rh.removeSubscription(t);
121
121
  }
122
122
  removeAllSubscriptions() {
123
- this.ht.removeAllSubscriptions(), this.oh.removeAllSubscriptions();
123
+ this.ht.removeAllSubscriptions(), this.rh.removeAllSubscriptions();
124
124
  }
125
125
  closeMessage() {
126
- this.he(this.qe);
126
+ this.ye(this.Me);
127
127
  }
128
128
  xe() {
129
129
  return !0;
@@ -131,43 +131,43 @@ export default class InAppMessage {
131
131
  io() {
132
132
  return this.xe();
133
133
  }
134
- $e() {
134
+ Ne() {
135
135
  return null != this.htmlId && this.htmlId.length > 4;
136
136
  }
137
- ye() {
138
- return this.$e() && null != this.css && this.css.length > 0;
139
- }
140
137
  Ae() {
141
- if (this.$e() && this.ye()) return this.htmlId + "-css";
138
+ return this.Ne() && null != this.css && this.css.length > 0;
139
+ }
140
+ Ce() {
141
+ if (this.Ne() && this.Ae()) return this.htmlId + "-css";
142
142
  }
143
143
  M() {
144
- return !this.eh && ((this.eh = !0), !0);
144
+ return !this.Th && ((this.Th = !0), !0);
145
145
  }
146
- Qr() {
147
- return this.eh;
146
+ so() {
147
+ return this.Th;
148
148
  }
149
149
  p(t) {
150
- return !this.vo && ((this.vo = !0), this.ht.Et(), !0);
150
+ return !this.do && ((this.do = !0), this.ht.Et(), !0);
151
151
  }
152
152
  F() {
153
- return !this.nh && ((this.nh = !0), this.oh.Et(), !0);
153
+ return !this.oh && ((this.oh = !0), this.rh.Et(), !0);
154
154
  }
155
155
  hide(t) {
156
156
  if (t && t.parentNode) {
157
157
  let s = t.closest(".ab-iam-root");
158
158
  if ((null == s && (s = t), this.xe() && null != s.parentNode)) {
159
159
  const t = s.parentNode.classList;
160
- t && t.contains(InAppMessage.rh) && t.remove(InAppMessage.rh),
161
- document.body.removeEventListener("touchmove", InAppMessage.lh);
160
+ t && t.contains(InAppMessage.lh) && t.remove(InAppMessage.lh),
161
+ document.body.removeEventListener("touchmove", InAppMessage.uh);
162
162
  }
163
- s.className = s.className.replace(InAppMessage.uh, InAppMessage.Eh);
163
+ s.className = s.className.replace(InAppMessage.ah, InAppMessage.Ih);
164
164
  }
165
165
  return this.animateOut || !1;
166
166
  }
167
- he(t, s) {
167
+ ye(t, s) {
168
168
  if (null == t) return;
169
169
  let i;
170
- (this.qe = null),
170
+ (this.Me = null),
171
171
  (i =
172
172
  -1 === t.className.indexOf("ab-in-app-message")
173
173
  ? t.getElementsByClassName("ab-in-app-message")[0]
@@ -175,57 +175,57 @@ export default class InAppMessage {
175
175
  let h = !1;
176
176
  i && (h = this.hide(i));
177
177
  const e = document.body;
178
- let n;
179
- null != e && (n = e.scrollTop);
180
- const o = () => {
178
+ let E;
179
+ null != e && (E = e.scrollTop);
180
+ const n = () => {
181
181
  if (t && t.parentNode) {
182
182
  let s = t.closest(".ab-iam-root");
183
183
  null == s && (s = t), s.parentNode && s.parentNode.removeChild(s);
184
184
  }
185
- const i = this.Ae();
185
+ const i = this.Ce();
186
186
  if (null != i) {
187
187
  const t = document.getElementById(i);
188
188
  t && t.parentNode && t.parentNode.removeChild(t);
189
189
  }
190
- null != e && "Safari" === V.browser && (e.scrollTop = n),
190
+ null != e && "Safari" === V.browser && (e.scrollTop = E),
191
191
  s ? s() : this.F();
192
192
  };
193
- h ? setTimeout(o, InAppMessage.Th) : o(), this.ke && this.ke.focus();
193
+ h ? setTimeout(n, InAppMessage.Oh) : n(), this.ke && this.ke.focus();
194
194
  }
195
- Be() {
195
+ Ge() {
196
196
  return document.createTextNode(this.message || "");
197
197
  }
198
- Ie(t) {
198
+ Be(t) {
199
199
  let s = "";
200
200
  this.message || this.header || !this.xe() || (s = "Modal Image"),
201
201
  t.setAttribute("alt", s);
202
202
  }
203
- static lh(t) {
203
+ static uh(t) {
204
204
  if (t.targetTouches && t.targetTouches.length > 1) return;
205
205
  const s = t.target;
206
206
  (s &&
207
207
  s.classList &&
208
208
  s.classList.contains("ab-message-text") &&
209
209
  s.scrollHeight > s.clientHeight) ||
210
- (document.querySelector(`.${InAppMessage.rh}`) && t.preventDefault());
210
+ (document.querySelector(`.${InAppMessage.lh}`) && t.preventDefault());
211
211
  }
212
- ah(t) {
212
+ Ah(t) {
213
213
  const s = t.parentNode;
214
214
  this.xe() &&
215
215
  null != s &&
216
216
  this.orientation !== InAppMessage.Orientation.LANDSCAPE &&
217
- (null != s.classList && s.classList.add(InAppMessage.rh),
217
+ (null != s.classList && s.classList.add(InAppMessage.lh),
218
218
  document.body.addEventListener(
219
219
  "touchmove",
220
- InAppMessage.lh,
221
- !!Tt() && { passive: !1 }
220
+ InAppMessage.uh,
221
+ !!Tt() && { passive: !1 },
222
222
  )),
223
- (t.className += " " + InAppMessage.uh);
223
+ (t.className += " " + InAppMessage.ah);
224
224
  }
225
- static mh(t) {
225
+ static Lh(t) {
226
226
  if (
227
- t.keyCode === lt.Ih &&
228
- !e.nn(L.Lh) &&
227
+ t.keyCode === lt._h &&
228
+ !e.nn(L.mh) &&
229
229
  document.querySelectorAll(".ab-modal-interactions").length > 0
230
230
  ) {
231
231
  const t = document.getElementsByClassName("ab-html-message");
@@ -235,55 +235,91 @@ export default class InAppMessage {
235
235
  It(i) &&
236
236
  i.contentWindow &&
237
237
  (t = i.contentWindow.document.getElementsByClassName(
238
- "ab-programmatic-close-button"
238
+ "ab-programmatic-close-button",
239
239
  )[0]),
240
240
  null != t && (Et(t), (s = !0));
241
241
  }
242
242
  if (!s) {
243
243
  const t = document.querySelectorAll(
244
- ".ab-modal-interactions > .ab-close-button"
244
+ ".ab-modal-interactions > .ab-close-button",
245
245
  )[0];
246
246
  null != t && Et(t);
247
247
  }
248
248
  }
249
249
  }
250
- Ah() {
251
- this.hh ||
252
- e.nn(L.Lh) ||
253
- (document.addEventListener("keydown", InAppMessage.mh, !1),
254
- e.Nh(() => {
255
- document.removeEventListener("keydown", InAppMessage.mh);
250
+ Nh() {
251
+ this.nh ||
252
+ e.nn(L.mh) ||
253
+ (document.addEventListener("keydown", InAppMessage.Lh, !1),
254
+ e.Rh(() => {
255
+ document.removeEventListener("keydown", InAppMessage.Lh);
256
256
  }),
257
- (this.hh = !0));
257
+ (this.nh = !0));
258
+ }
259
+ ss(t) {
260
+ const s = {};
261
+ return t
262
+ ? ((s[InAppMessage.hs.ea] = this.message),
263
+ (s[InAppMessage.hs.ra] = this.messageAlignment),
264
+ (s[InAppMessage.hs.Sh] = this.slideFrom),
265
+ (s[InAppMessage.hs.xs] = this.extras),
266
+ (s[InAppMessage.hs.sa] = this.triggerId),
267
+ (s[InAppMessage.hs.ta] = this.clickAction),
268
+ (s[InAppMessage.hs.URI] = this.uri),
269
+ (s[InAppMessage.hs.ia] = this.openTarget),
270
+ (s[InAppMessage.hs.oa] = this.dismissType),
271
+ (s[InAppMessage.hs.pa] = this.duration),
272
+ (s[InAppMessage.hs.ma] = this.icon),
273
+ (s[InAppMessage.hs.os] = this.imageUrl),
274
+ (s[InAppMessage.hs.na] = this.imageStyle),
275
+ (s[InAppMessage.hs.ua] = this.iconColor),
276
+ (s[InAppMessage.hs.ca] = this.iconBackgroundColor),
277
+ (s[InAppMessage.hs.fa] = this.backgroundColor),
278
+ (s[InAppMessage.hs.da] = this.textColor),
279
+ (s[InAppMessage.hs.la] = this.closeButtonColor),
280
+ (s[InAppMessage.hs.ga] = this.animateIn),
281
+ (s[InAppMessage.hs.ja] = this.animateOut),
282
+ (s[InAppMessage.hs.xa] = this.header),
283
+ (s[InAppMessage.hs.za] = this.headerAlignment),
284
+ (s[InAppMessage.hs.ha] = this.headerTextColor),
285
+ (s[InAppMessage.hs.va] = this.frameColor),
286
+ (s[InAppMessage.hs.wa] = this.buttons),
287
+ (s[InAppMessage.hs.ya] = this.cropType),
288
+ (s[InAppMessage.hs.Sa] = this.orientation),
289
+ (s[InAppMessage.hs.ba] = this.htmlId),
290
+ (s[InAppMessage.hs.CSS] = this.css),
291
+ (s[InAppMessage.hs.ts] = t),
292
+ s)
293
+ : s;
258
294
  }
259
295
  }
260
- (InAppMessage.Vr = {
261
- th: 4281545523,
262
- Wr: 4294967295,
263
- Ur: 4278219733,
264
- dh: 4293914607,
265
- _h: 4283782485,
266
- ih: 3224580915,
267
- sh: 4288387995
296
+ (InAppMessage.th = {
297
+ hh: 4281545523,
298
+ ih: 4294967295,
299
+ sh: 4278219733,
300
+ Dh: 4293914607,
301
+ Mh: 4283782485,
302
+ Eh: 3224580915,
303
+ eh: 4288387995,
268
304
  }),
269
- (InAppMessage.Me = {
270
- Oh: "hd",
271
- ze: "ias",
272
- Sh: "of",
273
- Dh: "do",
274
- Or: "umt",
275
- Zi: "tf",
276
- Mh: "te"
305
+ (InAppMessage.Ie = {
306
+ Ch: "hd",
307
+ Le: "ias",
308
+ dh: "of",
309
+ Uh: "do",
310
+ Xr: "umt",
311
+ Qr: "tf",
312
+ bh: "te",
277
313
  }),
278
314
  (InAppMessage.SlideFrom = { TOP: "TOP", BOTTOM: "BOTTOM" }),
279
315
  (InAppMessage.ClickAction = {
280
316
  NEWS_FEED: "NEWS_FEED",
281
317
  URI: "URI",
282
- NONE: "NONE"
318
+ NONE: "NONE",
283
319
  }),
284
320
  (InAppMessage.DismissType = {
285
321
  AUTO_DISMISS: "AUTO_DISMISS",
286
- MANUAL: "SWIPE"
322
+ MANUAL: "SWIPE",
287
323
  }),
288
324
  (InAppMessage.OpenTarget = { NONE: "NONE", BLANK: "BLANK" }),
289
325
  (InAppMessage.ImageStyle = { TOP: "TOP", GRAPHIC: "GRAPHIC" }),
@@ -291,23 +327,56 @@ export default class InAppMessage {
291
327
  (InAppMessage.TextAlignment = {
292
328
  START: "START",
293
329
  CENTER: "CENTER",
294
- END: "END"
330
+ END: "END",
295
331
  }),
296
332
  (InAppMessage.CropType = {
297
333
  CENTER_CROP: "CENTER_CROP",
298
- FIT_CENTER: "FIT_CENTER"
334
+ FIT_CENTER: "FIT_CENTER",
299
335
  }),
300
- (InAppMessage.Ee = {
301
- Rh: "SLIDEUP",
302
- bh: "MODAL",
303
- Ne: "MODAL_STYLED",
304
- so: "FULL",
305
- do: "WEB_HTML",
306
- Pe: "HTML",
307
- ph: "HTML_FULL"
336
+ (InAppMessage.qe = {
337
+ pn: "SLIDEUP",
338
+ un: "MODAL",
339
+ Se: "MODAL_STYLED",
340
+ on: "FULL",
341
+ ln: "WEB_HTML",
342
+ Ee: "HTML",
343
+ Ue: "HTML_FULL",
308
344
  }),
309
- (InAppMessage.Th = 500),
310
- (InAppMessage.Uh = 200),
311
- (InAppMessage.uh = "ab-show"),
312
- (InAppMessage.Eh = "ab-hide"),
313
- (InAppMessage.rh = "ab-pause-scrolling");
345
+ (InAppMessage.Oh = 500),
346
+ (InAppMessage.Ph = 200),
347
+ (InAppMessage.ah = "ab-show"),
348
+ (InAppMessage.Ih = "ab-hide"),
349
+ (InAppMessage.lh = "ab-pause-scrolling"),
350
+ (InAppMessage.hs = {
351
+ ea: "m",
352
+ ra: "ma",
353
+ Sh: "sf",
354
+ xs: "e",
355
+ sa: "ti",
356
+ ta: "ca",
357
+ URI: "u",
358
+ ia: "oa",
359
+ oa: "dt",
360
+ pa: "d",
361
+ ma: "i",
362
+ os: "iu",
363
+ na: "is",
364
+ ua: "ic",
365
+ ca: "ibc",
366
+ fa: "bc",
367
+ da: "tc",
368
+ la: "cbc",
369
+ ga: "ai",
370
+ ja: "ao",
371
+ xa: "h",
372
+ za: "ha",
373
+ ha: "htc",
374
+ va: "fc",
375
+ wa: "b",
376
+ ya: "ct",
377
+ Sa: "o",
378
+ ba: "hi",
379
+ CSS: "css",
380
+ ts: "type",
381
+ vo: "messageFields",
382
+ });
@@ -1,66 +1,101 @@
1
+ import { buttonsFromSerializedInAppMessage as pe } from "../in-app-message-factory.js";
1
2
  import InAppMessage from "./in-app-message.js";
2
3
  export default class ModalMessage extends InAppMessage {
3
4
  constructor(
4
- s,
5
5
  e,
6
- o,
7
- t,
8
6
  r,
7
+ s,
8
+ t,
9
9
  i,
10
- p,
10
+ o,
11
11
  a,
12
- d,
13
- c,
12
+ p,
14
13
  m,
15
14
  n,
16
15
  u,
16
+ c,
17
+ d,
17
18
  f,
18
19
  l,
20
+ g,
21
+ j,
19
22
  v,
20
23
  x,
21
- g,
24
+ z,
22
25
  h,
23
- j,
26
+ w,
27
+ y,
28
+ S,
24
29
  b,
25
30
  k,
26
31
  q,
27
- w,
28
- y,
29
- z,
30
- A
31
32
  ) {
32
33
  super(
33
- s,
34
34
  e,
35
+ r,
35
36
  void 0,
36
- o,
37
+ s,
37
38
  t,
38
- r,
39
39
  i,
40
- p,
41
- (a = a || InAppMessage.DismissType.MANUAL),
42
- d,
43
- c,
40
+ o,
41
+ a,
42
+ (p = p || InAppMessage.DismissType.MANUAL),
44
43
  m,
45
44
  n,
46
45
  u,
46
+ c,
47
+ d,
47
48
  f,
48
49
  l,
50
+ g,
51
+ j,
49
52
  v,
50
53
  x,
51
- g,
54
+ z,
52
55
  h,
53
- j,
54
- b,
55
- k,
56
- q,
57
56
  w,
58
- (y = y || InAppMessage.CropType.FIT_CENTER),
57
+ y,
58
+ S,
59
+ (b = b || InAppMessage.CropType.FIT_CENTER),
59
60
  void 0,
60
- z,
61
- A
61
+ k,
62
+ q,
62
63
  ),
63
- (this.Le = InAppMessage.TextAlignment.CENTER);
64
+ (this.Te = InAppMessage.TextAlignment.CENTER);
65
+ }
66
+ ss() {
67
+ return super.ss(ModalMessage.es);
68
+ }
69
+ static an(e) {
70
+ return new ModalMessage(
71
+ e[InAppMessage.hs.ea],
72
+ e[InAppMessage.hs.ra],
73
+ e[InAppMessage.hs.xs],
74
+ e[InAppMessage.hs.sa],
75
+ e[InAppMessage.hs.ta],
76
+ e[InAppMessage.hs.URI],
77
+ e[InAppMessage.hs.ia],
78
+ e[InAppMessage.hs.oa],
79
+ e[InAppMessage.hs.pa],
80
+ e[InAppMessage.hs.ma],
81
+ e[InAppMessage.hs.os],
82
+ e[InAppMessage.hs.na],
83
+ e[InAppMessage.hs.ua],
84
+ e[InAppMessage.hs.ca],
85
+ e[InAppMessage.hs.fa],
86
+ e[InAppMessage.hs.da],
87
+ e[InAppMessage.hs.la],
88
+ e[InAppMessage.hs.ga],
89
+ e[InAppMessage.hs.ja],
90
+ e[InAppMessage.hs.xa],
91
+ e[InAppMessage.hs.za],
92
+ e[InAppMessage.hs.ha],
93
+ e[InAppMessage.hs.va],
94
+ pe(e[InAppMessage.hs.wa]),
95
+ e[InAppMessage.hs.ya],
96
+ e[InAppMessage.hs.ba],
97
+ e[InAppMessage.hs.CSS],
98
+ );
64
99
  }
65
100
  }
66
- ModalMessage.es = InAppMessage.Ee.bh;
101
+ ModalMessage.es = InAppMessage.qe.un;