@scalemule/news-publication 0.0.12 → 0.0.14
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/{chunk-EKQXS63J.js → chunk-5YQYJ2L2.js} +29 -5
- package/dist/chunk-QWK6G2UF.js +117 -0
- package/dist/{chunk-ZSA6YQBV.js → chunk-WZ3NQRQO.js} +1 -1
- package/dist/compliance.cjs +19 -0
- package/dist/compliance.d.cts +2 -0
- package/dist/compliance.d.ts +2 -0
- package/dist/compliance.js +2 -0
- package/dist/cookie-consent-banner.cjs +44 -213
- package/dist/cookie-consent-banner.d.cts +3 -1
- package/dist/cookie-consent-banner.d.ts +3 -1
- package/dist/cookie-consent-banner.js +2 -2
- package/dist/cookie-settings-view.cjs +21 -123
- package/dist/cookie-settings-view.js +2 -2
- package/dist/index.cjs +147 -287
- package/dist/index.d.cts +14 -102
- package/dist/index.d.ts +14 -102
- package/dist/index.js +3 -3
- package/dist/{marketplace-CpGWPbFk.d.ts → marketplace-29i5w4LS.d.cts} +1 -1
- package/dist/{marketplace-CpGWPbFk.d.cts → marketplace-29i5w4LS.d.ts} +1 -1
- package/dist/marketplace-view.d.cts +1 -1
- package/dist/marketplace-view.d.ts +1 -1
- package/dist/{meet-5Ym5bxfh.d.cts → meet-RWmfj3I3.d.cts} +1 -1
- package/dist/{meet-5Ym5bxfh.d.ts → meet-RWmfj3I3.d.ts} +1 -1
- package/dist/meet-forms.d.cts +1 -1
- package/dist/meet-forms.d.ts +1 -1
- package/dist/meet-view.d.cts +1 -1
- package/dist/meet-view.d.ts +1 -1
- package/dist/snapshot-file.d.cts +1 -1
- package/dist/snapshot-file.d.ts +1 -1
- package/dist/{snapshot-BS4hn1dk.d.ts → snapshot-sHgQHuAF.d.cts} +1 -1
- package/dist/{snapshot-BS4hn1dk.d.cts → snapshot-sHgQHuAF.d.ts} +1 -1
- package/package.json +12 -2
- package/dist/chunk-CWZWU4HE.js +0 -354
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var compliance = require('@scalemule/compliance');
|
|
3
4
|
var react = require('react');
|
|
4
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
6
|
|
|
@@ -782,24 +783,9 @@ async function syncPublication(input) {
|
|
|
782
783
|
ageMs
|
|
783
784
|
};
|
|
784
785
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
var COOKIE_CONSENT_BACKUP_KEY = "napsite_cookie_consent_v1";
|
|
789
|
-
var COOKIE_CONSENT_EVENT = "scalemule-cookie-consent-change";
|
|
790
|
-
var COOKIE_CONSENT_MAX_AGE_SECONDS = 365 * 24 * 60 * 60;
|
|
791
|
-
var DEFAULT_PREFERENCES_REJECTED = {
|
|
792
|
-
essential: true,
|
|
793
|
-
performance: false,
|
|
794
|
-
functional: false,
|
|
795
|
-
advertising: false
|
|
796
|
-
};
|
|
797
|
-
var DEFAULT_PREFERENCES_ACCEPTED = {
|
|
798
|
-
essential: true,
|
|
799
|
-
performance: true,
|
|
800
|
-
functional: true,
|
|
801
|
-
advertising: true
|
|
802
|
-
};
|
|
786
|
+
async function recordConsentToCompliance(record, options) {
|
|
787
|
+
return compliance.recordConsentToCompliance(record, options);
|
|
788
|
+
}
|
|
803
789
|
var COOKIE_CATEGORIES = [
|
|
804
790
|
{
|
|
805
791
|
id: "essential",
|
|
@@ -908,233 +894,6 @@ var COOKIE_CATEGORIES = [
|
|
|
908
894
|
]
|
|
909
895
|
}
|
|
910
896
|
];
|
|
911
|
-
var memoryConsent = null;
|
|
912
|
-
function readCookie(name) {
|
|
913
|
-
if (typeof document === "undefined") return null;
|
|
914
|
-
const match = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1") + "=([^;]*)"));
|
|
915
|
-
return match ? decodeURIComponent(match[1]) : null;
|
|
916
|
-
}
|
|
917
|
-
function writeCookie(name, value, maxAgeSeconds) {
|
|
918
|
-
if (typeof document === "undefined") return;
|
|
919
|
-
const secure = typeof location !== "undefined" && location.protocol === "https:" ? "; Secure" : "";
|
|
920
|
-
document.cookie = `${name}=${encodeURIComponent(value)}; Path=/; Max-Age=${maxAgeSeconds}; SameSite=Lax${secure}`;
|
|
921
|
-
}
|
|
922
|
-
function getCookieConsent() {
|
|
923
|
-
if (typeof window === "undefined") return memoryConsent;
|
|
924
|
-
try {
|
|
925
|
-
const raw = readCookie(COOKIE_CONSENT_KEY) || readCookie(COOKIE_CONSENT_BACKUP_KEY);
|
|
926
|
-
if (raw) {
|
|
927
|
-
const parsed = JSON.parse(raw);
|
|
928
|
-
if (parsed && parsed.version === 1 && parsed.preferences) {
|
|
929
|
-
memoryConsent = parsed;
|
|
930
|
-
return parsed;
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
const stored = window.localStorage?.getItem(COOKIE_CONSENT_KEY);
|
|
934
|
-
if (stored) {
|
|
935
|
-
const parsed = JSON.parse(stored);
|
|
936
|
-
if (parsed && parsed.version === 1 && parsed.preferences) {
|
|
937
|
-
memoryConsent = parsed;
|
|
938
|
-
return parsed;
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
} catch {
|
|
942
|
-
}
|
|
943
|
-
return memoryConsent;
|
|
944
|
-
}
|
|
945
|
-
var EU_EEA_UK_COUNTRIES = /* @__PURE__ */ new Set([
|
|
946
|
-
"AT",
|
|
947
|
-
"BE",
|
|
948
|
-
"BG",
|
|
949
|
-
"HR",
|
|
950
|
-
"CY",
|
|
951
|
-
"CZ",
|
|
952
|
-
"DK",
|
|
953
|
-
"EE",
|
|
954
|
-
"FI",
|
|
955
|
-
"FR",
|
|
956
|
-
"DE",
|
|
957
|
-
"GR",
|
|
958
|
-
"HU",
|
|
959
|
-
"IE",
|
|
960
|
-
"IT",
|
|
961
|
-
"LV",
|
|
962
|
-
"LT",
|
|
963
|
-
"LU",
|
|
964
|
-
"MT",
|
|
965
|
-
"NL",
|
|
966
|
-
"PL",
|
|
967
|
-
"PT",
|
|
968
|
-
"RO",
|
|
969
|
-
"SK",
|
|
970
|
-
"SI",
|
|
971
|
-
"ES",
|
|
972
|
-
"SE",
|
|
973
|
-
"IS",
|
|
974
|
-
"LI",
|
|
975
|
-
"NO",
|
|
976
|
-
"GB",
|
|
977
|
-
"CH"
|
|
978
|
-
]);
|
|
979
|
-
function isGeoConsentRequired(countryCode) {
|
|
980
|
-
if (countryCode && typeof countryCode === "string") {
|
|
981
|
-
const code = countryCode.trim().toUpperCase();
|
|
982
|
-
if (code.length === 2) {
|
|
983
|
-
return EU_EEA_UK_COUNTRIES.has(code);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
if (typeof window !== "undefined") {
|
|
987
|
-
try {
|
|
988
|
-
const cached = readCookie("sm_geo_country") || window.localStorage?.getItem("sm_geo_country");
|
|
989
|
-
if (cached && typeof cached === "string" && cached.length === 2) {
|
|
990
|
-
return EU_EEA_UK_COUNTRIES.has(cached.toUpperCase());
|
|
991
|
-
}
|
|
992
|
-
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
993
|
-
if (tz) {
|
|
994
|
-
if (/^(America|US|Canada|Pacific)\//i.test(tz)) {
|
|
995
|
-
return false;
|
|
996
|
-
}
|
|
997
|
-
if (/^(Europe|Atlantic\/Reykjavik|Atlantic\/Canary|Atlantic\/Faeroe|Atlantic\/Madeira|Atlantic\/Azores|WET|CET|EET|GMT)/i.test(tz)) {
|
|
998
|
-
return true;
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
} catch {
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
return false;
|
|
1005
|
-
}
|
|
1006
|
-
function checkUrlConsentBridge() {
|
|
1007
|
-
if (typeof window === "undefined") return false;
|
|
1008
|
-
try {
|
|
1009
|
-
const url = new URL(window.location.href);
|
|
1010
|
-
const param = url.searchParams.get("sm_consent");
|
|
1011
|
-
if (!param) return false;
|
|
1012
|
-
if (param === "accepted" || param === "1" || param === "all") {
|
|
1013
|
-
acceptAllCookies();
|
|
1014
|
-
} else if (param === "rejected" || param === "0" || param === "essential") {
|
|
1015
|
-
rejectOptionalCookies();
|
|
1016
|
-
} else {
|
|
1017
|
-
return false;
|
|
1018
|
-
}
|
|
1019
|
-
url.searchParams.delete("sm_consent");
|
|
1020
|
-
const newSearch = url.searchParams.toString() ? `?${url.searchParams.toString()}` : "";
|
|
1021
|
-
window.history.replaceState(null, "", `${url.pathname}${newSearch}${url.hash}`);
|
|
1022
|
-
return true;
|
|
1023
|
-
} catch {
|
|
1024
|
-
return false;
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
function decorateNetworkUrl(targetUrl) {
|
|
1028
|
-
const consent = getCookieConsent();
|
|
1029
|
-
if (!consent) return targetUrl;
|
|
1030
|
-
try {
|
|
1031
|
-
const base = typeof window !== "undefined" ? window.location.origin : "https://localhost";
|
|
1032
|
-
const url = new URL(targetUrl, base);
|
|
1033
|
-
const value = consent.preferences.performance || consent.preferences.advertising ? "1" : "0";
|
|
1034
|
-
url.searchParams.set("sm_consent", value);
|
|
1035
|
-
return url.toString();
|
|
1036
|
-
} catch {
|
|
1037
|
-
return targetUrl;
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
function hasConsented() {
|
|
1041
|
-
return getCookieConsent() !== null;
|
|
1042
|
-
}
|
|
1043
|
-
function isCategoryAllowed(category) {
|
|
1044
|
-
if (category === "essential") return true;
|
|
1045
|
-
const consent = getCookieConsent();
|
|
1046
|
-
if (!consent) {
|
|
1047
|
-
if (typeof navigator !== "undefined") {
|
|
1048
|
-
const nav = navigator;
|
|
1049
|
-
if (nav.globalPrivacyControl || nav.doNotTrack === "1") {
|
|
1050
|
-
return false;
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
return false;
|
|
1054
|
-
}
|
|
1055
|
-
return Boolean(consent.preferences[category]);
|
|
1056
|
-
}
|
|
1057
|
-
function setCookieConsent(preferences, source = "settings_save") {
|
|
1058
|
-
const mergedPreferences = {
|
|
1059
|
-
essential: true,
|
|
1060
|
-
performance: Boolean(preferences.performance),
|
|
1061
|
-
functional: Boolean(preferences.functional),
|
|
1062
|
-
advertising: Boolean(preferences.advertising)
|
|
1063
|
-
};
|
|
1064
|
-
let anonymous_id;
|
|
1065
|
-
if (typeof window !== "undefined") {
|
|
1066
|
-
try {
|
|
1067
|
-
anonymous_id = window.localStorage?.getItem("napsite_visitor_v1") || void 0;
|
|
1068
|
-
} catch {
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
const record = {
|
|
1072
|
-
version: 1,
|
|
1073
|
-
preferences: mergedPreferences,
|
|
1074
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1075
|
-
anonymous_id,
|
|
1076
|
-
source
|
|
1077
|
-
};
|
|
1078
|
-
memoryConsent = record;
|
|
1079
|
-
const serialized = JSON.stringify(record);
|
|
1080
|
-
writeCookie(COOKIE_CONSENT_KEY, serialized, COOKIE_CONSENT_MAX_AGE_SECONDS);
|
|
1081
|
-
writeCookie(COOKIE_CONSENT_BACKUP_KEY, serialized, COOKIE_CONSENT_MAX_AGE_SECONDS);
|
|
1082
|
-
if (typeof window !== "undefined") {
|
|
1083
|
-
try {
|
|
1084
|
-
window.localStorage?.setItem(COOKIE_CONSENT_KEY, serialized);
|
|
1085
|
-
} catch {
|
|
1086
|
-
}
|
|
1087
|
-
window.dispatchEvent(new CustomEvent(COOKIE_CONSENT_EVENT, { detail: record }));
|
|
1088
|
-
}
|
|
1089
|
-
return record;
|
|
1090
|
-
}
|
|
1091
|
-
function acceptAllCookies() {
|
|
1092
|
-
return setCookieConsent(DEFAULT_PREFERENCES_ACCEPTED, "banner_accept");
|
|
1093
|
-
}
|
|
1094
|
-
function rejectOptionalCookies() {
|
|
1095
|
-
return setCookieConsent(DEFAULT_PREFERENCES_REJECTED, "banner_reject");
|
|
1096
|
-
}
|
|
1097
|
-
function clearCookieConsent() {
|
|
1098
|
-
memoryConsent = null;
|
|
1099
|
-
if (typeof document !== "undefined") {
|
|
1100
|
-
document.cookie = `${COOKIE_CONSENT_KEY}=; Path=/; Max-Age=0; SameSite=Lax`;
|
|
1101
|
-
document.cookie = `${COOKIE_CONSENT_BACKUP_KEY}=; Path=/; Max-Age=0; SameSite=Lax`;
|
|
1102
|
-
}
|
|
1103
|
-
if (typeof window !== "undefined") {
|
|
1104
|
-
try {
|
|
1105
|
-
window.localStorage?.removeItem(COOKIE_CONSENT_KEY);
|
|
1106
|
-
} catch {
|
|
1107
|
-
}
|
|
1108
|
-
window.dispatchEvent(new CustomEvent(COOKIE_CONSENT_EVENT, { detail: null }));
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
async function recordConsentToCompliance(record, options) {
|
|
1112
|
-
if (typeof window === "undefined") return;
|
|
1113
|
-
const endpoint = options?.endpoint || "/api/compliance/consent";
|
|
1114
|
-
try {
|
|
1115
|
-
const payload = {
|
|
1116
|
-
consent_type: "cookie_policy",
|
|
1117
|
-
granted: record.preferences.performance || record.preferences.advertising,
|
|
1118
|
-
preferences: record.preferences,
|
|
1119
|
-
source: record.source,
|
|
1120
|
-
anonymous_id: record.anonymous_id,
|
|
1121
|
-
timestamp: record.timestamp,
|
|
1122
|
-
url: window.location.href,
|
|
1123
|
-
user_agent: window.navigator.userAgent
|
|
1124
|
-
};
|
|
1125
|
-
if (typeof navigator.sendBeacon === "function") {
|
|
1126
|
-
navigator.sendBeacon(endpoint, new Blob([JSON.stringify(payload)], { type: "application/json" }));
|
|
1127
|
-
} else {
|
|
1128
|
-
await fetch(endpoint, {
|
|
1129
|
-
method: "POST",
|
|
1130
|
-
headers: { "content-type": "application/json" },
|
|
1131
|
-
body: JSON.stringify(payload),
|
|
1132
|
-
keepalive: true
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
} catch {
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
897
|
function CookieConsentBanner({
|
|
1139
898
|
title = "Help Us Improve Our Website with Cookies",
|
|
1140
899
|
text,
|
|
@@ -1143,48 +902,76 @@ function CookieConsentBanner({
|
|
|
1143
902
|
publicationSlug,
|
|
1144
903
|
complianceEndpoint = "/api/compliance/consent",
|
|
1145
904
|
countryCode,
|
|
1146
|
-
forceShow = false
|
|
905
|
+
forceShow = false,
|
|
906
|
+
consentHubUrl = compliance.DEFAULT_CONSENT_HUB_URL
|
|
1147
907
|
}) {
|
|
1148
908
|
const [mounted, setMounted] = react.useState(false);
|
|
1149
909
|
const [visible, setVisible] = react.useState(false);
|
|
1150
910
|
react.useEffect(() => {
|
|
1151
911
|
setMounted(true);
|
|
1152
|
-
if (checkUrlConsentBridge()) {
|
|
912
|
+
if (compliance.checkUrlConsentBridge()) {
|
|
1153
913
|
setVisible(false);
|
|
1154
914
|
return;
|
|
1155
915
|
}
|
|
1156
|
-
if (hasConsented()) {
|
|
916
|
+
if (compliance.hasConsented()) {
|
|
1157
917
|
setVisible(false);
|
|
1158
918
|
return;
|
|
1159
919
|
}
|
|
1160
|
-
if (!forceShow && !isGeoConsentRequired(countryCode)) {
|
|
920
|
+
if (!forceShow && !compliance.isGeoConsentRequired(countryCode)) {
|
|
1161
921
|
setVisible(false);
|
|
922
|
+
void compliance.queryNetworkConsentHub(consentHubUrl, 1200).then((networkStatus) => {
|
|
923
|
+
if (networkStatus === "accepted") {
|
|
924
|
+
compliance.acceptAllCookies();
|
|
925
|
+
} else if (networkStatus === "rejected") {
|
|
926
|
+
compliance.rejectOptionalCookies();
|
|
927
|
+
}
|
|
928
|
+
});
|
|
1162
929
|
return;
|
|
1163
930
|
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
931
|
+
let cancelled = false;
|
|
932
|
+
void compliance.queryNetworkConsentHub(consentHubUrl, 1e3).then((networkStatus) => {
|
|
933
|
+
if (cancelled) return;
|
|
934
|
+
if (networkStatus === "accepted") {
|
|
935
|
+
compliance.acceptAllCookies();
|
|
936
|
+
setVisible(false);
|
|
937
|
+
} else if (networkStatus === "rejected") {
|
|
938
|
+
compliance.rejectOptionalCookies();
|
|
939
|
+
setVisible(false);
|
|
940
|
+
} else {
|
|
941
|
+
setVisible(true);
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
return () => {
|
|
945
|
+
cancelled = true;
|
|
946
|
+
};
|
|
947
|
+
}, [countryCode, forceShow, consentHubUrl]);
|
|
1167
948
|
react.useEffect(() => {
|
|
1168
949
|
const onConsentChange = () => {
|
|
1169
|
-
if (hasConsented()) {
|
|
950
|
+
if (compliance.hasConsented()) {
|
|
1170
951
|
setVisible(false);
|
|
1171
952
|
}
|
|
1172
953
|
};
|
|
1173
|
-
window.addEventListener(COOKIE_CONSENT_EVENT, onConsentChange);
|
|
1174
|
-
return () => window.removeEventListener(COOKIE_CONSENT_EVENT, onConsentChange);
|
|
954
|
+
window.addEventListener(compliance.COOKIE_CONSENT_EVENT, onConsentChange);
|
|
955
|
+
return () => window.removeEventListener(compliance.COOKIE_CONSENT_EVENT, onConsentChange);
|
|
1175
956
|
}, []);
|
|
1176
957
|
if (!mounted || !visible) return null;
|
|
1177
958
|
const handleAccept = () => {
|
|
1178
|
-
const record = acceptAllCookies();
|
|
959
|
+
const record = compliance.acceptAllCookies();
|
|
1179
960
|
setVisible(false);
|
|
1180
961
|
void recordConsentToCompliance(record, {
|
|
1181
|
-
endpoint: complianceEndpoint
|
|
962
|
+
endpoint: complianceEndpoint,
|
|
963
|
+
publicationSlug
|
|
964
|
+
});
|
|
965
|
+
compliance.setNetworkConsentHub("accepted", consentHubUrl);
|
|
1182
966
|
};
|
|
1183
967
|
const handleReject = () => {
|
|
1184
|
-
const record = rejectOptionalCookies();
|
|
968
|
+
const record = compliance.rejectOptionalCookies();
|
|
1185
969
|
setVisible(false);
|
|
1186
970
|
void recordConsentToCompliance(record, {
|
|
1187
|
-
endpoint: complianceEndpoint
|
|
971
|
+
endpoint: complianceEndpoint,
|
|
972
|
+
publicationSlug
|
|
973
|
+
});
|
|
974
|
+
compliance.setNetworkConsentHub("rejected", consentHubUrl);
|
|
1188
975
|
};
|
|
1189
976
|
const defaultText = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1190
977
|
"We use cookies and device data to analyze performance, support local sponsors, and remember your reading preferences across our news network. View",
|
|
@@ -1239,8 +1026,8 @@ function CookieSettingsView({
|
|
|
1239
1026
|
publicationSlug
|
|
1240
1027
|
}) {
|
|
1241
1028
|
const [preferences, setPreferences] = react.useState(() => {
|
|
1242
|
-
const existing = getCookieConsent();
|
|
1243
|
-
return existing ? existing.preferences : { ...DEFAULT_PREFERENCES_ACCEPTED };
|
|
1029
|
+
const existing = compliance.getCookieConsent();
|
|
1030
|
+
return existing ? existing.preferences : { ...compliance.DEFAULT_PREFERENCES_ACCEPTED };
|
|
1244
1031
|
});
|
|
1245
1032
|
const [expandedCategories, setExpandedCategories] = react.useState({
|
|
1246
1033
|
essential: false,
|
|
@@ -1251,7 +1038,7 @@ function CookieSettingsView({
|
|
|
1251
1038
|
const [saveSuccess, setSaveSuccess] = react.useState(false);
|
|
1252
1039
|
const [lastSavedTime, setLastSavedTime] = react.useState(null);
|
|
1253
1040
|
react.useEffect(() => {
|
|
1254
|
-
const existing = getCookieConsent();
|
|
1041
|
+
const existing = compliance.getCookieConsent();
|
|
1255
1042
|
if (existing) {
|
|
1256
1043
|
setPreferences(existing.preferences);
|
|
1257
1044
|
setLastSavedTime(new Date(existing.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }));
|
|
@@ -1272,29 +1059,35 @@ function CookieSettingsView({
|
|
|
1272
1059
|
}));
|
|
1273
1060
|
};
|
|
1274
1061
|
const handleSave = () => {
|
|
1275
|
-
const record = setCookieConsent(preferences, "settings_save");
|
|
1062
|
+
const record = compliance.setCookieConsent(preferences, "settings_save");
|
|
1276
1063
|
setSaveSuccess(true);
|
|
1277
1064
|
setLastSavedTime(new Date(record.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }));
|
|
1278
1065
|
void recordConsentToCompliance(record, {
|
|
1279
|
-
endpoint: complianceEndpoint
|
|
1066
|
+
endpoint: complianceEndpoint,
|
|
1067
|
+
publicationSlug
|
|
1068
|
+
});
|
|
1280
1069
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
1281
1070
|
};
|
|
1282
1071
|
const handleAcceptAll = () => {
|
|
1283
|
-
setPreferences({ ...DEFAULT_PREFERENCES_ACCEPTED });
|
|
1284
|
-
const record = setCookieConsent(DEFAULT_PREFERENCES_ACCEPTED, "settings_save");
|
|
1072
|
+
setPreferences({ ...compliance.DEFAULT_PREFERENCES_ACCEPTED });
|
|
1073
|
+
const record = compliance.setCookieConsent(compliance.DEFAULT_PREFERENCES_ACCEPTED, "settings_save");
|
|
1285
1074
|
setSaveSuccess(true);
|
|
1286
1075
|
setLastSavedTime(new Date(record.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }));
|
|
1287
1076
|
void recordConsentToCompliance(record, {
|
|
1288
|
-
endpoint: complianceEndpoint
|
|
1077
|
+
endpoint: complianceEndpoint,
|
|
1078
|
+
publicationSlug
|
|
1079
|
+
});
|
|
1289
1080
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
1290
1081
|
};
|
|
1291
1082
|
const handleRejectAll = () => {
|
|
1292
|
-
setPreferences({ ...DEFAULT_PREFERENCES_REJECTED });
|
|
1293
|
-
const record = setCookieConsent(DEFAULT_PREFERENCES_REJECTED, "settings_save");
|
|
1083
|
+
setPreferences({ ...compliance.DEFAULT_PREFERENCES_REJECTED });
|
|
1084
|
+
const record = compliance.setCookieConsent(compliance.DEFAULT_PREFERENCES_REJECTED, "settings_save");
|
|
1294
1085
|
setSaveSuccess(true);
|
|
1295
1086
|
setLastSavedTime(new Date(record.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }));
|
|
1296
1087
|
void recordConsentToCompliance(record, {
|
|
1297
|
-
endpoint: complianceEndpoint
|
|
1088
|
+
endpoint: complianceEndpoint,
|
|
1089
|
+
publicationSlug
|
|
1090
|
+
});
|
|
1298
1091
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
1299
1092
|
};
|
|
1300
1093
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sm-cookie-settings-container", children: [
|
|
@@ -1758,20 +1551,97 @@ function ThemeToggle({
|
|
|
1758
1551
|
] });
|
|
1759
1552
|
}
|
|
1760
1553
|
|
|
1554
|
+
Object.defineProperty(exports, "COOKIE_CONSENT_BACKUP_KEY", {
|
|
1555
|
+
enumerable: true,
|
|
1556
|
+
get: function () { return compliance.COOKIE_CONSENT_BACKUP_KEY; }
|
|
1557
|
+
});
|
|
1558
|
+
Object.defineProperty(exports, "COOKIE_CONSENT_EVENT", {
|
|
1559
|
+
enumerable: true,
|
|
1560
|
+
get: function () { return compliance.COOKIE_CONSENT_EVENT; }
|
|
1561
|
+
});
|
|
1562
|
+
Object.defineProperty(exports, "COOKIE_CONSENT_KEY", {
|
|
1563
|
+
enumerable: true,
|
|
1564
|
+
get: function () { return compliance.COOKIE_CONSENT_KEY; }
|
|
1565
|
+
});
|
|
1566
|
+
Object.defineProperty(exports, "COOKIE_CONSENT_MAX_AGE_SECONDS", {
|
|
1567
|
+
enumerable: true,
|
|
1568
|
+
get: function () { return compliance.COOKIE_CONSENT_MAX_AGE_SECONDS; }
|
|
1569
|
+
});
|
|
1570
|
+
Object.defineProperty(exports, "DEFAULT_CONSENT_HUB_URL", {
|
|
1571
|
+
enumerable: true,
|
|
1572
|
+
get: function () { return compliance.DEFAULT_CONSENT_HUB_URL; }
|
|
1573
|
+
});
|
|
1574
|
+
Object.defineProperty(exports, "DEFAULT_PREFERENCES_ACCEPTED", {
|
|
1575
|
+
enumerable: true,
|
|
1576
|
+
get: function () { return compliance.DEFAULT_PREFERENCES_ACCEPTED; }
|
|
1577
|
+
});
|
|
1578
|
+
Object.defineProperty(exports, "DEFAULT_PREFERENCES_REJECTED", {
|
|
1579
|
+
enumerable: true,
|
|
1580
|
+
get: function () { return compliance.DEFAULT_PREFERENCES_REJECTED; }
|
|
1581
|
+
});
|
|
1582
|
+
Object.defineProperty(exports, "EU_EEA_UK_COUNTRIES", {
|
|
1583
|
+
enumerable: true,
|
|
1584
|
+
get: function () { return compliance.EU_EEA_UK_COUNTRIES; }
|
|
1585
|
+
});
|
|
1586
|
+
Object.defineProperty(exports, "NETWORK_CONSENT_STORAGE_KEY", {
|
|
1587
|
+
enumerable: true,
|
|
1588
|
+
get: function () { return compliance.NETWORK_CONSENT_STORAGE_KEY; }
|
|
1589
|
+
});
|
|
1590
|
+
Object.defineProperty(exports, "acceptAllCookies", {
|
|
1591
|
+
enumerable: true,
|
|
1592
|
+
get: function () { return compliance.acceptAllCookies; }
|
|
1593
|
+
});
|
|
1594
|
+
Object.defineProperty(exports, "checkUrlConsentBridge", {
|
|
1595
|
+
enumerable: true,
|
|
1596
|
+
get: function () { return compliance.checkUrlConsentBridge; }
|
|
1597
|
+
});
|
|
1598
|
+
Object.defineProperty(exports, "clearCookieConsent", {
|
|
1599
|
+
enumerable: true,
|
|
1600
|
+
get: function () { return compliance.clearCookieConsent; }
|
|
1601
|
+
});
|
|
1602
|
+
Object.defineProperty(exports, "decorateNetworkUrl", {
|
|
1603
|
+
enumerable: true,
|
|
1604
|
+
get: function () { return compliance.decorateNetworkUrl; }
|
|
1605
|
+
});
|
|
1606
|
+
Object.defineProperty(exports, "getCookieConsent", {
|
|
1607
|
+
enumerable: true,
|
|
1608
|
+
get: function () { return compliance.getCookieConsent; }
|
|
1609
|
+
});
|
|
1610
|
+
Object.defineProperty(exports, "hasConsented", {
|
|
1611
|
+
enumerable: true,
|
|
1612
|
+
get: function () { return compliance.hasConsented; }
|
|
1613
|
+
});
|
|
1614
|
+
Object.defineProperty(exports, "isCategoryAllowed", {
|
|
1615
|
+
enumerable: true,
|
|
1616
|
+
get: function () { return compliance.isCategoryAllowed; }
|
|
1617
|
+
});
|
|
1618
|
+
Object.defineProperty(exports, "isGeoConsentRequired", {
|
|
1619
|
+
enumerable: true,
|
|
1620
|
+
get: function () { return compliance.isGeoConsentRequired; }
|
|
1621
|
+
});
|
|
1622
|
+
Object.defineProperty(exports, "queryNetworkConsentHub", {
|
|
1623
|
+
enumerable: true,
|
|
1624
|
+
get: function () { return compliance.queryNetworkConsentHub; }
|
|
1625
|
+
});
|
|
1626
|
+
Object.defineProperty(exports, "rejectOptionalCookies", {
|
|
1627
|
+
enumerable: true,
|
|
1628
|
+
get: function () { return compliance.rejectOptionalCookies; }
|
|
1629
|
+
});
|
|
1630
|
+
Object.defineProperty(exports, "setCookieConsent", {
|
|
1631
|
+
enumerable: true,
|
|
1632
|
+
get: function () { return compliance.setCookieConsent; }
|
|
1633
|
+
});
|
|
1634
|
+
Object.defineProperty(exports, "setNetworkConsentHub", {
|
|
1635
|
+
enumerable: true,
|
|
1636
|
+
get: function () { return compliance.setNetworkConsentHub; }
|
|
1637
|
+
});
|
|
1761
1638
|
exports.ANALYTICS_COOKIE = ANALYTICS_COOKIE;
|
|
1762
1639
|
exports.ANALYTICS_VERSION = ANALYTICS_VERSION;
|
|
1763
1640
|
exports.BROADSHEET_THEME = BROADSHEET_THEME;
|
|
1764
1641
|
exports.CLASSIFIED_CATEGORIES = CLASSIFIED_CATEGORIES;
|
|
1765
1642
|
exports.COOKIE_CATEGORIES = COOKIE_CATEGORIES;
|
|
1766
|
-
exports.COOKIE_CONSENT_BACKUP_KEY = COOKIE_CONSENT_BACKUP_KEY;
|
|
1767
|
-
exports.COOKIE_CONSENT_EVENT = COOKIE_CONSENT_EVENT;
|
|
1768
|
-
exports.COOKIE_CONSENT_KEY = COOKIE_CONSENT_KEY;
|
|
1769
|
-
exports.COOKIE_CONSENT_MAX_AGE_SECONDS = COOKIE_CONSENT_MAX_AGE_SECONDS;
|
|
1770
1643
|
exports.CookieConsentBanner = CookieConsentBanner;
|
|
1771
1644
|
exports.CookieSettingsView = CookieSettingsView;
|
|
1772
|
-
exports.DEFAULT_PREFERENCES_ACCEPTED = DEFAULT_PREFERENCES_ACCEPTED;
|
|
1773
|
-
exports.DEFAULT_PREFERENCES_REJECTED = DEFAULT_PREFERENCES_REJECTED;
|
|
1774
|
-
exports.EU_EEA_UK_COUNTRIES = EU_EEA_UK_COUNTRIES;
|
|
1775
1645
|
exports.EVENTS = EVENTS;
|
|
1776
1646
|
exports.FEATURE_NAMES = FEATURE_NAMES;
|
|
1777
1647
|
exports.JOB_EMPLOYMENT_TYPES = JOB_EMPLOYMENT_TYPES;
|
|
@@ -1787,7 +1657,6 @@ exports.THEME_STORAGE_KEY = THEME_STORAGE_KEY;
|
|
|
1787
1657
|
exports.ThemeToggle = ThemeToggle;
|
|
1788
1658
|
exports.UTM_FIELDS = UTM_FIELDS;
|
|
1789
1659
|
exports.UUID = UUID;
|
|
1790
|
-
exports.acceptAllCookies = acceptAllCookies;
|
|
1791
1660
|
exports.acceptRemoteRecord = acceptRemoteRecord;
|
|
1792
1661
|
exports.acceptSnapshot = acceptSnapshot;
|
|
1793
1662
|
exports.activeNearby = activeNearby;
|
|
@@ -1801,17 +1670,14 @@ exports.attribution = attribution;
|
|
|
1801
1670
|
exports.briefSummary = briefSummary;
|
|
1802
1671
|
exports.canHostMeetup = canHostMeetup;
|
|
1803
1672
|
exports.categoryLabel = categoryLabel;
|
|
1804
|
-
exports.checkUrlConsentBridge = checkUrlConsentBridge;
|
|
1805
1673
|
exports.classifiedPath = classifiedPath;
|
|
1806
1674
|
exports.classifiedSearchPath = classifiedSearchPath;
|
|
1807
|
-
exports.clearCookieConsent = clearCookieConsent;
|
|
1808
1675
|
exports.clearTheme = clearTheme;
|
|
1809
1676
|
exports.clipChars = clipChars;
|
|
1810
1677
|
exports.composeEdition = composeEdition;
|
|
1811
1678
|
exports.dealDollars = dealDollars;
|
|
1812
1679
|
exports.dealGoPath = dealGoPath;
|
|
1813
1680
|
exports.dealsFeedPath = dealsFeedPath;
|
|
1814
|
-
exports.decorateNetworkUrl = decorateNetworkUrl;
|
|
1815
1681
|
exports.defaultRevalidateTargets = defaultRevalidateTargets;
|
|
1816
1682
|
exports.definePublication = definePublication;
|
|
1817
1683
|
exports.displayHeadline = displayHeadline;
|
|
@@ -1822,16 +1688,12 @@ exports.featureEnabled = featureEnabled;
|
|
|
1822
1688
|
exports.feedCacheKey = feedCacheKey;
|
|
1823
1689
|
exports.feedCacheOptions = feedCacheOptions;
|
|
1824
1690
|
exports.filterNews = filterNews;
|
|
1825
|
-
exports.getCookieConsent = getCookieConsent;
|
|
1826
1691
|
exports.getStoredTheme = getStoredTheme;
|
|
1827
1692
|
exports.getSystemTheme = getSystemTheme;
|
|
1828
|
-
exports.hasConsented = hasConsented;
|
|
1829
1693
|
exports.inventoryCacheOptions = inventoryCacheOptions;
|
|
1830
1694
|
exports.isAdult = isAdult;
|
|
1831
|
-
exports.isCategoryAllowed = isCategoryAllowed;
|
|
1832
1695
|
exports.isClassifiedCategory = isClassifiedCategory;
|
|
1833
1696
|
exports.isEmploymentType = isEmploymentType;
|
|
1834
|
-
exports.isGeoConsentRequired = isGeoConsentRequired;
|
|
1835
1697
|
exports.jobEmployerBody = jobEmployerBody;
|
|
1836
1698
|
exports.jobOpeningBody = jobOpeningBody;
|
|
1837
1699
|
exports.jobPostingBody = jobPostingBody;
|
|
@@ -1854,7 +1716,6 @@ exports.publicationMeta = publicationMeta;
|
|
|
1854
1716
|
exports.publicationRecord = publicationRecord;
|
|
1855
1717
|
exports.recordConsentToCompliance = recordConsentToCompliance;
|
|
1856
1718
|
exports.referralCode = referralCode;
|
|
1857
|
-
exports.rejectOptionalCookies = rejectOptionalCookies;
|
|
1858
1719
|
exports.resolveCoupon = resolveCoupon;
|
|
1859
1720
|
exports.resolveEffectiveTheme = resolveEffectiveTheme;
|
|
1860
1721
|
exports.resolveLayout = resolveLayout;
|
|
@@ -1864,7 +1725,6 @@ exports.secretsMatch = secretsMatch;
|
|
|
1864
1725
|
exports.sectionDefinition = sectionDefinition;
|
|
1865
1726
|
exports.sectionId = sectionId;
|
|
1866
1727
|
exports.sectionPath = sectionPath;
|
|
1867
|
-
exports.setCookieConsent = setCookieConsent;
|
|
1868
1728
|
exports.setTheme = setTheme;
|
|
1869
1729
|
exports.shortDeck = shortDeck;
|
|
1870
1730
|
exports.shortText = shortText;
|