@braze/web-sdk 4.5.0 → 4.6.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/README.md +1 -1
- package/index.d.ts +49 -8
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +7 -7
- package/shared-lib/encoding-utils.js +3 -3
- package/shared-lib/event-types.js +14 -14
- package/shared-lib/guid.js +2 -2
- package/shared-lib/indexed-db-adapter.js +3 -3
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +15 -15
- package/src/Card/index.js +1 -0
- package/src/Card/log-content-card-click.js +4 -0
- package/src/FeatureFlags/feature-flag-factory.js +13 -5
- package/src/FeatureFlags/feature-flag.js +36 -8
- package/src/FeatureFlags/feature-flags-provider.js +58 -33
- package/src/FeatureFlags/get-all-feature-flags.js +3 -3
- package/src/FeatureFlags/get-feature-flag.js +5 -5
- package/src/FeatureFlags/index.js +1 -0
- package/src/Feed/feed-provider-factory.js +8 -8
- package/src/Feed/feed-provider.js +3 -3
- package/src/Feed/get-cached-feed.js +2 -2
- package/src/Feed/log-feed-displayed.js +1 -1
- package/src/Feed/request-feed-refresh.js +2 -2
- package/src/Feed/subscribe-to-feed-updates.js +2 -2
- package/src/Feed/ui/show-feed.js +2 -2
- package/src/InAppMessage/display/html-message-to-html.js +3 -3
- package/src/InAppMessage/display/in-app-message-to-html.js +101 -86
- package/src/InAppMessage/display/modal-utils.js +9 -9
- package/src/InAppMessage/in-app-message-factory.js +1 -1
- package/src/InAppMessage/in-app-message-manager-factory.js +3 -3
- package/src/InAppMessage/in-app-message-manager.js +52 -52
- package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +1 -1
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +68 -68
- package/src/InAppMessage/models/modal-message.js +2 -2
- package/src/InAppMessage/models/slide-up-message.js +8 -8
- package/src/InAppMessage/models/templated-in-app-message.js +4 -4
- 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 +24 -21
- package/src/Push/push-manager.js +54 -54
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +4 -4
- package/src/User/user.js +13 -13
- package/src/common/base-feed.js +1 -1
- package/src/common/feed-display.js +22 -22
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/managers/auth-manager.js +23 -23
- package/src/managers/braze-instance.js +93 -93
- package/src/managers/device-manager.js +2 -2
- package/src/managers/network-manager.js +42 -42
- package/src/managers/server-config-manager.js +9 -9
- package/src/managers/session-manager.js +27 -27
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +61 -61
- package/src/managers/subscription-manager.js +6 -6
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +2 -2
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +6 -6
- package/src/models/push-token.js +3 -3
- package/src/models/server-config.js +3 -3
- package/src/request-controller.js +52 -52
- package/src/triggers/models/filter-set.js +2 -2
- package/src/triggers/models/filter.js +34 -34
- package/src/triggers/models/in-app-message-click-data.js +6 -6
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +8 -8
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +30 -30
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +37 -37
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +1 -1
- package/src/ui/js/iam-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +2 -2
- package/src/util/dom-utils.js +8 -8
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +3 -3
- package/src/util/window-utils.js +1 -1
|
@@ -8,61 +8,61 @@ export default class Rt {
|
|
|
8
8
|
(this.h = s),
|
|
9
9
|
(this.v = t),
|
|
10
10
|
(this.gt = e),
|
|
11
|
-
(this.
|
|
11
|
+
(this.dh = 1e3),
|
|
12
12
|
(i = parseFloat(i)),
|
|
13
13
|
isNaN(i) && (i = 1800),
|
|
14
|
-
i < this.
|
|
14
|
+
i < this.dh / 1e3 &&
|
|
15
15
|
(r.D.info(
|
|
16
16
|
"Specified session timeout of " +
|
|
17
17
|
i +
|
|
18
18
|
"s is too small, using the minimum session timeout of " +
|
|
19
|
-
this.
|
|
19
|
+
this.dh / 1e3 +
|
|
20
20
|
"s instead."
|
|
21
21
|
),
|
|
22
|
-
(i = this.
|
|
23
|
-
(this.
|
|
22
|
+
(i = this.dh / 1e3)),
|
|
23
|
+
(this.fh = i);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
return new ue(this.v.getUserId(), r.A.
|
|
25
|
+
ph(s, t) {
|
|
26
|
+
return new ue(this.v.getUserId(), r.A.gh, s, t.iu, { d: l(s - t.wh) });
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
const s = this.h.tu(o.eu.
|
|
28
|
+
la() {
|
|
29
|
+
const s = this.h.tu(o.eu.Sh);
|
|
30
30
|
return null == s ? null : s.iu;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
jh() {
|
|
33
33
|
const s = new Date().valueOf(),
|
|
34
34
|
t = this.gt.wl(),
|
|
35
|
-
e = this.h.I(o.q.
|
|
35
|
+
e = this.h.I(o.q.bh);
|
|
36
36
|
if (null != e && null == t) return !1;
|
|
37
37
|
const i = null == e || s - e > 1e3 * t;
|
|
38
|
-
return i && this.h.B(o.q.
|
|
38
|
+
return i && this.h.B(o.q.bh, s), i;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
return null == t || (!(s - t.
|
|
40
|
+
xh(s, t) {
|
|
41
|
+
return null == t || (!(s - t.wh < this.dh) && t.Dh < s);
|
|
42
42
|
}
|
|
43
43
|
mo() {
|
|
44
44
|
const s = new Date().valueOf(),
|
|
45
|
-
t = s + 1e3 * this.
|
|
46
|
-
e = this.h.tu(o.eu.
|
|
47
|
-
if (this.
|
|
45
|
+
t = s + 1e3 * this.fh,
|
|
46
|
+
e = this.h.tu(o.eu.Sh);
|
|
47
|
+
if (this.xh(s, e)) {
|
|
48
48
|
let i = "Generating session start event with time " + s;
|
|
49
49
|
if (null != e) {
|
|
50
|
-
let s = e.
|
|
51
|
-
s - e.
|
|
52
|
-
this.h.
|
|
50
|
+
let s = e.Ch;
|
|
51
|
+
s - e.wh < this.dh && (s = e.wh + this.Gh),
|
|
52
|
+
this.h.Nh(this.ph(s, e)),
|
|
53
53
|
(i += " (old session ended " + s + ")");
|
|
54
54
|
}
|
|
55
55
|
(i += ". Will expire " + t.valueOf()), r.D.info(i);
|
|
56
56
|
const n = new _t(r.it.nt(), t);
|
|
57
|
-
this.h.
|
|
58
|
-
this.h.ru(o.eu.
|
|
59
|
-
return null == this.h.I(o.q.
|
|
57
|
+
this.h.Nh(new ue(this.v.getUserId(), r.A._h, s, n.iu)),
|
|
58
|
+
this.h.ru(o.eu.Sh, n);
|
|
59
|
+
return null == this.h.I(o.q.bh) && this.h.B(o.q.bh, s), n.iu;
|
|
60
60
|
}
|
|
61
|
-
return (e.
|
|
61
|
+
return (e.Ch = s), (e.Dh = t), this.h.ru(o.eu.Sh, e), e.iu;
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
const s = this.h.tu(o.eu.
|
|
63
|
+
Fh() {
|
|
64
|
+
const s = this.h.tu(o.eu.Sh);
|
|
65
65
|
null != s &&
|
|
66
|
-
(this.h.
|
|
66
|
+
(this.h.Hh(o.eu.Sh), this.h.Nh(this.ph(new Date().valueOf(), s)));
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -13,7 +13,7 @@ export const STORAGE_KEYS = {
|
|
|
13
13
|
eu: {
|
|
14
14
|
su: "ab.storage.userId",
|
|
15
15
|
Jo: "ab.storage.deviceId",
|
|
16
|
-
|
|
16
|
+
Sh: "ab.storage.sessionId"
|
|
17
17
|
},
|
|
18
18
|
q: {
|
|
19
19
|
Sa: "ab.test",
|
|
@@ -21,16 +21,16 @@ export const STORAGE_KEYS = {
|
|
|
21
21
|
Ia: "ab.storage.attributes",
|
|
22
22
|
Ka: "ab.storage.attributes.anonymous_user",
|
|
23
23
|
Yo: "ab.storage.device",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
ha: "ab.storage.sdk_metadata",
|
|
25
|
+
ca: "ab.storage.session_id_for_cached_metadata",
|
|
26
|
+
Sn: "ab.storage.pushToken",
|
|
27
27
|
ei: "ab.storage.newsFeed",
|
|
28
28
|
hi: "ab.storage.lastNewsFeedRefresh",
|
|
29
29
|
P: "ab.storage.cardImpressions",
|
|
30
30
|
ol: "ab.storage.serverConfig",
|
|
31
31
|
Ya: "ab.storage.triggers",
|
|
32
32
|
Da: "ab.storage.triggers.ts",
|
|
33
|
-
|
|
33
|
+
bh: "ab.storage.messagingSessionStart",
|
|
34
34
|
Yt: "ab.storage.cc",
|
|
35
35
|
vs: "ab.storage.ccLastFullSync",
|
|
36
36
|
ys: "ab.storage.ccLastCardUpdated",
|
|
@@ -40,11 +40,11 @@ export const STORAGE_KEYS = {
|
|
|
40
40
|
Ga: "ab.storage.lastDisplayedTriggerTimesById",
|
|
41
41
|
Na: "ab.storage.lastDisplayedTriggerTime",
|
|
42
42
|
va: "ab.storage.triggerFireInstancesById",
|
|
43
|
-
|
|
43
|
+
Qn: "ab.storage.signature",
|
|
44
44
|
As: "ab.storage.brazeSyncRetryCount",
|
|
45
45
|
_s: "ab.storage.sdkVersion",
|
|
46
46
|
ze: "ab.storage.ff",
|
|
47
|
-
|
|
47
|
+
Ce: "ab.storage.ffLastRefreshAt"
|
|
48
48
|
},
|
|
49
49
|
ae: "ab.optOut"
|
|
50
50
|
};
|
|
@@ -58,12 +58,12 @@ export default class G {
|
|
|
58
58
|
}
|
|
59
59
|
ya(t) {
|
|
60
60
|
const e = this.tu(t);
|
|
61
|
-
null != e && ((e.
|
|
61
|
+
null != e && ((e.Ch = new Date().valueOf()), this.ru(t, e));
|
|
62
62
|
}
|
|
63
63
|
tu(t) {
|
|
64
|
-
return _t.
|
|
64
|
+
return _t.jn(this.Ma.lr(t));
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
Hh(t) {
|
|
67
67
|
this.Ma.remove(t);
|
|
68
68
|
}
|
|
69
69
|
bo(t) {
|
|
@@ -74,7 +74,7 @@ export default class G {
|
|
|
74
74
|
for (let s = 0; s < t.length; s++) e.push(t[s].ss());
|
|
75
75
|
return this.Ca.store(STORAGE_KEYS.q.Ta, e);
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
Nh(t) {
|
|
78
78
|
return null != t && this.bo([t]);
|
|
79
79
|
}
|
|
80
80
|
Ua() {
|
|
@@ -85,7 +85,7 @@ export default class G {
|
|
|
85
85
|
o = null;
|
|
86
86
|
if (p(t))
|
|
87
87
|
for (let s = 0; s < t.length; s++)
|
|
88
|
-
ue.Fa(t[s]) ? e.push(ue.
|
|
88
|
+
ue.Fa(t[s]) ? e.push(ue.jn(t[s])) : (o = s);
|
|
89
89
|
else s = !0;
|
|
90
90
|
if (s || null != o) {
|
|
91
91
|
let n = "Stored events could not be deserialized as Events";
|
|
@@ -147,14 +147,14 @@ export default class G {
|
|
|
147
147
|
La(t) {
|
|
148
148
|
return t || STORAGE_KEYS.q.Ka;
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
za(t) {
|
|
151
151
|
let e = this.Ca.lr(STORAGE_KEYS.q.Ia);
|
|
152
152
|
null == e && (e = {});
|
|
153
|
-
const s = this.La(t[User.
|
|
153
|
+
const s = this.La(t[User.On]);
|
|
154
154
|
for (let r in t)
|
|
155
|
-
r === User.
|
|
155
|
+
r === User.On ||
|
|
156
156
|
(null != e[s] && null != e[s][r]) ||
|
|
157
|
-
this.mu(t[User.
|
|
157
|
+
this.mu(t[User.On], r, t[r]);
|
|
158
158
|
}
|
|
159
159
|
mu(t, e, s) {
|
|
160
160
|
let r = this.Ca.lr(STORAGE_KEYS.q.Ia);
|
|
@@ -162,14 +162,14 @@ export default class G {
|
|
|
162
162
|
const o = this.La(t);
|
|
163
163
|
let n = r[o];
|
|
164
164
|
if (
|
|
165
|
-
(null == n && ((n = {}), null != t && (n[User.
|
|
165
|
+
(null == n && ((n = {}), null != t && (n[User.On] = t)), e === User.lu)
|
|
166
166
|
) {
|
|
167
167
|
null == n[e] && (n[e] = {});
|
|
168
168
|
for (let t in s) n[e][t] = s[t];
|
|
169
169
|
} else n[e] = s;
|
|
170
170
|
return (r[o] = n), this.Ca.store(STORAGE_KEYS.q.Ia, r);
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
Pa() {
|
|
173
173
|
const t = this.Ca.lr(STORAGE_KEYS.q.Ia);
|
|
174
174
|
this.Ca.remove(STORAGE_KEYS.q.Ia);
|
|
175
175
|
const e = [];
|
|
@@ -184,41 +184,41 @@ export default class G {
|
|
|
184
184
|
null != r &&
|
|
185
185
|
((e[s] = void 0),
|
|
186
186
|
this.Ca.store(STORAGE_KEYS.q.Ia, e),
|
|
187
|
-
(r[User.
|
|
188
|
-
this.
|
|
187
|
+
(r[User.On] = t),
|
|
188
|
+
this.za(r));
|
|
189
189
|
}
|
|
190
|
-
const s = this.tu(STORAGE_KEYS.eu.
|
|
190
|
+
const s = this.tu(STORAGE_KEYS.eu.Sh);
|
|
191
191
|
let r = null;
|
|
192
192
|
null != s && (r = s.iu);
|
|
193
193
|
const o = this.Ua();
|
|
194
194
|
if (null != o)
|
|
195
195
|
for (let e = 0; e < o.length; e++) {
|
|
196
196
|
const s = o[e];
|
|
197
|
-
null == s.userId && s.sessionId == r && (s.userId = t), this.
|
|
197
|
+
null == s.userId && s.sessionId == r && (s.userId = t), this.Nh(s);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
|
|
201
|
-
return this.Ca.
|
|
200
|
+
xa() {
|
|
201
|
+
return this.Ca.Ja;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
G._a = class {
|
|
205
205
|
constructor(t) {
|
|
206
|
-
(this._r = t), (this.
|
|
206
|
+
(this._r = t), (this.Ja = ot.ka() ? 3 : 10);
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
Va(t) {
|
|
209
209
|
return t + "." + this._r;
|
|
210
210
|
}
|
|
211
211
|
store(t, e) {
|
|
212
212
|
const s = { v: e };
|
|
213
213
|
try {
|
|
214
|
-
return localStorage.setItem(this.
|
|
214
|
+
return localStorage.setItem(this.Va(t), JSON.stringify(s)), !0;
|
|
215
215
|
} catch (t) {
|
|
216
216
|
return r.D.info("Storage failure: " + t.message), !1;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
lr(t) {
|
|
220
220
|
try {
|
|
221
|
-
const e = JSON.parse(localStorage.getItem(this.
|
|
221
|
+
const e = JSON.parse(localStorage.getItem(this.Va(t)));
|
|
222
222
|
return null == e ? null : e.v;
|
|
223
223
|
} catch (t) {
|
|
224
224
|
return r.D.info("Storage retrieval failure: " + t.message), null;
|
|
@@ -226,7 +226,7 @@ G._a = class {
|
|
|
226
226
|
}
|
|
227
227
|
remove(t) {
|
|
228
228
|
try {
|
|
229
|
-
localStorage.removeItem(this.
|
|
229
|
+
localStorage.removeItem(this.Va(t));
|
|
230
230
|
} catch (t) {
|
|
231
231
|
return r.D.info("Storage removal failure: " + t.message), !1;
|
|
232
232
|
}
|
|
@@ -234,12 +234,12 @@ G._a = class {
|
|
|
234
234
|
};
|
|
235
235
|
G.ne = class {
|
|
236
236
|
constructor(t, e) {
|
|
237
|
-
(this._r = t), (this.
|
|
237
|
+
(this._r = t), (this.Qa = this.Ha()), (this.Wa = 576e3), (this.Xa = !!e);
|
|
238
238
|
}
|
|
239
|
-
|
|
239
|
+
Va(t) {
|
|
240
240
|
return null != this._r ? t + "." + this._r : t;
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
Ha() {
|
|
243
243
|
let t = 0,
|
|
244
244
|
e = document.location.hostname;
|
|
245
245
|
const s = e.split("."),
|
|
@@ -256,9 +256,9 @@ G.ne = class {
|
|
|
256
256
|
}
|
|
257
257
|
ie() {
|
|
258
258
|
const t = new Date();
|
|
259
|
-
return t.setTime(t.getTime() + 60 * this.
|
|
259
|
+
return t.setTime(t.getTime() + 60 * this.Wa * 1e3), t.getFullYear();
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
Za() {
|
|
262
262
|
const t = At(STORAGE_KEYS.eu),
|
|
263
263
|
e = document.cookie.split(";");
|
|
264
264
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -272,19 +272,19 @@ G.ne = class {
|
|
|
272
272
|
}
|
|
273
273
|
if (o) {
|
|
274
274
|
const t = r.split("=")[0];
|
|
275
|
-
-1 === t.indexOf("." + this._r) && this
|
|
275
|
+
-1 === t.indexOf("." + this._r) && this.$a(t);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
store(t, e) {
|
|
280
|
-
this.
|
|
280
|
+
this.Za();
|
|
281
281
|
const s = new Date();
|
|
282
|
-
s.setTime(s.getTime() + 60 * this.
|
|
282
|
+
s.setTime(s.getTime() + 60 * this.Wa * 1e3);
|
|
283
283
|
const o = "expires=" + s.toUTCString(),
|
|
284
|
-
n = "domain=" + this.
|
|
284
|
+
n = "domain=" + this.Qa;
|
|
285
285
|
let i;
|
|
286
|
-
i = this.
|
|
287
|
-
const a = this.
|
|
286
|
+
i = this.Xa ? e : encodeURIComponent(JSON.stringify(e));
|
|
287
|
+
const a = this.Va(t) + "=" + i + ";" + o + ";" + n + ";path=/";
|
|
288
288
|
return a.length >= 4093
|
|
289
289
|
? (r.D.info(
|
|
290
290
|
"Storage failure: string is " +
|
|
@@ -296,7 +296,7 @@ G.ne = class {
|
|
|
296
296
|
}
|
|
297
297
|
lr(t) {
|
|
298
298
|
const e = [],
|
|
299
|
-
s = this.
|
|
299
|
+
s = this.Va(t) + "=",
|
|
300
300
|
o = document.cookie.split(";");
|
|
301
301
|
for (let n = 0; n < o.length; n++) {
|
|
302
302
|
let i = o[n];
|
|
@@ -304,7 +304,7 @@ G.ne = class {
|
|
|
304
304
|
if (0 === i.indexOf(s))
|
|
305
305
|
try {
|
|
306
306
|
let t;
|
|
307
|
-
(t = this.
|
|
307
|
+
(t = this.Xa
|
|
308
308
|
? i.substring(s.length, i.length)
|
|
309
309
|
: JSON.parse(decodeURIComponent(i.substring(s.length, i.length)))),
|
|
310
310
|
e.push(t);
|
|
@@ -319,33 +319,33 @@ G.ne = class {
|
|
|
319
319
|
return e.length > 0 ? e[e.length - 1] : null;
|
|
320
320
|
}
|
|
321
321
|
remove(t) {
|
|
322
|
-
this
|
|
322
|
+
this.$a(this.Va(t));
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
$a(t) {
|
|
325
325
|
const e = t + "=;expires=" + new Date(0).toGMTString();
|
|
326
326
|
(document.cookie = e), (document.cookie = e + ";path=/");
|
|
327
|
-
const s = e + ";domain=" + this.
|
|
327
|
+
const s = e + ";domain=" + this.Qa;
|
|
328
328
|
(document.cookie = s), (document.cookie = s + ";path=/");
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
331
|
G.Oa = class {
|
|
332
332
|
constructor() {
|
|
333
|
-
(this
|
|
333
|
+
(this.El = {}), (this.Sl = 5242880), (this.Ja = 3);
|
|
334
334
|
}
|
|
335
335
|
store(t, e) {
|
|
336
336
|
const s = { value: e },
|
|
337
|
-
o = this.
|
|
338
|
-
return o > this.
|
|
337
|
+
o = this._l(e);
|
|
338
|
+
return o > this.Sl
|
|
339
339
|
? (r.D.info(
|
|
340
340
|
"Storage failure: object is ≈" +
|
|
341
341
|
o +
|
|
342
342
|
" bytes which is greater than the max of " +
|
|
343
|
-
this.
|
|
343
|
+
this.Sl
|
|
344
344
|
),
|
|
345
345
|
!1)
|
|
346
|
-
: ((this
|
|
346
|
+
: ((this.El[t] = s), !0);
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
_l(t) {
|
|
349
349
|
const e = [],
|
|
350
350
|
s = [t];
|
|
351
351
|
let r = 0;
|
|
@@ -362,33 +362,33 @@ G.Oa = class {
|
|
|
362
362
|
return r;
|
|
363
363
|
}
|
|
364
364
|
lr(t) {
|
|
365
|
-
const e = this
|
|
365
|
+
const e = this.El[t];
|
|
366
366
|
return null == e ? null : e.value;
|
|
367
367
|
}
|
|
368
368
|
remove(t) {
|
|
369
|
-
this
|
|
369
|
+
this.El[t] = null;
|
|
370
370
|
}
|
|
371
371
|
};
|
|
372
372
|
G.wa = class {
|
|
373
373
|
constructor(t, e, s) {
|
|
374
|
-
(this.
|
|
375
|
-
e && this.
|
|
376
|
-
s && this.
|
|
377
|
-
this.
|
|
374
|
+
(this.Tl = []),
|
|
375
|
+
e && this.Tl.push(new G.ne(t)),
|
|
376
|
+
s && this.Tl.push(new G._a(t)),
|
|
377
|
+
this.Tl.push(new G.Oa(t));
|
|
378
378
|
}
|
|
379
379
|
store(t, e) {
|
|
380
380
|
let s = !0;
|
|
381
|
-
for (let r = 0; r < this.
|
|
381
|
+
for (let r = 0; r < this.Tl.length; r++) s = this.Tl[r].store(t, e) && s;
|
|
382
382
|
return s;
|
|
383
383
|
}
|
|
384
384
|
lr(t) {
|
|
385
|
-
for (let e = 0; e < this.
|
|
386
|
-
const s = this.
|
|
385
|
+
for (let e = 0; e < this.Tl.length; e++) {
|
|
386
|
+
const s = this.Tl[e].lr(t);
|
|
387
387
|
if (null != s) return s;
|
|
388
388
|
}
|
|
389
389
|
return null;
|
|
390
390
|
}
|
|
391
391
|
remove(t) {
|
|
392
|
-
for (let e = 0; e < this.
|
|
392
|
+
for (let e = 0; e < this.Tl.length; e++) this.Tl[e].remove(t);
|
|
393
393
|
}
|
|
394
394
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
2
2
|
export default class u {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.
|
|
4
|
+
this.ni = {};
|
|
5
5
|
}
|
|
6
6
|
ut(t) {
|
|
7
7
|
if ("function" != typeof t) return null;
|
|
8
8
|
const i = r.it.nt();
|
|
9
|
-
return (this.
|
|
9
|
+
return (this.ni[i] = t), i;
|
|
10
10
|
}
|
|
11
11
|
removeSubscription(t) {
|
|
12
|
-
delete this.
|
|
12
|
+
delete this.ni[t];
|
|
13
13
|
}
|
|
14
14
|
removeAllSubscriptions() {
|
|
15
|
-
this.
|
|
15
|
+
this.ni = {};
|
|
16
16
|
}
|
|
17
17
|
bu() {
|
|
18
|
-
return Object.keys(this.
|
|
18
|
+
return Object.keys(this.ni).length;
|
|
19
19
|
}
|
|
20
20
|
St(t) {
|
|
21
21
|
const i = [];
|
|
22
|
-
for (let r in this.
|
|
22
|
+
for (let r in this.ni) i.push(this.ni[r](t));
|
|
23
23
|
return i;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Ra: "invalid_api_key",
|
|
3
|
+
ba: "blacklisted",
|
|
4
|
+
ga: "no_device_identifier",
|
|
5
|
+
pa: "invalid_json_response",
|
|
6
|
+
ma: "empty_response",
|
|
7
7
|
__: "sdk_auth_error"
|
|
8
8
|
};
|
|
@@ -11,7 +11,7 @@ export default class ue {
|
|
|
11
11
|
(this.sessionId = r),
|
|
12
12
|
(this.data = e);
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
Si() {
|
|
15
15
|
const t = {
|
|
16
16
|
name: this.type,
|
|
17
17
|
time: l(this.time),
|
|
@@ -35,7 +35,7 @@ export default class ue {
|
|
|
35
35
|
static Fa(t) {
|
|
36
36
|
return null != t && Jt(t) && null != t.t && "" !== t.t;
|
|
37
37
|
}
|
|
38
|
-
static
|
|
38
|
+
static jn(t) {
|
|
39
39
|
return new ue(t.u, t.t, t.ts, t.s, t.d);
|
|
40
40
|
}
|
|
41
41
|
}
|
package/src/models/device.js
CHANGED
package/src/models/identifier.js
CHANGED
|
@@ -5,16 +5,16 @@ export default class _t {
|
|
|
5
5
|
(s = parseInt(s)),
|
|
6
6
|
(isNaN(s) || 0 === s) && (s = new Date().valueOf()),
|
|
7
7
|
(this.iu = t),
|
|
8
|
-
(this.
|
|
9
|
-
(this.
|
|
10
|
-
(this.
|
|
8
|
+
(this.wh = s),
|
|
9
|
+
(this.Ch = new Date().valueOf()),
|
|
10
|
+
(this.Dh = e);
|
|
11
11
|
}
|
|
12
12
|
ss() {
|
|
13
|
-
return { g: this.iu, e: this.
|
|
13
|
+
return { g: this.iu, e: this.Dh, c: this.wh, l: this.Ch };
|
|
14
14
|
}
|
|
15
|
-
static
|
|
15
|
+
static jn(t) {
|
|
16
16
|
if (null == t || null == t.g) return null;
|
|
17
17
|
const e = new _t(t.g, t.e, t.c);
|
|
18
|
-
return (e.
|
|
18
|
+
return (e.Ch = t.l), e;
|
|
19
19
|
}
|
|
20
20
|
}
|
package/src/models/push-token.js
CHANGED
|
@@ -2,7 +2,7 @@ import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
|
|
|
2
2
|
export default class ei {
|
|
3
3
|
constructor(t, i, l, s, u) {
|
|
4
4
|
(this.endpoint = t || null),
|
|
5
|
-
(this.
|
|
5
|
+
(this._n = i || null),
|
|
6
6
|
(this.publicKey = l || null),
|
|
7
7
|
(this.zl = s || null),
|
|
8
8
|
(this.gl = u || null);
|
|
@@ -10,13 +10,13 @@ export default class ei {
|
|
|
10
10
|
ss() {
|
|
11
11
|
return {
|
|
12
12
|
e: this.endpoint,
|
|
13
|
-
c: this.
|
|
13
|
+
c: this._n,
|
|
14
14
|
p: this.publicKey,
|
|
15
15
|
u: this.zl,
|
|
16
16
|
v: this.gl
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
static
|
|
19
|
+
static jn(t) {
|
|
20
20
|
return new ei(t.e, w(t.c), t.p, t.u, t.v);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -12,7 +12,7 @@ export default class Ft {
|
|
|
12
12
|
}
|
|
13
13
|
ss() {
|
|
14
14
|
return {
|
|
15
|
-
s: "4.
|
|
15
|
+
s: "4.6.0",
|
|
16
16
|
l: this.ul,
|
|
17
17
|
e: this.bl,
|
|
18
18
|
a: this.dl,
|
|
@@ -23,10 +23,10 @@ export default class Ft {
|
|
|
23
23
|
f: this.cl
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
static
|
|
26
|
+
static jn(t) {
|
|
27
27
|
let s = t.l;
|
|
28
28
|
return (
|
|
29
|
-
"4.
|
|
29
|
+
"4.6.0" !== t.s && (s = 0), new Ft(s, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
}
|