@braze/web-sdk 4.9.0 → 5.0.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 +2204 -2230
- 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 +13 -13
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +8 -8
- package/src/Card/models/captioned-image.js +19 -19
- package/src/Card/models/card.js +95 -94
- package/src/Card/models/classic-card.js +19 -19
- package/src/Card/models/control-card.js +9 -9
- package/src/Card/models/image-only.js +21 -22
- package/src/Card/models/index.js +0 -1
- package/src/Card/util/card-factory.js +39 -39
- package/src/ContentCards/content-cards-provider.js +114 -114
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/index.js +0 -1
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
- package/src/ContentCards/ui/hide-content-cards.js +2 -2
- package/src/ContentCards/ui/show-content-cards.js +14 -14
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.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 +9 -7
- package/src/Core/handle-braze-action.js +14 -14
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/open-session.js +5 -5
- package/src/Core/set-sdk-authentication-signature.js +2 -2
- package/src/Core/wipe-data.js +4 -4
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +7 -7
- package/src/FeatureFlags/feature-flags-provider.js +50 -50
- package/src/FeatureFlags/get-all-feature-flags.js +1 -1
- package/src/FeatureFlags/get-feature-flag.js +3 -5
- package/src/Feed/feed-provider-factory.js +8 -8
- package/src/Feed/feed-provider.js +15 -15
- package/src/Feed/get-cached-feed.js +2 -2
- package/src/Feed/request-feed-refresh.js +2 -2
- package/src/Feed/subscribe-to-feed-updates.js +2 -2
- package/src/Feed/ui/hide-feed.js +2 -2
- package/src/Feed/ui/show-feed.js +13 -13
- package/src/InAppMessage/display/html-message-to-html.js +11 -12
- package/src/InAppMessage/display/in-app-message-to-html.js +15 -15
- package/src/InAppMessage/display/modal-utils.js +8 -8
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager.js +38 -38
- package/src/InAppMessage/models/full-screen-message.js +31 -31
- package/src/InAppMessage/models/html-message.js +16 -16
- package/src/InAppMessage/models/in-app-message-button.js +5 -5
- package/src/InAppMessage/models/in-app-message.js +46 -46
- package/src/InAppMessage/models/modal-message.js +30 -30
- package/src/InAppMessage/models/slide-up-message.js +26 -26
- package/src/InAppMessage/ui/show-in-app-message.js +9 -9
- 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.js +31 -31
- package/src/Push/utils/push-utils.js +9 -9
- package/src/User/user-manager.js +8 -8
- package/src/User/user.js +38 -37
- package/src/common/base-feed.js +15 -14
- package/src/common/base-provider.js +1 -1
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +32 -32
- package/src/l10n/l10n-manager-factory.js +9 -9
- package/src/managers/auth-manager.js +6 -6
- package/src/managers/braze-instance.js +84 -92
- package/src/managers/device-manager.js +9 -9
- package/src/managers/network-manager.js +72 -69
- package/src/managers/server-config-manager.js +13 -13
- package/src/managers/session-manager.js +9 -9
- package/src/managers/storage-manager-factory.js +11 -11
- package/src/managers/storage-manager.js +110 -110
- package/src/managers/subscription-manager.js +3 -3
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/identifier.js +1 -1
- package/src/models/push-token.js +1 -1
- package/src/models/server-config.js +6 -6
- package/src/request-controller.js +129 -125
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +6 -6
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +31 -31
- 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 +4 -4
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +30 -30
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +32 -32
- package/src/triggers/triggers-provider.js +55 -55
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +5 -5
- package/src/ui/js/iam-css.js +4 -4
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +11 -11
- package/src/util/client-hints-parser.js +5 -5
- package/src/util/component-utils.js +2 -2
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +4 -5
- package/src/util/dom-utils.js +5 -5
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +17 -17
- package/src/util/user-agent-parser.js +11 -16
- package/src/util/validation-utils.js +9 -9
- package/src/Card/models/banner.js +0 -31
- package/src/ContentCards/log-content-cards-displayed.js +0 -5
|
@@ -1,68 +1,67 @@
|
|
|
1
1
|
import kt from "./auth-manager.js";
|
|
2
2
|
import y from "../common/base-provider.js";
|
|
3
|
-
import
|
|
3
|
+
import Q from "../util/browser-detector.js";
|
|
4
4
|
import Ot from "./device-manager.js";
|
|
5
5
|
import DeviceProperties from "../Core/device-properties.js";
|
|
6
6
|
import {
|
|
7
7
|
isArray as p,
|
|
8
8
|
keys as oo,
|
|
9
|
-
validateValueIsFromEnum as
|
|
10
|
-
values as
|
|
9
|
+
validateValueIsFromEnum as G,
|
|
10
|
+
values as Pt,
|
|
11
11
|
} from "../util/code-utils.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import Mt from "./server-config-manager.js";
|
|
12
|
+
import Rt from "./network-manager.js";
|
|
13
|
+
import Lt from "../request-controller.js";
|
|
14
|
+
import jt from "./server-config-manager.js";
|
|
16
15
|
import Dt from "./session-manager.js";
|
|
17
16
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
17
|
+
import J, { STORAGE_KEYS as i } from "./storage-manager.js";
|
|
18
|
+
import Mt from "./storage-manager-factory.js";
|
|
20
19
|
import E from "./subscription-manager.js";
|
|
21
20
|
import { TriggersProviderFactory as et } from "../triggers/triggers-provider-factory.js";
|
|
22
21
|
import bt from "../User/user-manager.js";
|
|
23
22
|
import { User } from "../User/index.js";
|
|
24
|
-
import { parseQueryStringKeyValues as
|
|
25
|
-
import { WindowUtils as
|
|
23
|
+
import { parseQueryStringKeyValues as ut } from "../util/url-utils.js";
|
|
24
|
+
import { WindowUtils as Y } from "../util/window-utils.js";
|
|
26
25
|
import { BRAZE_MUST_BE_INITIALIZED_ERROR as P } from "../common/constants.js";
|
|
27
26
|
const L = {
|
|
28
27
|
ho: "allowCrawlerActivity",
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
_o: "baseUrl",
|
|
29
|
+
Eo: "noCookies",
|
|
31
30
|
Io: "devicePropertyAllowlist",
|
|
32
31
|
Aa: "disablePushTokenMaintenance",
|
|
33
32
|
Ao: "enableLogging",
|
|
34
33
|
So: "enableSdkAuthentication",
|
|
35
34
|
qa: "manageServiceWorkerExternally",
|
|
36
35
|
No: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
Oo: "sessionTimeoutInSeconds",
|
|
37
|
+
wo: "appVersion",
|
|
38
|
+
Po: "appVersionNumber",
|
|
39
39
|
_a: "serviceWorkerLocation",
|
|
40
40
|
ka: "safariWebsitePushId",
|
|
41
41
|
Ba: "localization",
|
|
42
42
|
po: "contentSecurityNonce",
|
|
43
|
-
|
|
44
|
-
Lo: "allowUserSuppliedJavascript",
|
|
43
|
+
Ro: "allowUserSuppliedJavascript",
|
|
45
44
|
lo: "inAppMessageZIndex",
|
|
46
45
|
fo: "openInAppMessagesInNewTab",
|
|
47
46
|
tn: "openCardsInNewTab",
|
|
48
47
|
en: "openNewsFeedCardsInNewTab",
|
|
49
48
|
mh: "requireExplicitInAppMessageDismissal",
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
Co: "doNotLoadFontAwesome",
|
|
50
|
+
Lo: "sdkFlavor",
|
|
52
51
|
};
|
|
53
|
-
class
|
|
52
|
+
class Bt {
|
|
54
53
|
constructor() {
|
|
55
54
|
(this.cn = ""),
|
|
56
|
-
(this.
|
|
57
|
-
(this.
|
|
58
|
-
(this.
|
|
55
|
+
(this.jo = ""),
|
|
56
|
+
(this.Do = void 0),
|
|
57
|
+
(this.Mo = null),
|
|
59
58
|
(this.fn = null),
|
|
60
|
-
(this
|
|
59
|
+
(this.$t = null),
|
|
61
60
|
(this.ki = null),
|
|
62
|
-
(this.
|
|
61
|
+
(this.yt = null),
|
|
63
62
|
(this._e = null),
|
|
64
63
|
(this.u = null),
|
|
65
|
-
(this.
|
|
64
|
+
(this.wt = null),
|
|
66
65
|
(this.Uo = ""),
|
|
67
66
|
(this.Bo = !1),
|
|
68
67
|
(this.Wo = !1),
|
|
@@ -72,13 +71,13 @@ class Wt {
|
|
|
72
71
|
(this.Go = []),
|
|
73
72
|
(this.Ko = []),
|
|
74
73
|
(this.Ve = []),
|
|
75
|
-
(this.
|
|
74
|
+
(this.jo = "5.0.0");
|
|
76
75
|
}
|
|
77
|
-
|
|
78
|
-
this.zo.
|
|
76
|
+
$o(t) {
|
|
77
|
+
this.zo.It(t);
|
|
79
78
|
}
|
|
80
79
|
Rh(t) {
|
|
81
|
-
this.Vo.
|
|
80
|
+
this.Vo.It(t);
|
|
82
81
|
}
|
|
83
82
|
initialize(t, s) {
|
|
84
83
|
if (this.fe())
|
|
@@ -87,7 +86,7 @@ class Wt {
|
|
|
87
86
|
);
|
|
88
87
|
this.options = s || {};
|
|
89
88
|
let e = this.nn(L.Ao);
|
|
90
|
-
const n =
|
|
89
|
+
const n = ut(Y.Cn());
|
|
91
90
|
if (
|
|
92
91
|
(n && "true" === n.brazeLogging && (e = !0),
|
|
93
92
|
r.j.init(e),
|
|
@@ -98,7 +97,7 @@ class Wt {
|
|
|
98
97
|
)
|
|
99
98
|
return r.j.error("Braze requires a valid API key to be initialized."), !1;
|
|
100
99
|
this.cn = t;
|
|
101
|
-
let o = this.nn(L.
|
|
100
|
+
let o = this.nn(L._o);
|
|
102
101
|
if (null == o || "" === o || "string" != typeof o)
|
|
103
102
|
return r.j.error("Braze requires a valid baseUrl to be initialized."), !1;
|
|
104
103
|
!1 === /^https?:/.test(o) && (o = `https://${o}`);
|
|
@@ -108,16 +107,16 @@ class Wt {
|
|
|
108
107
|
(o.href = h),
|
|
109
108
|
"/" === o.pathname && (o = `${o}api/v3`),
|
|
110
109
|
(this.Uo = o.toString()),
|
|
111
|
-
|
|
110
|
+
Q.qo && !this.nn(L.ho))
|
|
112
111
|
)
|
|
113
112
|
return (
|
|
114
113
|
r.j.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
115
114
|
(this.Wo = !0),
|
|
116
115
|
!1
|
|
117
116
|
);
|
|
118
|
-
const a = this.nn(L.
|
|
117
|
+
const a = this.nn(L.Eo) || !1;
|
|
119
118
|
if (
|
|
120
|
-
((this.u =
|
|
119
|
+
((this.u = Mt.xo(t, a)), a && this.u.Jo(t), new J.ee(null, !0).jr(i.re))
|
|
121
120
|
)
|
|
122
121
|
return (
|
|
123
122
|
r.j.info("Ignoring all activity due to previous opt out"),
|
|
@@ -125,21 +124,21 @@ class Wt {
|
|
|
125
124
|
!1
|
|
126
125
|
);
|
|
127
126
|
for (const t of oo(this.options))
|
|
128
|
-
-1 ===
|
|
127
|
+
-1 === Pt(r.Yo).indexOf(t) &&
|
|
129
128
|
r.j.warn(`Ignoring unknown initialization option '${t}'.`);
|
|
130
129
|
const l = ["mparticle", "wordpress", "tealium"];
|
|
131
|
-
if (null != this.nn(L.
|
|
132
|
-
const t = this.nn(L.
|
|
130
|
+
if (null != this.nn(L.Lo)) {
|
|
131
|
+
const t = this.nn(L.Lo);
|
|
133
132
|
-1 !== l.indexOf(t)
|
|
134
|
-
? (this.
|
|
133
|
+
? (this.Do = t)
|
|
135
134
|
: r.j.error("Invalid sdk flavor passed: " + t);
|
|
136
135
|
}
|
|
137
|
-
let u = this.nn(r.
|
|
136
|
+
let u = this.nn(r.Yo.Io);
|
|
138
137
|
if (null != u)
|
|
139
138
|
if (p(u)) {
|
|
140
139
|
const t = [];
|
|
141
140
|
for (let i = 0; i < u.length; i++)
|
|
142
|
-
|
|
141
|
+
G(
|
|
143
142
|
DeviceProperties,
|
|
144
143
|
u[i],
|
|
145
144
|
"devicePropertyAllowlist contained an invalid value.",
|
|
@@ -152,57 +151,52 @@ class Wt {
|
|
|
152
151
|
),
|
|
153
152
|
(u = null);
|
|
154
153
|
(this.fn = new Ot(this.u, u)),
|
|
155
|
-
(this.
|
|
156
|
-
(this.
|
|
157
|
-
(this._e = new Dt(this.u, this.
|
|
154
|
+
(this.yt = new jt(this.u)),
|
|
155
|
+
(this.wt = new bt(this.yt, this.u)),
|
|
156
|
+
(this._e = new Dt(this.u, this.wt, this.yt, this.nn(L.Oo)));
|
|
158
157
|
const f = new E();
|
|
159
158
|
return (
|
|
160
|
-
(this.
|
|
161
|
-
this.
|
|
162
|
-
(this
|
|
159
|
+
(this.Mo = new kt(this.u, this.nn(L.So), f)),
|
|
160
|
+
this.Ht(f),
|
|
161
|
+
(this.$t = new Rt(
|
|
163
162
|
this.fn,
|
|
164
163
|
this.u,
|
|
165
|
-
this.
|
|
166
|
-
this.ft,
|
|
167
|
-
this._e,
|
|
164
|
+
this.Mo,
|
|
168
165
|
this.wt,
|
|
166
|
+
this._e,
|
|
167
|
+
this.yt,
|
|
169
168
|
this.cn,
|
|
170
169
|
this.Uo,
|
|
171
|
-
this.
|
|
172
|
-
this.
|
|
173
|
-
this.nn(L.
|
|
170
|
+
this.jo,
|
|
171
|
+
this.Do || "",
|
|
172
|
+
this.nn(L.wo),
|
|
173
|
+
this.nn(L.Po),
|
|
174
174
|
)),
|
|
175
|
-
(this.ki = new
|
|
175
|
+
(this.ki = new Lt(
|
|
176
176
|
this.cn,
|
|
177
177
|
this.Uo,
|
|
178
178
|
this._e,
|
|
179
179
|
this.fn,
|
|
180
|
-
this.ft,
|
|
181
180
|
this.wt,
|
|
181
|
+
this.yt,
|
|
182
182
|
this.u,
|
|
183
183
|
(t) => {
|
|
184
|
-
if (this.fe()) for (const i of this.gr()) i.
|
|
184
|
+
if (this.fe()) for (const i of this.gr()) i.Ss(t);
|
|
185
185
|
},
|
|
186
|
-
this.
|
|
187
|
-
this
|
|
186
|
+
this.Mo,
|
|
187
|
+
this.$t,
|
|
188
188
|
)),
|
|
189
189
|
this.ki.initialize(),
|
|
190
190
|
r.j.info(
|
|
191
191
|
`Initialized for the Braze backend at "${this.nn(
|
|
192
|
-
L.
|
|
192
|
+
L._o,
|
|
193
193
|
)}" with API key "${this.cn}".`,
|
|
194
194
|
),
|
|
195
|
-
null != this.nn(L.Co) &&
|
|
196
|
-
z(
|
|
197
|
-
"enableHtmlInAppMessages",
|
|
198
|
-
"initialization option",
|
|
199
|
-
"allowUserSuppliedJavascript",
|
|
200
|
-
),
|
|
201
195
|
et.o(),
|
|
202
|
-
this.
|
|
196
|
+
this.yt.Ci(() => {
|
|
203
197
|
this.Bo &&
|
|
204
|
-
this.
|
|
205
|
-
this.
|
|
198
|
+
this.yt &&
|
|
199
|
+
this.yt.yi() &&
|
|
206
200
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
207
201
|
if (!this.Bo) return;
|
|
208
202
|
(0, t.default)();
|
|
@@ -210,21 +204,21 @@ class Wt {
|
|
|
210
204
|
}),
|
|
211
205
|
this.ki.pr(() => {
|
|
212
206
|
this.Bo &&
|
|
213
|
-
this.
|
|
214
|
-
this.
|
|
207
|
+
this.yt &&
|
|
208
|
+
this.yt.yi() &&
|
|
215
209
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
216
210
|
if (!this.Bo) return;
|
|
217
211
|
(0, t.default)(void 0, void 0, !0);
|
|
218
212
|
});
|
|
219
213
|
}),
|
|
220
|
-
this.zo.
|
|
214
|
+
this.zo.Dt(this.options),
|
|
221
215
|
(this.Bo = !0),
|
|
222
216
|
!0
|
|
223
217
|
);
|
|
224
218
|
}
|
|
225
219
|
destroy(t) {
|
|
226
220
|
if ((r.j.destroy(), this.fe())) {
|
|
227
|
-
this.Vo.
|
|
221
|
+
this.Vo.Dt(), this.Vo.removeAllSubscriptions();
|
|
228
222
|
for (const t of this.Go) t.destroy();
|
|
229
223
|
this.Go = [];
|
|
230
224
|
for (const t of this.Ko) t.clearData(!1);
|
|
@@ -233,29 +227,27 @@ class Wt {
|
|
|
233
227
|
(this.Ve = []),
|
|
234
228
|
null != this.ki && this.ki.destroy(),
|
|
235
229
|
(this.ki = null),
|
|
236
|
-
(this.
|
|
230
|
+
(this.Mo = null),
|
|
237
231
|
(this.fn = null),
|
|
238
|
-
(this
|
|
239
|
-
(this.
|
|
232
|
+
(this.$t = null),
|
|
233
|
+
(this.yt = null),
|
|
240
234
|
(this._e = null),
|
|
241
|
-
(this.
|
|
235
|
+
(this.wt = null),
|
|
242
236
|
(this.options = {}),
|
|
243
|
-
(this.
|
|
237
|
+
(this.Do = void 0),
|
|
244
238
|
(this.Bo = !1),
|
|
245
239
|
(this.Wo = !1),
|
|
246
240
|
t && (this.u = null);
|
|
247
241
|
}
|
|
248
242
|
}
|
|
249
243
|
rr() {
|
|
250
|
-
|
|
251
|
-
if (!this.fe()) throw new Error(P);
|
|
252
|
-
return !0;
|
|
244
|
+
return !this.Ho() && (!!this.fe() || (console.warn(P), !1));
|
|
253
245
|
}
|
|
254
246
|
Ma() {
|
|
255
247
|
return this.cn;
|
|
256
248
|
}
|
|
257
249
|
Sr() {
|
|
258
|
-
return this.
|
|
250
|
+
return this.Mo;
|
|
259
251
|
}
|
|
260
252
|
Ys() {
|
|
261
253
|
return this.Uo;
|
|
@@ -264,7 +256,7 @@ class Wt {
|
|
|
264
256
|
return this.fn;
|
|
265
257
|
}
|
|
266
258
|
ar() {
|
|
267
|
-
return this
|
|
259
|
+
return this.$t;
|
|
268
260
|
}
|
|
269
261
|
nn(t) {
|
|
270
262
|
return this.options[t];
|
|
@@ -276,7 +268,7 @@ class Wt {
|
|
|
276
268
|
return this.ki;
|
|
277
269
|
}
|
|
278
270
|
tr() {
|
|
279
|
-
return this.
|
|
271
|
+
return this.yt;
|
|
280
272
|
}
|
|
281
273
|
aa() {
|
|
282
274
|
return this._e;
|
|
@@ -285,13 +277,13 @@ class Wt {
|
|
|
285
277
|
return this.u;
|
|
286
278
|
}
|
|
287
279
|
br() {
|
|
288
|
-
if (this.
|
|
280
|
+
if (this.wt && this.ki) return new User(this.wt, this.ki);
|
|
289
281
|
}
|
|
290
282
|
ir() {
|
|
291
|
-
return this.
|
|
283
|
+
return this.wt;
|
|
292
284
|
}
|
|
293
285
|
nr() {
|
|
294
|
-
return !0 === this.nn(L.
|
|
286
|
+
return !0 === this.nn(L.Ro);
|
|
295
287
|
}
|
|
296
288
|
g(t) {
|
|
297
289
|
let i = !1;
|
|
@@ -303,7 +295,7 @@ class Wt {
|
|
|
303
295
|
for (const s of this.Ko) s.constructor === t.constructor && (i = !0);
|
|
304
296
|
t instanceof y && !i && this.Ko.push(t);
|
|
305
297
|
}
|
|
306
|
-
|
|
298
|
+
Ht(t) {
|
|
307
299
|
t instanceof E && this.Ve.push(t);
|
|
308
300
|
}
|
|
309
301
|
removeAllSubscriptions() {
|
|
@@ -318,12 +310,12 @@ class Wt {
|
|
|
318
310
|
fe() {
|
|
319
311
|
return this.Bo;
|
|
320
312
|
}
|
|
321
|
-
|
|
313
|
+
Ho() {
|
|
322
314
|
return this.Wo;
|
|
323
315
|
}
|
|
324
|
-
|
|
325
|
-
return this.
|
|
316
|
+
As() {
|
|
317
|
+
return this.jo;
|
|
326
318
|
}
|
|
327
319
|
}
|
|
328
|
-
const e = new
|
|
329
|
-
export { e as default,
|
|
320
|
+
const e = new Bt();
|
|
321
|
+
export { e as default, Bt as BrazeSdkInstance, L as OPTIONS };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Q from "../util/browser-detector.js";
|
|
2
2
|
import xt from "../models/device.js";
|
|
3
3
|
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) {
|
|
@@ -21,10 +21,10 @@ export default class Ot {
|
|
|
21
21
|
for (let t = 0; t < this.Qo.length; t++) {
|
|
22
22
|
switch (this.Qo[t]) {
|
|
23
23
|
case DeviceProperties.BROWSER:
|
|
24
|
-
s.browser =
|
|
24
|
+
s.browser = Q.browser;
|
|
25
25
|
break;
|
|
26
26
|
case DeviceProperties.BROWSER_VERSION:
|
|
27
|
-
s.Zo =
|
|
27
|
+
s.Zo = Q.version;
|
|
28
28
|
break;
|
|
29
29
|
case DeviceProperties.OS:
|
|
30
30
|
s.os = this.Ia();
|
|
@@ -33,21 +33,21 @@ export default class Ot {
|
|
|
33
33
|
s.Ta = screen.width + "x" + screen.height;
|
|
34
34
|
break;
|
|
35
35
|
case DeviceProperties.LANGUAGE:
|
|
36
|
-
s.language =
|
|
36
|
+
s.language = Q.language;
|
|
37
37
|
break;
|
|
38
38
|
case DeviceProperties.TIME_ZONE:
|
|
39
39
|
s.timeZone = this.Da(new Date());
|
|
40
40
|
break;
|
|
41
41
|
case DeviceProperties.USER_AGENT:
|
|
42
|
-
s.userAgent =
|
|
42
|
+
s.userAgent = Q.userAgent;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return s;
|
|
46
46
|
}
|
|
47
47
|
Ia() {
|
|
48
|
-
if (
|
|
48
|
+
if (Q.Oa()) return Q.Oa();
|
|
49
49
|
const t = this.u.v(i.k.Ca);
|
|
50
|
-
return t && t.os_version ? t.os_version :
|
|
50
|
+
return t && t.os_version ? t.os_version : Q.Ia();
|
|
51
51
|
}
|
|
52
52
|
Da(t) {
|
|
53
53
|
let e = !1;
|