@braze/web-sdk 6.8.0 → 6.9.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 +99 -19
- package/package.json +1 -1
- package/shared-lib/event-types.js +20 -20
- package/shared-lib/indexed-db-adapter.js +64 -64
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +8 -8
- package/src/Banner/banner-provider.js +67 -59
- package/src/Banner/banner.js +40 -19
- package/src/Banner/dismiss-banner.js +4 -0
- package/src/Banner/display/banner-to-html.js +10 -10
- package/src/Banner/display/destroy-banner-html.js +2 -2
- package/src/Banner/get-all-banners.js +6 -6
- package/src/Banner/get-banner.js +6 -6
- package/src/Banner/index.js +1 -0
- package/src/Banner/log-banner-click.js +7 -7
- package/src/Banner/log-banner-dismissal.js +7 -7
- package/src/Banner/log-banner-impressions.js +10 -10
- package/src/Banner/request-banners-refresh.js +8 -8
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Banner/ui/insert-banner.js +8 -8
- package/src/Card/card-manager.js +31 -31
- package/src/Card/log-card-dismissal.js +2 -2
- package/src/Card/log-content-card-click.js +2 -2
- package/src/Card/log-content-card-impressions.js +4 -4
- package/src/Card/models/captioned-image.js +15 -15
- package/src/Card/models/card.js +89 -89
- package/src/Card/models/classic-card.js +16 -16
- package/src/Card/models/control-card.js +7 -7
- package/src/Card/models/image-only.js +13 -13
- package/src/Card/util/card-factory.js +32 -32
- package/src/ContentCards/content-cards-provider.js +102 -102
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
- package/src/ContentCards/ui/show-content-cards.js +5 -5
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +3 -3
- package/src/Core/destroy.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 +2 -2
- package/src/Core/handle-braze-action.js +5 -5
- package/src/Core/log-custom-event.js +5 -5
- package/src/Core/log-ecommerce-event.js +5 -5
- package/src/Core/log-purchase.js +9 -9
- package/src/Core/open-session.js +7 -7
- package/src/Core/set-logger.js +2 -2
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +6 -6
- package/src/DUST/dust-provider.js +249 -240
- package/src/DUST/dust-shared-worker-code.js +1 -1
- package/src/DUST/dust-shared-worker-impl.js +15 -14
- package/src/DUST/dust-worker-bridge.js +50 -35
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +8 -8
- package/src/FeatureFlags/feature-flag.js +3 -3
- package/src/FeatureFlags/feature-flags-provider.js +21 -21
- package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/InAppMessage/constants.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +4 -4
- package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
- package/src/InAppMessage/in-app-message-factory.js +36 -36
- package/src/InAppMessage/in-app-message-manager.js +78 -78
- package/src/InAppMessage/log-in-app-message-button-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
- package/src/InAppMessage/log-in-app-message-impression.js +4 -4
- package/src/InAppMessage/models/control-message.js +4 -4
- package/src/InAppMessage/models/full-screen-message.js +4 -4
- package/src/InAppMessage/models/html-message.js +3 -3
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +12 -12
- package/src/InAppMessage/models/modal-message.js +4 -4
- package/src/InAppMessage/models/slide-up-message.js +4 -4
- 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 +14 -14
- package/src/Push/push-manager-factory.js +2 -2
- package/src/Push/push-manager.js +38 -38
- package/src/Push/utils/push-utils.js +6 -6
- package/src/User/user-manager.js +14 -14
- package/src/User/user.js +25 -25
- package/src/common/base-provider.js +1 -1
- package/src/common/content-cards-display.js +7 -7
- package/src/common/event-logger.js +3 -3
- package/src/common/properties-base.js +3 -3
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +3 -3
- package/src/managers/auth-manager.js +11 -11
- package/src/managers/braze-instance.js +56 -56
- package/src/managers/device-manager.js +10 -10
- package/src/managers/network-manager.js +102 -101
- package/src/managers/server-config-manager.js +115 -98
- package/src/managers/session-manager.js +20 -20
- package/src/managers/storage-manager-factory.js +9 -9
- package/src/managers/storage-manager.js +74 -74
- package/src/managers/subscription-manager.js +2 -2
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +1 -1
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +2 -2
- package/src/models/push-token.js +6 -6
- package/src/models/request-result.js +1 -1
- package/src/models/server-config.js +42 -24
- package/src/request-controller.js +126 -126
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +2 -2
- package/src/triggers/models/filter.js +1 -1
- 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 +33 -33
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +33 -33
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +68 -68
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/braze-actions.js +7 -7
- package/src/util/browser-detector.js +2 -2
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/code-utils.js +2 -2
- package/src/util/deprecation-utils.js +2 -2
- package/src/util/dom-utils.js +7 -7
- package/src/util/ecommerce-event-validation.js +52 -35
- package/src/util/html-display-utils.js +11 -11
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +17 -17
- package/src/util/string-utils.js +2 -2
- package/src/util/user-agent-parser.js +2 -2
- package/src/util/validation-utils.js +12 -12
- package/src/util/window-utils.js +2 -2
|
@@ -5,20 +5,20 @@ export function subscribeToBannersUpdates(n) {
|
|
|
5
5
|
var o;
|
|
6
6
|
if (!r.rr()) return;
|
|
7
7
|
const t = i.o();
|
|
8
|
-
if (t.
|
|
8
|
+
if (t.zt()) {
|
|
9
9
|
const r = getAllBanners();
|
|
10
10
|
r && "function" == typeof n && n(r);
|
|
11
11
|
}
|
|
12
|
-
const s = t.
|
|
13
|
-
if (!t.
|
|
12
|
+
const s = t.Kt(n);
|
|
13
|
+
if (!t.Et()) {
|
|
14
14
|
const n =
|
|
15
15
|
null === (o = r.nn()) || void 0 === o
|
|
16
16
|
? void 0
|
|
17
17
|
: o.rn(() => {
|
|
18
|
-
const n = t.
|
|
18
|
+
const n = t.jt();
|
|
19
19
|
n && n.length > 0 && t.O(n);
|
|
20
20
|
});
|
|
21
|
-
n && t
|
|
21
|
+
n && t.Lt(n);
|
|
22
22
|
}
|
|
23
23
|
return s;
|
|
24
24
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BannerStrings as
|
|
1
|
+
import b from "../../../shared-lib/logger.js";
|
|
2
|
+
import { BannerStrings as x } from "../constants.js";
|
|
3
3
|
import r, { OPTIONS as U } from "../../managers/braze-instance.js";
|
|
4
4
|
import { setupBannerUI as S } from "../../ui/js/banner-css.js";
|
|
5
5
|
import { addPassiveEventListener as F } from "../../util/dom-utils.js";
|
|
6
6
|
import { bannerToHtml as G } from "../display/banner-to-html.js";
|
|
7
|
-
import { destroyBannerHtml as
|
|
7
|
+
import { destroyBannerHtml as _ } from "../display/destroy-banner-html.js";
|
|
8
8
|
import { detectBannerImpressions as H } from "../display/detect-banner-impressions.js";
|
|
9
9
|
import { subscribeToBannersUpdates } from "../subscribe-to-banners-updates.js";
|
|
10
10
|
export function insertBanner(e, n) {
|
|
11
11
|
if (!r.rr()) return;
|
|
12
|
-
if (!e) return void
|
|
12
|
+
if (!e) return void b.error("Not inserting banner: banner was not provided.");
|
|
13
13
|
if (!n)
|
|
14
|
-
return void
|
|
14
|
+
return void b.error("Not inserting banner: parentNode was not provided.");
|
|
15
15
|
if (!r.er(U.nr))
|
|
16
|
-
return void
|
|
16
|
+
return void b.error(
|
|
17
17
|
"Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
|
|
18
18
|
);
|
|
19
19
|
S();
|
|
20
20
|
const o = G(e, r.er(U.sr)),
|
|
21
21
|
s = subscribeToBannersUpdates((s) => {
|
|
22
22
|
const i = s[e.placementId];
|
|
23
|
-
i ? n.replaceChildren(G(i, r.er(U.sr))) :
|
|
23
|
+
i ? n.replaceChildren(G(i, r.er(U.sr))) : _(o);
|
|
24
24
|
});
|
|
25
|
-
s && o.setAttribute(
|
|
25
|
+
s && o.setAttribute(x.ea, s),
|
|
26
26
|
n.replaceChildren(o),
|
|
27
27
|
F(window, "scroll", H),
|
|
28
28
|
H();
|
package/src/Card/card-manager.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
import { ControlCard } from "./models/index.js";
|
|
2
2
|
import v from "../common/event-logger.js";
|
|
3
3
|
import L from "../models/request-result.js";
|
|
4
|
-
import { logger as
|
|
4
|
+
import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
|
|
5
5
|
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
6
6
|
export default class M {
|
|
7
7
|
constructor(t) {
|
|
8
|
-
(this.
|
|
8
|
+
(this.j = t), (this.j = t);
|
|
9
9
|
}
|
|
10
10
|
logClick(t) {
|
|
11
11
|
const n = new L();
|
|
12
|
-
if ((t.
|
|
12
|
+
if ((t.Yt(), null == t.url || "" === t.url))
|
|
13
13
|
return (
|
|
14
|
-
|
|
14
|
+
b.info(`Card ${t.id} has no url. Not logging click to Braze servers.`),
|
|
15
15
|
n
|
|
16
16
|
);
|
|
17
|
-
if (t.id && this.
|
|
18
|
-
const n = this.
|
|
19
|
-
(n[t.id] = !0), this.
|
|
17
|
+
if (t.id && this.j) {
|
|
18
|
+
const n = this.j.St(s.It.Zt) || {};
|
|
19
|
+
(n[t.id] = !0), this.j.Pt(s.It.Zt, n);
|
|
20
20
|
}
|
|
21
|
-
const r = this.
|
|
21
|
+
const r = this.ls([t]);
|
|
22
22
|
if (null == r) return n;
|
|
23
|
-
const i = p.
|
|
24
|
-
return v.
|
|
23
|
+
const i = p.us;
|
|
24
|
+
return v.Dt(i, r);
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
cs(t) {
|
|
27
27
|
const n = new L();
|
|
28
|
-
if (!t.
|
|
28
|
+
if (!t.Ft())
|
|
29
29
|
return (
|
|
30
|
-
|
|
30
|
+
b.info(
|
|
31
31
|
`Card ${t.id} refused this dismissal. Ignoring analytics event.`,
|
|
32
32
|
),
|
|
33
33
|
n
|
|
34
34
|
);
|
|
35
|
-
if (t.id && this.
|
|
36
|
-
const n = this.
|
|
37
|
-
(n[t.id] = !0), this.
|
|
35
|
+
if (t.id && this.j) {
|
|
36
|
+
const n = this.j.St(s.It.fs) || {};
|
|
37
|
+
(n[t.id] = !0), this.j.Pt(s.It.fs, n);
|
|
38
38
|
}
|
|
39
|
-
const r = this.
|
|
40
|
-
return null == r ? n : v.
|
|
39
|
+
const r = this.ls([t]);
|
|
40
|
+
return null == r ? n : v.Dt(p.gs, r);
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
ds(t) {
|
|
43
43
|
const n = new L(!0),
|
|
44
44
|
r = [],
|
|
45
45
|
i = [];
|
|
46
46
|
let o = {};
|
|
47
|
-
this.
|
|
47
|
+
this.j && (o = this.j.St(s.It.ps) || {});
|
|
48
48
|
for (const s of t) {
|
|
49
|
-
s.
|
|
49
|
+
s.js()
|
|
50
50
|
? (s instanceof ControlCard ? i.push(s) : r.push(s),
|
|
51
51
|
s.id && (o[s.id] = !0))
|
|
52
|
-
:
|
|
52
|
+
: b.info(
|
|
53
53
|
`Card ${s.id} logged an impression too recently. Ignoring analytics event.`,
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
const e = this.
|
|
57
|
-
l = this.
|
|
56
|
+
const e = this.ls(r),
|
|
57
|
+
l = this.ls(i);
|
|
58
58
|
if (null == e && null == l) return (n.lt = !1), n;
|
|
59
|
-
if ((this.
|
|
60
|
-
const t = p.
|
|
61
|
-
s = v.
|
|
62
|
-
n.
|
|
59
|
+
if ((this.j && this.j.Pt(s.It.ps, o), null != e)) {
|
|
60
|
+
const t = p.vs,
|
|
61
|
+
s = v.Dt(t, e);
|
|
62
|
+
n.Cs(s);
|
|
63
63
|
}
|
|
64
64
|
if (null != l) {
|
|
65
|
-
const t = v.
|
|
66
|
-
n.
|
|
65
|
+
const t = v.Dt(p.ws, l);
|
|
66
|
+
n.Cs(t);
|
|
67
67
|
}
|
|
68
68
|
return n;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
ls(t) {
|
|
71
71
|
let s,
|
|
72
72
|
n = null;
|
|
73
73
|
for (let r = 0; r < t.length; r++)
|
|
@@ -2,10 +2,10 @@ import { Card } from "./models/index.js";
|
|
|
2
2
|
import K from "./card-manager-factory.js";
|
|
3
3
|
import { CardStrings as W } from "./constants.js";
|
|
4
4
|
import r from "../managers/braze-instance.js";
|
|
5
|
-
import { logger as
|
|
5
|
+
import { logger as b } from "../../shared-lib/index.js";
|
|
6
6
|
export function logCardDismissal(o) {
|
|
7
7
|
return (
|
|
8
8
|
!!r.rr() &&
|
|
9
|
-
(o instanceof Card ? K.ra().
|
|
9
|
+
(o instanceof Card ? K.ra().cs(o).lt : (b.error("card " + W.tr), !1))
|
|
10
10
|
);
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import b from "../../shared-lib/logger.js";
|
|
2
2
|
import { CardStrings as W } from "./constants.js";
|
|
3
3
|
import r from "../managers/braze-instance.js";
|
|
4
4
|
import K from "./card-manager-factory.js";
|
|
@@ -6,6 +6,6 @@ import { Card } from "./models/index.js";
|
|
|
6
6
|
export function logContentCardClick(o) {
|
|
7
7
|
return (
|
|
8
8
|
!!r.rr() &&
|
|
9
|
-
(o instanceof Card ? K.ra().logClick(o).lt : (
|
|
9
|
+
(o instanceof Card ? K.ra().logClick(o).lt : (b.error("card " + W.tr), !1))
|
|
10
10
|
);
|
|
11
11
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Card } from "./models/index.js";
|
|
2
2
|
import r from "../managers/braze-instance.js";
|
|
3
3
|
import { isArray as g } from "../util/code-utils.js";
|
|
4
|
-
import
|
|
4
|
+
import b from "../../shared-lib/logger.js";
|
|
5
5
|
import { CardStrings as W } from "./constants.js";
|
|
6
6
|
import K from "./card-manager-factory.js";
|
|
7
7
|
export function logContentCardImpressions(o) {
|
|
8
8
|
if (!r.rr()) return !1;
|
|
9
|
-
if (!g(o)) return
|
|
9
|
+
if (!g(o)) return b.error("cards must be an array"), !1;
|
|
10
10
|
for (const r of o)
|
|
11
|
-
if (!(r instanceof Card)) return
|
|
12
|
-
return K.ra().
|
|
11
|
+
if (!(r instanceof Card)) return b.error(`Each card in cards ${W.tr}`), !1;
|
|
12
|
+
return K.ra().ds(o).lt;
|
|
13
13
|
}
|
|
@@ -11,22 +11,22 @@ export default class CaptionedImage extends Card {
|
|
|
11
11
|
return (
|
|
12
12
|
(t[Card.bs.xs] = Card.ks.zs),
|
|
13
13
|
(t[Card.bs.qs] = this.id),
|
|
14
|
-
(t[Card.bs.
|
|
15
|
-
(t[Card.bs.
|
|
16
|
-
(t[Card.bs.
|
|
17
|
-
(t[Card.bs.
|
|
18
|
-
(t[Card.bs.
|
|
19
|
-
(t[Card.bs.
|
|
14
|
+
(t[Card.bs.ys] = this.viewed),
|
|
15
|
+
(t[Card.bs.As] = this.title),
|
|
16
|
+
(t[Card.bs.Bs] = this.imageUrl),
|
|
17
|
+
(t[Card.bs.Ds] = this.description),
|
|
18
|
+
(t[Card.bs.Es] = this.updated),
|
|
19
|
+
(t[Card.bs.Fs] = this.expiresAt),
|
|
20
20
|
(t[Card.bs.URL] = this.url),
|
|
21
|
-
(t[Card.bs.
|
|
22
|
-
(t[Card.bs.
|
|
23
|
-
(t[Card.bs.
|
|
24
|
-
(t[Card.bs.
|
|
25
|
-
(t[Card.bs.
|
|
26
|
-
(t[Card.bs.
|
|
27
|
-
(t[Card.bs.
|
|
28
|
-
(t[Card.bs.
|
|
29
|
-
(t[Card.bs.
|
|
21
|
+
(t[Card.bs.Gs] = this.linkText),
|
|
22
|
+
(t[Card.bs.Hs] = this.aspectRatio),
|
|
23
|
+
(t[Card.bs.Is] = this.extras),
|
|
24
|
+
(t[Card.bs.Js] = this.pinned),
|
|
25
|
+
(t[Card.bs.Ks] = this.dismissible),
|
|
26
|
+
(t[Card.bs.Ls] = this.clicked),
|
|
27
|
+
(t[Card.bs.Ms] = this.language),
|
|
28
|
+
(t[Card.bs.Ns] = this.altImageText),
|
|
29
|
+
(t[Card.bs.Os] = this.test),
|
|
30
30
|
t
|
|
31
31
|
);
|
|
32
32
|
}
|
package/src/Card/models/card.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "../../util/date-utils.js";
|
|
5
5
|
import { FEED_ANIMATION_DURATION as Z } from "../../common/constants.js";
|
|
6
6
|
import f from "../../managers/subscription-manager.js";
|
|
7
|
-
import
|
|
7
|
+
import b from "../../../shared-lib/logger.js";
|
|
8
8
|
export default class Card {
|
|
9
9
|
constructor(t, i, s, h, l, n, e, r, u, E, T, o, a, I, N, A) {
|
|
10
10
|
(this.id = t),
|
|
@@ -46,20 +46,20 @@ export default class Card {
|
|
|
46
46
|
(this.altImageText = A || null),
|
|
47
47
|
(this.test = !1),
|
|
48
48
|
(this.ti = null),
|
|
49
|
-
(this.
|
|
50
|
-
(this.
|
|
49
|
+
(this.es = null),
|
|
50
|
+
(this.ii = null);
|
|
51
51
|
}
|
|
52
52
|
subscribeToClickedEvent(t) {
|
|
53
|
-
return this.
|
|
53
|
+
return this.si().Ut(t);
|
|
54
54
|
}
|
|
55
55
|
subscribeToDismissedEvent(t) {
|
|
56
|
-
return this.
|
|
56
|
+
return this.ns().Ut(t);
|
|
57
57
|
}
|
|
58
58
|
removeSubscription(t) {
|
|
59
|
-
this.
|
|
59
|
+
this.si().removeSubscription(t), this.ns().removeSubscription(t);
|
|
60
60
|
}
|
|
61
61
|
removeAllSubscriptions() {
|
|
62
|
-
this.
|
|
62
|
+
this.si().removeAllSubscriptions(), this.ns().removeAllSubscriptions();
|
|
63
63
|
}
|
|
64
64
|
dismissCard() {
|
|
65
65
|
if (!this.dismissible || this.dismissed) return;
|
|
@@ -76,134 +76,134 @@ export default class Card {
|
|
|
76
76
|
(t.style.margin = "0"),
|
|
77
77
|
setTimeout(function () {
|
|
78
78
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
79
|
-
}, Card.
|
|
79
|
+
}, Card.hi));
|
|
80
80
|
}, Z));
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
si() {
|
|
83
83
|
return null == this.ti && (this.ti = new f()), this.ti;
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
return null == this.
|
|
85
|
+
ns() {
|
|
86
|
+
return null == this.es && (this.es = new f()), this.es;
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
js() {
|
|
89
89
|
const t = new Date().valueOf();
|
|
90
90
|
return (
|
|
91
|
-
!(null != this.
|
|
92
|
-
((this.
|
|
91
|
+
!(null != this.ii && t - this.ii < Card.li) &&
|
|
92
|
+
((this.ii = t), (this.viewed = !0), !0)
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
(this.viewed = !0), (this.clicked = !0), this.
|
|
95
|
+
Yt() {
|
|
96
|
+
(this.viewed = !0), (this.clicked = !0), this.si().A();
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
Ft() {
|
|
99
99
|
return (
|
|
100
100
|
!(!this.dismissible || this.dismissed) &&
|
|
101
|
-
((this.dismissed = !0), this.
|
|
101
|
+
((this.dismissed = !0), this.ns().A(), !0)
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
if (null == t || t[Card.
|
|
106
|
-
if (t[Card.
|
|
104
|
+
ni(t) {
|
|
105
|
+
if (null == t || t[Card.ei.qs] !== this.id) return !0;
|
|
106
|
+
if (t[Card.ei.ri]) return !1;
|
|
107
107
|
if (
|
|
108
|
-
null != t[Card.
|
|
108
|
+
null != t[Card.ei.Es] &&
|
|
109
109
|
null != this.updated &&
|
|
110
|
-
parseInt(t[Card.
|
|
110
|
+
parseInt(t[Card.ei.Es]) < X(this.updated.valueOf())
|
|
111
111
|
)
|
|
112
112
|
return !0;
|
|
113
113
|
if (
|
|
114
|
-
(t[Card.
|
|
115
|
-
t[Card.
|
|
116
|
-
null != t[Card.
|
|
117
|
-
null != t[Card.
|
|
118
|
-
null != t[Card.
|
|
119
|
-
null != t[Card.
|
|
114
|
+
(t[Card.ei.ys] && !this.viewed && (this.viewed = !0),
|
|
115
|
+
t[Card.ei.Ls] && !this.clicked && (this.clicked = t[Card.ei.Ls]),
|
|
116
|
+
null != t[Card.ei.As] && (this.title = t[Card.ei.As]),
|
|
117
|
+
null != t[Card.ei.Bs] && (this.imageUrl = t[Card.ei.Bs]),
|
|
118
|
+
null != t[Card.ei.Ds] && (this.description = t[Card.ei.Ds]),
|
|
119
|
+
null != t[Card.ei.Es])
|
|
120
120
|
) {
|
|
121
|
-
const i = Y(t[Card.
|
|
121
|
+
const i = Y(t[Card.ei.Es]);
|
|
122
122
|
null != i && (this.updated = i);
|
|
123
123
|
}
|
|
124
|
-
if (null != t[Card.
|
|
124
|
+
if (null != t[Card.ei.Fs]) {
|
|
125
125
|
let i;
|
|
126
|
-
(i = t[Card.
|
|
126
|
+
(i = t[Card.ei.Fs] === Card.ui ? null : Y(t[Card.ei.Fs])),
|
|
127
127
|
(this.expiresAt = i);
|
|
128
128
|
}
|
|
129
129
|
if (
|
|
130
|
-
(null != t[Card.
|
|
131
|
-
null != t[Card.
|
|
132
|
-
null != t[Card.
|
|
130
|
+
(null != t[Card.ei.URL] && (this.url = t[Card.ei.URL]),
|
|
131
|
+
null != t[Card.ei.Gs] && (this.linkText = t[Card.ei.Gs]),
|
|
132
|
+
null != t[Card.ei.Hs])
|
|
133
133
|
) {
|
|
134
|
-
const i = parseFloat(t[Card.
|
|
134
|
+
const i = parseFloat(t[Card.ei.Hs].toString());
|
|
135
135
|
this.aspectRatio = isNaN(i) ? null : i;
|
|
136
136
|
}
|
|
137
137
|
return (
|
|
138
|
-
null != t[Card.
|
|
139
|
-
null != t[Card.
|
|
140
|
-
null != t[Card.
|
|
141
|
-
null != t[Card.
|
|
142
|
-
null != t[Card.
|
|
143
|
-
null != t[Card.
|
|
138
|
+
null != t[Card.ei.Is] && (this.extras = t[Card.ei.Is]),
|
|
139
|
+
null != t[Card.ei.Js] && (this.pinned = t[Card.ei.Js]),
|
|
140
|
+
null != t[Card.ei.Ks] && (this.dismissible = t[Card.ei.Ks]),
|
|
141
|
+
null != t[Card.ei.Ms] && (this.language = t[Card.ei.Ms]),
|
|
142
|
+
null != t[Card.ei.Ns] && (this.altImageText = t[Card.ei.Ns]),
|
|
143
|
+
null != t[Card.ei.Os] && (this.test = t[Card.ei.Os]),
|
|
144
144
|
!0
|
|
145
145
|
);
|
|
146
146
|
}
|
|
147
147
|
qt() {
|
|
148
|
-
|
|
148
|
+
b.error("Must be implemented in a subclass");
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
(Card.
|
|
152
|
-
(Card.
|
|
151
|
+
(Card.ui = -1),
|
|
152
|
+
(Card.ei = {
|
|
153
153
|
qs: "id",
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
ys: "v",
|
|
155
|
+
Ks: "db",
|
|
156
|
+
ri: "r",
|
|
157
|
+
Es: "ca",
|
|
158
|
+
Js: "p",
|
|
159
|
+
Fs: "ea",
|
|
160
|
+
Is: "e",
|
|
161
161
|
xs: "tp",
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
Bs: "i",
|
|
163
|
+
As: "tt",
|
|
164
|
+
Ds: "ds",
|
|
165
165
|
URL: "u",
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
Gs: "dm",
|
|
167
|
+
Hs: "ar",
|
|
168
|
+
Ls: "cl",
|
|
169
|
+
Os: "t",
|
|
170
|
+
Ms: "language",
|
|
171
|
+
Ns: "image_alt",
|
|
172
172
|
}),
|
|
173
173
|
(Card.ks = {
|
|
174
174
|
zs: "captioned_image",
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
Ei: "text_announcement",
|
|
176
|
+
Ti: "short_news",
|
|
177
|
+
oi: "banner_image",
|
|
178
|
+
ai: "control",
|
|
179
179
|
}),
|
|
180
180
|
(Card.bs = {
|
|
181
181
|
qs: "id",
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
182
|
+
ys: "v",
|
|
183
|
+
Ks: "db",
|
|
184
|
+
Ii: "cr",
|
|
185
|
+
Es: "ca",
|
|
186
|
+
Js: "p",
|
|
187
|
+
Ni: "t",
|
|
188
|
+
Fs: "ea",
|
|
189
|
+
Is: "e",
|
|
190
190
|
xs: "tp",
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
Bs: "i",
|
|
192
|
+
As: "tt",
|
|
193
|
+
Ds: "ds",
|
|
194
194
|
URL: "u",
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
195
|
+
Gs: "dm",
|
|
196
|
+
Hs: "ar",
|
|
197
|
+
Ls: "cl",
|
|
198
|
+
Os: "s",
|
|
199
|
+
Ms: "l",
|
|
200
|
+
Ns: "ia",
|
|
201
201
|
}),
|
|
202
|
-
(Card.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
(Card.Ai = {
|
|
203
|
+
ci: "ADVERTISING",
|
|
204
|
+
mi: "ANNOUNCEMENTS",
|
|
205
|
+
Si: "NEWS",
|
|
206
|
+
Di: "SOCIAL",
|
|
207
207
|
}),
|
|
208
|
-
(Card.
|
|
209
|
-
(Card.
|
|
208
|
+
(Card.hi = 400),
|
|
209
|
+
(Card.li = 1e4);
|
|
@@ -8,24 +8,24 @@ export default class ClassicCard extends Card {
|
|
|
8
8
|
qt() {
|
|
9
9
|
const s = {};
|
|
10
10
|
return (
|
|
11
|
-
(s[Card.bs.xs] = Card.ks.
|
|
11
|
+
(s[Card.bs.xs] = Card.ks.Ti),
|
|
12
12
|
(s[Card.bs.qs] = this.id),
|
|
13
|
-
(s[Card.bs.
|
|
14
|
-
(s[Card.bs.
|
|
15
|
-
(s[Card.bs.
|
|
16
|
-
(s[Card.bs.
|
|
17
|
-
(s[Card.bs.
|
|
18
|
-
(s[Card.bs.
|
|
13
|
+
(s[Card.bs.ys] = this.viewed),
|
|
14
|
+
(s[Card.bs.As] = this.title),
|
|
15
|
+
(s[Card.bs.Bs] = this.imageUrl),
|
|
16
|
+
(s[Card.bs.Ds] = this.description),
|
|
17
|
+
(s[Card.bs.Es] = this.updated),
|
|
18
|
+
(s[Card.bs.Fs] = this.expiresAt),
|
|
19
19
|
(s[Card.bs.URL] = this.url),
|
|
20
|
-
(s[Card.bs.
|
|
21
|
-
(s[Card.bs.
|
|
22
|
-
(s[Card.bs.
|
|
23
|
-
(s[Card.bs.
|
|
24
|
-
(s[Card.bs.
|
|
25
|
-
(s[Card.bs.
|
|
26
|
-
(s[Card.bs.
|
|
27
|
-
(s[Card.bs.
|
|
28
|
-
(s[Card.bs.
|
|
20
|
+
(s[Card.bs.Gs] = this.linkText),
|
|
21
|
+
(s[Card.bs.Hs] = this.aspectRatio),
|
|
22
|
+
(s[Card.bs.Is] = this.extras),
|
|
23
|
+
(s[Card.bs.Js] = this.pinned),
|
|
24
|
+
(s[Card.bs.Ks] = this.dismissible),
|
|
25
|
+
(s[Card.bs.Ls] = this.clicked),
|
|
26
|
+
(s[Card.bs.Ms] = this.language),
|
|
27
|
+
(s[Card.bs.Ns] = this.altImageText),
|
|
28
|
+
(s[Card.bs.Os] = this.test),
|
|
29
29
|
s
|
|
30
30
|
);
|
|
31
31
|
}
|
|
@@ -9,14 +9,14 @@ export default class ControlCard extends Card {
|
|
|
9
9
|
qt() {
|
|
10
10
|
const t = {};
|
|
11
11
|
return (
|
|
12
|
-
(t[Card.bs.xs] = Card.ks.
|
|
12
|
+
(t[Card.bs.xs] = Card.ks.ai),
|
|
13
13
|
(t[Card.bs.qs] = this.id),
|
|
14
|
-
(t[Card.bs.
|
|
15
|
-
(t[Card.bs.
|
|
16
|
-
(t[Card.bs.
|
|
17
|
-
(t[Card.bs.
|
|
18
|
-
(t[Card.bs.
|
|
19
|
-
(t[Card.bs.
|
|
14
|
+
(t[Card.bs.ys] = this.viewed),
|
|
15
|
+
(t[Card.bs.Es] = this.updated),
|
|
16
|
+
(t[Card.bs.Fs] = this.expiresAt),
|
|
17
|
+
(t[Card.bs.Is] = this.extras),
|
|
18
|
+
(t[Card.bs.Js] = this.pinned),
|
|
19
|
+
(t[Card.bs.Os] = this.test),
|
|
20
20
|
t
|
|
21
21
|
);
|
|
22
22
|
}
|
|
@@ -9,21 +9,21 @@ export default class ImageOnly extends Card {
|
|
|
9
9
|
qt() {
|
|
10
10
|
const s = {};
|
|
11
11
|
return (
|
|
12
|
-
(s[Card.bs.xs] = Card.ks.
|
|
12
|
+
(s[Card.bs.xs] = Card.ks.oi),
|
|
13
13
|
(s[Card.bs.qs] = this.id),
|
|
14
|
-
(s[Card.bs.
|
|
15
|
-
(s[Card.bs.
|
|
16
|
-
(s[Card.bs.
|
|
17
|
-
(s[Card.bs.
|
|
14
|
+
(s[Card.bs.ys] = this.viewed),
|
|
15
|
+
(s[Card.bs.Bs] = this.imageUrl),
|
|
16
|
+
(s[Card.bs.Es] = this.updated),
|
|
17
|
+
(s[Card.bs.Fs] = this.expiresAt),
|
|
18
18
|
(s[Card.bs.URL] = this.url),
|
|
19
|
-
(s[Card.bs.
|
|
20
|
-
(s[Card.bs.
|
|
21
|
-
(s[Card.bs.
|
|
22
|
-
(s[Card.bs.
|
|
23
|
-
(s[Card.bs.
|
|
24
|
-
(s[Card.bs.
|
|
25
|
-
(s[Card.bs.
|
|
26
|
-
(s[Card.bs.
|
|
19
|
+
(s[Card.bs.Hs] = this.aspectRatio),
|
|
20
|
+
(s[Card.bs.Is] = this.extras),
|
|
21
|
+
(s[Card.bs.Js] = this.pinned),
|
|
22
|
+
(s[Card.bs.Ks] = this.dismissible),
|
|
23
|
+
(s[Card.bs.Ls] = this.clicked),
|
|
24
|
+
(s[Card.bs.Ms] = this.language),
|
|
25
|
+
(s[Card.bs.Ns] = this.altImageText),
|
|
26
|
+
(s[Card.bs.Os] = this.test),
|
|
27
27
|
s
|
|
28
28
|
);
|
|
29
29
|
}
|