@financial-times/cmp-client 4.0.0 → 4.1.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/README.md +2 -0
- package/dist/index.cjs +13 -3
- package/dist/index.js +13 -3
- package/dist/scripts/cmp-static.js +1 -1
- package/dist/src/lib/constants.d.ts +2 -2
- package/dist/src/lib/properties.d.ts +11 -0
- package/dist/src/lib/properties.d.ts.map +1 -1
- package/dist/src/utils/url.d.ts +10 -0
- package/dist/src/utils/url.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -266,6 +266,8 @@ npm run dev -w src/examples/cmp-client
|
|
|
266
266
|
|
|
267
267
|
Visit https://localhost:5173 (see setup details in `src/examples/cmp-client`) to interact with the banner and see how cookies are set accordingly
|
|
268
268
|
|
|
269
|
+
> For resetting your consent cookies/record and other common troubleshooting issues, see the [Troubleshooting Guide](./docs/troubleshooting.md)
|
|
270
|
+
|
|
269
271
|
#### Resources
|
|
270
272
|
|
|
271
273
|
For a detailed deep-dive (internal only) of how the static deployment process works, the design is [documented here](https://financialtimes.atlassian.net/wiki/spaces/ADS/pages/8293711881/How+the+CMP+static+loader+works). If you need to be granted access, please reach out to the Ads & Privacy team.
|
package/dist/index.cjs
CHANGED
|
@@ -151,6 +151,15 @@ const MM_IGNITES_EUROPE = {
|
|
|
151
151
|
rootDomain: "igniteseurope.com"
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
+
const SP_MANDATE_WIRE = {
|
|
155
|
+
...defaults,
|
|
156
|
+
accountId: 1906,
|
|
157
|
+
baseEndpoint: "https://consent-manager.mandatewire.com",
|
|
158
|
+
propertyId: 35490,
|
|
159
|
+
_clientOptions: {
|
|
160
|
+
rootDomain: "mandatewire.com"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
154
163
|
const properties = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
155
164
|
__proto__: null,
|
|
156
165
|
FT_DOTCOM_PROD,
|
|
@@ -161,6 +170,7 @@ const properties = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
161
170
|
SP_FDI_INTELLIGENCE,
|
|
162
171
|
SP_FT_ADVISER,
|
|
163
172
|
SP_INVESTORS_CHRONICLE,
|
|
173
|
+
SP_MANDATE_WIRE,
|
|
164
174
|
SP_PWMNET,
|
|
165
175
|
SP_SUSTAINABLE_VIEWS,
|
|
166
176
|
SP_THE_BANKER
|
|
@@ -285,7 +295,7 @@ const iabCustomCategories = {
|
|
|
285
295
|
specialFeatures: []
|
|
286
296
|
},
|
|
287
297
|
demographicAds: {
|
|
288
|
-
purposes: [
|
|
298
|
+
purposes: [7, 9, 10],
|
|
289
299
|
iabVendors: [],
|
|
290
300
|
customVendors: [],
|
|
291
301
|
specialFeatures: []
|
|
@@ -303,7 +313,7 @@ const iabCustomCategories = {
|
|
|
303
313
|
specialFeatures: []
|
|
304
314
|
},
|
|
305
315
|
personalisedMarketing: {
|
|
306
|
-
purposes: [
|
|
316
|
+
purposes: [2, 7, 8, 9, 10],
|
|
307
317
|
iabVendors: [],
|
|
308
318
|
customVendors: [],
|
|
309
319
|
specialFeatures: []
|
|
@@ -640,7 +650,7 @@ function setupPmTracking(trackingProps, cmpBaseEndpoint) {
|
|
|
640
650
|
false
|
|
641
651
|
);
|
|
642
652
|
}
|
|
643
|
-
const version = "4.
|
|
653
|
+
const version = "4.1.0";
|
|
644
654
|
async function initSourcepointCmp({
|
|
645
655
|
propertyConfig = FT_DOTCOM_PROD,
|
|
646
656
|
userId,
|
package/dist/index.js
CHANGED
|
@@ -149,6 +149,15 @@ const MM_IGNITES_EUROPE = {
|
|
|
149
149
|
rootDomain: "igniteseurope.com"
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
|
+
const SP_MANDATE_WIRE = {
|
|
153
|
+
...defaults,
|
|
154
|
+
accountId: 1906,
|
|
155
|
+
baseEndpoint: "https://consent-manager.mandatewire.com",
|
|
156
|
+
propertyId: 35490,
|
|
157
|
+
_clientOptions: {
|
|
158
|
+
rootDomain: "mandatewire.com"
|
|
159
|
+
}
|
|
160
|
+
};
|
|
152
161
|
const properties = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
153
162
|
__proto__: null,
|
|
154
163
|
FT_DOTCOM_PROD,
|
|
@@ -159,6 +168,7 @@ const properties = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
159
168
|
SP_FDI_INTELLIGENCE,
|
|
160
169
|
SP_FT_ADVISER,
|
|
161
170
|
SP_INVESTORS_CHRONICLE,
|
|
171
|
+
SP_MANDATE_WIRE,
|
|
162
172
|
SP_PWMNET,
|
|
163
173
|
SP_SUSTAINABLE_VIEWS,
|
|
164
174
|
SP_THE_BANKER
|
|
@@ -283,7 +293,7 @@ const iabCustomCategories = {
|
|
|
283
293
|
specialFeatures: []
|
|
284
294
|
},
|
|
285
295
|
demographicAds: {
|
|
286
|
-
purposes: [
|
|
296
|
+
purposes: [7, 9, 10],
|
|
287
297
|
iabVendors: [],
|
|
288
298
|
customVendors: [],
|
|
289
299
|
specialFeatures: []
|
|
@@ -301,7 +311,7 @@ const iabCustomCategories = {
|
|
|
301
311
|
specialFeatures: []
|
|
302
312
|
},
|
|
303
313
|
personalisedMarketing: {
|
|
304
|
-
purposes: [
|
|
314
|
+
purposes: [2, 7, 8, 9, 10],
|
|
305
315
|
iabVendors: [],
|
|
306
316
|
customVendors: [],
|
|
307
317
|
specialFeatures: []
|
|
@@ -638,7 +648,7 @@ function setupPmTracking(trackingProps, cmpBaseEndpoint) {
|
|
|
638
648
|
false
|
|
639
649
|
);
|
|
640
650
|
}
|
|
641
|
-
const version = "4.
|
|
651
|
+
const version = "4.1.0";
|
|
642
652
|
async function initSourcepointCmp({
|
|
643
653
|
propertyConfig = FT_DOTCOM_PROD,
|
|
644
654
|
userId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";var T,k;const N=(e,{credentials:t="omit"}={})=>fetch(`https://session-next.ft.com${e}`,{credentials:t,useCorsProxy:!0}).then(n=>n.ok?n.json():n.text().then(o=>{throw new Error(`Next session responded with "${o}" (${n.status})`)})).catch(n=>{document.body.dispatchEvent(new CustomEvent("oErrors.log",{bubbles:!0,detail:{error:n,info:{component:"next-session-client"}}}))});let l={};const g=(e,t)=>{if(typeof e=="object"){l=e;return}if(typeof e=="string"&&typeof t=="string"){l[e]=t;return}if(typeof e=="string"&&typeof t>"u")return l[e]||null;if(typeof e>"u"&&typeof t>"u")return l;throw new Error("Invalid arguments")};g.clear=()=>{l={}};const f={},L=()=>{const[,e]=/FTSession_s=([^;]+)/.exec(document.cookie)||[];return e},P=()=>{const e=g("uuid");if(e)return Promise.resolve({uuid:e});const t=L();return t?(f.uuid||(f.uuid=N(`/sessions/s/${t}`).then(({uuid:n}={})=>(delete f.uuid,n&&g("uuid",n),{uuid:n}))),f.uuid):Promise.resolve({uuid:void 0})},v="sourcepoint-cmp",M="FTPINK",A="FTConsent",R="sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk",D=".ft.com",F="https://consent.ft.com",I={permutiveAds:{purposes:[2,4,8,9],iabVendors:[361],customVendors:[],specialFeatures:[]},demographicAds:{purposes:[3,4,7,9,10],iabVendors:[],customVendors:[],specialFeatures:[]},behaviouralAds:{purposes:[2,4,8,9],iabVendors:[],customVendors:[],specialFeatures:[]},programmaticAds:{purposes:[2],iabVendors:[],customVendors:[],specialFeatures:[]},personalisedMarketing:{purposes:[1,4,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]}},E=Object.keys(I),u={joinHref:!0,gdpr:{},ccpa:{}},w={...u,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyHref:"https://local.ft.com",_clientOptions:{privacyManagerId:827767,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies"}},y={...u,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyId:31642,_clientOptions:{privacyManagerId:827767,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com"}},V={...u,accountId:1906,baseEndpoint:"https://consent-manager.pwmnet.com",propertyId:33414,_clientOptions:{rootDomain:"pwmnet.com"}},j={...u,accountId:1906,baseEndpoint:"https://consent-manager.fdiintelligence.com",propertyId:34061,_clientOptions:{rootDomain:"fdiintelligence.com"}},H={...u,accountId:1906,baseEndpoint:"https://consent-manager.thebanker.com",propertyId:34060,_clientOptions:{rootDomain:"thebanker.com"}},U={...u,accountId:1906,baseEndpoint:"https://consent-manager.bankingriskandregulation.com",propertyId:34059,_clientOptions:{rootDomain:"bankingriskandregulation.com"}},x={...u,accountId:1906,baseEndpoint:"https://consent-manager.sustainableviews.com",propertyId:34058,_clientOptions:{rootDomain:"sustainableviews.com"}},q={...u,accountId:1906,baseEndpoint:"https://consent-manager.ftadviser.com",propertyId:33416,_clientOptions:{rootDomain:"ftadviser.com"}},$={...u,accountId:1906,baseEndpoint:"https://consent-manager.investorschronicle.co.uk",propertyId:33415,_clientOptions:{rootDomain:"investorschronicle.co.uk"}},G={...u,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33947,_clientOptions:{rootDomain:"ignitesasia.com"}},K={...u,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33946,_clientOptions:{rootDomain:"igniteseurope.com"}},W=Object.freeze(Object.defineProperty({__proto__:null,FT_DOTCOM_PROD:y,FT_DOTCOM_TEST:w,MM_IGNITES_ASIA:G,MM_IGNITES_EUROPE:K,SP_BANKING_RR:U,SP_FDI_INTELLIGENCE:j,SP_FT_ADVISER:q,SP_INVESTORS_CHRONICLE:$,SP_PWMNET:V,SP_SUSTAINABLE_VIEWS:x,SP_THE_BANKER:H},Symbol.toStringTag,{value:"Module"}));function O(e,t){const n=document.createElement("script");return n.dataset.cmpScript=e,n.innerHTML=t,n}function B(e){const t=document.createElement("script");return t.src=e,t}const J={cmpFrames:"https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"},S={tcfStub:'"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",r.title = "__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();',uspStub:'"use strict";(function () { var e = false; var c = window; var t = document; function r() { if (!c.frames["__uspapiLocator"]) { if (t.body) { var a = t.body; var e = t.createElement("iframe"); e.style.cssText = "display:none"; e.name = "__uspapiLocator"; e.title = "__uspapiLocator";a.appendChild(e) } else { setTimeout(r, 5) } } } r(); function p() { var a = arguments; __uspapi.a = __uspapi.a || []; if (!a.length) { return __uspapi.a } else if (a[0] === "ping") { a[2]({ gdprAppliesGlobally: e, cmpLoaded: false }, true) } else { __uspapi.a.push([].slice.apply(a)) } } function l(t) { var r = typeof t.data === "string"; try { var a = r ? JSON.parse(t.data) : t.data; if (a.__cmpCall) { var n = a.__cmpCall; c.__uspapi(n.command, n.parameter, function (a, e) { var c = { __cmpReturn: { returnValue: a, success: e, callId: n.callId } }; t.source.postMessage(r ? JSON.stringify(c) : c, "*") }) } } catch (a) { } } if (typeof __uspapi !== "function") { c.__uspapi = p; __uspapi.msgHandler = l; c.addEventListener("message", l, false) } })();'};function X(){const e=document.createDocumentFragment();return e.appendChild(O("tcf",S.tcfStub)),e.appendChild(O("usp",S.uspStub)),e.appendChild(B(J.cmpFrames)),e}function Y(e){const{_clientOptions:t,...n}=e;window._sp_={config:n},window._sp_queue??(window._sp_queue=[]),document.head.appendChild(X())}function z(e,t,{formOfWordsId:n,cookieDomain:o}){const c=Object.keys(e).reduce((r,p)=>(r[p]={onsite:{status:e[p],lbi:!1,source:v,fow:n}},r),{});return t?{setConsentCookie:!0,formOfWordsId:n,consentSource:v,cookieDomain:o,data:c}:{data:c,cookieDomain:o}}function Z(e,{purpose:t,vendor:n,specialFeatureOptins:o}){const s=I[e],c=s.purposes.every(i=>(t==null?void 0:t.consents[i])||(t==null?void 0:t.legitimateInterests[i])),r=s.iabVendors.every(i=>(n==null?void 0:n.consents[i])||(n==null?void 0:n.legitimateInterests[i])),p=s.specialFeatures.every(i=>(o==null?void 0:o[i])===!0);return c&&r&&p}function Q(e){const t=(e==null?void 0:e[2])==="N",n={};for(const o of E)n[o]=t;return n}async function ee(){const e=await new Promise((n,o)=>{var s;try{(s=window.__tcfapi)==null||s.call(window,"addEventListener",2,n)}catch(c){o(c)}}),t={};for(const n of E)t[n]=Z(n,e);return t}async function te(e,t){return e==="ccpa"?Q(t):await ee()}function ne(){const t=Object.fromEntries(document.cookie.split("; ").map(o=>o.split("=")))[A];if(!t)return{};const n=decodeURIComponent(t);return Object.fromEntries(n.split(",").map(o=>{const[s,c]=o.split(":");return[s,c==="on"]}))}function oe(e,t){return Object.keys(e).some(o=>{const s=`${o.toLowerCase()}Onsite`;return e[o]!==t[s]})}function se({userId:e,useConsentStore:t}){return!!e&&t===!0}function ce(e,t){return e?`${t.consentProxyHost}/__consent/consent-record/${M}/${t.userId}`:`${t.consentProxyHost}/__consent/consent-record-cookie?cookieDomain=${t.cookieDomain}`}async function re(e,t){try{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"include"});n.ok||console.error("Unable to save consent preferences",n.status)}catch(n){console.error("An error occurred while saving consent",n)}}function ae(e){return async function(n,o,s,c){if(e.disableFTCookies)return;const r=c.applies?n:"gdpr";if(r!==n||!s)return;const p=await te(r,s);if(!oe(p,ne()))return;const a=se(e),_=ce(a,e),Oe=z(p,a,e);await re(_,Oe),document.dispatchEvent(new CustomEvent("oCookieMessage.act",{bubbles:!0}))}}const b="cookie-message",ie="manage-cookies";let h=Object.freeze({activeComponent:b,messageId:0,privacyManagerId:0});function ue(e){return typeof e=="object"&&e!==null&&e.constructor===Object&&Object.prototype.toString.call(e)==="[object Object]"}const pe=()=>({...h}),C=e=>{if(!ue(e)){console.error("Invalid state changes");return}h={...h,...e}},de=["adsDisableInternalCMP","pwm.cmp","messageSlotBottom"];function le(e,t){const n=fe(e.flags);window._sp_queue=window._sp_queue??[],window._sp_queue.push(()=>{var o,s;for(const[c,r]of Object.entries(_e))(s=(o=window._sp_).addEventListener)==null||s.call(o,c,r({...e,flags:n}))}),ge({...e,flags:n},t)}function fe(e){const t={};return typeof e=="object"&&de.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t}function me(e){if(!e)return;const t=document.body,n=new CustomEvent("oTracking.event",{bubbles:!0,cancelable:!0,detail:e.detail});t.dispatchEvent(n)}function m({trackingProps:e,action:t,triggerAction:n}){let o;const s=pe(),{product:c,app:r,flags:p}=e;s.activeComponent===b?o=s.messageId:o=s.privacyManagerId;const i={detail:{component:{id:o,name:s.activeComponent,type:"overlay",subtype:"cmp"},category:"component",action:t,...n&&{trigger_action:n},...c&&{product:c},...r&&{app:r},custom:[{cookie_toggle_flag:p}],url:window.document.location.href||null}};me(i)}const _e={onMessageChoiceSelect:e=>(t,n,o)=>{const c={11:"accept_all",12:"manage_cookies",13:"reject_all"}[o];c&&m({trackingProps:e,action:"click",triggerAction:c})},onMessageReady:e=>()=>{m({trackingProps:e,action:"view"})},onMessageReceiveData:()=>(e,t)=>{const{messageId:n}=t;n&&C({messageId:n})},onError:e=>(t,n)=>{m({trackingProps:e,action:"error",triggerAction:n})},onPMCancel:()=>()=>{C({activeComponent:b})}};function ge(e,t){window.addEventListener("message",function(n){if(n.origin!==t)return;const o={1:"save_and_close",11:"accept_all",13:"reject_all"},{data:{fromPM:s,actionType:c,messageId:r="0"}={}}=n;s&&(+r&&C({activeComponent:ie,privacyManagerId:+r}),!(!c||!o[c])&&m({trackingProps:e,action:"click",triggerAction:o[c]}))},!1)}const ye="4.0.0";async function be({propertyConfig:e=y,userId:t,useFTSession:n=!0,consentProxyHost:o=F,cookieDomain:s=D,formOfWordsId:c=R,useConsentStore:r=!0,trackingContext:p={},disableFTCookies:i=!1}={}){if(typeof window>"u"){console.error("The CMP client can only be initialised in a browser context");return}if(window.FT_CMP_CLIENT_VERSION=ye,!t&&n)try{const a=await P();t=a==null?void 0:a.uuid}catch(a){console.error(a)}if(!(e!=null&&e.accountId))throw new Error("Please pass a valid property config");t&&(e.authId=t),e.events&&(console.warn("[cmp-client] Passing an events map in the config is not supported and will be ignored. Please use window._sp_.addEventListener() to listen for events"),delete e.events),Y(e),window._sp_queue.push(()=>{var a,_;(_=(a=window._sp_)==null?void 0:a.addEventListener)==null||_.call(a,"onConsentReady",ae({userId:t,consentProxyHost:o,cookieDomain:s,formOfWordsId:c,useConsentStore:r,disableFTCookies:i}))}),le(p,e.baseEndpoint)}const he=new Promise(e=>{if(typeof document>"u")return e();const t=()=>["interactive","complete"].includes(document.readyState);function n(){t()&&(document.removeEventListener("readystatechange",n),e())}if(t())return e();document.addEventListener("readystatechange",n)});function Ce(e,t){const{privacyManagerId:n,manageCookiesLinkOverride:o}=e??{};if(!n||!o)return console.warn("_clientOptions is missing privacyManagerId or manageCookiesLinkOverride");const s=document.querySelectorAll(`a[href*="${o}"]`);for(const c of s)c.addEventListener("click",r=>{r.preventDefault(),t==null||t(+n)})}function ve({_clientOptions:e}=y){he.then(()=>{window._sp_queue??(window._sp_queue=[]),window._sp_queue.push(()=>{var t,n;Ce(e,(n=(t=window._sp_)==null?void 0:t.gdpr)==null?void 0:n.loadPrivacyManagerModal)})})}function Ie(e,t){if(!t||Number.isFinite(parseFloat(t))||!e.endsWith(t))return!1;const n=e.indexOf(t),o=e[n-1];return o==="."||o===void 0}function Ee(e){if(!e)throw new Error("Invalid hostname provided");let n=Object.values(W).find(o=>{var c;const s=(c=o._clientOptions)==null?void 0:c.rootDomain;return s&&Ie(e,s)});return n??(n=w),n}const we=new URL(window.location.href).hostname,d=Ee(we);be({propertyConfig:d}),(T=d==null?void 0:d._clientOptions)!=null&&T.privacyManagerId&&((k=d==null?void 0:d._clientOptions)!=null&&k.manageCookiesLinkOverride)&&ve(d)})();
|
|
1
|
+
(function(){"use strict";var T,k;const N=(e,{credentials:t="omit"}={})=>fetch(`https://session-next.ft.com${e}`,{credentials:t,useCorsProxy:!0}).then(n=>n.ok?n.json():n.text().then(o=>{throw new Error(`Next session responded with "${o}" (${n.status})`)})).catch(n=>{document.body.dispatchEvent(new CustomEvent("oErrors.log",{bubbles:!0,detail:{error:n,info:{component:"next-session-client"}}}))});let l={};const g=(e,t)=>{if(typeof e=="object"){l=e;return}if(typeof e=="string"&&typeof t=="string"){l[e]=t;return}if(typeof e=="string"&&typeof t>"u")return l[e]||null;if(typeof e>"u"&&typeof t>"u")return l;throw new Error("Invalid arguments")};g.clear=()=>{l={}};const f={},P=()=>{const[,e]=/FTSession_s=([^;]+)/.exec(document.cookie)||[];return e},L=()=>{const e=g("uuid");if(e)return Promise.resolve({uuid:e});const t=P();return t?(f.uuid||(f.uuid=N(`/sessions/s/${t}`).then(({uuid:n}={})=>(delete f.uuid,n&&g("uuid",n),{uuid:n}))),f.uuid):Promise.resolve({uuid:void 0})},I="sourcepoint-cmp",M="FTPINK",A="FTConsent",D="sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk",R=".ft.com",F="https://consent.ft.com",v={permutiveAds:{purposes:[2,4,8,9],iabVendors:[361],customVendors:[],specialFeatures:[]},demographicAds:{purposes:[7,9,10],iabVendors:[],customVendors:[],specialFeatures:[]},behaviouralAds:{purposes:[2,4,8,9],iabVendors:[],customVendors:[],specialFeatures:[]},programmaticAds:{purposes:[2],iabVendors:[],customVendors:[],specialFeatures:[]},personalisedMarketing:{purposes:[2,7,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]}},E=Object.keys(v),i={joinHref:!0,gdpr:{},ccpa:{}},w={...i,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyHref:"https://local.ft.com",_clientOptions:{privacyManagerId:827767,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies"}},y={...i,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyId:31642,_clientOptions:{privacyManagerId:827767,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com"}},V={...i,accountId:1906,baseEndpoint:"https://consent-manager.pwmnet.com",propertyId:33414,_clientOptions:{rootDomain:"pwmnet.com"}},j={...i,accountId:1906,baseEndpoint:"https://consent-manager.fdiintelligence.com",propertyId:34061,_clientOptions:{rootDomain:"fdiintelligence.com"}},H={...i,accountId:1906,baseEndpoint:"https://consent-manager.thebanker.com",propertyId:34060,_clientOptions:{rootDomain:"thebanker.com"}},U={...i,accountId:1906,baseEndpoint:"https://consent-manager.bankingriskandregulation.com",propertyId:34059,_clientOptions:{rootDomain:"bankingriskandregulation.com"}},x={...i,accountId:1906,baseEndpoint:"https://consent-manager.sustainableviews.com",propertyId:34058,_clientOptions:{rootDomain:"sustainableviews.com"}},q={...i,accountId:1906,baseEndpoint:"https://consent-manager.ftadviser.com",propertyId:33416,_clientOptions:{rootDomain:"ftadviser.com"}},$={...i,accountId:1906,baseEndpoint:"https://consent-manager.investorschronicle.co.uk",propertyId:33415,_clientOptions:{rootDomain:"investorschronicle.co.uk"}},G={...i,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33947,_clientOptions:{rootDomain:"ignitesasia.com"}},W={...i,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33946,_clientOptions:{rootDomain:"igniteseurope.com"}},K={...i,accountId:1906,baseEndpoint:"https://consent-manager.mandatewire.com",propertyId:35490,_clientOptions:{rootDomain:"mandatewire.com"}},B=Object.freeze(Object.defineProperty({__proto__:null,FT_DOTCOM_PROD:y,FT_DOTCOM_TEST:w,MM_IGNITES_ASIA:G,MM_IGNITES_EUROPE:W,SP_BANKING_RR:U,SP_FDI_INTELLIGENCE:j,SP_FT_ADVISER:q,SP_INVESTORS_CHRONICLE:$,SP_MANDATE_WIRE:K,SP_PWMNET:V,SP_SUSTAINABLE_VIEWS:x,SP_THE_BANKER:H},Symbol.toStringTag,{value:"Module"}));function O(e,t){const n=document.createElement("script");return n.dataset.cmpScript=e,n.innerHTML=t,n}function J(e){const t=document.createElement("script");return t.src=e,t}const X={cmpFrames:"https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"},S={tcfStub:'"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",r.title = "__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();',uspStub:'"use strict";(function () { var e = false; var c = window; var t = document; function r() { if (!c.frames["__uspapiLocator"]) { if (t.body) { var a = t.body; var e = t.createElement("iframe"); e.style.cssText = "display:none"; e.name = "__uspapiLocator"; e.title = "__uspapiLocator";a.appendChild(e) } else { setTimeout(r, 5) } } } r(); function p() { var a = arguments; __uspapi.a = __uspapi.a || []; if (!a.length) { return __uspapi.a } else if (a[0] === "ping") { a[2]({ gdprAppliesGlobally: e, cmpLoaded: false }, true) } else { __uspapi.a.push([].slice.apply(a)) } } function l(t) { var r = typeof t.data === "string"; try { var a = r ? JSON.parse(t.data) : t.data; if (a.__cmpCall) { var n = a.__cmpCall; c.__uspapi(n.command, n.parameter, function (a, e) { var c = { __cmpReturn: { returnValue: a, success: e, callId: n.callId } }; t.source.postMessage(r ? JSON.stringify(c) : c, "*") }) } } catch (a) { } } if (typeof __uspapi !== "function") { c.__uspapi = p; __uspapi.msgHandler = l; c.addEventListener("message", l, false) } })();'};function Y(){const e=document.createDocumentFragment();return e.appendChild(O("tcf",S.tcfStub)),e.appendChild(O("usp",S.uspStub)),e.appendChild(J(X.cmpFrames)),e}function z(e){const{_clientOptions:t,...n}=e;window._sp_={config:n},window._sp_queue??(window._sp_queue=[]),document.head.appendChild(Y())}function Z(e,t,{formOfWordsId:n,cookieDomain:o}){const c=Object.keys(e).reduce((r,p)=>(r[p]={onsite:{status:e[p],lbi:!1,source:I,fow:n}},r),{});return t?{setConsentCookie:!0,formOfWordsId:n,consentSource:I,cookieDomain:o,data:c}:{data:c,cookieDomain:o}}function Q(e,{purpose:t,vendor:n,specialFeatureOptins:o}){const s=v[e],c=s.purposes.every(u=>(t==null?void 0:t.consents[u])||(t==null?void 0:t.legitimateInterests[u])),r=s.iabVendors.every(u=>(n==null?void 0:n.consents[u])||(n==null?void 0:n.legitimateInterests[u])),p=s.specialFeatures.every(u=>(o==null?void 0:o[u])===!0);return c&&r&&p}function ee(e){const t=(e==null?void 0:e[2])==="N",n={};for(const o of E)n[o]=t;return n}async function te(){const e=await new Promise((n,o)=>{var s;try{(s=window.__tcfapi)==null||s.call(window,"addEventListener",2,n)}catch(c){o(c)}}),t={};for(const n of E)t[n]=Q(n,e);return t}async function ne(e,t){return e==="ccpa"?ee(t):await te()}function oe(){const t=Object.fromEntries(document.cookie.split("; ").map(o=>o.split("=")))[A];if(!t)return{};const n=decodeURIComponent(t);return Object.fromEntries(n.split(",").map(o=>{const[s,c]=o.split(":");return[s,c==="on"]}))}function se(e,t){return Object.keys(e).some(o=>{const s=`${o.toLowerCase()}Onsite`;return e[o]!==t[s]})}function ce({userId:e,useConsentStore:t}){return!!e&&t===!0}function re(e,t){return e?`${t.consentProxyHost}/__consent/consent-record/${M}/${t.userId}`:`${t.consentProxyHost}/__consent/consent-record-cookie?cookieDomain=${t.cookieDomain}`}async function ae(e,t){try{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"include"});n.ok||console.error("Unable to save consent preferences",n.status)}catch(n){console.error("An error occurred while saving consent",n)}}function ie(e){return async function(n,o,s,c){if(e.disableFTCookies)return;const r=c.applies?n:"gdpr";if(r!==n||!s)return;const p=await ne(r,s);if(!se(p,oe()))return;const a=ce(e),_=re(a,e),Se=Z(p,a,e);await ae(_,Se),document.dispatchEvent(new CustomEvent("oCookieMessage.act",{bubbles:!0}))}}const b="cookie-message",ue="manage-cookies";let h=Object.freeze({activeComponent:b,messageId:0,privacyManagerId:0});function pe(e){return typeof e=="object"&&e!==null&&e.constructor===Object&&Object.prototype.toString.call(e)==="[object Object]"}const de=()=>({...h}),C=e=>{if(!pe(e)){console.error("Invalid state changes");return}h={...h,...e}},le=["adsDisableInternalCMP","pwm.cmp","messageSlotBottom"];function fe(e,t){const n=me(e.flags);window._sp_queue=window._sp_queue??[],window._sp_queue.push(()=>{var o,s;for(const[c,r]of Object.entries(ge))(s=(o=window._sp_).addEventListener)==null||s.call(o,c,r({...e,flags:n}))}),ye({...e,flags:n},t)}function me(e){const t={};return typeof e=="object"&&le.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t}function _e(e){if(!e)return;const t=document.body,n=new CustomEvent("oTracking.event",{bubbles:!0,cancelable:!0,detail:e.detail});t.dispatchEvent(n)}function m({trackingProps:e,action:t,triggerAction:n}){let o;const s=de(),{product:c,app:r,flags:p}=e;s.activeComponent===b?o=s.messageId:o=s.privacyManagerId;const u={detail:{component:{id:o,name:s.activeComponent,type:"overlay",subtype:"cmp"},category:"component",action:t,...n&&{trigger_action:n},...c&&{product:c},...r&&{app:r},custom:[{cookie_toggle_flag:p}],url:window.document.location.href||null}};_e(u)}const ge={onMessageChoiceSelect:e=>(t,n,o)=>{const c={11:"accept_all",12:"manage_cookies",13:"reject_all"}[o];c&&m({trackingProps:e,action:"click",triggerAction:c})},onMessageReady:e=>()=>{m({trackingProps:e,action:"view"})},onMessageReceiveData:()=>(e,t)=>{const{messageId:n}=t;n&&C({messageId:n})},onError:e=>(t,n)=>{m({trackingProps:e,action:"error",triggerAction:n})},onPMCancel:()=>()=>{C({activeComponent:b})}};function ye(e,t){window.addEventListener("message",function(n){if(n.origin!==t)return;const o={1:"save_and_close",11:"accept_all",13:"reject_all"},{data:{fromPM:s,actionType:c,messageId:r="0"}={}}=n;s&&(+r&&C({activeComponent:ue,privacyManagerId:+r}),!(!c||!o[c])&&m({trackingProps:e,action:"click",triggerAction:o[c]}))},!1)}const be="4.1.0";async function he({propertyConfig:e=y,userId:t,useFTSession:n=!0,consentProxyHost:o=F,cookieDomain:s=R,formOfWordsId:c=D,useConsentStore:r=!0,trackingContext:p={},disableFTCookies:u=!1}={}){if(typeof window>"u"){console.error("The CMP client can only be initialised in a browser context");return}if(window.FT_CMP_CLIENT_VERSION=be,!t&&n)try{const a=await L();t=a==null?void 0:a.uuid}catch(a){console.error(a)}if(!(e!=null&&e.accountId))throw new Error("Please pass a valid property config");t&&(e.authId=t),e.events&&(console.warn("[cmp-client] Passing an events map in the config is not supported and will be ignored. Please use window._sp_.addEventListener() to listen for events"),delete e.events),z(e),window._sp_queue.push(()=>{var a,_;(_=(a=window._sp_)==null?void 0:a.addEventListener)==null||_.call(a,"onConsentReady",ie({userId:t,consentProxyHost:o,cookieDomain:s,formOfWordsId:c,useConsentStore:r,disableFTCookies:u}))}),fe(p,e.baseEndpoint)}const Ce=new Promise(e=>{if(typeof document>"u")return e();const t=()=>["interactive","complete"].includes(document.readyState);function n(){t()&&(document.removeEventListener("readystatechange",n),e())}if(t())return e();document.addEventListener("readystatechange",n)});function Ie(e,t){const{privacyManagerId:n,manageCookiesLinkOverride:o}=e??{};if(!n||!o)return console.warn("_clientOptions is missing privacyManagerId or manageCookiesLinkOverride");const s=document.querySelectorAll(`a[href*="${o}"]`);for(const c of s)c.addEventListener("click",r=>{r.preventDefault(),t==null||t(+n)})}function ve({_clientOptions:e}=y){Ce.then(()=>{window._sp_queue??(window._sp_queue=[]),window._sp_queue.push(()=>{var t,n;Ie(e,(n=(t=window._sp_)==null?void 0:t.gdpr)==null?void 0:n.loadPrivacyManagerModal)})})}function Ee(e,t){if(!t||Number.isFinite(parseFloat(t))||!e.endsWith(t))return!1;const n=e.indexOf(t),o=e[n-1];return o==="."||o===void 0}function we(e){if(!e)throw new Error("Invalid hostname provided");let n=Object.values(B).find(o=>{var c;const s=(c=o._clientOptions)==null?void 0:c.rootDomain;return s&&Ee(e,s)});return n??(n=w),n}const Oe=new URL(window.location.href).hostname,d=we(Oe);he({propertyConfig:d}),(T=d==null?void 0:d._clientOptions)!=null&&T.privacyManagerId&&((k=d==null?void 0:d._clientOptions)!=null&&k.manageCookiesLinkOverride)&&ve(d)})();
|
|
@@ -16,7 +16,7 @@ export declare const iabCustomCategories: {
|
|
|
16
16
|
readonly specialFeatures: readonly [];
|
|
17
17
|
};
|
|
18
18
|
readonly demographicAds: {
|
|
19
|
-
readonly purposes: readonly [
|
|
19
|
+
readonly purposes: readonly [7, 9, 10];
|
|
20
20
|
readonly iabVendors: readonly [];
|
|
21
21
|
readonly customVendors: readonly [];
|
|
22
22
|
readonly specialFeatures: readonly [];
|
|
@@ -34,7 +34,7 @@ export declare const iabCustomCategories: {
|
|
|
34
34
|
readonly specialFeatures: readonly [];
|
|
35
35
|
};
|
|
36
36
|
readonly personalisedMarketing: {
|
|
37
|
-
readonly purposes: readonly [
|
|
37
|
+
readonly purposes: readonly [2, 7, 8, 9, 10];
|
|
38
38
|
readonly iabVendors: readonly [];
|
|
39
39
|
readonly customVendors: readonly [];
|
|
40
40
|
readonly specialFeatures: readonly [];
|
|
@@ -127,4 +127,15 @@ export declare const MM_IGNITES_EUROPE: {
|
|
|
127
127
|
gdpr: {};
|
|
128
128
|
ccpa: {};
|
|
129
129
|
};
|
|
130
|
+
export declare const SP_MANDATE_WIRE: {
|
|
131
|
+
accountId: number;
|
|
132
|
+
baseEndpoint: string;
|
|
133
|
+
propertyId: number;
|
|
134
|
+
_clientOptions: {
|
|
135
|
+
rootDomain: string;
|
|
136
|
+
};
|
|
137
|
+
joinHref: boolean;
|
|
138
|
+
gdpr: {};
|
|
139
|
+
ccpa: {};
|
|
140
|
+
};
|
|
130
141
|
//# sourceMappingURL=properties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/lib/properties.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAS1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;CAU1B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;CAQrB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;CAQ/B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;CAQhC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;CAQlC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;CAQ7B,CAAC"}
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/lib/properties.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAS1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;CAU1B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;CAQrB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;CAQ/B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;CAQhC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;CAQlC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;CAQ7B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;CAQ3B,CAAC"}
|
package/dist/src/utils/url.d.ts
CHANGED
|
@@ -122,5 +122,15 @@ export declare function getPropertyConfigByHostname(hostname: string): {
|
|
|
122
122
|
joinHref: boolean;
|
|
123
123
|
gdpr: {};
|
|
124
124
|
ccpa: {};
|
|
125
|
+
} | {
|
|
126
|
+
accountId: number;
|
|
127
|
+
baseEndpoint: string;
|
|
128
|
+
propertyId: number;
|
|
129
|
+
_clientOptions: {
|
|
130
|
+
rootDomain: string;
|
|
131
|
+
};
|
|
132
|
+
joinHref: boolean;
|
|
133
|
+
gdpr: {};
|
|
134
|
+
ccpa: {};
|
|
125
135
|
};
|
|
126
136
|
//# sourceMappingURL=url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAWtE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAWtE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa3D"}
|