@braze/web-sdk 6.3.1 → 6.4.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 +35 -3
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +23 -23
- package/shared-lib/guid.js +2 -2
- package/shared-lib/indexed-db-adapter.js +7 -7
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +22 -21
- package/src/Banner/display/banner-to-html.js +2 -2
- package/src/Banner/display/detect-banner-impressions.js +7 -7
- package/src/Banner/index.js +2 -0
- package/src/Banner/request-banners-refresh.js +6 -6
- package/src/Banner/ui/insert-banner.js +4 -4
- package/src/Card/card-manager-factory.js +5 -5
- package/src/Card/card-manager.js +4 -4
- package/src/Card/display/card-display.js +7 -7
- package/src/Card/log-card-dismissal.js +3 -3
- package/src/Card/log-content-card-click.js +3 -3
- package/src/Card/log-content-card-impressions.js +6 -6
- package/src/Card/models/card.js +7 -7
- package/src/Card/util/card-factory.js +6 -6
- package/src/ContentCards/content-cards-provider-factory.js +14 -10
- package/src/ContentCards/content-cards-provider.js +28 -28
- package/src/ContentCards/content-cards.js +4 -4
- package/src/ContentCards/get-cached-content-cards.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +2 -2
- package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
- package/src/ContentCards/ui/show-content-cards.js +8 -8
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +5 -5
- package/src/Core/disable-sdk.js +3 -3
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/get-user.js +1 -1
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/log-custom-event.js +9 -9
- package/src/Core/log-purchase.js +7 -7
- package/src/Core/open-session.js +11 -11
- package/src/Core/set-sdk-authentication-signature.js +2 -2
- package/src/Core/wipe-data.js +5 -5
- package/src/DUST/dust-provider-factory.js +20 -0
- package/src/DUST/dust-provider.js +288 -0
- package/src/DUST/index.js +3 -0
- package/src/DUST/subscribe-to-dust.js +24 -0
- package/src/DUST/types.js +1 -0
- package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
- package/src/FeatureFlags/feature-flags-provider.js +38 -38
- package/src/FeatureFlags/get-all-feature-flags.js +3 -3
- package/src/FeatureFlags/get-feature-flag.js +3 -3
- package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
- package/src/FeatureFlags/refresh-feature-flags.js +5 -5
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +5 -5
- package/src/InAppMessage/display/in-app-message-to-html.js +22 -22
- 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 +80 -80
- package/src/InAppMessage/log-in-app-message-button-click.js +5 -5
- package/src/InAppMessage/log-in-app-message-click.js +5 -5
- package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
- 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 +12 -12
- package/src/InAppMessage/models/html-message.js +14 -14
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +119 -121
- package/src/InAppMessage/models/modal-message.js +12 -12
- package/src/InAppMessage/models/slide-up-message.js +21 -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/remove-all-visible-in-app-messages.js +18 -0
- package/src/InAppMessage/ui/show-in-app-message.js +24 -24
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager-factory.js +8 -8
- package/src/Push/push-manager.js +90 -90
- package/src/Push/utils/push-utils.js +17 -17
- package/src/User/user-manager.js +12 -12
- package/src/User/user.js +48 -48
- package/src/common/constants.js +1 -0
- package/src/common/content-cards-display.js +20 -20
- package/src/common/event-logger.js +4 -4
- package/src/common/properties-base.js +16 -16
- package/src/l10n/l10n-manager-factory.js +2 -2
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/auth-manager.js +29 -29
- package/src/managers/braze-instance.js +141 -133
- package/src/managers/device-manager.js +18 -18
- package/src/managers/network-manager.js +139 -139
- package/src/managers/server-config-manager.js +99 -82
- package/src/managers/session-manager.js +32 -32
- package/src/managers/storage-manager-factory.js +8 -8
- package/src/managers/storage-manager.js +76 -74
- package/src/managers/subscription-manager.js +10 -10
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +9 -9
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +12 -12
- package/src/models/push-token.js +12 -12
- package/src/models/request-result.js +1 -1
- package/src/models/server-config.js +38 -34
- package/src/request-controller.js +136 -134
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +30 -30
- 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 +2 -2
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +36 -36
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +15 -15
- package/src/triggers/triggers-provider-factory.js +3 -3
- package/src/triggers/triggers-provider.js +25 -25
- 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 +3 -3
- package/src/util/browser-detector.js +13 -13
- package/src/util/client-hints-parser.js +6 -6
- package/src/util/component-utils.js +1 -1
- package/src/util/dom-utils.js +10 -10
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +22 -22
- package/src/util/user-agent-parser.js +14 -14
- package/src/util/validation-utils.js +9 -9
- package/src/util/window-utils.js +1 -1
|
@@ -11,51 +11,55 @@ export default class ni {
|
|
|
11
11
|
e = null,
|
|
12
12
|
l = null,
|
|
13
13
|
r = { enabled: !1 },
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
n = { enabled: !1, refresh_rate_limit: void 0 },
|
|
15
|
+
a = { enabled: !0, capacity: hi, refill_rate: li, endpoint_overrides: {} },
|
|
16
16
|
o = null,
|
|
17
|
+
c = null,
|
|
17
18
|
) {
|
|
18
|
-
(this.
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
19
|
+
(this.Dl = t),
|
|
20
|
+
(this.Il = i),
|
|
21
|
+
(this.Ml = s),
|
|
22
|
+
(this.Sl = h),
|
|
23
|
+
(this.Pl = e),
|
|
24
|
+
(this.xl = l),
|
|
25
|
+
(this.Gl = r),
|
|
26
|
+
(this.je = n),
|
|
27
|
+
(this.kl = a),
|
|
27
28
|
(this.banners = o),
|
|
28
|
-
(this.
|
|
29
|
-
(this.
|
|
30
|
-
(this.
|
|
31
|
-
(this.
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
35
|
-
(this.
|
|
36
|
-
(this.
|
|
37
|
-
(this.
|
|
29
|
+
(this.dust = c),
|
|
30
|
+
(this.Dl = t),
|
|
31
|
+
(this.Il = i),
|
|
32
|
+
(this.Ml = s),
|
|
33
|
+
(this.Sl = h),
|
|
34
|
+
(this.Pl = e),
|
|
35
|
+
(this.xl = l),
|
|
36
|
+
(this.Gl = r),
|
|
37
|
+
(this.je = n),
|
|
38
|
+
(this.kl = a),
|
|
39
|
+
(this.banners = o),
|
|
40
|
+
(this.dust = c);
|
|
38
41
|
}
|
|
39
42
|
dt() {
|
|
40
43
|
return {
|
|
41
|
-
s: "6.
|
|
42
|
-
l: this.
|
|
43
|
-
e: this.
|
|
44
|
-
a: this.
|
|
45
|
-
p: this.
|
|
46
|
-
m: this.
|
|
47
|
-
v: this.
|
|
48
|
-
c: this.
|
|
49
|
-
f: this.
|
|
50
|
-
grl: this.
|
|
44
|
+
s: "6.4.0",
|
|
45
|
+
l: this.Dl,
|
|
46
|
+
e: this.Il,
|
|
47
|
+
a: this.Ml,
|
|
48
|
+
p: this.Sl,
|
|
49
|
+
m: this.Pl,
|
|
50
|
+
v: this.xl,
|
|
51
|
+
c: this.Gl,
|
|
52
|
+
f: this.je,
|
|
53
|
+
grl: this.kl,
|
|
51
54
|
b: this.banners,
|
|
55
|
+
d: this.dust,
|
|
52
56
|
};
|
|
53
57
|
}
|
|
54
|
-
static
|
|
58
|
+
static Vo(t) {
|
|
55
59
|
let i = t.l;
|
|
56
60
|
return (
|
|
57
|
-
"6.
|
|
58
|
-
new ni(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
|
|
61
|
+
"6.4.0" !== t.s && (i = 0),
|
|
62
|
+
new ni(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b, t.d)
|
|
59
63
|
);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
@@ -2,70 +2,71 @@ import a from "./util/net.js";
|
|
|
2
2
|
import ue from "./models/braze-event.js";
|
|
3
3
|
import c from "./common/event-logger.js";
|
|
4
4
|
import { randomInclusive as l } from "./util/math.js";
|
|
5
|
-
import
|
|
5
|
+
import G from "./models/request-result.js";
|
|
6
6
|
import {
|
|
7
7
|
logger as E,
|
|
8
|
-
IndexedDBAdapter as
|
|
9
|
-
Guid as
|
|
8
|
+
IndexedDBAdapter as it,
|
|
9
|
+
Guid as L,
|
|
10
10
|
EventTypes as m,
|
|
11
11
|
} from "../shared-lib/index.js";
|
|
12
12
|
import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
|
|
13
13
|
import u from "./managers/subscription-manager.js";
|
|
14
|
-
import
|
|
14
|
+
import vt from "./Push/utils/push-utils.js";
|
|
15
15
|
import h from "./util/request-header-utils.js";
|
|
16
|
+
import { removeAllVisibleInAppMessages as oi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
|
|
16
17
|
export default class Wt {
|
|
17
18
|
constructor(t, i, s, e, h, n, o, r, l, a) {
|
|
18
|
-
(this.
|
|
19
|
+
(this.Pn = t),
|
|
19
20
|
(this.baseUrl = i),
|
|
20
21
|
(this.C = s),
|
|
21
|
-
(this.
|
|
22
|
+
(this.Dn = e),
|
|
22
23
|
(this.Cs = h),
|
|
23
24
|
(this.h = n),
|
|
24
25
|
(this.j = o),
|
|
25
|
-
(this
|
|
26
|
-
(this.
|
|
26
|
+
(this.fc = r),
|
|
27
|
+
(this.La = l),
|
|
27
28
|
(this.B = a),
|
|
28
|
-
(this.
|
|
29
|
+
(this.Pn = t),
|
|
29
30
|
(this.baseUrl = i),
|
|
30
|
-
(this.
|
|
31
|
-
(this.
|
|
32
|
-
(this.
|
|
31
|
+
(this.vc = 0),
|
|
32
|
+
(this.bE = o.dE() || 0),
|
|
33
|
+
(this.bc = null),
|
|
33
34
|
(this.C = s),
|
|
34
|
-
(this.
|
|
35
|
+
(this.Dn = e),
|
|
35
36
|
(this.Cs = h),
|
|
36
37
|
(this.h = n),
|
|
37
38
|
(this.j = o),
|
|
38
|
-
(this.
|
|
39
|
+
(this.La = l),
|
|
39
40
|
(this.B = a),
|
|
40
|
-
(this
|
|
41
|
-
(this.
|
|
42
|
-
(this.
|
|
43
|
-
(this.
|
|
44
|
-
(this.
|
|
45
|
-
(this.
|
|
41
|
+
(this.fc = r),
|
|
42
|
+
(this.wc = new u()),
|
|
43
|
+
(this.kc = null),
|
|
44
|
+
(this.yc = 50),
|
|
45
|
+
(this.jc = !1),
|
|
46
|
+
(this.Sc = !1);
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
return !t && !i && this.
|
|
48
|
+
Ac(t, i) {
|
|
49
|
+
return !t && !i && this.La.Jh() >= this.yc;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
let i = this.C.
|
|
51
|
+
Dc(t) {
|
|
52
|
+
let i = this.C.Ul();
|
|
52
53
|
if (t.length > 0) {
|
|
53
54
|
const s = this.Cs.getUserId();
|
|
54
55
|
for (const e of t) {
|
|
55
56
|
const t = (!e.userId && !s) || e.userId === s;
|
|
56
|
-
e.type === m.
|
|
57
|
+
e.type === m.sm && t && (i = !0);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
return i;
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
i && this.
|
|
62
|
+
$c(t = !1, i = !0, e, n, o, r = !1, u = !1) {
|
|
63
|
+
i && this.qc();
|
|
63
64
|
const c = this.j.RE(),
|
|
64
65
|
d = this.j.IE();
|
|
65
66
|
let m = !1;
|
|
66
67
|
const f = (t, r, u = -1) => {
|
|
67
68
|
const c = new Date().valueOf();
|
|
68
|
-
h.K(this.j, h.H.
|
|
69
|
+
h.K(this.j, h.H.Yi, c),
|
|
69
70
|
-1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
|
|
70
71
|
let d = !1;
|
|
71
72
|
a.O({
|
|
@@ -75,18 +76,18 @@ export default class Wt {
|
|
|
75
76
|
W: (i) => {
|
|
76
77
|
null != t.respond_with &&
|
|
77
78
|
t.respond_with.triggers &&
|
|
78
|
-
(this.
|
|
79
|
+
(this.vc = Math.max(this.vc - 1, 0)),
|
|
79
80
|
this.B.Y(t, i, r)
|
|
80
|
-
? (this.
|
|
81
|
-
this.h.
|
|
81
|
+
? (this.La.Z(),
|
|
82
|
+
this.h.Nl(i),
|
|
82
83
|
(null != t.respond_with &&
|
|
83
84
|
t.respond_with.user_id != this.Cs.getUserId()) ||
|
|
84
|
-
(null != t.device && this.j.ft(s.ct.
|
|
85
|
+
(null != t.device && this.j.ft(s.ct.ac, t.device),
|
|
85
86
|
null != t.sdk_metadata &&
|
|
86
|
-
(this.j.ft(s.ct.
|
|
87
|
-
this.j.ft(s.ct.
|
|
88
|
-
this
|
|
89
|
-
h.
|
|
87
|
+
(this.j.ft(s.ct.ku, t.sdk_metadata),
|
|
88
|
+
this.j.ft(s.ct.wu, this.C.bt())),
|
|
89
|
+
this.fc(i),
|
|
90
|
+
h.Wu(this.j, h.H.Yi, 1),
|
|
90
91
|
"function" == typeof e && e()))
|
|
91
92
|
: i.auth_error && (d = !0);
|
|
92
93
|
},
|
|
@@ -94,13 +95,13 @@ export default class Wt {
|
|
|
94
95
|
(d = !0),
|
|
95
96
|
null != t.respond_with &&
|
|
96
97
|
t.respond_with.triggers &&
|
|
97
|
-
(this.
|
|
98
|
-
this.B.
|
|
98
|
+
(this.vc = Math.max(this.vc - 1, 0)),
|
|
99
|
+
this.B.Bu(t.events, t.attributes),
|
|
99
100
|
"function" == typeof n && n();
|
|
100
101
|
},
|
|
101
102
|
tt: (t, s) => {
|
|
102
103
|
"function" == typeof o && o(!d);
|
|
103
|
-
const e = this.B.
|
|
104
|
+
const e = this.B.il(s);
|
|
104
105
|
let n = 0;
|
|
105
106
|
if (e)
|
|
106
107
|
switch (e.type) {
|
|
@@ -112,97 +113,97 @@ export default class Wt {
|
|
|
112
113
|
}
|
|
113
114
|
if (i && !m) {
|
|
114
115
|
if (d) {
|
|
115
|
-
h.
|
|
116
|
-
let t = this.
|
|
117
|
-
(null == t || t < 1e3 * this.
|
|
118
|
-
const i = Math.min(3e5, l(1e3 * this.
|
|
119
|
-
this.
|
|
120
|
-
} else this.
|
|
116
|
+
h.sl(this.j, h.H.Yi);
|
|
117
|
+
let t = this.bc;
|
|
118
|
+
(null == t || t < 1e3 * this.bE) && (t = 1e3 * this.bE);
|
|
119
|
+
const i = Math.min(3e5, l(1e3 * this.bE, 3 * t)) + n;
|
|
120
|
+
this.Cc(i);
|
|
121
|
+
} else this.Cc(Math.max(1e3 * this.bE, n));
|
|
121
122
|
m = !0;
|
|
122
123
|
}
|
|
123
124
|
},
|
|
124
125
|
});
|
|
125
126
|
},
|
|
126
|
-
g = this.
|
|
127
|
-
|
|
128
|
-
if (this.
|
|
127
|
+
g = this.Dc(c),
|
|
128
|
+
p = t || g;
|
|
129
|
+
if (this.Ac(r, g))
|
|
129
130
|
return void E.info(
|
|
130
131
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
131
132
|
);
|
|
132
|
-
if (i && !this.B.
|
|
133
|
-
return this.
|
|
134
|
-
const
|
|
135
|
-
|
|
133
|
+
if (i && !this.B.Fu(c, d, p))
|
|
134
|
+
return this.Cc(), void ("function" == typeof o && o(!0));
|
|
135
|
+
const v = this.B.Ku(p, c, d, u);
|
|
136
|
+
p && this.vc++;
|
|
136
137
|
let b = !1;
|
|
137
|
-
if (
|
|
138
|
-
for (const t of
|
|
138
|
+
if (v)
|
|
139
|
+
for (const t of v)
|
|
139
140
|
this.B.J(
|
|
140
141
|
t.requestData,
|
|
141
142
|
(i) => f(t.requestData, t.headers, i),
|
|
142
|
-
h.H.
|
|
143
|
+
h.H.Yi,
|
|
143
144
|
n,
|
|
144
145
|
),
|
|
145
146
|
(b = !0);
|
|
146
|
-
this.
|
|
147
|
-
? this.
|
|
147
|
+
this.La.wh() && i && !b
|
|
148
|
+
? this.Cc()
|
|
148
149
|
: g &&
|
|
149
150
|
(E.info("Invoking new session subscriptions"),
|
|
150
|
-
this.
|
|
151
|
-
(this.
|
|
151
|
+
this.wc.L(),
|
|
152
|
+
(this.Sc = !0));
|
|
152
153
|
}
|
|
153
|
-
|
|
154
|
-
return this.
|
|
154
|
+
Mc() {
|
|
155
|
+
return this.vc > 0;
|
|
155
156
|
}
|
|
156
|
-
|
|
157
|
-
this.
|
|
158
|
-
(this.
|
|
159
|
-
(this.
|
|
157
|
+
Cc(t = 1e3 * this.bE) {
|
|
158
|
+
this.jc ||
|
|
159
|
+
(this.qc(),
|
|
160
|
+
(this.kc = window.setTimeout(() => {
|
|
160
161
|
if (document.hidden) {
|
|
161
162
|
const t = "visibilitychange",
|
|
162
163
|
i = () => {
|
|
163
164
|
document.hidden ||
|
|
164
|
-
(document.removeEventListener(t, i, !1), this
|
|
165
|
+
(document.removeEventListener(t, i, !1), this.$c());
|
|
165
166
|
};
|
|
166
167
|
document.addEventListener(t, i, !1);
|
|
167
|
-
} else this
|
|
168
|
+
} else this.$c();
|
|
168
169
|
}, t)),
|
|
169
|
-
(this.
|
|
170
|
+
(this.bc = t));
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
-
null != this.
|
|
172
|
+
qc() {
|
|
173
|
+
null != this.kc && (clearTimeout(this.kc), (this.kc = null));
|
|
173
174
|
}
|
|
174
175
|
initialize() {
|
|
175
|
-
(this.
|
|
176
|
+
(this.jc = !1), this.Cc();
|
|
176
177
|
}
|
|
177
178
|
destroy() {
|
|
178
|
-
this.
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
181
|
-
(this.
|
|
182
|
-
this
|
|
183
|
-
(this.
|
|
184
|
-
(this.
|
|
179
|
+
this.wc.removeAllSubscriptions(),
|
|
180
|
+
this.La.Gh(),
|
|
181
|
+
this.qc(),
|
|
182
|
+
(this.jc = !0),
|
|
183
|
+
this.$c(void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
184
|
+
(this.kc = null),
|
|
185
|
+
(this.Sc = !1);
|
|
185
186
|
}
|
|
186
187
|
rn(t) {
|
|
187
|
-
return this.
|
|
188
|
+
return this.Sc ? (t(), null) : this.wc.wt(t);
|
|
188
189
|
}
|
|
189
190
|
openSession() {
|
|
190
|
-
const t = this.C.bt() !== this.C.
|
|
191
|
-
t && (this.j.hE(s.iu.
|
|
192
|
-
this
|
|
193
|
-
t && (this.j.Nt(s.ct.
|
|
191
|
+
const t = this.C.bt() !== this.C.Fo();
|
|
192
|
+
t && (this.j.hE(s.iu.Oa), this.j.hE(s.iu.su)),
|
|
193
|
+
this.$c(!1, void 0, () => {
|
|
194
|
+
t && (this.j.Nt(s.ct.Ne), this.j.Nt(s.ct.It));
|
|
194
195
|
}),
|
|
195
|
-
this.
|
|
196
|
+
this.Au(),
|
|
196
197
|
t &&
|
|
197
198
|
import("./Push/push-manager-factory.js").then((t) => {
|
|
198
|
-
if (this.
|
|
199
|
+
if (this.jc) return;
|
|
199
200
|
const i = t.default.ea();
|
|
200
201
|
if (
|
|
201
202
|
null != i &&
|
|
202
|
-
(
|
|
203
|
+
(vt.isPushPermissionGranted() || vt.isPushBlocked())
|
|
203
204
|
) {
|
|
204
205
|
const t = () => {
|
|
205
|
-
i.
|
|
206
|
+
i.Rn()
|
|
206
207
|
? E.info(
|
|
207
208
|
"Push token maintenance is disabled, not refreshing token for backend.",
|
|
208
209
|
)
|
|
@@ -212,55 +213,56 @@ export default class Wt {
|
|
|
212
213
|
s && t();
|
|
213
214
|
},
|
|
214
215
|
h = () => {
|
|
215
|
-
const i = this.j.lt(s.ct.
|
|
216
|
+
const i = this.j.lt(s.ct.Wo);
|
|
216
217
|
(null == i || i) && t();
|
|
217
218
|
},
|
|
218
|
-
n =
|
|
219
|
-
new
|
|
219
|
+
n = it.Us.Rs;
|
|
220
|
+
new it(n, E).kr(n.Fs.cu, e, h);
|
|
220
221
|
}
|
|
221
222
|
});
|
|
222
223
|
}
|
|
223
|
-
|
|
224
|
-
this.j.Nt(s.ct.
|
|
224
|
+
Tc() {
|
|
225
|
+
this.j.Nt(s.ct.Se), this.j.Nt(s.ct.Ps), this.j.Nt(s.ct.yn);
|
|
225
226
|
}
|
|
226
|
-
|
|
227
|
+
Lc() {
|
|
227
228
|
var t, i;
|
|
228
|
-
this.j.Nt(s.ct.
|
|
229
|
+
this.j.Nt(s.ct.tl), this.j.Nt(s.ct.SE);
|
|
229
230
|
const e = h.H;
|
|
230
231
|
for (const i in e) {
|
|
231
232
|
const s = e[i];
|
|
232
|
-
this.B.
|
|
233
|
+
this.B.al(s, null === (t = this.h) || void 0 === t ? void 0 : t.bl(s));
|
|
233
234
|
}
|
|
234
|
-
this.B.
|
|
235
|
+
this.B.rl(null === (i = this.h) || void 0 === i ? void 0 : i.Rl());
|
|
235
236
|
}
|
|
236
237
|
changeUser(t, i, e) {
|
|
237
238
|
const h = this.Cs.getUserId();
|
|
238
239
|
if (h !== t) {
|
|
239
|
-
this.C.
|
|
240
|
-
this.
|
|
241
|
-
|
|
240
|
+
this.C.tm(),
|
|
241
|
+
this.Tc(),
|
|
242
|
+
oi(),
|
|
243
|
+
null != h && this.$c(void 0, !1, void 0, void 0, void 0),
|
|
242
244
|
this.Cs.ou(t),
|
|
243
|
-
e ? this.
|
|
245
|
+
e ? this.La.setSdkAuthenticationSignature(e) : this.La.yh();
|
|
244
246
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
|
|
245
247
|
this.B.fo(),
|
|
246
248
|
null != h && this.j.Nt(s.ct.rE),
|
|
247
|
-
this.j.Nt(s.ct.
|
|
249
|
+
this.j.Nt(s.ct.ac),
|
|
248
250
|
this.j.Nt(s.ct.uE),
|
|
249
|
-
this.
|
|
251
|
+
this.Lc(),
|
|
250
252
|
this.openSession(),
|
|
251
253
|
E.info('Changed user to "' + t + '".');
|
|
252
254
|
} else {
|
|
253
255
|
let i = "Doing nothing.";
|
|
254
256
|
e &&
|
|
255
|
-
this.
|
|
256
|
-
(this.
|
|
257
|
+
this.La.jh() !== e &&
|
|
258
|
+
(this.La.setSdkAuthenticationSignature(e),
|
|
257
259
|
(i = "Updated SDK authentication signature")),
|
|
258
260
|
E.info(`Current user is already ${t}. ${i}`);
|
|
259
261
|
}
|
|
260
262
|
}
|
|
261
263
|
requestImmediateDataFlush(t) {
|
|
262
|
-
this.
|
|
263
|
-
this
|
|
264
|
+
this.qc(), this.C.Fo();
|
|
265
|
+
this.$c(
|
|
264
266
|
void 0,
|
|
265
267
|
void 0,
|
|
266
268
|
void 0,
|
|
@@ -271,13 +273,13 @@ export default class Wt {
|
|
|
271
273
|
!0,
|
|
272
274
|
);
|
|
273
275
|
}
|
|
274
|
-
|
|
275
|
-
this.C.
|
|
276
|
+
yr(t, i) {
|
|
277
|
+
this.C.Fo(),
|
|
276
278
|
E.info("Requesting explicit trigger refresh."),
|
|
277
|
-
this
|
|
279
|
+
this.$c(!0, void 0, t, i);
|
|
278
280
|
}
|
|
279
|
-
|
|
280
|
-
const e = m.
|
|
281
|
+
du(t, i) {
|
|
282
|
+
const e = m.Rc,
|
|
281
283
|
h = { a: t, l: i },
|
|
282
284
|
n = c.rt(e, h);
|
|
283
285
|
return (
|
|
@@ -285,10 +287,10 @@ export default class Wt {
|
|
|
285
287
|
n
|
|
286
288
|
);
|
|
287
289
|
}
|
|
288
|
-
|
|
290
|
+
bu(t, i, s) {
|
|
289
291
|
if (this.h.hu(i))
|
|
290
292
|
return (
|
|
291
|
-
E.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new
|
|
293
|
+
E.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new G()
|
|
292
294
|
);
|
|
293
295
|
const e = { key: i, value: s },
|
|
294
296
|
h = c.rt(t, e);
|
|
@@ -303,52 +305,52 @@ export default class Wt {
|
|
|
303
305
|
null != e && (o.altitude = e),
|
|
304
306
|
null != h && (o.ll_accuracy = h),
|
|
305
307
|
null != n && (o.alt_accuracy = n);
|
|
306
|
-
const r = c.rt(m.
|
|
308
|
+
const r = c.rt(m.Fc, o, t || void 0);
|
|
307
309
|
return (
|
|
308
310
|
r &&
|
|
309
311
|
E.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
|
|
310
312
|
r
|
|
311
313
|
);
|
|
312
314
|
}
|
|
313
|
-
|
|
314
|
-
const s = this.C.
|
|
315
|
-
return new ue(this.Cs.getUserId(), m.
|
|
315
|
+
$r(t, i) {
|
|
316
|
+
const s = this.C.Fo();
|
|
317
|
+
return new ue(this.Cs.getUserId(), m.Ic, t, s, { cid: i });
|
|
316
318
|
}
|
|
317
|
-
|
|
318
|
-
return new
|
|
319
|
+
Pc(t, i) {
|
|
320
|
+
return new it(t, i);
|
|
319
321
|
}
|
|
320
|
-
|
|
321
|
-
const t =
|
|
322
|
-
this.
|
|
322
|
+
Au() {
|
|
323
|
+
const t = it.Us.Rs;
|
|
324
|
+
this.Pc(t, E).setItem(t.Fs.Yi, 1, {
|
|
323
325
|
baseUrl: this.baseUrl,
|
|
324
|
-
data: { api_key: this.
|
|
326
|
+
data: { api_key: this.Pn, device_id: this.Dn.fe().id },
|
|
325
327
|
userId: this.Cs.getUserId(),
|
|
326
|
-
sdkAuthEnabled: this.
|
|
328
|
+
sdkAuthEnabled: this.La.wh(),
|
|
327
329
|
});
|
|
328
330
|
}
|
|
329
|
-
|
|
331
|
+
Fr(t) {
|
|
330
332
|
for (const i of t)
|
|
331
|
-
if (i.api_key === this.
|
|
333
|
+
if (i.api_key === this.Pn) this.B.Bu(i.events, i.attributes);
|
|
332
334
|
else {
|
|
333
|
-
const t =
|
|
334
|
-
new
|
|
335
|
+
const t = it.Us.Rs;
|
|
336
|
+
new it(t, E).setItem(t.Fs.zr, L.oe(), i);
|
|
335
337
|
}
|
|
336
338
|
}
|
|
337
|
-
|
|
339
|
+
Iu(t, i, s) {
|
|
338
340
|
if (this.h.hu(t))
|
|
339
341
|
return (
|
|
340
|
-
E.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new
|
|
342
|
+
E.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new G()
|
|
341
343
|
);
|
|
342
344
|
let e, h;
|
|
343
345
|
return (
|
|
344
346
|
null === i && null === s
|
|
345
|
-
? ((e = m.
|
|
346
|
-
: ((e = m.
|
|
347
|
+
? ((e = m.xc), (h = { key: t }))
|
|
348
|
+
: ((e = m.Nc), (h = { key: t, latitude: i, longitude: s })),
|
|
347
349
|
c.rt(e, h)
|
|
348
350
|
);
|
|
349
351
|
}
|
|
350
|
-
|
|
352
|
+
Cu(t, i) {
|
|
351
353
|
const s = { group_id: t, status: i };
|
|
352
|
-
return c.rt(m.
|
|
354
|
+
return c.rt(m.Oc, s);
|
|
353
355
|
}
|
|
354
356
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export default class rs {
|
|
2
2
|
constructor(t) {
|
|
3
|
-
(this.
|
|
3
|
+
(this.zc = t), (this.zc = t);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
return null == this.
|
|
5
|
+
Bc(t) {
|
|
6
|
+
return null == this.zc || this.zc === t[0];
|
|
7
7
|
}
|
|
8
8
|
static fromJson(t) {
|
|
9
9
|
return new rs(t ? t.event_name : null);
|
|
10
10
|
}
|
|
11
11
|
dt() {
|
|
12
|
-
return this.
|
|
12
|
+
return this.zc;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import is from "./filter-set.js";
|
|
2
2
|
export default class ls {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.zc = t), (this.tf = s), (this.zc = t), (this.tf = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.
|
|
6
|
+
Bc(t) {
|
|
7
|
+
if (null == this.zc || null == this.tf) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.
|
|
10
|
+
return s === this.zc && this.tf.Bc(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new ls(
|
|
@@ -16,6 +16,6 @@ export default class ls {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
dt() {
|
|
19
|
-
return { e: this.
|
|
19
|
+
return { e: this.zc, pf: this.tf ? this.tf.dt() : null };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isArray as
|
|
1
|
+
import cr from "./filter.js";
|
|
2
|
+
import { isArray as z } from "../../util/code-utils.js";
|
|
3
3
|
export default class is {
|
|
4
4
|
constructor(t) {
|
|
5
5
|
(this.filters = t), (this.filters = t);
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
Bc(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].Bc(t)) {
|
|
14
14
|
s = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -22,12 +22,12 @@ export default class is {
|
|
|
22
22
|
return r;
|
|
23
23
|
}
|
|
24
24
|
static fromJson(t) {
|
|
25
|
-
if (null == t || !
|
|
25
|
+
if (null == t || !z(t)) return null;
|
|
26
26
|
const r = [];
|
|
27
27
|
for (let e = 0; e < t.length; e++) {
|
|
28
28
|
const o = [],
|
|
29
29
|
s = t[e];
|
|
30
|
-
for (let t = 0; t < s.length; t++) o.push(
|
|
30
|
+
for (let t = 0; t < s.length; t++) o.push(cr.fromJson(s[t]));
|
|
31
31
|
r.push(o);
|
|
32
32
|
}
|
|
33
33
|
return new is(r);
|
|
@@ -42,12 +42,12 @@ export default class is {
|
|
|
42
42
|
}
|
|
43
43
|
return t;
|
|
44
44
|
}
|
|
45
|
-
static
|
|
45
|
+
static Vo(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(
|
|
50
|
+
for (let t = 0; t < s.length; t++) o.push(cr.Vo(s[t]));
|
|
51
51
|
r.push(o);
|
|
52
52
|
}
|
|
53
53
|
return new is(r);
|