@braze/web-sdk 6.7.1 → 6.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.
- package/index.d.ts +165 -38
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +2 -2
- package/shared-lib/event-types.js +16 -16
- package/shared-lib/indexed-db-adapter.js +65 -65
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +1 -1
- package/src/Banner/banner-provider.js +67 -59
- package/src/Banner/banner.js +40 -19
- package/src/Banner/dismiss-banner.js +4 -0
- package/src/Banner/display/banner-to-html.js +10 -10
- package/src/Banner/display/destroy-banner-html.js +2 -2
- package/src/Banner/get-all-banners.js +6 -6
- package/src/Banner/get-banner.js +6 -6
- package/src/Banner/index.js +1 -0
- package/src/Banner/log-banner-click.js +7 -7
- package/src/Banner/log-banner-dismissal.js +7 -7
- package/src/Banner/log-banner-impressions.js +27 -18
- package/src/Banner/request-banners-refresh.js +8 -8
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Banner/ui/insert-banner.js +8 -8
- package/src/Card/card-manager.js +31 -31
- package/src/Card/log-card-dismissal.js +2 -2
- package/src/Card/log-content-card-click.js +2 -2
- package/src/Card/log-content-card-impressions.js +4 -4
- package/src/Card/models/captioned-image.js +15 -15
- package/src/Card/models/card.js +89 -89
- package/src/Card/models/classic-card.js +16 -16
- package/src/Card/models/control-card.js +7 -7
- package/src/Card/models/image-only.js +13 -13
- package/src/Card/util/card-factory.js +32 -32
- package/src/ContentCards/content-cards-provider-factory.js +13 -11
- package/src/ContentCards/content-cards-provider.js +105 -105
- 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 +7 -7
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +5 -5
- package/src/Core/destroy.js +2 -2
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +5 -5
- package/src/Core/index.js +1 -0
- package/src/Core/log-custom-event.js +5 -5
- package/src/Core/log-ecommerce-event.js +29 -0
- package/src/Core/log-purchase.js +23 -198
- package/src/Core/open-session.js +10 -10
- package/src/Core/set-logger.js +2 -2
- package/src/Core/set-sdk-authentication-signature.js +1 -1
- package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +6 -6
- package/src/DUST/dust-connection-core.js +1 -0
- package/src/DUST/dust-provider-factory.js +10 -10
- package/src/DUST/dust-provider.js +258 -226
- package/src/DUST/dust-shared-worker-code.js +1 -1
- package/src/DUST/dust-shared-worker-impl.js +97 -103
- package/src/DUST/dust-worker-bridge.js +55 -40
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +8 -8
- package/src/FeatureFlags/feature-flag.js +3 -3
- package/src/FeatureFlags/feature-flags-provider.js +21 -21
- package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/InAppMessage/constants.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +3 -3
- package/src/InAppMessage/display/html-message-to-html.js +4 -4
- package/src/InAppMessage/display/in-app-message-to-html.js +32 -32
- package/src/InAppMessage/display/modal-utils.js +2 -2
- package/src/InAppMessage/in-app-message-factory.js +36 -36
- package/src/InAppMessage/in-app-message-manager.js +35 -35
- package/src/InAppMessage/log-in-app-message-button-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-impression.js +3 -3
- package/src/InAppMessage/models/control-message.js +4 -4
- package/src/InAppMessage/models/full-screen-message.js +9 -9
- package/src/InAppMessage/models/html-message.js +2 -2
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +34 -34
- package/src/InAppMessage/models/modal-message.js +7 -7
- package/src/InAppMessage/models/slide-up-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +20 -20
- package/src/Push/push-manager.js +44 -44
- package/src/User/user-manager.js +19 -19
- package/src/User/user.js +17 -17
- package/src/common/base-provider.js +1 -1
- package/src/common/constants.js +1 -0
- package/src/common/content-cards-display.js +6 -6
- package/src/common/event-logger.js +3 -3
- package/src/common/properties-base.js +3 -3
- package/src/l10n/l10n-manager.js +2 -2
- package/src/managers/auth-manager.js +11 -11
- package/src/managers/braze-instance.js +59 -59
- package/src/managers/device-manager.js +9 -9
- package/src/managers/network-manager.js +65 -63
- package/src/managers/server-config-manager.js +110 -93
- package/src/managers/session-manager.js +20 -20
- package/src/managers/storage-manager-factory.js +9 -9
- package/src/managers/storage-manager.js +137 -137
- package/src/managers/subscription-manager.js +2 -2
- package/src/managers/utils.js +1 -1
- package/src/models/braze-event.js +2 -2
- package/src/models/identifier.js +5 -5
- package/src/models/push-token.js +8 -8
- package/src/models/request-result.js +1 -1
- package/src/models/server-config.js +46 -28
- package/src/request-controller.js +124 -124
- 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 +45 -45
- package/src/triggers/models/trigger-events.js +3 -3
- package/src/triggers/models/trigger.js +30 -30
- package/src/triggers/triggers-provider.js +63 -63
- package/src/types.js +5 -1
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/braze-actions.js +6 -6
- package/src/util/browser-detector.js +13 -13
- package/src/util/client-hints-parser.js +5 -5
- package/src/util/code-utils.js +2 -2
- package/src/util/deprecation-utils.js +2 -2
- package/src/util/dom-utils.js +8 -8
- package/src/util/ecommerce-event-validation.js +343 -0
- package/src/util/html-display-utils.js +11 -11
- package/src/util/iso-4217-currency-codes.js +176 -0
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +10 -10
- package/src/util/string-utils.js +2 -2
- package/src/util/user-agent-parser.js +15 -15
- package/src/util/validation-utils.js +14 -14
|
@@ -8,7 +8,7 @@ import v from "../common/event-logger.js";
|
|
|
8
8
|
import { newInAppMessageFromJson as pt } from "./in-app-message-factory.js";
|
|
9
9
|
import { randomInclusive as a } from "../util/math.js";
|
|
10
10
|
import L from "../models/request-result.js";
|
|
11
|
-
import { logger as
|
|
11
|
+
import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
|
|
12
12
|
import f from "../managers/subscription-manager.js";
|
|
13
13
|
import gt from "../triggers/models/trigger.js";
|
|
14
14
|
import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
|
|
@@ -23,52 +23,52 @@ 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),
|
|
30
|
-
(this.
|
|
31
|
-
(this.
|
|
30
|
+
(this.C = e),
|
|
31
|
+
(this.j = s),
|
|
32
32
|
(this.Ss = i),
|
|
33
33
|
(this.B = t),
|
|
34
|
-
(this.
|
|
35
|
-
(this.
|
|
34
|
+
(this.C = e),
|
|
35
|
+
(this.j = s),
|
|
36
36
|
(this.Ss = i),
|
|
37
37
|
(this.In = new f()),
|
|
38
38
|
r.S(this.In),
|
|
39
39
|
(this.An = 1e3),
|
|
40
40
|
(this.Dn = 6e4),
|
|
41
|
-
(this.Bn = null),
|
|
42
41
|
(this._n = null),
|
|
43
|
-
(this.qn = null)
|
|
42
|
+
(this.qn = null),
|
|
43
|
+
(this.xn = null);
|
|
44
44
|
}
|
|
45
45
|
Pn() {
|
|
46
46
|
return this.In;
|
|
47
47
|
}
|
|
48
48
|
En(t) {
|
|
49
|
-
return this.In.
|
|
49
|
+
return this.In.Ut(t);
|
|
50
50
|
}
|
|
51
51
|
Gn() {
|
|
52
|
-
return this.
|
|
52
|
+
return this._n;
|
|
53
53
|
}
|
|
54
54
|
Nn(t) {
|
|
55
|
-
this.
|
|
55
|
+
this._n = t;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
Dt(t, e, s, i) {
|
|
58
58
|
const r = new L();
|
|
59
59
|
let n;
|
|
60
60
|
if (e === p.Fn || t instanceof ControlMessage) {
|
|
61
|
-
if (!t.
|
|
61
|
+
if (!t.js())
|
|
62
62
|
return (
|
|
63
|
-
|
|
63
|
+
b.info(
|
|
64
64
|
"This in-app message has already received an impression. Ignoring analytics event.",
|
|
65
65
|
),
|
|
66
66
|
r
|
|
67
67
|
);
|
|
68
68
|
} else if (e === p.On || (t instanceof HtmlMessage && e === p.Xn)) {
|
|
69
|
-
if (!t.
|
|
69
|
+
if (!t.Yt(i))
|
|
70
70
|
return (
|
|
71
|
-
|
|
71
|
+
b.info(
|
|
72
72
|
"This in-app message has already received a click. Ignoring analytics event.",
|
|
73
73
|
),
|
|
74
74
|
r
|
|
@@ -83,14 +83,14 @@ export default class ea {
|
|
|
83
83
|
? r
|
|
84
84
|
: (t.messageExtras && (n.message_extras = t.messageExtras),
|
|
85
85
|
null != s && (n.bid = s),
|
|
86
|
-
v.
|
|
86
|
+
v.Dt(e, n))
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
Jn(t, e) {
|
|
90
90
|
const s = new L();
|
|
91
|
-
if (!t.
|
|
91
|
+
if (!t.Yt())
|
|
92
92
|
return (
|
|
93
|
-
|
|
93
|
+
b.info(
|
|
94
94
|
"This in-app message button has already received a click. Ignoring analytics event.",
|
|
95
95
|
),
|
|
96
96
|
s
|
|
@@ -99,11 +99,11 @@ export default class ea {
|
|
|
99
99
|
return null == i
|
|
100
100
|
? s
|
|
101
101
|
: t.id === InAppMessageButton.Kn
|
|
102
|
-
? (
|
|
102
|
+
? (b.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.
|
|
106
|
+
: (null != t.id && (i.bid = t.id), v.Dt(p.Xn, i));
|
|
107
107
|
}
|
|
108
108
|
Ln(t) {
|
|
109
109
|
const e = t.messageFields;
|
|
@@ -128,27 +128,27 @@ export default class ea {
|
|
|
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
141
|
Zn(t, e) {
|
|
142
|
-
e !== this.
|
|
142
|
+
e !== this.xn && this._o(), (this.qn = t), (this.xn = e);
|
|
143
143
|
}
|
|
144
144
|
_o() {
|
|
145
|
-
null != this.
|
|
146
|
-
(clearTimeout(this.
|
|
145
|
+
null != this.qn &&
|
|
146
|
+
(clearTimeout(this.qn), (this.qn = null), (this.xn = null));
|
|
147
147
|
}
|
|
148
148
|
Xo(t, e, s, i) {
|
|
149
149
|
const r = this.B;
|
|
150
150
|
if (!r) return;
|
|
151
|
-
this.
|
|
151
|
+
this.xn && t.triggerId !== this.xn && (this._o(), h.Ji(this.j, h.it.Yo));
|
|
152
152
|
const n = r.Zo(!1),
|
|
153
153
|
o = r.Z(n);
|
|
154
154
|
(o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
|
|
@@ -160,7 +160,7 @@ export default class ea {
|
|
|
160
160
|
const n = this.B;
|
|
161
161
|
if (!n) return;
|
|
162
162
|
const m = new Date().valueOf();
|
|
163
|
-
h.nt(this.
|
|
163
|
+
h.nt(this.j, h.it.Yo, m),
|
|
164
164
|
-1 !== r && u.push(["X-Braze-Req-Tokens-Remaining", r.toString()]);
|
|
165
165
|
let c,
|
|
166
166
|
p,
|
|
@@ -179,7 +179,7 @@ export default class ea {
|
|
|
179
179
|
if (null == i) return;
|
|
180
180
|
const r = this.Qn(i);
|
|
181
181
|
if (r)
|
|
182
|
-
return
|
|
182
|
+
return b.error(r), void ("function" == typeof t.ia && t.ia());
|
|
183
183
|
"function" == typeof t.ua && t.ua(i);
|
|
184
184
|
},
|
|
185
185
|
error: (e) => {
|
|
@@ -216,7 +216,7 @@ export default class ea {
|
|
|
216
216
|
Hn(t) {
|
|
217
217
|
if (null == t.triggerId)
|
|
218
218
|
return (
|
|
219
|
-
|
|
219
|
+
b.info(
|
|
220
220
|
"The in-app message has no analytics id. Not logging event to Braze servers.",
|
|
221
221
|
),
|
|
222
222
|
null
|
|
@@ -226,17 +226,17 @@ export default class ea {
|
|
|
226
226
|
}
|
|
227
227
|
jn(t) {
|
|
228
228
|
return (
|
|
229
|
-
!!this.
|
|
229
|
+
!!this.j &&
|
|
230
230
|
!(
|
|
231
231
|
!(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
|
|
232
232
|
t instanceof ControlMessage
|
|
233
233
|
) &&
|
|
234
|
-
this.
|
|
234
|
+
this.j.Pt(s.It.pa, t.qt())
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
sa() {
|
|
238
|
-
if (!this.
|
|
239
|
-
const t = this.
|
|
238
|
+
if (!this.j) return null;
|
|
239
|
+
const t = this.j.St(s.It.pa);
|
|
240
240
|
if (!t) return null;
|
|
241
241
|
let e;
|
|
242
242
|
switch (t.type) {
|
|
@@ -258,6 +258,6 @@ export default class ea {
|
|
|
258
258
|
return e && this.fa(), e;
|
|
259
259
|
}
|
|
260
260
|
fa() {
|
|
261
|
-
this.
|
|
261
|
+
this.j && this.j.Vt(s.It.pa);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
@@ -3,15 +3,15 @@ import { IamStrings as mr } from "./constants.js";
|
|
|
3
3
|
import InAppMessage from "./models/in-app-message.js";
|
|
4
4
|
import InAppMessageButton from "./models/in-app-message-button.js";
|
|
5
5
|
import je from "./in-app-message-manager-factory.js";
|
|
6
|
-
import { logger as
|
|
6
|
+
import { logger as b } from "../../shared-lib/index.js";
|
|
7
7
|
import ot from "../triggers/models/trigger-events.js";
|
|
8
8
|
import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
|
|
9
9
|
export function logInAppMessageButtonClick(t, o) {
|
|
10
10
|
var e;
|
|
11
11
|
if (!r.rr()) return !1;
|
|
12
12
|
if (!(t instanceof InAppMessageButton))
|
|
13
|
-
return
|
|
14
|
-
if (!(o instanceof InAppMessage)) return
|
|
13
|
+
return b.error("button must be an InAppMessageButton object"), !1;
|
|
14
|
+
if (!(o instanceof InAppMessage)) return b.error(mr.EE), !1;
|
|
15
15
|
const s = je.ra().Jn(t, o);
|
|
16
16
|
if (s.lt)
|
|
17
17
|
for (let r = 0; r < s.Ce.length; r++)
|
|
@@ -3,13 +3,13 @@ import InAppMessage from "./models/in-app-message.js";
|
|
|
3
3
|
import je from "./in-app-message-manager-factory.js";
|
|
4
4
|
import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
|
|
5
5
|
import { IamStrings as mr } from "./constants.js";
|
|
6
|
-
import { logger as
|
|
6
|
+
import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
|
|
7
7
|
import ot from "../triggers/models/trigger-events.js";
|
|
8
8
|
import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
|
|
9
9
|
export function logInAppMessageClick(s) {
|
|
10
10
|
if (!r.rr()) return !1;
|
|
11
|
-
if (!(s instanceof InAppMessage)) return
|
|
12
|
-
const e = je.ra().
|
|
11
|
+
if (!(s instanceof InAppMessage)) return b.error(mr.EE), !1;
|
|
12
|
+
const e = je.ra().Dt(s, p.On);
|
|
13
13
|
if (e) {
|
|
14
14
|
s.sm() || logInAppMessageImpression(s);
|
|
15
15
|
for (let r = 0; r < e.Ce.length; r++)
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import r from "../managers/braze-instance.js";
|
|
2
2
|
import HtmlMessage from "./models/html-message.js";
|
|
3
3
|
import je from "./in-app-message-manager-factory.js";
|
|
4
|
-
import { logger as
|
|
4
|
+
import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
|
|
5
5
|
import ot from "../triggers/models/trigger-events.js";
|
|
6
6
|
import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
|
|
7
7
|
export function logInAppMessageHtmlClick(e, t, s) {
|
|
8
8
|
if (!r.rr()) return !1;
|
|
9
9
|
if (!(e instanceof HtmlMessage))
|
|
10
10
|
return (
|
|
11
|
-
|
|
11
|
+
b.error(
|
|
12
12
|
"inAppMessage argument to logInAppMessageHtmlClick must be an HtmlMessage object.",
|
|
13
13
|
),
|
|
14
14
|
!1
|
|
15
15
|
);
|
|
16
16
|
let o = p.On;
|
|
17
17
|
null != t && (o = p.Xn);
|
|
18
|
-
const m = je.ra().
|
|
18
|
+
const m = je.ra().Dt(e, o, t, s);
|
|
19
19
|
if (m.lt)
|
|
20
20
|
for (let r = 0; r < m.Ce.length; r++)
|
|
21
21
|
rt.o().Ee(ot.rm, [e.triggerId, t], m.Ce[r]);
|
|
@@ -3,11 +3,11 @@ import ControlMessage from "./models/control-message.js";
|
|
|
3
3
|
import InAppMessage from "./models/in-app-message.js";
|
|
4
4
|
import je from "./in-app-message-manager-factory.js";
|
|
5
5
|
import { IamStrings as mr } from "./constants.js";
|
|
6
|
-
import { logger as
|
|
6
|
+
import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
|
|
7
7
|
export function logInAppMessageImpression(s) {
|
|
8
8
|
if (!r.rr()) return !1;
|
|
9
9
|
if (!(s instanceof InAppMessage || s instanceof ControlMessage))
|
|
10
|
-
return
|
|
10
|
+
return b.error(mr.EE), !1;
|
|
11
11
|
const o = s instanceof ControlMessage ? p.om : p.Fn;
|
|
12
|
-
return je.ra().
|
|
12
|
+
return je.ra().Dt(s, o).lt;
|
|
13
13
|
}
|
|
@@ -6,15 +6,15 @@ export default class ControlMessage {
|
|
|
6
6
|
(this.messageExtras = t),
|
|
7
7
|
(this.extras = {}),
|
|
8
8
|
(this.isControl = !0),
|
|
9
|
-
(this.
|
|
9
|
+
(this.hs = !1);
|
|
10
10
|
}
|
|
11
11
|
static fromJson(s) {
|
|
12
12
|
return new ControlMessage(s.trigger_id, s.message_extras);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
return !this.
|
|
14
|
+
js() {
|
|
15
|
+
return !this.hs && ((this.hs = !0), !0);
|
|
16
16
|
}
|
|
17
17
|
sm() {
|
|
18
|
-
return this.
|
|
18
|
+
return this.hs;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -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,7 +78,7 @@ 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);
|
|
@@ -87,7 +87,7 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
87
87
|
return new FullScreenMessage(
|
|
88
88
|
r[cr.rE],
|
|
89
89
|
r[cr.mE],
|
|
90
|
-
r[cr.
|
|
90
|
+
r[cr.Is],
|
|
91
91
|
r[cr.FE],
|
|
92
92
|
r[cr.HE],
|
|
93
93
|
r[cr.URI],
|
|
@@ -95,7 +95,7 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
95
95
|
r[cr.BE],
|
|
96
96
|
r[cr.lE],
|
|
97
97
|
r[cr.bE],
|
|
98
|
-
r[cr.
|
|
98
|
+
r[cr.Bs],
|
|
99
99
|
r[cr.gE],
|
|
100
100
|
r[cr.YE],
|
|
101
101
|
r[cr.KE],
|
|
@@ -115,7 +115,7 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
115
115
|
r[cr.CSS],
|
|
116
116
|
r[cr.JE],
|
|
117
117
|
r[cr.LANGUAGE],
|
|
118
|
-
r[cr.
|
|
118
|
+
r[cr.Ns],
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -46,7 +46,7 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
46
46
|
od() {
|
|
47
47
|
return !1;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
Yt(i) {
|
|
50
50
|
if (this.ko === dt.iE) {
|
|
51
51
|
if (this.rd) return !1;
|
|
52
52
|
this.rd = !0;
|
|
@@ -60,7 +60,7 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
60
60
|
static ha(i) {
|
|
61
61
|
return new HtmlMessage(
|
|
62
62
|
i[cr.rE],
|
|
63
|
-
i[cr.
|
|
63
|
+
i[cr.Is],
|
|
64
64
|
i[cr.FE],
|
|
65
65
|
i[cr.BE],
|
|
66
66
|
i[cr.lE],
|
|
@@ -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,7 +13,7 @@ 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
18
|
null == n && (n = InAppMessageButton.Kn),
|
|
19
19
|
(this.id = n),
|
|
@@ -21,7 +21,7 @@ export default class InAppMessageButton {
|
|
|
21
21
|
(this.ti = new f());
|
|
22
22
|
}
|
|
23
23
|
subscribeToClickedEvent(s) {
|
|
24
|
-
return this.ti.
|
|
24
|
+
return this.ti.Ut(s);
|
|
25
25
|
}
|
|
26
26
|
removeSubscription(s) {
|
|
27
27
|
this.ti.removeSubscription(s);
|
|
@@ -29,7 +29,7 @@ export default class InAppMessageButton {
|
|
|
29
29
|
removeAllSubscriptions() {
|
|
30
30
|
this.ti.removeAllSubscriptions();
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
Yt() {
|
|
33
33
|
return !this.rd && ((this.rd = !0), this.ti.A(), !0);
|
|
34
34
|
}
|
|
35
35
|
static fromJson(s) {
|
|
@@ -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),
|
|
@@ -128,20 +128,20 @@ export default class InAppMessage {
|
|
|
128
128
|
(this.language = D),
|
|
129
129
|
(this.altImageText = z),
|
|
130
130
|
(this.th = !1),
|
|
131
|
-
(this.
|
|
131
|
+
(this.hs = !1),
|
|
132
132
|
(this.rd = !1),
|
|
133
133
|
(this.sh = !1),
|
|
134
134
|
(this.Eo = null),
|
|
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
|
-
return this.ti.
|
|
141
|
+
return this.ti.Ut(t);
|
|
142
142
|
}
|
|
143
143
|
subscribeToDismissedEvent(t) {
|
|
144
|
-
return this.ih.
|
|
144
|
+
return this.ih.Ut(t);
|
|
145
145
|
}
|
|
146
146
|
removeSubscription(t) {
|
|
147
147
|
this.ti.removeSubscription(t), this.ih.removeSubscription(t);
|
|
@@ -167,16 +167,16 @@ export default class InAppMessage {
|
|
|
167
167
|
Oo() {
|
|
168
168
|
if (this.Bo() && this.Mo()) return this.htmlId + "-css";
|
|
169
169
|
}
|
|
170
|
-
|
|
171
|
-
return !this.
|
|
170
|
+
js() {
|
|
171
|
+
return !this.hs && ((this.hs = !0), !0);
|
|
172
172
|
}
|
|
173
173
|
sm() {
|
|
174
|
-
return this.
|
|
174
|
+
return this.hs;
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
Yt(t) {
|
|
177
177
|
return !this.rd && ((this.rd = !0), this.ti.A(), !0);
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
Ft() {
|
|
180
180
|
return !this.sh && ((this.sh = !0), this.ih.A(), !0);
|
|
181
181
|
}
|
|
182
182
|
hide(t) {
|
|
@@ -215,7 +215,7 @@ export default class InAppMessage {
|
|
|
215
215
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
216
216
|
}
|
|
217
217
|
null != e && "Safari" === ro.browser && (e.scrollTop = n),
|
|
218
|
-
s ? s() : this.
|
|
218
|
+
s ? s() : this.Ft();
|
|
219
219
|
};
|
|
220
220
|
h ? setTimeout(r, Et.gr) : r(), this.$o && this.$o.focus();
|
|
221
221
|
}
|
|
@@ -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",
|
|
@@ -289,7 +289,7 @@ export default class InAppMessage {
|
|
|
289
289
|
? ((s[cr.rE] = this.message),
|
|
290
290
|
(s[cr.mE] = this.messageAlignment),
|
|
291
291
|
(s[cr.GE] = this.slideFrom),
|
|
292
|
-
(s[cr.
|
|
292
|
+
(s[cr.Is] = this.extras),
|
|
293
293
|
(s[cr.FE] = this.triggerId),
|
|
294
294
|
(s[cr.HE] = this.clickAction),
|
|
295
295
|
(s[cr.URI] = this.uri),
|
|
@@ -297,7 +297,7 @@ export default class InAppMessage {
|
|
|
297
297
|
(s[cr.BE] = this.dismissType),
|
|
298
298
|
(s[cr.lE] = this.duration),
|
|
299
299
|
(s[cr.bE] = this.icon),
|
|
300
|
-
(s[cr.
|
|
300
|
+
(s[cr.Bs] = this.imageUrl),
|
|
301
301
|
(s[cr.gE] = this.imageStyle),
|
|
302
302
|
(s[cr.YE] = this.iconColor),
|
|
303
303
|
(s[cr.KE] = this.iconBackgroundColor),
|
|
@@ -318,21 +318,21 @@ export default class InAppMessage {
|
|
|
318
318
|
(s[cr.xs] = t),
|
|
319
319
|
(s[cr.JE] = this.messageExtras),
|
|
320
320
|
(s[cr.LANGUAGE] = this.language),
|
|
321
|
-
(s[cr.
|
|
321
|
+
(s[cr.Ns] = this.altImageText),
|
|
322
322
|
s)
|
|
323
323
|
: s;
|
|
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,7 +74,7 @@ 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);
|
|
@@ -83,7 +83,7 @@ export default class ModalMessage extends InAppMessage {
|
|
|
83
83
|
return new ModalMessage(
|
|
84
84
|
r[cr.rE],
|
|
85
85
|
r[cr.mE],
|
|
86
|
-
r[cr.
|
|
86
|
+
r[cr.Is],
|
|
87
87
|
r[cr.FE],
|
|
88
88
|
r[cr.HE],
|
|
89
89
|
r[cr.URI],
|
|
@@ -91,7 +91,7 @@ export default class ModalMessage extends InAppMessage {
|
|
|
91
91
|
r[cr.BE],
|
|
92
92
|
r[cr.lE],
|
|
93
93
|
r[cr.bE],
|
|
94
|
-
r[cr.
|
|
94
|
+
r[cr.Bs],
|
|
95
95
|
r[cr.gE],
|
|
96
96
|
r[cr.YE],
|
|
97
97
|
r[cr.KE],
|
|
@@ -110,7 +110,7 @@ export default class ModalMessage extends InAppMessage {
|
|
|
110
110
|
r[cr.CSS],
|
|
111
111
|
r[cr.JE],
|
|
112
112
|
r[cr.LANGUAGE],
|
|
113
|
-
r[cr.
|
|
113
|
+
r[cr.Ns],
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
}
|