@scrippsproduct/networks-ui-library 2.0.8 → 2.0.9
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/dist/components/ActionButton/ActionButton.test.js +3 -3
- package/dist/components/AdBlock/AdBlock.test.js +2 -2
- package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +2 -2
- package/dist/components/AirDateFormatter/AirDateFormatter.test.js +2 -2
- package/dist/components/AnchorTag/AnchorTag.test.js +3 -3
- package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +2 -2
- package/dist/components/BasicGridModule/BasicGridModule.test.js +2 -2
- package/dist/components/Button/Button.test.js +3 -3
- package/dist/components/ButtonAnchor/ButtonAnchor.test.js +3 -3
- package/dist/components/Carousel/Carousel.suspense-regression.test.js +2 -2
- package/dist/components/Carousel/Carousel.test.js +2 -2
- package/dist/components/Carousel/navigations/Pagination.test.js +2 -2
- package/dist/components/CarouselSlide/CarouselSlide.test.js +2 -2
- package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
- package/dist/components/CastInfoLayout/CastInfoLayout.test.js +2 -2
- package/dist/components/ChannelSearch/ChannelSearch.test.js +2 -2
- package/dist/components/ChoicesItem/ChoicesItem.test.js +2 -2
- package/dist/components/Concat/Concat.js +1 -1
- package/dist/components/Concat/Concat.test.js +2 -2
- package/dist/components/CtaBlock/CtaBlock.js +1 -1
- package/dist/components/CtaBlock/CtaBlock.test.js +3 -3
- package/dist/components/CustomSelect/CustomSelect.test.js +3 -3
- package/dist/components/DateNavigation/DateNavigation.test.js +3 -3
- package/dist/components/DatePicker/DatePicker.js +2309 -2324
- package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +2 -2
- package/dist/components/DrawerNavigation/DrawerNavigation.test.js +3 -3
- package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +2 -2
- package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +2 -2
- package/dist/components/ErrorHandler/ErrorHandler.js +1 -1
- package/dist/components/ErrorHandler/ErrorHandler.test.js +2 -2
- package/dist/components/FeaturedList/FeaturedList.test.js +3 -3
- package/dist/components/Figure/Figure.js +1 -1
- package/dist/components/Figure/Figure.test.js +2 -2
- package/dist/components/FindUs/FindUs.test.js +2 -2
- package/dist/components/FooterNavigation/FooterNavigation.test.js +2 -2
- package/dist/components/GenericList/GenericList.js +1 -1
- package/dist/components/GenericList/GenericList.test.js +2 -2
- package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +2 -2
- package/dist/components/GradientButton/GradientButton.test.js +2 -2
- package/dist/components/GridList/GridList.test.js +1 -1
- package/dist/components/ImageCard/ImageCard.test.js +2 -2
- package/dist/components/ImageCard/ImageCardCore.js +1 -1
- package/dist/components/ImageCard/ImageCardCore.test.js +2 -2
- package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +1 -1
- package/dist/components/InlineNavigation/InlineNavigation.test.js +1 -1
- package/dist/components/Input/Input.test.js +2 -2
- package/dist/components/InstructionsList/InstructionsList.js +1 -1
- package/dist/components/InstructionsList/InstructionsList.test.js +1 -1
- package/dist/components/LogoListItem/LogoListItem.test.js +1 -1
- package/dist/components/LogoNavigation/LogoNavigation.test.js +1 -1
- package/dist/components/ModalContainer/ModalContainer.js +1 -1
- package/dist/components/NavList/NavList.test.js +2 -2
- package/dist/components/Overlay/Overlay.js +1 -1
- package/dist/components/Overlay/Overlay.test.js +1 -1
- package/dist/components/PageHero/PageHero.test.js +1 -1
- package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
- package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
- package/dist/components/ProgramAirdate/ProgramAirdate.test.js +1 -1
- package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +2 -2
- package/dist/components/PromotionsRowModule/PromotionsRowModule.js +1 -1
- package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +2 -2
- package/dist/components/RescanInstructions/RescanInstructions.test.js +1 -1
- package/dist/components/ResponsiveImage/ResponsiveImage.test.js +2 -2
- package/dist/components/ResultsTable/ResultsTable.test.js +1 -1
- package/dist/components/ResultsTableBody/ResultsTableBody.test.js +1 -1
- package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +1 -1
- package/dist/components/ScheduleLayout/ScheduleContext.js +1893 -1123
- package/dist/components/SectionedContent/SectionedContent.js +1 -1
- package/dist/components/SectionedContent/SectionedContent.test.js +2 -2
- package/dist/components/Select/Select.test.js +2 -2
- package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
- package/dist/components/ShowAboutContent/ShowAboutContent.test.js +2 -2
- package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +2 -2
- package/dist/components/StringList/StringList.js +1 -1
- package/dist/components/StringList/StringList.test.js +1 -1
- package/dist/components/TabContent/TabContent.js +1 -1
- package/dist/components/TabContent/TabContent.test.js +1 -1
- package/dist/components/TabNavigation/TabNavigation.test.js +1 -1
- package/dist/components/TabbedContent/TabbedContent.test.js +1 -1
- package/dist/components/UpcomingList/UpcomingList.test.js +2 -2
- package/dist/index-BCErBUQT.mjs +3 -0
- package/dist/{index-sxnwPHiC.mjs → index-CHzqLQze.mjs} +181 -166
- package/dist/index-DnEp_Vsr.mjs +3085 -0
- package/dist/{index-5kXULIVv.mjs → index-DrfkaNHX.mjs} +16 -16
- package/dist/{magic-string.es-uPKorP4O.mjs → magic-string.es-DDAFx1CP.mjs} +93 -93
- package/dist/matchers-35e4d3bd-CfhTZpyY.mjs +2572 -0
- package/dist/react.esm-CX7MGXBg.mjs +52738 -0
- package/dist/src/icons/Facebook.d.ts +2 -1
- package/dist/src/icons/Tiktok.d.ts +2 -1
- package/dist/src/icons/Twitter.d.ts +2 -1
- package/dist/src/utils/analytics.d.ts +24 -5
- package/dist/test/setupTests.js +2 -2
- package/dist/utils/analytics.js +247 -446
- package/package.json +3 -3
- package/dist/index-B03xsUba.mjs +0 -3
- package/dist/index-C-uizG4-.mjs +0 -3098
- package/dist/matchers-35e4d3bd-BckKR3wh.mjs +0 -2404
- package/dist/react.esm-CUNRDkfQ.mjs +0 -49632
package/dist/utils/analytics.js
CHANGED
|
@@ -1,469 +1,270 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (typeof window < "u") {
|
|
12
|
-
var o;
|
|
13
|
-
typeof window.gtag > "u" && (window.dataLayer = window.dataLayer || [], window.gtag = function() {
|
|
14
|
-
window.dataLayer.push(arguments);
|
|
15
|
-
}), (o = window).gtag.apply(o, A);
|
|
16
|
-
}
|
|
17
|
-
}, y = h;
|
|
18
|
-
g.default = y;
|
|
19
|
-
})(T)), T;
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var f = (e, t, n) => t in e ? h(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var o = (e, t, n) => f(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
const p = (...e) => {
|
|
5
|
+
typeof window < "u" && (typeof window.gtag > "u" && (window.dataLayer = window.dataLayer || [], window.gtag = function() {
|
|
6
|
+
window.dataLayer.push(arguments);
|
|
7
|
+
}), window.gtag(...e));
|
|
8
|
+
}, m = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
9
|
+
function w(e) {
|
|
10
|
+
return e.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, (t, n, i) => n > 0 && n + t.length !== i.length && t.search(m) > -1 && i.charAt(n - 2) !== ":" && (i.charAt(n + t.length) !== "-" || i.charAt(n - 1) === "-") && i.charAt(n - 1).search(/[^\s-]/) < 0 ? t.toLowerCase() : t.substr(1).search(/[A-Z]|\../) > -1 ? t : t.charAt(0).toUpperCase() + t.substr(1));
|
|
20
11
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var h = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
28
|
-
function y(o) {
|
|
29
|
-
return o.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(u, c, l) {
|
|
30
|
-
return c > 0 && c + u.length !== l.length && u.search(h) > -1 && l.charAt(c - 2) !== ":" && (l.charAt(c + u.length) !== "-" || l.charAt(c - 1) === "-") && l.charAt(c - 1).search(/[^\s-]/) < 0 ? u.toLowerCase() : u.substr(1).search(/[A-Z]|\../) > -1 ? u : u.charAt(0).toUpperCase() + u.substr(1);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function S(o) {
|
|
34
|
-
return typeof o == "string" && o.indexOf("@") !== -1;
|
|
35
|
-
}
|
|
36
|
-
var b = "REDACTED (Potential Email Address)";
|
|
37
|
-
function A(o) {
|
|
38
|
-
return S(o) ? (console.warn("This arg looks like an email address, redacting."), b) : o;
|
|
39
|
-
}
|
|
40
|
-
function w() {
|
|
41
|
-
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, l = o || "";
|
|
42
|
-
return u && (l = y(o)), c && (l = A(l)), l;
|
|
43
|
-
}
|
|
44
|
-
})(M)), M;
|
|
12
|
+
function v(e) {
|
|
13
|
+
return typeof e == "string" && e.indexOf("@") !== -1;
|
|
14
|
+
}
|
|
15
|
+
const y = "REDACTED (Potential Email Address)";
|
|
16
|
+
function b(e) {
|
|
17
|
+
return v(e) ? (console.warn("This arg looks like an email address, redacting."), y) : e;
|
|
45
18
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
19
|
+
function l(e = "", t = !0, n = !0) {
|
|
20
|
+
let i = e || "";
|
|
21
|
+
return t && (i = w(e)), n && (i = b(i)), i;
|
|
22
|
+
}
|
|
23
|
+
var C = class {
|
|
24
|
+
constructor() {
|
|
25
|
+
o(this, "isInitialized");
|
|
26
|
+
o(this, "_testMode");
|
|
27
|
+
o(this, "_currentMeasurementId");
|
|
28
|
+
o(this, "_hasLoadedGA");
|
|
29
|
+
o(this, "_isQueuing");
|
|
30
|
+
o(this, "_queueGtag");
|
|
31
|
+
o(this, "reset", () => {
|
|
32
|
+
this.isInitialized = !1, this._testMode = !1, this._currentMeasurementId = "", this._hasLoadedGA = !1, this._isQueuing = !1, this._queueGtag = [];
|
|
33
|
+
});
|
|
34
|
+
o(this, "_gtag", (...e) => {
|
|
35
|
+
this._testMode ? this._queueGtag.push(e) : this._isQueuing ? this._queueGtag.push(e) : p(...e);
|
|
36
|
+
});
|
|
37
|
+
o(this, "_loadGA", (e, t, n = "https://www.googletagmanager.com/gtag/js") => {
|
|
38
|
+
if (!(typeof window > "u" || typeof document > "u") && !this._hasLoadedGA) {
|
|
39
|
+
const i = document.createElement("script");
|
|
40
|
+
i.async = !0, i.src = `${n}?id=${e}`, t && i.setAttribute("nonce", t), document.body.appendChild(i), window.dataLayer = window.dataLayer || [], window.gtag = function() {
|
|
41
|
+
window.dataLayer.push(arguments);
|
|
42
|
+
}, this._hasLoadedGA = !0;
|
|
63
43
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
44
|
+
});
|
|
45
|
+
o(this, "_toGtagOptions", (e) => {
|
|
46
|
+
if (!e) return;
|
|
47
|
+
const t = {
|
|
48
|
+
cookieUpdate: "cookie_update",
|
|
49
|
+
cookieExpires: "cookie_expires",
|
|
50
|
+
cookieDomain: "cookie_domain",
|
|
51
|
+
cookieFlags: "cookie_flags",
|
|
52
|
+
userId: "user_id",
|
|
53
|
+
clientId: "client_id",
|
|
54
|
+
anonymizeIp: "anonymize_ip",
|
|
55
|
+
contentGroup1: "content_group1",
|
|
56
|
+
contentGroup2: "content_group2",
|
|
57
|
+
contentGroup3: "content_group3",
|
|
58
|
+
contentGroup4: "content_group4",
|
|
59
|
+
contentGroup5: "content_group5",
|
|
60
|
+
allowAdFeatures: "allow_google_signals",
|
|
61
|
+
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
62
|
+
nonInteraction: "non_interaction",
|
|
63
|
+
page: "page_path",
|
|
64
|
+
hitCallback: "event_callback"
|
|
65
|
+
};
|
|
66
|
+
return Object.entries(e).reduce((n, [i, a]) => (t[i] ? n[t[i]] = a : n[i] = a, n), {});
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param {InitOptions[]|string} GA_MEASUREMENT_ID
|
|
71
|
+
* @param {Object} [options]
|
|
72
|
+
* @param {string} [options.nonce]
|
|
73
|
+
* @param {boolean} [options.testMode=false]
|
|
74
|
+
* @param {string} [options.gtagUrl=https://www.googletagmanager.com/gtag/js]
|
|
75
|
+
* @param {GaOptions|any} [options.gaOptions]
|
|
76
|
+
* @param {Object} [options.gtagOptions] New parameter
|
|
77
|
+
*/
|
|
78
|
+
o(this, "initialize", (e, t = {}) => {
|
|
79
|
+
if (!e) throw new Error("Require GA_MEASUREMENT_ID");
|
|
80
|
+
const n = typeof e == "string" ? [{ trackingId: e }] : e;
|
|
81
|
+
this._currentMeasurementId = n[0].trackingId;
|
|
82
|
+
const { gaOptions: i, gtagOptions: a, nonce: g, testMode: r = !1, gtagUrl: d } = t;
|
|
83
|
+
if (this._testMode = r, r || this._loadGA(this._currentMeasurementId, g, d), this.isInitialized || (this._gtag("js", /* @__PURE__ */ new Date()), n.forEach((s) => {
|
|
84
|
+
const c = {
|
|
85
|
+
...this._toGtagOptions({
|
|
86
|
+
...i,
|
|
87
|
+
...s.gaOptions
|
|
88
|
+
}),
|
|
89
|
+
...a,
|
|
90
|
+
...s.gtagOptions
|
|
91
|
+
};
|
|
92
|
+
Object.keys(c).length ? this._gtag("config", s.trackingId, c) : this._gtag("config", s.trackingId);
|
|
93
|
+
})), this.isInitialized = !0, !r) {
|
|
94
|
+
const s = [...this._queueGtag];
|
|
95
|
+
for (this._queueGtag = [], this._isQueuing = !1; s.length; ) {
|
|
96
|
+
const c = s.shift();
|
|
97
|
+
this._gtag(...c), c[0] === "get" && (this._isQueuing = !0);
|
|
98
|
+
}
|
|
101
99
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
e % 2 ? D(Object(t), !0).forEach(function(n) {
|
|
108
|
-
d(r, n, t[n]);
|
|
109
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : D(Object(t)).forEach(function(n) {
|
|
110
|
-
Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
|
|
111
|
-
});
|
|
100
|
+
});
|
|
101
|
+
o(this, "set", (e) => {
|
|
102
|
+
if (!e) {
|
|
103
|
+
console.warn("`fieldsObject` is required in .set()");
|
|
104
|
+
return;
|
|
112
105
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return K(r) || H(r, e) || L(r, e) || B();
|
|
117
|
-
}
|
|
118
|
-
function B() {
|
|
119
|
-
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
120
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
121
|
-
}
|
|
122
|
-
function L(r, e) {
|
|
123
|
-
if (r) {
|
|
124
|
-
if (typeof r == "string") return I(r, e);
|
|
125
|
-
var t = Object.prototype.toString.call(r).slice(8, -1);
|
|
126
|
-
if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set") return Array.from(r);
|
|
127
|
-
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return I(r, e);
|
|
106
|
+
if (typeof e != "object") {
|
|
107
|
+
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
108
|
+
return;
|
|
128
109
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (!p && t.return != null && (f = t.return(), Object(f) !== f)) return;
|
|
146
|
-
} finally {
|
|
147
|
-
if (m) throw a;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return s;
|
|
110
|
+
Object.keys(e).length === 0 && console.warn("empty `fieldsObject` given to .set()"), this._gaCommand("set", e);
|
|
111
|
+
});
|
|
112
|
+
o(this, "_gaCommandSendEvent", (e, t, n, i, a) => {
|
|
113
|
+
this._gtag("event", t, {
|
|
114
|
+
event_category: e,
|
|
115
|
+
event_label: n,
|
|
116
|
+
value: i,
|
|
117
|
+
...a && { non_interaction: a.nonInteraction },
|
|
118
|
+
...this._toGtagOptions(a)
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
o(this, "_gaCommandSendEventParameters", (...e) => {
|
|
122
|
+
if (typeof e[0] == "string") this._gaCommandSendEvent(...e.slice(1));
|
|
123
|
+
else {
|
|
124
|
+
const { eventCategory: t, eventAction: n, eventLabel: i, eventValue: a, hitType: g, ...r } = e[0];
|
|
125
|
+
this._gaCommandSendEvent(t, n, i, a, r);
|
|
151
126
|
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
127
|
+
});
|
|
128
|
+
o(this, "_gaCommandSendTiming", (e, t, n, i) => {
|
|
129
|
+
this._gtag("event", "timing_complete", {
|
|
130
|
+
name: t,
|
|
131
|
+
value: n,
|
|
132
|
+
event_category: e,
|
|
133
|
+
event_label: i
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
o(this, "_gaCommandSendPageview", (e, t) => {
|
|
137
|
+
if (t && Object.keys(t).length) {
|
|
138
|
+
const { title: n, location: i, ...a } = this._toGtagOptions(t) || {};
|
|
139
|
+
this._gtag("event", "page_view", {
|
|
140
|
+
...e && { page_path: e },
|
|
141
|
+
...n && { page_title: n },
|
|
142
|
+
...i && { page_location: i },
|
|
143
|
+
...a
|
|
144
|
+
});
|
|
145
|
+
} else e ? this._gtag("event", "page_view", { page_path: e }) : this._gtag("event", "page_view");
|
|
146
|
+
});
|
|
147
|
+
o(this, "_gaCommandSendPageviewParameters", (...e) => {
|
|
148
|
+
if (typeof e[0] == "string") this._gaCommandSendPageview(...e.slice(1));
|
|
149
|
+
else {
|
|
150
|
+
const { page: t, hitType: n, ...i } = e[0];
|
|
151
|
+
this._gaCommandSendPageview(t, i);
|
|
164
152
|
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
153
|
+
});
|
|
154
|
+
o(this, "_gaCommandSend", (...e) => {
|
|
155
|
+
const t = typeof e[0] == "string" ? e[0] : e[0].hitType;
|
|
156
|
+
switch (t) {
|
|
157
|
+
case "event":
|
|
158
|
+
this._gaCommandSendEventParameters(...e);
|
|
159
|
+
break;
|
|
160
|
+
case "pageview":
|
|
161
|
+
this._gaCommandSendPageviewParameters(...e);
|
|
162
|
+
break;
|
|
163
|
+
case "timing":
|
|
164
|
+
this._gaCommandSendTiming(...e.slice(1));
|
|
165
|
+
break;
|
|
166
|
+
case "screenview":
|
|
167
|
+
case "transaction":
|
|
168
|
+
case "item":
|
|
169
|
+
case "social":
|
|
170
|
+
case "exception":
|
|
171
|
+
console.warn(`Unsupported send command: ${t}`);
|
|
172
|
+
break;
|
|
173
|
+
default:
|
|
174
|
+
console.warn(`Send command doesn't exist: ${t}`);
|
|
183
175
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
cookieDomain: "cookie_domain",
|
|
211
|
-
cookieFlags: "cookie_flags",
|
|
212
|
-
// must be in set method?
|
|
213
|
-
userId: "user_id",
|
|
214
|
-
clientId: "client_id",
|
|
215
|
-
anonymizeIp: "anonymize_ip",
|
|
216
|
-
// https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
|
|
217
|
-
contentGroup1: "content_group1",
|
|
218
|
-
contentGroup2: "content_group2",
|
|
219
|
-
contentGroup3: "content_group3",
|
|
220
|
-
contentGroup4: "content_group4",
|
|
221
|
-
contentGroup5: "content_group5",
|
|
222
|
-
// https://support.google.com/analytics/answer/9050852?hl=en
|
|
223
|
-
allowAdFeatures: "allow_google_signals",
|
|
224
|
-
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
225
|
-
nonInteraction: "non_interaction",
|
|
226
|
-
page: "page_path",
|
|
227
|
-
hitCallback: "event_callback"
|
|
228
|
-
}, a = Object.entries(t).reduce(function(i, f) {
|
|
229
|
-
var s = x(f, 2), p = s[0], m = s[1];
|
|
230
|
-
return n[p] ? i[n[p]] = m : i[p] = m, i;
|
|
231
|
-
}, {});
|
|
232
|
-
return a;
|
|
233
|
-
}
|
|
234
|
-
}), d(this, "initialize", function(t) {
|
|
235
|
-
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
236
|
-
if (!t)
|
|
237
|
-
throw new Error("Require GA_MEASUREMENT_ID");
|
|
238
|
-
var a = typeof t == "string" ? [{
|
|
239
|
-
trackingId: t
|
|
240
|
-
}] : t;
|
|
241
|
-
e._currentMeasurementId = a[0].trackingId;
|
|
242
|
-
var i = n.gaOptions, f = n.gtagOptions, s = n.nonce, p = n.testMode, m = p === void 0 ? !1 : p, v = n.gtagUrl;
|
|
243
|
-
if (e._testMode = m, m || e._loadGA(e._currentMeasurementId, s, v), e.isInitialized || (e._gtag("js", /* @__PURE__ */ new Date()), a.forEach(function(G) {
|
|
244
|
-
var F = _(_(_({}, e._toGtagOptions(_(_({}, i), G.gaOptions))), f), G.gtagOptions);
|
|
245
|
-
Object.keys(F).length ? e._gtag("config", G.trackingId, F) : e._gtag("config", G.trackingId);
|
|
246
|
-
})), e.isInitialized = !0, !m) {
|
|
247
|
-
var j = l(e._queueGtag);
|
|
248
|
-
for (e._queueGtag = [], e._isQueuing = !1; j.length; ) {
|
|
249
|
-
var W = j.shift();
|
|
250
|
-
e._gtag.apply(e, l(W)), W[0] === "get" && (e._isQueuing = !0);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}), d(this, "set", function(t) {
|
|
254
|
-
if (!t) {
|
|
255
|
-
console.warn("`fieldsObject` is required in .set()");
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
if (c(t) !== "object") {
|
|
259
|
-
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
Object.keys(t).length === 0 && console.warn("empty `fieldsObject` given to .set()"), e._gaCommand("set", t);
|
|
263
|
-
}), d(this, "_gaCommandSendEvent", function(t, n, a, i, f) {
|
|
264
|
-
e._gtag("event", n, _(_({
|
|
265
|
-
event_category: t,
|
|
266
|
-
event_label: a,
|
|
267
|
-
value: i
|
|
268
|
-
}, f && {
|
|
269
|
-
non_interaction: f.nonInteraction
|
|
270
|
-
}), e._toGtagOptions(f)));
|
|
271
|
-
}), d(this, "_gaCommandSendEventParameters", function() {
|
|
272
|
-
for (var t = arguments.length, n = new Array(t), a = 0; a < t; a++)
|
|
273
|
-
n[a] = arguments[a];
|
|
274
|
-
if (typeof n[0] == "string")
|
|
275
|
-
e._gaCommandSendEvent.apply(e, l(n.slice(1)));
|
|
276
|
-
else {
|
|
277
|
-
var i = n[0], f = i.eventCategory, s = i.eventAction, p = i.eventLabel, m = i.eventValue;
|
|
278
|
-
i.hitType;
|
|
279
|
-
var v = o(i, S);
|
|
280
|
-
e._gaCommandSendEvent(f, s, p, m, v);
|
|
281
|
-
}
|
|
282
|
-
}), d(this, "_gaCommandSendTiming", function(t, n, a, i) {
|
|
283
|
-
e._gtag("event", "timing_complete", {
|
|
284
|
-
name: n,
|
|
285
|
-
value: a,
|
|
286
|
-
event_category: t,
|
|
287
|
-
event_label: i
|
|
288
|
-
});
|
|
289
|
-
}), d(this, "_gaCommandSendPageview", function(t, n) {
|
|
290
|
-
if (n && Object.keys(n).length) {
|
|
291
|
-
var a = e._toGtagOptions(n), i = a.title, f = a.location, s = o(a, b);
|
|
292
|
-
e._gtag("event", "page_view", _(_(_(_({}, t && {
|
|
293
|
-
page_path: t
|
|
294
|
-
}), i && {
|
|
295
|
-
page_title: i
|
|
296
|
-
}), f && {
|
|
297
|
-
page_location: f
|
|
298
|
-
}), s));
|
|
299
|
-
} else t ? e._gtag("event", "page_view", {
|
|
300
|
-
page_path: t
|
|
301
|
-
}) : e._gtag("event", "page_view");
|
|
302
|
-
}), d(this, "_gaCommandSendPageviewParameters", function() {
|
|
303
|
-
for (var t = arguments.length, n = new Array(t), a = 0; a < t; a++)
|
|
304
|
-
n[a] = arguments[a];
|
|
305
|
-
if (typeof n[0] == "string")
|
|
306
|
-
e._gaCommandSendPageview.apply(e, l(n.slice(1)));
|
|
307
|
-
else {
|
|
308
|
-
var i = n[0], f = i.page;
|
|
309
|
-
i.hitType;
|
|
310
|
-
var s = o(i, A);
|
|
311
|
-
e._gaCommandSendPageview(f, s);
|
|
312
|
-
}
|
|
313
|
-
}), d(this, "_gaCommandSend", function() {
|
|
314
|
-
for (var t = arguments.length, n = new Array(t), a = 0; a < t; a++)
|
|
315
|
-
n[a] = arguments[a];
|
|
316
|
-
var i = typeof n[0] == "string" ? n[0] : n[0].hitType;
|
|
317
|
-
switch (i) {
|
|
318
|
-
case "event":
|
|
319
|
-
e._gaCommandSendEventParameters.apply(e, n);
|
|
320
|
-
break;
|
|
321
|
-
case "pageview":
|
|
322
|
-
e._gaCommandSendPageviewParameters.apply(e, n);
|
|
323
|
-
break;
|
|
324
|
-
case "timing":
|
|
325
|
-
e._gaCommandSendTiming.apply(e, l(n.slice(1)));
|
|
326
|
-
break;
|
|
327
|
-
case "screenview":
|
|
328
|
-
case "transaction":
|
|
329
|
-
case "item":
|
|
330
|
-
case "social":
|
|
331
|
-
case "exception":
|
|
332
|
-
console.warn("Unsupported send command: ".concat(i));
|
|
333
|
-
break;
|
|
334
|
-
default:
|
|
335
|
-
console.warn("Send command doesn't exist: ".concat(i));
|
|
336
|
-
}
|
|
337
|
-
}), d(this, "_gaCommandSet", function() {
|
|
338
|
-
for (var t = arguments.length, n = new Array(t), a = 0; a < t; a++)
|
|
339
|
-
n[a] = arguments[a];
|
|
340
|
-
typeof n[0] == "string" && (n[0] = d({}, n[0], n[1])), e._gtag("set", e._toGtagOptions(n[0]));
|
|
341
|
-
}), d(this, "_gaCommand", function(t) {
|
|
342
|
-
for (var n = arguments.length, a = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)
|
|
343
|
-
a[i - 1] = arguments[i];
|
|
344
|
-
switch (t) {
|
|
345
|
-
case "send":
|
|
346
|
-
e._gaCommandSend.apply(e, a);
|
|
347
|
-
break;
|
|
348
|
-
case "set":
|
|
349
|
-
e._gaCommandSet.apply(e, a);
|
|
350
|
-
break;
|
|
351
|
-
default:
|
|
352
|
-
console.warn("Command doesn't exist: ".concat(t));
|
|
353
|
-
}
|
|
354
|
-
}), d(this, "ga", function() {
|
|
355
|
-
for (var t = arguments.length, n = new Array(t), a = 0; a < t; a++)
|
|
356
|
-
n[a] = arguments[a];
|
|
357
|
-
if (typeof n[0] == "string")
|
|
358
|
-
e._gaCommand.apply(e, n);
|
|
359
|
-
else {
|
|
360
|
-
var i = n[0];
|
|
361
|
-
e._gtag("get", e._currentMeasurementId, "client_id", function(f) {
|
|
362
|
-
e._isQueuing = !1;
|
|
363
|
-
var s = e._queueGtag;
|
|
364
|
-
for (i({
|
|
365
|
-
get: function(v) {
|
|
366
|
-
return v === "clientId" ? f : v === "trackingId" ? e._currentMeasurementId : v === "apiVersion" ? "1" : void 0;
|
|
367
|
-
}
|
|
368
|
-
}); s.length; ) {
|
|
369
|
-
var p = s.shift();
|
|
370
|
-
e._gtag.apply(e, l(p));
|
|
371
|
-
}
|
|
372
|
-
}), e._isQueuing = !0;
|
|
373
|
-
}
|
|
374
|
-
return e.ga;
|
|
375
|
-
}), d(this, "event", function(t, n) {
|
|
376
|
-
if (typeof t == "string")
|
|
377
|
-
e._gtag("event", t, e._toGtagOptions(n));
|
|
378
|
-
else {
|
|
379
|
-
var a = t.action, i = t.category, f = t.label, s = t.value, p = t.nonInteraction, m = t.transport;
|
|
380
|
-
if (!i || !a) {
|
|
381
|
-
console.warn("args.category AND args.action are required in event()");
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
var v = {
|
|
385
|
-
hitType: "event",
|
|
386
|
-
eventCategory: (0, y.default)(i),
|
|
387
|
-
eventAction: (0, y.default)(a)
|
|
388
|
-
};
|
|
389
|
-
f && (v.eventLabel = (0, y.default)(f)), typeof s < "u" && (typeof s != "number" ? console.warn("Expected `args.value` arg to be a Number.") : v.eventValue = s), typeof p < "u" && (typeof p != "boolean" ? console.warn("`args.nonInteraction` must be a boolean.") : v.nonInteraction = p), typeof m < "u" && (typeof m != "string" ? console.warn("`args.transport` must be a string.") : (["beacon", "xhr", "image"].indexOf(m) === -1 && console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"), v.transport = m)), e._gaCommand("send", v);
|
|
176
|
+
});
|
|
177
|
+
o(this, "_gaCommandSet", (...e) => {
|
|
178
|
+
typeof e[0] == "string" && (e[0] = { [e[0]]: e[1] }), this._gtag("set", this._toGtagOptions(e[0]));
|
|
179
|
+
});
|
|
180
|
+
o(this, "_gaCommand", (e, ...t) => {
|
|
181
|
+
switch (e) {
|
|
182
|
+
case "send":
|
|
183
|
+
this._gaCommandSend(...t);
|
|
184
|
+
break;
|
|
185
|
+
case "set":
|
|
186
|
+
this._gaCommandSet(...t);
|
|
187
|
+
break;
|
|
188
|
+
default:
|
|
189
|
+
console.warn(`Command doesn't exist: ${e}`);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
o(this, "ga", (...e) => {
|
|
193
|
+
if (typeof e[0] == "string") this._gaCommand(...e);
|
|
194
|
+
else {
|
|
195
|
+
const [t] = e;
|
|
196
|
+
this._gtag("get", this._currentMeasurementId, "client_id", (n) => {
|
|
197
|
+
this._isQueuing = !1;
|
|
198
|
+
const i = this._queueGtag;
|
|
199
|
+
for (t({ get: (a) => a === "clientId" ? n : a === "trackingId" ? this._currentMeasurementId : a === "apiVersion" ? "1" : void 0 }); i.length; ) {
|
|
200
|
+
const a = i.shift();
|
|
201
|
+
this._gtag(...a);
|
|
390
202
|
}
|
|
391
|
-
}),
|
|
392
|
-
e._gaCommand("send", t);
|
|
393
|
-
}), this.reset();
|
|
203
|
+
}), this._isQueuing = !0;
|
|
394
204
|
}
|
|
395
|
-
return
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
function re() {
|
|
409
|
-
return V || (V = 1, (function(g) {
|
|
410
|
-
function h(o) {
|
|
411
|
-
"@babel/helpers - typeof";
|
|
412
|
-
return h = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(u) {
|
|
413
|
-
return typeof u;
|
|
414
|
-
} : function(u) {
|
|
415
|
-
return u && typeof Symbol == "function" && u.constructor === Symbol && u !== Symbol.prototype ? "symbol" : typeof u;
|
|
416
|
-
}, h(o);
|
|
417
|
-
}
|
|
418
|
-
Object.defineProperty(g, "__esModule", {
|
|
419
|
-
value: !0
|
|
420
|
-
}), g.default = g.ReactGAImplementation = void 0;
|
|
421
|
-
var y = b(ne());
|
|
422
|
-
function S(o) {
|
|
423
|
-
if (typeof WeakMap != "function") return null;
|
|
424
|
-
var u = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap();
|
|
425
|
-
return (S = function(C) {
|
|
426
|
-
return C ? c : u;
|
|
427
|
-
})(o);
|
|
428
|
-
}
|
|
429
|
-
function b(o, u) {
|
|
430
|
-
if (o && o.__esModule)
|
|
431
|
-
return o;
|
|
432
|
-
if (o === null || h(o) !== "object" && typeof o != "function")
|
|
433
|
-
return { default: o };
|
|
434
|
-
var c = S(u);
|
|
435
|
-
if (c && c.has(o))
|
|
436
|
-
return c.get(o);
|
|
437
|
-
var l = {}, C = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
438
|
-
for (var O in o)
|
|
439
|
-
if (O !== "default" && Object.prototype.hasOwnProperty.call(o, O)) {
|
|
440
|
-
var P = C ? Object.getOwnPropertyDescriptor(o, O) : null;
|
|
441
|
-
P && (P.get || P.set) ? Object.defineProperty(l, O, P) : l[O] = o[O];
|
|
205
|
+
return this.ga;
|
|
206
|
+
});
|
|
207
|
+
/**
|
|
208
|
+
* @param {UaEventOptions|string} optionsOrName
|
|
209
|
+
* @param {Object} [params]
|
|
210
|
+
*/
|
|
211
|
+
o(this, "event", (e, t) => {
|
|
212
|
+
if (typeof e == "string") this._gtag("event", e, this._toGtagOptions(t));
|
|
213
|
+
else {
|
|
214
|
+
const { action: n, category: i, label: a, value: g, nonInteraction: r, transport: d } = e;
|
|
215
|
+
if (!i || !n) {
|
|
216
|
+
console.warn("args.category AND args.action are required in event()");
|
|
217
|
+
return;
|
|
442
218
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
219
|
+
const s = {
|
|
220
|
+
hitType: "event",
|
|
221
|
+
eventCategory: l(i),
|
|
222
|
+
eventAction: l(n)
|
|
223
|
+
};
|
|
224
|
+
a && (s.eventLabel = l(a)), typeof g < "u" && (typeof g != "number" ? console.warn("Expected `args.value` arg to be a Number.") : s.eventValue = g), typeof r < "u" && (typeof r != "boolean" ? console.warn("`args.nonInteraction` must be a boolean.") : s.nonInteraction = r), typeof d < "u" && (typeof d != "string" ? console.warn("`args.transport` must be a string.") : ([
|
|
225
|
+
"beacon",
|
|
226
|
+
"xhr",
|
|
227
|
+
"image"
|
|
228
|
+
].indexOf(d) === -1 && console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"), s.transport = d)), this._gaCommand("send", s);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
o(this, "send", (e) => {
|
|
232
|
+
this._gaCommand("send", e);
|
|
233
|
+
});
|
|
234
|
+
this.reset();
|
|
235
|
+
}
|
|
236
|
+
gtag(...e) {
|
|
237
|
+
this._gtag(...e);
|
|
238
|
+
}
|
|
239
|
+
}, G = new C(), _ = G;
|
|
240
|
+
let u = !1;
|
|
241
|
+
const A = (e, t = "local", n, i = {}) => {
|
|
242
|
+
const { autoPageView: a = !0 } = i;
|
|
243
|
+
if (!n) {
|
|
454
244
|
console.warn("GA_MEASUREMENT_ID is not set. Google Analytics will not be initialized.");
|
|
455
245
|
return;
|
|
456
246
|
}
|
|
457
|
-
|
|
247
|
+
t === "staging" || t === "production" ? (_.initialize(n, {
|
|
458
248
|
// Use gaOptions to send custom dimensions with every GA event except initial_page_view.
|
|
459
249
|
// gtagOptions could be used to send custom dimensions to initial_page_view only, if desired.
|
|
460
250
|
gaOptions: {
|
|
461
251
|
// custom dimensions to report
|
|
462
|
-
scripps_brand:
|
|
252
|
+
scripps_brand: e,
|
|
463
253
|
scripps_platform: "Web"
|
|
464
|
-
}
|
|
465
|
-
|
|
254
|
+
},
|
|
255
|
+
// gtagOptions are merged into the gtag `config` call. send_page_view: false stops GA4
|
|
256
|
+
// firing its own page_view on load, leaving the app in sole control of page views.
|
|
257
|
+
...a ? {} : { gtagOptions: { send_page_view: !1 } }
|
|
258
|
+
}), u = !0) : (u = !1, console.warn("** Note: Google Analytics is only initialized in staging and production environments. **"));
|
|
259
|
+
}, I = (e, t) => {
|
|
260
|
+
!u || typeof window > "u" || _.send({
|
|
261
|
+
hitType: "pageview",
|
|
262
|
+
page: e ?? `${window.location.pathname}${window.location.search}`,
|
|
263
|
+
title: t ?? document.title,
|
|
264
|
+
location: window.location.href
|
|
265
|
+
});
|
|
466
266
|
};
|
|
467
267
|
export {
|
|
468
|
-
|
|
268
|
+
A as initializeAnalytics,
|
|
269
|
+
I as sendPageView
|
|
469
270
|
};
|