@braze/web-sdk 5.1.1 → 5.3.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 +65 -10
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +20 -20
- package/shared-lib/indexed-db-adapter.js +52 -52
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +22 -21
- package/src/ContentCards/content-cards-provider.js +107 -135
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +2 -2
- package/src/ContentCards/ui/show-content-cards.js +1 -1
- package/src/FeatureFlags/feature-flag.js +41 -30
- package/src/FeatureFlags/feature-flags-provider.js +88 -84
- package/src/FeatureFlags/get-all-feature-flags.js +2 -2
- package/src/FeatureFlags/get-feature-flag.js +2 -2
- package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
- package/src/Feed/feed-provider.js +24 -24
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/log-feed-displayed.js +1 -1
- package/src/Feed/request-feed-refresh.js +1 -1
- package/src/Feed/subscribe-to-feed-updates.js +1 -1
- package/src/Feed/ui/show-feed.js +1 -1
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +45 -42
- package/src/InAppMessage/display/in-app-message-to-html.js +22 -22
- package/src/InAppMessage/display/modal-utils.js +7 -7
- package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
- package/src/InAppMessage/in-app-message-factory.js +23 -21
- package/src/InAppMessage/in-app-message-manager.js +95 -112
- package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
- 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 +1 -1
- package/src/InAppMessage/models/control-message.js +4 -2
- package/src/InAppMessage/models/full-screen-message.js +14 -11
- package/src/InAppMessage/models/html-message.js +11 -9
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +127 -120
- package/src/InAppMessage/models/modal-message.js +14 -11
- package/src/InAppMessage/models/slide-up-message.js +46 -21
- 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 +37 -43
- package/src/InAppMessage/utils/in-app-message-utils.js +18 -1
- package/src/Push/push-manager-factory.js +4 -4
- package/src/Push/push-manager.js +118 -110
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +4 -4
- package/src/User/user.js +19 -19
- package/src/common/base-feed.js +1 -1
- package/src/common/base-provider.js +1 -1
- package/src/common/constants.js +0 -2
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +12 -12
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +4 -4
- package/src/managers/auth-manager.js +27 -27
- package/src/managers/braze-instance.js +119 -112
- package/src/managers/device-manager.js +19 -19
- package/src/managers/network-manager.js +215 -165
- package/src/managers/server-config-manager.js +46 -50
- package/src/managers/session-manager.js +21 -21
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +128 -125
- package/src/managers/utils.js +6 -0
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +19 -11
- package/src/models/device.js +3 -3
- package/src/models/identifier.js +34 -20
- package/src/models/push-token.js +4 -4
- package/src/models/server-config.js +24 -24
- package/src/request-controller.js +134 -124
- package/src/triggers/models/filter-set.js +2 -2
- package/src/triggers/models/filter.js +56 -56
- package/src/triggers/models/in-app-message-click-data.js +8 -8
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +30 -30
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +36 -36
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +84 -95
- package/src/ui/js/attach-css.js +2 -2
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +25 -24
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/component-utils.js +2 -2
- package/src/util/device-constants.js +2 -2
- package/src/util/dom-utils.js +6 -6
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +36 -37
- package/src/util/user-agent-parser.js +8 -8
- package/src/util/validation-utils.js +2 -0
- package/src/util/window-utils.js +3 -3
|
@@ -13,11 +13,11 @@ export function logInAppMessageHtmlClick(t, s, o) {
|
|
|
13
13
|
),
|
|
14
14
|
!1
|
|
15
15
|
);
|
|
16
|
-
let m = i.
|
|
17
|
-
null != s && (m = i.
|
|
16
|
+
let m = i.Ei;
|
|
17
|
+
null != s && (m = i.Gi);
|
|
18
18
|
const n = se.m().q(t, m, s, o);
|
|
19
19
|
if (n.L)
|
|
20
20
|
for (let e = 0; e < n.ge.length; e++)
|
|
21
|
-
et.rr().fe(tt.
|
|
21
|
+
et.rr().fe(tt.Qr, [t.triggerId, s], n.ge[e]);
|
|
22
22
|
return n.L;
|
|
23
23
|
}
|
|
@@ -8,6 +8,6 @@ export function logInAppMessageImpression(o) {
|
|
|
8
8
|
if (!e.X()) return !1;
|
|
9
9
|
if (!(o instanceof InAppMessage || o instanceof ControlMessage))
|
|
10
10
|
return r.error(sr), !1;
|
|
11
|
-
const s = o instanceof ControlMessage ? i.
|
|
11
|
+
const s = o instanceof ControlMessage ? i.mo : i.Oi;
|
|
12
12
|
return se.m().q(o, s).L;
|
|
13
13
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export default class ControlMessage {
|
|
2
|
-
constructor(t) {
|
|
2
|
+
constructor(t, s) {
|
|
3
3
|
(this.triggerId = t),
|
|
4
|
+
(this.messageExtras = s),
|
|
4
5
|
(this.triggerId = t),
|
|
6
|
+
(this.messageExtras = s),
|
|
5
7
|
(this.extras = {}),
|
|
6
8
|
(this.isControl = !0);
|
|
7
9
|
}
|
|
8
10
|
static fromJson(t) {
|
|
9
|
-
return new ControlMessage(t.trigger_id);
|
|
11
|
+
return new ControlMessage(t.trigger_id, t.message_extras);
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -30,6 +30,7 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
30
30
|
k,
|
|
31
31
|
q,
|
|
32
32
|
A,
|
|
33
|
+
B,
|
|
33
34
|
) {
|
|
34
35
|
(p = p || InAppMessage.DismissType.MANUAL),
|
|
35
36
|
(k = k || InAppMessage.Orientation.PORTRAIT),
|
|
@@ -63,25 +64,30 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
63
64
|
k,
|
|
64
65
|
q,
|
|
65
66
|
A,
|
|
67
|
+
B,
|
|
66
68
|
),
|
|
67
|
-
(this
|
|
69
|
+
(this.De = InAppMessage.TextAlignment.CENTER);
|
|
68
70
|
}
|
|
69
71
|
Y() {
|
|
70
72
|
return super.Y(FullScreenMessage.it);
|
|
71
73
|
}
|
|
72
|
-
static
|
|
74
|
+
static Xr(e) {
|
|
73
75
|
return new FullScreenMessage(
|
|
76
|
+
e[InAppMessage.tt.Vr],
|
|
77
|
+
e[InAppMessage.tt.Wr],
|
|
78
|
+
e[InAppMessage.tt.bt],
|
|
79
|
+
e[InAppMessage.tt.Yr],
|
|
80
|
+
e[InAppMessage.tt.Zr],
|
|
81
|
+
e[InAppMessage.tt.URI],
|
|
74
82
|
e[InAppMessage.tt.ea],
|
|
75
83
|
e[InAppMessage.tt.ra],
|
|
76
|
-
e[InAppMessage.tt.bt],
|
|
77
84
|
e[InAppMessage.tt.sa],
|
|
78
85
|
e[InAppMessage.tt.ta],
|
|
79
|
-
e[InAppMessage.tt.
|
|
86
|
+
e[InAppMessage.tt.ot],
|
|
80
87
|
e[InAppMessage.tt.ia],
|
|
81
88
|
e[InAppMessage.tt.aa],
|
|
82
89
|
e[InAppMessage.tt.oa],
|
|
83
90
|
e[InAppMessage.tt.pa],
|
|
84
|
-
e[InAppMessage.tt.ot],
|
|
85
91
|
e[InAppMessage.tt.ma],
|
|
86
92
|
e[InAppMessage.tt.na],
|
|
87
93
|
e[InAppMessage.tt.ua],
|
|
@@ -90,16 +96,13 @@ export default class FullScreenMessage extends InAppMessage {
|
|
|
90
96
|
e[InAppMessage.tt.da],
|
|
91
97
|
e[InAppMessage.tt.la],
|
|
92
98
|
e[InAppMessage.tt.ga],
|
|
93
|
-
e[InAppMessage.tt.ja],
|
|
99
|
+
pe(e[InAppMessage.tt.ja]),
|
|
94
100
|
e[InAppMessage.tt.xa],
|
|
95
101
|
e[InAppMessage.tt.za],
|
|
96
102
|
e[InAppMessage.tt.ha],
|
|
97
|
-
pe(e[InAppMessage.tt.va]),
|
|
98
|
-
e[InAppMessage.tt.wa],
|
|
99
|
-
e[InAppMessage.tt.ya],
|
|
100
|
-
e[InAppMessage.tt.Sa],
|
|
101
103
|
e[InAppMessage.tt.CSS],
|
|
104
|
+
e[InAppMessage.tt.va],
|
|
102
105
|
);
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
|
-
FullScreenMessage.it = InAppMessage.
|
|
108
|
+
FullScreenMessage.it = InAppMessage.qe.Or;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import InAppMessage from "./in-app-message.js";
|
|
2
2
|
export default class HtmlMessage extends InAppMessage {
|
|
3
|
-
constructor(i, o, e, r, d, t, s, v, n, u, a) {
|
|
3
|
+
constructor(i, o, e, r, d, t, s, v, n, u, a, c) {
|
|
4
4
|
super(
|
|
5
5
|
i,
|
|
6
6
|
void 0,
|
|
@@ -31,6 +31,7 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
31
31
|
void 0,
|
|
32
32
|
n,
|
|
33
33
|
u,
|
|
34
|
+
c,
|
|
34
35
|
),
|
|
35
36
|
(this.messageFields = a),
|
|
36
37
|
(this.messageFields = a);
|
|
@@ -39,7 +40,7 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
39
40
|
return !1;
|
|
40
41
|
}
|
|
41
42
|
p(i) {
|
|
42
|
-
if (this.
|
|
43
|
+
if (this.we === InAppMessage.qe.Hr) {
|
|
43
44
|
if (this.vo) return !1;
|
|
44
45
|
this.vo = !0;
|
|
45
46
|
}
|
|
@@ -49,20 +50,21 @@ export default class HtmlMessage extends InAppMessage {
|
|
|
49
50
|
const i = super.Y(HtmlMessage.it);
|
|
50
51
|
return (i[InAppMessage.tt.uo] = this.messageFields), i;
|
|
51
52
|
}
|
|
52
|
-
static
|
|
53
|
+
static Xr(i) {
|
|
53
54
|
return new HtmlMessage(
|
|
54
|
-
i[InAppMessage.tt.
|
|
55
|
+
i[InAppMessage.tt.Vr],
|
|
55
56
|
i[InAppMessage.tt.bt],
|
|
57
|
+
i[InAppMessage.tt.Yr],
|
|
58
|
+
i[InAppMessage.tt.ra],
|
|
56
59
|
i[InAppMessage.tt.sa],
|
|
57
|
-
i[InAppMessage.tt.
|
|
58
|
-
i[InAppMessage.tt.
|
|
59
|
-
i[InAppMessage.tt.la],
|
|
60
|
+
i[InAppMessage.tt.ua],
|
|
61
|
+
i[InAppMessage.tt.ca],
|
|
60
62
|
i[InAppMessage.tt.ga],
|
|
61
63
|
i[InAppMessage.tt.ha],
|
|
62
|
-
i[InAppMessage.tt.Sa],
|
|
63
64
|
i[InAppMessage.tt.CSS],
|
|
64
65
|
i[InAppMessage.tt.uo],
|
|
66
|
+
i[InAppMessage.tt.va],
|
|
65
67
|
);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
HtmlMessage.it = InAppMessage.
|
|
70
|
+
HtmlMessage.it = InAppMessage.qe.Hr;
|
|
@@ -15,7 +15,7 @@ export default class InAppMessageButton {
|
|
|
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.
|
|
18
|
+
null == n && (n = InAppMessageButton.Ji),
|
|
19
19
|
(this.id = n),
|
|
20
20
|
(this.vo = !1),
|
|
21
21
|
(this.Et = new T());
|
|
@@ -44,4 +44,4 @@ export default class InAppMessageButton {
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
InAppMessageButton.
|
|
47
|
+
InAppMessageButton.Ji = -1;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
clickElement as Et,
|
|
5
5
|
supportsPassive as Tt,
|
|
6
6
|
} from "../../util/dom-utils.js";
|
|
7
|
-
import { KeyCodes as
|
|
7
|
+
import { KeyCodes as lt } from "../../util/key-codes.js";
|
|
8
8
|
import T from "../../managers/subscription-manager.js";
|
|
9
9
|
import { isIFrame as It } from "../utils/in-app-message-utils.js";
|
|
10
10
|
export default class InAppMessage {
|
|
@@ -23,21 +23,22 @@ export default class InAppMessage {
|
|
|
23
23
|
a,
|
|
24
24
|
I,
|
|
25
25
|
c,
|
|
26
|
-
O,
|
|
27
26
|
A,
|
|
28
|
-
|
|
27
|
+
O,
|
|
29
28
|
_,
|
|
30
29
|
m,
|
|
30
|
+
L,
|
|
31
31
|
N,
|
|
32
|
-
R,
|
|
33
32
|
S,
|
|
34
|
-
|
|
33
|
+
R,
|
|
35
34
|
M,
|
|
35
|
+
D,
|
|
36
36
|
C,
|
|
37
37
|
d,
|
|
38
38
|
U,
|
|
39
39
|
b,
|
|
40
40
|
P,
|
|
41
|
+
p,
|
|
41
42
|
) {
|
|
42
43
|
(this.message = t),
|
|
43
44
|
(this.messageAlignment = s),
|
|
@@ -53,21 +54,22 @@ export default class InAppMessage {
|
|
|
53
54
|
(this.imageUrl = a),
|
|
54
55
|
(this.imageStyle = I),
|
|
55
56
|
(this.iconColor = c),
|
|
56
|
-
(this.iconBackgroundColor =
|
|
57
|
-
(this.backgroundColor =
|
|
58
|
-
(this.textColor =
|
|
59
|
-
(this.closeButtonColor =
|
|
60
|
-
(this.animateIn =
|
|
57
|
+
(this.iconBackgroundColor = A),
|
|
58
|
+
(this.backgroundColor = O),
|
|
59
|
+
(this.textColor = _),
|
|
60
|
+
(this.closeButtonColor = m),
|
|
61
|
+
(this.animateIn = L),
|
|
61
62
|
(this.animateOut = N),
|
|
62
|
-
(this.header =
|
|
63
|
-
(this.headerAlignment =
|
|
64
|
-
(this.headerTextColor =
|
|
65
|
-
(this.frameColor =
|
|
63
|
+
(this.header = S),
|
|
64
|
+
(this.headerAlignment = R),
|
|
65
|
+
(this.headerTextColor = M),
|
|
66
|
+
(this.frameColor = D),
|
|
66
67
|
(this.buttons = C),
|
|
67
68
|
(this.cropType = d),
|
|
68
69
|
(this.orientation = U),
|
|
69
70
|
(this.htmlId = b),
|
|
70
71
|
(this.css = P),
|
|
72
|
+
(this.messageExtras = p),
|
|
71
73
|
(this.message = t),
|
|
72
74
|
(this.messageAlignment = s || InAppMessage.TextAlignment.CENTER),
|
|
73
75
|
(this.duration = l || 5e3),
|
|
@@ -82,33 +84,34 @@ export default class InAppMessage {
|
|
|
82
84
|
(this.imageUrl = a),
|
|
83
85
|
(this.imageStyle = I || InAppMessage.ImageStyle.TOP),
|
|
84
86
|
(this.iconColor = c || InAppMessage.th.ih),
|
|
85
|
-
(this.iconBackgroundColor =
|
|
86
|
-
(this.backgroundColor =
|
|
87
|
-
(this.textColor =
|
|
88
|
-
(this.closeButtonColor =
|
|
89
|
-
(this.animateIn =
|
|
87
|
+
(this.iconBackgroundColor = A || InAppMessage.th.sh),
|
|
88
|
+
(this.backgroundColor = O || InAppMessage.th.ih),
|
|
89
|
+
(this.textColor = _ || InAppMessage.th.hh),
|
|
90
|
+
(this.closeButtonColor = m || InAppMessage.th.eh),
|
|
91
|
+
(this.animateIn = L),
|
|
90
92
|
null == this.animateIn && (this.animateIn = !0),
|
|
91
93
|
(this.animateOut = N),
|
|
92
94
|
null == this.animateOut && (this.animateOut = !0),
|
|
93
|
-
(this.header =
|
|
94
|
-
(this.headerAlignment =
|
|
95
|
-
(this.headerTextColor =
|
|
96
|
-
(this.frameColor =
|
|
95
|
+
(this.header = S),
|
|
96
|
+
(this.headerAlignment = R || InAppMessage.TextAlignment.CENTER),
|
|
97
|
+
(this.headerTextColor = M || InAppMessage.th.hh),
|
|
98
|
+
(this.frameColor = D || InAppMessage.th.Eh),
|
|
97
99
|
(this.buttons = C || []),
|
|
98
100
|
(this.cropType = d || InAppMessage.CropType.FIT_CENTER),
|
|
99
101
|
(this.orientation = U),
|
|
100
102
|
(this.htmlId = b),
|
|
101
103
|
(this.css = P),
|
|
102
104
|
(this.isControl = !1),
|
|
105
|
+
(this.messageExtras = p),
|
|
103
106
|
(this.nh = !1),
|
|
104
107
|
(this.Th = !1),
|
|
105
108
|
(this.vo = !1),
|
|
106
109
|
(this.oh = !1),
|
|
107
|
-
(this.
|
|
108
|
-
(this.
|
|
110
|
+
(this.Me = null),
|
|
111
|
+
(this.ke = null),
|
|
109
112
|
(this.Et = new T()),
|
|
110
113
|
(this.rh = new T()),
|
|
111
|
-
(this
|
|
114
|
+
(this.De = InAppMessage.TextAlignment.CENTER);
|
|
112
115
|
}
|
|
113
116
|
subscribeToClickedEvent(t) {
|
|
114
117
|
return this.Et.It(t);
|
|
@@ -123,27 +126,27 @@ export default class InAppMessage {
|
|
|
123
126
|
this.Et.removeAllSubscriptions(), this.rh.removeAllSubscriptions();
|
|
124
127
|
}
|
|
125
128
|
closeMessage() {
|
|
126
|
-
this.
|
|
129
|
+
this.Ae(this.Me);
|
|
127
130
|
}
|
|
128
|
-
|
|
131
|
+
ze() {
|
|
129
132
|
return !0;
|
|
130
133
|
}
|
|
131
134
|
do() {
|
|
132
|
-
return this.
|
|
135
|
+
return this.ze();
|
|
133
136
|
}
|
|
134
|
-
|
|
137
|
+
xe() {
|
|
135
138
|
return null != this.htmlId && this.htmlId.length > 4;
|
|
136
139
|
}
|
|
137
|
-
|
|
138
|
-
return this.
|
|
140
|
+
Ce() {
|
|
141
|
+
return this.xe() && null != this.css && this.css.length > 0;
|
|
139
142
|
}
|
|
140
|
-
|
|
141
|
-
if (this.
|
|
143
|
+
ve() {
|
|
144
|
+
if (this.xe() && this.Ce()) return this.htmlId + "-css";
|
|
142
145
|
}
|
|
143
146
|
K() {
|
|
144
147
|
return !this.Th && ((this.Th = !0), !0);
|
|
145
148
|
}
|
|
146
|
-
|
|
149
|
+
Ur() {
|
|
147
150
|
return this.Th;
|
|
148
151
|
}
|
|
149
152
|
p(t) {
|
|
@@ -155,7 +158,7 @@ export default class InAppMessage {
|
|
|
155
158
|
hide(t) {
|
|
156
159
|
if (t && t.parentNode) {
|
|
157
160
|
let s = t.closest(".ab-iam-root");
|
|
158
|
-
if ((null == s && (s = t), this.
|
|
161
|
+
if ((null == s && (s = t), this.ze() && null != s.parentNode)) {
|
|
159
162
|
const t = s.parentNode.classList;
|
|
160
163
|
t && t.contains(InAppMessage.lh) && t.remove(InAppMessage.lh),
|
|
161
164
|
document.body.removeEventListener("touchmove", InAppMessage.uh);
|
|
@@ -164,10 +167,10 @@ export default class InAppMessage {
|
|
|
164
167
|
}
|
|
165
168
|
return this.animateOut || !1;
|
|
166
169
|
}
|
|
167
|
-
|
|
170
|
+
Ae(t, s) {
|
|
168
171
|
if (null == t) return;
|
|
169
172
|
let i;
|
|
170
|
-
(this.
|
|
173
|
+
(this.Me = null),
|
|
171
174
|
(i =
|
|
172
175
|
-1 === t.className.indexOf("ab-in-app-message")
|
|
173
176
|
? t.getElementsByClassName("ab-in-app-message")[0]
|
|
@@ -182,7 +185,7 @@ export default class InAppMessage {
|
|
|
182
185
|
let s = t.closest(".ab-iam-root");
|
|
183
186
|
null == s && (s = t), s.parentNode && s.parentNode.removeChild(s);
|
|
184
187
|
}
|
|
185
|
-
const i = this.
|
|
188
|
+
const i = this.ve();
|
|
186
189
|
if (null != i) {
|
|
187
190
|
const t = document.getElementById(i);
|
|
188
191
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
@@ -190,14 +193,14 @@ export default class InAppMessage {
|
|
|
190
193
|
null != e && "Safari" === X.browser && (e.scrollTop = E),
|
|
191
194
|
s ? s() : this.N();
|
|
192
195
|
};
|
|
193
|
-
h ? setTimeout(n, InAppMessage.
|
|
196
|
+
h ? setTimeout(n, InAppMessage.Ah) : n(), this.ke && this.ke.focus();
|
|
194
197
|
}
|
|
195
|
-
|
|
198
|
+
Je() {
|
|
196
199
|
return document.createTextNode(this.message || "");
|
|
197
200
|
}
|
|
198
|
-
|
|
201
|
+
Ge(t) {
|
|
199
202
|
let s = "";
|
|
200
|
-
this.message || this.header || !this.
|
|
203
|
+
this.message || this.header || !this.ze() || (s = "Modal Image"),
|
|
201
204
|
t.setAttribute("alt", s);
|
|
202
205
|
}
|
|
203
206
|
static uh(t) {
|
|
@@ -207,11 +210,13 @@ export default class InAppMessage {
|
|
|
207
210
|
s.classList &&
|
|
208
211
|
s.classList.contains("ab-message-text") &&
|
|
209
212
|
s.scrollHeight > s.clientHeight) ||
|
|
210
|
-
(document.querySelector(`.${InAppMessage.lh}`) &&
|
|
213
|
+
(document.querySelector(`.${InAppMessage.lh}`) &&
|
|
214
|
+
t.cancelable &&
|
|
215
|
+
t.preventDefault());
|
|
211
216
|
}
|
|
212
|
-
|
|
217
|
+
Oh(t) {
|
|
213
218
|
const s = t.parentNode;
|
|
214
|
-
this.
|
|
219
|
+
this.ze() &&
|
|
215
220
|
null != s &&
|
|
216
221
|
this.orientation !== InAppMessage.Orientation.LANDSCAPE &&
|
|
217
222
|
(null != s.classList && s.classList.add(InAppMessage.lh),
|
|
@@ -222,10 +227,10 @@ export default class InAppMessage {
|
|
|
222
227
|
)),
|
|
223
228
|
(t.className += " " + InAppMessage.ah);
|
|
224
229
|
}
|
|
225
|
-
static
|
|
230
|
+
static _h(t) {
|
|
226
231
|
if (
|
|
227
|
-
t.keyCode ===
|
|
228
|
-
!e.nn(L.
|
|
232
|
+
t.keyCode === lt.mh &&
|
|
233
|
+
!e.nn(L.Lh) &&
|
|
229
234
|
document.querySelectorAll(".ab-modal-interactions").length > 0
|
|
230
235
|
) {
|
|
231
236
|
const t = document.getElementsByClassName("ab-html-message");
|
|
@@ -249,46 +254,47 @@ export default class InAppMessage {
|
|
|
249
254
|
}
|
|
250
255
|
Nh() {
|
|
251
256
|
this.nh ||
|
|
252
|
-
e.nn(L.
|
|
253
|
-
(document.addEventListener("keydown", InAppMessage.
|
|
254
|
-
e.
|
|
255
|
-
document.removeEventListener("keydown", InAppMessage.
|
|
257
|
+
e.nn(L.Lh) ||
|
|
258
|
+
(document.addEventListener("keydown", InAppMessage._h, !1),
|
|
259
|
+
e.Sh(() => {
|
|
260
|
+
document.removeEventListener("keydown", InAppMessage._h);
|
|
256
261
|
}),
|
|
257
262
|
(this.nh = !0));
|
|
258
263
|
}
|
|
259
264
|
Y(t) {
|
|
260
265
|
const s = {};
|
|
261
266
|
return t
|
|
262
|
-
? ((s[InAppMessage.tt.
|
|
263
|
-
(s[InAppMessage.tt.
|
|
264
|
-
(s[InAppMessage.tt.
|
|
267
|
+
? ((s[InAppMessage.tt.Vr] = this.message),
|
|
268
|
+
(s[InAppMessage.tt.Wr] = this.messageAlignment),
|
|
269
|
+
(s[InAppMessage.tt.Rh] = this.slideFrom),
|
|
265
270
|
(s[InAppMessage.tt.bt] = this.extras),
|
|
266
|
-
(s[InAppMessage.tt.
|
|
267
|
-
(s[InAppMessage.tt.
|
|
271
|
+
(s[InAppMessage.tt.Yr] = this.triggerId),
|
|
272
|
+
(s[InAppMessage.tt.Zr] = this.clickAction),
|
|
268
273
|
(s[InAppMessage.tt.URI] = this.uri),
|
|
269
|
-
(s[InAppMessage.tt.
|
|
270
|
-
(s[InAppMessage.tt.
|
|
271
|
-
(s[InAppMessage.tt.
|
|
272
|
-
(s[InAppMessage.tt.
|
|
274
|
+
(s[InAppMessage.tt.ea] = this.openTarget),
|
|
275
|
+
(s[InAppMessage.tt.ra] = this.dismissType),
|
|
276
|
+
(s[InAppMessage.tt.sa] = this.duration),
|
|
277
|
+
(s[InAppMessage.tt.ta] = this.icon),
|
|
273
278
|
(s[InAppMessage.tt.ot] = this.imageUrl),
|
|
274
|
-
(s[InAppMessage.tt.
|
|
275
|
-
(s[InAppMessage.tt.
|
|
276
|
-
(s[InAppMessage.tt.
|
|
277
|
-
(s[InAppMessage.tt.
|
|
278
|
-
(s[InAppMessage.tt.
|
|
279
|
-
(s[InAppMessage.tt.
|
|
280
|
-
(s[InAppMessage.tt.
|
|
281
|
-
(s[InAppMessage.tt.
|
|
282
|
-
(s[InAppMessage.tt.
|
|
283
|
-
(s[InAppMessage.tt.
|
|
284
|
-
(s[InAppMessage.tt.
|
|
285
|
-
(s[InAppMessage.tt.
|
|
286
|
-
(s[InAppMessage.tt.
|
|
287
|
-
(s[InAppMessage.tt.
|
|
288
|
-
(s[InAppMessage.tt.
|
|
289
|
-
(s[InAppMessage.tt.
|
|
279
|
+
(s[InAppMessage.tt.ia] = this.imageStyle),
|
|
280
|
+
(s[InAppMessage.tt.aa] = this.iconColor),
|
|
281
|
+
(s[InAppMessage.tt.oa] = this.iconBackgroundColor),
|
|
282
|
+
(s[InAppMessage.tt.pa] = this.backgroundColor),
|
|
283
|
+
(s[InAppMessage.tt.ma] = this.textColor),
|
|
284
|
+
(s[InAppMessage.tt.na] = this.closeButtonColor),
|
|
285
|
+
(s[InAppMessage.tt.ua] = this.animateIn),
|
|
286
|
+
(s[InAppMessage.tt.ca] = this.animateOut),
|
|
287
|
+
(s[InAppMessage.tt.fa] = this.header),
|
|
288
|
+
(s[InAppMessage.tt.da] = this.headerAlignment),
|
|
289
|
+
(s[InAppMessage.tt.la] = this.headerTextColor),
|
|
290
|
+
(s[InAppMessage.tt.ga] = this.frameColor),
|
|
291
|
+
(s[InAppMessage.tt.ja] = this.buttons),
|
|
292
|
+
(s[InAppMessage.tt.xa] = this.cropType),
|
|
293
|
+
(s[InAppMessage.tt.za] = this.orientation),
|
|
294
|
+
(s[InAppMessage.tt.ha] = this.htmlId),
|
|
290
295
|
(s[InAppMessage.tt.CSS] = this.css),
|
|
291
296
|
(s[InAppMessage.tt.Z] = t),
|
|
297
|
+
(s[InAppMessage.tt.va] = this.messageExtras),
|
|
292
298
|
s)
|
|
293
299
|
: s;
|
|
294
300
|
}
|
|
@@ -297,19 +303,19 @@ export default class InAppMessage {
|
|
|
297
303
|
hh: 4281545523,
|
|
298
304
|
ih: 4294967295,
|
|
299
305
|
sh: 4278219733,
|
|
300
|
-
|
|
301
|
-
|
|
306
|
+
Mh: 4293914607,
|
|
307
|
+
Dh: 4283782485,
|
|
302
308
|
Eh: 3224580915,
|
|
303
309
|
eh: 4288387995,
|
|
304
310
|
}),
|
|
305
|
-
(InAppMessage.
|
|
311
|
+
(InAppMessage.Be = {
|
|
306
312
|
Ch: "hd",
|
|
307
|
-
|
|
313
|
+
Le: "ias",
|
|
308
314
|
dh: "of",
|
|
309
315
|
Uh: "do",
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
316
|
+
bh: "umt",
|
|
317
|
+
Ph: "tf",
|
|
318
|
+
ph: "te",
|
|
313
319
|
}),
|
|
314
320
|
(InAppMessage.SlideFrom = { TOP: "TOP", BOTTOM: "BOTTOM" }),
|
|
315
321
|
(InAppMessage.ClickAction = {
|
|
@@ -333,50 +339,51 @@ export default class InAppMessage {
|
|
|
333
339
|
CENTER_CROP: "CENTER_CROP",
|
|
334
340
|
FIT_CENTER: "FIT_CENTER",
|
|
335
341
|
}),
|
|
336
|
-
(InAppMessage.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
(InAppMessage.qe = {
|
|
343
|
+
Kr: "SLIDEUP",
|
|
344
|
+
Jr: "MODAL",
|
|
345
|
+
Ve: "MODAL_STYLED",
|
|
346
|
+
Or: "FULL",
|
|
347
|
+
Hr: "WEB_HTML",
|
|
348
|
+
$e: "HTML",
|
|
349
|
+
We: "HTML_FULL",
|
|
344
350
|
}),
|
|
345
|
-
(InAppMessage.
|
|
346
|
-
(InAppMessage.
|
|
351
|
+
(InAppMessage.Ah = 500),
|
|
352
|
+
(InAppMessage.fh = 200),
|
|
347
353
|
(InAppMessage.ah = "ab-show"),
|
|
348
354
|
(InAppMessage.Ih = "ab-hide"),
|
|
349
355
|
(InAppMessage.lh = "ab-pause-scrolling"),
|
|
350
356
|
(InAppMessage.tt = {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
357
|
+
Vr: "m",
|
|
358
|
+
Wr: "ma",
|
|
359
|
+
Rh: "sf",
|
|
354
360
|
bt: "e",
|
|
355
|
-
|
|
356
|
-
|
|
361
|
+
Yr: "ti",
|
|
362
|
+
Zr: "ca",
|
|
357
363
|
URI: "u",
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
364
|
+
ea: "oa",
|
|
365
|
+
ra: "dt",
|
|
366
|
+
sa: "d",
|
|
367
|
+
ta: "i",
|
|
362
368
|
ot: "iu",
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
369
|
+
ia: "is",
|
|
370
|
+
aa: "ic",
|
|
371
|
+
oa: "ibc",
|
|
372
|
+
pa: "bc",
|
|
373
|
+
ma: "tc",
|
|
374
|
+
na: "cbc",
|
|
375
|
+
ua: "ai",
|
|
376
|
+
ca: "ao",
|
|
377
|
+
fa: "h",
|
|
378
|
+
da: "ha",
|
|
379
|
+
la: "htc",
|
|
380
|
+
ga: "fc",
|
|
381
|
+
ja: "b",
|
|
382
|
+
xa: "ct",
|
|
383
|
+
za: "o",
|
|
384
|
+
ha: "hi",
|
|
379
385
|
CSS: "css",
|
|
380
386
|
Z: "type",
|
|
381
387
|
uo: "messageFields",
|
|
388
|
+
va: "me",
|
|
382
389
|
});
|
|
@@ -29,6 +29,7 @@ export default class ModalMessage extends InAppMessage {
|
|
|
29
29
|
b,
|
|
30
30
|
k,
|
|
31
31
|
q,
|
|
32
|
+
A,
|
|
32
33
|
) {
|
|
33
34
|
super(
|
|
34
35
|
e,
|
|
@@ -60,25 +61,30 @@ export default class ModalMessage extends InAppMessage {
|
|
|
60
61
|
void 0,
|
|
61
62
|
k,
|
|
62
63
|
q,
|
|
64
|
+
A,
|
|
63
65
|
),
|
|
64
|
-
(this
|
|
66
|
+
(this.De = InAppMessage.TextAlignment.CENTER);
|
|
65
67
|
}
|
|
66
68
|
Y() {
|
|
67
69
|
return super.Y(ModalMessage.it);
|
|
68
70
|
}
|
|
69
|
-
static
|
|
71
|
+
static Xr(e) {
|
|
70
72
|
return new ModalMessage(
|
|
73
|
+
e[InAppMessage.tt.Vr],
|
|
74
|
+
e[InAppMessage.tt.Wr],
|
|
75
|
+
e[InAppMessage.tt.bt],
|
|
76
|
+
e[InAppMessage.tt.Yr],
|
|
77
|
+
e[InAppMessage.tt.Zr],
|
|
78
|
+
e[InAppMessage.tt.URI],
|
|
71
79
|
e[InAppMessage.tt.ea],
|
|
72
80
|
e[InAppMessage.tt.ra],
|
|
73
|
-
e[InAppMessage.tt.bt],
|
|
74
81
|
e[InAppMessage.tt.sa],
|
|
75
82
|
e[InAppMessage.tt.ta],
|
|
76
|
-
e[InAppMessage.tt.
|
|
83
|
+
e[InAppMessage.tt.ot],
|
|
77
84
|
e[InAppMessage.tt.ia],
|
|
78
85
|
e[InAppMessage.tt.aa],
|
|
79
86
|
e[InAppMessage.tt.oa],
|
|
80
87
|
e[InAppMessage.tt.pa],
|
|
81
|
-
e[InAppMessage.tt.ot],
|
|
82
88
|
e[InAppMessage.tt.ma],
|
|
83
89
|
e[InAppMessage.tt.na],
|
|
84
90
|
e[InAppMessage.tt.ua],
|
|
@@ -87,15 +93,12 @@ export default class ModalMessage extends InAppMessage {
|
|
|
87
93
|
e[InAppMessage.tt.da],
|
|
88
94
|
e[InAppMessage.tt.la],
|
|
89
95
|
e[InAppMessage.tt.ga],
|
|
90
|
-
e[InAppMessage.tt.ja],
|
|
96
|
+
pe(e[InAppMessage.tt.ja]),
|
|
91
97
|
e[InAppMessage.tt.xa],
|
|
92
|
-
e[InAppMessage.tt.za],
|
|
93
98
|
e[InAppMessage.tt.ha],
|
|
94
|
-
pe(e[InAppMessage.tt.va]),
|
|
95
|
-
e[InAppMessage.tt.wa],
|
|
96
|
-
e[InAppMessage.tt.Sa],
|
|
97
99
|
e[InAppMessage.tt.CSS],
|
|
100
|
+
e[InAppMessage.tt.va],
|
|
98
101
|
);
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
|
-
ModalMessage.it = InAppMessage.
|
|
104
|
+
ModalMessage.it = InAppMessage.qe.Jr;
|