@braze/web-sdk 5.0.1 → 5.1.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/README.md +1 -1
- package/index.d.ts +10 -5
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +3 -3
- package/shared-lib/event-types.js +29 -29
- package/shared-lib/guid.js +3 -3
- package/shared-lib/index.js +6 -0
- package/shared-lib/indexed-db-adapter.js +70 -70
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +21 -21
- package/src/Card/card-manager.js +43 -45
- package/src/Card/display/card-display.js +60 -60
- package/src/Card/log-card-click.js +4 -4
- package/src/Card/log-card-dismissal.js +2 -3
- package/src/Card/log-card-impressions.js +7 -7
- package/src/Card/models/captioned-image.js +21 -21
- package/src/Card/models/card.js +73 -73
- 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 +68 -68
- package/src/ContentCards/content-cards-provider-factory.js +3 -3
- package/src/ContentCards/content-cards-provider.js +255 -245
- package/src/ContentCards/content-cards.js +2 -2
- 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 +6 -6
- package/src/ContentCards/ui/hide-content-cards.js +1 -1
- package/src/ContentCards/ui/show-content-cards.js +24 -24
- package/src/ContentCards/ui/toggle-content-cards.js +1 -1
- package/src/Core/add-sdk-metadata.js +21 -19
- package/src/Core/change-user.js +10 -10
- package/src/Core/destroy.js +2 -2
- package/src/Core/disable-sdk.js +11 -11
- package/src/Core/enable-sdk.js +7 -7
- package/src/Core/get-device-id.js +6 -6
- package/src/Core/get-user.js +1 -1
- package/src/Core/handle-braze-action.js +41 -41
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/log-custom-event.js +15 -15
- package/src/Core/log-purchase.js +31 -37
- package/src/Core/open-session.js +12 -12
- package/src/Core/remove-all-subscriptions.js +1 -1
- package/src/Core/remove-subscription.js +1 -1
- package/src/Core/request-immediate-data-flush.js +1 -1
- package/src/Core/set-logger.js +2 -2
- package/src/Core/set-sdk-authentication-signature.js +3 -3
- package/src/Core/subscribe-to-sdk-authentication-failures.js +6 -4
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +9 -9
- package/src/FeatureFlags/feature-flag-factory.js +12 -12
- package/src/FeatureFlags/feature-flag.js +10 -10
- package/src/FeatureFlags/feature-flags-provider-factory.js +3 -2
- package/src/FeatureFlags/feature-flags-provider.js +108 -80
- package/src/FeatureFlags/get-all-feature-flags.js +5 -5
- package/src/FeatureFlags/get-feature-flag.js +6 -6
- package/src/FeatureFlags/log-feature-flag-impression.js +15 -13
- package/src/FeatureFlags/refresh-feature-flags.js +1 -1
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +7 -4
- package/src/Feed/feed-provider-factory.js +2 -2
- package/src/Feed/feed-provider.js +44 -44
- package/src/Feed/feed.js +1 -1
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/log-feed-displayed.js +4 -4
- package/src/Feed/request-feed-refresh.js +1 -1
- package/src/Feed/subscribe-to-feed-updates.js +1 -1
- package/src/Feed/ui/hide-feed.js +1 -1
- package/src/Feed/ui/show-feed.js +28 -28
- package/src/Feed/ui/toggle-feed.js +1 -1
- package/src/InAppMessage/defer-in-app-message.js +5 -5
- package/src/InAppMessage/display/html-message-to-html.js +54 -54
- package/src/InAppMessage/display/in-app-message-to-html.js +79 -79
- package/src/InAppMessage/display/modal-utils.js +8 -8
- package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
- package/src/InAppMessage/in-app-message-factory.js +49 -49
- package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
- package/src/InAppMessage/in-app-message-manager.js +143 -138
- package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
- package/src/InAppMessage/log-in-app-message-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-html-click.js +12 -12
- package/src/InAppMessage/log-in-app-message-impression.js +6 -6
- package/src/InAppMessage/models/full-screen-message.js +33 -33
- package/src/InAppMessage/models/html-message.js +20 -20
- package/src/InAppMessage/models/in-app-message-button.js +6 -6
- package/src/InAppMessage/models/in-app-message.js +99 -99
- package/src/InAppMessage/models/modal-message.js +32 -32
- package/src/InAppMessage/models/slide-up-message.js +28 -28
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
- package/src/InAppMessage/ui/show-in-app-message.js +81 -81
- package/src/Push/is-push-blocked.js +1 -1
- package/src/Push/is-push-permission-granted.js +1 -1
- package/src/Push/is-push-supported.js +1 -1
- package/src/Push/push-manager-factory.js +5 -5
- package/src/Push/push-manager.js +176 -173
- package/src/Push/request-push-permission.js +1 -1
- package/src/Push/unregister-push.js +1 -1
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +29 -29
- package/src/User/user.js +72 -74
- package/src/common/base-feed.js +7 -7
- package/src/common/base-provider.js +1 -1
- package/src/common/constants.js +2 -0
- package/src/common/event-logger.js +21 -18
- package/src/common/feed-display.js +44 -44
- package/src/l10n/l10n-manager-factory.js +3 -3
- package/src/l10n/l10n-manager.js +7 -7
- package/src/managers/auth-manager.js +32 -32
- package/src/managers/braze-instance.js +188 -190
- package/src/managers/device-manager.js +28 -28
- package/src/managers/network-manager.js +189 -138
- package/src/managers/server-config-manager.js +69 -53
- package/src/managers/session-manager.js +34 -30
- package/src/managers/storage-manager-factory.js +16 -16
- package/src/managers/storage-manager.js +178 -163
- package/src/managers/subscription-manager.js +12 -12
- 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 +34 -14
- package/src/models/push-token.js +8 -8
- package/src/models/request-result.js +3 -3
- package/src/models/server-config.js +32 -23
- package/src/request-controller.js +187 -179
- package/src/triggers/models/custom-event-data.js +7 -7
- package/src/triggers/models/custom-event-property-data.js +10 -10
- package/src/triggers/models/filter-set.js +13 -13
- package/src/triggers/models/filter.js +45 -45
- package/src/triggers/models/in-app-message-click-data.js +12 -12
- package/src/triggers/models/purchase-data.js +2 -2
- package/src/triggers/models/purchase-property-data.js +10 -10
- package/src/triggers/models/push-click-data.js +7 -7
- package/src/triggers/models/trigger-condition.js +57 -59
- package/src/triggers/models/trigger-events.js +4 -4
- package/src/triggers/models/trigger.js +38 -38
- package/src/triggers/triggers-provider-factory.js +4 -4
- package/src/triggers/triggers-provider.js +127 -130
- package/src/ui/js/attach-css.js +2 -2
- package/src/ui/js/iam-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +3 -3
- package/src/util/braze-actions.js +35 -35
- package/src/util/browser-detector.js +21 -21
- package/src/util/client-hints-parser.js +8 -8
- package/src/util/code-utils.js +2 -2
- package/src/util/component-utils.js +1 -1
- package/src/util/deprecation-utils.js +4 -4
- package/src/util/device-constants.js +1 -1
- package/src/util/dom-utils.js +18 -18
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +18 -18
- package/src/util/request-header-utils.js +39 -37
- package/src/util/string-utils.js +10 -10
- package/src/util/user-agent-parser.js +18 -18
- package/src/util/validation-utils.js +37 -39
- package/src/util/window-utils.js +3 -3
- package/shared-lib/braze-shared-lib.js +0 -8
|
@@ -3,68 +3,68 @@ import e from "../managers/braze-instance.js";
|
|
|
3
3
|
import Feed from "./feed.js";
|
|
4
4
|
import {
|
|
5
5
|
newCardFromFeedJson as ht,
|
|
6
|
-
newCardFromSerializedValue as
|
|
6
|
+
newCardFromSerializedValue as D,
|
|
7
7
|
} from "../Card/util/card-factory.js";
|
|
8
8
|
import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
|
|
9
|
-
import { STORAGE_KEYS as
|
|
10
|
-
import
|
|
9
|
+
import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
|
|
10
|
+
import T from "../managers/subscription-manager.js";
|
|
11
11
|
export default class ee extends y {
|
|
12
12
|
constructor(t, s) {
|
|
13
13
|
super(),
|
|
14
14
|
(this.u = t),
|
|
15
|
-
(this.
|
|
15
|
+
(this.Ei = s),
|
|
16
16
|
(this.cards = []),
|
|
17
|
-
(this.
|
|
17
|
+
(this.Gi = null),
|
|
18
18
|
(this.u = t),
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
e
|
|
22
|
-
this.
|
|
19
|
+
(this.Ei = s),
|
|
20
|
+
(this.Jt = new T()),
|
|
21
|
+
e.$t(this.Jt),
|
|
22
|
+
this.Kt();
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
Kt() {
|
|
25
25
|
let t = [];
|
|
26
|
-
this.u && (t = this.u.
|
|
26
|
+
this.u && (t = this.u.j(o.C.Hi) || []);
|
|
27
27
|
const s = [];
|
|
28
28
|
for (let i = 0; i < t.length; i++) {
|
|
29
|
-
const e =
|
|
29
|
+
const e = D(t[i]);
|
|
30
30
|
null != e && s.push(e);
|
|
31
31
|
}
|
|
32
|
-
(this.cards = s), this.u && (this.
|
|
32
|
+
(this.cards = s), this.u && (this.Gi = w(this.u.j(o.C.Ji)));
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
Ki(t) {
|
|
35
35
|
const s = [];
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
this.u && (
|
|
39
|
-
const
|
|
40
|
-
for (let
|
|
41
|
-
|
|
42
|
-
const o = ht(
|
|
36
|
+
let i = null,
|
|
37
|
+
e = {};
|
|
38
|
+
this.u && (e = this.u.j(o.C.J) || {});
|
|
39
|
+
const r = {};
|
|
40
|
+
for (let h = 0; h < t.length; h++) {
|
|
41
|
+
i = t[h];
|
|
42
|
+
const o = ht(i);
|
|
43
43
|
if (null != o) {
|
|
44
44
|
const t = o.id;
|
|
45
|
-
t &&
|
|
45
|
+
t && e[t] && ((o.viewed = !0), (r[t] = !0)), s.push(o);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
(this.cards = s),
|
|
49
|
-
this.
|
|
50
|
-
(this.
|
|
51
|
-
this.u && (this.u.
|
|
49
|
+
this.js(),
|
|
50
|
+
(this.Gi = new Date()),
|
|
51
|
+
this.u && (this.u.k(o.C.J, r), this.u.k(o.C.Ji, this.Gi));
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
for (let
|
|
57
|
-
this.u.
|
|
53
|
+
js() {
|
|
54
|
+
var t;
|
|
55
|
+
const s = [];
|
|
56
|
+
for (let t = 0; t < this.cards.length; t++) s.push(this.cards[t].Y());
|
|
57
|
+
null === (t = this.u) || void 0 === t || t.k(o.C.Hi, s);
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
Rs(t) {
|
|
60
60
|
null != t &&
|
|
61
61
|
t.feed &&
|
|
62
|
-
(this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
62
|
+
(this.Kt(),
|
|
63
|
+
this.Ki(t.feed),
|
|
64
|
+
this.Jt.Dt(new Feed(this.cards.slice(), this.Gi)));
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
this.
|
|
66
|
+
Li() {
|
|
67
|
+
this.Kt();
|
|
68
68
|
const t = [],
|
|
69
69
|
s = new Date();
|
|
70
70
|
for (let i = 0; i < this.cards.length; i++) {
|
|
@@ -72,19 +72,19 @@ export default class ee extends y {
|
|
|
72
72
|
let r = !0;
|
|
73
73
|
null != e && (r = e >= s), r && t.push(this.cards[i]);
|
|
74
74
|
}
|
|
75
|
-
return new Feed(t, this.
|
|
75
|
+
return new Feed(t, this.Gi);
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
this.
|
|
77
|
+
Fs() {
|
|
78
|
+
this.Ei && this.Ei.requestFeedRefresh();
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
return this.
|
|
80
|
+
ei(t) {
|
|
81
|
+
return this.Jt.It(t);
|
|
82
82
|
}
|
|
83
83
|
clearData(t) {
|
|
84
84
|
null == t && (t = !1),
|
|
85
85
|
(this.cards = []),
|
|
86
|
-
(this.
|
|
87
|
-
t && this.u && (this.u.
|
|
88
|
-
this.
|
|
86
|
+
(this.Gi = null),
|
|
87
|
+
t && this.u && (this.u.hi(o.C.Hi), this.u.hi(o.C.Ji)),
|
|
88
|
+
this.Jt.Dt(new Feed(this.cards.slice(), this.Gi));
|
|
89
89
|
}
|
|
90
90
|
}
|
package/src/Feed/feed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../managers/braze-instance.js";
|
|
2
|
-
import
|
|
2
|
+
import { InternalEventTypes as or } from "../../shared-lib/index.js";
|
|
3
3
|
export function logFeedDisplayed() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var r;
|
|
5
|
+
if (e.X())
|
|
6
|
+
return null === (r = e.nr()) || void 0 === r ? void 0 : r.qr(or.Br).L;
|
|
7
7
|
}
|
package/src/Feed/ui/hide-feed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../../managers/braze-instance.js";
|
|
2
2
|
import { destroyFeedHtml as z } from "../../common/feed-display.js";
|
|
3
3
|
export function destroyFeed() {
|
|
4
|
-
if (!e.
|
|
4
|
+
if (!e.X()) return;
|
|
5
5
|
const o = document.querySelectorAll(".ab-feed");
|
|
6
6
|
for (let e = 0; e < o.length; e++) z(o[e]);
|
|
7
7
|
}
|
package/src/Feed/ui/show-feed.js
CHANGED
|
@@ -5,49 +5,49 @@ import {
|
|
|
5
5
|
feedToHtml as I,
|
|
6
6
|
LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as M,
|
|
7
7
|
refreshFeed as $,
|
|
8
|
-
registerFeedSubscriptionId as
|
|
9
|
-
updateFeedCards as
|
|
8
|
+
registerFeedSubscriptionId as B,
|
|
9
|
+
updateFeedCards as F,
|
|
10
10
|
} from "../../common/feed-display.js";
|
|
11
11
|
import { Feed, logFeedDisplayed, subscribeToFeedUpdates } from "../index.js";
|
|
12
12
|
import re from "../feed-provider-factory.js";
|
|
13
13
|
import { intersection as te } from "../../util/code-utils.js";
|
|
14
|
-
import { setCardHeight as
|
|
15
|
-
import { setupFeedUI as
|
|
16
|
-
import r from "../../../shared-lib/
|
|
14
|
+
import { setCardHeight as G } from "../../Card/display/card-display.js";
|
|
15
|
+
import { setupFeedUI as H } from "../../ui/js/index.js";
|
|
16
|
+
import { logger as r } from "../../../shared-lib/index.js";
|
|
17
17
|
export function showFeed(t, n, o) {
|
|
18
|
-
if (!e.
|
|
19
|
-
|
|
20
|
-
const
|
|
18
|
+
if (!e.X()) return;
|
|
19
|
+
H();
|
|
20
|
+
const i = (e, t) => {
|
|
21
21
|
if (null == t) return e;
|
|
22
22
|
const n = [];
|
|
23
23
|
for (let e = 0; e < t.length; e++) n.push(t[e].toLowerCase());
|
|
24
24
|
const o = [];
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const r = [],
|
|
27
|
-
|
|
28
|
-
for (let e = 0; e <
|
|
27
|
+
i = e[t].categories || [];
|
|
28
|
+
for (let e = 0; e < i.length; e++) r.push(i[e].toLowerCase());
|
|
29
29
|
te(r, n).length > 0 && o.push(e[t]);
|
|
30
30
|
}
|
|
31
31
|
return o;
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
s = e.nn(L.tn) || e.nn(L.en) || !1;
|
|
34
34
|
let l = !1;
|
|
35
35
|
null == t && ((t = document.body), (l = !0));
|
|
36
|
-
let
|
|
37
|
-
|
|
36
|
+
let f,
|
|
37
|
+
a = !1;
|
|
38
38
|
null == n
|
|
39
|
-
? ((
|
|
40
|
-
|
|
41
|
-
(
|
|
42
|
-
: (
|
|
43
|
-
const u = I(
|
|
44
|
-
if (
|
|
45
|
-
(null ==
|
|
46
|
-
new Date().valueOf() -
|
|
47
|
-
(r.
|
|
48
|
-
`Cached feed was older than max TTL of ${Feed.
|
|
39
|
+
? ((f = re.rr().Li()),
|
|
40
|
+
F(f, i(f.cards, o), f.lastUpdated, null, s),
|
|
41
|
+
(a = !0))
|
|
42
|
+
: (f = new Feed(i(n, o), new Date()));
|
|
43
|
+
const u = I(f, s, l);
|
|
44
|
+
if (a) {
|
|
45
|
+
(null == f.lastUpdated ||
|
|
46
|
+
new Date().valueOf() - f.lastUpdated.valueOf() > Feed.ur) &&
|
|
47
|
+
(r.info(
|
|
48
|
+
`Cached feed was older than max TTL of ${Feed.ur} ms, requesting an update from the server.`,
|
|
49
49
|
),
|
|
50
|
-
$(
|
|
50
|
+
$(f, u));
|
|
51
51
|
const e = new Date().valueOf(),
|
|
52
52
|
t = subscribeToFeedUpdates(function (t) {
|
|
53
53
|
const n = u.querySelectorAll(".ab-refresh-button")[0];
|
|
@@ -66,9 +66,9 @@ export function showFeed(t, n, o) {
|
|
|
66
66
|
Math.max(t, 0),
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
F(f, i(t.cards, o), t.lastUpdated, u, s);
|
|
70
70
|
});
|
|
71
|
-
|
|
71
|
+
B(t, u);
|
|
72
72
|
}
|
|
73
73
|
const d = (e) => {
|
|
74
74
|
const t = e.querySelectorAll(".ab-feed");
|
|
@@ -82,8 +82,8 @@ export function showFeed(t, n, o) {
|
|
|
82
82
|
}, 0),
|
|
83
83
|
l && u.focus(),
|
|
84
84
|
logFeedDisplayed(),
|
|
85
|
-
q(
|
|
86
|
-
|
|
85
|
+
q(f, u),
|
|
86
|
+
f && G(f.cards, e);
|
|
87
87
|
};
|
|
88
88
|
var m;
|
|
89
89
|
null != t
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import InAppMessage from "./models/in-app-message.js";
|
|
2
2
|
import e from "../managers/braze-instance.js";
|
|
3
3
|
import ControlMessage from "./models/control-message.js";
|
|
4
|
-
import r from "../../shared-lib/
|
|
4
|
+
import { logger as r } from "../../shared-lib/index.js";
|
|
5
5
|
import se from "./in-app-message-manager-factory.js";
|
|
6
6
|
export function deferInAppMessage(s) {
|
|
7
|
-
if (e.
|
|
7
|
+
if (e.X())
|
|
8
8
|
return s instanceof ControlMessage
|
|
9
|
-
? (r.
|
|
9
|
+
? (r.info("Not deferring since this is a ControlMessage."), !1)
|
|
10
10
|
: s instanceof InAppMessage
|
|
11
|
-
? se.m().
|
|
12
|
-
: (r.
|
|
11
|
+
? se.m().de(s)
|
|
12
|
+
: (r.info("Not an instance of InAppMessage, ignoring."), !1);
|
|
13
13
|
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import
|
|
1
|
+
import X from "../../util/browser-detector.js";
|
|
2
2
|
import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
|
|
3
|
-
import { getUser as
|
|
3
|
+
import { getUser as ro } from "../../Core/get-user.js";
|
|
4
4
|
import { InAppMessage } from "../index.js";
|
|
5
|
-
import { keys as
|
|
6
|
-
import { OperatingSystems as
|
|
5
|
+
import { keys as to } from "../../util/code-utils.js";
|
|
6
|
+
import { OperatingSystems as Y } from "../../util/device-constants.js";
|
|
7
7
|
import { parseQueryStringKeyValues as ut } from "../../util/url-utils.js";
|
|
8
|
-
import { WindowUtils as
|
|
8
|
+
import { WindowUtils as eo } from "../../util/window-utils.js";
|
|
9
9
|
import e from "../../managers/braze-instance.js";
|
|
10
|
-
import r from "../../../shared-lib/
|
|
11
|
-
import { BRAZE_MUST_BE_INITIALIZED_ERROR as
|
|
10
|
+
import { logger as r } from "../../../shared-lib/index.js";
|
|
11
|
+
import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../../common/constants.js";
|
|
12
12
|
export default function ct(t, o, n, s, i, u) {
|
|
13
13
|
const c = document.createElement("iframe");
|
|
14
14
|
c.setAttribute("title", "Modal Message"),
|
|
15
15
|
i && (c.style.zIndex = (i + 1).toString());
|
|
16
16
|
const a = (e) => {
|
|
17
17
|
const o = e.getAttribute("href"),
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
if (null !=
|
|
18
|
+
n = e.onclick;
|
|
19
|
+
return (r) => {
|
|
20
|
+
if (null != n && "function" == typeof n && !1 === n.bind(e)(r)) return;
|
|
21
21
|
let i = ut(o).abButtonId;
|
|
22
22
|
if (
|
|
23
23
|
((null != i && "" !== i) || (i = e.getAttribute("id") || void 0),
|
|
24
24
|
null != o && "" !== o && 0 !== o.indexOf("#"))
|
|
25
25
|
) {
|
|
26
|
-
const
|
|
26
|
+
const n =
|
|
27
27
|
"blank" ===
|
|
28
28
|
(e.getAttribute("target") || "").toLowerCase().replace("_", ""),
|
|
29
|
-
u = s || t.openTarget === InAppMessage.OpenTarget.BLANK ||
|
|
29
|
+
u = s || t.openTarget === InAppMessage.OpenTarget.BLANK || n,
|
|
30
30
|
a = () => {
|
|
31
|
-
logInAppMessageHtmlClick(t, i, o),
|
|
31
|
+
logInAppMessageHtmlClick(t, i, o), eo.openUri(o, u, r);
|
|
32
32
|
};
|
|
33
|
-
u ? a() : t.
|
|
33
|
+
u ? a() : t.he(c, a);
|
|
34
34
|
} else logInAppMessageHtmlClick(t, i, o || void 0);
|
|
35
|
-
return
|
|
35
|
+
return r.stopPropagation(), !1;
|
|
36
36
|
};
|
|
37
37
|
},
|
|
38
38
|
m = (t, e, o) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
const o = `${
|
|
43
|
-
return `${t.slice(0,
|
|
44
|
-
|
|
39
|
+
const n = `([\\w]+)\\s*=\\s*document.createElement\\(['"]${o}['"]\\)`,
|
|
40
|
+
r = t.match(new RegExp(n));
|
|
41
|
+
if (r) {
|
|
42
|
+
const o = `${r[1]}.setAttribute("nonce", "${e}")`;
|
|
43
|
+
return `${t.slice(0, r.index + r[0].length)};${o};${t.slice(
|
|
44
|
+
r.index + r[0].length,
|
|
45
45
|
)}`;
|
|
46
46
|
}
|
|
47
47
|
return null;
|
|
@@ -62,18 +62,18 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
62
62
|
));
|
|
63
63
|
const e = m(o[t].innerHTML, u, "script");
|
|
64
64
|
e && (o[t].innerHTML = e);
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const n = m(o[t].innerHTML, u, "style");
|
|
66
|
+
n && (o[t].innerHTML = n);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
const i = c.contentWindow;
|
|
70
70
|
i.focus(), i.document.write(s ? s.innerHTML : t.message || "");
|
|
71
71
|
const l = i.document.getElementsByTagName("head")[0];
|
|
72
72
|
if (null != l) {
|
|
73
|
-
if (t.
|
|
73
|
+
if (t.be()) {
|
|
74
74
|
const e = document.createElement("style");
|
|
75
75
|
(e.innerHTML = t.css || ""),
|
|
76
|
-
(e.id = t.
|
|
76
|
+
(e.id = t.ye() || ""),
|
|
77
77
|
null != u && e.setAttribute("nonce", u),
|
|
78
78
|
l.appendChild(e);
|
|
79
79
|
}
|
|
@@ -84,7 +84,7 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
84
84
|
f && f.length > 0 && c.setAttribute("title", f[0].textContent || "");
|
|
85
85
|
const d = {
|
|
86
86
|
closeMessage: function () {
|
|
87
|
-
t.
|
|
87
|
+
t.he(c);
|
|
88
88
|
},
|
|
89
89
|
logClick: function () {
|
|
90
90
|
logInAppMessageHtmlClick(t, ...arguments);
|
|
@@ -96,9 +96,9 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
96
96
|
return function () {
|
|
97
97
|
const t = arguments;
|
|
98
98
|
import("../../Push/request-push-permission.js").then((o) => {
|
|
99
|
-
e.
|
|
99
|
+
e.so()
|
|
100
100
|
? o.requestPushPermission(...Array.prototype.slice.call(t))
|
|
101
|
-
: r.
|
|
101
|
+
: r.error(_);
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
104
|
},
|
|
@@ -107,9 +107,9 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
107
107
|
const t = arguments;
|
|
108
108
|
import("../../Core/request-immediate-data-flush.js").then(
|
|
109
109
|
({ requestImmediateDataFlush: requestImmediateDataFlush }) => {
|
|
110
|
-
e.
|
|
110
|
+
e.so()
|
|
111
111
|
? requestImmediateDataFlush(...Array.prototype.slice.call(t))
|
|
112
|
-
: r.
|
|
112
|
+
: r.error(_);
|
|
113
113
|
},
|
|
114
114
|
);
|
|
115
115
|
},
|
|
@@ -117,7 +117,7 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
117
117
|
const t = arguments;
|
|
118
118
|
import("../../Core/log-custom-event.js").then(
|
|
119
119
|
({ logCustomEvent: logCustomEvent }) => {
|
|
120
|
-
if (!e.
|
|
120
|
+
if (!e.so()) return void r.error(_);
|
|
121
121
|
logCustomEvent(...Array.prototype.slice.call(t));
|
|
122
122
|
},
|
|
123
123
|
);
|
|
@@ -126,7 +126,7 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
126
126
|
const t = arguments;
|
|
127
127
|
import("../../Core/log-purchase.js").then(
|
|
128
128
|
({ logPurchase: logPurchase }) => {
|
|
129
|
-
if (!e.
|
|
129
|
+
if (!e.so()) return void r.error(_);
|
|
130
130
|
logPurchase(...Array.prototype.slice.call(t));
|
|
131
131
|
},
|
|
132
132
|
);
|
|
@@ -135,9 +135,9 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
135
135
|
const t = arguments;
|
|
136
136
|
import("../../Push/unregister-push.js").then(
|
|
137
137
|
({ unregisterPush: unregisterPush }) => {
|
|
138
|
-
e.
|
|
138
|
+
e.so()
|
|
139
139
|
? unregisterPush(...Array.prototype.slice.call(t))
|
|
140
|
-
: r.
|
|
140
|
+
: r.error(_);
|
|
141
141
|
},
|
|
142
142
|
);
|
|
143
143
|
},
|
|
@@ -146,19 +146,19 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
146
146
|
const t = arguments;
|
|
147
147
|
import("../../Core/change-user.js").then(
|
|
148
148
|
({ changeUser: changeUser }) => {
|
|
149
|
-
if (!e.
|
|
149
|
+
if (!e.so()) return void r.error(_);
|
|
150
150
|
changeUser(...Array.prototype.slice.call(t));
|
|
151
151
|
},
|
|
152
152
|
);
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
|
-
|
|
155
|
+
g = function (t) {
|
|
156
156
|
return function () {
|
|
157
157
|
p[t](...Array.prototype.slice.call(arguments));
|
|
158
158
|
};
|
|
159
159
|
};
|
|
160
|
-
for (const t of
|
|
161
|
-
const
|
|
160
|
+
for (const t of to(p)) d[t] = g(t);
|
|
161
|
+
const h = [
|
|
162
162
|
"setFirstName",
|
|
163
163
|
"setLastName",
|
|
164
164
|
"setEmail",
|
|
@@ -179,14 +179,14 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
179
179
|
"addToSubscriptionGroup",
|
|
180
180
|
"removeFromSubscriptionGroup",
|
|
181
181
|
],
|
|
182
|
-
|
|
182
|
+
b = function (t) {
|
|
183
183
|
return function () {
|
|
184
|
-
const e =
|
|
184
|
+
const e = ro();
|
|
185
185
|
e && e[t](...Array.prototype.slice.call(arguments));
|
|
186
186
|
};
|
|
187
187
|
},
|
|
188
188
|
y = {};
|
|
189
|
-
for (let t = 0; t <
|
|
189
|
+
for (let t = 0; t < h.length; t++) y[h[t]] = b(h[t]);
|
|
190
190
|
d.getUser = function () {
|
|
191
191
|
return y;
|
|
192
192
|
};
|
|
@@ -194,36 +194,36 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
194
194
|
j = function (e) {
|
|
195
195
|
return function () {
|
|
196
196
|
const o = arguments;
|
|
197
|
-
t.
|
|
197
|
+
t.he(c, function () {
|
|
198
198
|
A[e](...Array.prototype.slice.call(o));
|
|
199
199
|
});
|
|
200
200
|
};
|
|
201
201
|
},
|
|
202
202
|
C = d.display;
|
|
203
|
-
for (const t of
|
|
203
|
+
for (const t of to(A)) C[t] = j(t);
|
|
204
204
|
const v = { registerAppboyPushMessages: requestPushPermission() },
|
|
205
|
-
|
|
205
|
+
P = function (t) {
|
|
206
206
|
return function () {
|
|
207
207
|
v[t](...Array.prototype.slice.call(arguments));
|
|
208
208
|
};
|
|
209
209
|
},
|
|
210
|
-
|
|
211
|
-
for (const t of
|
|
210
|
+
w = d.web;
|
|
211
|
+
for (const t of to(v)) w[t] = P(t);
|
|
212
212
|
if (
|
|
213
|
-
((i.appboyBridge = d), (i.brazeBridge = d), t.
|
|
213
|
+
((i.appboyBridge = d), (i.brazeBridge = d), t.Ae !== InAppMessage.Ce.je)
|
|
214
214
|
) {
|
|
215
215
|
const t = i.document.getElementsByTagName("a");
|
|
216
216
|
for (let e = 0; e < t.length; e++) t[e].onclick = a(t[e]);
|
|
217
217
|
const e = i.document.getElementsByTagName("button");
|
|
218
218
|
for (let t = 0; t < e.length; t++) e[t].onclick = a(e[t]);
|
|
219
219
|
}
|
|
220
|
-
const
|
|
221
|
-
if (null !=
|
|
222
|
-
t.
|
|
220
|
+
const E = i.document.body;
|
|
221
|
+
if (null != E) {
|
|
222
|
+
t.ve() && (E.id = t.htmlId || "");
|
|
223
223
|
const e = document.createElement("hidden");
|
|
224
224
|
(e.onclick = d.closeMessage),
|
|
225
225
|
(e.className = "ab-programmatic-close-button"),
|
|
226
|
-
|
|
226
|
+
E.appendChild(e);
|
|
227
227
|
}
|
|
228
228
|
i.dispatchEvent(new CustomEvent("ab.BridgeReady")),
|
|
229
229
|
-1 !== c.className.indexOf("ab-start-hidden") &&
|
|
@@ -232,12 +232,12 @@ export default function ct(t, o, n, s, i, u) {
|
|
|
232
232
|
}),
|
|
233
233
|
(c.className =
|
|
234
234
|
"ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
|
|
235
|
-
|
|
235
|
+
X.OS === Y.io)
|
|
236
236
|
) {
|
|
237
237
|
const e = document.createElement("div");
|
|
238
238
|
return (
|
|
239
|
-
(e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.
|
|
239
|
+
(e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Pe = e), e
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
|
-
return (t.
|
|
242
|
+
return (t.Pe = c), c;
|
|
243
243
|
}
|