@braze/web-sdk 4.7.1 → 4.8.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 (161) hide show
  1. package/index.d.ts +27 -24
  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 +24 -24
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/indexed-db-adapter.js +17 -17
  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 +47 -41
  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 +35 -33
  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 +7 -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 +40 -36
  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 +122 -108
  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 +192 -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 +18 -18
  109. package/src/common/types.js +1 -0
  110. package/src/l10n/l10n-manager-factory.js +5 -5
  111. package/src/l10n/l10n-manager.js +1 -1
  112. package/src/managers/auth-manager.js +32 -32
  113. package/src/managers/braze-instance.js +204 -202
  114. package/src/managers/device-manager.js +23 -23
  115. package/src/managers/network-manager.js +96 -82
  116. package/src/managers/server-config-manager.js +60 -42
  117. package/src/managers/session-manager.js +41 -41
  118. package/src/managers/storage-manager-factory.js +15 -15
  119. package/src/managers/storage-manager.js +165 -155
  120. package/src/managers/subscription-manager.js +11 -11
  121. package/src/models/backend-errors.js +5 -5
  122. package/src/models/braze-event.js +7 -7
  123. package/src/models/device.js +2 -2
  124. package/src/models/identifier.js +7 -7
  125. package/src/models/push-token.js +7 -7
  126. package/src/models/request-result.js +3 -3
  127. package/src/models/server-config.js +20 -20
  128. package/src/request-controller.js +176 -174
  129. package/src/triggers/models/custom-event-data.js +6 -6
  130. package/src/triggers/models/custom-event-property-data.js +9 -9
  131. package/src/triggers/models/filter-set.js +9 -9
  132. package/src/triggers/models/filter.js +64 -64
  133. package/src/triggers/models/in-app-message-click-data.js +12 -12
  134. package/src/triggers/models/purchase-data.js +3 -3
  135. package/src/triggers/models/purchase-property-data.js +9 -9
  136. package/src/triggers/models/push-click-data.js +5 -5
  137. package/src/triggers/models/trigger-condition.js +52 -52
  138. package/src/triggers/models/trigger-events.js +2 -2
  139. package/src/triggers/models/trigger.js +42 -42
  140. package/src/triggers/triggers-provider-factory.js +8 -8
  141. package/src/triggers/triggers-provider.js +171 -168
  142. package/src/types.js +1 -0
  143. package/src/ui/js/attach-css.js +3 -3
  144. package/src/ui/js/load-font-awesome.js +2 -2
  145. package/src/util/base-device-parser.js +1 -1
  146. package/src/util/braze-actions.js +20 -20
  147. package/src/util/browser-detector.js +22 -22
  148. package/src/util/client-hints-parser.js +6 -6
  149. package/src/util/code-utils.js +1 -1
  150. package/src/util/color-utils.js +2 -2
  151. package/src/util/component-utils.js +2 -2
  152. package/src/util/deprecation-utils.js +1 -1
  153. package/src/util/device-constants.js +5 -5
  154. package/src/util/dom-utils.js +2 -2
  155. package/src/util/key-codes.js +1 -1
  156. package/src/util/net.js +11 -11
  157. package/src/util/request-header-utils.js +23 -0
  158. package/src/util/string-utils.js +1 -1
  159. package/src/util/user-agent-parser.js +20 -20
  160. package/src/util/validation-utils.js +44 -44
  161. package/src/util/window-utils.js +3 -3
@@ -1,52 +1,59 @@
1
- import b from "../util/net.js";
1
+ import C from "../util/net.js";
2
2
  import e from "../managers/braze-instance.js";
3
3
  import ControlMessage from "./models/control-message.js";
4
4
  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 lt } from "./in-app-message-factory.js";
9
- import { randomInclusive as tt } from "../util/math.js";
8
+ import { newInAppMessageFromJson as pt } from "./in-app-message-factory.js";
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
- import u from "../managers/subscription-manager.js";
13
- import pt from "../triggers/models/trigger.js";
14
- import { validateValueIsFromEnum as F } from "../util/code-utils.js";
15
- import { BRAZE_ACTION_URI_REGEX as J } from "../util/validation-utils.js";
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";
16
16
  import {
17
- containsPushPrimerBrazeAction as mt,
18
- containsUnknownBrazeAction as gt,
19
- getDecodedBrazeAction as _,
20
- ineligibleBrazeActionURLErrorMessage as ht,
21
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as ft
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
22
22
  } from "../util/braze-actions.js";
