PageSourceSearch

https://www.vol.no/core-micro-frontends/SourcepointLoader.astro_astro_type_script_index_0_lang.BP08NmPr.js

js vol.no collected 2026-09-24 23:12:09 UTC 6,646 bytes, 1 lines download raw bytes

1import{t as e}from"./dist.Cnxa_LV8.js";var t=e=>{console.log(`CMP`,`window._sp_.config`,e._sp_?.config),console.log(`CMP`,`isConsentedToAll`,e._tcf_?.getConsentedToAllSync()),console.log(`CMP`,`isRejectedToAll`,e.localStorage.getItem(`CMP:rejectedToAll`)===`1`),console.log(`CMP`,`TCF interface`,e._tcf_)},n=1915,r=(e,t)=>({baseEndpoint:`https://cmpv2.${new URL(e.location.href).hostname.replace(/.*\.([a-z0-9-]+\.(?:no|se))/i,`$1`)}`,accountId:n,groupPmId:t.groupPmId,propertyId:Number(t.propertyId),consentLanguage:t.consentLanguage||`no`,authId:t.authId,gdpr:{includeTcfApi:!0}}),i=(e,t)=>{let{consents:n={},legitimateInterests:r={}}=e.purpose||{},i=Object.keys(n).length===0&&Object.keys(r).length===0;t.localStorage.setItem(`CMP:rejectedToAll`,i?`1`:`0`);let a=t._tcf_?.getConsentedToAllSync();t.localStorage.setItem(`CMP:consentedToAll`,a&&!i?`1`:`0`)},a=e=>{e.__tcfapi?.(`addEventListener`,2,(t,n)=>{n&&(i(t,e),t.eventStatus===`tcloaded`&&e.__tcfapi?.(`removeEventListener`,2,()=>{}))})},o=!1;function s(e){o=e}function c(...e){o&&console.debug(`[CMP]`,...e)}var l={optIn:!1,status:`unknown`},u={CMP_ADVERTISING:`CMP:advertising`,CMP_ANALYTICS:`CMP:analytics`,CMP_MARKETING:`CMP:marketing`,CMP_PERSONALIZATION:`CMP:personalization`};function d(e){let t=Object.entries(u).reduce((t,[n,r])=>{let i=e._tcf_?.getPermissionSync(r);return{...t,[n]:i===`1`?{optIn:!0,status:`accepted`}:i===`0`?{optIn:!1,status:`rejected`}:l}},{});return{purposes:t,source:Object.values(t).some(e=>e.status!==`unknown`)?`cache`:`default`}}var f={ADVERTISING:`CMP:advertising`,ANALYTICS:`CMP:analytics`,MARKETING:`CMP:marketing`,PERSONALIZATION:`CMP:personalization`};function p(e){return e===`1`||e===`0`||e===null}function m(e,{groupPmId:t,propertyId:n}){let r=[],i={[f.ADVERTISING]:[],[f.ANALYTICS]:[],[f.MARKETING]:[],[f.PERSONALIZATION]:[]};function a(t){c(`getPermissionFromCache(category=${t})`);let n=e.localStorage.getItem(t);return p(n)?n:null}let o=null;function s(){o===null&&(o=setTimeout(()=>{for(let e of r)e();o=null},10))}let l={subscribers:i,showPrivacyManager(){if(c(`showPrivacyManager()`),!e._sp_?.gdpr?.loadPrivacyManagerModal){console.error(`Failed to load Sourcepoint Privacy Manager modal`);return}e._sp_.gdpr.loadPrivacyManagerModal?.(t)},getPermissionSync(e){return c(`getPermissionSync(category=${e})`),a(e)},getPermission(e,t){c(`getPermission(category=${e})`);let n=l.subscribe(e,(function(){let e=!1;return r=>{if(e){typeof n==`function`&&n();return}e=!0,t(r),t=()=>{}}})())},notify:(function(e){return(t,n)=>{if(e[t]===n){c(`notify(category=${t}, value=${n}) - IGNORED`);return}s(),c(`notify(category=${t}, value=${n})`),e[t]=n,l.subscribers[t]?.forEach(e=>e(n))}})({[f.ADVERTISING]:a(f.ADVERTISING),[f.ANALYTICS]:a(f.ANALYTICS),[f.MARKETING]:a(f.MARKETING),[f.PERSONALIZATION]:a(f.PERSONALIZATION)}),subscribe(e,t){if(c(`subscribe(category=${e})`),!l.subscribers[e])return console.error(`Unable to subscribe - undefined consent category!`),()=>{};l.subscribers[e].push(t);let n=a(e);return n!==null&&t(n),()=>{l.subscribers[e]=l.subscribers[e]?.filter(e=>e!==t)}},subscribeAny(e){return c(`subscribeAny`),r.push(e),()=>{r=r.filter(t=>t!==e)}},getCachedOrDefaultConsentsForPulse:function(){return d(e)},getConsentedToAllSync(){let t=`_sp_user_consent_${n}`,r=e.localStorage.getItem(t);try{if(Object.keys(localStorage).filter(e=>e.startsWith(`CMP:`)).length===0)return null;let e=JSON.parse(r||`{}`)?.gdpr?.consentStatus;if(e?.vendorListAdditions||e?.legalBasisChanges)return null;let t=e?.consentedAll;return t===void 0?null:t}catch{return null}}};return e._SourcePoint_Consent_Callback=l.notify,l}function h(e){let t=e.createElement(`script`);t.innerHTML=`"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",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()}();`,e.head.appendChild(t)}function g(e,t){let n=`${e}/unified/wrapperMessagingWithoutDetection.js`,r=t.getElementsByTagName(`script`),i=r[r.length-1];if(!i){console.error(`Failed to load Sourcepoint messaging script`);return}let a=t.createElement(`script`);a.async=!0,a.src=n,a.onload=()=>document.dispatchEvent(new Event(`cmp:loaded`)),i.insertAdjacentElement(`afterend`,a)}function _(e,t){e._sp_||={},e._sp_.config=t,c(`Sourcepoint initiated with config: `,t)}function v(e,t,n,r=!1){s(r),h(t),_(e,n);let{groupPmId:i,propertyId:a,baseEndpoint:o}=n;e._tcf_=m(e,{groupPmId:i,propertyId:a}),g(o,t),t.dispatchEvent(new Event(`cmp:ready`))}function y(e){return!/localhost|([0-9]{1,3}\.){3}[0-9]{1,3}|pm\.test$/.test(e)}var b=e=>e.get(`debug`)?.split(`,`)?.includes(`sourcepoint`)??!1,x={setup:e=>{if(!e.enabled)return;if(!y(window.location.host)){console.warn(`Sourcepoint CMP is disabled on current host ${window.location.host}`);return}if(window._tcf_)return;let n=b(new URLSearchParams(window.location.search));try{let i=r(window,e);v(window,document,i,n),a(window),n&&t(window)}catch(e){console.error(`Sourcepoint CMP setup failed:`,e)}}},S=class extends HTMLElement{connectedCallback(){let t=JSON.parse(this.dataset.config||`{}`);try{x.setup(t),e.debug(`[sourcepoint loader] mount complete; propertyId: %s, groupPmId: %s, propertyHref: %s`,t.propertyId,t.groupPmId,t.propertyHref)}catch(t){e.error(`[sourcepoint loader] failed to mount; %o`,t)}}};customElements.get(`sourcepoint-loader`)||customElements.define(`sourcepoint-loader`,S);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.