@braze/web-sdk 6.8.0 → 6.9.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 +99 -19
- package/package.json +1 -1
- package/shared-lib/event-types.js +20 -20
- package/shared-lib/indexed-db-adapter.js +64 -64
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +8 -8
- package/src/Banner/banner-provider.js +67 -59
- package/src/Banner/banner.js +40 -19
- package/src/Banner/dismiss-banner.js +4 -0
- package/src/Banner/display/banner-to-html.js +10 -10
- package/src/Banner/display/destroy-banner-html.js +2 -2
- package/src/Banner/get-all-banners.js +6 -6
- package/src/Banner/get-banner.js +6 -6
- package/src/Banner/index.js +1 -0
- package/src/Banner/log-banner-click.js +7 -7
- package/src/Banner/log-banner-dismissal.js +7 -7
- package/src/Banner/log-banner-impressions.js +10 -10
- package/src/Banner/request-banners-refresh.js +8 -8
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Banner/ui/insert-banner.js +8 -8
- package/src/Card/card-manager.js +31 -31
- package/src/Card/log-card-dismissal.js +2 -2
- package/src/Card/log-content-card-click.js +2 -2
- package/src/Card/log-content-card-impressions.js +4 -4
- package/src/Card/models/captioned-image.js +15 -15
- package/src/Card/models/card.js +89 -89
- package/src/Card/models/classic-card.js +16 -16
- package/src/Card/models/control-card.js +7 -7
- package/src/Card/models/image-only.js +13 -13
- package/src/Card/util/card-factory.js +32 -32
- package/src/ContentCards/content-cards-provider.js +102 -102
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.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/destroy.js +2 -2
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +5 -5
- package/src/Core/log-custom-event.js +5 -5
- package/src/Core/log-ecommerce-event.js +5 -5
- package/src/Core/log-purchase.js +9 -9
- package/src/Core/open-session.js +7 -7
- package/src/Core/set-logger.js +2 -2
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +6 -6
- package/src/DUST/dust-provider.js +249 -240
- package/src/DUST/dust-shared-worker-code.js +1 -1
- package/src/DUST/dust-shared-worker-impl.js +15 -14
- package/src/DUST/dust-worker-bridge.js +50 -35
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +8 -8
- package/src/FeatureFlags/feature-flag.js +3 -3
- package/src/FeatureFlags/feature-flags-provider.js +21 -21
- package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/InAppMessage/constants.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +4 -4
- package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
- package/src/InAppMessage/in-app-message-factory.js +36 -36
- package/src/InAppMessage/in-app-message-manager.js +78 -78
- package/src/InAppMessage/log-in-app-message-button-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
- package/src/InAppMessage/log-in-app-message-impression.js +4 -4
- package/src/InAppMessage/models/control-message.js +4 -4
- package/src/InAppMessage/models/full-screen-message.js +4 -4
- package/src/InAppMessage/models/html-message.js +3 -3
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +12 -12
- package/src/InAppMessage/models/modal-message.js +4 -4
- package/src/InAppMessage/models/slide-up-message.js +4 -4
- 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 +14 -14
- package/src/Push/push-manager-factory.js +2 -2
- package/src/Push/push-manager.js +38 -38
- package/src/Push/utils/push-utils.js +6 -6
- package/src/User/user-manager.js +14 -14
- package/src/User/user.js +25 -25
- package/src/common/base-provider.js +1 -1
- package/src/common/content-cards-display.js +7 -7
- package/src/common/event-logger.js +3 -3
- package/src/common/properties-base.js +3 -3
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +3 -3
- package/src/managers/auth-manager.js +11 -11
- package/src/managers/braze-instance.js +56 -56
- package/src/managers/device-manager.js +10 -10
- package/src/managers/network-manager.js +102 -101
- package/src/managers/server-config-manager.js +115 -98
- package/src/managers/session-manager.js +20 -20
- package/src/managers/storage-manager-factory.js +9 -9
- package/src/managers/storage-manager.js +74 -74
- package/src/managers/subscription-manager.js +2 -2
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +1 -1
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +2 -2
- package/src/models/push-token.js +6 -6
- package/src/models/request-result.js +1 -1
- package/src/models/server-config.js +42 -24
- package/src/request-controller.js +126 -126
- 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 +2 -2
- package/src/triggers/models/filter.js +1 -1
- 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 +33 -33
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +33 -33
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +68 -68
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/braze-actions.js +7 -7
- package/src/util/browser-detector.js +2 -2
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/code-utils.js +2 -2
- package/src/util/deprecation-utils.js +2 -2
- package/src/util/dom-utils.js +7 -7
- package/src/util/ecommerce-event-validation.js +52 -35
- package/src/util/html-display-utils.js +11 -11
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +17 -17
- package/src/util/string-utils.js +2 -2
- package/src/util/user-agent-parser.js +2 -2
- package/src/util/validation-utils.js +12 -12
- package/src/util/window-utils.js +2 -2
|
@@ -11,177 +11,194 @@ import {
|
|
|
11
11
|
} from "../common/constants.js";
|
|
12
12
|
export default class Yt {
|
|
13
13
|
constructor(t) {
|
|
14
|
-
(this.
|
|
15
|
-
(this.
|
|
14
|
+
(this.j = t),
|
|
15
|
+
(this.j = t),
|
|
16
|
+
(this.Gl = new f()),
|
|
17
|
+
(this._l = new f()),
|
|
16
18
|
(this.Vl = new f()),
|
|
17
19
|
(this.Jl = new f()),
|
|
18
20
|
(this.Ql = new f()),
|
|
19
21
|
(this.Wl = new f()),
|
|
20
|
-
(this.Yl =
|
|
21
|
-
(this.Zl = null)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.tc = null != t ? di._u(t) : new di();
|
|
22
|
+
(this.Yl = null),
|
|
23
|
+
(this.Zl = null);
|
|
24
|
+
}
|
|
25
|
+
ed() {
|
|
26
|
+
if (null == this.Zl) {
|
|
27
|
+
const t = this.j.St(s.It.sd);
|
|
28
|
+
this.Zl = null != t ? di._u(t) : new di();
|
|
28
29
|
}
|
|
29
|
-
return this.
|
|
30
|
+
return this.Zl;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
return this.
|
|
32
|
+
Qt() {
|
|
33
|
+
return this.ed().nd;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
var i, e, n, r;
|
|
35
|
+
ld(t) {
|
|
36
|
+
var i, e, n, l, r, o;
|
|
36
37
|
if (null != t && null != t.config) {
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
const t = (t) => (null == t ? this.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
t(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
const u = t.config;
|
|
39
|
+
if (u.time > this.ed().nd) {
|
|
40
|
+
const t = (t) => (null == t ? this.ed().ud : t),
|
|
41
|
+
a = new di(
|
|
42
|
+
u.time,
|
|
43
|
+
u.events_blacklist,
|
|
44
|
+
u.attributes_blacklist,
|
|
45
|
+
u.purchases_blacklist,
|
|
46
|
+
u.messaging_session_timeout,
|
|
47
|
+
u.vapid_public_key,
|
|
48
|
+
u.content_cards,
|
|
49
|
+
u.feature_flags,
|
|
50
|
+
t(u.global_request_rate_limit),
|
|
51
|
+
u.banners,
|
|
52
|
+
u.dust,
|
|
53
|
+
u.request_backoff,
|
|
54
|
+
u.minimum_session_timeout,
|
|
55
|
+
u.conversational_chat,
|
|
54
56
|
);
|
|
55
|
-
let o = !1;
|
|
56
|
-
null != u.uc && this.ju() !== u.uc && (o = !0);
|
|
57
|
-
let a = !1;
|
|
58
|
-
null != u.oc.enabled && this.Bi() !== u.oc.enabled && (a = !0);
|
|
59
57
|
let h = !1;
|
|
60
|
-
null !=
|
|
58
|
+
null != a.ad && this.ju() !== a.ad && (h = !0);
|
|
59
|
+
let d = !1;
|
|
60
|
+
null != a.hd.enabled && this.Pi() !== a.hd.enabled && (d = !0);
|
|
61
61
|
let c = !1;
|
|
62
|
+
null != a.Xr.enabled && this.lo() !== a.Xr.enabled && (c = !0);
|
|
63
|
+
let v = !1;
|
|
62
64
|
null !=
|
|
63
|
-
(null === (i =
|
|
64
|
-
this.
|
|
65
|
-
(null === (e =
|
|
66
|
-
(
|
|
67
|
-
let
|
|
68
|
-
null != (null === (n =
|
|
69
|
-
this.
|
|
70
|
-
(null === (
|
|
71
|
-
(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
(null === (i = a.banners) || void 0 === i ? void 0 : i.enabled) &&
|
|
66
|
+
this.Ot() !==
|
|
67
|
+
(null === (e = a.banners) || void 0 === e ? void 0 : e.enabled) &&
|
|
68
|
+
(v = !0);
|
|
69
|
+
let m = !1;
|
|
70
|
+
null != (null === (n = a.dust) || void 0 === n ? void 0 : n.enabled) &&
|
|
71
|
+
this.fn() !==
|
|
72
|
+
(null === (l = a.dust) || void 0 === l ? void 0 : l.enabled) &&
|
|
73
|
+
(m = !0);
|
|
74
|
+
let g = !1;
|
|
75
|
+
null != (null === (r = a.dd) || void 0 === r ? void 0 : r.enabled) &&
|
|
76
|
+
this.vd() !==
|
|
77
|
+
(null === (o = a.dd) || void 0 === o ? void 0 : o.enabled) &&
|
|
78
|
+
(g = !0),
|
|
79
|
+
(this.Zl = a),
|
|
80
|
+
this.j.Pt(s.It.sd, a.qt()),
|
|
81
|
+
h && this.Gl.A(),
|
|
82
|
+
d && this._l.A(),
|
|
83
|
+
c && this.Vl.A(),
|
|
84
|
+
v && this.Jl.A(),
|
|
85
|
+
m && this.Ql.A(),
|
|
86
|
+
g && this.Wl.A();
|
|
79
87
|
}
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
90
|
xu(t) {
|
|
83
|
-
const i = this.
|
|
84
|
-
return this.
|
|
91
|
+
const i = this.Gl.Ut(t);
|
|
92
|
+
return this.Yl && this.Gl.removeSubscription(this.Yl), (this.Yl = i), i;
|
|
85
93
|
}
|
|
86
|
-
|
|
87
|
-
return this.
|
|
94
|
+
$i(t) {
|
|
95
|
+
return this._l.Ut(t);
|
|
88
96
|
}
|
|
89
97
|
bo(t) {
|
|
90
|
-
return this.
|
|
98
|
+
return this.Vl.Ut(t);
|
|
91
99
|
}
|
|
92
100
|
V(t) {
|
|
93
|
-
return this.
|
|
101
|
+
return this.Jl.Ut(t);
|
|
94
102
|
}
|
|
95
103
|
Tr(t) {
|
|
96
|
-
return this.
|
|
104
|
+
return this.Ql.Ut(t);
|
|
105
|
+
}
|
|
106
|
+
md(t) {
|
|
107
|
+
return this.Wl.Ut(t);
|
|
97
108
|
}
|
|
98
109
|
$e(t) {
|
|
99
|
-
return -1 !== this.
|
|
110
|
+
return -1 !== this.ed().gd.indexOf(t);
|
|
100
111
|
}
|
|
101
112
|
qu(t) {
|
|
102
|
-
return -1 !== this.
|
|
113
|
+
return -1 !== this.ed().bd.indexOf(t);
|
|
103
114
|
}
|
|
104
115
|
$r(t) {
|
|
105
|
-
return -1 !== this.
|
|
116
|
+
return -1 !== this.ed().fd.indexOf(t);
|
|
106
117
|
}
|
|
107
|
-
|
|
108
|
-
return this.
|
|
118
|
+
pd() {
|
|
119
|
+
return this.ed().Rd;
|
|
109
120
|
}
|
|
110
121
|
ju() {
|
|
111
|
-
return this.
|
|
122
|
+
return this.ed().ad;
|
|
112
123
|
}
|
|
113
|
-
|
|
114
|
-
return this.
|
|
124
|
+
Pi() {
|
|
125
|
+
return this.ed().hd.enabled || !1;
|
|
115
126
|
}
|
|
116
|
-
|
|
117
|
-
const t = this.
|
|
127
|
+
Cd() {
|
|
128
|
+
const t = this.ed().ud;
|
|
118
129
|
return !(!t || null == t.enabled) && t.enabled;
|
|
119
130
|
}
|
|
120
|
-
|
|
121
|
-
if (!this.
|
|
122
|
-
const t = this.
|
|
131
|
+
Ul() {
|
|
132
|
+
if (!this.Cd()) return -1;
|
|
133
|
+
const t = this.ed().ud;
|
|
123
134
|
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
|
|
124
135
|
}
|
|
125
|
-
|
|
126
|
-
if (!this.
|
|
127
|
-
const t = this.
|
|
136
|
+
xl() {
|
|
137
|
+
if (!this.Cd()) return -1;
|
|
138
|
+
const t = this.ed().ud;
|
|
128
139
|
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
|
|
129
140
|
}
|
|
130
|
-
|
|
131
|
-
const i = this.
|
|
141
|
+
Ed(t) {
|
|
142
|
+
const i = this.ed().ud.endpoint_overrides;
|
|
132
143
|
return null == i ? null : i[t];
|
|
133
144
|
}
|
|
134
|
-
|
|
135
|
-
const i = this.
|
|
145
|
+
Hl(t) {
|
|
146
|
+
const i = this.Ed(t);
|
|
136
147
|
return null == i || isNaN(i.capacity) || i.capacity <= 0 ? -1 : i.capacity;
|
|
137
148
|
}
|
|
138
|
-
|
|
139
|
-
const i = this.
|
|
149
|
+
Ol(t) {
|
|
150
|
+
const i = this.Ed(t);
|
|
140
151
|
return null == i || isNaN(i.refill_rate) || i.refill_rate <= 0
|
|
141
152
|
? -1
|
|
142
153
|
: i.refill_rate;
|
|
143
154
|
}
|
|
144
155
|
lo() {
|
|
145
|
-
return this.
|
|
146
|
-
? (v.
|
|
147
|
-
: this.
|
|
156
|
+
return this.ed().Xr.enabled && null == this.Ro()
|
|
157
|
+
? (v.Dt(p.Ya, { e: "Missing feature flag refresh_rate_limit." }), !1)
|
|
158
|
+
: this.ed().Xr.enabled || !1;
|
|
148
159
|
}
|
|
149
160
|
Ro() {
|
|
150
|
-
return this.
|
|
161
|
+
return this.ed().Xr.refresh_rate_limit;
|
|
151
162
|
}
|
|
152
|
-
|
|
163
|
+
Ot() {
|
|
153
164
|
var t;
|
|
154
165
|
return (
|
|
155
|
-
(null === (t = this.
|
|
166
|
+
(null === (t = this.ed().banners) || void 0 === t ? void 0 : t.enabled) ||
|
|
156
167
|
null
|
|
157
168
|
);
|
|
158
169
|
}
|
|
159
170
|
re() {
|
|
160
171
|
var t;
|
|
161
172
|
return (
|
|
162
|
-
(null === (t = this.
|
|
173
|
+
(null === (t = this.ed().banners) || void 0 === t
|
|
163
174
|
? void 0
|
|
164
175
|
: t.max_placements) || 0
|
|
165
176
|
);
|
|
166
177
|
}
|
|
167
|
-
|
|
178
|
+
Gt() {
|
|
168
179
|
var t;
|
|
169
180
|
const i =
|
|
170
|
-
null === (t = this.
|
|
181
|
+
null === (t = this.ed().banners) || void 0 === t
|
|
171
182
|
? void 0
|
|
172
183
|
: t.dismissals_cache_size;
|
|
173
184
|
return null != i && "number" == typeof i && i > 0 ? i : u;
|
|
174
185
|
}
|
|
175
|
-
|
|
186
|
+
fn() {
|
|
187
|
+
var t;
|
|
188
|
+
return (
|
|
189
|
+
(null === (t = this.ed().dust) || void 0 === t ? void 0 : t.enabled) || !1
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
vd() {
|
|
176
193
|
var t;
|
|
177
194
|
return (
|
|
178
|
-
(null === (t = this.
|
|
195
|
+
(null === (t = this.ed().dd) || void 0 === t ? void 0 : t.enabled) || !1
|
|
179
196
|
);
|
|
180
197
|
}
|
|
181
198
|
vt() {
|
|
182
199
|
var t;
|
|
183
200
|
const i =
|
|
184
|
-
null === (t = this.
|
|
201
|
+
null === (t = this.ed().wd) || void 0 === t
|
|
185
202
|
? void 0
|
|
186
203
|
: t.min_sleep_duration_ms;
|
|
187
204
|
return null != i ? i : d;
|
|
@@ -189,18 +206,18 @@ export default class Yt {
|
|
|
189
206
|
gt() {
|
|
190
207
|
var t;
|
|
191
208
|
const i =
|
|
192
|
-
null === (t = this.
|
|
209
|
+
null === (t = this.ed().wd) || void 0 === t ? void 0 : t.scale_factor;
|
|
193
210
|
return null != i ? i : m;
|
|
194
211
|
}
|
|
195
212
|
bt() {
|
|
196
213
|
var t;
|
|
197
214
|
const i =
|
|
198
|
-
null === (t = this.
|
|
215
|
+
null === (t = this.ed().wd) || void 0 === t
|
|
199
216
|
? void 0
|
|
200
217
|
: t.max_sleep_duration_ms;
|
|
201
218
|
return null != i ? i : c;
|
|
202
219
|
}
|
|
203
|
-
|
|
204
|
-
return this.
|
|
220
|
+
Bd() {
|
|
221
|
+
return this.ed().Td;
|
|
205
222
|
}
|
|
206
223
|
}
|
|
@@ -3,25 +3,25 @@ import Ie from "../models/braze-event.js";
|
|
|
3
3
|
import _t from "../models/identifier.js";
|
|
4
4
|
import { convertMsToSeconds as X } from "../util/date-utils.js";
|
|
5
5
|
import {
|
|
6
|
-
logger as
|
|
6
|
+
logger as b,
|
|
7
7
|
Guid as V,
|
|
8
8
|
EventTypes as p,
|
|
9
9
|
} from "../../shared-lib/index.js";
|
|
10
10
|
import { DEFAULT_MINIMUM_SESSION_TIMEOUT_IN_MS as ts } from "./constants.js";
|
|
11
11
|
export default class Xt {
|
|
12
12
|
constructor(s, t, i, e) {
|
|
13
|
-
(this.
|
|
13
|
+
(this.j = s),
|
|
14
14
|
(this.Ss = t),
|
|
15
15
|
(this.h = i),
|
|
16
16
|
(this.tm = e),
|
|
17
|
-
(this.
|
|
17
|
+
(this.j = s),
|
|
18
18
|
(this.Ss = t),
|
|
19
19
|
(this.h = i);
|
|
20
|
-
const n = this.h.
|
|
20
|
+
const n = this.h.Bd();
|
|
21
21
|
(this.im = n ? 1e3 * n : ts),
|
|
22
22
|
(null == e || isNaN(e)) && (e = 1800),
|
|
23
23
|
e < this.im / 1e3 &&
|
|
24
|
-
|
|
24
|
+
b.info(
|
|
25
25
|
"Specified session timeout of " +
|
|
26
26
|
e +
|
|
27
27
|
"s is too small, using the minimum session timeout of " +
|
|
@@ -34,19 +34,19 @@ export default class Xt {
|
|
|
34
34
|
return new Ie(this.Ss.getUserId(), p.hm, s, t.Tu, { d: X(s - t.lm) });
|
|
35
35
|
}
|
|
36
36
|
al() {
|
|
37
|
-
return this.
|
|
37
|
+
return this.j.$u(s.Ou.um);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
const t = this.
|
|
39
|
+
$t() {
|
|
40
|
+
const t = this.j.$u(s.Ou.um);
|
|
41
41
|
return null == t ? null : t.Tu;
|
|
42
42
|
}
|
|
43
43
|
am() {
|
|
44
44
|
const t = new Date().valueOf(),
|
|
45
|
-
i = this.h.
|
|
45
|
+
i = this.h.pd();
|
|
46
46
|
if (null == i) return !1;
|
|
47
|
-
const e = this.
|
|
47
|
+
const e = this.j.St(s.It.dm),
|
|
48
48
|
n = null == e || t - e > 1e3 * i;
|
|
49
|
-
return n && this.
|
|
49
|
+
return n && this.j.Pt(s.It.dm, t), n;
|
|
50
50
|
}
|
|
51
51
|
ul(s, t) {
|
|
52
52
|
return null == t || null == t.fm || (!(s - t.lm < this.im) && t.fm < s);
|
|
@@ -54,26 +54,26 @@ export default class Xt {
|
|
|
54
54
|
el() {
|
|
55
55
|
const t = new Date().valueOf(),
|
|
56
56
|
i = t + 1e3 * this.tm,
|
|
57
|
-
e = this.
|
|
57
|
+
e = this.j.$u(s.Ou.um);
|
|
58
58
|
if (this.ul(t, e)) {
|
|
59
59
|
let n = "Generating session start event with time " + t;
|
|
60
60
|
if (null != e) {
|
|
61
61
|
let s = e.pm;
|
|
62
62
|
s - e.lm < this.im && (s = e.lm + this.im),
|
|
63
|
-
this.
|
|
63
|
+
this.j.gm(this.nm(s, e)),
|
|
64
64
|
(n += " (old session ended " + s + ")");
|
|
65
65
|
}
|
|
66
|
-
(n += ". Will expire " + i.valueOf()),
|
|
66
|
+
(n += ". Will expire " + i.valueOf()), b.info(n);
|
|
67
67
|
const r = new _t(V.de(), i);
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
return null == this.
|
|
68
|
+
this.j.gm(new Ie(this.Ss.getUserId(), p.wm, t, r.Tu)),
|
|
69
|
+
this.j.Iu(s.Ou.um, r);
|
|
70
|
+
return null == this.j.St(s.It.dm) && this.j.Pt(s.It.dm, t), r.Tu;
|
|
71
71
|
}
|
|
72
|
-
if (null != e) return (e.pm = t), (e.fm = i), this.
|
|
72
|
+
if (null != e) return (e.pm = t), (e.fm = i), this.j.Iu(s.Ou.um, e), e.Tu;
|
|
73
73
|
}
|
|
74
74
|
Sm() {
|
|
75
|
-
const t = this.
|
|
75
|
+
const t = this.j.$u(s.Ou.um);
|
|
76
76
|
null != t &&
|
|
77
|
-
(this.
|
|
77
|
+
(this.j.jm(s.Ou.um), this.j.gm(this.nm(new Date().valueOf(), t)));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import ne, { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
2
|
-
import { logger as
|
|
2
|
+
import { logger as b } from "../../shared-lib/index.js";
|
|
3
3
|
const Zt = {
|
|
4
4
|
rl: function (o, t = !1, e) {
|
|
5
|
-
const r = Zt.
|
|
5
|
+
const r = Zt.oc(),
|
|
6
6
|
a = Zt.sl(),
|
|
7
|
-
n = new ne.
|
|
7
|
+
n = new ne.tc(o, r && !t, a, e);
|
|
8
8
|
let c;
|
|
9
|
-
return (c = a ? new ne.
|
|
9
|
+
return (c = a ? new ne.ec(o) : new ne.rc()), new ne(n, c);
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
oc: function () {
|
|
12
12
|
return (
|
|
13
13
|
navigator.cookieEnabled ||
|
|
14
14
|
("cookie" in document &&
|
|
@@ -22,9 +22,9 @@ const Zt = {
|
|
|
22
22
|
try {
|
|
23
23
|
if (localStorage && localStorage.getItem)
|
|
24
24
|
try {
|
|
25
|
-
localStorage.setItem(s.
|
|
26
|
-
localStorage.getItem(s.
|
|
27
|
-
? (localStorage.removeItem(s.
|
|
25
|
+
localStorage.setItem(s.It.ac, "true"),
|
|
26
|
+
localStorage.getItem(s.It.ac)
|
|
27
|
+
? (localStorage.removeItem(s.It.ac), (o = !0))
|
|
28
28
|
: (o = !1);
|
|
29
29
|
} catch (t) {
|
|
30
30
|
if (
|
|
@@ -39,7 +39,7 @@ const Zt = {
|
|
|
39
39
|
o = !0;
|
|
40
40
|
}
|
|
41
41
|
} catch (o) {
|
|
42
|
-
|
|
42
|
+
b.info("Local Storage not supported!");
|
|
43
43
|
}
|
|
44
44
|
return o;
|
|
45
45
|
},
|