@braze/web-sdk 5.7.0 → 5.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 +4 -4
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +8 -8
- package/shared-lib/indexed-db-adapter.js +7 -7
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +17 -17
- package/src/Banner/get-all-banners.js +2 -3
- package/src/Banner/get-banner.js +11 -11
- package/src/Banner/request-banners-refresh.js +20 -12
- package/src/Banner/subscribe-to-banners-updates.js +14 -13
- package/src/Banner/ui/insert-banner.js +11 -9
- package/src/Card/log-card-impressions.js +2 -2
- package/src/ContentCards/content-cards-provider-factory.js +1 -1
- package/src/ContentCards/content-cards.js +3 -3
- package/src/ContentCards/ui/show-content-cards.js +5 -5
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +3 -3
- package/src/Core/disable-sdk.js +5 -5
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/get-user.js +1 -1
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/open-session.js +6 -6
- package/src/Core/wipe-data.js +1 -1
- package/src/FeatureFlags/feature-flag-factory.js +4 -4
- package/src/FeatureFlags/feature-flag.js +17 -17
- package/src/FeatureFlags/feature-flags-provider.js +37 -37
- package/src/FeatureFlags/get-all-feature-flags.js +6 -7
- package/src/FeatureFlags/get-feature-flag.js +5 -6
- package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/Feed/feed.js +2 -2
- package/src/Feed/ui/show-feed.js +4 -4
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +6 -6
- package/src/InAppMessage/display/in-app-message-to-html.js +18 -18
- package/src/InAppMessage/display/modal-utils.js +4 -4
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
- package/src/InAppMessage/in-app-message-manager.js +49 -49
- 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-impression.js +1 -1
- package/src/InAppMessage/models/control-message.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +3 -3
- package/src/InAppMessage/models/html-message.js +5 -5
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +32 -32
- package/src/InAppMessage/models/modal-message.js +3 -3
- package/src/InAppMessage/models/slide-up-message.js +6 -6
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +18 -18
- package/src/Push/push-manager-factory.js +8 -8
- package/src/Push/push-manager.js +83 -83
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +6 -6
- package/src/User/user.js +18 -18
- package/src/common/base-feed.js +3 -3
- package/src/common/event-logger.js +1 -1
- package/src/common/feed-display.js +8 -8
- package/src/l10n/l10n-manager-factory.js +2 -2
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/braze-instance.js +107 -107
- package/src/managers/device-manager.js +18 -18
- package/src/managers/network-manager.js +117 -117
- package/src/managers/server-config-manager.js +61 -61
- package/src/managers/session-manager.js +25 -25
- package/src/managers/storage-manager-factory.js +8 -8
- package/src/managers/storage-manager.js +57 -57
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +2 -2
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +10 -10
- package/src/models/push-token.js +7 -7
- package/src/models/server-config.js +30 -30
- package/src/request-controller.js +93 -93
- package/src/triggers/models/filter-set.js +4 -4
- package/src/triggers/models/filter.js +1 -1
- package/src/triggers/models/trigger-condition.js +29 -29
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +9 -9
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +15 -15
- package/src/ui/js/attach-css.js +3 -3
- package/src/ui/js/load-font-awesome.js +2 -2
- package/src/util/base-device-parser.js +3 -3
- 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/component-utils.js +1 -1
- package/src/util/dom-utils.js +6 -6
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +13 -13
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/validation-utils.js +4 -4
- package/src/util/window-utils.js +1 -1
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
convertSecondsToMs as Xt,
|
|
6
6
|
} from "../util/date-utils.js";
|
|
7
7
|
import c from "../common/event-logger.js";
|
|
8
|
-
import { isArray as
|
|
8
|
+
import { isArray as z, isEqual as ii } from "../util/code-utils.js";
|
|
9
9
|
import { logger as N, EventTypes as d } from "../../shared-lib/index.js";
|
|
10
10
|
import { STORAGE_KEYS as t } from "./storage-manager.js";
|
|
11
11
|
import h from "../util/request-header-utils.js";
|
|
@@ -17,52 +17,52 @@ import { getAlias as Ht } from "./utils.js";
|
|
|
17
17
|
import { readResponseHeaders as Yt } from "../util/net.js";
|
|
18
18
|
export default class Pt {
|
|
19
19
|
constructor(t, e, i, s, r, n, o, a, h, u, l, c) {
|
|
20
|
-
(this.
|
|
20
|
+
(this.fn = t),
|
|
21
21
|
(this.C = e),
|
|
22
|
-
(this.
|
|
22
|
+
(this.Na = i),
|
|
23
23
|
(this.As = s),
|
|
24
24
|
(this.T = r),
|
|
25
25
|
(this.B = n),
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
28
|
-
(this.
|
|
29
|
-
(this.
|
|
26
|
+
(this.cn = o),
|
|
27
|
+
(this.Oa = a),
|
|
28
|
+
(this.Qh = h),
|
|
29
|
+
(this.Ia = u),
|
|
30
30
|
(this.appVersion = l),
|
|
31
|
-
(this.
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
31
|
+
(this.fu = c),
|
|
32
|
+
(this.vu = (t) => (null == t ? "" : `${t} `)),
|
|
33
|
+
(this.fn = t),
|
|
34
34
|
(this.C = e),
|
|
35
|
-
(this.
|
|
35
|
+
(this.Na = i),
|
|
36
36
|
(this.As = s),
|
|
37
37
|
(this.T = r),
|
|
38
38
|
(this.B = n),
|
|
39
|
-
(this.
|
|
40
|
-
(this.
|
|
41
|
-
(this.
|
|
42
|
-
(this.
|
|
39
|
+
(this.cn = o),
|
|
40
|
+
(this.Oa = a),
|
|
41
|
+
(this.Qh = h),
|
|
42
|
+
(this.Ia = u),
|
|
43
43
|
(this.appVersion = l),
|
|
44
|
-
(this.
|
|
45
|
-
(this.
|
|
44
|
+
(this.fu = c),
|
|
45
|
+
(this.Ru = ["npm"]);
|
|
46
46
|
}
|
|
47
47
|
H(e, i = !1, s = !1) {
|
|
48
|
-
const r = this.
|
|
49
|
-
n = r.
|
|
50
|
-
o = this.C.vs(t.gs
|
|
48
|
+
const r = this.fn.de(!s),
|
|
49
|
+
n = r.Kr(),
|
|
50
|
+
o = this.C.vs(t.gs.ec);
|
|
51
51
|
ii(o, n) || (e.device = n),
|
|
52
|
-
(e.api_key = this.
|
|
52
|
+
(e.api_key = this.cn),
|
|
53
53
|
(e.time = L(new Date().valueOf(), !0));
|
|
54
|
-
const a = this.C.vs(t.gs.
|
|
55
|
-
h = this.C.vs(t.gs.
|
|
56
|
-
this.
|
|
57
|
-
(!ii(a, this.
|
|
58
|
-
(e.sdk_metadata = this.
|
|
59
|
-
(e.sdk_version = this.
|
|
60
|
-
this.
|
|
54
|
+
const a = this.C.vs(t.gs.gu) || [],
|
|
55
|
+
h = this.C.vs(t.gs.bu) || "";
|
|
56
|
+
this.Ru.length > 0 &&
|
|
57
|
+
(!ii(a, this.Ru) || h !== this.T.Ss()) &&
|
|
58
|
+
(e.sdk_metadata = this.Ru),
|
|
59
|
+
(e.sdk_version = this.Qh),
|
|
60
|
+
this.Ia && (e.sdk_flavor = this.Ia),
|
|
61
61
|
(e.app_version = this.appVersion),
|
|
62
|
-
(e.app_version_code = this.
|
|
62
|
+
(e.app_version_code = this.fu),
|
|
63
63
|
(e.device_id = r.id);
|
|
64
64
|
const u = this.As.getUserId();
|
|
65
|
-
if ((i && null !== u && (e.user_id = u), !u && !this.
|
|
65
|
+
if ((i && null !== u && (e.user_id = u), !u && !this.Na.jh())) {
|
|
66
66
|
const t = Ht(this.C);
|
|
67
67
|
t && (e.alias = t);
|
|
68
68
|
}
|
|
@@ -74,10 +74,10 @@ export default class Pt {
|
|
|
74
74
|
if (!s && !r) return !0;
|
|
75
75
|
if (s) {
|
|
76
76
|
let e;
|
|
77
|
-
this.
|
|
77
|
+
this.Na.Jh();
|
|
78
78
|
const r = { errorCode: s.error_code };
|
|
79
79
|
for (const t of i)
|
|
80
|
-
|
|
80
|
+
z(t) && "X-Braze-Auth-Signature" === t[0] && (r.signature = t[1]);
|
|
81
81
|
t.respond_with && t.respond_with.user_id
|
|
82
82
|
? (r.userId = t.respond_with.user_id)
|
|
83
83
|
: t.user_id && (r.userId = t.user_id);
|
|
@@ -86,12 +86,12 @@ export default class Pt {
|
|
|
86
86
|
n
|
|
87
87
|
? ((r.reason = n), (e = `due to ${n}`))
|
|
88
88
|
: (e = `with error code ${s.error_code}.`),
|
|
89
|
-
this.
|
|
89
|
+
this.Na.jh() ||
|
|
90
90
|
(e +=
|
|
91
91
|
' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),
|
|
92
92
|
N.error(`SDK Authentication failed ${e}`),
|
|
93
|
-
this.
|
|
94
|
-
this.
|
|
93
|
+
this.qu(t.events || [], t.attributes || []),
|
|
94
|
+
this.Na.Gh(r),
|
|
95
95
|
!1
|
|
96
96
|
);
|
|
97
97
|
}
|
|
@@ -99,42 +99,42 @@ export default class Pt {
|
|
|
99
99
|
let i,
|
|
100
100
|
s = r;
|
|
101
101
|
switch (s) {
|
|
102
|
-
case qt.
|
|
102
|
+
case qt.Au:
|
|
103
103
|
return (
|
|
104
104
|
(i = "Received successful response with empty body."),
|
|
105
|
-
c.cs(d.
|
|
105
|
+
c.cs(d.Du, { e: i }),
|
|
106
106
|
N.info(i),
|
|
107
107
|
!1
|
|
108
108
|
);
|
|
109
|
-
case qt.
|
|
109
|
+
case qt.ku:
|
|
110
110
|
return (
|
|
111
111
|
(i = "Received successful response with invalid JSON"),
|
|
112
|
-
c.cs(d.
|
|
112
|
+
c.cs(d.Du, { e: i + ": " + e.response }),
|
|
113
113
|
N.info(i),
|
|
114
114
|
!1
|
|
115
115
|
);
|
|
116
|
-
case qt.
|
|
117
|
-
s = `The API key "${t.api_key}" is invalid for the baseUrl ${this.
|
|
116
|
+
case qt.Tu:
|
|
117
|
+
s = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Oa}`;
|
|
118
118
|
break;
|
|
119
|
-
case qt.
|
|
119
|
+
case qt.yu:
|
|
120
120
|
s =
|
|
121
121
|
"Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";
|
|
122
122
|
break;
|
|
123
|
-
case qt.
|
|
123
|
+
case qt.Nu:
|
|
124
124
|
s = "No device identifier. Please contact support@braze.com";
|
|
125
125
|
}
|
|
126
126
|
N.error("Backend error: " + s);
|
|
127
127
|
}
|
|
128
128
|
return !1;
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
wu(t, e, i, s) {
|
|
131
131
|
return !!((t && 0 !== t.length) || (e && 0 !== e.length) || i || s);
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
Cu(t, e, i, s, r = !1) {
|
|
134
134
|
const n = [],
|
|
135
135
|
o = (t) => t || "",
|
|
136
136
|
a = o(this.As.getUserId());
|
|
137
|
-
let u = this.
|
|
137
|
+
let u = this.Jr(t, e);
|
|
138
138
|
const l = [],
|
|
139
139
|
c = [];
|
|
140
140
|
let d,
|
|
@@ -142,7 +142,7 @@ export default class Pt {
|
|
|
142
142
|
if (i.length > 0) {
|
|
143
143
|
const t = [];
|
|
144
144
|
for (const e of i) {
|
|
145
|
-
if (((d = e.
|
|
145
|
+
if (((d = e.Kr()), this.Na.jh())) {
|
|
146
146
|
if (a && !d.user_id) {
|
|
147
147
|
f || (f = {}), f.events || (f.events = []), f.events.push(d);
|
|
148
148
|
continue;
|
|
@@ -159,19 +159,19 @@ export default class Pt {
|
|
|
159
159
|
if (s.length > 0) {
|
|
160
160
|
const t = [];
|
|
161
161
|
for (const e of s)
|
|
162
|
-
e && (this.
|
|
162
|
+
e && (this.Na.jh() && o(e.user_id) !== a ? l.push(e) : t.push(e));
|
|
163
163
|
t.length > 0 && (u.attributes = t);
|
|
164
164
|
}
|
|
165
|
-
if ((this.
|
|
165
|
+
if ((this.qu(c, l), (u = this.H(u, !1, r)), f)) {
|
|
166
166
|
f = this.H(f, !1, r);
|
|
167
|
-
const t = { requestData: f, headers: this.J(f, h.O.
|
|
167
|
+
const t = { requestData: f, headers: this.J(f, h.O.Su) };
|
|
168
168
|
n.push(t);
|
|
169
169
|
}
|
|
170
|
-
if (u && !this.
|
|
171
|
-
const m = { requestData: u, headers: this.J(u, h.O.
|
|
170
|
+
if (u && !this.wu(u.events, u.attributes, t, e)) return f ? n : null;
|
|
171
|
+
const m = { requestData: u, headers: this.J(u, h.O.Su) };
|
|
172
172
|
return n.push(m), n;
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
qu(t, e) {
|
|
175
175
|
if (t) {
|
|
176
176
|
const e = [];
|
|
177
177
|
for (const i of t) {
|
|
@@ -180,39 +180,39 @@ export default class Pt {
|
|
|
180
180
|
}
|
|
181
181
|
this.C.Go(e);
|
|
182
182
|
}
|
|
183
|
-
if (e) for (const t of e) this.C.
|
|
183
|
+
if (e) for (const t of e) this.C.Bu(t);
|
|
184
184
|
}
|
|
185
185
|
ns(t, e) {
|
|
186
186
|
let i = "HTTP error ";
|
|
187
187
|
null != t && (i += t + " "), (i += e), N.error(i);
|
|
188
188
|
}
|
|
189
189
|
zr(t) {
|
|
190
|
-
return c.cs(d.
|
|
190
|
+
return c.cs(d.zu, { n: t });
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
Jr(t, e, i) {
|
|
193
193
|
const s = {};
|
|
194
194
|
t && (s.feed = !0), e && (s.triggers = !0);
|
|
195
195
|
const r = null != i ? i : this.As.getUserId();
|
|
196
|
-
if ((r && (s.user_id = r), !s.user_id && !this.
|
|
196
|
+
if ((r && (s.user_id = r), !s.user_id && !this.Na.jh())) {
|
|
197
197
|
const t = Ht(this.C);
|
|
198
198
|
t && (s.alias = t);
|
|
199
199
|
}
|
|
200
200
|
return (s.config = { config_time: this.B.Us() }), { respond_with: s };
|
|
201
201
|
}
|
|
202
|
-
|
|
202
|
+
ju(t) {
|
|
203
203
|
const e = new Date().valueOf();
|
|
204
204
|
let i = $t.toString();
|
|
205
|
-
const s = h
|
|
205
|
+
const s = h.Mu(this.C, t);
|
|
206
206
|
if (-1 !== s) {
|
|
207
207
|
i = (e - s).toString();
|
|
208
208
|
}
|
|
209
209
|
return i;
|
|
210
210
|
}
|
|
211
211
|
J(t, e, i = !1) {
|
|
212
|
-
const s = [["X-Braze-Api-Key", this.
|
|
213
|
-
r = this.
|
|
212
|
+
const s = [["X-Braze-Api-Key", this.cn]],
|
|
213
|
+
r = this.ju(e);
|
|
214
214
|
s.push(["X-Braze-Last-Req-Ms-Ago", r]);
|
|
215
|
-
const n = h.
|
|
215
|
+
const n = h.Xu(this.C, e).toString();
|
|
216
216
|
s.push(["X-Braze-Req-Attempt", n]);
|
|
217
217
|
let o = !1;
|
|
218
218
|
if (
|
|
@@ -225,55 +225,55 @@ export default class Pt {
|
|
|
225
225
|
e === h.O.Ai)
|
|
226
226
|
) {
|
|
227
227
|
s.push(["X-Braze-ContentCardsRequest", "true"]);
|
|
228
|
-
let t = h.
|
|
229
|
-
(t && !i) || ((t = 1), h
|
|
228
|
+
let t = h.Xu(this.C, h.O.Ai);
|
|
229
|
+
(t && !i) || ((t = 1), h.$u(this.C, h.O.Ai, t));
|
|
230
230
|
const e = Math.max(0, t - 1);
|
|
231
231
|
s.push(["BRAZE-SYNC-RETRY-COUNT", e.toString()]), (o = !0);
|
|
232
232
|
}
|
|
233
233
|
if (
|
|
234
|
-
(e === h.O.
|
|
234
|
+
(e === h.O._e &&
|
|
235
235
|
(s.push(["X-Braze-FeatureFlagsRequest", "true"]), (o = !0)),
|
|
236
236
|
o && s.push(["X-Braze-DataRequest", "true"]),
|
|
237
|
-
this.
|
|
237
|
+
this.Na.jh())
|
|
238
238
|
) {
|
|
239
|
-
const t = this.
|
|
239
|
+
const t = this.Na.xh();
|
|
240
240
|
null != t && s.push(["X-Braze-Auth-Signature", t]);
|
|
241
241
|
}
|
|
242
242
|
return s;
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
Fu(t, e, i, s) {
|
|
245
245
|
window.setTimeout(() => {
|
|
246
|
-
N.info(`Retrying rate limited ${this.
|
|
246
|
+
N.info(`Retrying rate limited ${this.vu(s)}SDK request.`),
|
|
247
247
|
this.V(e, i, s);
|
|
248
248
|
}, t);
|
|
249
249
|
}
|
|
250
250
|
V(e, i, s, r) {
|
|
251
|
-
if (!this.
|
|
251
|
+
if (!this.Lu(s))
|
|
252
252
|
return (
|
|
253
|
-
N.info(`${this.
|
|
253
|
+
N.info(`${this.vu(s)}SDK request being rate limited.`),
|
|
254
254
|
void ("function" == typeof r && r())
|
|
255
255
|
);
|
|
256
|
-
const n = this.
|
|
257
|
-
if (!n.
|
|
256
|
+
const n = this.Eu();
|
|
257
|
+
if (!n.Ku)
|
|
258
258
|
return (
|
|
259
259
|
N.info(
|
|
260
|
-
`${this.
|
|
260
|
+
`${this.vu(
|
|
261
261
|
s,
|
|
262
262
|
)}SDK request being rate limited. Request will be retried in ${Math.trunc(
|
|
263
|
-
n.
|
|
263
|
+
n.Iu / 1e3,
|
|
264
264
|
)} seconds.`,
|
|
265
265
|
),
|
|
266
|
-
void this.
|
|
266
|
+
void this.Fu(n.Iu, e, i, s)
|
|
267
267
|
);
|
|
268
|
-
this.C.Bs(t.gs.
|
|
268
|
+
this.C.Bs(t.gs.Pu, new Date().valueOf());
|
|
269
269
|
const o = e.device;
|
|
270
270
|
o && o.os_version instanceof Promise
|
|
271
271
|
? o.os_version.then((t) => {
|
|
272
|
-
(e.device.os_version = t), i(n.
|
|
272
|
+
(e.device.os_version = t), i(n.Uu);
|
|
273
273
|
})
|
|
274
|
-
: i(n.
|
|
274
|
+
: i(n.Uu);
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
xu(t) {
|
|
277
277
|
const e = t ? Yt(t) : null;
|
|
278
278
|
if (!e || !e["retry-after"]) return null;
|
|
279
279
|
const i = e["retry-after"];
|
|
@@ -284,21 +284,21 @@ export default class Pt {
|
|
|
284
284
|
{
|
|
285
285
|
const t =
|
|
286
286
|
"Received unexpected value for retry-after header in /sync response";
|
|
287
|
-
c.cs(d.
|
|
287
|
+
c.cs(d.Du, { e: t + ": " + i });
|
|
288
288
|
}
|
|
289
289
|
return null;
|
|
290
290
|
}
|
|
291
291
|
os(t, e, i, s, r, n) {
|
|
292
|
-
if (h.
|
|
292
|
+
if (h.Xu(this.C, i) >= Kt) return;
|
|
293
293
|
let o;
|
|
294
294
|
n = n || 0;
|
|
295
|
-
const a = this.
|
|
295
|
+
const a = this.xu(t);
|
|
296
296
|
r();
|
|
297
297
|
const u = (t) => {
|
|
298
298
|
const r = window.setTimeout(() => {
|
|
299
299
|
e();
|
|
300
300
|
}, t);
|
|
301
|
-
s(r), h.
|
|
301
|
+
s(r), h.Hu(this.C, i);
|
|
302
302
|
};
|
|
303
303
|
if (a && !isNaN(a.value)) {
|
|
304
304
|
switch (a.type) {
|
|
@@ -311,44 +311,44 @@ export default class Pt {
|
|
|
311
311
|
u(o);
|
|
312
312
|
} else n ? u(n) : h.zi(this.C, i);
|
|
313
313
|
}
|
|
314
|
-
|
|
314
|
+
Ou(e) {
|
|
315
315
|
var i;
|
|
316
|
-
null === (i = this.C) || void 0 === i || i.Bs(t.gs.
|
|
316
|
+
null === (i = this.C) || void 0 === i || i.Bs(t.gs.Gu, e);
|
|
317
317
|
}
|
|
318
|
-
|
|
319
|
-
let s = this.
|
|
320
|
-
null == s && (s = {}), (s[e] = i), this.C.Bs(t.gs.
|
|
318
|
+
_u(e, i) {
|
|
319
|
+
let s = this.Wu();
|
|
320
|
+
null == s && (s = {}), (s[e] = i), this.C.Bs(t.gs.Yu, s);
|
|
321
321
|
}
|
|
322
|
-
|
|
322
|
+
Ju() {
|
|
323
323
|
var e;
|
|
324
|
-
return null === (e = this.C) || void 0 === e ? void 0 : e.vs(t.gs.
|
|
324
|
+
return null === (e = this.C) || void 0 === e ? void 0 : e.vs(t.gs.Gu);
|
|
325
325
|
}
|
|
326
|
-
|
|
326
|
+
Wu() {
|
|
327
327
|
var e;
|
|
328
|
-
return null === (e = this.C) || void 0 === e ? void 0 : e.vs(t.gs.
|
|
328
|
+
return null === (e = this.C) || void 0 === e ? void 0 : e.vs(t.gs.Yu);
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
Qu(t, e, i, s, r = "") {
|
|
331
331
|
let n;
|
|
332
332
|
if (r) {
|
|
333
|
-
const t = this.
|
|
333
|
+
const t = this.Wu();
|
|
334
334
|
n = null == t || isNaN(t[r]) ? e : t[r];
|
|
335
|
-
} else (n = this.
|
|
335
|
+
} else (n = this.Ju()), (null == n || isNaN(n)) && (n = e);
|
|
336
336
|
const o = (t - s) / 1e3;
|
|
337
337
|
return (n = Math.min(n + o / i, e)), n;
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
Vu(t, e) {
|
|
340
340
|
return Math.max(0, (1 - t) * e * 1e3);
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
Zu(e, i = "") {
|
|
343
343
|
var s, r, n, o, a;
|
|
344
|
-
const u = {
|
|
344
|
+
const u = { Ku: !0, Uu: -1, Iu: 0 };
|
|
345
345
|
if ((null == e && (e = !0), !e && !i)) return u;
|
|
346
346
|
let l,
|
|
347
347
|
c,
|
|
348
348
|
d = null;
|
|
349
|
-
if (e) d = null === (s = this.C) || void 0 === s ? void 0 : s.vs(t.gs.
|
|
349
|
+
if (e) d = null === (s = this.C) || void 0 === s ? void 0 : s.vs(t.gs.Pu);
|
|
350
350
|
else {
|
|
351
|
-
const t = h.
|
|
351
|
+
const t = h.tl(this.C);
|
|
352
352
|
if (null == t || null == t[i]) return u;
|
|
353
353
|
d = t[i];
|
|
354
354
|
}
|
|
@@ -356,38 +356,38 @@ export default class Pt {
|
|
|
356
356
|
if (
|
|
357
357
|
(e
|
|
358
358
|
? ((l =
|
|
359
|
-
(null === (r = this.B) || void 0 === r ? void 0 : r.
|
|
360
|
-
(c = (null === (n = this.B) || void 0 === n ? void 0 : n.
|
|
359
|
+
(null === (r = this.B) || void 0 === r ? void 0 : r.el()) || -1),
|
|
360
|
+
(c = (null === (n = this.B) || void 0 === n ? void 0 : n.il()) || -1))
|
|
361
361
|
: ((l =
|
|
362
|
-
(null === (o = this.B) || void 0 === o ? void 0 : o.
|
|
362
|
+
(null === (o = this.B) || void 0 === o ? void 0 : o.sl(i)) || -1),
|
|
363
363
|
(c =
|
|
364
|
-
(null === (a = this.B) || void 0 === a ? void 0 : a.
|
|
364
|
+
(null === (a = this.B) || void 0 === a ? void 0 : a.rl(i)) || -1)),
|
|
365
365
|
-1 === l || -1 === c)
|
|
366
366
|
)
|
|
367
367
|
return u;
|
|
368
368
|
const f = new Date().valueOf();
|
|
369
|
-
let m = this.
|
|
369
|
+
let m = this.Qu(f, l, c, d, i);
|
|
370
370
|
return m < 1
|
|
371
|
-
? ((u.
|
|
371
|
+
? ((u.Ku = !1), (u.Iu = this.Vu(m, c)), u)
|
|
372
372
|
: ((m = Math.trunc(m) - 1),
|
|
373
|
-
(u.
|
|
374
|
-
e ? this.
|
|
373
|
+
(u.Uu = m),
|
|
374
|
+
e ? this.Ou(m) : this._u(i, m),
|
|
375
375
|
u);
|
|
376
376
|
}
|
|
377
|
-
|
|
378
|
-
return this.
|
|
377
|
+
Eu() {
|
|
378
|
+
return this.Zu(!0);
|
|
379
379
|
}
|
|
380
|
-
|
|
381
|
-
const e = this.
|
|
382
|
-
return !(e && !e.
|
|
380
|
+
Lu(t) {
|
|
381
|
+
const e = this.Zu(!1, t);
|
|
382
|
+
return !(e && !e.Ku);
|
|
383
383
|
}
|
|
384
384
|
es() {
|
|
385
|
-
this.
|
|
385
|
+
this.Na.es();
|
|
386
386
|
}
|
|
387
387
|
Z() {
|
|
388
|
-
return this.
|
|
388
|
+
return this.Oa;
|
|
389
389
|
}
|
|
390
390
|
addSdkMetadata(t) {
|
|
391
|
-
for (const e of t) -1 === this.
|
|
391
|
+
for (const e of t) -1 === this.Ru.indexOf(e) && this.Ru.push(e);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
@@ -7,28 +7,28 @@ export default class Mt {
|
|
|
7
7
|
constructor(t) {
|
|
8
8
|
(this.C = t),
|
|
9
9
|
(this.C = t),
|
|
10
|
+
(this.al = new u()),
|
|
10
11
|
(this.hl = new u()),
|
|
11
12
|
(this.ul = new u()),
|
|
12
|
-
(this.
|
|
13
|
-
(this.
|
|
14
|
-
(this.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.bl = null != e ? Jt.Yn(e) : new Jt();
|
|
13
|
+
(this.ol = new u()),
|
|
14
|
+
(this.cl = null),
|
|
15
|
+
(this.ml = null);
|
|
16
|
+
}
|
|
17
|
+
gl() {
|
|
18
|
+
if (null == this.ml) {
|
|
19
|
+
const e = this.C.vs(t.gs.bl);
|
|
20
|
+
this.ml = null != e ? Jt.Bn(e) : new Jt();
|
|
21
21
|
}
|
|
22
|
-
return this.
|
|
22
|
+
return this.ml;
|
|
23
23
|
}
|
|
24
24
|
Us() {
|
|
25
|
-
return this.
|
|
25
|
+
return this.gl().fl;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
dl(e) {
|
|
28
28
|
if (null != e && null != e.config) {
|
|
29
29
|
const i = e.config;
|
|
30
|
-
if (i.time > this.
|
|
31
|
-
const e = (t) => (null == t ? this.
|
|
30
|
+
if (i.time > this.gl().fl) {
|
|
31
|
+
const e = (t) => (null == t ? this.gl().Rl : t),
|
|
32
32
|
s = new Jt(
|
|
33
33
|
i.time,
|
|
34
34
|
i.events_blacklist,
|
|
@@ -42,95 +42,95 @@ export default class Mt {
|
|
|
42
42
|
i.banners,
|
|
43
43
|
);
|
|
44
44
|
let n = !1;
|
|
45
|
-
null != s.
|
|
45
|
+
null != s.Cl && this.En() !== s.Cl && (n = !0);
|
|
46
46
|
let r = !1;
|
|
47
|
-
null != s.
|
|
47
|
+
null != s.El.enabled && this.Fi() !== s.El.enabled && (r = !0);
|
|
48
48
|
let l = !1;
|
|
49
|
-
null != s.
|
|
49
|
+
null != s.we.enabled && this.qe() !== s.we.enabled && (l = !0);
|
|
50
50
|
let a = !1;
|
|
51
51
|
null != s.banners.enabled &&
|
|
52
52
|
this.Ds() !== s.banners.enabled &&
|
|
53
53
|
(a = !0),
|
|
54
|
-
(this.
|
|
55
|
-
this.C.Bs(t.gs.
|
|
56
|
-
n && this.
|
|
57
|
-
r && this.
|
|
58
|
-
l && this.
|
|
59
|
-
a && this.
|
|
54
|
+
(this.ml = s),
|
|
55
|
+
this.C.Bs(t.gs.bl, s.bs()),
|
|
56
|
+
n && this.al.X(),
|
|
57
|
+
r && this.hl.X(),
|
|
58
|
+
l && this.ul.X(),
|
|
59
|
+
a && this.ol.X();
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
const e = this.
|
|
65
|
-
return this.
|
|
63
|
+
Rn(t) {
|
|
64
|
+
const e = this.al.Fs(t);
|
|
65
|
+
return this.cl && this.al.removeSubscription(this.cl), (this.cl = e), e;
|
|
66
66
|
}
|
|
67
67
|
qi(t) {
|
|
68
|
-
return this.
|
|
68
|
+
return this.hl.Fs(t);
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
return this.
|
|
70
|
+
Xe(t) {
|
|
71
|
+
return this.ul.Fs(t);
|
|
72
72
|
}
|
|
73
73
|
A(t) {
|
|
74
|
-
return this.
|
|
74
|
+
return this.ol.Fs(t);
|
|
75
75
|
}
|
|
76
76
|
ge(t) {
|
|
77
|
-
return -1 !== this.
|
|
77
|
+
return -1 !== this.gl().vl.indexOf(t);
|
|
78
78
|
}
|
|
79
79
|
hu(t) {
|
|
80
|
-
return -1 !== this.
|
|
80
|
+
return -1 !== this.gl().wl.indexOf(t);
|
|
81
81
|
}
|
|
82
82
|
Dr(t) {
|
|
83
|
-
return -1 !== this.
|
|
83
|
+
return -1 !== this.gl().yl.indexOf(t);
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
return this.
|
|
85
|
+
Ll() {
|
|
86
|
+
return this.gl().Bl;
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
return this.
|
|
88
|
+
En() {
|
|
89
|
+
return this.gl().Cl;
|
|
90
90
|
}
|
|
91
91
|
Fi() {
|
|
92
|
-
return this.
|
|
92
|
+
return this.gl().El.enabled || !1;
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
const t = this.
|
|
94
|
+
Fl() {
|
|
95
|
+
const t = this.gl().Rl;
|
|
96
96
|
return !(!t || null == t.enabled) && t.enabled;
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
if (!this.
|
|
100
|
-
const t = this.
|
|
98
|
+
el() {
|
|
99
|
+
if (!this.Fl()) return -1;
|
|
100
|
+
const t = this.gl().Rl;
|
|
101
101
|
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
if (!this.
|
|
105
|
-
const t = this.
|
|
103
|
+
il() {
|
|
104
|
+
if (!this.Fl()) return -1;
|
|
105
|
+
const t = this.gl().Rl;
|
|
106
106
|
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
const e = this.
|
|
108
|
+
Tl(t) {
|
|
109
|
+
const e = this.gl().Rl.endpoint_overrides;
|
|
110
110
|
return null == e ? null : e[t];
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
const e = this.
|
|
112
|
+
sl(t) {
|
|
113
|
+
const e = this.Tl(t);
|
|
114
114
|
return null == e || isNaN(e.capacity) || e.capacity <= 0 ? -1 : e.capacity;
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
const e = this.
|
|
116
|
+
rl(t) {
|
|
117
|
+
const e = this.Tl(t);
|
|
118
118
|
return null == e || isNaN(e.refill_rate) || e.refill_rate <= 0
|
|
119
119
|
? -1
|
|
120
120
|
: e.refill_rate;
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
return this.
|
|
124
|
-
? (c.cs(d.
|
|
125
|
-
: this.
|
|
122
|
+
qe() {
|
|
123
|
+
return this.gl().we.enabled && null == this.Ae()
|
|
124
|
+
? (c.cs(d.Du, { e: "Missing feature flag refresh_rate_limit." }), !1)
|
|
125
|
+
: this.gl().we.enabled || !1;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
return this.
|
|
127
|
+
Ae() {
|
|
128
|
+
return this.gl().we.refresh_rate_limit;
|
|
129
129
|
}
|
|
130
130
|
Ds() {
|
|
131
|
-
return this.
|
|
131
|
+
return this.gl().banners.enabled || !1;
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
return this.
|
|
133
|
+
ne() {
|
|
134
|
+
return this.gl().banners.max_placements || 0;
|
|
135
135
|
}
|
|
136
136
|
}
|