23
- import dt from "../Push/utils/push-utils.js";
24
- export default class ge {
23
+ import yt from "../Push/utils/push-utils.js";
24
+ import T from "../util/request-header-utils.js";
25
+ export default class aa {
25
26
  constructor(t, s, i, r) {
26
- (this.vt = t),
27
- (this.j = s),
28
- (this.h = i),
29
- (this.v = r),
30
- (this.Se = new u()),
27
+ (this.gt = t),
28
+ (this._e = s),
29
+ (this.u = i),
30
+ (this.ft = r),
31
+ (this.gt = t),
32
+ (this._e = s),
33
+ (this.u = i),
34
+ (this.ft = r),
35
+ (this.Se = new E()),
31
36
  e.jt(this.Se),
32
37
  (this.Oe = 1e3),
33
- (this.Re = 6e4);
38
+ (this.Re = 6e4),
39
+ (this.Qe = null);
34
40
  }
35
- Qe() {
41
+ Ue() {
36
42
  return this.Se;
37
43
  }
38
- Ue(t) {
39
- return this.Se.ut(t);
44
+ Ve(t) {
45
+ return this.Se.lt(t);
40
46
  }
41
- Ve() {
42
- return this.We;
47
+ We() {
48
+ return this.Qe;
43
49
  }
44
50
  Xe(t) {
45
- this.We = t;
51
+ this.Qe = t;
46
52
  }
47
53
  Ye(e, i) {
54
+ if (!e) return new t();
48
55
  if (
49
- !F(
56
+ !H(
50
57
  InAppMessage.Me,
51
58
  i,
52
59
  `${i} is not a valid in-app message display failure`,
@@ -55,135 +62,142 @@ export default class ge {
55
62
  )
56
63
  return new t();
57
64
  const n = { trigger_ids: [e], error_code: i };
58
- return s.G(r.A.Ze, n);
65
+ return s.N(r.q.Ze, n);
59
66
  }
60
- G(e, i, n, o) {
67
+ N(e, i, n, o) {
61
68
  const a = new t();
62
69
  let l;
63
70
  if (e instanceof ControlMessage) l = { trigger_ids: [e.triggerId] };
64
71
  else {
65
- if (i === r.A.Ii || (e instanceof HtmlMessage && i === r.A.Ai)) {
66
- if (!e.k(o))
72
+ if (i === r.q.Ii || (e instanceof HtmlMessage && i === r.q.Mi)) {
73
+ if (!e.p(o))
67
74
  return (
68
- r.D.info(
75
+ r.j.info(
69
76
  "This in-app message has already received a click. Ignoring analytics event."
70
77
  ),
71
78
  a
72
79
  );
73
- } else if (i === r.A.Mi) {
74
- if (!e.R())
80
+ } else if (i === r.q._i) {
81
+ if (!e.M())
75
82
  return (
76
- r.D.info(
83
+ r.j.info(
77
84
  "This in-app message has already received an impression. Ignoring analytics event."
78
85
  ),
79
86
  a
80
87
  );
81
88
  }
82
- l = this.zi(e);
89
+ l = this.Gi(e);
83
90
  }
84
- return null == l ? a : (null != n && (l.bid = n), s.G(i, l));
91
+ return null == l ? a : (null != n && (l.bid = n), s.N(i, l));
85
92
  }
86
- ki(e, i) {
93
+ Oi(e, i) {
87
94
  const n = new t();
88
- if (!e.k())
95
+ if (!e.p())
89
96
  return (
90
- r.D.info(
97
+ r.j.info(
91
98
  "This in-app message button has already received a click. Ignoring analytics event."
92
99
  ),
93
100
  n
94
101
  );
95
- const o = this.zi(i);
102
+ const o = this.Gi(i);
96
103
  return null == o
97
104
  ? n
98
- : e.id === InAppMessageButton.$i
99
- ? (r.D.info(
105
+ : e.id === InAppMessageButton.Pi
106
+ ? (r.j.info(
100
107
  "This in-app message button does not have a tracking id. Not logging event to Braze servers."
101
108
  ),
102
109
  n)
103
- : (null != e.id && (o.bid = e.id), s.G(r.A.Ai, o));
110
+ : (null != e.id && (o.bid = e.id), s.N(r.q.Mi, o));
104
111
  }
105
- Bi(t) {
112
+ Hi(t) {
106
113
  if (!(t instanceof InAppMessage)) return;
107
- const e = t => {
108
- const e = _(t);
109
- return gt(e)
110
- ? ht(ft.Ei, "In-App Message")
111
- : mt(e) && !dt.Gi()
112
- ? ht(ft.Ni, "In-App Message")
114
+ const s = t => {
115
+ if (!t) return;
116
+ const s = Q(t);
117
+ return ft(s)
118
+ ? dt(vt.Ji, "In-App Message")
119
+ : gt(s) && !yt.Ki()
120
+ ? dt(vt.Li, "In-App Message")
113
121
  : void 0;
114
122
  },
115
- s = t.buttons;
123
+ e = t.buttons || [];
116
124
  let i;
117
- for (const t of s)
125
+ for (const t of e)
118
126
  if (
119
127
  t.clickAction === InAppMessage.ClickAction.URI &&
120
- J.test(t.uri) &&
121
- ((i = e(t.uri)), i)
128
+ t.uri &&
129
+ X.test(t.uri) &&
130
+ ((i = s(t.uri)), i)
122
131
  )
123
132
  return i;
124
- return t.clickAction === InAppMessage.ClickAction.URI && J.test(t.uri)
125
- ? e(t.uri)
133
+ return t.clickAction === InAppMessage.ClickAction.URI &&
134
+ t.uri &&
135
+ X.test(t.uri)
136
+ ? s(t.uri)
126
137
  : void 0;
127
138
  }
128
- qi(t, e, s, i) {
129
- let n = this.vt.Oi(!1, !1);
130
- (n = this.vt.Ps(n)),
131
- (n.template = { trigger_id: t.triggerId, trigger_event_type: e }),
132
- null != s && (n.template.data = s.Pi());
133
- const o = this.vt.Bs(n);
134
- this.vt.Gs(n, () => {
135
- b.Hs({
136
- url: `${this.vt.Ks()}/template/`,
137
- data: n,
138
- headers: o,
139
- S: e => {
140
- if (!this.vt.Os(n, e, o))
141
- return (
142
- this.Ye(t.triggerId, InAppMessage.Me.Ri),
143
- void ("function" == typeof t.Hi && t.Hi())
144
- );
145
- if ((this.vt.Qs(), null == e || null == e.templated_message))
146
- return void this.Ye(t.triggerId, InAppMessage.Me.Ri);
147
- const s = e.templated_message;
148
- if (s.type !== pt.Ki.Ji)
149
- return void this.Ye(t.triggerId, InAppMessage.Me.Li);
150
- const i = lt(s.data);
151
- if (null == i) return void this.Ye(t.triggerId, InAppMessage.Me.Li);
152
- let a = this.Bi(i);
153
- if (a)
154
- return r.D.error(a), void ("function" == typeof t.Hi && t.Hi());
155
- "function" == typeof t.Qi
156
- ? t.Qi(i)
157
- : this.Ye(t.triggerId, InAppMessage.Me.Ri);
158
- },
159
- error: r => {
160
- let n = `getting user personalization for message ${t.triggerId}`;
161
- if (new Date().valueOf() - t.Ui > t.Vi)
162
- this.Ye(t.triggerId, InAppMessage.Me.Ri);
163
- else {
164
- const r = Math.min(t.Vi, this.Re),
165
- o = this.Oe;
166
- null == i && (i = o);
167
- const a = Math.min(r, tt(o, 3 * i));
168
- (n += `. Retrying in ${a} ms`),
169
- setTimeout(() => {
170
- this.qi(t, e, s, a);
171
- }, a);
139
+ Qi(t, s, e, i) {
140
+ if (!this.gt) return;
141
+ const n = this.gt.Vi(!1, !1),
142
+ o = this.gt.Gs(n);
143
+ (o.template = { trigger_id: t.triggerId, trigger_event_type: s }),
144
+ null != e && (o.template.data = e.Wi());
145
+ const a = this.gt.Ks(o, T.Qs.Xi);
146
+ this.gt.Vs(o, () => {
147
+ this.gt &&
148
+ (T.Xs(this.u, T.Qs.Xi, new Date().valueOf()),
149
+ C.Ys({
150
+ url: `${this.gt.Zs()}/template/`,
151
+ data: o,
152
+ headers: a,
153
+ O: s => {
154
+ if (!this.gt.ti(o, s, a))
155
+ return (
156
+ this.Ye(t.triggerId, InAppMessage.Me.Yi),
157
+ void ("function" == typeof t.Zi && t.Zi())
158
+ );
159
+ if ((this.gt.si(), null == s || null == s.templated_message))
160
+ return void this.Ye(t.triggerId, InAppMessage.Me.Yi);
161
+ const e = s.templated_message;
162
+ if (e.type !== mt._r.Mr)
163
+ return void this.Ye(t.triggerId, InAppMessage.Me.Gr);
164
+ const i = pt(e.data);
165
+ if (null == i) return void this.Ye(t.triggerId, InAppMessage.Me.Gr);
166
+ const n = this.Hi(i);
167
+ if (n)
168
+ return r.j.error(n), void ("function" == typeof t.Zi && t.Zi());
169
+ "function" == typeof t.Or
170
+ ? t.Or(i)
171
+ : this.Ye(t.triggerId, InAppMessage.Me.Yi);
172
+ },
173
+ error: r => {
174
+ let n = `getting user personalization for message ${t.triggerId}`;
175
+ if (new Date().valueOf() - t.Hr > t.Jr)
176
+ this.Ye(t.triggerId, InAppMessage.Me.Yi);
177
+ else {
178
+ const r = Math.min(t.Jr, this.Re),
179
+ o = this.Oe;
180
+ null == i && (i = o);
181
+ const a = Math.min(r, D(o, 3 * i));
182
+ (n += `. Retrying in ${a} ms`),
183
+ setTimeout(() => {
184
+ this.Qi(t, s, e, a);
185
+ }, a);
186
+ }
187
+ this.gt.ii(r, n);
172
188
  }
173
- this.vt.Vs(r, n);
174
- }
175
- });
189
+ }));
176
190
  });
177
191
  }
178
- zi(t) {
192
+ Gi(t) {
179
193
  if (null == t.triggerId)
180
194
  return (
181
- r.D.info(
195
+ r.j.info(
182
196
  "The in-app message has no analytics id. Not logging event to Braze servers."
183
197
  ),
184
198
  null
185
199
  );
186
- const e = {};
187
- return null != t.triggerId && (e.trigger_ids = [t.triggerId]), e;
200
+ const s = {};
201
+ return null != t.triggerId && (s.trigger_ids = [t.triggerId]), s;
188
202
  }
189
203
  }
@@ -1,19 +1,19 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
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 pe from "./in-app-message-manager-factory.js";
5
+ import ea from "./in-app-message-manager-factory.js";
6
6
  import r from "../../shared-lib/braze-shared-lib.js";
7
- import V from "../triggers/models/trigger-events.js";
8
- import { TriggersProviderFactory as W } from "../triggers/triggers-provider-factory.js";
7
+ import tt from "../triggers/models/trigger-events.js";
8
+ import { TriggersProviderFactory as et } from "../triggers/triggers-provider-factory.js";
9
9
  export function logInAppMessageButtonClick(t, o) {
10
10
  if (!e.rr()) return !1;
11
11
  if (!(t instanceof InAppMessageButton))
12
- return r.D.error("button must be an InAppMessageButton object"), !1;
13
- if (!(o instanceof InAppMessage)) return r.D.error(sr), !1;
14
- const s = pe.m().ki(t, o);
15
- if (s.S)
12
+ 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().Oi(t, o);
15
+ if (s.O)
16
16
  for (let r = 0; r < s.ve.length; r++)
17
- W.er().je(V.Mr, [o.triggerId, t.id], s.ve[r]);
18
- return s.S;
17
+ et.er().je(tt.Kr, [o.triggerId, t.id], s.ve[r]);
18
+ return s.O;
19
19
  }
@@ -1,19 +1,19 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import InAppMessage from "./models/in-app-message.js";
3
- import pe from "./in-app-message-manager-factory.js";
3
+ import ea from "./in-app-message-manager-factory.js";
4
4
  import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
5
- import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
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
- import V from "../triggers/models/trigger-events.js";
8
- import { TriggersProviderFactory as W } from "../triggers/triggers-provider-factory.js";
7
+ import tt from "../triggers/models/trigger-events.js";
8
+ import { TriggersProviderFactory as et } from "../triggers/triggers-provider-factory.js";
9
9
  export function logInAppMessageClick(o) {
10
10
  if (!e.rr()) return !1;
11
- if (!(o instanceof InAppMessage)) return r.D.error(sr), !1;
12
- const s = pe.m().G(o, r.A.Ii);
11
+ if (!(o instanceof InAppMessage)) return r.j.error(or), !1;
12
+ const s = ea.m().N(o, r.q.Ii);
13
13
  if (s) {
14
- o.Cr() || logInAppMessageImpression(o);
14
+ o.Lr() || logInAppMessageImpression(o);
15
15
  for (let r = 0; r < s.ve.length; r++)
16
- W.er().je(V.Mr, [o.triggerId], s.ve[r]);
16
+ et.er().je(tt.Kr, [o.triggerId], s.ve[r]);
17
17
  }
18
- return s.S;
18
+ return s.O;
19
19
  }
@@ -1,23 +1,23 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import HtmlMessage from "./models/html-message.js";
3
- import pe from "./in-app-message-manager-factory.js";
3
+ import ea from "./in-app-message-manager-factory.js";
4
4
  import r from "../../shared-lib/braze-shared-lib.js";
5
- import V from "../triggers/models/trigger-events.js";
6
- import { TriggersProviderFactory as W } from "../triggers/triggers-provider-factory.js";
5
+ import tt from "../triggers/models/trigger-events.js";
6
+ import { TriggersProviderFactory as et } from "../triggers/triggers-provider-factory.js";
7
7
  export function logInAppMessageHtmlClick(s, t, o) {
8
8
  if (!e.rr()) return !1;
9
9
  if (!(s instanceof HtmlMessage))
10
10
  return (
11
- r.D.error(
11
+ r.j.error(
12
12
  "inAppMessage argument to logInAppMessageHtmlClick must be an HtmlMessage object."
13
13
  ),
14
14
  !1
15
15
  );
16
- let m = r.A.Ii;
17
- null != t && (m = r.A.Ai);
18
- const i = pe.m().G(s, m, t, o);
19
- if (i.S)
16
+ let m = r.q.Ii;
17
+ null != t && (m = r.q.Mi);
18
+ const i = ea.m().N(s, m, t, o);
19
+ if (i.O)
20
20
  for (let r = 0; r < i.ve.length; r++)
21
- W.er().je(V.Mr, [s.triggerId, t], i.ve[r]);
22
- return i.S;
21
+ et.er().je(tt.Kr, [s.triggerId, t], i.ve[r]);
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 pe from "./in-app-message-manager-factory.js";
5
- import { MUST_BE_IN_APP_MESSAGE_WARNING as sr } from "../common/constants.js";
4
+ import ea from "./in-app-message-manager-factory.js";
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
- return r.D.error(sr), !1;
11
- const s = o instanceof ControlMessage ? r.A.ro : r.A.Mi;
12
- return pe.m().G(o, s).S;
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;
13
13
  }
@@ -1,6 +1,9 @@
1
1
  export default class ControlMessage {
2
2
  constructor(t) {
3
- (this.triggerId = t), (this.extras = {}), (this.isControl = !0);
3
+ (this.triggerId = t),
4
+ (this.triggerId = t),
5
+ (this.extras = {}),
6
+ (this.isControl = !0);
4
7
  }
5
8
  static fromJson(t) {
6
9
  return new ControlMessage(t.trigger_id);
@@ -1,71 +1,69 @@
1
1
  import InAppMessage from "./in-app-message.js";
2
2
  export default class FullScreenMessage extends InAppMessage {
3
3
  constructor(
4
+ s,
4
5
  e,
5
6
  t,
6
- r,
7
- s,
8
- n,
9
- l,
10
- u,
11
- a,
12
7
  o,
8
+ r,
13
9
  p,
14
- m,
10
+ a,
11
+ i,
15
12
  c,
16
13
  d,
14
+ m,
15
+ n,
16
+ u,
17
17
  f,
18
- g,
19
- i,
18
+ l,
20
19
  x,
20
+ g,
21
+ h,
21
22
  j,
22
- A,
23
- T,
23
+ v,
24
24
  b,
25
- h,
26
25
  k,
27
26
  q,
28
- v,
29
27
  w,
30
28
  y,
31
- z
29
+ z,
30
+ A,
31
+ B
32
32
  ) {
33
- (a = a || InAppMessage.DismissType.MANUAL),
34
- (w = w || InAppMessage.Orientation.PORTRAIT),
33
+ (i = i || InAppMessage.DismissType.MANUAL),
34
+ (z = z || InAppMessage.Orientation.PORTRAIT),
35
35
  super(
36
+ s,
36
37
  e,
38
+ void 0,
37
39
  t,
38
- null,
39
- r,
40
- s,
41
- n,
42
- l,
43
- u,
44
- a,
45
40
  o,
41
+ r,
46
42
  p,
47
- m,
43
+ a,
44
+ i,
48
45
  c,
49
46
  d,
47
+ m,
48
+ n,
49
+ u,
50
50
  f,
51
- g,
52
- i,
51
+ l,
53
52
  x,
53
+ g,
54
+ h,
54
55
  j,
55
- A,
56
- T,
56
+ v,
57
57
  b,
58
- h,
59
58
  k,
60
59
  q,
61
- (v = v || InAppMessage.CropType.CENTER_CROP),
62
60
  w,
63
- y,
64
- z
65
- );
66
- }
67
- get Le() {
68
- return InAppMessage.TextAlignment.CENTER;
61
+ (y = y || InAppMessage.CropType.CENTER_CROP),
62
+ z,
63
+ A,
64
+ B
65
+ ),
66
+ (this.Le = InAppMessage.TextAlignment.CENTER);
69
67
  }
70
68
  }
71
- FullScreenMessage.es = InAppMessage.es.Tr;
69
+ FullScreenMessage.es = InAppMessage.Ee.so;
@@ -1,48 +1,49 @@
1
1
  import InAppMessage from "./in-app-message.js";
2
2
  export default class HtmlMessage extends InAppMessage {
3
- constructor(l, u, n, e, r, s, t, i, o, a, c) {
3
+ constructor(i, o, d, v, s, t, e, r, u, h, n) {
4
4
  super(
5
- l,
6
- null,
7
- null,
8
- u,
9
- n,
10
- null,
11
- null,
12
- null,
13
- (e = e || InAppMessage.DismissType.MANUAL),
14
- r,
15
- null,
16
- null,
17
- null,
18
- null,
19
- null,
20
- null,
21
- null,
22
- null,
5
+ i,
6
+ void 0,
7
+ void 0,
8
+ o,
9
+ d,
10
+ void 0,
11
+ void 0,
12
+ void 0,
13
+ (v = v || InAppMessage.DismissType.MANUAL),
23
14
  s,
15
+ void 0,
16
+ void 0,
17
+ void 0,
18
+ void 0,
19
+ void 0,
20
+ void 0,
21
+ void 0,
22
+ void 0,
24
23
  t,
25
- null,
26
- null,
27
- null,
28
- i,
24
+ e,
29
25
  void 0,
30
26
  void 0,
31
27
  void 0,
32
- o,
33
- a
28
+ r,
29
+ void 0,
30
+ void 0,
31
+ void 0,
32
+ u,
33
+ h
34
34
  ),
35
- (this.messageFields = c);
35
+ (this.messageFields = n),
36
+ (this.messageFields = n);
36
37
  }
37
- ll() {
38
+ io() {
38
39
  return !1;
39
40
  }
40
- k(l) {
41
- if (this.Ce === InAppMessage.es.ul) {
42
- if (this.nl) return !1;
43
- this.nl = !0;
41
+ p(i) {
42
+ if (this.Ce === InAppMessage.Ee.do) {
43
+ if (this.vo) return !1;
44
+ this.vo = !0;
44
45
  }
45
- return this.lt.St(l), !0;
46
+ return this.ht.Et(i), !0;
46
47
  }
47
48
  }
48
- HtmlMessage.es = InAppMessage.es.ul;
49
+ HtmlMessage.es = InAppMessage.Ee.do;