@braze/web-sdk 5.8.0 → 5.8.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 +1 -1
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +22 -22
- package/shared-lib/guid.js +1 -1
- package/shared-lib/indexed-db-adapter.js +18 -18
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +16 -16
- package/src/Banner/banner-provider.js +79 -79
- package/src/Banner/banner.js +9 -9
- package/src/Banner/display/banner-to-html.js +2 -2
- package/src/Banner/get-all-banners.js +2 -2
- package/src/Banner/get-banner.js +2 -2
- package/src/Banner/log-banner-click.js +2 -2
- package/src/Banner/log-banner-impressions.js +4 -4
- package/src/Banner/request-banners-refresh.js +1 -1
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Card/card-manager.js +35 -35
- package/src/Card/display/card-display.js +8 -8
- package/src/Card/log-card-click.js +1 -1
- package/src/Card/log-card-dismissal.js +1 -1
- package/src/Card/log-card-impressions.js +1 -1
- package/src/Card/models/captioned-image.js +21 -21
- package/src/Card/models/card.js +92 -92
- package/src/Card/models/classic-card.js +21 -21
- package/src/Card/models/control-card.js +11 -11
- package/src/Card/models/image-only.js +19 -19
- package/src/Card/util/card-factory.js +39 -39
- package/src/ContentCards/content-cards-provider.js +142 -142
- 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 +4 -4
- package/src/ContentCards/ui/show-content-cards.js +3 -3
- package/src/Core/disable-sdk.js +6 -6
- package/src/Core/enable-sdk.js +5 -5
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +2 -2
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/log-custom-event.js +5 -5
- package/src/Core/log-purchase.js +4 -4
- package/src/Core/open-session.js +5 -5
- package/src/Core/wipe-data.js +2 -2
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +15 -15
- package/src/FeatureFlags/feature-flags-provider.js +61 -61
- 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 +4 -4
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
- package/src/Feed/feed-provider.js +41 -41
- 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 +6 -6
- package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
- package/src/InAppMessage/display/modal-utils.js +4 -4
- package/src/InAppMessage/in-app-message-factory.js +7 -7
- package/src/InAppMessage/in-app-message-manager.js +89 -89
- package/src/InAppMessage/log-in-app-message-button-click.js +6 -6
- package/src/InAppMessage/log-in-app-message-click.js +5 -5
- package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
- package/src/InAppMessage/log-in-app-message-impression.js +2 -2
- package/src/InAppMessage/models/control-message.js +5 -5
- package/src/InAppMessage/models/full-screen-message.js +34 -34
- package/src/InAppMessage/models/html-message.js +20 -20
- package/src/InAppMessage/models/in-app-message-button.js +8 -8
- package/src/InAppMessage/models/in-app-message.js +80 -80
- package/src/InAppMessage/models/modal-message.js +33 -33
- package/src/InAppMessage/models/slide-up-message.js +29 -29
- 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 +12 -12
- package/src/Push/push-manager-factory.js +1 -1
- package/src/Push/push-manager.js +94 -94
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +17 -17
- package/src/User/user.js +38 -38
- package/src/common/base-feed.js +1 -1
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +5 -5
- package/src/common/feed-display.js +6 -6
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/auth-manager.js +31 -31
- package/src/managers/braze-instance.js +125 -125
- package/src/managers/device-manager.js +24 -24
- package/src/managers/network-manager.js +149 -149
- package/src/managers/server-config-manager.js +84 -84
- package/src/managers/session-manager.js +27 -27
- package/src/managers/storage-manager-factory.js +12 -12
- package/src/managers/storage-manager.js +83 -83
- package/src/managers/subscription-manager.js +10 -10
- package/src/managers/utils.js +4 -4
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +4 -4
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +3 -3
- package/src/models/push-token.js +8 -8
- package/src/models/request-result.js +3 -3
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +148 -148
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +2 -2
- package/src/triggers/models/filter-set.js +4 -4
- package/src/triggers/models/filter.js +2 -2
- 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 +32 -32
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +11 -11
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +72 -72
- package/src/ui/js/attach-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/braze-actions.js +4 -4
- package/src/util/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/component-utils.js +1 -1
- package/src/util/dom-utils.js +4 -4
- package/src/util/html-display-utils.js +6 -6
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +6 -6
- package/src/util/request-header-utils.js +21 -21
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/window-utils.js +1 -1
|
@@ -13,66 +13,66 @@ import { getErrorMessage as si } from "../util/error-utils.js";
|
|
|
13
13
|
export const STORAGE_KEYS = {
|
|
14
14
|
iu: {
|
|
15
15
|
su: "ab.storage.userId",
|
|
16
|
-
|
|
16
|
+
Ia: "ab.storage.deviceId",
|
|
17
17
|
Nl: "ab.storage.sessionId",
|
|
18
18
|
},
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
gt: {
|
|
20
|
+
ac: "ab.test",
|
|
21
21
|
tE: "ab.storage.events",
|
|
22
22
|
eE: "ab.storage.attributes",
|
|
23
23
|
sE: "ab.storage.attributes.anonymous_user",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
ic: "ab.storage.device",
|
|
25
|
+
vu: "ab.storage.sdk_metadata",
|
|
26
|
+
pu: "ab.storage.session_id_for_cached_metadata",
|
|
27
|
+
qn: "ab.storage.pushToken",
|
|
28
|
+
qi: "ab.storage.newsFeed",
|
|
29
|
+
zi: "ab.storage.lastNewsFeedRefresh",
|
|
30
|
+
Zt: "ab.storage.cardImpressions",
|
|
31
|
+
cl: "ab.storage.serverConfig",
|
|
32
32
|
rE: "ab.storage.triggers",
|
|
33
33
|
oE: "ab.storage.triggers.ts",
|
|
34
34
|
Hl: "ab.storage.messagingSessionStart",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
Is: "ab.storage.cc",
|
|
36
|
+
Qs: "ab.storage.ccLastFullSync",
|
|
37
|
+
Vs: "ab.storage.ccLastCardUpdated",
|
|
38
|
+
xu: "ab.storage.globalRateLimitCurrentTokenCount",
|
|
39
|
+
Gu: "ab.storage.dynamicRateLimitCurrentTokenCount",
|
|
40
|
+
Kt: "ab.storage.ccClicks",
|
|
41
|
+
Yt: "ab.storage.ccImpressions",
|
|
42
|
+
Vt: "ab.storage.ccDismissals",
|
|
43
43
|
nE: "ab.storage.lastDisplayedTriggerTimesById",
|
|
44
44
|
aE: "ab.storage.lastDisplayedTriggerTime",
|
|
45
45
|
iE: "ab.storage.triggerFireInstancesById",
|
|
46
|
-
|
|
46
|
+
xh: "ab.storage.signature",
|
|
47
47
|
EE: "ab.storage.brazeSyncRetryCount",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
fi: "ab.storage.sdkVersion",
|
|
49
|
+
Xe: "ab.storage.ff",
|
|
50
|
+
Ge: "ab.storage.ffImpressions",
|
|
51
|
+
Ze: "ab.storage.ffLastRefreshAt",
|
|
52
|
+
Ve: "ab.storage.ff.sessionId",
|
|
53
53
|
lE: "ab.storage.lastReqToEndpoint",
|
|
54
54
|
SE: "ab.storage.requestAttempts",
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
Lr: "ab.storage.deferredIam",
|
|
56
|
+
Eu: "ab.storage.lastSdkReq",
|
|
57
57
|
_E: "ab.storage.alias",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
vt: "ab.storage.banners",
|
|
59
|
+
kt: "ab.storage.banners.impressions",
|
|
60
|
+
yt: "ab.storage.banners.sessionId",
|
|
61
61
|
},
|
|
62
|
-
|
|
62
|
+
me: "ab.optOut",
|
|
63
63
|
};
|
|
64
64
|
export default class ne {
|
|
65
65
|
constructor(t, e) {
|
|
66
66
|
(this.uE = t), (this.cE = e), (this.uE = t), (this.cE = e);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
Ya(t) {
|
|
69
69
|
const e = y(STORAGE_KEYS.iu),
|
|
70
70
|
s = new ne.se(t);
|
|
71
71
|
for (const t of e) s.remove(STORAGE_KEYS.iu[t]);
|
|
72
72
|
}
|
|
73
73
|
uu(t, e) {
|
|
74
74
|
let s = null;
|
|
75
|
-
null != e && e instanceof _t && (s = e.
|
|
75
|
+
null != e && e instanceof _t && (s = e.bt()), this.uE.store(t, s);
|
|
76
76
|
}
|
|
77
77
|
TE(t) {
|
|
78
78
|
const e = this.tu(t);
|
|
@@ -90,44 +90,44 @@ export default class ne {
|
|
|
90
90
|
return e;
|
|
91
91
|
})(e);
|
|
92
92
|
let r;
|
|
93
|
-
if (s) (r = _t.
|
|
93
|
+
if (s) (r = _t.En(s) || null), r && this.uu(t, r);
|
|
94
94
|
else {
|
|
95
95
|
const s = _t.hE(e);
|
|
96
|
-
(r = _t.
|
|
96
|
+
(r = _t.En(s) || null), s !== e && r && this.uu(t, r);
|
|
97
97
|
}
|
|
98
98
|
return r;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
Il(t) {
|
|
101
101
|
this.uE.remove(t);
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
Ha() {
|
|
104
104
|
const t = y(STORAGE_KEYS.iu);
|
|
105
105
|
let e;
|
|
106
106
|
for (const s of t)
|
|
107
107
|
(e = this.tu(STORAGE_KEYS.iu[s])),
|
|
108
108
|
null != e && this.uu(STORAGE_KEYS.iu[s], e);
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
Vo(t) {
|
|
111
111
|
let e;
|
|
112
112
|
if (null == t || 0 === t.length) return !1;
|
|
113
113
|
e = z(t) ? t : [t];
|
|
114
|
-
let s = this.cE.gr(STORAGE_KEYS.
|
|
114
|
+
let s = this.cE.gr(STORAGE_KEYS.gt.tE);
|
|
115
115
|
(null != s && z(s)) || (s = []);
|
|
116
|
-
for (let t = 0; t < e.length; t++) s.push(e[t].
|
|
117
|
-
return this.cE.store(STORAGE_KEYS.
|
|
116
|
+
for (let t = 0; t < e.length; t++) s.push(e[t].bt());
|
|
117
|
+
return this.cE.store(STORAGE_KEYS.gt.tE, s);
|
|
118
118
|
}
|
|
119
119
|
Al(t) {
|
|
120
|
-
return null != t && this.
|
|
120
|
+
return null != t && this.Vo([t]);
|
|
121
121
|
}
|
|
122
122
|
AE() {
|
|
123
|
-
let t = this.cE.gr(STORAGE_KEYS.
|
|
124
|
-
this.cE.remove(STORAGE_KEYS.
|
|
123
|
+
let t = this.cE.gr(STORAGE_KEYS.gt.tE);
|
|
124
|
+
this.cE.remove(STORAGE_KEYS.gt.tE), null == t && (t = []);
|
|
125
125
|
const e = [];
|
|
126
126
|
let s = !1,
|
|
127
127
|
r = null;
|
|
128
128
|
if (z(t))
|
|
129
129
|
for (let s = 0; s < t.length; s++)
|
|
130
|
-
ve.RE(t[s]) ? e.push(ve.
|
|
130
|
+
ve.RE(t[s]) ? e.push(ve.En(t[s])) : (r = s);
|
|
131
131
|
else s = !0;
|
|
132
132
|
if (s || null != r) {
|
|
133
133
|
let o = "Stored events could not be deserialized as Events";
|
|
@@ -140,34 +140,34 @@ export default class ne {
|
|
|
140
140
|
typeof t +
|
|
141
141
|
": " +
|
|
142
142
|
JSON.stringify(t)),
|
|
143
|
-
e.push(new ve(null, d.
|
|
143
|
+
e.push(new ve(null, d.bu, new Date().valueOf(), null, { e: o }));
|
|
144
144
|
}
|
|
145
145
|
return e;
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
Bt(t, e) {
|
|
148
148
|
return (
|
|
149
149
|
!!ta(
|
|
150
|
-
STORAGE_KEYS.
|
|
150
|
+
STORAGE_KEYS.gt,
|
|
151
151
|
t,
|
|
152
152
|
"StorageManager cannot store object.",
|
|
153
153
|
"STORAGE_KEYS.OBJECTS",
|
|
154
154
|
) && this.cE.store(t, e)
|
|
155
155
|
);
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
ft(t) {
|
|
158
158
|
return (
|
|
159
159
|
!!ta(
|
|
160
|
-
STORAGE_KEYS.
|
|
160
|
+
STORAGE_KEYS.gt,
|
|
161
161
|
t,
|
|
162
162
|
"StorageManager cannot retrieve object.",
|
|
163
163
|
"STORAGE_KEYS.OBJECTS",
|
|
164
164
|
) && this.cE.gr(t)
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
Ut(t) {
|
|
168
168
|
return (
|
|
169
169
|
!!ta(
|
|
170
|
-
STORAGE_KEYS.
|
|
170
|
+
STORAGE_KEYS.gt,
|
|
171
171
|
t,
|
|
172
172
|
"StorageManager cannot remove object.",
|
|
173
173
|
"STORAGE_KEYS.OBJECTS",
|
|
@@ -176,59 +176,59 @@ export default class ne {
|
|
|
176
176
|
}
|
|
177
177
|
clearData() {
|
|
178
178
|
const t = y(STORAGE_KEYS.iu),
|
|
179
|
-
e = y(STORAGE_KEYS.
|
|
179
|
+
e = y(STORAGE_KEYS.gt);
|
|
180
180
|
for (let e = 0; e < t.length; e++) {
|
|
181
181
|
const s = t[e];
|
|
182
182
|
this.uE.remove(STORAGE_KEYS.iu[s]);
|
|
183
183
|
}
|
|
184
184
|
for (let t = 0; t < e.length; t++) {
|
|
185
185
|
const s = e[t];
|
|
186
|
-
this.cE.remove(STORAGE_KEYS.
|
|
186
|
+
this.cE.remove(STORAGE_KEYS.gt[s]);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
gE(t) {
|
|
190
|
-
return t || STORAGE_KEYS.
|
|
190
|
+
return t || STORAGE_KEYS.gt.sE;
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
let e = this.cE.gr(STORAGE_KEYS.
|
|
192
|
+
wu(t) {
|
|
193
|
+
let e = this.cE.gr(STORAGE_KEYS.gt.eE);
|
|
194
194
|
null == e && (e = {});
|
|
195
|
-
const s = this.gE(t[User.
|
|
195
|
+
const s = this.gE(t[User.Qn]),
|
|
196
196
|
r = e[s];
|
|
197
197
|
for (const o in t)
|
|
198
|
-
o !== User.
|
|
198
|
+
o !== User.Qn &&
|
|
199
199
|
(null == e[s] || (r && null == r[o])) &&
|
|
200
|
-
this.mu(t[User.
|
|
200
|
+
this.mu(t[User.Qn], o, t[o]);
|
|
201
201
|
}
|
|
202
202
|
mu(t, e, s) {
|
|
203
|
-
let r = this.cE.gr(STORAGE_KEYS.
|
|
203
|
+
let r = this.cE.gr(STORAGE_KEYS.gt.eE);
|
|
204
204
|
null == r && (r = {});
|
|
205
205
|
const o = this.gE(t);
|
|
206
206
|
let n = r[o];
|
|
207
207
|
if (
|
|
208
|
-
(null == n && ((n = {}), null != t && (n[User.
|
|
208
|
+
(null == n && ((n = {}), null != t && (n[User.Qn] = t)), e === User.lu)
|
|
209
209
|
) {
|
|
210
210
|
null == n[e] && (n[e] = {});
|
|
211
211
|
for (const t in s) n[e][t] = s[t];
|
|
212
212
|
} else n[e] = s;
|
|
213
|
-
return (r[o] = n), this.cE.store(STORAGE_KEYS.
|
|
213
|
+
return (r[o] = n), this.cE.store(STORAGE_KEYS.gt.eE, r);
|
|
214
214
|
}
|
|
215
215
|
OE() {
|
|
216
|
-
const t = this.cE.gr(STORAGE_KEYS.
|
|
217
|
-
this.cE.remove(STORAGE_KEYS.
|
|
216
|
+
const t = this.cE.gr(STORAGE_KEYS.gt.eE);
|
|
217
|
+
this.cE.remove(STORAGE_KEYS.gt.eE);
|
|
218
218
|
const e = [];
|
|
219
219
|
for (const s in t) null != t[s] && e.push(t[s]);
|
|
220
220
|
return e;
|
|
221
221
|
}
|
|
222
222
|
ru(t) {
|
|
223
|
-
const e = this.cE.gr(STORAGE_KEYS.
|
|
223
|
+
const e = this.cE.gr(STORAGE_KEYS.gt.eE);
|
|
224
224
|
if (null != e) {
|
|
225
225
|
const s = this.gE(null),
|
|
226
226
|
r = e[s];
|
|
227
227
|
null != r &&
|
|
228
228
|
((e[s] = void 0),
|
|
229
|
-
this.cE.store(STORAGE_KEYS.
|
|
230
|
-
(r[User.
|
|
231
|
-
this.
|
|
229
|
+
this.cE.store(STORAGE_KEYS.gt.eE, e),
|
|
230
|
+
(r[User.Qn] = t),
|
|
231
|
+
this.wu(r));
|
|
232
232
|
}
|
|
233
233
|
const s = this.tu(STORAGE_KEYS.iu.Nl);
|
|
234
234
|
let r = null;
|
|
@@ -244,12 +244,12 @@ export default class ne {
|
|
|
244
244
|
return this.cE.dE;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
(ne.
|
|
247
|
+
(ne.lc = class {
|
|
248
248
|
constructor(t) {
|
|
249
|
-
(this.
|
|
249
|
+
(this.un = t), (this.un = t), (this.dE = ro.fE() ? 3 : 10);
|
|
250
250
|
}
|
|
251
251
|
bE(t) {
|
|
252
|
-
return t + "." + this.
|
|
252
|
+
return t + "." + this.un;
|
|
253
253
|
}
|
|
254
254
|
store(t, e) {
|
|
255
255
|
const s = { v: e };
|
|
@@ -276,7 +276,7 @@ export default class ne {
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}),
|
|
279
|
-
(ne.
|
|
279
|
+
(ne.gc = class {
|
|
280
280
|
constructor() {
|
|
281
281
|
(this.KE = {}), (this.mE = 5242880), (this.dE = 3);
|
|
282
282
|
}
|
|
@@ -320,15 +320,15 @@ export default class ne {
|
|
|
320
320
|
}),
|
|
321
321
|
(ne.se = class {
|
|
322
322
|
constructor(t, e) {
|
|
323
|
-
(this.
|
|
323
|
+
(this.un = t),
|
|
324
324
|
(this.NE = e),
|
|
325
|
-
(this.
|
|
325
|
+
(this.un = t),
|
|
326
326
|
(this.GE = this.DE()),
|
|
327
327
|
(this.CE = 576e3),
|
|
328
328
|
(this.NE = !!e);
|
|
329
329
|
}
|
|
330
330
|
bE(t) {
|
|
331
|
-
return null != this.
|
|
331
|
+
return null != this.un ? t + "." + this.un : t;
|
|
332
332
|
}
|
|
333
333
|
DE() {
|
|
334
334
|
let t = 0,
|
|
@@ -345,7 +345,7 @@ export default class ne {
|
|
|
345
345
|
e
|
|
346
346
|
);
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
le() {
|
|
349
349
|
const t = new Date();
|
|
350
350
|
return t.setTime(t.getTime() + 60 * this.CE * 1e3), t.getFullYear();
|
|
351
351
|
}
|
|
@@ -363,7 +363,7 @@ export default class ne {
|
|
|
363
363
|
}
|
|
364
364
|
if (o) {
|
|
365
365
|
const t = r.split("=")[0];
|
|
366
|
-
-1 === t.indexOf("." + this.
|
|
366
|
+
-1 === t.indexOf("." + this.un) && this.pE(t);
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
}
|
|
@@ -419,13 +419,13 @@ export default class ne {
|
|
|
419
419
|
(document.cookie = s), (document.cookie = s + ";path=/");
|
|
420
420
|
}
|
|
421
421
|
}),
|
|
422
|
-
(ne.
|
|
422
|
+
(ne.cc = class {
|
|
423
423
|
constructor(t, e, s) {
|
|
424
|
-
(this.
|
|
424
|
+
(this.un = t),
|
|
425
425
|
(this.vE = []),
|
|
426
426
|
e && this.vE.push(new ne.se(t)),
|
|
427
|
-
s && this.vE.push(new ne.
|
|
428
|
-
this.vE.push(new ne.
|
|
427
|
+
s && this.vE.push(new ne.lc(t)),
|
|
428
|
+
this.vE.push(new ne.gc());
|
|
429
429
|
}
|
|
430
430
|
store(t, e) {
|
|
431
431
|
let s = !0;
|
|
@@ -440,7 +440,7 @@ export default class ne {
|
|
|
440
440
|
return null;
|
|
441
441
|
}
|
|
442
442
|
remove(t) {
|
|
443
|
-
new ne.se(this.
|
|
443
|
+
new ne.se(this.un).remove(t);
|
|
444
444
|
for (let e = 0; e < this.vE.length; e++) this.vE[e].remove(t);
|
|
445
445
|
}
|
|
446
446
|
});
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { Guid as G } from "../../shared-lib/index.js";
|
|
2
2
|
export default class u {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.
|
|
4
|
+
this.Mi = {};
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
Ft(t) {
|
|
7
7
|
if ("function" != typeof t) return null;
|
|
8
|
-
const i = G.
|
|
9
|
-
return (this.
|
|
8
|
+
const i = G.ce();
|
|
9
|
+
return (this.Mi[i] = t), i;
|
|
10
10
|
}
|
|
11
11
|
removeSubscription(t) {
|
|
12
|
-
delete this.
|
|
12
|
+
delete this.Mi[t];
|
|
13
13
|
}
|
|
14
14
|
removeAllSubscriptions() {
|
|
15
|
-
this.
|
|
15
|
+
this.Mi = {};
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
return Object.keys(this.
|
|
17
|
+
uc() {
|
|
18
|
+
return Object.keys(this.Mi).length;
|
|
19
19
|
}
|
|
20
20
|
X(t) {
|
|
21
21
|
const i = [];
|
|
22
|
-
for (const s in this.
|
|
23
|
-
const r = this.
|
|
22
|
+
for (const s in this.Mi) {
|
|
23
|
+
const r = this.Mi[s];
|
|
24
24
|
i.push(r(t));
|
|
25
25
|
}
|
|
26
26
|
return i;
|
package/src/managers/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { STORAGE_KEYS as
|
|
1
|
+
import { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
2
2
|
export function getAlias(e) {
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
return
|
|
3
|
+
const t = null == e ? void 0 : e.ft(s.gt._E);
|
|
4
|
+
let n;
|
|
5
|
+
return t && (n = { label: t.l, name: t.a }), n;
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Au: "invalid_api_key",
|
|
3
|
+
Du: "blacklisted",
|
|
4
|
+
ku: "no_device_identifier",
|
|
5
|
+
qu: "invalid_json_response",
|
|
6
|
+
gu: "empty_response",
|
|
7
7
|
__: "sdk_auth_error",
|
|
8
8
|
};
|
|
@@ -18,7 +18,7 @@ export default class ve {
|
|
|
18
18
|
(this.sessionId = r),
|
|
19
19
|
(this.data = e);
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
$r() {
|
|
22
22
|
var t;
|
|
23
23
|
const s = {
|
|
24
24
|
name: this.type,
|
|
@@ -27,14 +27,14 @@ export default class ve {
|
|
|
27
27
|
session_id: this.sessionId,
|
|
28
28
|
};
|
|
29
29
|
null != this.userId && (s.user_id = this.userId);
|
|
30
|
-
const i = (null === (t = r.Sr()) || void 0 === t ? void 0 : t.
|
|
30
|
+
const i = (null === (t = r.Sr()) || void 0 === t ? void 0 : t.wh()) || !1;
|
|
31
31
|
if (!s.user_id && !i) {
|
|
32
32
|
const t = Ht(r.j());
|
|
33
33
|
t && (s.alias = t);
|
|
34
34
|
}
|
|
35
35
|
return s;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
bt() {
|
|
38
38
|
return {
|
|
39
39
|
u: this.userId,
|
|
40
40
|
t: this.type,
|
|
@@ -49,7 +49,7 @@ export default class ve {
|
|
|
49
49
|
static RE(t) {
|
|
50
50
|
return null != t && yt(t) && null != t.t && "" !== t.t;
|
|
51
51
|
}
|
|
52
|
-
static
|
|
52
|
+
static En(t) {
|
|
53
53
|
return new ve(t.u, t.t, t.ts, t.s, t.d);
|
|
54
54
|
}
|
|
55
55
|
}
|
package/src/models/device.js
CHANGED
|
@@ -2,11 +2,11 @@ export default class Gt {
|
|
|
2
2
|
constructor(s) {
|
|
3
3
|
(this.id = s), (this.id = s);
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
$r() {
|
|
6
6
|
const s = {};
|
|
7
7
|
return (
|
|
8
8
|
null != this.browser && (s.browser = this.browser),
|
|
9
|
-
null != this.
|
|
9
|
+
null != this.Za && (s.browser_version = this.Za),
|
|
10
10
|
null != this.os && (s.os_version = this.os),
|
|
11
11
|
null != this.resolution && (s.resolution = this.resolution),
|
|
12
12
|
null != this.language && (s.locale = this.language),
|
package/src/models/identifier.js
CHANGED
|
@@ -4,13 +4,13 @@ import { getErrorMessage as si } from "../util/error-utils.js";
|
|
|
4
4
|
export default class _t {
|
|
5
5
|
constructor(t, e, i) {
|
|
6
6
|
(this.eu = t),
|
|
7
|
-
null == t && (t = G.
|
|
7
|
+
null == t && (t = G.ce()),
|
|
8
8
|
!i || isNaN(i) ? (this.Gl = new Date().valueOf()) : (this.Gl = i),
|
|
9
9
|
(this.eu = t),
|
|
10
10
|
(this.ql = new Date().valueOf()),
|
|
11
11
|
(this.kl = e);
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
bt() {
|
|
14
14
|
return `g:${encodeURIComponent(this.eu)}|e:${this.kl}|c:${this.Gl}|l:${
|
|
15
15
|
this.ql
|
|
16
16
|
}`;
|
|
@@ -26,7 +26,7 @@ export default class _t {
|
|
|
26
26
|
(t = t.replace(i, `g:${n}`))
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
static
|
|
29
|
+
static En(t) {
|
|
30
30
|
let e;
|
|
31
31
|
if ("string" == typeof t)
|
|
32
32
|
try {
|
package/src/models/push-token.js
CHANGED
|
@@ -2,26 +2,26 @@ import { rehydrateDateAfterJsonization as V } from "../util/date-utils.js";
|
|
|
2
2
|
export default class ti {
|
|
3
3
|
constructor(t, i, s, l, h) {
|
|
4
4
|
(this.endpoint = t),
|
|
5
|
-
(this.
|
|
5
|
+
(this.zn = i),
|
|
6
6
|
(this.publicKey = s),
|
|
7
7
|
(this.Vl = l),
|
|
8
|
-
(this.
|
|
8
|
+
(this.fl = h),
|
|
9
9
|
(this.endpoint = t || null),
|
|
10
|
-
(this.
|
|
10
|
+
(this.zn = i || null),
|
|
11
11
|
(this.publicKey = s || null),
|
|
12
12
|
(this.Vl = l || null),
|
|
13
|
-
(this.
|
|
13
|
+
(this.fl = h || null);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
bt() {
|
|
16
16
|
return {
|
|
17
17
|
e: this.endpoint,
|
|
18
|
-
c: this.
|
|
18
|
+
c: this.zn,
|
|
19
19
|
p: this.publicKey,
|
|
20
20
|
u: this.Vl,
|
|
21
|
-
v: this.
|
|
21
|
+
v: this.fl,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
static
|
|
24
|
+
static En(t) {
|
|
25
25
|
return new ti(t.e, V(t.c), t.p, t.u, t.v);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default class E {
|
|
2
2
|
constructor(t = !1, s = []) {
|
|
3
|
-
(this.
|
|
3
|
+
(this.tt = t), (this.$e = s), (this.tt = t), (this.$e = s);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
(this.
|
|
5
|
+
rs(t) {
|
|
6
|
+
(this.tt = this.tt && t.tt), this.$e.push(...t.$e);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -15,46 +15,46 @@ export default class Jt {
|
|
|
15
15
|
n = { enabled: !0, capacity: Zt, refill_rate: hi, endpoint_overrides: {} },
|
|
16
16
|
o = { enabled: !1, max_placements: 0 },
|
|
17
17
|
) {
|
|
18
|
-
(this.
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
18
|
+
(this.ml = t),
|
|
19
|
+
(this.Rl = i),
|
|
20
|
+
(this.Cl = s),
|
|
21
|
+
(this.El = h),
|
|
22
|
+
(this.wl = e),
|
|
23
|
+
(this.fl = l),
|
|
24
|
+
(this.dl = r),
|
|
25
|
+
(this.De = a),
|
|
26
|
+
(this.bl = n),
|
|
27
27
|
(this.banners = o),
|
|
28
|
-
(this.
|
|
29
|
-
(this.
|
|
30
|
-
(this.
|
|
31
|
-
(this.
|
|
32
|
-
(this.
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
35
|
-
(this.
|
|
36
|
-
(this.
|
|
28
|
+
(this.ml = t),
|
|
29
|
+
(this.Rl = i),
|
|
30
|
+
(this.Cl = s),
|
|
31
|
+
(this.El = h),
|
|
32
|
+
(this.wl = e),
|
|
33
|
+
(this.fl = l),
|
|
34
|
+
(this.dl = r),
|
|
35
|
+
(this.De = a),
|
|
36
|
+
(this.bl = n),
|
|
37
37
|
(this.banners = o);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
bt() {
|
|
40
40
|
return {
|
|
41
|
-
s: "5.8.
|
|
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.
|
|
41
|
+
s: "5.8.1",
|
|
42
|
+
l: this.ml,
|
|
43
|
+
e: this.Rl,
|
|
44
|
+
a: this.Cl,
|
|
45
|
+
p: this.El,
|
|
46
|
+
m: this.wl,
|
|
47
|
+
v: this.fl,
|
|
48
|
+
c: this.dl,
|
|
49
|
+
f: this.De,
|
|
50
|
+
grl: this.bl,
|
|
51
51
|
b: this.banners,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
static
|
|
54
|
+
static En(t) {
|
|
55
55
|
let i = t.l;
|
|
56
56
|
return (
|
|
57
|
-
"5.8.
|
|
57
|
+
"5.8.1" !== t.s && (i = 0),
|
|
58
58
|
new Jt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
|
|
59
59
|
);
|
|
60
60
|
}
|