@braze/web-sdk 6.12.1 → 6.13.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 +240 -3
- package/package.json +1 -1
- package/shared-lib/event-types.js +18 -18
- package/shared-lib/indexed-db-adapter.js +58 -58
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +25 -24
- package/src/ConversationalChat/automatically-manage-chat.js +5 -0
- package/src/ConversationalChat/chat-message-factory.js +25 -0
- package/src/ConversationalChat/chat-message.js +33 -0
- package/src/ConversationalChat/constants.js +1 -0
- package/src/ConversationalChat/conversational-chat-provider-factory.js +26 -0
- package/src/ConversationalChat/conversational-chat-provider.js +372 -0
- package/src/ConversationalChat/display/chat-widget-manager.js +113 -0
- package/src/ConversationalChat/display/chat-widget-to-html.js +58 -0
- package/src/ConversationalChat/get-chat-messages.js +7 -0
- package/src/ConversationalChat/index.js +12 -0
- package/src/ConversationalChat/is-chat-conversation-ended.js +7 -0
- package/src/ConversationalChat/is-chat-turn-errored.js +7 -0
- package/src/ConversationalChat/is-chat-turn-in-progress.js +7 -0
- package/src/ConversationalChat/register-chat-action-handler.js +10 -0
- package/src/ConversationalChat/reset-chat-conversation.js +5 -0
- package/src/ConversationalChat/retrieve-chat-config.js +7 -0
- package/src/ConversationalChat/send-chat-message.js +17 -0
- package/src/ConversationalChat/subscribe-to-chat-action.js +5 -0
- package/src/ConversationalChat/subscribe-to-chat-conversation-updated.js +5 -0
- package/src/ConversationalChat/subscribe-to-chat-message-received.js +5 -0
- package/src/ConversationalChat/trigger-chat-action.js +11 -0
- package/src/ConversationalChat/types.js +1 -0
- package/src/Core/add-sdk-metadata.js +5 -5
- package/src/Core/change-user.js +6 -6
- package/src/Core/disable-sdk.js +6 -6
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +20 -13
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/log-custom-event.js +9 -9
- package/src/Core/log-ecommerce-event.js +4 -4
- package/src/Core/log-purchase.js +14 -14
- package/src/Core/open-session.js +8 -8
- package/src/Core/set-sdk-authentication-signature.js +3 -3
- package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
- package/src/Core/wipe-data.js +1 -1
- package/src/DUST/dust-config-store.js +35 -35
- package/src/DUST/dust-message-dedup.js +3 -3
- package/src/DUST/dust-provider-factory.js +10 -10
- package/src/DUST/dust-provider.js +234 -234
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +2 -2
- package/src/FeatureFlags/feature-flag.js +4 -4
- package/src/FeatureFlags/feature-flags-provider-factory.js +11 -11
- 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 +4 -4
- 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-display-utils.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +13 -13
- package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
- package/src/InAppMessage/display/modal-utils.js +7 -7
- package/src/InAppMessage/in-app-message-factory.js +6 -6
- package/src/InAppMessage/in-app-message-manager.js +92 -92
- package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-click.js +7 -7
- package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
- package/src/InAppMessage/log-in-app-message-impression.js +3 -3
- package/src/InAppMessage/models/full-screen-message.js +39 -39
- package/src/InAppMessage/models/html-message.js +20 -20
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +102 -102
- package/src/InAppMessage/models/modal-message.js +38 -38
- package/src/InAppMessage/models/slide-up-message.js +34 -34
- 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 +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +23 -23
- 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 +15 -15
- package/src/Push/push-manager.js +13 -13
- package/src/Push/register-push.js +2 -2
- package/src/Push/request-push-permission.js +2 -2
- package/src/Push/unregister-push-token-on-server.js +3 -3
- package/src/Push/unregister-push.js +3 -3
- package/src/Push/utils/push-utils.js +15 -15
- package/src/User/user-manager.js +9 -9
- package/src/User/user.js +50 -50
- package/src/common/constants.js +1 -1
- package/src/common/content-cards-display.js +22 -22
- package/src/common/event-logger.js +3 -3
- package/src/index.js +2 -9
- package/src/l10n/l10n-manager-factory.js +4 -4
- package/src/l10n/l10n-manager.js +6 -6
- package/src/managers/auth-manager.js +28 -28
- package/src/managers/braze-action-manager.js +14 -0
- package/src/managers/braze-instance.js +159 -151
- package/src/managers/device-manager.js +26 -26
- package/src/managers/network-manager.js +120 -120
- package/src/managers/server-config-manager.js +95 -86
- package/src/managers/session-manager.js +25 -25
- package/src/managers/storage-manager-factory.js +12 -12
- package/src/managers/storage-manager.js +129 -124
- package/src/managers/subscription-manager.js +8 -8
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +5 -5
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +8 -8
- package/src/models/push-token.js +6 -6
- package/src/models/request-result.js +2 -2
- package/src/models/server-config.js +27 -27
- package/src/request-controller.js +117 -117
- package/src/standard-index.js +9 -0
- 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 +5 -5
- package/src/triggers/models/filter.js +31 -31
- package/src/triggers/models/in-app-message-click-data.js +9 -9
- 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 +4 -4
- package/src/triggers/models/trigger-condition.js +35 -35
- package/src/triggers/models/trigger-events.js +3 -3
- package/src/triggers/models/trigger.js +36 -36
- package/src/triggers/triggers-provider-factory.js +5 -5
- package/src/triggers/triggers-provider.js +128 -128
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/chat-widget-css.js +11 -0
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +5 -5
- package/src/util/browser-detector.js +41 -41
- package/src/util/client-hints-parser.js +10 -10
- package/src/util/component-utils.js +1 -1
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +5 -5
- package/src/util/dom-utils.js +8 -8
- package/src/util/ecommerce-event-validation.js +13 -13
- package/src/util/html-display-utils.js +6 -6
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +82 -44
- package/src/util/request-header-utils.js +26 -24
- package/src/util/user-agent-parser.js +21 -21
- package/src/util/validation-utils.js +29 -21
- package/src/util/window-utils.js +3 -3
|
@@ -9,35 +9,36 @@ import {
|
|
|
9
9
|
REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT as d,
|
|
10
10
|
REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT as m,
|
|
11
11
|
} from "../common/constants.js";
|
|
12
|
-
export default class
|
|
12
|
+
export default class Ei {
|
|
13
13
|
constructor(t) {
|
|
14
14
|
(this.j = t),
|
|
15
15
|
(this.j = t),
|
|
16
|
-
(this.
|
|
17
|
-
(this.
|
|
18
|
-
(this.
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
(this.ld = new f()),
|
|
17
|
+
(this.dd = new f()),
|
|
18
|
+
(this.vd = new f()),
|
|
19
|
+
(this.md = new f()),
|
|
20
|
+
(this.gd = new f()),
|
|
21
|
+
(this.bd = new f()),
|
|
22
|
+
(this.fd = null),
|
|
23
|
+
(this.pd = null);
|
|
24
|
+
}
|
|
25
|
+
Cd() {
|
|
26
|
+
var t;
|
|
27
|
+
if (null == this.pd) {
|
|
28
|
+
const i = null === (t = this.j) || void 0 === t ? void 0 : t.St(s.It.Rd);
|
|
29
|
+
this.pd = null != i ? vi._u(i) : new vi();
|
|
29
30
|
}
|
|
30
|
-
return this.
|
|
31
|
+
return this.pd;
|
|
31
32
|
}
|
|
32
33
|
Qt() {
|
|
33
|
-
return this.
|
|
34
|
+
return this.Cd().Ed;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
wd(t) {
|
|
36
37
|
var i, e, n, l, r, o;
|
|
37
38
|
if (null != t && null != t.config) {
|
|
38
39
|
const u = t.config;
|
|
39
|
-
if (u.time > this.
|
|
40
|
-
const t = (t) => (null == t ? this.
|
|
40
|
+
if (u.time > this.Cd().Ed) {
|
|
41
|
+
const t = (t) => (null == t ? this.Cd().Bd : t),
|
|
41
42
|
a = new vi(
|
|
42
43
|
u.time,
|
|
43
44
|
u.events_blacklist,
|
|
@@ -55,122 +56,123 @@ export default class li {
|
|
|
55
56
|
u.conversational_chat,
|
|
56
57
|
);
|
|
57
58
|
let h = !1;
|
|
58
|
-
null != a.
|
|
59
|
+
null != a.Td && this.Wu() !== a.Td && (h = !0);
|
|
59
60
|
let d = !1;
|
|
60
|
-
null != a.
|
|
61
|
-
let c = !1;
|
|
62
|
-
null != a.Rr.enabled && this.Kr() !== a.Rr.enabled && (c = !0);
|
|
61
|
+
null != a.yd.enabled && this.Pi() !== a.yd.enabled && (d = !0);
|
|
63
62
|
let v = !1;
|
|
63
|
+
null != a.Rr.enabled && this.Qr() !== a.Rr.enabled && (v = !0);
|
|
64
|
+
let c = !1;
|
|
64
65
|
null !=
|
|
65
66
|
(null === (i = a.banners) || void 0 === i ? void 0 : i.enabled) &&
|
|
66
67
|
this.Ot() !==
|
|
67
68
|
(null === (e = a.banners) || void 0 === e ? void 0 : e.enabled) &&
|
|
68
|
-
(
|
|
69
|
+
(c = !0);
|
|
69
70
|
let m = !1;
|
|
70
71
|
null != (null === (n = a.dust) || void 0 === n ? void 0 : n.enabled) &&
|
|
71
|
-
this
|
|
72
|
+
this.Ih() !==
|
|
72
73
|
(null === (l = a.dust) || void 0 === l ? void 0 : l.enabled) &&
|
|
73
74
|
(m = !0);
|
|
74
75
|
let g = !1;
|
|
75
|
-
null != (null === (r = a.
|
|
76
|
-
this.
|
|
77
|
-
(null === (o = a.
|
|
76
|
+
null != (null === (r = a.Md) || void 0 === r ? void 0 : r.enabled) &&
|
|
77
|
+
this.Zi() !==
|
|
78
|
+
(null === (o = a.Md) || void 0 === o ? void 0 : o.enabled) &&
|
|
78
79
|
(g = !0),
|
|
79
|
-
|
|
80
|
-
this.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
v && this.
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
null != a.Md && this.dn() !== (a.Md.widget_url || null) && (g = !0),
|
|
81
|
+
(this.pd = a),
|
|
82
|
+
this.j.Pt(s.It.Rd, a.qt()),
|
|
83
|
+
h && this.ld.A(),
|
|
84
|
+
d && this.dd.A(),
|
|
85
|
+
v && this.vd.A(),
|
|
86
|
+
c && this.md.A(),
|
|
87
|
+
m && this.gd.A(),
|
|
88
|
+
g && this.bd.A();
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
ju(t) {
|
|
91
|
-
const i = this.
|
|
92
|
-
return this.
|
|
93
|
+
const i = this.ld.Ut(t);
|
|
94
|
+
return this.fd && this.ld.removeSubscription(this.fd), (this.fd = i), i;
|
|
93
95
|
}
|
|
94
96
|
$i(t) {
|
|
95
|
-
return this.
|
|
97
|
+
return this.dd.Ut(t);
|
|
96
98
|
}
|
|
97
|
-
|
|
98
|
-
return this.
|
|
99
|
+
po(t) {
|
|
100
|
+
return this.vd.Ut(t);
|
|
99
101
|
}
|
|
100
102
|
V(t) {
|
|
101
|
-
return this.
|
|
103
|
+
return this.md.Ut(t);
|
|
102
104
|
}
|
|
103
105
|
Tr(t) {
|
|
104
|
-
return this.
|
|
106
|
+
return this.gd.Ut(t);
|
|
105
107
|
}
|
|
106
|
-
|
|
107
|
-
return this.
|
|
108
|
+
ln(t) {
|
|
109
|
+
return this.bd.Ut(t);
|
|
108
110
|
}
|
|
109
|
-
|
|
110
|
-
return -1 !== this.
|
|
111
|
+
Le(t) {
|
|
112
|
+
return -1 !== this.Cd().Sd.indexOf(t);
|
|
111
113
|
}
|
|
112
114
|
zu(t) {
|
|
113
|
-
return -1 !== this.
|
|
115
|
+
return -1 !== this.Cd().Fd.indexOf(t);
|
|
114
116
|
}
|
|
115
|
-
|
|
116
|
-
return -1 !== this.
|
|
117
|
+
Pr(t) {
|
|
118
|
+
return -1 !== this.Cd().Ld.indexOf(t);
|
|
117
119
|
}
|
|
118
|
-
|
|
119
|
-
return this.
|
|
120
|
+
jd() {
|
|
121
|
+
return this.Cd().kd;
|
|
120
122
|
}
|
|
121
123
|
Wu() {
|
|
122
|
-
return this.
|
|
124
|
+
return this.Cd().Td;
|
|
123
125
|
}
|
|
124
126
|
Pi() {
|
|
125
|
-
return this.
|
|
127
|
+
return this.Cd().yd.enabled || !1;
|
|
126
128
|
}
|
|
127
|
-
|
|
128
|
-
const t = this.
|
|
129
|
+
Dd() {
|
|
130
|
+
const t = this.Cd().Bd;
|
|
129
131
|
return !(!t || null == t.enabled) && t.enabled;
|
|
130
132
|
}
|
|
131
|
-
|
|
132
|
-
if (!this.
|
|
133
|
-
const t = this.
|
|
133
|
+
nd() {
|
|
134
|
+
if (!this.Dd()) return -1;
|
|
135
|
+
const t = this.Cd().Bd;
|
|
134
136
|
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
|
|
135
137
|
}
|
|
136
|
-
|
|
137
|
-
if (!this.
|
|
138
|
-
const t = this.
|
|
138
|
+
ad() {
|
|
139
|
+
if (!this.Dd()) return -1;
|
|
140
|
+
const t = this.Cd().Bd;
|
|
139
141
|
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
|
|
140
142
|
}
|
|
141
|
-
|
|
142
|
-
const i = this.
|
|
143
|
+
Nd(t) {
|
|
144
|
+
const i = this.Cd().Bd.endpoint_overrides;
|
|
143
145
|
return null == i ? null : i[t];
|
|
144
146
|
}
|
|
145
|
-
|
|
146
|
-
const i = this.
|
|
147
|
+
hd(t) {
|
|
148
|
+
const i = this.Nd(t);
|
|
147
149
|
return null == i || isNaN(i.capacity) || i.capacity <= 0 ? -1 : i.capacity;
|
|
148
150
|
}
|
|
149
|
-
|
|
150
|
-
const i = this.
|
|
151
|
+
ud(t) {
|
|
152
|
+
const i = this.Nd(t);
|
|
151
153
|
return null == i || isNaN(i.refill_rate) || i.refill_rate <= 0
|
|
152
154
|
? -1
|
|
153
155
|
: i.refill_rate;
|
|
154
156
|
}
|
|
155
|
-
|
|
156
|
-
return this.
|
|
157
|
-
? (v.Dt(p.
|
|
158
|
-
: this.
|
|
157
|
+
Qr() {
|
|
158
|
+
return this.Cd().Rr.enabled && null == this.wo()
|
|
159
|
+
? (v.Dt(p.Zl, { e: "Missing feature flag refresh_rate_limit." }), !1)
|
|
160
|
+
: this.Cd().Rr.enabled || !1;
|
|
159
161
|
}
|
|
160
|
-
|
|
161
|
-
return this.
|
|
162
|
+
wo() {
|
|
163
|
+
return this.Cd().Rr.refresh_rate_limit;
|
|
162
164
|
}
|
|
163
165
|
Ot() {
|
|
164
166
|
var t;
|
|
165
167
|
return (
|
|
166
|
-
(null === (t = this.
|
|
168
|
+
(null === (t = this.Cd().banners) || void 0 === t ? void 0 : t.enabled) ||
|
|
167
169
|
null
|
|
168
170
|
);
|
|
169
171
|
}
|
|
170
172
|
re() {
|
|
171
173
|
var t;
|
|
172
174
|
return (
|
|
173
|
-
(null === (t = this.
|
|
175
|
+
(null === (t = this.Cd().banners) || void 0 === t
|
|
174
176
|
? void 0
|
|
175
177
|
: t.max_placements) || 0
|
|
176
178
|
);
|
|
@@ -178,27 +180,34 @@ export default class li {
|
|
|
178
180
|
Gt() {
|
|
179
181
|
var t;
|
|
180
182
|
const i =
|
|
181
|
-
null === (t = this.
|
|
183
|
+
null === (t = this.Cd().banners) || void 0 === t
|
|
182
184
|
? void 0
|
|
183
185
|
: t.dismissals_cache_size;
|
|
184
186
|
return null != i && "number" == typeof i && i > 0 ? i : u;
|
|
185
187
|
}
|
|
186
|
-
|
|
188
|
+
Ih() {
|
|
189
|
+
var t;
|
|
190
|
+
return (
|
|
191
|
+
(null === (t = this.Cd().dust) || void 0 === t ? void 0 : t.enabled) || !1
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
Zi() {
|
|
187
195
|
var t;
|
|
188
196
|
return (
|
|
189
|
-
(null === (t = this.
|
|
197
|
+
(null === (t = this.Cd().Md) || void 0 === t ? void 0 : t.enabled) || !1
|
|
190
198
|
);
|
|
191
199
|
}
|
|
192
|
-
|
|
200
|
+
dn() {
|
|
193
201
|
var t;
|
|
194
202
|
return (
|
|
195
|
-
(null === (t = this.
|
|
203
|
+
(null === (t = this.Cd().Md) || void 0 === t ? void 0 : t.widget_url) ||
|
|
204
|
+
null
|
|
196
205
|
);
|
|
197
206
|
}
|
|
198
207
|
vt() {
|
|
199
208
|
var t;
|
|
200
209
|
const i =
|
|
201
|
-
null === (t = this.
|
|
210
|
+
null === (t = this.Cd().xd) || void 0 === t
|
|
202
211
|
? void 0
|
|
203
212
|
: t.min_sleep_duration_ms;
|
|
204
213
|
return null != i ? i : d;
|
|
@@ -206,18 +215,18 @@ export default class li {
|
|
|
206
215
|
gt() {
|
|
207
216
|
var t;
|
|
208
217
|
const i =
|
|
209
|
-
null === (t = this.
|
|
218
|
+
null === (t = this.Cd().xd) || void 0 === t ? void 0 : t.scale_factor;
|
|
210
219
|
return null != i ? i : m;
|
|
211
220
|
}
|
|
212
221
|
bt() {
|
|
213
222
|
var t;
|
|
214
223
|
const i =
|
|
215
|
-
null === (t = this.
|
|
224
|
+
null === (t = this.Cd().xd) || void 0 === t
|
|
216
225
|
? void 0
|
|
217
226
|
: t.max_sleep_duration_ms;
|
|
218
227
|
return null != i ? i : c;
|
|
219
228
|
}
|
|
220
|
-
|
|
221
|
-
return this.
|
|
229
|
+
qd() {
|
|
230
|
+
return this.Cd().Gd;
|
|
222
231
|
}
|
|
223
232
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
2
2
|
import ve from "../models/braze-event.js";
|
|
3
|
-
import
|
|
3
|
+
import Ut from "../models/identifier.js";
|
|
4
4
|
import { convertMsToSeconds as X } from "../util/date-utils.js";
|
|
5
5
|
import {
|
|
6
6
|
logger as b,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
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
|
-
export default class
|
|
11
|
+
export default class Ii {
|
|
12
12
|
constructor(s, t, i, e) {
|
|
13
13
|
(this.j = s),
|
|
14
14
|
(this.Ss = t),
|
|
@@ -17,7 +17,7 @@ export default class fi {
|
|
|
17
17
|
(this.j = s),
|
|
18
18
|
(this.Ss = t),
|
|
19
19
|
(this.h = i);
|
|
20
|
-
const n = this.h.
|
|
20
|
+
const n = this.h.qd();
|
|
21
21
|
(this.im = n ? 1e3 * n : ts),
|
|
22
22
|
(null == e || isNaN(e)) && (e = 1800),
|
|
23
23
|
e < this.im / 1e3 &&
|
|
@@ -33,47 +33,47 @@ export default class fi {
|
|
|
33
33
|
nm(s, t) {
|
|
34
34
|
return new ve(this.Ss.getUserId(), p.hm, s, t.Iu, { d: X(s - t.lm) });
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
return this.j.$u(s.Ou.
|
|
36
|
+
Kl() {
|
|
37
|
+
return this.j.$u(s.Ou.am);
|
|
38
38
|
}
|
|
39
39
|
$t() {
|
|
40
|
-
const t = this.j.$u(s.Ou.
|
|
40
|
+
const t = this.j.$u(s.Ou.am);
|
|
41
41
|
return null == t ? null : t.Iu;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
dm() {
|
|
44
44
|
const t = new Date().valueOf(),
|
|
45
|
-
i = this.h.
|
|
45
|
+
i = this.h.jd();
|
|
46
46
|
if (null == i) return !1;
|
|
47
|
-
const e = this.j.St(s.It.
|
|
47
|
+
const e = this.j.St(s.It.fm),
|
|
48
48
|
n = null == e || t - e > 1e3 * i;
|
|
49
|
-
return n && this.j.Pt(s.It.
|
|
49
|
+
return n && this.j.Pt(s.It.fm, t), n;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
return null == t || null == t.
|
|
51
|
+
Fl(s, t) {
|
|
52
|
+
return null == t || null == t.pm || (!(s - t.lm < this.im) && t.pm < s);
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
ol() {
|
|
55
55
|
const t = new Date().valueOf(),
|
|
56
56
|
i = t + 1e3 * this.tm,
|
|
57
|
-
e = this.j.$u(s.Ou.
|
|
58
|
-
if (this.
|
|
57
|
+
e = this.j.$u(s.Ou.am);
|
|
58
|
+
if (this.Fl(t, e)) {
|
|
59
59
|
let n = "Generating session start event with time " + t;
|
|
60
60
|
if (null != e) {
|
|
61
|
-
let s = e.
|
|
61
|
+
let s = e.gm;
|
|
62
62
|
s - e.lm < this.im && (s = e.lm + this.im),
|
|
63
|
-
this.j.
|
|
63
|
+
this.j.wm(this.nm(s, e)),
|
|
64
64
|
(n += " (old session ended " + s + ")");
|
|
65
65
|
}
|
|
66
66
|
(n += ". Will expire " + i.valueOf()), b.info(n);
|
|
67
|
-
const r = new
|
|
68
|
-
this.j.
|
|
69
|
-
this.j.Ju(s.Ou.
|
|
70
|
-
return null == this.j.St(s.It.
|
|
67
|
+
const r = new Ut(V.de(), i);
|
|
68
|
+
this.j.wm(new ve(this.Ss.getUserId(), p.Sm, t, r.Iu)),
|
|
69
|
+
this.j.Ju(s.Ou.am, r);
|
|
70
|
+
return null == this.j.St(s.It.fm) && this.j.Pt(s.It.fm, t), r.Iu;
|
|
71
71
|
}
|
|
72
|
-
if (null != e) return (e.
|
|
72
|
+
if (null != e) return (e.gm = t), (e.pm = i), this.j.Ju(s.Ou.am, e), e.Iu;
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
const t = this.j.$u(s.Ou.
|
|
74
|
+
jm() {
|
|
75
|
+
const t = this.j.$u(s.Ou.am);
|
|
76
76
|
null != t &&
|
|
77
|
-
(this.j.
|
|
77
|
+
(this.j.xm(s.Ou.am), this.j.wm(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
2
|
import { logger as b } from "../../shared-lib/index.js";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const r =
|
|
6
|
-
a =
|
|
7
|
-
n = new ne.
|
|
3
|
+
const _i = {
|
|
4
|
+
Bl: function (o, t = !1, e) {
|
|
5
|
+
const r = _i.og(),
|
|
6
|
+
a = _i.zl(),
|
|
7
|
+
n = new ne.tg(o, r && !t, a, e);
|
|
8
8
|
let c;
|
|
9
|
-
return (c = a ? new ne.
|
|
9
|
+
return (c = a ? new ne.eg(o) : new ne.rg()), new ne(n, c);
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
og: function () {
|
|
12
12
|
return (
|
|
13
13
|
navigator.cookieEnabled ||
|
|
14
14
|
("cookie" in document &&
|
|
@@ -17,14 +17,14 @@ const di = {
|
|
|
17
17
|
-1))
|
|
18
18
|
);
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
zl: function () {
|
|
21
21
|
let o = !1;
|
|
22
22
|
try {
|
|
23
23
|
if (localStorage && localStorage.getItem)
|
|
24
24
|
try {
|
|
25
|
-
localStorage.setItem(s.It.
|
|
26
|
-
localStorage.getItem(s.It.
|
|
27
|
-
? (localStorage.removeItem(s.It.
|
|
25
|
+
localStorage.setItem(s.It.ag, "true"),
|
|
26
|
+
localStorage.getItem(s.It.ag)
|
|
27
|
+
? (localStorage.removeItem(s.It.ag), (o = !0))
|
|
28
28
|
: (o = !1);
|
|
29
29
|
} catch (t) {
|
|
30
30
|
if (
|
|
@@ -44,4 +44,4 @@ const di = {
|
|
|
44
44
|
return o;
|
|
45
45
|
},
|
|
46
46
|
};
|
|
47
|
-
export default
|
|
47
|
+
export default _i;
|