@braze/web-sdk 4.8.3 → 4.10.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 (153) hide show
  1. package/index.d.ts +2247 -2071
  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 +23 -22
  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 +14 -13
  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 +9 -7
  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 +63 -62
  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 +132 -130
  102. package/src/managers/device-manager.js +22 -22
  103. package/src/managers/network-manager.js +103 -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 +134 -131
  108. package/src/managers/subscription-manager.js +7 -7
  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 +197 -180
  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 +65 -61
  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 +52 -56
  126. package/src/triggers/models/trigger-events.js +3 -3
  127. package/src/triggers/models/trigger.js +50 -38
  128. package/src/triggers/triggers-provider-factory.js +10 -6
  129. package/src/triggers/triggers-provider.js +204 -186
  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/util/base-device-parser.js +1 -1
  135. package/src/util/braze-actions.js +35 -30
  136. package/src/util/browser-detector.js +30 -31
  137. package/src/util/client-hints-parser.js +28 -22
  138. package/src/util/code-utils.js +22 -21
  139. package/src/util/color-utils.js +19 -13
  140. package/src/util/component-utils.js +4 -4
  141. package/src/util/date-utils.js +6 -5
  142. package/src/util/device-constants.js +10 -10
  143. package/src/util/dom-utils.js +28 -24
  144. package/src/util/error-utils.js +1 -1
  145. package/src/util/key-codes.js +1 -1
  146. package/src/util/net.js +53 -57
  147. package/src/util/request-header-utils.js +34 -11
  148. package/src/util/string-utils.js +14 -14
  149. package/src/util/types.js +1 -0
  150. package/src/util/url-utils.js +1 -4
  151. package/src/util/user-agent-parser.js +39 -39
  152. package/src/util/validation-utils.js +34 -34
  153. package/src/util/window-utils.js +11 -12
@@ -18,10 +18,12 @@ import {
18
18
  containsUnknownBrazeAction as ft,
19
19
  getDecodedBrazeAction as Q,
20
20
  ineligibleBrazeActionURLErrorMessage as dt,
21
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as vt
21
+ INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as vt,
22
22
  } from "../util/braze-actions.js";
23
- import yt from "../Push/utils/push-utils.js";
23
+ import jt from "../Push/utils/push-utils.js";
24
24
  import T from "../util/request-header-utils.js";
