@braze/web-sdk 6.7.1 → 6.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.
- package/index.d.ts +74 -27
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +2 -2
- package/shared-lib/event-types.js +13 -13
- package/shared-lib/indexed-db-adapter.js +3 -3
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +8 -8
- package/src/Banner/log-banner-impressions.js +20 -11
- package/src/ContentCards/content-cards-provider-factory.js +13 -11
- package/src/ContentCards/content-cards-provider.js +4 -4
- package/src/ContentCards/get-cached-content-cards.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +2 -2
- package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
- package/src/ContentCards/ui/show-content-cards.js +3 -3
- package/src/Core/change-user.js +2 -2
- package/src/Core/index.js +1 -0
- package/src/Core/log-ecommerce-event.js +29 -0
- package/src/Core/log-purchase.js +17 -192
- package/src/Core/open-session.js +6 -6
- package/src/Core/set-sdk-authentication-signature.js +1 -1
- package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
- package/src/DUST/dust-connection-core.js +1 -0
- package/src/DUST/dust-provider-factory.js +10 -10
- package/src/DUST/dust-provider.js +181 -158
- package/src/DUST/dust-shared-worker-code.js +1 -1
- package/src/DUST/dust-shared-worker-impl.js +93 -100
- package/src/DUST/dust-worker-bridge.js +27 -27
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
- package/src/InAppMessage/display/modal-utils.js +2 -2
- package/src/InAppMessage/in-app-message-manager.js +64 -64
- package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +7 -7
- package/src/InAppMessage/models/html-message.js +1 -1
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +22 -22
- package/src/InAppMessage/models/modal-message.js +5 -5
- package/src/InAppMessage/models/slide-up-message.js +6 -6
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +20 -20
- package/src/Push/push-manager-factory.js +2 -2
- package/src/Push/push-manager.js +8 -8
- package/src/Push/utils/push-utils.js +6 -6
- package/src/User/user-manager.js +5 -5
- package/src/User/user.js +8 -8
- package/src/common/constants.js +1 -0
- package/src/common/content-cards-display.js +2 -2
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/braze-instance.js +21 -21
- package/src/managers/device-manager.js +6 -6
- package/src/managers/network-manager.js +93 -92
- package/src/managers/server-config-manager.js +68 -68
- package/src/managers/session-manager.js +2 -2
- package/src/managers/storage-manager-factory.js +4 -4
- package/src/managers/storage-manager.js +120 -120
- package/src/managers/subscription-manager.js +1 -1
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +3 -3
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +3 -3
- package/src/models/push-token.js +5 -5
- package/src/models/server-config.js +27 -27
- package/src/request-controller.js +99 -99
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +2 -2
- package/src/triggers/models/filter.js +1 -1
- package/src/triggers/models/in-app-message-click-data.js +5 -5
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +2 -2
- package/src/triggers/models/push-click-data.js +5 -5
- package/src/triggers/models/trigger-condition.js +42 -42
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +10 -10
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +30 -30
- package/src/types.js +5 -1
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/braze-actions.js +5 -5
- package/src/util/browser-detector.js +13 -13
- package/src/util/client-hints-parser.js +2 -2
- package/src/util/dom-utils.js +2 -2
- package/src/util/ecommerce-event-validation.js +326 -0
- package/src/util/iso-4217-currency-codes.js +176 -0
- package/src/util/net.js +3 -3
- package/src/util/request-header-utils.js +18 -18
- package/src/util/user-agent-parser.js +14 -14
- package/src/util/validation-utils.js +2 -2
- package/src/util/window-utils.js +2 -2
|
@@ -23,7 +23,7 @@ import It from "../Push/utils/push-utils.js";
|
|
|
23
23
|
import h from "../util/request-header-utils.js";
|
|
24
24
|
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
25
25
|
import { FullScreenMessage, ModalMessage, SlideUpMessage } from "./index.js";
|
|
26
|
-
import { IamClickAction as
|
|
26
|
+
import { IamClickAction as Le, IamServerTypes as dt } from "./constants.js";
|
|
27
27
|
export default class ea {
|
|
28
28
|
constructor(t, e, s, i) {
|
|
29
29
|
(this.B = t),
|
|
@@ -36,28 +36,28 @@ export default class ea {
|
|
|
36
36
|
(this.Ss = i),
|
|
37
37
|
(this.In = new f()),
|
|
38
38
|
r.S(this.In),
|
|
39
|
-
(this.
|
|
40
|
-
(this.
|
|
41
|
-
(this.
|
|
42
|
-
(this.
|
|
43
|
-
(this.
|
|
39
|
+
(this.Bn = 1e3),
|
|
40
|
+
(this._n = 6e4),
|
|
41
|
+
(this.qn = null),
|
|
42
|
+
(this.Pn = null),
|
|
43
|
+
(this.En = null);
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
Gn() {
|
|
46
46
|
return this.In;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
Nn(t) {
|
|
49
49
|
return this.In.Kt(t);
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
return this.
|
|
51
|
+
Fn() {
|
|
52
|
+
return this.qn;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
this.
|
|
54
|
+
On(t) {
|
|
55
|
+
this.qn = t;
|
|
56
56
|
}
|
|
57
57
|
wt(t, e, s, i) {
|
|
58
58
|
const r = new L();
|
|
59
59
|
let n;
|
|
60
|
-
if (e === p.
|
|
60
|
+
if (e === p.Xn || t instanceof ControlMessage) {
|
|
61
61
|
if (!t.gs())
|
|
62
62
|
return (
|
|
63
63
|
E.info(
|
|
@@ -65,7 +65,7 @@ export default class ea {
|
|
|
65
65
|
),
|
|
66
66
|
r
|
|
67
67
|
);
|
|
68
|
-
} else if (e === p.
|
|
68
|
+
} else if (e === p.Hn || (t instanceof HtmlMessage && e === p.Jn)) {
|
|
69
69
|
if (!t.ss(i))
|
|
70
70
|
return (
|
|
71
71
|
E.info(
|
|
@@ -78,7 +78,7 @@ export default class ea {
|
|
|
78
78
|
(n =
|
|
79
79
|
t instanceof ControlMessage
|
|
80
80
|
? { trigger_ids: [t.triggerId] }
|
|
81
|
-
: this.
|
|
81
|
+
: this.Kn(t)),
|
|
82
82
|
null == n
|
|
83
83
|
? r
|
|
84
84
|
: (t.messageExtras && (n.message_extras = t.messageExtras),
|
|
@@ -86,7 +86,7 @@ export default class ea {
|
|
|
86
86
|
v.wt(e, n))
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
Ln(t, e) {
|
|
90
90
|
const s = new L();
|
|
91
91
|
if (!t.ss())
|
|
92
92
|
return (
|
|
@@ -95,72 +95,72 @@ export default class ea {
|
|
|
95
95
|
),
|
|
96
96
|
s
|
|
97
97
|
);
|
|
98
|
-
const i = this.
|
|
98
|
+
const i = this.Kn(e);
|
|
99
99
|
return null == i
|
|
100
100
|
? s
|
|
101
|
-
: t.id === InAppMessageButton.
|
|
101
|
+
: t.id === InAppMessageButton.Qn
|
|
102
102
|
? (E.info(
|
|
103
103
|
"This in-app message button does not have a tracking id. Not logging event to Braze servers.",
|
|
104
104
|
),
|
|
105
105
|
s)
|
|
106
|
-
: (null != t.id && (i.bid = t.id), v.wt(p.
|
|
106
|
+
: (null != t.id && (i.bid = t.id), v.wt(p.Jn, i));
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
Un(t) {
|
|
109
109
|
const e = t.messageFields;
|
|
110
110
|
return (null != e && e.is_push_primer) || !1;
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
Vn(t) {
|
|
113
113
|
if (!(t instanceof InAppMessage)) return;
|
|
114
114
|
const e = (t) => {
|
|
115
115
|
if (!t) return;
|
|
116
116
|
const e = eo(t);
|
|
117
|
-
if (vt(e)) return yt(bt.
|
|
117
|
+
if (vt(e)) return yt(bt.Wn, "In-App Message");
|
|
118
118
|
if (jt(e)) {
|
|
119
|
-
const t = It.
|
|
120
|
-
if (!t.
|
|
119
|
+
const t = It.Yn();
|
|
120
|
+
if (!t.Zn) return It._o(t.reason, "In-App Message");
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
|
-
if (this.
|
|
124
|
-
const t = It.
|
|
125
|
-
if (!t.
|
|
123
|
+
if (this.Un(t)) {
|
|
124
|
+
const t = It.Yn();
|
|
125
|
+
if (!t.Zn) return It._o(t.reason, "In-App Message");
|
|
126
126
|
}
|
|
127
127
|
const s = t.buttons || [];
|
|
128
128
|
let i;
|
|
129
129
|
for (const t of s)
|
|
130
130
|
if (
|
|
131
|
-
t.clickAction ===
|
|
131
|
+
t.clickAction === Le.URI &&
|
|
132
132
|
t.uri &&
|
|
133
133
|
to.test(t.uri) &&
|
|
134
134
|
((i = e(t.uri)), i)
|
|
135
135
|
)
|
|
136
136
|
return i;
|
|
137
|
-
return t.clickAction ===
|
|
137
|
+
return t.clickAction === Le.URI && t.uri && to.test(t.uri)
|
|
138
138
|
? e(t.uri)
|
|
139
139
|
: void 0;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
e !== this.
|
|
141
|
+
Xo(t, e) {
|
|
142
|
+
e !== this.En && this.Yo(), (this.Pn = t), (this.En = e);
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
null != this.
|
|
146
|
-
(clearTimeout(this.
|
|
144
|
+
Yo() {
|
|
145
|
+
null != this.Pn &&
|
|
146
|
+
(clearTimeout(this.Pn), (this.Pn = null), (this.En = null));
|
|
147
147
|
}
|
|
148
|
-
|
|
148
|
+
Zo(t, e, s, i) {
|
|
149
149
|
const r = this.B;
|
|
150
150
|
if (!r) return;
|
|
151
|
-
this.
|
|
152
|
-
const n = r.
|
|
151
|
+
this.En && t.triggerId !== this.En && (this.Yo(), h.Li(this.C, h.it.ta));
|
|
152
|
+
const n = r.ia(!1),
|
|
153
153
|
o = r.Z(n);
|
|
154
154
|
(o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
|
|
155
|
-
null != s && (o.template.data = s.
|
|
156
|
-
const u = r.tt(o, h.it.
|
|
155
|
+
null != s && (o.template.data = s.oa());
|
|
156
|
+
const u = r.tt(o, h.it.ta);
|
|
157
157
|
r.et(
|
|
158
158
|
o,
|
|
159
159
|
(r = -1) => {
|
|
160
160
|
const n = this.B;
|
|
161
161
|
if (!n) return;
|
|
162
162
|
const m = new Date().valueOf();
|
|
163
|
-
h.nt(this.C, h.it.
|
|
163
|
+
h.nt(this.C, h.it.ta, m),
|
|
164
164
|
-1 !== r && u.push(["X-Braze-Req-Tokens-Remaining", r.toString()]);
|
|
165
165
|
let c,
|
|
166
166
|
p,
|
|
@@ -171,16 +171,16 @@ export default class ea {
|
|
|
171
171
|
headers: u,
|
|
172
172
|
lt: (e) => {
|
|
173
173
|
if (!n.ut(o, e, u))
|
|
174
|
-
return void ("function" == typeof t.
|
|
174
|
+
return void ("function" == typeof t.la && t.la());
|
|
175
175
|
if ((n.ct(), null == e || null == e.templated_message)) return;
|
|
176
176
|
const s = e.templated_message;
|
|
177
|
-
if (s.type !== gt.
|
|
177
|
+
if (s.type !== gt.ma.ua) return;
|
|
178
178
|
const i = pt(s.data);
|
|
179
179
|
if (null == i) return;
|
|
180
|
-
const r = this.
|
|
180
|
+
const r = this.Vn(i);
|
|
181
181
|
if (r)
|
|
182
|
-
return E.error(r), void ("function" == typeof t.
|
|
183
|
-
"function" == typeof t.
|
|
182
|
+
return E.error(r), void ("function" == typeof t.la && t.la());
|
|
183
|
+
"function" == typeof t.ca && t.ca(i);
|
|
184
184
|
},
|
|
185
185
|
error: (e) => {
|
|
186
186
|
(f = !0),
|
|
@@ -188,21 +188,21 @@ export default class ea {
|
|
|
188
188
|
(p = `getting user personalization for message ${t.triggerId}.`);
|
|
189
189
|
},
|
|
190
190
|
ft: (r, o) => {
|
|
191
|
-
if (new Date().valueOf() - t.
|
|
191
|
+
if (new Date().valueOf() - t.pa < t.ha) {
|
|
192
192
|
let r = 0;
|
|
193
193
|
if (f) {
|
|
194
|
-
const e = Math.min(t.
|
|
195
|
-
s = this.
|
|
194
|
+
const e = Math.min(t.ha, this._n),
|
|
195
|
+
s = this.Bn;
|
|
196
196
|
null == i && (i = s), (r = Math.min(e, a(s, 3 * i)));
|
|
197
197
|
}
|
|
198
198
|
n.yt(
|
|
199
199
|
o,
|
|
200
200
|
() => {
|
|
201
|
-
this.
|
|
201
|
+
this.Zo(t, e, s, r);
|
|
202
202
|
},
|
|
203
|
-
h.it.
|
|
204
|
-
(e) => this.
|
|
205
|
-
() => this.
|
|
203
|
+
h.it.ta,
|
|
204
|
+
(e) => this.Xo(e, t.triggerId),
|
|
205
|
+
() => this.Yo(),
|
|
206
206
|
r,
|
|
207
207
|
);
|
|
208
208
|
}
|
|
@@ -210,10 +210,10 @@ export default class ea {
|
|
|
210
210
|
},
|
|
211
211
|
});
|
|
212
212
|
},
|
|
213
|
-
h.it.
|
|
213
|
+
h.it.ta,
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
|
-
|
|
216
|
+
Kn(t) {
|
|
217
217
|
if (null == t.triggerId)
|
|
218
218
|
return (
|
|
219
219
|
E.info(
|
|
@@ -224,40 +224,40 @@ export default class ea {
|
|
|
224
224
|
const e = {};
|
|
225
225
|
return null != t.triggerId && (e.trigger_ids = [t.triggerId]), e;
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
An(t) {
|
|
228
228
|
return (
|
|
229
229
|
!!this.C &&
|
|
230
230
|
!(
|
|
231
231
|
!(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
|
|
232
232
|
t instanceof ControlMessage
|
|
233
233
|
) &&
|
|
234
|
-
this.C.It(s.Tt.
|
|
234
|
+
this.C.It(s.Tt.fa, t.qt())
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
sa() {
|
|
238
238
|
if (!this.C) return null;
|
|
239
|
-
const t = this.C.Rt(s.Tt.
|
|
239
|
+
const t = this.C.Rt(s.Tt.fa);
|
|
240
240
|
if (!t) return null;
|
|
241
241
|
let e;
|
|
242
242
|
switch (t.type) {
|
|
243
243
|
case dt.cE:
|
|
244
|
-
e = FullScreenMessage.
|
|
244
|
+
e = FullScreenMessage.ga(t);
|
|
245
245
|
break;
|
|
246
246
|
case dt.iE:
|
|
247
247
|
case dt.PE:
|
|
248
248
|
case dt.nE:
|
|
249
|
-
e = HtmlMessage.
|
|
249
|
+
e = HtmlMessage.ga(t);
|
|
250
250
|
break;
|
|
251
251
|
case dt.aE:
|
|
252
252
|
case dt.UE:
|
|
253
|
-
e = ModalMessage.
|
|
253
|
+
e = ModalMessage.ga(t);
|
|
254
254
|
break;
|
|
255
255
|
case dt.sE:
|
|
256
|
-
e = SlideUpMessage.
|
|
256
|
+
e = SlideUpMessage.ga(t);
|
|
257
257
|
}
|
|
258
|
-
return e && this.
|
|
258
|
+
return e && this.da(), e;
|
|
259
259
|
}
|
|
260
|
-
|
|
261
|
-
this.C && this.C.Qt(s.Tt.
|
|
260
|
+
da() {
|
|
261
|
+
this.C && this.C.Qt(s.Tt.fa);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
@@ -12,7 +12,7 @@ export function logInAppMessageButtonClick(t, o) {
|
|
|
12
12
|
if (!(t instanceof InAppMessageButton))
|
|
13
13
|
return E.error("button must be an InAppMessageButton object"), !1;
|
|
14
14
|
if (!(o instanceof InAppMessage)) return E.error(mr.EE), !1;
|
|
15
|
-
const s = je.ra().
|
|
15
|
+
const s = je.ra().Ln(t, o);
|
|
16
16
|
if (s.lt)
|
|
17
17
|
for (let r = 0; r < s.Ce.length; r++)
|
|
18
18
|
rt.o().Ee(
|
|
@@ -9,7 +9,7 @@ import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-fac
|
|
|
9
9
|
export function logInAppMessageClick(s) {
|
|
10
10
|
if (!r.rr()) return !1;
|
|
11
11
|
if (!(s instanceof InAppMessage)) return E.error(mr.EE), !1;
|
|
12
|
-
const e = je.ra().wt(s, p.
|
|
12
|
+
const e = je.ra().wt(s, p.Hn);
|
|
13
13
|
if (e) {
|
|
14
14
|
s.sm() || logInAppMessageImpression(s);
|
|
15
15
|
for (let r = 0; r < e.Ce.length; r++)
|
|
@@ -8,6 +8,6 @@ export function logInAppMessageImpression(s) {
|
|
|
8
8
|
if (!r.rr()) return !1;
|
|
9
9
|
if (!(s instanceof InAppMessage || s instanceof ControlMessage))
|
|
10
10
|
return E.error(mr.EE), !1;
|
|
11
|
-
const o = s instanceof ControlMessage ? p.om : p.
|
|
11
|
+
const o = s instanceof ControlMessage ? p.om : p.Xn;
|
|
12
12
|
return je.ra().wt(s, o).lt;
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IamCropType as
|
|
2
|
+
IamCropType as Me,
|
|
3
3
|
IamDismissType as pr,
|
|
4
|
-
IamOrientation as
|
|
4
|
+
IamOrientation as De,
|
|
5
5
|
IamSerializationKeys as cr,
|
|
6
6
|
IamServerTypes as dt,
|
|
7
|
-
IamTextAlignment as
|
|
7
|
+
IamTextAlignment as Fe,
|
|
8
8
|
} from "../constants.js";
|
|
9
9
|
import { buttonsFromSerializedInAppMessage as ur } from "../in-app-message-factory.js";
|
|
10
10
|
import InAppMessage from "./in-app-message.js";
|
|
@@ -43,7 +43,7 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
43
43
|
D,
|
|
44
44
|
) {
|
|
45
45
|
(p = p || pr.MANUAL),
|
|
46
|
-
(k = k ||
|
|
46
|
+
(k = k || De.PORTRAIT),
|
|
47
47
|
super(
|
|
48
48
|
r,
|
|
49
49
|
s,
|
|
@@ -70,7 +70,7 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
70
70
|
w,
|
|
71
71
|
y,
|
|
72
72
|
S,
|
|
73
|
-
(b = b ||
|
|
73
|
+
(b = b || Me.CENTER_CROP),
|
|
74
74
|
k,
|
|
75
75
|
q,
|
|
76
76
|
A,
|
|
@@ -78,12 +78,12 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
78
78
|
C,
|
|
79
79
|
D,
|
|
80
80
|
),
|
|
81
|
-
(this.Go =
|
|
81
|
+
(this.Go = Fe.CENTER);
|
|
82
82
|
}
|
|
83
83
|
qt() {
|
|
84
84
|
return super.qt(dt.cE);
|
|
85
85
|
}
|
|
86
|
-
static
|
|
86
|
+
static ga(r) {
|
|
87
87
|
return new FullScreenMessage(
|
|
88
88
|
r[cr.rE],
|
|
89
89
|
r[cr.mE],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import f from "../../managers/subscription-manager.js";
|
|
2
|
-
import { IamColors as ss, IamClickAction as
|
|
2
|
+
import { IamColors as ss, IamClickAction as Le } from "../constants.js";
|
|
3
3
|
export default class InAppMessageButton {
|
|
4
4
|
constructor(s, t, i, r, h, e, n) {
|
|
5
5
|
(this.text = s),
|
|
@@ -13,9 +13,9 @@ export default class InAppMessageButton {
|
|
|
13
13
|
(this.backgroundColor = t || ss._E),
|
|
14
14
|
(this.textColor = i || ss.AE),
|
|
15
15
|
(this.borderColor = r || this.backgroundColor),
|
|
16
|
-
(this.clickAction = h ||
|
|
16
|
+
(this.clickAction = h || Le.NONE),
|
|
17
17
|
(this.uri = e),
|
|
18
|
-
null == n && (n = InAppMessageButton.
|
|
18
|
+
null == n && (n = InAppMessageButton.Qn),
|
|
19
19
|
(this.id = n),
|
|
20
20
|
(this.rd = !1),
|
|
21
21
|
(this.ti = new f());
|
|
@@ -44,4 +44,4 @@ export default class InAppMessageButton {
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
InAppMessageButton.
|
|
47
|
+
InAppMessageButton.Qn = -1;
|
|
@@ -10,17 +10,17 @@ import { isIFrame as St } from "../utils/in-app-message-utils.js";
|
|
|
10
10
|
import {
|
|
11
11
|
IamStrings as mr,
|
|
12
12
|
IamColors as ss,
|
|
13
|
-
IamClickAction as
|
|
13
|
+
IamClickAction as Le,
|
|
14
14
|
IAM_SHOW_CLASS as Tt,
|
|
15
15
|
IAM_HIDE_CLASS as xt,
|
|
16
|
-
IamDisplayFailures as
|
|
17
|
-
IamSlideFrom as
|
|
16
|
+
IamDisplayFailures as qe,
|
|
17
|
+
IamSlideFrom as Ee,
|
|
18
18
|
IamDismissType as pr,
|
|
19
19
|
IamOpenTarget as ut,
|
|
20
|
-
IamImageStyle as
|
|
21
|
-
IamOrientation as
|
|
22
|
-
IamTextAlignment as
|
|
23
|
-
IamCropType as
|
|
20
|
+
IamImageStyle as Ae,
|
|
21
|
+
IamOrientation as De,
|
|
22
|
+
IamTextAlignment as Fe,
|
|
23
|
+
IamCropType as Me,
|
|
24
24
|
IamServerTypes as dt,
|
|
25
25
|
IamTiming as Et,
|
|
26
26
|
IamSerializationKeys as cr,
|
|
@@ -93,18 +93,18 @@ export default class InAppMessage {
|
|
|
93
93
|
(this.language = D),
|
|
94
94
|
(this.altImageText = z),
|
|
95
95
|
(this.message = t),
|
|
96
|
-
(this.messageAlignment = s ||
|
|
96
|
+
(this.messageAlignment = s || Fe.CENTER),
|
|
97
97
|
(this.duration = u || 5e3),
|
|
98
|
-
(this.slideFrom = i ||
|
|
98
|
+
(this.slideFrom = i || Ee.BOTTOM),
|
|
99
99
|
(this.extras = h || {}),
|
|
100
100
|
(this.triggerId = e),
|
|
101
|
-
(this.clickAction = n ||
|
|
101
|
+
(this.clickAction = n || Le.NONE),
|
|
102
102
|
(this.uri = r),
|
|
103
103
|
(this.openTarget = o || ut.NONE),
|
|
104
104
|
(this.dismissType = l || pr.AUTO_DISMISS),
|
|
105
105
|
(this.icon = a),
|
|
106
106
|
(this.imageUrl = m),
|
|
107
|
-
(this.imageStyle = c ||
|
|
107
|
+
(this.imageStyle = c || Ae.TOP),
|
|
108
108
|
(this.iconColor = d || ss.AE),
|
|
109
109
|
(this.iconBackgroundColor = p || ss._E),
|
|
110
110
|
(this.backgroundColor = b || ss.AE),
|
|
@@ -115,11 +115,11 @@ export default class InAppMessage {
|
|
|
115
115
|
(this.animateOut = j),
|
|
116
116
|
null == this.animateOut && (this.animateOut = !0),
|
|
117
117
|
(this.header = k),
|
|
118
|
-
(this.headerAlignment = w ||
|
|
118
|
+
(this.headerAlignment = w || Fe.CENTER),
|
|
119
119
|
(this.headerTextColor = y || ss.IE),
|
|
120
120
|
(this.frameColor = S || ss.SE),
|
|
121
121
|
(this.buttons = T || []),
|
|
122
|
-
(this.cropType = x ||
|
|
122
|
+
(this.cropType = x || Me.FIT_CENTER),
|
|
123
123
|
(this.orientation = E),
|
|
124
124
|
(this.htmlId = H),
|
|
125
125
|
(this.css = M),
|
|
@@ -135,7 +135,7 @@ export default class InAppMessage {
|
|
|
135
135
|
(this.$o = null),
|
|
136
136
|
(this.ti = new f()),
|
|
137
137
|
(this.ih = new f()),
|
|
138
|
-
(this.Go =
|
|
138
|
+
(this.Go = Fe.CENTER);
|
|
139
139
|
}
|
|
140
140
|
subscribeToClickedEvent(t) {
|
|
141
141
|
return this.ti.Kt(t);
|
|
@@ -240,7 +240,7 @@ export default class InAppMessage {
|
|
|
240
240
|
const s = t.parentNode;
|
|
241
241
|
this.zo() &&
|
|
242
242
|
null != s &&
|
|
243
|
-
this.orientation !==
|
|
243
|
+
this.orientation !== De.LANDSCAPE &&
|
|
244
244
|
(null != s.classList && s.classList.add(mr.TE),
|
|
245
245
|
document.body.addEventListener(
|
|
246
246
|
"touchmove",
|
|
@@ -324,15 +324,15 @@ export default class InAppMessage {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
(InAppMessage.ah = ss),
|
|
327
|
-
(InAppMessage.mh =
|
|
328
|
-
(InAppMessage.SlideFrom =
|
|
329
|
-
(InAppMessage.ClickAction =
|
|
327
|
+
(InAppMessage.mh = qe),
|
|
328
|
+
(InAppMessage.SlideFrom = Ee),
|
|
329
|
+
(InAppMessage.ClickAction = Le),
|
|
330
330
|
(InAppMessage.DismissType = pr),
|
|
331
331
|
(InAppMessage.OpenTarget = ut),
|
|
332
|
-
(InAppMessage.ImageStyle =
|
|
333
|
-
(InAppMessage.Orientation =
|
|
334
|
-
(InAppMessage.TextAlignment =
|
|
335
|
-
(InAppMessage.CropType =
|
|
332
|
+
(InAppMessage.ImageStyle = Ae),
|
|
333
|
+
(InAppMessage.Orientation = De),
|
|
334
|
+
(InAppMessage.TextAlignment = Fe),
|
|
335
|
+
(InAppMessage.CropType = Me),
|
|
336
336
|
(InAppMessage.dh = dt),
|
|
337
337
|
(InAppMessage.gr = Et.gr),
|
|
338
338
|
(InAppMessage.pE = Et.pE),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IamCropType as
|
|
2
|
+
IamCropType as Me,
|
|
3
3
|
IamDismissType as pr,
|
|
4
4
|
IamSerializationKeys as cr,
|
|
5
5
|
IamServerTypes as dt,
|
|
6
|
-
IamTextAlignment as
|
|
6
|
+
IamTextAlignment as Fe,
|
|
7
7
|
} from "../constants.js";
|
|
8
8
|
import { buttonsFromSerializedInAppMessage as ur } from "../in-app-message-factory.js";
|
|
9
9
|
import InAppMessage from "./in-app-message.js";
|
|
@@ -66,7 +66,7 @@ export default class ModalMessage extends InAppMessage {
|
|
|
66
66
|
w,
|
|
67
67
|
y,
|
|
68
68
|
S,
|
|
69
|
-
(b = b ||
|
|
69
|
+
(b = b || Me.FIT_CENTER),
|
|
70
70
|
void 0,
|
|
71
71
|
k,
|
|
72
72
|
q,
|
|
@@ -74,12 +74,12 @@ export default class ModalMessage extends InAppMessage {
|
|
|
74
74
|
B,
|
|
75
75
|
C,
|
|
76
76
|
),
|
|
77
|
-
(this.Go =
|
|
77
|
+
(this.Go = Fe.CENTER);
|
|
78
78
|
}
|
|
79
79
|
qt() {
|
|
80
80
|
return super.qt(dt.aE);
|
|
81
81
|
}
|
|
82
|
-
static
|
|
82
|
+
static ga(r) {
|
|
83
83
|
return new ModalMessage(
|
|
84
84
|
r[cr.rE],
|
|
85
85
|
r[cr.mE],
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
IamColors as ss,
|
|
5
5
|
IamSerializationKeys as cr,
|
|
6
6
|
IamServerTypes as dt,
|
|
7
|
-
IamSlideFrom as
|
|
8
|
-
IamTextAlignment as
|
|
7
|
+
IamSlideFrom as Ee,
|
|
8
|
+
IamTextAlignment as Fe,
|
|
9
9
|
} from "../constants.js";
|
|
10
10
|
export default class SlideUpMessage extends InAppMessage {
|
|
11
11
|
constructor(
|
|
@@ -38,7 +38,7 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
38
38
|
(v = v || ss.OE),
|
|
39
39
|
super(
|
|
40
40
|
t,
|
|
41
|
-
(s = s ||
|
|
41
|
+
(s = s || Fe.START),
|
|
42
42
|
e,
|
|
43
43
|
o,
|
|
44
44
|
i,
|
|
@@ -70,7 +70,7 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
70
70
|
b,
|
|
71
71
|
z,
|
|
72
72
|
),
|
|
73
|
-
(this.Go =
|
|
73
|
+
(this.Go = Fe.START);
|
|
74
74
|
}
|
|
75
75
|
zo() {
|
|
76
76
|
return !1;
|
|
@@ -82,7 +82,7 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
82
82
|
eh(t) {
|
|
83
83
|
const s = t.getElementsByClassName("ab-in-app-message")[0];
|
|
84
84
|
Mt.td(s, !0, !0) ||
|
|
85
|
-
(this.slideFrom ===
|
|
85
|
+
(this.slideFrom === Ee.TOP
|
|
86
86
|
? (s.style.top = "0px")
|
|
87
87
|
: (s.style.bottom = "0px")),
|
|
88
88
|
super.eh(t);
|
|
@@ -90,7 +90,7 @@ export default class SlideUpMessage extends InAppMessage {
|
|
|
90
90
|
qt() {
|
|
91
91
|
return super.qt(dt.sE);
|
|
92
92
|
}
|
|
93
|
-
static
|
|
93
|
+
static ga(t) {
|
|
94
94
|
return new SlideUpMessage(
|
|
95
95
|
t[cr.rE],
|
|
96
96
|
t[cr.mE],
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export default class Jt {
|
|
2
2
|
constructor(t, s, i, h, l) {
|
|
3
3
|
(this.triggerId = t),
|
|
4
|
-
(this.
|
|
5
|
-
(this.
|
|
6
|
-
(this.
|
|
7
|
-
(this.
|
|
4
|
+
(this.ca = s),
|
|
5
|
+
(this.la = i),
|
|
6
|
+
(this.pa = h),
|
|
7
|
+
(this.ha = l),
|
|
8
8
|
(this.triggerId = t),
|
|
9
|
-
(this.
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
12
|
-
(this.
|
|
9
|
+
(this.ca = s),
|
|
10
|
+
(this.la = i),
|
|
11
|
+
(this.pa = h),
|
|
12
|
+
(this.ha = l);
|
|
13
13
|
}
|
|
14
14
|
static fromJson(t, s, i, h, l) {
|
|
15
15
|
return null == t || null == t.trigger_id
|
|
@@ -7,9 +7,9 @@ export function automaticallyShowInAppMessages() {
|
|
|
7
7
|
if (!r.rr()) return;
|
|
8
8
|
rs();
|
|
9
9
|
const s = je.ra();
|
|
10
|
-
if (null == s.
|
|
10
|
+
if (null == s.Fn()) {
|
|
11
11
|
const r = subscribeToInAppMessage((s) => showInAppMessage(s));
|
|
12
|
-
s.
|
|
12
|
+
s.On(r);
|
|
13
13
|
}
|
|
14
|
-
return s.
|
|
14
|
+
return s.Fn();
|
|
15
15
|
}
|