@braze/web-sdk 4.4.0 → 4.5.1
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 +15 -3
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +7 -7
- package/shared-lib/indexed-db-adapter.js +1 -1
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +13 -13
- package/src/Card/models/card.js +1 -0
- package/src/Card/models/control-card.js +3 -2
- package/src/InAppMessage/log-in-app-message-click.js +4 -1
- package/src/InAppMessage/models/control-message.js +1 -1
- package/src/InAppMessage/models/in-app-message.js +8 -4
- package/src/Push/push-manager.js +54 -54
- package/src/Push/utils/push-utils.js +3 -3
- package/src/User/user-manager.js +4 -4
- package/src/User/user.js +8 -8
- package/src/managers/auth-manager.js +4 -4
- package/src/managers/braze-instance.js +81 -81
- package/src/managers/device-manager.js +7 -7
- package/src/managers/network-manager.js +39 -39
- package/src/managers/server-config-manager.js +4 -4
- package/src/managers/session-manager.js +1 -1
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +40 -40
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +1 -1
- package/src/models/identifier.js +1 -1
- package/src/models/push-token.js +3 -3
- package/src/models/server-config.js +3 -3
- package/src/request-controller.js +64 -64
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +4 -4
- package/src/triggers/models/filter.js +57 -57
- package/src/triggers/models/in-app-message-click-data.js +1 -1
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +5 -5
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +4 -4
- package/src/triggers/models/trigger.js +16 -16
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +14 -14
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +1 -1
- package/src/ui/js/iam-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- package/src/util/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/net.js +3 -3
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/window-utils.js +1 -1
|
@@ -20,10 +20,10 @@ export const STORAGE_KEYS = {
|
|
|
20
20
|
Ta: "ab.storage.events",
|
|
21
21
|
Ia: "ab.storage.attributes",
|
|
22
22
|
Ka: "ab.storage.attributes.anonymous_user",
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
Yo: "ab.storage.device",
|
|
24
|
+
ua: "ab.storage.sdk_metadata",
|
|
25
|
+
ha: "ab.storage.session_id_for_cached_metadata",
|
|
26
|
+
Pn: "ab.storage.pushToken",
|
|
27
27
|
ei: "ab.storage.newsFeed",
|
|
28
28
|
hi: "ab.storage.lastNewsFeedRefresh",
|
|
29
29
|
P: "ab.storage.cardImpressions",
|
|
@@ -61,7 +61,7 @@ export default class G {
|
|
|
61
61
|
null != e && ((e.bh = new Date().valueOf()), this.ru(t, e));
|
|
62
62
|
}
|
|
63
63
|
tu(t) {
|
|
64
|
-
return _t.
|
|
64
|
+
return _t.Sn(this.Ma.lr(t));
|
|
65
65
|
}
|
|
66
66
|
Nh(t) {
|
|
67
67
|
this.Ma.remove(t);
|
|
@@ -85,7 +85,7 @@ export default class G {
|
|
|
85
85
|
o = null;
|
|
86
86
|
if (p(t))
|
|
87
87
|
for (let s = 0; s < t.length; s++)
|
|
88
|
-
ue.Fa(t[s]) ? e.push(ue.
|
|
88
|
+
ue.Fa(t[s]) ? e.push(ue.Sn(t[s])) : (o = s);
|
|
89
89
|
else s = !0;
|
|
90
90
|
if (s || null != o) {
|
|
91
91
|
let n = "Stored events could not be deserialized as Events";
|
|
@@ -147,14 +147,14 @@ export default class G {
|
|
|
147
147
|
La(t) {
|
|
148
148
|
return t || STORAGE_KEYS.q.Ka;
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
Aa(t) {
|
|
151
151
|
let e = this.Ca.lr(STORAGE_KEYS.q.Ia);
|
|
152
152
|
null == e && (e = {});
|
|
153
|
-
const s = this.La(t[User.
|
|
153
|
+
const s = this.La(t[User.Rn]);
|
|
154
154
|
for (let r in t)
|
|
155
|
-
r === User.
|
|
155
|
+
r === User.Rn ||
|
|
156
156
|
(null != e[s] && null != e[s][r]) ||
|
|
157
|
-
this.mu(t[User.
|
|
157
|
+
this.mu(t[User.Rn], r, t[r]);
|
|
158
158
|
}
|
|
159
159
|
mu(t, e, s) {
|
|
160
160
|
let r = this.Ca.lr(STORAGE_KEYS.q.Ia);
|
|
@@ -162,7 +162,7 @@ export default class G {
|
|
|
162
162
|
const o = this.La(t);
|
|
163
163
|
let n = r[o];
|
|
164
164
|
if (
|
|
165
|
-
(null == n && ((n = {}), null != t && (n[User.
|
|
165
|
+
(null == n && ((n = {}), null != t && (n[User.Rn] = t)), e === User.lu)
|
|
166
166
|
) {
|
|
167
167
|
null == n[e] && (n[e] = {});
|
|
168
168
|
for (let t in s) n[e][t] = s[t];
|
|
@@ -184,8 +184,8 @@ export default class G {
|
|
|
184
184
|
null != r &&
|
|
185
185
|
((e[s] = void 0),
|
|
186
186
|
this.Ca.store(STORAGE_KEYS.q.Ia, e),
|
|
187
|
-
(r[User.
|
|
188
|
-
this.
|
|
187
|
+
(r[User.Rn] = t),
|
|
188
|
+
this.Aa(r));
|
|
189
189
|
}
|
|
190
190
|
const s = this.tu(STORAGE_KEYS.eu.ph);
|
|
191
191
|
let r = null;
|
|
@@ -234,12 +234,12 @@ G._a = class {
|
|
|
234
234
|
};
|
|
235
235
|
G.ne = class {
|
|
236
236
|
constructor(t, e) {
|
|
237
|
-
(this._r = t), (this.Va = this.
|
|
237
|
+
(this._r = t), (this.Va = this.Qa()), (this.Ha = 576e3), (this.Wa = !!e);
|
|
238
238
|
}
|
|
239
239
|
ka(t) {
|
|
240
240
|
return null != this._r ? t + "." + this._r : t;
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
Qa() {
|
|
243
243
|
let t = 0,
|
|
244
244
|
e = document.location.hostname;
|
|
245
245
|
const s = e.split("."),
|
|
@@ -256,9 +256,9 @@ G.ne = class {
|
|
|
256
256
|
}
|
|
257
257
|
ie() {
|
|
258
258
|
const t = new Date();
|
|
259
|
-
return t.setTime(t.getTime() + 60 * this.
|
|
259
|
+
return t.setTime(t.getTime() + 60 * this.Ha * 1e3), t.getFullYear();
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
Xa() {
|
|
262
262
|
const t = At(STORAGE_KEYS.eu),
|
|
263
263
|
e = document.cookie.split(";");
|
|
264
264
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -272,18 +272,18 @@ G.ne = class {
|
|
|
272
272
|
}
|
|
273
273
|
if (o) {
|
|
274
274
|
const t = r.split("=")[0];
|
|
275
|
-
-1 === t.indexOf("." + this._r) && this.
|
|
275
|
+
-1 === t.indexOf("." + this._r) && this.Za(t);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
store(t, e) {
|
|
280
|
-
this.
|
|
280
|
+
this.Xa();
|
|
281
281
|
const s = new Date();
|
|
282
|
-
s.setTime(s.getTime() + 60 * this.
|
|
282
|
+
s.setTime(s.getTime() + 60 * this.Ha * 1e3);
|
|
283
283
|
const o = "expires=" + s.toUTCString(),
|
|
284
284
|
n = "domain=" + this.Va;
|
|
285
285
|
let i;
|
|
286
|
-
i = this.
|
|
286
|
+
i = this.Wa ? e : encodeURIComponent(JSON.stringify(e));
|
|
287
287
|
const a = this.ka(t) + "=" + i + ";" + o + ";" + n + ";path=/";
|
|
288
288
|
return a.length >= 4093
|
|
289
289
|
? (r.D.info(
|
|
@@ -304,7 +304,7 @@ G.ne = class {
|
|
|
304
304
|
if (0 === i.indexOf(s))
|
|
305
305
|
try {
|
|
306
306
|
let t;
|
|
307
|
-
(t = this.
|
|
307
|
+
(t = this.Wa
|
|
308
308
|
? i.substring(s.length, i.length)
|
|
309
309
|
: JSON.parse(decodeURIComponent(i.substring(s.length, i.length)))),
|
|
310
310
|
e.push(t);
|
|
@@ -319,9 +319,9 @@ G.ne = class {
|
|
|
319
319
|
return e.length > 0 ? e[e.length - 1] : null;
|
|
320
320
|
}
|
|
321
321
|
remove(t) {
|
|
322
|
-
this.
|
|
322
|
+
this.Za(this.ka(t));
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
Za(t) {
|
|
325
325
|
const e = t + "=;expires=" + new Date(0).toGMTString();
|
|
326
326
|
(document.cookie = e), (document.cookie = e + ";path=/");
|
|
327
327
|
const s = e + ";domain=" + this.Va;
|
|
@@ -330,22 +330,22 @@ G.ne = class {
|
|
|
330
330
|
};
|
|
331
331
|
G.Oa = class {
|
|
332
332
|
constructor() {
|
|
333
|
-
(this
|
|
333
|
+
(this.$a = {}), (this.El = 5242880), (this.xa = 3);
|
|
334
334
|
}
|
|
335
335
|
store(t, e) {
|
|
336
336
|
const s = { value: e },
|
|
337
|
-
o = this.
|
|
338
|
-
return o > this
|
|
337
|
+
o = this.Sl(e);
|
|
338
|
+
return o > this.El
|
|
339
339
|
? (r.D.info(
|
|
340
340
|
"Storage failure: object is ≈" +
|
|
341
341
|
o +
|
|
342
342
|
" bytes which is greater than the max of " +
|
|
343
|
-
this
|
|
343
|
+
this.El
|
|
344
344
|
),
|
|
345
345
|
!1)
|
|
346
|
-
: ((this
|
|
346
|
+
: ((this.$a[t] = s), !0);
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
Sl(t) {
|
|
349
349
|
const e = [],
|
|
350
350
|
s = [t];
|
|
351
351
|
let r = 0;
|
|
@@ -362,33 +362,33 @@ G.Oa = class {
|
|
|
362
362
|
return r;
|
|
363
363
|
}
|
|
364
364
|
lr(t) {
|
|
365
|
-
const e = this
|
|
365
|
+
const e = this.$a[t];
|
|
366
366
|
return null == e ? null : e.value;
|
|
367
367
|
}
|
|
368
368
|
remove(t) {
|
|
369
|
-
this
|
|
369
|
+
this.$a[t] = null;
|
|
370
370
|
}
|
|
371
371
|
};
|
|
372
372
|
G.wa = class {
|
|
373
373
|
constructor(t, e, s) {
|
|
374
|
-
(this.
|
|
375
|
-
e && this.
|
|
376
|
-
s && this.
|
|
377
|
-
this.
|
|
374
|
+
(this._l = []),
|
|
375
|
+
e && this._l.push(new G.ne(t)),
|
|
376
|
+
s && this._l.push(new G._a(t)),
|
|
377
|
+
this._l.push(new G.Oa(t));
|
|
378
378
|
}
|
|
379
379
|
store(t, e) {
|
|
380
380
|
let s = !0;
|
|
381
|
-
for (let r = 0; r < this.
|
|
381
|
+
for (let r = 0; r < this._l.length; r++) s = this._l[r].store(t, e) && s;
|
|
382
382
|
return s;
|
|
383
383
|
}
|
|
384
384
|
lr(t) {
|
|
385
|
-
for (let e = 0; e < this.
|
|
386
|
-
const s = this.
|
|
385
|
+
for (let e = 0; e < this._l.length; e++) {
|
|
386
|
+
const s = this._l[e].lr(t);
|
|
387
387
|
if (null != s) return s;
|
|
388
388
|
}
|
|
389
389
|
return null;
|
|
390
390
|
}
|
|
391
391
|
remove(t) {
|
|
392
|
-
for (let e = 0; e < this.
|
|
392
|
+
for (let e = 0; e < this._l.length; e++) this._l[e].remove(t);
|
|
393
393
|
}
|
|
394
394
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
pa: "invalid_api_key",
|
|
3
|
+
Ra: "blacklisted",
|
|
4
|
+
ba: "no_device_identifier",
|
|
5
|
+
ma: "invalid_json_response",
|
|
6
|
+
fa: "empty_response",
|
|
7
7
|
__: "sdk_auth_error"
|
|
8
8
|
};
|
package/src/models/identifier.js
CHANGED
package/src/models/push-token.js
CHANGED
|
@@ -2,7 +2,7 @@ import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
|
|
|
2
2
|
export default class ei {
|
|
3
3
|
constructor(t, i, l, s, u) {
|
|
4
4
|
(this.endpoint = t || null),
|
|
5
|
-
(this.
|
|
5
|
+
(this.Dn = i || null),
|
|
6
6
|
(this.publicKey = l || null),
|
|
7
7
|
(this.zl = s || null),
|
|
8
8
|
(this.gl = u || null);
|
|
@@ -10,13 +10,13 @@ export default class ei {
|
|
|
10
10
|
ss() {
|
|
11
11
|
return {
|
|
12
12
|
e: this.endpoint,
|
|
13
|
-
c: this.
|
|
13
|
+
c: this.Dn,
|
|
14
14
|
p: this.publicKey,
|
|
15
15
|
u: this.zl,
|
|
16
16
|
v: this.gl
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
static
|
|
19
|
+
static Sn(t) {
|
|
20
20
|
return new ei(t.e, w(t.c), t.p, t.u, t.v);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -12,7 +12,7 @@ export default class Ft {
|
|
|
12
12
|
}
|
|
13
13
|
ss() {
|
|
14
14
|
return {
|
|
15
|
-
s: "4.
|
|
15
|
+
s: "4.5.1",
|
|
16
16
|
l: this.ul,
|
|
17
17
|
e: this.bl,
|
|
18
18
|
a: this.dl,
|
|
@@ -23,10 +23,10 @@ export default class Ft {
|
|
|
23
23
|
f: this.cl
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
static
|
|
26
|
+
static Sn(t) {
|
|
27
27
|
let s = t.l;
|
|
28
28
|
return (
|
|
29
|
-
"4.
|
|
29
|
+
"4.5.1" !== t.s && (s = 0), new Ft(s, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -10,7 +10,7 @@ import dt from "./Push/utils/push-utils.js";
|
|
|
10
10
|
export default class Lt {
|
|
11
11
|
constructor(t, s, i, e, n, l, h, o, r, a) {
|
|
12
12
|
(this._r = t),
|
|
13
|
-
(this.
|
|
13
|
+
(this.Bo = s),
|
|
14
14
|
(this.kl = 0),
|
|
15
15
|
(this.yl = h.Pa()),
|
|
16
16
|
(this.jl = null),
|
|
@@ -19,16 +19,16 @@ export default class Lt {
|
|
|
19
19
|
(this.v = n),
|
|
20
20
|
(this.gt = l),
|
|
21
21
|
(this.h = h),
|
|
22
|
-
(this.
|
|
22
|
+
(this.Ko = r),
|
|
23
23
|
(this.vt = a),
|
|
24
24
|
(this.$l = o),
|
|
25
25
|
(this.Al = new u()),
|
|
26
26
|
(this.Tl = 50);
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
return !t && !s && this.
|
|
28
|
+
ql(t, s) {
|
|
29
|
+
return !t && !s && this.Ko.Yn() >= this.Tl;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
Fl(t) {
|
|
32
32
|
let s = this.j.gh();
|
|
33
33
|
if (t.length > 0) {
|
|
34
34
|
const i = this.v.getUserId();
|
|
@@ -39,15 +39,15 @@ export default class Lt {
|
|
|
39
39
|
}
|
|
40
40
|
return s;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
null == i && (i = !0), i && this.
|
|
42
|
+
Dl(t, s, i, e, n, l, h) {
|
|
43
|
+
null == i && (i = !0), i && this.Ll();
|
|
44
44
|
const u = this.h.Ua(),
|
|
45
45
|
a = this.h.Ba();
|
|
46
46
|
let c = !1;
|
|
47
47
|
const d = (t, s) => {
|
|
48
48
|
let h = !1;
|
|
49
49
|
b.Hs({
|
|
50
|
-
url: this.
|
|
50
|
+
url: this.Bo + "/data/",
|
|
51
51
|
data: t,
|
|
52
52
|
headers: s,
|
|
53
53
|
S: i => {
|
|
@@ -55,14 +55,14 @@ export default class Lt {
|
|
|
55
55
|
t.respond_with.triggers &&
|
|
56
56
|
(this.kl = Math.max(this.kl - 1, 0)),
|
|
57
57
|
this.vt.Os(t, i, s)
|
|
58
|
-
? (this.
|
|
58
|
+
? (this.Ko.Qs(),
|
|
59
59
|
this.gt.al(i),
|
|
60
60
|
(null != t.respond_with &&
|
|
61
61
|
t.respond_with.user_id != this.v.getUserId()) ||
|
|
62
|
-
(null != t.device && this.h.B(o.q.
|
|
62
|
+
(null != t.device && this.h.B(o.q.Yo, t.device),
|
|
63
63
|
null != t.sdk_metadata &&
|
|
64
|
-
(this.h.B(o.q.
|
|
65
|
-
this.h.B(o.q.
|
|
64
|
+
(this.h.B(o.q.ua, t.sdk_metadata),
|
|
65
|
+
this.h.B(o.q.ha, this.j.ca())),
|
|
66
66
|
this.$l(i),
|
|
67
67
|
"function" == typeof e && e()))
|
|
68
68
|
: i.auth_error && (h = !0);
|
|
@@ -71,91 +71,91 @@ export default class Lt {
|
|
|
71
71
|
null != t.respond_with &&
|
|
72
72
|
t.respond_with.triggers &&
|
|
73
73
|
(this.kl = Math.max(this.kl - 1, 0)),
|
|
74
|
-
this.vt.
|
|
74
|
+
this.vt.la(t.events, t.attributes),
|
|
75
75
|
"function" == typeof n && n();
|
|
76
76
|
},
|
|
77
|
-
|
|
77
|
+
Pl: t => {
|
|
78
78
|
if (("function" == typeof l && l(t), i && !c)) {
|
|
79
|
-
if (t && !h) this.
|
|
79
|
+
if (t && !h) this.Rl();
|
|
80
80
|
else {
|
|
81
81
|
let t = this.jl;
|
|
82
82
|
(null == t || t < 1e3 * this.yl) && (t = 1e3 * this.yl),
|
|
83
|
-
this.
|
|
83
|
+
this.Rl(Math.min(3e5, pt(1e3 * this.yl, 3 * t)));
|
|
84
84
|
}
|
|
85
85
|
c = !0;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
},
|
|
90
|
-
m = this.
|
|
90
|
+
m = this.Fl(u),
|
|
91
91
|
f = s || m;
|
|
92
|
-
if (this.
|
|
92
|
+
if (this.ql(h, m))
|
|
93
93
|
return void r.D.info(
|
|
94
94
|
"Declining to flush data due to 50 consecutive authentication failures"
|
|
95
95
|
);
|
|
96
|
-
if (i && !this.vt.
|
|
97
|
-
return this.
|
|
98
|
-
const g = this.vt.
|
|
96
|
+
if (i && !this.vt.ga(u, a, t, f))
|
|
97
|
+
return this.Rl(), void ("function" == typeof l && l(!0));
|
|
98
|
+
const g = this.vt.qa(t, f, u, a);
|
|
99
99
|
f && this.kl++;
|
|
100
100
|
let p = !1;
|
|
101
101
|
if (g)
|
|
102
102
|
for (const t of g)
|
|
103
103
|
this.vt.Gs(t.requestData, () => d(t.requestData, t.headers)), (p = !0);
|
|
104
|
-
this.
|
|
105
|
-
? this.
|
|
104
|
+
this.Ko.Jn() && i && !p
|
|
105
|
+
? this.Rl()
|
|
106
106
|
: m && (r.D.info("Invoking new session subscriptions"), this.Al.St());
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
Ml() {
|
|
109
109
|
return this.kl > 0;
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
this.
|
|
111
|
+
Rl(t) {
|
|
112
|
+
this.Il ||
|
|
113
113
|
(null == t && (t = 1e3 * this.yl),
|
|
114
|
-
this.
|
|
115
|
-
(this.
|
|
114
|
+
this.Ll(),
|
|
115
|
+
(this.Nl = setTimeout(() => {
|
|
116
116
|
if (document.hidden) {
|
|
117
117
|
const t = "visibilitychange",
|
|
118
118
|
s = () => {
|
|
119
119
|
document.hidden ||
|
|
120
|
-
(document.removeEventListener(t, s, !1), this.
|
|
120
|
+
(document.removeEventListener(t, s, !1), this.Dl());
|
|
121
121
|
};
|
|
122
122
|
document.addEventListener(t, s, !1);
|
|
123
|
-
} else this.
|
|
123
|
+
} else this.Dl();
|
|
124
124
|
}, t)),
|
|
125
125
|
(this.jl = t));
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
null != this.
|
|
127
|
+
Ll() {
|
|
128
|
+
null != this.Nl && (clearTimeout(this.Nl), (this.Nl = null));
|
|
129
129
|
}
|
|
130
130
|
initialize() {
|
|
131
|
-
(this.
|
|
131
|
+
(this.Il = !1), this.Rl();
|
|
132
132
|
}
|
|
133
133
|
destroy() {
|
|
134
134
|
this.Al.removeAllSubscriptions(),
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
137
|
-
(this.
|
|
138
|
-
this.
|
|
139
|
-
(this.
|
|
135
|
+
this.Ko.Wn(),
|
|
136
|
+
this.Ll(),
|
|
137
|
+
(this.Il = !0),
|
|
138
|
+
this.Dl(null, null, !1),
|
|
139
|
+
(this.Nl = null);
|
|
140
140
|
}
|
|
141
141
|
cr(t) {
|
|
142
142
|
return this.Al.ut(t);
|
|
143
143
|
}
|
|
144
144
|
openSession() {
|
|
145
|
-
const t = this.j.
|
|
145
|
+
const t = this.j.ca() !== this.j.mo();
|
|
146
146
|
t && (this.h.ya(o.eu.Jo), this.h.ya(o.eu.su)),
|
|
147
|
-
this.
|
|
148
|
-
this.
|
|
147
|
+
this.Dl(null, !1, null, null, null),
|
|
148
|
+
this.Ln(),
|
|
149
149
|
t &&
|
|
150
150
|
import("./Push/push-manager-factory.js").then(t => {
|
|
151
|
-
if (this.
|
|
151
|
+
if (this.Il) return;
|
|
152
152
|
const s = t.default.aa();
|
|
153
153
|
if (
|
|
154
154
|
null != s &&
|
|
155
155
|
(dt.isPushPermissionGranted() || dt.isPushBlocked())
|
|
156
156
|
) {
|
|
157
157
|
const t = () => {
|
|
158
|
-
s.
|
|
158
|
+
s.Gr()
|
|
159
159
|
? r.D.info(
|
|
160
160
|
"Push token maintenance is disabled, not refreshing token for backend."
|
|
161
161
|
)
|
|
@@ -165,7 +165,7 @@ export default class Lt {
|
|
|
165
165
|
i && t();
|
|
166
166
|
},
|
|
167
167
|
e = () => {
|
|
168
|
-
const s = this.h.I(o.q.
|
|
168
|
+
const s = this.h.I(o.q.Pn);
|
|
169
169
|
(null == s || s) && t();
|
|
170
170
|
},
|
|
171
171
|
n = r.xt.Ft;
|
|
@@ -177,26 +177,26 @@ export default class Lt {
|
|
|
177
177
|
const e = this.v.getUserId();
|
|
178
178
|
if (e !== t) {
|
|
179
179
|
this.j.Gh(),
|
|
180
|
-
null != e && this.
|
|
180
|
+
null != e && this.Dl(null, !1, null, null, null),
|
|
181
181
|
this.v.uu(t),
|
|
182
|
-
i ? this.
|
|
182
|
+
i ? this.Ko.setSdkAuthenticationSignature(i) : this.Ko.Qn();
|
|
183
183
|
for (let t = 0; t < s.length; t++) s[t].changeUser(null == e);
|
|
184
184
|
null != e && this.h.Xs(o.q.P),
|
|
185
|
-
this.h.Xs(o.q.
|
|
185
|
+
this.h.Xs(o.q.Yo),
|
|
186
186
|
this.openSession(),
|
|
187
187
|
r.D.info('Changed user to "' + t + '".');
|
|
188
188
|
} else {
|
|
189
189
|
let s = "Doing nothing.";
|
|
190
190
|
i &&
|
|
191
|
-
this.
|
|
192
|
-
(this.
|
|
191
|
+
this.Ko.Kn() !== i &&
|
|
192
|
+
(this.Ko.setSdkAuthenticationSignature(i),
|
|
193
193
|
(s = "Updated SDK authentication signature")),
|
|
194
194
|
r.D.info(`Current user is already ${t}. ${s}`);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
requestImmediateDataFlush(t) {
|
|
198
|
-
this.
|
|
199
|
-
this.
|
|
198
|
+
this.Ll(), this.j.mo();
|
|
199
|
+
this.Dl(
|
|
200
200
|
null,
|
|
201
201
|
null,
|
|
202
202
|
null,
|
|
@@ -211,15 +211,15 @@ export default class Lt {
|
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
213
|
requestFeedRefresh() {
|
|
214
|
-
this.j.mo(), this.
|
|
214
|
+
this.j.mo(), this.Dl(!0);
|
|
215
215
|
}
|
|
216
216
|
zr(t, s) {
|
|
217
217
|
this.j.mo(),
|
|
218
218
|
r.D.info("Requesting explicit trigger refresh."),
|
|
219
|
-
this.
|
|
219
|
+
this.Dl(null, !0, null, t, s);
|
|
220
220
|
}
|
|
221
221
|
Nn(t, i) {
|
|
222
|
-
const e = r.A.
|
|
222
|
+
const e = r.A.Ol,
|
|
223
223
|
n = { a: t, l: i },
|
|
224
224
|
l = s.G(e, n);
|
|
225
225
|
return l && r.D.info(`Logged alias ${t} with label ${i}`), l;
|
|
@@ -238,7 +238,7 @@ export default class Lt {
|
|
|
238
238
|
null != n && (o.altitude = n),
|
|
239
239
|
null != l && (o.ll_accuracy = l),
|
|
240
240
|
null != h && (o.alt_accuracy = h);
|
|
241
|
-
const u = s.G(r.A.
|
|
241
|
+
const u = s.G(r.A.Ul, o, t);
|
|
242
242
|
return (
|
|
243
243
|
u &&
|
|
244
244
|
r.D.info(
|
|
@@ -249,20 +249,20 @@ export default class Lt {
|
|
|
249
249
|
}
|
|
250
250
|
kr(t, s) {
|
|
251
251
|
const i = this.j.mo();
|
|
252
|
-
return new ue(this.v.getUserId(), r.A.
|
|
252
|
+
return new ue(this.v.getUserId(), r.A.xl, t, i, { cid: s });
|
|
253
253
|
}
|
|
254
|
-
|
|
254
|
+
Ln() {
|
|
255
255
|
const t = r.xt.Ft;
|
|
256
|
-
new r.qt(t, r.D).setItem(t.$t.
|
|
257
|
-
baseUrl: this.
|
|
256
|
+
new r.qt(t, r.D).setItem(t.$t.Kl, 1, {
|
|
257
|
+
baseUrl: this.Bo,
|
|
258
258
|
data: { api_key: this._r, device_id: this.Ur.te().id },
|
|
259
259
|
userId: this.v.getUserId(),
|
|
260
|
-
sdkAuthEnabled: this.
|
|
260
|
+
sdkAuthEnabled: this.Ko.Jn()
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
263
|
wr(t) {
|
|
264
264
|
for (const s of t)
|
|
265
|
-
if (s.api_key === this._r) this.vt.
|
|
265
|
+
if (s.api_key === this._r) this.vt.la(s.events, s.attributes);
|
|
266
266
|
else {
|
|
267
267
|
const t = r.xt.Ft;
|
|
268
268
|
new r.qt(t, r.D).setItem(t.$t.$r, r.it.nt(), s);
|
|
@@ -276,13 +276,13 @@ export default class Lt {
|
|
|
276
276
|
let l, h;
|
|
277
277
|
return (
|
|
278
278
|
null === e && null === n
|
|
279
|
-
? ((l = r.A.
|
|
280
|
-
: ((l = r.A.
|
|
279
|
+
? ((l = r.A.Wl), (h = { key: i }))
|
|
280
|
+
: ((l = r.A.Bl), (h = { key: i, latitude: e, longitude: n })),
|
|
281
281
|
s.G(l, h)
|
|
282
282
|
);
|
|
283
283
|
}
|
|
284
284
|
$n(t, i) {
|
|
285
285
|
const e = { group_id: t, status: i };
|
|
286
|
-
return s.G(r.A.
|
|
286
|
+
return s.G(r.A.Gl, e);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import kt from "./filter-set.js";
|
|
2
2
|
export default class Dt {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.Jl = t), (this.
|
|
4
|
+
(this.Jl = t), (this.Ql = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.Jl || null == this.
|
|
6
|
+
Hl(t) {
|
|
7
|
+
if (null == this.Jl || null == this.Ql) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
r = t[1];
|
|
10
|
-
return s === this.Jl && this.Hl
|
|
10
|
+
return s === this.Jl && this.Ql.Hl(r);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new Dt(
|
|
@@ -16,6 +16,6 @@ export default class Dt {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
ss() {
|
|
19
|
-
return { e: this.Jl, pf: this.
|
|
19
|
+
return { e: this.Jl, pf: this.Ql.ss() };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -4,13 +4,13 @@ export default class kt {
|
|
|
4
4
|
constructor(t) {
|
|
5
5
|
this.filters = t;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
Hl(t) {
|
|
8
8
|
let r = !0;
|
|
9
9
|
for (let e = 0; e < this.filters.length; e++) {
|
|
10
10
|
const o = this.filters[e];
|
|
11
11
|
let s = !1;
|
|
12
12
|
for (let r = 0; r < o.length; r++)
|
|
13
|
-
if (o[r].
|
|
13
|
+
if (o[r].Hl(t)) {
|
|
14
14
|
s = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -42,12 +42,12 @@ export default class kt {
|
|
|
42
42
|
}
|
|
43
43
|
return t;
|
|
44
44
|
}
|
|
45
|
-
static
|
|
45
|
+
static Sn(t) {
|
|
46
46
|
const r = [];
|
|
47
47
|
for (let e = 0; e < t.length; e++) {
|
|
48
48
|
const o = [],
|
|
49
49
|
s = t[e];
|
|
50
|
-
for (let t = 0; t < s.length; t++) o.push(Gt.
|
|
50
|
+
for (let t = 0; t < s.length; t++) o.push(Gt.Sn(s[t]));
|
|
51
51
|
r.push(o);
|
|
52
52
|
}
|
|
53
53
|
return new kt(r);
|