25
+ import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
26
+ import { FullScreenMessage, ModalMessage, SlideUpMessage } from "./index.js";
25
27
  export default class aa {
26
28
  constructor(t, s, i, r) {
27
29
  (this.gt = t),
@@ -32,178 +34,215 @@ export default class aa {
32
34
  (this._e = s),
33
35
  (this.u = i),
34
36
  (this.ft = r),
35
- (this.Se = new E()),
36
- e.jt(this.Se),
37
- (this.Oe = 1e3),
38
- (this.Re = 6e4),
39
- (this.Qe = null);
37
+ (this.Ve = new E()),
38
+ e.jt(this.Ve),
39
+ (this.We = 1e3),
40
+ (this.Xe = 6e4),
41
+ (this.Ye = null);
40
42
  }
41
- Ue() {
42
- return this.Se;
43
+ Ze() {
44
+ return this.Ve;
43
45
  }
44
- Ve(t) {
45
- return this.Se.lt(t);
46
+ _i(t) {
47
+ return this.Ve.lt(t);
46
48
  }
47
- We() {
48
- return this.Qe;
49
+ Pi() {
50
+ return this.Ye;
49
51
  }
50
- Xe(t) {
51
- this.Qe = t;
52
+ Oi(t) {
53
+ this.Ye = t;
52
54
  }
53
- Ye(e, i) {
55
+ Ji(e, i) {
54
56
  if (!e) return new t();
55
57
  if (
56
58
  !H(
57
- InAppMessage.Me,
59
+ InAppMessage.Ie,
58
60
  i,
59
61
  `${i} is not a valid in-app message display failure`,
60
- "InAppMessage.DisplayFailures"
62
+ "InAppMessage.DisplayFailures",
61
63
  )
62
64
  )
63
65
  return new t();
64
66
  const n = { trigger_ids: [e], error_code: i };
65
- return s.N(r.q.Ze, n);
67
+ return s.N(r.q.Ki, n);
66
68
  }
67
69
  N(e, i, n, o) {
68
70
  const a = new t();
69
71
  let l;
70
72
  if (e instanceof ControlMessage) l = { trigger_ids: [e.triggerId] };
71
73
  else {
72
- if (i === r.q.Ii || (e instanceof HtmlMessage && i === r.q.Mi)) {
74
+ if (i === r.q.Li || (e instanceof HtmlMessage && i === r.q.Qi)) {
73
75
  if (!e.p(o))
74
76
  return (
75
77
  r.j.info(
76
- "This in-app message has already received a click. Ignoring analytics event."
78
+ "This in-app message has already received a click. Ignoring analytics event.",
77
79
  ),
78
80
  a
79
81
  );
80
- } else if (i === r.q._i) {
82
+ } else if (i === r.q.Vi) {
81
83
  if (!e.M())
82
84
  return (
83
85
  r.j.info(
84
- "This in-app message has already received an impression. Ignoring analytics event."
86
+ "This in-app message has already received an impression. Ignoring analytics event.",
85
87
  ),
86
88
  a
87
89
  );
88
90
  }
89
- l = this.Pi(e);
91
+ l = this.Wi(e);
90
92
  }
91
93
  return null == l ? a : (null != n && (l.bid = n), s.N(i, l));
92
94
  }
93
- Gi(e, i) {
95
+ Xi(e, i) {
94
96
  const n = new t();
95
97
  if (!e.p())
96
98
  return (
97
99
  r.j.info(
98
- "This in-app message button has already received a click. Ignoring analytics event."
100
+ "This in-app message button has already received a click. Ignoring analytics event.",
99
101
  ),
100
102
  n
101
103
  );
102
- const o = this.Pi(i);
104
+ const o = this.Wi(i);
103
105
  return null == o
104
106
  ? n
105
- : e.id === InAppMessageButton.Oi
107
+ : e.id === InAppMessageButton.Yi
106
108
  ? (r.j.info(
107
- "This in-app message button does not have a tracking id. Not logging event to Braze servers."
109
+ "This in-app message button does not have a tracking id. Not logging event to Braze servers.",
108
110
  ),
109
111
  n)
110
- : (null != e.id && (o.bid = e.id), s.N(r.q.Mi, o));
112
+ : (null != e.id && (o.bid = e.id), s.N(r.q.Qi, o));
111
113
  }
112
- Hi(t) {
113
- const s = t.messageFields;
114
- return (null != s && s.is_push_primer) || !1;
114
+ Zi(t) {
115
+ const e = t.messageFields;
116
+ return (null != e && e.is_push_primer) || !1;
115
117
  }
116
- Ji(t) {
118
+ Mr(t) {
117
119
  if (!(t instanceof InAppMessage)) return;
118
- const s = t => {
120
+ const e = (t) => {
119
121
  if (!t) return;
120
- const s = Q(t);
121
- return ft(s)
122
- ? dt(vt.Ki, "In-App Message")
123
- : gt(s) && !yt.Li()
124
- ? dt(vt.Qi, "In-App Message")
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")
125
127
  : void 0;
126
128
  };
127
- if (this.Hi(t) && !yt.Li())
129
+ if (this.Zi(t) && !jt.Gr())
128
130
  return "In-App Message contains a push prompt, but is not eligible for a push prompt. Ignoring.";
129
- const e = t.buttons || [];
131
+ const s = t.buttons || [];
130
132
  let i;
131
- for (const t of e)
133
+ for (const t of s)
132
134
  if (
133
135
  t.clickAction === InAppMessage.ClickAction.URI &&
134
136
  t.uri &&
135
137
  X.test(t.uri) &&
136
- ((i = s(t.uri)), i)
138
+ ((i = e(t.uri)), i)
137
139
  )
138
140
  return i;
139
141
  return t.clickAction === InAppMessage.ClickAction.URI &&
140
142
  t.uri &&
141
143
  X.test(t.uri)
142
- ? s(t.uri)
144
+ ? e(t.uri)
143
145
  : void 0;
144
146
  }
145
- Vi(t, s, e, i) {
147
+ Hr(t, e, s, i) {
146
148
  if (!this.gt) return;
147
- const n = this.gt.Wi(!1, !1),
148
- o = this.gt.Gs(n);
149
- (o.template = { trigger_id: t.triggerId, trigger_event_type: s }),
150
- null != e && (o.template.data = e.Xi());
151
- const a = this.gt.Ks(o, T.Qs.Yi);
152
- this.gt.Vs(o, () => {
149
+ const n = this.gt.Jr(!1, !1),
150
+ o = this.gt.Bs(n);
151
+ (o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
152
+ null != s && (o.template.data = s.Kr());
153
+ const a = this.gt.Hs(o, T.Os.Lr);
154
+ this.gt.Qs(o, () => {
153
155
  this.gt &&
154
- (T.Xs(this.u, T.Qs.Yi, new Date().valueOf()),
155
- C.Ys({
156
- url: `${this.gt.Zs()}/template/`,
156
+ (T.Ws(this.u, T.Os.Lr, new Date().valueOf()),
157
+ C.Xs({
158
+ url: `${this.gt.Ys()}/template/`,
157
159
  data: o,
158
160
  headers: a,
159
- O: s => {
160
- if (!this.gt.ti(o, s, a))
161
+ O: (e) => {
162
+ if ((T.si(this.u, T.Os.Lr, 1), !this.gt.Zs(o, e, a)))
161
163
  return (
162
- this.Ye(t.triggerId, InAppMessage.Me.Zi),
163
- void ("function" == typeof t.Mr && t.Mr())
164
+ this.Ji(t.triggerId, InAppMessage.Ie.Qr),
165
+ void ("function" == typeof t.Ur && t.Ur())
164
166
  );
165
- if ((this.gt.si(), null == s || null == s.templated_message))
166
- return void this.Ye(t.triggerId, InAppMessage.Me.Zi);
167
- const e = s.templated_message;
168
- if (e.type !== mt.Gr._r)
169
- return void this.Ye(t.triggerId, InAppMessage.Me.Or);
170
- const i = pt(e.data);
171
- if (null == i) return void this.Ye(t.triggerId, InAppMessage.Me.Or);
172
- const n = this.Ji(i);
167
+ if ((this.gt.ti(), null == e || null == e.templated_message))
168
+ return void this.Ji(t.triggerId, InAppMessage.Ie.Qr);
169
+ const s = e.templated_message;
170
+ if (s.type !== mt.Wr.Vr)
171
+ return void this.Ji(t.triggerId, InAppMessage.Ie.Xr);
172
+ const i = pt(s.data);
173
+ if (null == i) return void this.Ji(t.triggerId, InAppMessage.Ie.Xr);
174
+ const n = this.Mr(i);
173
175
  if (n)
174
- return r.j.error(n), void ("function" == typeof t.Mr && t.Mr());
175
- "function" == typeof t.Hr
176
- ? t.Hr(i)
177
- : this.Ye(t.triggerId, InAppMessage.Me.Zi);
176
+ return r.j.error(n), void ("function" == typeof t.Ur && t.Ur());
177
+ "function" == typeof t.Yr
178
+ ? t.Yr(i)
179
+ : this.Ji(t.triggerId, InAppMessage.Ie.Qr);
178
180
  },
179
- error: r => {
181
+ error: (r) => {
180
182
  let n = `getting user personalization for message ${t.triggerId}`;
181
- if (new Date().valueOf() - t.Jr > t.Kr)
182
- this.Ye(t.triggerId, InAppMessage.Me.Zi);
183
+ if (new Date().valueOf() - t.Zr > t.sn)
184
+ this.Ji(t.triggerId, InAppMessage.Ie.Qr);
183
185
  else {
184
- const r = Math.min(t.Kr, this.Re),
185
- o = this.Oe;
186
+ T.hi(this.u, T.Os.Lr);
187
+ const r = Math.min(t.sn, this.Xe),
188
+ o = this.We;
186
189
  null == i && (i = o);
187
190
  const a = Math.min(r, D(o, 3 * i));
188
191
  (n += `. Retrying in ${a} ms`),
189
192
  setTimeout(() => {
190
- this.Vi(t, s, e, a);
193
+ this.Hr(t, e, s, a);
191
194
  }, a);
192
195
  }
193
196
  this.gt.ii(r, n);
194
- }
197
+ },
195
198
  }));
196
199
  });
197
200
  }
198
- Pi(t) {
201
+ Wi(t) {
199
202
  if (null == t.triggerId)
200
203
  return (
201
204
  r.j.info(
202
- "The in-app message has no analytics id. Not logging event to Braze servers."
205
+ "The in-app message has no analytics id. Not logging event to Braze servers.",
203
206
  ),
204
207
  null
205
208
  );
206
- const s = {};
207
- return null != t.triggerId && (s.trigger_ids = [t.triggerId]), s;
209
+ const e = {};
210
+ return null != t.triggerId && (e.trigger_ids = [t.triggerId]), e;
211
+ }
212
+ he(t) {
213
+ return (
214
+ !!this.u &&
215
+ !(
216
+ !(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
217
+ t instanceof ControlMessage
218
+ ) &&
219
+ this.u.D(i.k.rn, t.ss())
220
+ );
221
+ }
222
+ Re() {
223
+ if (!this.u) return null;
224
+ const t = this.u.v(i.k.rn);
225
+ if (!t) return null;
226
+ let e;
227
+ switch (t.type) {
228
+ case InAppMessage.qe.on:
229
+ e = FullScreenMessage.an(t);
230
+ break;
231
+ case InAppMessage.qe.ln:
232
+ case InAppMessage.qe.Ee:
233
+ case InAppMessage.qe.Ue:
234
+ e = HtmlMessage.an(t);
235
+ break;
236
+ case InAppMessage.qe.un:
237
+ case InAppMessage.qe.Se:
238
+ e = ModalMessage.an(t);
239
+ break;
240
+ case InAppMessage.qe.pn:
241
+ e = SlideUpMessage.an(t);
242
+ }
243
+ return e && this.mn(), e;
244
+ }
245
+ mn() {
246
+ this.u && this.u.ni(i.k.rn);
208
247
  }
209
248
  }
@@ -12,3 +12,5 @@ export { logInAppMessageHtmlClick } from "./log-in-app-message-html-click.js";
12
12
  export { logInAppMessageImpression } from "./log-in-app-message-impression.js";
13
13
  export { showInAppMessage } from "./ui/show-in-app-message.js";
14
14
  export { subscribeToInAppMessage } from "./subscribe-to-in-app-message.js";
15
+ export { deferInAppMessage } from "./defer-in-app-message.js";
16
+ export { getDeferredInAppMessage } from "./get-deferred-in-app-message.js";
@@ -2,18 +2,26 @@ import e from "../managers/braze-instance.js";
2
2
  import { MUST_BE_IN_APP_MESSAGE_WARNING as or } from "../common/constants.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
4
  import InAppMessageButton from "./models/in-app-message-button.js";
5
- import ea from "./in-app-message-manager-factory.js";
5
+ import se from "./in-app-message-manager-factory.js";
6
6
  import r from "../../shared-lib/braze-shared-lib.js";
7
7
  import tt from "../triggers/models/trigger-events.js";
8
8
  import { TriggersProviderFactory as et } from "../triggers/triggers-provider-factory.js";
9
- export function logInAppMessageButtonClick(t, o) {
9
+ export function logInAppMessageButtonClick(o, t) {
10
+ var s;
10
11
  if (!e.rr()) return !1;
11
- if (!(t instanceof InAppMessageButton))
12
+ if (!(o instanceof InAppMessageButton))
12
13
  return r.j.error("button must be an InAppMessageButton object"), !1;
13
- if (!(o instanceof InAppMessage)) return r.j.error(or), !1;
14
- const s = ea.m().Gi(t, o);
15
- if (s.O)
16
- for (let r = 0; r < s.ve.length; r++)
17
- et.er().je(tt.Lr, [o.triggerId, t.id], s.ve[r]);
18
- return s.O;
14
+ if (!(t instanceof InAppMessage)) return r.j.error(or), !1;
15
+ const n = se.m().Xi(o, t);
16
+ if (n.O)
17
+ for (let r = 0; r < n.ve.length; r++)
18
+ et.er().be(
19
+ tt.ro,
20
+ [
21
+ t.triggerId,
22
+ null === (s = o.id) || void 0 === s ? void 0 : s.toString(),
23
+ ],
24
+ n.ve[r],
25
+ );
26
+ return n.O;
19
27
  }
@@ -1,6 +1,6 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import InAppMessage from "./models/in-app-message.js";
3
- import ea from "./in-app-message-manager-factory.js";
3
+ import se from "./in-app-message-manager-factory.js";
4
4
  import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
5
5
  import { MUST_BE_IN_APP_MESSAGE_WARNING as or } from "../common/constants.js";
6
6
  import r from "../../shared-lib/braze-shared-lib.js";
@@ -9,11 +9,11 @@ import { TriggersProviderFactory as et } from "../triggers/triggers-provider-fac
9
9
  export function logInAppMessageClick(o) {
10
10
  if (!e.rr()) return !1;
11
11
  if (!(o instanceof InAppMessage)) return r.j.error(or), !1;
12
- const s = ea.m().N(o, r.q.Ii);
12
+ const s = se.m().N(o, r.q.Li);
13
13
  if (s) {
14
- o.Qr() || logInAppMessageImpression(o);
14
+ o.so() || logInAppMessageImpression(o);
15
15
  for (let r = 0; r < s.ve.length; r++)
16
- et.er().je(tt.Lr, [o.triggerId], s.ve[r]);
16
+ et.er().be(tt.ro, [o.triggerId], s.ve[r]);
17
17
  }
18
18
  return s.O;
19
19
  }
@@ -1,6 +1,6 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import HtmlMessage from "./models/html-message.js";
3
- import ea from "./in-app-message-manager-factory.js";
3
+ import se from "./in-app-message-manager-factory.js";
4
4
  import r from "../../shared-lib/braze-shared-lib.js";
5
5
  import tt from "../triggers/models/trigger-events.js";
6
6
  import { TriggersProviderFactory as et } from "../triggers/triggers-provider-factory.js";
@@ -9,15 +9,15 @@ export function logInAppMessageHtmlClick(s, t, o) {
9
9
  if (!(s instanceof HtmlMessage))
10
10
  return (
11
11
  r.j.error(
12
- "inAppMessage argument to logInAppMessageHtmlClick must be an HtmlMessage object."
12
+ "inAppMessage argument to logInAppMessageHtmlClick must be an HtmlMessage object.",
13
13
  ),
14
14
  !1
15
15
  );
16
- let m = r.q.Ii;
17
- null != t && (m = r.q.Mi);
18
- const i = ea.m().N(s, m, t, o);
16
+ let m = r.q.Li;
17
+ null != t && (m = r.q.Qi);
18
+ const i = se.m().N(s, m, t, o);
19
19
  if (i.O)
20
20
  for (let r = 0; r < i.ve.length; r++)
21
- et.er().je(tt.Lr, [s.triggerId, t], i.ve[r]);
21
+ et.er().be(tt.ro, [s.triggerId, t], i.ve[r]);
22
22
  return i.O;
23
23
  }
@@ -1,13 +1,13 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import ControlMessage from "./models/control-message.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
- import ea from "./in-app-message-manager-factory.js";
4
+ import se from "./in-app-message-manager-factory.js";
5
5
  import { MUST_BE_IN_APP_MESSAGE_WARNING as or } from "../common/constants.js";
6
6
  import r from "../../shared-lib/braze-shared-lib.js";
7
7
  export function logInAppMessageImpression(o) {
8
8
  if (!e.rr()) return !1;
9
9
  if (!(o instanceof InAppMessage || o instanceof ControlMessage))
10
10
  return r.j.error(or), !1;
11
- const s = o instanceof ControlMessage ? r.q.ro : r.q._i;
12
- return ea.m().N(o, s).O;
11
+ const s = o instanceof ControlMessage ? r.q.eo : r.q.Vi;
12
+ return se.m().N(o, s).O;
13
13
  }
@@ -1,69 +1,105 @@
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 FullScreenMessage extends InAppMessage {
3
4
  constructor(
4
- s,
5
5
  e,
6
+ r,
7
+ s,
6
8
  t,
9
+ i,
10
+ a,
7
11
  o,
8
- r,
9
12
  p,
10
- a,
11
- i,
12
- c,
13
- d,
14
13
  m,
15
14
  n,
16
15
  u,
16
+ c,
17
17
  f,
18
+ d,
18
19
  l,
19
- x,
20
20
  g,
21
- h,
22
21
  j,
22
+ x,
23
+ z,
24
+ h,
23
25
  v,
26
+ w,
27
+ y,
28
+ S,
24
29
  b,
25
30
  k,
26
31
  q,
27
- w,
28
- y,
29
- z,
30
32
  A,
31
- B
32
33
  ) {
33
- (i = i || InAppMessage.DismissType.MANUAL),
34
- (z = z || InAppMessage.Orientation.PORTRAIT),
34
+ (p = p || InAppMessage.DismissType.MANUAL),
35
+ (k = k || InAppMessage.Orientation.PORTRAIT),
35
36
  super(
36
- s,
37
37
  e,
38
+ r,
38
39
  void 0,
40
+ s,
39
41
  t,
42
+ i,
43
+ a,
40
44
  o,
41
- r,
42
45
  p,
43
- a,
44
- i,
45
- c,
46
- d,
47
46
  m,
48
47
  n,
49
48
  u,
49
+ c,
50
50
  f,
51
+ d,
51
52
  l,
52
- x,
53
53
  g,
54
- h,
55
54
  j,
55
+ x,
56
+ z,
57
+ h,
56
58
  v,
57
- b,
59
+ w,
60
+ y,
61
+ S,
62
+ (b = b || InAppMessage.CropType.CENTER_CROP),
58
63
  k,
59
64
  q,
60
- w,
61
- (y = y || InAppMessage.CropType.CENTER_CROP),
62
- z,
63
65
  A,
64
- B
65
66
  ),
66
- (this.Le = InAppMessage.TextAlignment.CENTER);
67
+ (this.Te = InAppMessage.TextAlignment.CENTER);
68
+ }
69
+ ss() {
70
+ return super.ss(FullScreenMessage.es);
71
+ }
72
+ static an(e) {
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],
102
+ );
67
103
  }
68
104
  }
69
- FullScreenMessage.es = InAppMessage.Ee.so;
105
+ FullScreenMessage.es = InAppMessage.qe.on;
@@ -1,17 +1,17 @@
1
1
  import InAppMessage from "./in-app-message.js";
2
2
  export default class HtmlMessage extends InAppMessage {
3
- constructor(i, o, d, v, s, t, e, r, u, h, n) {
3
+ constructor(i, o, e, r, d, t, s, v, n, u, a) {
4
4
  super(
5
5
  i,
6
6
  void 0,
7
7
  void 0,
8
8
  o,
9
- d,
9
+ e,
10
10
  void 0,
11
11
  void 0,
12
12
  void 0,
13
- (v = v || InAppMessage.DismissType.MANUAL),
14
- s,
13
+ (r = r || InAppMessage.DismissType.MANUAL),
14
+ d,
15
15
  void 0,
16
16
  void 0,
17
17
  void 0,
@@ -21,29 +21,48 @@ export default class HtmlMessage extends InAppMessage {
21
21
  void 0,
22
22
  void 0,
23
23
  t,
24
- e,
24
+ s,
25
25
  void 0,
26
26
  void 0,
27
27
  void 0,
28
- r,
28
+ v,
29
29
  void 0,
30
30
  void 0,
31
31
  void 0,
32
+ n,
32
33
  u,
33
- h
34
34
  ),
35
- (this.messageFields = n),
36
- (this.messageFields = n);
35
+ (this.messageFields = a),
36
+ (this.messageFields = a);
37
37
  }
38
38
  io() {
39
39
  return !1;
40
40
  }
41
41
  p(i) {
42
- if (this.Ce === InAppMessage.Ee.do) {
43
- if (this.vo) return !1;
44
- this.vo = !0;
42
+ if (this.Pe === InAppMessage.qe.ln) {
43
+ if (this.do) return !1;
44
+ this.do = !0;
45
45
  }
46
46
  return this.ht.Et(i), !0;
47
47
  }
48
+ ss() {
49
+ const i = super.ss(HtmlMessage.es);
50
+ return (i[InAppMessage.hs.vo] = this.messageFields), i;
51
+ }
52
+ static an(i) {
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],
65
+ );
66
+ }
48
67
  }
49
- HtmlMessage.es = InAppMessage.Ee.do;
68
+ HtmlMessage.es = InAppMessage.qe.ln;
@@ -10,14 +10,14 @@ export default class InAppMessageButton {
10
10
  (this.uri = e),
11
11
  (this.id = n),
12
12
  (this.text = s || ""),
13
- (this.backgroundColor = t || InAppMessage.Vr.Ur),
14
- (this.textColor = i || InAppMessage.Vr.Wr),
13
+ (this.backgroundColor = t || InAppMessage.th.sh),
14
+ (this.textColor = i || InAppMessage.th.ih),
15
15
  (this.borderColor = r || this.backgroundColor),
16
16
  (this.clickAction = h || InAppMessage.ClickAction.NONE),
17
17
  (this.uri = e),
18
- null == n && (n = InAppMessageButton.Oi),
18
+ null == n && (n = InAppMessageButton.Yi),
19
19
  (this.id = n),
20
- (this.vo = !1),
20
+ (this.do = !1),
21
21
  (this.ht = new E());
22
22
  }
23
23
  subscribeToClickedEvent(s) {
@@ -30,7 +30,7 @@ export default class InAppMessageButton {
30
30
  this.ht.removeAllSubscriptions();
31
31
  }
32
32
  p() {
33
- return !this.vo && ((this.vo = !0), this.ht.Et(), !0);
33
+ return !this.do && ((this.do = !0), this.ht.Et(), !0);
34
34
  }
35
35
  static fromJson(s) {
36
36
  return new InAppMessageButton(
@@ -40,8 +40,8 @@ export default class InAppMessageButton {
40
40
  s.border_color,
41
41
  s.click_action,
42
42
  s.uri,
43
- s.id
43
+ s.id,
44
44
  );
45
45
  }
46
46
  }
47
- InAppMessageButton.Oi = -1;
47
+ InAppMessageButton.Yi = -1;