@braze/web-sdk 6.10.2 → 6.11.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 +28 -4
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +3 -3
- package/shared-lib/event-types.js +10 -10
- package/shared-lib/indexed-db-adapter.js +51 -51
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +9 -9
- package/src/Core/logout.js +2 -2
- package/src/InAppMessage/constants.js +39 -47
- package/src/InAppMessage/display/html-message-to-html.js +1 -1
- package/src/InAppMessage/display/in-app-message-to-html.js +38 -36
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +89 -68
- 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 +22 -22
- package/src/InAppMessage/models/html-message.js +13 -13
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +68 -66
- package/src/InAppMessage/models/modal-message.js +20 -20
- package/src/InAppMessage/models/slide-up-message.js +25 -25
- package/src/InAppMessage/models/templated-in-app-message.js +6 -6
- 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 +27 -25
- package/src/Push/index.js +1 -0
- package/src/Push/push-manager-factory.js +4 -4
- package/src/Push/push-manager.js +222 -179
- package/src/Push/register-push.js +9 -0
- package/src/Push/unregister-push-token-on-server.js +4 -4
- package/src/Push/utils/push-utils.js +8 -8
- package/src/User/user-manager.js +19 -19
- package/src/User/user.js +35 -35
- package/src/common/constants.js +1 -1
- package/src/common/content-cards-display.js +5 -5
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/braze-instance.js +42 -38
- package/src/managers/device-manager.js +20 -20
- package/src/managers/network-manager.js +122 -122
- package/src/managers/server-config-manager.js +76 -76
- package/src/managers/session-manager.js +8 -8
- package/src/managers/storage-manager.js +127 -127
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +2 -2
- package/src/models/device.js +3 -3
- package/src/models/identifier.js +6 -6
- package/src/models/push-token.js +6 -6
- package/src/models/server-config.js +24 -24
- package/src/request-controller.js +85 -85
- package/src/triggers/models/trigger-condition.js +27 -27
- package/src/triggers/models/trigger.js +2 -2
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +37 -29
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/dom-utils.js +2 -2
- package/src/util/ecommerce-event-validation.js +1 -1
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +3 -3
- package/src/util/request-header-utils.js +15 -15
- package/src/util/user-agent-parser.js +4 -4
- package/src/util/validation-utils.js +5 -5
- package/src/util/window-utils.js +2 -2
|
@@ -13,31 +13,31 @@ export default class Yt {
|
|
|
13
13
|
constructor(t) {
|
|
14
14
|
(this.j = t),
|
|
15
15
|
(this.j = t),
|
|
16
|
-
(this._l = new f()),
|
|
17
16
|
(this.Vl = new f()),
|
|
18
|
-
(this.Jl = new f()),
|
|
19
17
|
(this.Ql = new f()),
|
|
20
|
-
(this.
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
(this.Zl = new f()),
|
|
19
|
+
(this.ed = new f()),
|
|
20
|
+
(this.sd = new f()),
|
|
21
|
+
(this.nd = new f()),
|
|
22
|
+
(this.ld = null),
|
|
23
|
+
(this.ud = null);
|
|
24
|
+
}
|
|
25
|
+
ad() {
|
|
26
|
+
if (null == this.ud) {
|
|
27
|
+
const t = this.j.St(s.It.hd);
|
|
28
|
+
this.ud = null != t ? di._u(t) : new di();
|
|
29
29
|
}
|
|
30
|
-
return this.
|
|
30
|
+
return this.ud;
|
|
31
31
|
}
|
|
32
32
|
Qt() {
|
|
33
|
-
return this.
|
|
33
|
+
return this.ad().dd;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
vd(t) {
|
|
36
36
|
var i, e, n, l, r, o;
|
|
37
37
|
if (null != t && null != t.config) {
|
|
38
38
|
const u = t.config;
|
|
39
|
-
if (u.time > this.
|
|
40
|
-
const t = (t) => (null == t ? this.
|
|
39
|
+
if (u.time > this.ad().dd) {
|
|
40
|
+
const t = (t) => (null == t ? this.ad().md : t),
|
|
41
41
|
a = new di(
|
|
42
42
|
u.time,
|
|
43
43
|
u.events_blacklist,
|
|
@@ -55,9 +55,9 @@ export default class Yt {
|
|
|
55
55
|
u.conversational_chat,
|
|
56
56
|
);
|
|
57
57
|
let h = !1;
|
|
58
|
-
null != a.
|
|
58
|
+
null != a.gd && this.Wu() !== a.gd && (h = !0);
|
|
59
59
|
let d = !1;
|
|
60
|
-
null != a.
|
|
60
|
+
null != a.bd.enabled && this.Pi() !== a.bd.enabled && (d = !0);
|
|
61
61
|
let c = !1;
|
|
62
62
|
null != a.Xr.enabled && this.lo() !== a.Xr.enabled && (c = !0);
|
|
63
63
|
let v = !1;
|
|
@@ -72,105 +72,105 @@ export default class Yt {
|
|
|
72
72
|
(null === (l = a.dust) || void 0 === l ? void 0 : l.enabled) &&
|
|
73
73
|
(m = !0);
|
|
74
74
|
let g = !1;
|
|
75
|
-
null != (null === (r = a.
|
|
76
|
-
this.
|
|
77
|
-
(null === (o = a.
|
|
75
|
+
null != (null === (r = a.fd) || void 0 === r ? void 0 : r.enabled) &&
|
|
76
|
+
this.pd() !==
|
|
77
|
+
(null === (o = a.fd) || void 0 === o ? void 0 : o.enabled) &&
|
|
78
78
|
(g = !0),
|
|
79
|
-
(this.
|
|
80
|
-
this.j.Pt(s.It.
|
|
81
|
-
h && this.
|
|
82
|
-
d && this.
|
|
83
|
-
c && this.
|
|
84
|
-
v && this.
|
|
85
|
-
m && this.
|
|
86
|
-
g && this.
|
|
79
|
+
(this.ud = a),
|
|
80
|
+
this.j.Pt(s.It.hd, a.qt()),
|
|
81
|
+
h && this.Vl.A(),
|
|
82
|
+
d && this.Ql.A(),
|
|
83
|
+
c && this.Zl.A(),
|
|
84
|
+
v && this.ed.A(),
|
|
85
|
+
m && this.sd.A(),
|
|
86
|
+
g && this.nd.A();
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
const i = this.
|
|
92
|
-
return this.
|
|
90
|
+
ju(t) {
|
|
91
|
+
const i = this.Vl.Ut(t);
|
|
92
|
+
return this.ld && this.Vl.removeSubscription(this.ld), (this.ld = i), i;
|
|
93
93
|
}
|
|
94
94
|
$i(t) {
|
|
95
|
-
return this.
|
|
95
|
+
return this.Ql.Ut(t);
|
|
96
96
|
}
|
|
97
97
|
bo(t) {
|
|
98
|
-
return this.
|
|
98
|
+
return this.Zl.Ut(t);
|
|
99
99
|
}
|
|
100
100
|
V(t) {
|
|
101
|
-
return this.
|
|
101
|
+
return this.ed.Ut(t);
|
|
102
102
|
}
|
|
103
103
|
Tr(t) {
|
|
104
|
-
return this.
|
|
104
|
+
return this.sd.Ut(t);
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
return this.
|
|
106
|
+
Rd(t) {
|
|
107
|
+
return this.nd.Ut(t);
|
|
108
108
|
}
|
|
109
109
|
$e(t) {
|
|
110
|
-
return -1 !== this.
|
|
110
|
+
return -1 !== this.ad().Cd.indexOf(t);
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
return -1 !== this.
|
|
112
|
+
zu(t) {
|
|
113
|
+
return -1 !== this.ad().Ed.indexOf(t);
|
|
114
114
|
}
|
|
115
115
|
$r(t) {
|
|
116
|
-
return -1 !== this.
|
|
116
|
+
return -1 !== this.ad().wd.indexOf(t);
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
return this.
|
|
118
|
+
Bd() {
|
|
119
|
+
return this.ad().Td;
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
return this.
|
|
121
|
+
Wu() {
|
|
122
|
+
return this.ad().gd;
|
|
123
123
|
}
|
|
124
124
|
Pi() {
|
|
125
|
-
return this.
|
|
125
|
+
return this.ad().bd.enabled || !1;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
const t = this.
|
|
127
|
+
yd() {
|
|
128
|
+
const t = this.ad().md;
|
|
129
129
|
return !(!t || null == t.enabled) && t.enabled;
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
if (!this.
|
|
133
|
-
const t = this.
|
|
131
|
+
_l() {
|
|
132
|
+
if (!this.yd()) return -1;
|
|
133
|
+
const t = this.ad().md;
|
|
134
134
|
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
if (!this.
|
|
138
|
-
const t = this.
|
|
136
|
+
Wl() {
|
|
137
|
+
if (!this.yd()) return -1;
|
|
138
|
+
const t = this.ad().md;
|
|
139
139
|
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
const i = this.
|
|
141
|
+
Md(t) {
|
|
142
|
+
const i = this.ad().md.endpoint_overrides;
|
|
143
143
|
return null == i ? null : i[t];
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
const i = this.
|
|
145
|
+
Yl(t) {
|
|
146
|
+
const i = this.Md(t);
|
|
147
147
|
return null == i || isNaN(i.capacity) || i.capacity <= 0 ? -1 : i.capacity;
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
const i = this.
|
|
149
|
+
Jl(t) {
|
|
150
|
+
const i = this.Md(t);
|
|
151
151
|
return null == i || isNaN(i.refill_rate) || i.refill_rate <= 0
|
|
152
152
|
? -1
|
|
153
153
|
: i.refill_rate;
|
|
154
154
|
}
|
|
155
155
|
lo() {
|
|
156
|
-
return this.
|
|
157
|
-
? (v.Dt(p.
|
|
158
|
-
: this.
|
|
156
|
+
return this.ad().Xr.enabled && null == this.Ro()
|
|
157
|
+
? (v.Dt(p.fl, { e: "Missing feature flag refresh_rate_limit." }), !1)
|
|
158
|
+
: this.ad().Xr.enabled || !1;
|
|
159
159
|
}
|
|
160
160
|
Ro() {
|
|
161
|
-
return this.
|
|
161
|
+
return this.ad().Xr.refresh_rate_limit;
|
|
162
162
|
}
|
|
163
163
|
Ot() {
|
|
164
164
|
var t;
|
|
165
165
|
return (
|
|
166
|
-
(null === (t = this.
|
|
166
|
+
(null === (t = this.ad().banners) || void 0 === t ? void 0 : t.enabled) ||
|
|
167
167
|
null
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
re() {
|
|
171
171
|
var t;
|
|
172
172
|
return (
|
|
173
|
-
(null === (t = this.
|
|
173
|
+
(null === (t = this.ad().banners) || void 0 === t
|
|
174
174
|
? void 0
|
|
175
175
|
: t.max_placements) || 0
|
|
176
176
|
);
|
|
@@ -178,7 +178,7 @@ export default class Yt {
|
|
|
178
178
|
Gt() {
|
|
179
179
|
var t;
|
|
180
180
|
const i =
|
|
181
|
-
null === (t = this.
|
|
181
|
+
null === (t = this.ad().banners) || void 0 === t
|
|
182
182
|
? void 0
|
|
183
183
|
: t.dismissals_cache_size;
|
|
184
184
|
return null != i && "number" == typeof i && i > 0 ? i : u;
|
|
@@ -186,19 +186,19 @@ export default class Yt {
|
|
|
186
186
|
fn() {
|
|
187
187
|
var t;
|
|
188
188
|
return (
|
|
189
|
-
(null === (t = this.
|
|
189
|
+
(null === (t = this.ad().dust) || void 0 === t ? void 0 : t.enabled) || !1
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
pd() {
|
|
193
193
|
var t;
|
|
194
194
|
return (
|
|
195
|
-
(null === (t = this.
|
|
195
|
+
(null === (t = this.ad().fd) || void 0 === t ? void 0 : t.enabled) || !1
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
198
|
vt() {
|
|
199
199
|
var t;
|
|
200
200
|
const i =
|
|
201
|
-
null === (t = this.
|
|
201
|
+
null === (t = this.ad().Sd) || void 0 === t
|
|
202
202
|
? void 0
|
|
203
203
|
: t.min_sleep_duration_ms;
|
|
204
204
|
return null != i ? i : d;
|
|
@@ -206,18 +206,18 @@ export default class Yt {
|
|
|
206
206
|
gt() {
|
|
207
207
|
var t;
|
|
208
208
|
const i =
|
|
209
|
-
null === (t = this.
|
|
209
|
+
null === (t = this.ad().Sd) || void 0 === t ? void 0 : t.scale_factor;
|
|
210
210
|
return null != i ? i : m;
|
|
211
211
|
}
|
|
212
212
|
bt() {
|
|
213
213
|
var t;
|
|
214
214
|
const i =
|
|
215
|
-
null === (t = this.
|
|
215
|
+
null === (t = this.ad().Sd) || void 0 === t
|
|
216
216
|
? void 0
|
|
217
217
|
: t.max_sleep_duration_ms;
|
|
218
218
|
return null != i ? i : c;
|
|
219
219
|
}
|
|
220
|
-
|
|
221
|
-
return this.
|
|
220
|
+
Fd() {
|
|
221
|
+
return this.ad().Ld;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -17,7 +17,7 @@ export default class Xt {
|
|
|
17
17
|
(this.j = s),
|
|
18
18
|
(this.Ss = t),
|
|
19
19
|
(this.h = i);
|
|
20
|
-
const n = this.h.
|
|
20
|
+
const n = this.h.Fd();
|
|
21
21
|
(this.im = n ? 1e3 * n : ts),
|
|
22
22
|
(null == e || isNaN(e)) && (e = 1800),
|
|
23
23
|
e < this.im / 1e3 &&
|
|
@@ -31,18 +31,18 @@ export default class Xt {
|
|
|
31
31
|
(this.tm = Math.max(e, this.im / 1e3));
|
|
32
32
|
}
|
|
33
33
|
nm(s, t) {
|
|
34
|
-
return new Ie(this.Ss.getUserId(), p.hm, s, t.
|
|
34
|
+
return new Ie(this.Ss.getUserId(), p.hm, s, t.Iu, { d: X(s - t.lm) });
|
|
35
35
|
}
|
|
36
36
|
al() {
|
|
37
37
|
return this.j.$u(s.Ou.um);
|
|
38
38
|
}
|
|
39
39
|
$t() {
|
|
40
40
|
const t = this.j.$u(s.Ou.um);
|
|
41
|
-
return null == t ? null : t.
|
|
41
|
+
return null == t ? null : t.Iu;
|
|
42
42
|
}
|
|
43
43
|
am() {
|
|
44
44
|
const t = new Date().valueOf(),
|
|
45
|
-
i = this.h.
|
|
45
|
+
i = this.h.Bd();
|
|
46
46
|
if (null == i) return !1;
|
|
47
47
|
const e = this.j.St(s.It.dm),
|
|
48
48
|
n = null == e || t - e > 1e3 * i;
|
|
@@ -65,11 +65,11 @@ export default class Xt {
|
|
|
65
65
|
}
|
|
66
66
|
(n += ". Will expire " + i.valueOf()), b.info(n);
|
|
67
67
|
const r = new _t(V.de(), i);
|
|
68
|
-
this.j.gm(new Ie(this.Ss.getUserId(), p.wm, t, r.
|
|
69
|
-
this.j.
|
|
70
|
-
return null == this.j.St(s.It.dm) && this.j.Pt(s.It.dm, t), r.
|
|
68
|
+
this.j.gm(new Ie(this.Ss.getUserId(), p.wm, t, r.Iu)),
|
|
69
|
+
this.j.Ju(s.Ou.um, r);
|
|
70
|
+
return null == this.j.St(s.It.dm) && this.j.Pt(s.It.dm, t), r.Iu;
|
|
71
71
|
}
|
|
72
|
-
if (null != e) return (e.pm = t), (e.fm = i), this.j.
|
|
72
|
+
if (null != e) return (e.pm = t), (e.fm = i), this.j.Ju(s.Ou.um, e), e.Iu;
|
|
73
73
|
}
|
|
74
74
|
Sm() {
|
|
75
75
|
const t = this.j.$u(s.Ou.um);
|