@braze/web-sdk 5.2.0 → 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 +54 -5
- package/package.json +1 -1
- package/shared-lib/event-types.js +14 -14
- package/shared-lib/indexed-db-adapter.js +51 -51
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +7 -7
- 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 +9 -9
- package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
- package/src/InAppMessage/display/modal-utils.js +5 -5
- package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +78 -75
- 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/full-screen-message.js +12 -12
- package/src/InAppMessage/models/html-message.js +9 -9
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +84 -82
- package/src/InAppMessage/models/modal-message.js +12 -12
- package/src/InAppMessage/models/slide-up-message.js +17 -17
- 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 +17 -17
- package/src/Push/push-manager-factory.js +6 -6
- package/src/Push/push-manager.js +1 -1
- package/src/Push/utils/push-utils.js +1 -1
- package/src/User/user.js +12 -12
- 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 +1 -1
- package/src/managers/auth-manager.js +3 -3
- package/src/managers/braze-instance.js +73 -73
- package/src/managers/device-manager.js +15 -15
- package/src/managers/network-manager.js +190 -145
- package/src/managers/server-config-manager.js +43 -47
- package/src/managers/session-manager.js +21 -21
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +107 -107
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +6 -6
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +8 -8
- package/src/models/server-config.js +25 -25
- package/src/request-controller.js +115 -108
- package/src/triggers/models/custom-event-data.js +2 -2
- package/src/triggers/models/custom-event-property-data.js +4 -4
- package/src/triggers/models/filter-set.js +3 -3
- package/src/triggers/models/filter.js +55 -55
- package/src/triggers/models/in-app-message-click-data.js +8 -8
- package/src/triggers/models/purchase-data.js +2 -2
- package/src/triggers/models/purchase-property-data.js +4 -4
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +40 -40
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +31 -31
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +40 -40
- package/src/ui/js/attach-css.js +2 -2
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +23 -23
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/dom-utils.js +6 -6
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +36 -37
- package/src/util/user-agent-parser.js +7 -7
- package/src/util/window-utils.js +1 -1
package/src/models/identifier.js
CHANGED
|
@@ -5,17 +5,17 @@ export default class _t {
|
|
|
5
5
|
constructor(t, e, i) {
|
|
6
6
|
(this.eu = t),
|
|
7
7
|
null == t && (t = p.W()),
|
|
8
|
-
!i || isNaN(i) ? (this.
|
|
8
|
+
!i || isNaN(i) ? (this.Dl = new Date().valueOf()) : (this.Dl = i),
|
|
9
9
|
(this.eu = t),
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
10
|
+
(this.Wl = new Date().valueOf()),
|
|
11
|
+
(this.Hl = e);
|
|
12
12
|
}
|
|
13
13
|
Y() {
|
|
14
|
-
return `g:${encodeURIComponent(this.eu)}|e:${this.
|
|
15
|
-
this.
|
|
14
|
+
return `g:${encodeURIComponent(this.eu)}|e:${this.Hl}|c:${this.Dl}|l:${
|
|
15
|
+
this.Wl
|
|
16
16
|
}`;
|
|
17
17
|
}
|
|
18
|
-
static
|
|
18
|
+
static hE(t) {
|
|
19
19
|
if ("string" != typeof t) return null;
|
|
20
20
|
const e = t.lastIndexOf("|e:"),
|
|
21
21
|
i = t.substring(0, e),
|
|
@@ -38,7 +38,7 @@ export default class _t {
|
|
|
38
38
|
if (!isNaN(e)) return e;
|
|
39
39
|
};
|
|
40
40
|
(e = new _t(decodeURIComponent(r(i[0])), n(i[1]), n(i[2]))),
|
|
41
|
-
(e.
|
|
41
|
+
(e.Wl = n(i[3]));
|
|
42
42
|
} catch (e) {
|
|
43
43
|
r.info(
|
|
44
44
|
`Unable to parse cookie string ${t}, failed with error: ${si(e)}`,
|
|
@@ -46,7 +46,7 @@ export default class _t {
|
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
48
|
if (null == t || null == t.g) return null;
|
|
49
|
-
(e = new _t(t.g, t.e, t.c)), (e.
|
|
49
|
+
(e = new _t(t.g, t.e, t.c)), (e.Wl = t.l);
|
|
50
50
|
}
|
|
51
51
|
return e;
|
|
52
52
|
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import {
|
|
2
|
-
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as
|
|
3
|
-
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as
|
|
2
|
+
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as Qt,
|
|
3
|
+
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as Yt,
|
|
4
4
|
} from "../common/constants.js";
|
|
5
|
-
export default class
|
|
5
|
+
export default class Ht {
|
|
6
6
|
constructor(
|
|
7
7
|
t = 0,
|
|
8
8
|
i = [],
|
|
9
9
|
s = [],
|
|
10
10
|
h = [],
|
|
11
11
|
e = null,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
r = null,
|
|
13
|
+
l = { enabled: !1 },
|
|
14
14
|
a = { enabled: !1, refresh_rate_limit: void 0 },
|
|
15
|
-
n = { enabled: !0, capacity:
|
|
15
|
+
n = { enabled: !0, capacity: Qt, refill_rate: Yt, endpoint_overrides: {} },
|
|
16
16
|
) {
|
|
17
|
-
(this.
|
|
17
|
+
(this.hl = t),
|
|
18
18
|
(this.gl = i),
|
|
19
19
|
(this.fl = s),
|
|
20
20
|
(this.bl = h),
|
|
21
|
-
(this.
|
|
22
|
-
(this.cl =
|
|
23
|
-
(this.ml =
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
21
|
+
(this.Rl = e),
|
|
22
|
+
(this.cl = r),
|
|
23
|
+
(this.ml = l),
|
|
24
|
+
(this.hi = a),
|
|
25
|
+
(this.ol = n),
|
|
26
|
+
(this.hl = t),
|
|
27
27
|
(this.gl = i),
|
|
28
28
|
(this.fl = s),
|
|
29
29
|
(this.bl = h),
|
|
30
|
-
(this.
|
|
31
|
-
(this.cl =
|
|
32
|
-
(this.ml =
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
30
|
+
(this.Rl = e),
|
|
31
|
+
(this.cl = r),
|
|
32
|
+
(this.ml = l),
|
|
33
|
+
(this.hi = a),
|
|
34
|
+
(this.ol = n);
|
|
35
35
|
}
|
|
36
36
|
Y() {
|
|
37
37
|
return {
|
|
38
|
-
s: "5.
|
|
39
|
-
l: this.
|
|
38
|
+
s: "5.3.0",
|
|
39
|
+
l: this.hl,
|
|
40
40
|
e: this.gl,
|
|
41
41
|
a: this.fl,
|
|
42
42
|
p: this.bl,
|
|
43
|
-
m: this.
|
|
43
|
+
m: this.Rl,
|
|
44
44
|
v: this.cl,
|
|
45
45
|
c: this.ml,
|
|
46
|
-
f: this.
|
|
47
|
-
grl: this.
|
|
46
|
+
f: this.hi,
|
|
47
|
+
grl: this.ol,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
static qn(t) {
|
|
51
51
|
let i = t.l;
|
|
52
52
|
return (
|
|
53
|
-
"5.
|
|
54
|
-
new
|
|
53
|
+
"5.3.0" !== t.s && (i = 0),
|
|
54
|
+
new Ht(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl)
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import C from "./util/net.js";
|
|
2
2
|
import ue from "./models/braze-event.js";
|
|
3
3
|
import s from "./common/event-logger.js";
|
|
4
|
-
import { randomInclusive as
|
|
4
|
+
import { randomInclusive as U } from "./util/math.js";
|
|
5
5
|
import t from "./models/request-result.js";
|
|
6
6
|
import {
|
|
7
7
|
logger as r,
|
|
@@ -12,166 +12,173 @@ import {
|
|
|
12
12
|
import { STORAGE_KEYS as o } from "./managers/storage-manager.js";
|
|
13
13
|
import T from "./managers/subscription-manager.js";
|
|
14
14
|
import vt from "./Push/utils/push-utils.js";
|
|
15
|
-
import
|
|
15
|
+
import D from "./util/request-header-utils.js";
|
|
16
16
|
export default class Lt {
|
|
17
17
|
constructor(t, i, s, e, h, o, n, r, u, l) {
|
|
18
18
|
(this.rn = t),
|
|
19
19
|
(this.baseUrl = i),
|
|
20
|
-
(this.
|
|
20
|
+
(this.ri = s),
|
|
21
21
|
(this.on = e),
|
|
22
22
|
(this.wt = h),
|
|
23
23
|
(this.yt = o),
|
|
24
24
|
(this.u = n),
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
25
|
+
(this.wu = r),
|
|
26
|
+
(this.zo = u),
|
|
27
27
|
(this.qt = l),
|
|
28
28
|
(this.rn = t),
|
|
29
29
|
(this.baseUrl = i),
|
|
30
|
-
(this.
|
|
31
|
-
(this.fE = n.
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
30
|
+
(this.yu = 0),
|
|
31
|
+
(this.fE = n.dE() || 0),
|
|
32
|
+
(this.ju = null),
|
|
33
|
+
(this.ri = s),
|
|
34
34
|
(this.on = e),
|
|
35
35
|
(this.wt = h),
|
|
36
36
|
(this.yt = o),
|
|
37
37
|
(this.u = n),
|
|
38
|
-
(this.
|
|
38
|
+
(this.zo = u),
|
|
39
39
|
(this.qt = l),
|
|
40
|
-
(this.
|
|
41
|
-
(this.
|
|
42
|
-
(this
|
|
43
|
-
(this.
|
|
44
|
-
(this.
|
|
40
|
+
(this.wu = r),
|
|
41
|
+
(this.Su = new T()),
|
|
42
|
+
(this.$u = null),
|
|
43
|
+
(this.Cu = 50),
|
|
44
|
+
(this.Fu = !1);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
return !t && !i && this.
|
|
46
|
+
Lu(t, i) {
|
|
47
|
+
return !t && !i && this.zo.Gh() >= this.Cu;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
let s = this.
|
|
49
|
+
Mu(t) {
|
|
50
|
+
let s = this.ri.Gl();
|
|
51
51
|
if (t.length > 0) {
|
|
52
52
|
const e = this.wt.getUserId();
|
|
53
53
|
for (const h of t) {
|
|
54
54
|
const t = (!h.userId && !e) || h.userId === e;
|
|
55
|
-
h.type === i.
|
|
55
|
+
h.type === i.ql && t && (s = !0);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
return s;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
s && this.
|
|
62
|
-
const a = this.u.
|
|
63
|
-
c = this.u.
|
|
60
|
+
Pu(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) {
|
|
61
|
+
s && this.xu();
|
|
62
|
+
const a = this.u.AE(),
|
|
63
|
+
c = this.u.OE();
|
|
64
64
|
let d = !1;
|
|
65
|
-
const
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
const m = (t, i, r = -1) => {
|
|
66
|
+
let u = !1;
|
|
67
|
+
const l = new Date().valueOf();
|
|
68
|
+
D._s(this.u, D.Ps.$a, l),
|
|
69
|
+
-1 !== r && i.push(["X-Braze-Req-Tokens-Remaining", r.toString()]),
|
|
70
|
+
C.Gs({
|
|
69
71
|
url: this.baseUrl + "/data/",
|
|
70
72
|
data: t,
|
|
71
73
|
headers: i,
|
|
72
74
|
L: (s) => {
|
|
73
75
|
null != t.respond_with &&
|
|
74
76
|
t.respond_with.triggers &&
|
|
75
|
-
(this.
|
|
76
|
-
this.qt.
|
|
77
|
-
? (this.
|
|
78
|
-
this.yt.
|
|
77
|
+
(this.yu = Math.max(this.yu - 1, 0)),
|
|
78
|
+
this.qt.Ks(t, s, i)
|
|
79
|
+
? (this.zo.Os(),
|
|
80
|
+
this.yt.al(s),
|
|
79
81
|
(null != t.respond_with &&
|
|
80
82
|
t.respond_with.user_id != this.wt.getUserId()) ||
|
|
81
|
-
(null != t.device && this.u.k(o.C.
|
|
83
|
+
(null != t.device && this.u.k(o.C.Ca, t.device),
|
|
82
84
|
null != t.sdk_metadata &&
|
|
83
|
-
(this.u.k(o.C.
|
|
84
|
-
this.u.k(o.C.
|
|
85
|
-
this.
|
|
86
|
-
|
|
85
|
+
(this.u.k(o.C.Yh, t.sdk_metadata),
|
|
86
|
+
this.u.k(o.C.Jh, this.ri.Si())),
|
|
87
|
+
this.wu(s),
|
|
88
|
+
D.Qs(this.u, D.Ps.$a, 1),
|
|
87
89
|
"function" == typeof e && e()))
|
|
88
|
-
: s.auth_error && (
|
|
90
|
+
: s.auth_error && (u = !0);
|
|
89
91
|
},
|
|
90
92
|
error: () => {
|
|
91
93
|
null != t.respond_with &&
|
|
92
94
|
t.respond_with.triggers &&
|
|
93
|
-
(this.
|
|
94
|
-
this.qt.
|
|
95
|
+
(this.yu = Math.max(this.yu - 1, 0)),
|
|
96
|
+
this.qt.Qh(t.events, t.attributes),
|
|
95
97
|
"function" == typeof h && h();
|
|
96
98
|
},
|
|
97
|
-
|
|
99
|
+
Ws: (t) => {
|
|
98
100
|
if (("function" == typeof n && n(t), s && !d)) {
|
|
99
|
-
if (t && !
|
|
101
|
+
if (t && !u) this.Iu();
|
|
100
102
|
else {
|
|
101
|
-
|
|
102
|
-
let t = this.
|
|
103
|
+
D.Ys(this.u, D.Ps.$a);
|
|
104
|
+
let t = this.ju;
|
|
103
105
|
(null == t || t < 1e3 * this.fE) && (t = 1e3 * this.fE),
|
|
104
|
-
this.
|
|
106
|
+
this.Iu(Math.min(3e5, U(1e3 * this.fE, 3 * t)));
|
|
105
107
|
}
|
|
106
108
|
d = !0;
|
|
107
109
|
}
|
|
108
110
|
},
|
|
109
111
|
});
|
|
110
112
|
},
|
|
111
|
-
|
|
112
|
-
g = i ||
|
|
113
|
-
if (this
|
|
113
|
+
f = this.Mu(a),
|
|
114
|
+
g = i || f;
|
|
115
|
+
if (this.Lu(u, f))
|
|
114
116
|
return void r.info(
|
|
115
117
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
116
118
|
);
|
|
117
|
-
if (s && !this.qt.
|
|
118
|
-
return this.
|
|
119
|
-
const v = this.qt.
|
|
120
|
-
g && this.
|
|
119
|
+
if (s && !this.qt.Na(a, c, t, g))
|
|
120
|
+
return this.Iu(), void ("function" == typeof n && n(!0));
|
|
121
|
+
const v = this.qt.Xa(t, g, a, c, l);
|
|
122
|
+
g && this.yu++;
|
|
121
123
|
let p = !1;
|
|
122
124
|
if (v)
|
|
123
125
|
for (const t of v)
|
|
124
|
-
this.qt.
|
|
126
|
+
this.qt.Xs(
|
|
127
|
+
t.requestData,
|
|
128
|
+
(i) => m(t.requestData, t.headers, i),
|
|
129
|
+
D.Ps.$a,
|
|
130
|
+
h,
|
|
131
|
+
),
|
|
125
132
|
(p = !0);
|
|
126
|
-
this.
|
|
127
|
-
? this.
|
|
128
|
-
:
|
|
133
|
+
this.zo.Fh() && s && !p
|
|
134
|
+
? this.Iu()
|
|
135
|
+
: f && (r.info("Invoking new session subscriptions"), this.Su.Dt());
|
|
129
136
|
}
|
|
130
|
-
|
|
131
|
-
return this.
|
|
137
|
+
Nu() {
|
|
138
|
+
return this.yu > 0;
|
|
132
139
|
}
|
|
133
|
-
|
|
134
|
-
this.
|
|
135
|
-
(this.
|
|
136
|
-
(this
|
|
140
|
+
Iu(t = 1e3 * this.fE) {
|
|
141
|
+
this.Fu ||
|
|
142
|
+
(this.xu(),
|
|
143
|
+
(this.$u = window.setTimeout(() => {
|
|
137
144
|
if (document.hidden) {
|
|
138
145
|
const t = "visibilitychange",
|
|
139
146
|
i = () => {
|
|
140
147
|
document.hidden ||
|
|
141
|
-
(document.removeEventListener(t, i, !1), this.
|
|
148
|
+
(document.removeEventListener(t, i, !1), this.Pu());
|
|
142
149
|
};
|
|
143
150
|
document.addEventListener(t, i, !1);
|
|
144
|
-
} else this.
|
|
151
|
+
} else this.Pu();
|
|
145
152
|
}, t)),
|
|
146
|
-
(this.
|
|
153
|
+
(this.ju = t));
|
|
147
154
|
}
|
|
148
|
-
|
|
149
|
-
null != this
|
|
155
|
+
xu() {
|
|
156
|
+
null != this.$u && (clearTimeout(this.$u), (this.$u = null));
|
|
150
157
|
}
|
|
151
158
|
initialize() {
|
|
152
|
-
(this.
|
|
159
|
+
(this.Fu = !1), this.Iu();
|
|
153
160
|
}
|
|
154
161
|
destroy() {
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
157
|
-
this.
|
|
158
|
-
(this.
|
|
159
|
-
this.
|
|
160
|
-
(this
|
|
162
|
+
this.Su.removeAllSubscriptions(),
|
|
163
|
+
this.zo.yh(),
|
|
164
|
+
this.xu(),
|
|
165
|
+
(this.Fu = !0),
|
|
166
|
+
this.Pu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
167
|
+
(this.$u = null);
|
|
161
168
|
}
|
|
162
169
|
mr(t) {
|
|
163
|
-
return this.
|
|
170
|
+
return this.Su.It(t);
|
|
164
171
|
}
|
|
165
172
|
openSession() {
|
|
166
|
-
const t = this.
|
|
173
|
+
const t = this.ri.Si() !== this.ri.wo();
|
|
167
174
|
t && (this.u.cE(o.iu.Uo), this.u.cE(o.iu.su)),
|
|
168
|
-
this.
|
|
169
|
-
this.u.
|
|
175
|
+
this.Pu(void 0, !1, void 0, () => {
|
|
176
|
+
this.u.ti(o.C.vi);
|
|
170
177
|
}),
|
|
171
178
|
this.Mn(),
|
|
172
179
|
t &&
|
|
173
180
|
import("./Push/push-manager-factory.js").then((t) => {
|
|
174
|
-
if (this.
|
|
181
|
+
if (this.Fu) return;
|
|
175
182
|
const i = t.default.m();
|
|
176
183
|
if (
|
|
177
184
|
null != i &&
|
|
@@ -196,36 +203,36 @@ export default class Lt {
|
|
|
196
203
|
}
|
|
197
204
|
});
|
|
198
205
|
}
|
|
199
|
-
|
|
200
|
-
this.u.
|
|
206
|
+
Ou() {
|
|
207
|
+
this.u.ti(o.C.gi), this.u.ti(o.C.ws), this.u.ti(o.C.Cr);
|
|
201
208
|
}
|
|
202
209
|
changeUser(t, i, s) {
|
|
203
210
|
const e = this.wt.getUserId();
|
|
204
211
|
if (e !== t) {
|
|
205
|
-
this.
|
|
206
|
-
this.
|
|
207
|
-
null != e && this.
|
|
212
|
+
this.ri.yl(),
|
|
213
|
+
this.Ou(),
|
|
214
|
+
null != e && this.Pu(void 0, !1, void 0, void 0, void 0),
|
|
208
215
|
this.wt.ou(t),
|
|
209
|
-
s ? this.
|
|
216
|
+
s ? this.zo.setSdkAuthenticationSignature(s) : this.zo.xh();
|
|
210
217
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == e);
|
|
211
|
-
null != e && this.u.
|
|
212
|
-
this.u.
|
|
213
|
-
this.u.
|
|
214
|
-
this.u.
|
|
218
|
+
null != e && this.u.ti(o.C.J),
|
|
219
|
+
this.u.ti(o.C.Ca),
|
|
220
|
+
this.u.ti(o.C.nE),
|
|
221
|
+
this.u.ti(o.C._E),
|
|
215
222
|
this.openSession(),
|
|
216
223
|
r.info('Changed user to "' + t + '".');
|
|
217
224
|
} else {
|
|
218
225
|
let i = "Doing nothing.";
|
|
219
226
|
s &&
|
|
220
|
-
this.
|
|
221
|
-
(this.
|
|
227
|
+
this.zo.kh() !== s &&
|
|
228
|
+
(this.zo.setSdkAuthenticationSignature(s),
|
|
222
229
|
(i = "Updated SDK authentication signature")),
|
|
223
230
|
r.info(`Current user is already ${t}. ${i}`);
|
|
224
231
|
}
|
|
225
232
|
}
|
|
226
233
|
requestImmediateDataFlush(t) {
|
|
227
|
-
this.
|
|
228
|
-
this.
|
|
234
|
+
this.xu(), this.ri.wo();
|
|
235
|
+
this.Pu(
|
|
229
236
|
void 0,
|
|
230
237
|
void 0,
|
|
231
238
|
void 0,
|
|
@@ -238,19 +245,19 @@ export default class Lt {
|
|
|
238
245
|
);
|
|
239
246
|
}
|
|
240
247
|
requestFeedRefresh() {
|
|
241
|
-
this.
|
|
248
|
+
this.ri.wo(), this.Pu(!0);
|
|
242
249
|
}
|
|
243
250
|
$r(t, i) {
|
|
244
|
-
this.
|
|
251
|
+
this.ri.wo(),
|
|
245
252
|
r.info("Requesting explicit trigger refresh."),
|
|
246
|
-
this.
|
|
253
|
+
this.Pu(void 0, !0, void 0, t, i);
|
|
247
254
|
}
|
|
248
255
|
Cn(t, e) {
|
|
249
|
-
const h = i.
|
|
256
|
+
const h = i.zu,
|
|
250
257
|
n = { a: t, l: e },
|
|
251
258
|
u = s.q(h, n);
|
|
252
259
|
return (
|
|
253
|
-
u && (r.info(`Logged alias ${t} with label ${e}`), this.u.k(o.C.
|
|
260
|
+
u && (r.info(`Logged alias ${t} with label ${e}`), this.u.k(o.C._E, n)), u
|
|
254
261
|
);
|
|
255
262
|
}
|
|
256
263
|
Fn(i, e, h) {
|
|
@@ -271,7 +278,7 @@ export default class Lt {
|
|
|
271
278
|
null != o && (l.altitude = o),
|
|
272
279
|
null != n && (l.ll_accuracy = n),
|
|
273
280
|
null != u && (l.alt_accuracy = u);
|
|
274
|
-
const a = s.q(i.
|
|
281
|
+
const a = s.q(i.Uu, l, t || void 0);
|
|
275
282
|
return (
|
|
276
283
|
a &&
|
|
277
284
|
r.info(`Set user last known location as ${JSON.stringify(l, null, 2)}`),
|
|
@@ -279,24 +286,24 @@ export default class Lt {
|
|
|
279
286
|
);
|
|
280
287
|
}
|
|
281
288
|
kr(t, s) {
|
|
282
|
-
const e = this.
|
|
283
|
-
return new ue(this.wt.getUserId(), i.
|
|
289
|
+
const e = this.ri.wo();
|
|
290
|
+
return new ue(this.wt.getUserId(), i._u, t, e, { cid: s });
|
|
284
291
|
}
|
|
285
|
-
|
|
292
|
+
Bu(t, i) {
|
|
286
293
|
return new A(t, i);
|
|
287
294
|
}
|
|
288
295
|
Mn() {
|
|
289
296
|
const t = A.Yt.Qt;
|
|
290
|
-
this.
|
|
297
|
+
this.Bu(t, r).setItem(t.ss.$a, 1, {
|
|
291
298
|
baseUrl: this.baseUrl,
|
|
292
299
|
data: { api_key: this.rn, device_id: this.on.ce().id },
|
|
293
300
|
userId: this.wt.getUserId(),
|
|
294
|
-
sdkAuthEnabled: this.
|
|
301
|
+
sdkAuthEnabled: this.zo.Fh(),
|
|
295
302
|
});
|
|
296
303
|
}
|
|
297
304
|
yr(t) {
|
|
298
305
|
for (const i of t)
|
|
299
|
-
if (i.api_key === this.rn) this.qt.
|
|
306
|
+
if (i.api_key === this.rn) this.qt.Qh(i.events, i.attributes);
|
|
300
307
|
else {
|
|
301
308
|
const t = A.Yt.Qt;
|
|
302
309
|
new A(t, r).setItem(t.ss.wr, p.W(), i);
|
|
@@ -310,13 +317,13 @@ export default class Lt {
|
|
|
310
317
|
let n, u;
|
|
311
318
|
return (
|
|
312
319
|
null === h && null === o
|
|
313
|
-
? ((n = i.
|
|
314
|
-
: ((n = i.
|
|
320
|
+
? ((n = i.Eu), (u = { key: e }))
|
|
321
|
+
: ((n = i.Ju), (u = { key: e, latitude: h, longitude: o })),
|
|
315
322
|
s.q(n, u)
|
|
316
323
|
);
|
|
317
324
|
}
|
|
318
325
|
Hn(t, e) {
|
|
319
326
|
const h = { group_id: t, status: e };
|
|
320
|
-
return s.q(i.
|
|
327
|
+
return s.q(i.Ku, h);
|
|
321
328
|
}
|
|
322
329
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default class
|
|
1
|
+
export default class Zt {
|
|
2
2
|
constructor(t) {
|
|
3
3
|
(this.Bl = t), (this.Bl = t);
|
|
4
4
|
}
|
|
@@ -6,7 +6,7 @@ export default class ts {
|
|
|
6
6
|
return null == this.Bl || this.Bl === t[0];
|
|
7
7
|
}
|
|
8
8
|
static fromJson(t) {
|
|
9
|
-
return new
|
|
9
|
+
return new Zt(t ? t.event_name : null);
|
|
10
10
|
}
|
|
11
11
|
Y() {
|
|
12
12
|
return this.Bl;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class
|
|
1
|
+
import ts from "./filter-set.js";
|
|
2
|
+
export default class is {
|
|
3
3
|
constructor(t, s) {
|
|
4
4
|
(this.Bl = t), (this.Ml = s), (this.Bl = t), (this.Ml = s);
|
|
5
5
|
}
|
|
@@ -10,9 +10,9 @@ export default class rs {
|
|
|
10
10
|
return s === this.Bl && this.Ml.Jl(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
|
-
return new
|
|
13
|
+
return new is(
|
|
14
14
|
t ? t.event_name : null,
|
|
15
|
-
t ?
|
|
15
|
+
t ? ts.fromJson(t.property_filters) : null,
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
Y() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import lr from "./filter.js";
|
|
2
2
|
import { isArray as j } from "../../util/code-utils.js";
|
|
3
|
-
export default class
|
|
3
|
+
export default class ts {
|
|
4
4
|
constructor(t) {
|
|
5
5
|
(this.filters = t), (this.filters = t);
|
|
6
6
|
}
|
|
@@ -30,7 +30,7 @@ export default class is {
|
|
|
30
30
|
for (let t = 0; t < s.length; t++) o.push(lr.fromJson(s[t]));
|
|
31
31
|
r.push(o);
|
|
32
32
|
}
|
|
33
|
-
return new
|
|
33
|
+
return new ts(r);
|
|
34
34
|
}
|
|
35
35
|
Y() {
|
|
36
36
|
const t = [];
|
|
@@ -50,6 +50,6 @@ export default class is {
|
|
|
50
50
|
for (let t = 0; t < s.length; t++) o.push(lr.qn(s[t]));
|
|
51
51
|
r.push(o);
|
|
52
52
|
}
|
|
53
|
-
return new
|
|
53
|
+
return new ts(r);
|
|
54
54
|
}
|
|
55
55
|
}
|