PageSourceSearch

https://www.aftenposten.no/front-page-assets/_astro/src.BZISUGVc.js

js aftenposten.no collected 2026-09-24 08:28:55 UTC 7,584 bytes, 2 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`2ba7f074-4510-4663-b590-f726c3d804cd`,e._sentryDebugIdIdentifier=`sentry-dbid-2ba7f074-4510-4663-b590-f726c3d804cd`)}catch{}})();import{t as e}from"./preload-helper.g9VOAxAu.js";import{t}from"./browser.zA1N_E0r.js";import{t as n}from"./ejs.Dp0NFTqB.js";import{i as r,t as i}from"./consents.Br6FJhmM.js";import{getGlobalIdentityInstance as a}from"https://esm.schibsted.tech/@schibsted/nanostores-account";var o=new t,s=e=>{let t=e.getStringProperty(`platform`)??``;return!t||t.split(`,`).map(e=>e.trim().toLowerCase()).some(e=>{switch(e){case`android`:return o.isAndroidApp();case`ios`:return o.isIOSApp();case`web`:return o.isWeb();default:return!1}})},c=async(e,{elementId:t,elementName:r,brand:i,target:a})=>{let o={type:e,action:e,object:{"@id":`sdrn:${i}:frontpage:${document.documentElement.dataset.id}:element:${t}`,type:`UIElement`,name:r},target:a};(await n())?.track(`trackerEvent`,o)},l,u=new Map,d=(e,t)=>{l||=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(u.get(e.target)?.(),l.unobserve(e.target))})},{threshold:.5}),l.observe(e),u.set(e,t)},f=(e,t,n)=>{let r=`braze-banner-card:${n}`;d(e,()=>{c(`View`,{elementId:r,elementName:`Braze banner card: ${n}`,brand:t,target:{url:window.location.href}})})},p=e=>[{position:`${e}_front_1_small`},{position:`${e}_front_2_medium`}],m=({brand:e,positions:t})=>{let n=(t??p(e)).map(({position:e})=>({placementId:e,element:document.getElementById(e)}));window.braze.subscribeToBannersUpdates(()=>{for(let{placementId:t,element:r}of n){if(!r)continue;let n=window.braze.getBanner(t);if(!n){r.style.display=`none`;continue}if(n.isControl){window.braze.insertBanner(n,r),r.style.display=`none`;continue}if(!s(n)){r.style.display=`none`;continue}window.braze.insertBanner(n,r),r.style.display=`block`,f(r,e,t)}})},h=(e,t)=>{let n=(t??p(e)).map(({position:e})=>e);window.braze.requestBannersRefresh(n)};async function g({realm:e,merchantIds:t=[],brand:n,userAccessDomain:r}){let i=`brazeActiveSubscription`,a=await window.Identity.getSpId(),o=sessionStorage.getItem(i);if(o!==null)return JSON.parse(o);let s=new URL(`https://${r||`access.schibsted.digital`}/v1/user-states`);s.searchParams.set(`merchantIds`,t.join(`,`)),r||(s.searchParams.set(`sp_id`,a||``),s.searchParams.set(`spid_instance`,e)),s.searchParams.set(`source`,n);let c=await fetch(s,{method:`GET`,...r?{credentials:`include`}:{},headers:{Accept:`application/json`}});if(!c.ok)return sessionStorage.setItem(i,`false`),!1;let{states:l}=await c.json()||{};if(!l)return sessionStorage.setItem(i,`false`),!1;for(let e of t){let t=l[e];if(t&&Object.values(t).some(e=>e===!0))return sessionStorage.setItem(i,`true`),!0}return sessionStorage.setItem(i,`false`),!1}var _=e=>{let n=e.extras.ignore??``,r=new t;return!(r.isAndroidApp()&&n.includes(`android`)||r.isIOSApp()&&n.includes(`ios`)||r.isWeb()&&n.includes(`web`))},v=(e,t)=>e.extras?.showOnlyIn===t,y=(e,t)=>e.extras?.position===t,b=e=>e.extras?.type!==`article`&&e.extras?.type!==`plus`,x=e=>window.braze&&!(e instanceof window.braze.ControlCard),S=async(e,{elementId:t,elementName:r,brand:i,target:a})=>{let o={type:e,action:e,object:{"@id":`sdrn:${i}:frontpage:${document.documentElement.dataset.id}:element:${t}`,type:`UIElement`,name:r},target:a};(await n())?.track(`trackerEvent`,o)},C=e=>e.toLowerCase().trim().replace(/[^a-z0-9]/g,`-`).replace(/^-+|-+$/g,``),w,T=new Map,E=(e,t)=>{w||=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(T.get(e.target)?.(),w.unobserve(e.target))})},{threshold:.5}),w.observe(e),T.set(e,t)},D=(e,t,n)=>{let r=`title`in e&&typeof e.title==`string`?C(e.title):`braze-card-without-title`,i=`url`in e&&typeof e.url==`string`?e.url:`braze-button-without-href`,a=`linkText`in e&&typeof e.linkText==`string`?e.linkText:`braze-button-without-text`,o=C(a),s=`pulseId`in e.extras?`braze-content-card:${e.extras.pulseId}`:`braze-content-card:${r}`;e.subscribeToClickedEvent?.(()=>{S(`Click`,{elementId:`${s}:button:${o}`,elementName:`Braze content card action button clicked: ${a}`,brand:n,target:{url:i}})}),e.subscribeToDismissedEvent?.(()=>{S(`Dismiss`,{elementId:`${s}:dismissed`,elementName:`Braze content card dismissed: ${a}`,brand:n,target:{url:i}})}),E(t,()=>{S(`View`,{elementId:s,elementName:`Braze content card clicked: ${a}`,brand:n,target:{url:i}})})},O=[{position:`1`,elementId:`braze-content-card-pos-1`},{position:`2`,elementId:`braze-content-card-pos-2`},{position:`3`,elementId:`braze-content-card-pos-3`}],k=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),A=e=>e instanceof window.braze.CaptionedImage?`captionedImage`:e instanceof window.braze.ClassicCard?`classicCard`:e instanceof window.braze.ImageOnly?`imageOnly`:null,j=(e,t,n)=>{let r=A(e);if(!r)return;let i=e.extras.style;i&&n[r]?.includes(i)&&t.classList.add(`${k(r)}-${k(i)}`)},M=(e,t)=>n=>x(n)&&_(n)&&v(n,e)&&y(n,t)&&b(n),N=(e,t,n)=>e.filter(M(t,n)),P=({brand:e,positions:t=O,styles:n,disableAnimation:r=!1})=>{let i=t.map(({position:e,elementId:t})=>({position:e,element:document.getElementById(t)}));for(let{position:t,element:a}of i)a&&(window.braze.showContentCards(a,r=>{let i=N(r,e,t).slice(0,1);for(let t of i)j(t,a,n),D(t,a,e);return i.length?a.style.display=`block`:a.style.display=`none`,i}),r&&a.querySelector(`.ab-feed`)?.classList.remove(`ab-effect-slide`))},F=async(e,{elementId:t,elementName:r,brand:i,target:a})=>{let o={type:e,action:e,object:{"@id":`sdrn:${i}:frontpage:${document.documentElement.dataset.id}:element:${t}`,type:`UIElement`,name:r},target:a};(await n())?.track(`trackerEvent`,o)},I=e=>
1{if(`uri`in e&&typeof e.uri==`string`)return e.uri;if(`clickAction`in e&&e.clickAction&&typeof e.clickAction==`object`&&`uri`in e.clickAction&&typeof e.clickAction.uri==`string`)return e.clickAction.uri},L=e=>`message`in e&&typeof e.message==`string`?e.message.substring(0,50):`header`in e&&typeof e.header==`string`?e.header.substring(0,50):`braze-in-app-message`,R=(e,t)=>{let n=L(e),r=I(e);F(`View`,{elementId:`braze-in-app-message:${n}`,elementName:`Braze in-app message: ${n}`,brand:t,...r&&{target:{url:r}}})},z=(e,t)=>{let n=L(e),r=I(e);F(`Click`,{elementId:`braze-in-app-message:${n}`,elementName:`Braze in-app message clicked: ${n}`,brand:t,...r&&{target:{url:r}}})};async function B(){if(await i(`marketing`)!==`1`)return new Promise(e=>{r(`marketing`,t=>{t===`1`&&e()})})}async function V(n){let{brazeKey:r,merchantId:i,brand:o,realm:s,contentCards:c,bannerCards:l,userAccessDomain:u}=n;await B();let d=await a();if(!d)return console.warn(`[@lumon/braze] Identity not found`);if(!await d.isLoggedIn()||!window.location.href.includes(`braze=test`)&&!await g({realm:s,merchantIds:[i],brand:o,userAccessDomain:u}))return;let f=await e(()=>import(`https://esm.schibsted.tech/@braze/[email protected]`),[],import.meta.url);window.braze=f,f.initialize(r,{baseUrl:`sdk.fra-01.braze.eu`,doNotLoadFontAwesome:!0,sessionTimeoutInSeconds:60,allowUserSuppliedJavascript:!0}),new t().isApp()||f.subscribeToInAppMessage(e=>{e instanceof f.InAppMessage&&e.subscribeToClickedEvent(()=>{z(e,o)}),f.showInAppMessage(e),e instanceof f.InAppMessage&&R(e,o)}),l?.enabled&&m({brand:o,positions:l.positions});let p=await d.getUserSDRN();f.changeUser(p),f.openSession(),c?.enabled&&P({brand:o,positions:c.positions,styles:c.styles,disableAnimation:c.disableAnimation}),l?.enabled&&h(o,l.positions)}export{V as initializeBraze};
2//# sourceMappingURL=src.BZISUGVc.js.map

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.