@braze/web-sdk 4.9.0 → 4.10.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 +2289 -2228
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/event-types.js +9 -9
- package/shared-lib/indexed-db-adapter.js +1 -1
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +5 -4
- package/src/Core/get-device-id.js +9 -7
- package/src/User/user.js +10 -9
- package/src/managers/braze-instance.js +68 -66
- package/src/managers/device-manager.js +15 -15
- package/src/managers/network-manager.js +64 -61
- package/src/managers/session-manager.js +1 -1
- package/src/managers/storage-manager-factory.js +8 -8
- package/src/managers/storage-manager.js +15 -15
- package/src/managers/subscription-manager.js +1 -1
- 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/server-config.js +2 -2
- package/src/request-controller.js +112 -108
- package/src/triggers/models/filter.js +7 -7
- package/src/triggers/models/trigger-condition.js +17 -17
- package/src/triggers/models/trigger.js +25 -25
- package/src/triggers/triggers-provider.js +21 -21
- 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/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +6 -6
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +1 -1
- package/src/util/dom-utils.js +5 -5
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +14 -14
- package/src/util/user-agent-parser.js +5 -5
- package/src/util/validation-utils.js +9 -9
package/package.json
CHANGED
|
@@ -4,5 +4,5 @@ import Ge from "./guid.js";
|
|
|
4
4
|
import Oe from "./indexed-db-adapter.js";
|
|
5
5
|
import Ue from "./logger.js";
|
|
6
6
|
import ke from "./supported-options.js";
|
|
7
|
-
const r = { On: ve, q: De, Cr: Be, Z: Ge, xt: Oe, zt: Oe.ep, j: Ue,
|
|
7
|
+
const r = { On: ve, q: De, Cr: Be, Z: Ge, xt: Oe, zt: Oe.ep, j: Ue, Yo: ke };
|
|
8
8
|
export default r;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const De = {
|
|
2
2
|
CustomEvent: "ce",
|
|
3
3
|
Pr: "p",
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Mu: "pc",
|
|
5
|
+
cc: "ca",
|
|
6
|
+
Ka: "i",
|
|
7
7
|
qs: "ie",
|
|
8
8
|
P: "cci",
|
|
9
9
|
T: "ccic",
|
|
@@ -16,19 +16,19 @@ const De = {
|
|
|
16
16
|
Qi: "sbc",
|
|
17
17
|
Ki: "sfe",
|
|
18
18
|
eo: "iec",
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Lu: "lr",
|
|
20
|
+
Tu: "uae",
|
|
21
21
|
R: "ci",
|
|
22
22
|
B: "cc",
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Ru: "lcaa",
|
|
24
|
+
Pu: "lcar",
|
|
25
25
|
Xn: "inc",
|
|
26
26
|
Jn: "add",
|
|
27
27
|
Qn: "rem",
|
|
28
28
|
Hn: "set",
|
|
29
29
|
Kn: "ncam",
|
|
30
|
-
|
|
30
|
+
Nu: "sgu",
|
|
31
31
|
Fr: "ffi",
|
|
32
32
|
},
|
|
33
|
-
Be = { Br: "feed_displayed",
|
|
33
|
+
Be = { Br: "feed_displayed", dc: "content_cards_displayed" };
|
|
34
34
|
export { De as EventTypes, Be as InternalEventTypes };
|
package/shared-lib/logger.js
CHANGED
|
@@ -24,13 +24,13 @@ const Ue = {
|
|
|
24
24
|
},
|
|
25
25
|
warn: function (n) {
|
|
26
26
|
if (Ue.zg) {
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (v4.
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v4.10.0)";
|
|
28
28
|
null != Ue.j ? Ue.j(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function (n) {
|
|
32
32
|
if (Ue.zg) {
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (v4.
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v4.10.0)";
|
|
34
34
|
null != Ue.j ? Ue.j(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -10,17 +10,18 @@ export default {
|
|
|
10
10
|
No: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
11
11
|
wo: "sessionTimeoutInSeconds",
|
|
12
12
|
Oo: "appVersion",
|
|
13
|
+
Po: "appVersionNumber",
|
|
13
14
|
_a: "serviceWorkerLocation",
|
|
14
15
|
ka: "safariWebsitePushId",
|
|
15
16
|
Ba: "localization",
|
|
16
17
|
po: "contentSecurityNonce",
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
Ro: "enableHtmlInAppMessages",
|
|
19
|
+
Co: "allowUserSuppliedJavascript",
|
|
19
20
|
lo: "inAppMessageZIndex",
|
|
20
21
|
fo: "openInAppMessagesInNewTab",
|
|
21
22
|
en: "openNewsFeedCardsInNewTab",
|
|
22
23
|
mh: "requireExplicitInAppMessageDismissal",
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
Lo: "doNotLoadFontAwesome",
|
|
25
|
+
Mo: "sdkFlavor",
|
|
25
26
|
tn: "openCardsInNewTab",
|
|
26
27
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import e from "../managers/braze-instance.js";
|
|
2
2
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
3
|
-
export function getDeviceId(
|
|
3
|
+
export function getDeviceId(t) {
|
|
4
4
|
if (!e.rr()) return;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const i = e.te();
|
|
6
|
+
if (!i) return;
|
|
7
|
+
const c = i.ce().id;
|
|
8
|
+
if ("function" != typeof t) return c;
|
|
9
|
+
r.j.warn(
|
|
10
|
+
"The callback for getDeviceId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getDeviceId()`)",
|
|
11
|
+
),
|
|
12
|
+
t(c);
|
|
11
13
|
}
|
package/src/User/user.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isArray as p,
|
|
3
|
-
isDate as
|
|
4
|
-
isObject as
|
|
3
|
+
isDate as yt,
|
|
4
|
+
isObject as Nt,
|
|
5
5
|
validateValueIsFromEnum as H,
|
|
6
6
|
} from "../util/code-utils.js";
|
|
7
7
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
@@ -21,11 +21,12 @@ export default class User {
|
|
|
21
21
|
(this.ft = t), (this.ki = e), (this.ft = t), (this.ki = e);
|
|
22
22
|
}
|
|
23
23
|
getUserId(t) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
|
|
24
|
+
const e = this.ft.getUserId();
|
|
25
|
+
if ("function" != typeof t) return e;
|
|
26
|
+
r.j.warn(
|
|
27
|
+
"The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)",
|
|
28
|
+
),
|
|
29
|
+
t(e);
|
|
29
30
|
}
|
|
30
31
|
addAlias(t, e) {
|
|
31
32
|
return !J(t, "add alias", "the alias", !1) || t.length <= 0
|
|
@@ -182,13 +183,13 @@ export default class User {
|
|
|
182
183
|
if (!s && !n && 0 !== e.length) return !1;
|
|
183
184
|
if (s || 0 === e.length) return this.ki.Gn(r.q.Hn, t, e).O;
|
|
184
185
|
for (const t of e) if (!i(t)) return !1;
|
|
185
|
-
} else if (
|
|
186
|
+
} else if (Nt(e)) {
|
|
186
187
|
if (!i(e)) return !1;
|
|
187
188
|
if (s) return this.ki.Gn(r.q.Kn, t, e).O;
|
|
188
189
|
} else {
|
|
189
190
|
if (!(void 0 !== e && Ut(e))) return !1;
|
|
190
191
|
if (
|
|
191
|
-
(
|
|
192
|
+
(yt(e) && (e = $t(e)),
|
|
192
193
|
"string" == typeof e &&
|
|
193
194
|
!ot(
|
|
194
195
|
e,
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
isArray as p,
|
|
8
8
|
keys as oo,
|
|
9
9
|
validateValueIsFromEnum as H,
|
|
10
|
-
values as
|
|
10
|
+
values as Pt,
|
|
11
11
|
} from "../util/code-utils.js";
|
|
12
12
|
import { logDeprecationWarning as z } from "../util/deprecation-utils.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import Rt from "./network-manager.js";
|
|
14
|
+
import Lt from "../request-controller.js";
|
|
15
15
|
import Mt from "./server-config-manager.js";
|
|
16
16
|
import Dt from "./session-manager.js";
|
|
17
17
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
@@ -36,26 +36,27 @@ const L = {
|
|
|
36
36
|
No: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
37
37
|
wo: "sessionTimeoutInSeconds",
|
|
38
38
|
Oo: "appVersion",
|
|
39
|
+
Po: "appVersionNumber",
|
|
39
40
|
_a: "serviceWorkerLocation",
|
|
40
41
|
ka: "safariWebsitePushId",
|
|
41
42
|
Ba: "localization",
|
|
42
43
|
po: "contentSecurityNonce",
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
Ro: "enableHtmlInAppMessages",
|
|
45
|
+
Co: "allowUserSuppliedJavascript",
|
|
45
46
|
lo: "inAppMessageZIndex",
|
|
46
47
|
fo: "openInAppMessagesInNewTab",
|
|
47
48
|
tn: "openCardsInNewTab",
|
|
48
49
|
en: "openNewsFeedCardsInNewTab",
|
|
49
50
|
mh: "requireExplicitInAppMessageDismissal",
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
Lo: "doNotLoadFontAwesome",
|
|
52
|
+
Mo: "sdkFlavor",
|
|
52
53
|
};
|
|
53
54
|
class Wt {
|
|
54
55
|
constructor() {
|
|
55
56
|
(this.cn = ""),
|
|
56
|
-
(this.
|
|
57
|
-
(this.
|
|
58
|
-
(this.
|
|
57
|
+
(this.jo = ""),
|
|
58
|
+
(this.Do = void 0),
|
|
59
|
+
(this.Uo = null),
|
|
59
60
|
(this.fn = null),
|
|
60
61
|
(this.gt = null),
|
|
61
62
|
(this.ki = null),
|
|
@@ -63,22 +64,22 @@ class Wt {
|
|
|
63
64
|
(this._e = null),
|
|
64
65
|
(this.u = null),
|
|
65
66
|
(this.ft = null),
|
|
66
|
-
(this.
|
|
67
|
-
(this.Bo = !1),
|
|
67
|
+
(this.Bo = ""),
|
|
68
68
|
(this.Wo = !1),
|
|
69
|
-
(this.zo =
|
|
69
|
+
(this.zo = !1),
|
|
70
70
|
(this.Vo = new E()),
|
|
71
|
+
(this.Go = new E()),
|
|
71
72
|
(this.options = {}),
|
|
72
|
-
(this.Go = []),
|
|
73
73
|
(this.Ko = []),
|
|
74
|
+
(this.Ho = []),
|
|
74
75
|
(this.Ve = []),
|
|
75
|
-
(this.
|
|
76
|
+
(this.jo = "4.10.0");
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
this.
|
|
78
|
+
$o(t) {
|
|
79
|
+
this.Vo.lt(t);
|
|
79
80
|
}
|
|
80
81
|
Rh(t) {
|
|
81
|
-
this.
|
|
82
|
+
this.Go.lt(t);
|
|
82
83
|
}
|
|
83
84
|
initialize(t, s) {
|
|
84
85
|
if (this.fe())
|
|
@@ -107,34 +108,34 @@ class Wt {
|
|
|
107
108
|
((o = document.createElement("a")),
|
|
108
109
|
(o.href = h),
|
|
109
110
|
"/" === o.pathname && (o = `${o}api/v3`),
|
|
110
|
-
(this.
|
|
111
|
-
V
|
|
111
|
+
(this.Bo = o.toString()),
|
|
112
|
+
V.qo && !this.nn(L.ho))
|
|
112
113
|
)
|
|
113
114
|
return (
|
|
114
115
|
r.j.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
115
|
-
(this.
|
|
116
|
+
(this.zo = !0),
|
|
116
117
|
!1
|
|
117
118
|
);
|
|
118
119
|
const a = this.nn(L._o) || !1;
|
|
119
120
|
if (
|
|
120
|
-
((this.u = Bt.
|
|
121
|
+
((this.u = Bt.xo(t, a)), a && this.u.Jo(t), new O.ee(null, !0).jr(i.re))
|
|
121
122
|
)
|
|
122
123
|
return (
|
|
123
124
|
r.j.info("Ignoring all activity due to previous opt out"),
|
|
124
|
-
(this.
|
|
125
|
+
(this.zo = !0),
|
|
125
126
|
!1
|
|
126
127
|
);
|
|
127
128
|
for (const t of oo(this.options))
|
|
128
|
-
-1 ===
|
|
129
|
+
-1 === Pt(r.Yo).indexOf(t) &&
|
|
129
130
|
r.j.warn(`Ignoring unknown initialization option '${t}'.`);
|
|
130
131
|
const l = ["mparticle", "wordpress", "tealium"];
|
|
131
|
-
if (null != this.nn(L.
|
|
132
|
-
const t = this.nn(L.
|
|
132
|
+
if (null != this.nn(L.Mo)) {
|
|
133
|
+
const t = this.nn(L.Mo);
|
|
133
134
|
-1 !== l.indexOf(t)
|
|
134
|
-
? (this.
|
|
135
|
+
? (this.Do = t)
|
|
135
136
|
: r.j.error("Invalid sdk flavor passed: " + t);
|
|
136
137
|
}
|
|
137
|
-
let u = this.nn(r.
|
|
138
|
+
let u = this.nn(r.Yo.Io);
|
|
138
139
|
if (null != u)
|
|
139
140
|
if (p(u)) {
|
|
140
141
|
const t = [];
|
|
@@ -157,24 +158,25 @@ class Wt {
|
|
|
157
158
|
(this._e = new Dt(this.u, this.ft, this.wt, this.nn(L.wo)));
|
|
158
159
|
const f = new E();
|
|
159
160
|
return (
|
|
160
|
-
(this.
|
|
161
|
+
(this.Uo = new kt(this.u, this.nn(L.So), f)),
|
|
161
162
|
this.jt(f),
|
|
162
|
-
(this.gt = new
|
|
163
|
+
(this.gt = new Rt(
|
|
163
164
|
this.fn,
|
|
164
165
|
this.u,
|
|
165
|
-
this.
|
|
166
|
+
this.Uo,
|
|
166
167
|
this.ft,
|
|
167
168
|
this._e,
|
|
168
169
|
this.wt,
|
|
169
170
|
this.cn,
|
|
170
|
-
this.
|
|
171
|
-
this.
|
|
172
|
-
this.
|
|
171
|
+
this.Bo,
|
|
172
|
+
this.jo,
|
|
173
|
+
this.Do || "",
|
|
173
174
|
this.nn(L.Oo),
|
|
175
|
+
this.nn(L.Po),
|
|
174
176
|
)),
|
|
175
|
-
(this.ki = new
|
|
177
|
+
(this.ki = new Lt(
|
|
176
178
|
this.cn,
|
|
177
|
-
this.
|
|
179
|
+
this.Bo,
|
|
178
180
|
this._e,
|
|
179
181
|
this.fn,
|
|
180
182
|
this.ft,
|
|
@@ -183,7 +185,7 @@ class Wt {
|
|
|
183
185
|
(t) => {
|
|
184
186
|
if (this.fe()) for (const i of this.gr()) i.Ts(t);
|
|
185
187
|
},
|
|
186
|
-
this.
|
|
188
|
+
this.Uo,
|
|
187
189
|
this.gt,
|
|
188
190
|
)),
|
|
189
191
|
this.ki.initialize(),
|
|
@@ -192,7 +194,7 @@ class Wt {
|
|
|
192
194
|
L.Eo,
|
|
193
195
|
)}" with API key "${this.cn}".`,
|
|
194
196
|
),
|
|
195
|
-
null != this.nn(L.
|
|
197
|
+
null != this.nn(L.Ro) &&
|
|
196
198
|
z(
|
|
197
199
|
"enableHtmlInAppMessages",
|
|
198
200
|
"initialization option",
|
|
@@ -200,54 +202,54 @@ class Wt {
|
|
|
200
202
|
),
|
|
201
203
|
et.o(),
|
|
202
204
|
this.wt.Ci(() => {
|
|
203
|
-
this.
|
|
205
|
+
this.Wo &&
|
|
204
206
|
this.wt &&
|
|
205
207
|
this.wt.vi() &&
|
|
206
208
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
207
|
-
if (!this.
|
|
209
|
+
if (!this.Wo) return;
|
|
208
210
|
(0, t.default)();
|
|
209
211
|
});
|
|
210
212
|
}),
|
|
211
213
|
this.ki.pr(() => {
|
|
212
|
-
this.
|
|
214
|
+
this.Wo &&
|
|
213
215
|
this.wt &&
|
|
214
216
|
this.wt.vi() &&
|
|
215
217
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
216
|
-
if (!this.
|
|
218
|
+
if (!this.Wo) return;
|
|
217
219
|
(0, t.default)(void 0, void 0, !0);
|
|
218
220
|
});
|
|
219
221
|
}),
|
|
220
|
-
this.
|
|
221
|
-
(this.
|
|
222
|
+
this.Vo.Et(this.options),
|
|
223
|
+
(this.Wo = !0),
|
|
222
224
|
!0
|
|
223
225
|
);
|
|
224
226
|
}
|
|
225
227
|
destroy(t) {
|
|
226
228
|
if ((r.j.destroy(), this.fe())) {
|
|
227
|
-
this.
|
|
228
|
-
for (const t of this.
|
|
229
|
-
this.
|
|
230
|
-
for (const t of this.
|
|
231
|
-
(this.
|
|
229
|
+
this.Go.Et(), this.Go.removeAllSubscriptions();
|
|
230
|
+
for (const t of this.Ko) t.destroy();
|
|
231
|
+
this.Ko = [];
|
|
232
|
+
for (const t of this.Ho) t.clearData(!1);
|
|
233
|
+
(this.Ho = []),
|
|
232
234
|
this.removeAllSubscriptions(),
|
|
233
235
|
(this.Ve = []),
|
|
234
236
|
null != this.ki && this.ki.destroy(),
|
|
235
237
|
(this.ki = null),
|
|
236
|
-
(this.
|
|
238
|
+
(this.Uo = null),
|
|
237
239
|
(this.fn = null),
|
|
238
240
|
(this.gt = null),
|
|
239
241
|
(this.wt = null),
|
|
240
242
|
(this._e = null),
|
|
241
243
|
(this.ft = null),
|
|
242
244
|
(this.options = {}),
|
|
243
|
-
(this.
|
|
244
|
-
(this.Bo = !1),
|
|
245
|
+
(this.Do = void 0),
|
|
245
246
|
(this.Wo = !1),
|
|
247
|
+
(this.zo = !1),
|
|
246
248
|
t && (this.u = null);
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
251
|
rr() {
|
|
250
|
-
if (this.
|
|
252
|
+
if (this.Xo()) return !1;
|
|
251
253
|
if (!this.fe()) throw new Error(P);
|
|
252
254
|
return !0;
|
|
253
255
|
}
|
|
@@ -255,10 +257,10 @@ class Wt {
|
|
|
255
257
|
return this.cn;
|
|
256
258
|
}
|
|
257
259
|
Sr() {
|
|
258
|
-
return this.
|
|
260
|
+
return this.Uo;
|
|
259
261
|
}
|
|
260
262
|
Ys() {
|
|
261
|
-
return this.
|
|
263
|
+
return this.Bo;
|
|
262
264
|
}
|
|
263
265
|
te() {
|
|
264
266
|
return this.fn;
|
|
@@ -270,7 +272,7 @@ class Wt {
|
|
|
270
272
|
return this.options[t];
|
|
271
273
|
}
|
|
272
274
|
gr() {
|
|
273
|
-
return this.
|
|
275
|
+
return this.Ho;
|
|
274
276
|
}
|
|
275
277
|
cr() {
|
|
276
278
|
return this.ki;
|
|
@@ -291,17 +293,17 @@ class Wt {
|
|
|
291
293
|
return this.ft;
|
|
292
294
|
}
|
|
293
295
|
nr() {
|
|
294
|
-
return !0 === this.nn(L.
|
|
296
|
+
return !0 === this.nn(L.Co) || !0 === this.nn(L.Ro);
|
|
295
297
|
}
|
|
296
298
|
g(t) {
|
|
297
299
|
let i = !1;
|
|
298
|
-
for (const s of this.
|
|
299
|
-
i || this.
|
|
300
|
+
for (const s of this.Ko) s === t && (i = !0);
|
|
301
|
+
i || this.Ko.push(t);
|
|
300
302
|
}
|
|
301
303
|
dr(t) {
|
|
302
304
|
let i = !1;
|
|
303
|
-
for (const s of this.
|
|
304
|
-
t instanceof y && !i && this.
|
|
305
|
+
for (const s of this.Ho) s.constructor === t.constructor && (i = !0);
|
|
306
|
+
t instanceof y && !i && this.Ho.push(t);
|
|
305
307
|
}
|
|
306
308
|
jt(t) {
|
|
307
309
|
t instanceof E && this.Ve.push(t);
|
|
@@ -313,16 +315,16 @@ class Wt {
|
|
|
313
315
|
if (this.rr()) for (const i of this.Ve) i.removeSubscription(t);
|
|
314
316
|
}
|
|
315
317
|
ne(t) {
|
|
316
|
-
this.
|
|
318
|
+
this.zo = t;
|
|
317
319
|
}
|
|
318
320
|
fe() {
|
|
319
|
-
return this.Bo;
|
|
320
|
-
}
|
|
321
|
-
Yo() {
|
|
322
321
|
return this.Wo;
|
|
323
322
|
}
|
|
323
|
+
Xo() {
|
|
324
|
+
return this.zo;
|
|
325
|
+
}
|
|
324
326
|
ks() {
|
|
325
|
-
return this.
|
|
327
|
+
return this.jo;
|
|
326
328
|
}
|
|
327
329
|
}
|
|
328
330
|
const e = new Wt();
|
|
@@ -4,19 +4,19 @@ import DeviceProperties from "../Core/device-properties.js";
|
|
|
4
4
|
import _t from "../models/identifier.js";
|
|
5
5
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
6
6
|
import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
|
|
7
|
-
import { values as
|
|
7
|
+
import { values as Pt } from "../util/code-utils.js";
|
|
8
8
|
import { getErrorMessage as ei } from "../util/error-utils.js";
|
|
9
9
|
export default class Ot {
|
|
10
10
|
constructor(t, e) {
|
|
11
11
|
(this.u = t),
|
|
12
12
|
(this.Qo = e),
|
|
13
13
|
(this.u = t),
|
|
14
|
-
null == e && (e =
|
|
14
|
+
null == e && (e = Pt(DeviceProperties)),
|
|
15
15
|
(this.Qo = e);
|
|
16
16
|
}
|
|
17
17
|
ce(t = !0) {
|
|
18
|
-
let e = this.u.tu(i.eu.
|
|
19
|
-
null == e && ((e = new _t(r.Z.Y())), t && this.u.uu(i.eu.
|
|
18
|
+
let e = this.u.tu(i.eu.Zo);
|
|
19
|
+
null == e && ((e = new _t(r.Z.Y())), t && this.u.uu(i.eu.Zo, e));
|
|
20
20
|
const s = new xt(e.iu);
|
|
21
21
|
for (let t = 0; t < this.Qo.length; t++) {
|
|
22
22
|
switch (this.Qo[t]) {
|
|
@@ -24,19 +24,19 @@ export default class Ot {
|
|
|
24
24
|
s.browser = V.browser;
|
|
25
25
|
break;
|
|
26
26
|
case DeviceProperties.BROWSER_VERSION:
|
|
27
|
-
s.
|
|
27
|
+
s.Ia = V.version;
|
|
28
28
|
break;
|
|
29
29
|
case DeviceProperties.OS:
|
|
30
|
-
s.os = this.
|
|
30
|
+
s.os = this.Ta();
|
|
31
31
|
break;
|
|
32
32
|
case DeviceProperties.RESOLUTION:
|
|
33
|
-
s.
|
|
33
|
+
s.Da = screen.width + "x" + screen.height;
|
|
34
34
|
break;
|
|
35
35
|
case DeviceProperties.LANGUAGE:
|
|
36
36
|
s.language = V.language;
|
|
37
37
|
break;
|
|
38
38
|
case DeviceProperties.TIME_ZONE:
|
|
39
|
-
s.timeZone = this.
|
|
39
|
+
s.timeZone = this.Oa(new Date());
|
|
40
40
|
break;
|
|
41
41
|
case DeviceProperties.USER_AGENT:
|
|
42
42
|
s.userAgent = V.userAgent;
|
|
@@ -44,12 +44,12 @@ export default class Ot {
|
|
|
44
44
|
}
|
|
45
45
|
return s;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
if (V.
|
|
49
|
-
const t = this.u.v(i.k.
|
|
50
|
-
return t && t.os_version ? t.os_version : V.
|
|
47
|
+
Ta() {
|
|
48
|
+
if (V.Ca()) return V.Ca();
|
|
49
|
+
const t = this.u.v(i.k.Fa);
|
|
50
|
+
return t && t.os_version ? t.os_version : V.Ta();
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
Oa(t) {
|
|
53
53
|
let e = !1;
|
|
54
54
|
if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)
|
|
55
55
|
try {
|
|
@@ -66,9 +66,9 @@ export default class Ot {
|
|
|
66
66
|
}
|
|
67
67
|
if (e) return "";
|
|
68
68
|
const s = t.getTimezoneOffset();
|
|
69
|
-
return this.
|
|
69
|
+
return this.Ga(s);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
Ga(t) {
|
|
72
72
|
const e = Math.trunc(t / 60),
|
|
73
73
|
r = Math.trunc(t % 60);
|
|
74
74
|
let s = "GMT";
|