@schibsted/advertory 2.49.0 → 2.49.2
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/core/aftenposten/es/index.css +1 -1
- package/core/aftenposten/es/index.js +1 -1
- package/core/aftenposten/index.js +1 -1
- package/core/aftonbladet/es/index.css +1 -1
- package/core/aftonbladet/es/index.js +1 -1
- package/core/aftonbladet/index.js +1 -1
- package/core/aftonbladetv2/es/index.css +1 -1
- package/core/aftonbladetv2/es/index.js +1 -1
- package/core/bt/es/index.css +1 -1
- package/core/bt/es/index.js +1 -1
- package/core/bt/index.js +1 -1
- package/core/e24/es/index.css +1 -1
- package/core/e24/es/index.js +1 -1
- package/core/e24/index.js +1 -1
- package/core/e24v2/es/index.css +1 -1
- package/core/e24v2/es/index.js +1 -1
- package/core/fotbollskanalen/es/index.css +1 -1
- package/core/fotbollskanalen/es/index.js +1 -1
- package/core/fotbollskanalen/index.js +1 -1
- package/core/godare/index.js +1 -1
- package/core/godt/index.js +1 -1
- package/core/klart/index.js +1 -1
- package/core/koket/es/index.js +1 -1
- package/core/koket/index.js +1 -1
- package/core/kompakt/index.js +1 -1
- package/core/minmote/index.js +1 -1
- package/core/pent/index.js +1 -1
- package/core/sa/es/index.css +1 -1
- package/core/sa/es/index.js +1 -1
- package/core/sa/index.js +1 -1
- package/core/svd/es/index.css +1 -1
- package/core/svd/es/index.js +1 -1
- package/core/svd/index.js +1 -1
- package/core/tek/index.js +1 -1
- package/core/tv4/es/index.js +1 -1
- package/core/tv4/index.js +1 -1
- package/core/vg/es/index.css +1 -1
- package/core/vg/es/index.js +1 -1
- package/core/vg/index.js +1 -1
- package/core/vgv2/es/index.css +1 -1
- package/core/vgv2/es/index.js +1 -1
- package/features/ad-native/index.js +1 -1
- package/package.json +1 -1
- package/sites/aftenposten/es/index.css +1 -1
- package/sites/aftonbladet/es/index.css +1 -1
- package/sites/aftonbladet/index.js +1 -1
- package/sites/aftonbladetv2/es/index.css +1 -1
- package/sites/bt/es/index.css +1 -1
- package/sites/e24/es/index.css +1 -1
- package/sites/e24v2/es/index.css +1 -1
- package/sites/sa/es/index.css +1 -1
- package/sites/svd/es/index.css +1 -1
- package/sites/vg/es/index.css +1 -1
- package/sites/vgv2/es/index.css +1 -1
- package/styles/aftonbladet/styles.css +1 -1
- package/styles/aftonbladetv2/styles.css +1 -1
- package/styles/e24v2/styles.css +1 -1
package/core/tv4/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("react/jsx-runtime");const e={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r;var i=t(function(){if(r)return n;r=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map(function(e){return i(e,n)})}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function d(e,t,n){var r={};return n.isMergeableObject(e)&&s(e).forEach(function(t){r[t]=i(e[t],n)}),s(t).forEach(function(o){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(a(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):r[o]=i(t[o],n))}),r}function l(t,n,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||e,r.cloneUnlessOtherwiseSpecified=i;var s=Array.isArray(n);return s===Array.isArray(t)?s?r.arrayMerge(t,n,r):d(t,n,r):i(n,r)}return l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return l(e,n,t)},{})},n=l}());const o=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],s={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},a=6;class d{set(e){this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of o){const r=e[n];void 0!==r&&(t[n]=r)}Object.assign(this.config,t),Object.prototype.hasOwnProperty.call(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=i(d.DEFAULT_SITE_HANDLERS,e)}}d.DEFAULT_SITE_HANDLERS={siteEvents:s,initNativeAd:function(){}};const l=new d,c=l.modifyConfigProperties.bind(l),u={NO:"no",SE:"se"},v=()=>{const{country:e}=l.get();return e===u.NO?"no-sno":"se-generic"},p=()=>{const{country:e,publisher:t}=l.get();return`${e}-${t}`},g="ABSOLUTE_FULLSCREEN",h="ANY_FULLSCREEN",m="VERTICAL_FULLWIDTH",y="FULLWIDTH",f="TAKEOVER",w="VELVET_TAKEOVER",b="WALLPAPER",E="COLLAPSE",I={ANY_FULLSCREEN:[{width:6,height:6},{width:1920,height:1080},{width:3,height:3}],ABSOLUTE_FULLSCREEN:[{width:6,height:6}],VERTICAL_FULLWIDTH:[{width:1080,height:1920}],FIXED_FULLSCREEN:[{width:1920,height:1080},{width:3,height:3}],FULLWIDTH:[{width:5},{width:400,height:400}],NATIVE_AD:[{width:1,height:1}],TAKEOVER:[{width:4,height:4}],VELVET_TAKEOVER:[{width:7,height:7}],WALLPAPER:[{width:2,height:2}],COLLAPSE:[{width:2,height:1}]},A={wallpaper:1600,"l-format":1600},S=()=>{if(!window.location.search.includes("kv_"))return{};const e={},t=(()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e)})();return Object.keys(t).forEach(n=>{n.startsWith("kv_")&&(e[n.slice(3)]=t[n])}),e},T="svd",C="vg",P="godare",k="aftonbladet",O="e24",x="tv4",L=e=>{const{source:t}=e;return"csm"===t},j={[C]:["board","netboard","backfill","outstream"],[k]:["panorama","outstream"],[P]:["panorama","outstream"],[T]:["wph-article-panorama","wph-front-panorama"]},$=e=>{var t;const{publisher:n}=l.get();return!!j[n]&&!!(null===(t=j[n])||void 0===t?void 0:t.some(t=>e.includes(t)))};function N(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{d(r.next(e))}catch(e){o(e)}}function a(e){try{d(r.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}d((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const _=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},D="cmp:loaded";let q,M=!1;const R=e=>{const t=!!(null==e?void 0:e.enabled),n=(null==e?void 0:e.timeout)||3e3,r=(i="bypass_tcf",new URLSearchParams(window.location.search).get(i));var i;const o=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(_("TCF bypass param detected, returning consent: true"),!0):(_("TCF is not enabled, returning consent: true"),!0))(t,r))return!0;if(M)return null;if(!q)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const n=q.getConsentedToAllSync();return _(`TCF consented to all is: ${n}`),q.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(_("Getting TCF consent manager..."),window._tcf_)return _("TCF consent manager is already available"),q=window._tcf_,void e(q);_("TCF consent manager is not available");const r=()=>{_("CMP loaded, resolving consent manager..."),i&&clearTimeout(i),window._tcf_?(q=window._tcf_,e(q)):t(new Error("CMP loaded but window._tcf_ is not defined"))},i=setTimeout(()=>{document.removeEventListener(D,r),M=!0,t(new Error("Timeout waiting for CMP to load"))},n);_("Listening for CMP loaded event..."),document.addEventListener(D,r,{once:!0})}):Promise.resolve(null),getConsentSync:o,getConsentAsync:()=>N(void 0,void 0,void 0,function*(){const t=o();return!(null==e?void 0:e.enabled)||(null!==t?t:yield new Promise((e,t)=>{try{if(!q)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");q.isConsentedToAll(t=>{e(t)})}catch(e){t(e)}}))})}};function B(e){const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null}const F={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},H=9826;class U{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=F.DESKTOP,isMobileApp:t}=l.get();if(t){return{"aa-sch-supply_type":`app_${e===F.MOBILE?"phone":F.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return N(this,void 0,void 0,function*(){return Object.assign(Object.assign({},e),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},e.keywords),this.getSupplyTypeKeywords()),this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(e.keywords)),user:{externalUid:this.getExternalUid(),dnt:this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){const e=this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}}getUserId(){return function(){const e=B("_pulse2data");return e?e.split(",")[2]:void 0}()}getExternalUid(){return function(){const{tcf:e}=l.get(),{getConsentSync:t}=R(e);if(!t())return;const n=B("_pulse2data");return n?n.split(",")[9]:void 0}()}isTrackingForbidden(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===this.getExternalUid()}getMember(){const{pageOptions:{member:e},testMember:t=H}=l.get();return window.location.search.includes("inventory_test=true")?t:e}getCMPValue(e){return localStorage.getItem(`CMP:${e}`)?"0"===localStorage.getItem(`CMP:${e}`)?"0":"1":"0"}getPublisherKeywords(){const{publisher:e}=l.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return N(this,void 0,void 0,function*(){const{tcf:e}=l.get(),{getConsentAsync:t}=R(e);return{"aa-sch-cmp_advertising":(yield t())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=l.get();return{"aa-sch-page_type":e}}getCountryCodeKeywords(e){return{"aa-sch-country_code":e}}getInventoryTypeKeywords(){return{"aa-sch-inventory_type":"editorial"}}getHasContextKeywords(e){const t=e["aa-sch-context_keyword"];return{"aa-sch-has_context_keyword":Array.isArray(t)&&t.length?1:0}}getPageOptionsFormatDevice(e="desktop"){return"mobile"===e?"phone":e}getSponsorsKeywords(){var e;const{publisher:t,keywordsConfig:n}=l.get(),r=null===(e=null==n?void 0:n.sponsors)||void 0===e?void 0:e.split(":").map(e=>`${t}_${e}`);return r?{"no-sno-news-sponsors":r}:{}}}const V=new U;V.prepare.bind(V);function z(e=!1){var t,n;const r=null===(n=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===n?void 0:n.toLocaleLowerCase(),i=(()=>{const e=window.navigator.userAgent.toLowerCase(),t=[["win","windows"],["macintosh","macos"],["x11","linux"],["android","android"],["ipad","ios"],["iphone","ios"]].find(([t])=>e.includes(t));return t?t[1]:"unknown"})();return{OS:i,mobileOS:["ios","android"].includes(i)?i:"unknown",isHybridApp:r.includes("hermes"),appMode:e?"hybrid":"notinapp"}}class W extends U{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=F.DESKTOP}=l.get();return{"se-generic-sitemode":this.getPageOptionsFormatDevice(e)}}}getScreenKeywords(){const e=function(){const e=window.innerWidth,t=window.innerHeight,n=document.documentElement.clientWidth,r=document.documentElement.clientHeight;return{width:e||n||0,height:t||r||0}}(),t={width:null!==(r=null===(n=window.screen)||void 0===n?void 0:n.width)&&void 0!==r?r:0,height:null!==(o=null===(i=window.screen)||void 0===i?void 0:i.height)&&void 0!==o?o:0};var n,r,i,o;return{"se-generic-viewportheight":e.height,"se-generic-viewportwidth":e.width,"se-generic-screenheight":t.height,"se-generic-screenwidth":t.width}}getExternalIdSrc(){const e=this.getExternalUid(),t=this.getUserId();return e?{"se-generic-externalid_src":Number(!!e)+Number(!!t)}:{"se-generic-externalid_src":0}}getAppTypeKeywords(){const{isMobileApp:e}=l.get(),{appMode:t,mobileOS:n}=z(e);return{"se-generic-appmode":t,"se-generic-mobileos":n}}getPublisherGroup(){return{"se-generic-publishergroup":"schibsted"}}}const K=864e5,J=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return _("Error with parsing localStorage data"),null}},t=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:t,setWithTimestamp:(e,n,r=K)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=K)=>{const r=e(t);if(!r)return null;if(!n)return r;try{const{expirationTime:e,data:t}=JSON.parse(r);return(new Date).getTime()<=e?t:null}catch(e){return _("Error with parsing localStorage data"),null}}}})(),G={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return _(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,t)=>{try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){_(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){_(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},Y="advertory:ppids-cache",Q={[u.SE]:`SCH${u.SE.toUpperCase()}-EnvHash`,[u.NO]:`SCH${u.NO.toUpperCase()}-EnvHash`},X={[u.SE]:`SCH${u.SE.toUpperCase()}-UserHash`,[u.NO]:`SCH${u.NO.toUpperCase()}-UserHash`},Z={[u.SE]:`sch${u.SE}-envhash-v3`,[u.NO]:`sch${u.NO}-envhash-v3`},ee={[u.SE]:`sch${u.SE}-userhash-v3`,[u.NO]:`sch${u.NO}-userhash-v3`},te={[u.SE]:`'sch${u.SE}-iosid-v3'`,[u.NO]:`'sch${u.NO}-iosid-v3'`},ne={[u.SE]:`sch${u.SE}-androidid-v3`,[u.NO]:`sch${u.NO}-androidid-v3`},re={[u.SE]:"sdrn:schibsted.com:user",[u.NO]:"sdrn:spid.no:user"},ie=e=>N(void 0,void 0,void 0,function*(){const t=yield e.getEnvironmentId();if(!t)return null;return`sdrn:schibsted:environment:${t}`}),oe=(e,t)=>N(void 0,void 0,void 0,function*(){const n=yield e.getUserId();if(!n)return null;return`${re[t]}:${n}`}),se=()=>N(void 0,void 0,void 0,function*(){return yield new Promise(e=>{if("undefined"!=typeof window)if(window.Identity)e(window.Identity);else{const t=()=>{e(window.Identity)};window.addEventListener("identity-initialized",t,{once:!0})}else e(void 0)})});class ae{constructor(e){this.identity=e,this.getIdentityUser=this.getIdentityUser.bind(this),this.isUserLoggedIn=this.isUserLoggedIn.bind(this),this.onIdentityLogout=this.onIdentityLogout.bind(this)}getIdentityUser(){return N(this,void 0,void 0,function*(){var e;try{const t=yield null===(e=this.identity)||void 0===e?void 0:e.getUser();return null!=t?t:null}catch(e){return _("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return N(this,void 0,void 0,function*(){var e,t;return null!==(t=yield null===(e=this.identity)||void 0===e?void 0:e.isLoggedIn())&&void 0!==t&&t})}onIdentityLogout(e){var t;null===(t=this.identity)||void 0===t||t.on("logout",e)}}const de="advertory-session",le=e=>{const{privacyBroker:{storageKeyPrefix:t=de}={}}=l.get();return t+"-"+e},ce=()=>{const{privacyBroker:{storageKeyPrefix:e=de}={}}=l.get(),t=sessionStorage;for(const n in t)0===n.indexOf(e+"-")&&G.remove(n)},ue={LOCAL:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",DEV:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",PRE:"https://user-permissions.privacy-pre.schibsted.io/privacy/v2",PRO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_NO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_FI:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_DK:"https://user-permissions.privacy.schibsted.com/privacy/v2"},ve={get:(e,t)=>N(void 0,void 0,void 0,function*(){const n=yield fetch(e,t);if(!n.ok)throw new Error(n.statusText);return yield n.json()}),post:(e,t,n)=>N(void 0,void 0,void 0,function*(){const r=JSON.stringify(n),i=yield fetch(e,{method:"POST",headers:t,body:r});if(!i.ok)throw new Error(i.statusText);return yield i.json()})},pe=e=>N(void 0,[e],void 0,function*({endpoint:e,identityFacade:t,environment:n}){var r;ce();const i=yield(e=>N(void 0,void 0,void 0,function*(){const t=new Headers;t.set("Content-Type","application/json");const n=yield e.getIdentityUser();return n&&t.set("Authorization",`SPIDSIG ${n.sig}`),t}))(t);try{const t=null!==(r=ue[n])&&void 0!==r?r:ue.PRO;return yield ve.get(`${t}${e}`,{headers:i})}catch(e){return _("[PrivacyBroker] Failed to fetch permissions",e),null}}),ge=()=>N(void 0,void 0,void 0,function*(){var e,t;const{privacyBroker:{enabled:n,clientId:r}={},tracker:{instance:i}={},country:o}=l.get();if(!n||!i||!r)return _("[Privacy Broker]: Data not present",{enabled:n,trackerInstance:i}),null;const s=yield se(),a=new ae(s);if(!s||!a)return _("[Privacy Broker]: Data not present",{identity:s,identityFacade:a}),null;const d=yield a.isUserLoggedIn();a.onIdentityLogout(()=>{_("[Privacy Broker]: clearPermissions"),ce()});const c=null!==(e=yield oe(i,o))&&void 0!==e?e:"",u=null!==(t=yield ie(i))&&void 0!==t?t:"",v=d?c:u,p=yield((e,t,n)=>N(void 0,void 0,void 0,function*(){const r=`/schacc/${t}/user/${n}/permissions`,i=`/anonymous/${t}/user/${n}/permissions`;return(yield e.getIdentityUser())?r:i}))(a,r,v),g=(e=>!!G.get(le(e)))(v),h=le(v);if(g){_("[Privacy Broker]: SessionStorage cached",{key:h,permissions:sessionStorage.getItem(h)});return G.get(h)}const m=yield(e=>N(void 0,[e],void 0,function*({endpoint:e,timeout:t,identityFacade:n,environment:r}){return yield Promise.race([pe({endpoint:e,environment:r,identityFacade:n}),new Promise(e=>setTimeout(()=>e(null),t))])}))({endpoint:p,timeout:500,identityFacade:a,environment:s.env});return m?(f=v,(null==(y=m)?void 0:y.permissions)&&G.set(le(f),y.permissions),m):(_("[Privacy Broker]: Permissions not found",{permissions:m,isLoggedIn:d,identifiedId:v,country:o}),null);var y,f}),he="glimrTags",me=["glwe_","glwet_"],ye={geofenceTags:[],geoTags:[],weatherTags:[]},fe=()=>N(void 0,void 0,void 0,function*(){const{privacyBroker:e}=l.get();if(null==e?void 0:e.enabled){const e=(e=>{const t=null==e?void 0:e.find(e=>e.purpose.includes("targeted_advertising"));if(_("targeted_advertising permissions",t),!(null==t?void 0:t.data)||!Array.isArray(null==t?void 0:t.data))return!1;const n=null==t?void 0:t.data.find(e=>e.includes("geolocation"));return _("geolocation permission",n),!!n})(yield N(void 0,void 0,void 0,function*(){var e,t;const{country:n,tracker:{instance:r}={}}=l.get(),i=yield se();if(!r||!i)return _("[Privacy Broker] No tracker found."),null;const o=new ae(i),s=yield o.isUserLoggedIn(),a=null!==(e=yield oe(r,n))&&void 0!==e?e:"",d=null!==(t=yield ie(r))&&void 0!==t?t:"",c=le(s?a:d);return G.get(c)||null}));return e}return!0}),we=()=>N(void 0,void 0,void 0,function*(){const{glimr:e}=l.get();if(!(yield fe())||!(null==e?void 0:e.enabled))return void _("No consent for glimr data fetching.");const t=yield(n=500,N(void 0,void 0,void 0,function*(){return yield Promise.race([N(void 0,void 0,void 0,function*(){const e=yield import("glimr-sdk");return e.default||e}),new Promise(e=>setTimeout(()=>e(!1),n))])}));var n;if(t)try{t.setTagCacheTimeInSeconds(300),yield new Promise(n=>{t.getTags(e.clientId,(e,t)=>{J.setWithTimestamp(he,{tags:e,tagMappings:t}),n(!0)})})}catch(e){_(`Error during getting glimr data: ${e}`)}else _("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),be={svd:"svd",vg:"vg",godare:"godare",aftenposten:"no-aftenposten",sa:"no-stavangeraftenblad",bt:"no-bergenstidende",aftonbladet:"aftonbladet",e24:"e24",minmote:"minmote",pent:"pent",godt:"godt",tek:"no-tek"},Ee=e=>me.some(t=>e.startsWith(t)),Ie=e=>e.startsWith("glgc_"),Ae=e=>!Ee(e)&&!Ie(e),Se=e=>{const t=Te();if(!t)return ye;const n=((e=[])=>e.filter(Ee))(t),r=((e=[])=>e.filter(Ie))(t),i=((e=[],t)=>{const n=e.filter(Ae);if(t){const{publisher:e}=l.get(),t=be[e]||e;n.push(t)}return n})(t,e);return{geoTags:i,geofenceTags:r,weatherTags:n}},Te=()=>{const e=J.getByTimestamp(he);return e&&"string"!=typeof e?null==e?void 0:e.tags:null};class Ce{constructor(){this.eids=[]}add(e,t){return e&&this.eids.push({id:e,source:t}),this}buildRyEids(){return this.eids.map(({id:e,source:t})=>({source:t,uids:[{id:e,atype:1,ext:{stype:"ppuid"}}]}))}buildEids(){return[...this.eids]}buildVideoEids(){return this.eids.map(({id:e,source:t})=>`${t},${e}`).join("|")}buildNorstatPath(){const e=this.eids[0];return e?`${e.source}-${e.id}`:""}buildNorstatQuery(e){const t=new URLSearchParams;return this.eids.slice(1).forEach(({id:n,source:r})=>{t.append(e,`${r}-${n}`)}),t}}const Pe=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return N(this,arguments,void 0,function*(e,t=1e4){var n,r;const i=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=i.xandr)||void 0===n?void 0:n.ppId1,null===(r=i.xandr)||void 0===r?void 0:r.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||_("PPIDv2s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:""}}setPPIDs(e,t){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:""}},ke=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return N(this,void 0,void 0,function*(){var n,r,i,o,s,a,d,l,c,u,v;const p=J.get(Y),g=yield this.getNewPPIDs(e,t);if(this.shouldHash(p,g)){const t=null!==(n=e.hasherUrl)&&void 0!==n?n:"https://hasher.schibsted.com/api/v1/hash",l=this.createHasherPayload(g),c=yield this.hashPPIDs(l,t);return c?(this.cachePPIDs(l,c,null===(r=g.idfv)||void 0===r?void 0:r.plain,null===(i=g.anId)||void 0===i?void 0:i.plain),void this.setPPIDs(null!==(o=c.userId)&&void 0!==o?o:"",null!==(s=c.environmentId)&&void 0!==s?s:"",null===(a=g.idfv)||void 0===a?void 0:a.plain,null===(d=g.anId)||void 0===d?void 0:d.plain)):void this.setPPIDs("","")}this.setPPIDs(null!==(l=null==p?void 0:p.userId.hashed)&&void 0!==l?l:"",null!==(c=null==p?void 0:p.environmentId.hashed)&&void 0!==c?c:"",null===(u=null==g?void 0:g.idfv)||void 0===u?void 0:u.plain,null===(v=null==g?void 0:g.anId)||void 0===v?void 0:v.plain)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||_("PPIDv3s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:"",idfv:this.idfv,anId:this.anId}}setPPIDs(e,t,n,r){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:"",this.idfv=null!=n?n:null,this.anId=null!=r?r:null}shouldHash(e,t){var n,r;if(!e)return!0;for(const i in e){if((null===(n=e[i])||void 0===n?void 0:n.plain)!==(null===(r=t[i])||void 0===r?void 0:r.plain))return!0}return!1}cachePPIDs(e,t,n,r){const i=Object.assign(Object.assign({clientId:{plain:e.clientId},userId:{plain:e.userId,hashed:t.userId},environmentId:{plain:e.environmentId,hashed:t.environmentId},trackerType:{plain:e.trackerType},trackerVersion:{plain:e.trackerVersion}},n?{idfv:{plain:n}}:{}),r?{anId:{plain:r}}:{});J.set(Y,i)}hashPPIDs(e,t){return N(this,void 0,void 0,function*(){try{const n=new Headers({"Content-Type":"application/json"});return yield ve.post(t,n,e)}catch(e){return _("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return N(this,arguments,void 0,function*({clientId:e,instance:t},n){const r=yield oe(t,n),i=yield ie(t),o=window.advertory_idfv,s=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:e},userId:{plain:r},environmentId:{plain:i},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},o?{idfv:{plain:o}}:{}),s?{anId:{plain:s}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:r,environmentId:i}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:r.plain,environmentId:i.plain}}},Oe=e=>{const{ppid1:t,ppid2:n}=Pe.getPPIDs(),{ppid1:r,ppid2:i,idfv:o,anId:s}=ke.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new Ce).add(n,Q[e]).add(t,X[e]).add(i,Z[e]).add(r,ee[e]).add(o,te[e]).add(s,ne[e]).buildEids()}]}},xe=e=>{const{ppid1:t,ppid2:n}=Pe.getPPIDs(),{ppid1:r,ppid2:i,idfv:o,anId:s}=ke.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new Ce).add(n,Q[e]).add(t,X[e]).add(i,Z[e]).add(r,ee[e]).add(o,te[e]).add(s,ne[e]).buildRyEids()}}]}}};const Le=new class extends W{prepare(e){return N(this,void 0,void 0,function*(){const t=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"aa-sch-country_code":u.SE},this.getPublisherKeywords()),this.getSupplyTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),this.getScreenKeywords()),yield N(void 0,void 0,void 0,function*(){const{glimr:e}=l.get(),{addPublisherToGeo:t}={},n=yield fe();if(!(null==e?void 0:e.enabled)||!n)return _("No consent for getting glimr tags."),{};const r=v(),i=Se(t);return{[`${r}-geo`]:i.geoTags,[`${r}-weather`]:i.weatherTags,[`${r}-geofence`]:i.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=Pe.getPPIDs();return{"aa-sch-schuserhash":e?"1":"0","aa-sch-schenvhash":t?"1":"0"}})()),e.keywords);return Object.assign(Object.assign({},e),{keywords:t,user:Object.assign({},Oe(u.SE)),member:this.getMember()})})}};var je=Le.prepare.bind(Le);class $e{initialize(){this.DATA=Object.assign({},$e.INITIAL_DATA)}getData(e){if(!this.DATA)throw new Error("Storage was accessed with invalid data.");return this.DATA[e]}setData(e,t){if(!this.DATA)throw new Error("Storage was accessed before it had been initialized.");this.DATA[e]=Object.assign(Object.assign({},this.DATA[e]),t)}}$e.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const Ne=new $e,_e=()=>(window.apntag||(window.apntag={anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}}),window.apntag),De=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),qe=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:r=!1}={}}=l.get(),i=[`${v()}-geo`],o=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...r?i:[]],s=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),a=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:s}}},a)}},Me=(e,...t)=>N(void 0,[e,...t],void 0,function*(e,{timeout:t}={timeout:1e3}){document.querySelector(`script[src="${e}"]:not([type="module"])`)||(yield new Promise((n,r)=>{const i=document.createElement("script");i.async=!0,i.src=e;const o=()=>{a(),n()},s=()=>{a(),r(new Error(`Failed to load ${e}`))},a=()=>{i.removeEventListener("load",o),i.removeEventListener("error",s),clearTimeout(d)};i.addEventListener("load",o),i.addEventListener("error",s);const d=setTimeout(()=>{a(),r(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(i)}).catch(e=>{console.error(e)}))}),Re=()=>{const{prebid:e,tcf:t,country:n}=l.get(),{getConsentSync:r}=R(t),i=r(),{initNativeAd:o}=l.getHandlers();if(!(null==e?void 0:e.enabled))return;const s=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:r=>{const i=_e(),{prebid:{relevantCbTimeout:o}={}}=l.get(),s="relevantCb"===r&&o?o:n[r].timeout,a=setTimeout(()=>{!n[r].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${r}'`),e=!0,i.loadTags&&i.loadTags())},s);t.push(a)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),a=_e(),d=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=_e();return{user:e,keywords:t}})();s.failsafeOnTimeout("relevantCb");const{user:{externalUid:c=""}={},keywords:u}=d;(()=>{const e=De();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(s.getCancel()||!a.loadTags)return _("core loadTags() call was cancelled",{cancel:s.getCancel(),apnTagLoadTags:!a.loadTags,condition:"or"}),void s.cleanup();const t=De();s.events.relevantCb.done=!0,s.failsafeOnTimeout("auctionCb");const r=i?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};_("prebid consentManagement",r),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},xe(n)),qe(u,c))),_("core add prebid config",Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},xe(n)),qe(u,c))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{s.getCancel()||(s.events.auctionCb.done=!0,a.loadTags(e)),s.cleanup()}},customNativeRender:e=>{Be(e,o)}}),_("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{s.getCancel()||(s.events.auctionCb.done=!0,a.loadTags(e))}},customNativeRender:e=>{Be(e,o)}})})},Be=(e,t)=>{var n;const{divId:r,native:i,bid:o}=e,s=document.querySelectorAll(`[id^=${r}]`)[0],a=`RY-${s.id}`;((e,t)=>{e.childNodes.forEach(e=>e.style.cssText="position: absolute; z-index: -1;");const n=document.createElement("div");n.setAttribute("id",t),e.appendChild(n)})(s,a);const d=null===(n=s.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:i,targetId:a},l.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},Fe="0123456789abcdefghijklmnopqrstuvwxyz",He=()=>Promise.resolve(),Ue=()=>{},Ve=e=>{window.apntag.anq.push(e)},ze=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),We=new Promise(e=>{if("undefined"==typeof document||!document.hidden)return void e();const t=()=>{document.hidden||(document.removeEventListener("visibilitychange",t),e())};document.addEventListener("visibilitychange",t,{once:!0})}),Ke=e=>{const{banner:t,targetId:n}=e;return!(!t||(null==n?void 0:n.includes("takeover")))&&st(e,h)},Je=e=>{const{native:t}=e;return!!t},Ge=e=>st(e,y),Ye=e=>{const{targetId:t}=e;return t.includes("takeover")||st(e,f)},Qe=e=>st(e,f),Xe=e=>st(e,b),Ze=e=>st(e,E),et=e=>e.targetId.includes("sponsorstripe"),tt=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},nt=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),rt=e=>e.targetId.startsWith("midboard"),it=e=>e.width>=1260&&e.width<=1280,ot=e=>e.width>=1600&&e.width<=1620,st=(e,t)=>{const n=I[t];if(!n)return!1;return!!n.find(t=>{var n,r;const i=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,o=(null===(r=e.banner)||void 0===r?void 0:r.height)||e.height,s=t.width===i,a=!t.height||t.height===o;return s&&a})},at=e=>e.includes("snoap.no"),dt=e=>{var t,n,r,i,o;return!!(null===(o=null===(i=null===(r=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags[e])||void 0===r?void 0:r.adResponse)||void 0===i?void 0:i.ads[1])||void 0===o?void 0:o.rtb)},lt=(e,t=(...e)=>{})=>{const n=t.toString();if(0===e.length)return n;const r=n.substring(0,n.indexOf("=>")).replace("(","").replace(")","").split(",").map(e=>e.trim()),i=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),o=r.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...o,i).toString()},ct=lt([],()=>{const e=({width:e,height:t})=>{var n;const r=null===(n=document.querySelector("#sf_align"))||void 0===n?void 0:n.querySelector("div");if(!r)return;const{clientWidth:i,clientHeight:o}=r,s=e/i,a=t/o;r.style.transform=`scale(${s},${a})`,r.style.transformOrigin="left top"},t=()=>{const{innerWidth:t,innerHeight:n}=window;e({width:t,height:n})};window.addEventListener("resize",t=>{if(!t.currentTarget)return;const n={width:innerWidth,height:innerHeight};e(n)});const n=window.frameElement;(null==n?void 0:n.contentWindow)?n.contentWindow.document.body.onload=t:document.body.onload=t}),ut=e=>{const t=lt([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n adfm-ad {\n height: 100% !important;\n width: 100% !important;\n }\n ",e.contentDocument.head.appendChild(t);const n=e.contentDocument.querySelector("iframe");if(!(null==n?void 0:n.contentDocument))return;const r=n.contentDocument.createElement("style");r.textContent="\n #image {\n background-size: cover !important;\n }\n ",new MutationObserver((e,t)=>{n.contentDocument&&(n.contentDocument.head.appendChild(r),t.disconnect())}).observe(e.contentDocument,{childList:!0,subtree:!0})})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),n=document.createElement("script");n.textContent=`(${t})()`;return e+n.outerHTML},vt=[],pt={},gt=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const r=mt(e);n?(ht(r,n),yt(e,r,t)):(ht(r,n),ft(e,r,t))})},ht=(e,t)=>{var n,r;const i=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!i)return;const o=t?"showFullscreen":"hideFullscreen";null===(r=i.contentWindow)||void 0===r||r.postMessage(`advertory:${o}-${e}`,"*")},mt=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},yt=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),vt.includes(t)||vt.push(t),n&&window.addEventListener("scroll",pt[t],{passive:!0})},ft=(e,t,n)=>{vt.includes(t)&&(n&&window.removeEventListener("scroll",pt[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},wt=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:r=[".skyscraper_r"],headerZIndex:i=3}=t,o=[],s=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&o.push(n)}),r.forEach(e=>{const t=document.querySelector(e);t&&s.push(t)}),()=>{o.length&&bt(e,o,i,0),s.length&&bt(e,s,i,40)}},bt=(e,t,n,r)=>{const i=e.offsetHeight,o=window.scrollY,s=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let a;a=s>o?(s-o)/t-r:(o+t-(s+i))/t;const d=a<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=a.toString()})};function Et(e){if(!e||"undefined"==typeof window)return;const t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}Et('body.fullscreen-scroll-in-screen{overflow-x:hidden}.advertory-fullscreen-scroll-wrapper{visibility:hidden;overflow:visible;width:100% !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;position:relative;margin:var(--advertory-fullscreen-scroll-wrapper-margin);z-index:1;display:block !important;min-height:250px;padding:0 !important;clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh);-webkit-clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh)}.advertory-fullscreen-scroll-wrapper>div{position:fixed;top:0;left:0;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;width:100vw !important;overflow:hidden}html[data-app-platform=iOS] .advertory-fullscreen-scroll-wrapper>div{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important;top:unset !important;bottom:env(safe-area-inset-bottom) !important}.advertory-fullscreen-scroll-wrapper>div>iframe{height:inherit !important;width:inherit !important;display:none !important}.advertory-fullscreen-scroll-wrapper.in-screen{visibility:visible;overflow:visible;width:100vw !important}.advertory-fullscreen-scroll-wrapper.in-screen>div>iframe{display:block !important}.advertory-fullscreen-scroll-wrapper.in-screen:before{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-150dvh;padding:0 !important}.advertory-fullscreen-scroll-wrapper.in-screen:after{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-50dvh}.advertory-fullscreen-scroll{position:fixed;top:var(--advertory-fullscreen-scroll-top, 0px);left:var(--advertory-fullscreen-scroll-left, 0px);width:var(--advertory-fullscreen-scroll-vw, 100vw);height:var(--advertory-fullscreen-scroll-vh, 100vh);overflow:hidden}.advertory-fullscreen-scroll::before{content:attr(data-ad-label);box-sizing:border-box;position:fixed;top:0}html[data-app-platform=iOS] .advertory-fullscreen-scroll::before{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix, 0px)) !important}.advertory-fullscreen-scroll::before{left:calc(50vw - 628px);width:calc(100% - 36px);max-width:1250px;text-align:left;background-color:hsla(0,0%,100%,.6);color:#212121;font-family:Ester Blenda,Arial,sans-serif;font-size:11px;font-weight:400;font-style:normal;text-transform:lowercase;line-height:1;margin:16px 2px;padding:10px;z-index:1;visibility:inherit !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll::before{left:16px}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:calc(50vw - 623px);right:unset}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:22px;right:unset}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]::before{padding-left:32px}.advertory-fullscreen-scroll>div[id*=utif]{display:block;width:var(--advertory-fullscreen-scroll-vw, 100vw) !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[id*=utif]{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important}.advertory-fullscreen-scroll>div[id*=utif]{overflow:hidden}.advertory-fullscreen-scroll>div[id*=utif]>iframe{display:block;height:inherit !important;width:inherit !important}.advertory-fullscreen-scroll>div[role=button]{z-index:1;opacity:1;background:rgba(0,0,0,0) !important;left:unset;position:fixed !important;right:calc(50vw - 623px);top:19px !important;width:26px !important;height:26px !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[role=button]{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix) + 19px) !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll>div[role=button]{right:22px}}');const It={no:{adText:"ANNONSE",adFrom:"ANNONSE FRA",adContent:"ANNONSØRINNHOLD",adContentFrom:"ANNONSØRINNHOLD FRA"},se:{adText:"ANNONS",adFrom:"ANNONS FRÅN",adContent:"EXTERN LÄNK",adContentFrom:"EXTERN LÄNK FRÅN"}};let At=null;const St=(e,t)=>{let n=e;return n=(e=>{const t=document.createElement("script");return t.textContent="\n {\n const frame = window.frameElement;\n \n if (frame) {\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n window.addEventListener('message', function(event) {\n if (event.data === 'advertory:showFullscreen-'+document.body.id) {\n document.body.style.display= \"block\";\n } else if (event.data === 'advertory:hideFullscreen-'+document.body.id) {\n document.body.style.display= \"none\";\n }\n });\n }\n }\n ",e+t.outerHTML})(e),n=(e=>{const t=document.createElement("script");return t.textContent=`(${ct})()`,e+t.outerHTML})(n),n=(e=>{if((e=>e.includes("google"))(e))return e;const t=document.createElement("div");t.innerHTML=e;const n=t.querySelector("img");return n?(n.style.width="100%",n.style.height="100%",n.style.objectFit="cover",n.style.position="fixed",t.innerHTML):e})(n),n=(e=>{if(at(e))return e;const t=document.createElement("style");return t.textContent="\n .GoogleActiveViewClass, .GoogleActiveViewElement {\n transform: translate(calc(-50% + 50vw), 0);\n width: 100vw !important;\n height: 100vh !important;\n }\n .GoogleActiveViewClass img, .GoogleActiveViewElement img {\n width: 100vw;\n height: 100vh;\n object-fit: cover;\n }\n .GoogleActiveViewClass iframe {\n width: 100vw !important;\n height: 100vh !important;\n }\n ",e+t.outerHTML})(n),(e=>e.includes("adform"))(n)&&(n=(e=>{const t=document.createElement("script");t.textContent='\n var frame = window.frameElement;\n if (frame) {\n frame.style.removeProperty("width");\n frame.style.removeProperty("height");\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n var iframe = document.querySelector("adfm-ad iframe");\n if (iframe) {\n var image = iframe.contentWindow.document.getElementById("image");\n if (!image) return;\n image.style.backgroundSize = "cover";\n } else {\n var iframe = document.querySelector(".adform-adbox iframe");\n if (iframe) {\n var style = document.createElement("style");\n style.textContent = "#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}";\n iframe.contentDocument.body.append(style);\n iframe.style = "width: 100vw; height: 100vh;";\n } else {\n var observer = new MutationObserver(function(mutations, obs) {\n for (var mutation of mutations) {\n var iframe = mutation.addedNodes[0];\n if (iframe && iframe.nodeName === "IFRAME") {\n iframe.style = "width: 100vw; height: 100vh;";\n iframe.dataset.contents += "<style>#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}</style>";\n obs.disconnect();\n }\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n }\n }\n ';const n=document.createElement("style");return n.textContent="\n html, body, adfm-ad, #sf_align, .adform-adbox, .adform-adbox img {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover;\n max-width: 100vw;\n }\n ",e+n.outerHTML+t.outerHTML})(n)),(e=>e.includes("529299503"))(n)&&(n=ut(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>at(e)?e:e.replace("<iframe ","<iframe onload=\"\n var f = document.querySelector('iframe');\n if (!f) return;\n var s = f.style;\n s.transform = 'scale(' + (window.innerHeight / Number(f.height)).toFixed(2) + ')';\n s.right = parseInt((Number(f.width) - window.innerWidth) / 2) + 'px';\n s.bottom = parseInt((Number(f.height) - window.innerHeight) / 2) + 'px';\n s.position = 'relative';\n \" "))(n)),at(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</iframe>","</iframe><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),(e=>e.includes("kreateam.io"))(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</div>","</div><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),dt(t)&&(n=(e=>{const t=document.createElement("script");t.textContent='var frame = window.frameElement;\n if (frame) {\n frame.style.width = "100vw";\n frame.style.height = "100vh";\n }';const n=document.createElement("div");return n.innerHTML=e,n.appendChild(t),n.innerHTML})(n)),n},Tt=()=>{At=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,r=e?e.offsetLeft:0,i=document.documentElement;i.style.setProperty("--advertory-fullscreen-scroll-vh",`${t}px`),i.style.setProperty("--advertory-fullscreen-scroll-vw",`${n}px`),i.style.setProperty("--advertory-fullscreen-scroll-left",`${r}px`)},Ct=()=>{At||(At=window.requestAnimationFrame(Tt))},Pt=(e,t)=>{var n,r,i,o;const{country:s}=l.get(),{targetId:a}=e;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(n=null==t?void 0:t.iosSafeAreaTopFix)&&void 0!==n?n:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:r="#fff",margin:i="16px 0",beforeContentValue:o=""}=e,s=t/2,a=document.createElement("style");a.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${s}px),\n ${r} calc(50% - ${s}px),\n ${r} calc(50% + ${s}px),\n ${n} calc(50% + ${s}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${i};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${o&&"clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);\n -webkit-clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);"}\n }\n\n .advertory-fullscreen-scroll-wrapper:before, .advertory-fullscreen-scroll-wrapper:after {\n background: var(--background);\n content: '${o}' !important;\n }`,a.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(a)})(null!==(r=null==t?void 0:t.overlayStyles)&&void 0!==r?r:{});const d=document.getElementById(a),c=null==d?void 0:d.parentElement;d&&c&&(((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,r=new IntersectionObserver(e=>gt(e,n),{}),i=mt(e);r.observe(e),n&&(pt[i]=wt(e,t))})(c,t),d.className="advertory-fullscreen-scroll",st(e,g)&&(d.style.position="absolute"),c.className="advertory-fullscreen-scroll-wrapper",c.dataset.showTagSubscribeId=a,d.setAttribute("data-ad-label",It[s].adText),(null==t?void 0:t.moveCogwheelToTheLeft)&&(d.dataset.moveCogwheelToTheLeft="true"),Ct(),window.addEventListener("resize",Ct),null===(i=window.visualViewport)||void 0===i||i.addEventListener("resize",Ct),null===(o=window.visualViewport)||void 0===o||o.addEventListener("scroll",Ct))},kt=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=dt(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,r=dt(e)?1:0;n&&(n.tags[e].adResponse.ads[r].rtb.banner.content=t)})(e,St(t,e))},Ot=e=>{const t=e.split("-"),n=t[t.length-1];return 6===n.length&&n.match(/^[a-zA-Z0-9]+$/)?t.slice(0,-1).join("-"):e};let xt="";const Lt=new Map,jt="advertory-wallpaper-background",$t=()=>{const e=document.querySelector(`.${jt}`);e&&e.remove()},Nt=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,_t=e=>{if(window.location.href.includes("collapse_ad=0"))return;const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.setProperty("width","0","important"),t.style.setProperty("height","0","important"),t.style.setProperty("display","none","important"),n.style.setProperty("display","none","important"),e.includes("wallpaper")&&$t())},Dt=e=>{const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("display"),n.style.removeProperty("display"))},qt=e=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement,r=(null==n?void 0:n.offsetHeight)||0;n&&(n.style.minHeight=`${r}px`)},Mt=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:r}=(e=>{const t=Ne.getData("initialClassNames")[e.id];return{wrapper:(null==t?void 0:t.wrapper)?t.wrapper.join(" "):"",container:(null==t?void 0:t.container)?t.container.join(" "):""}})(e);e.className=n,t.className=r},Rt=()=>{$t();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{_t(e.id),Mt(e),(e=>{const t=document.querySelector(`#${e}`),n=null==t?void 0:t.getAttribute("data-probable-height"),r=null==t?void 0:t.getAttribute("data-probable-width");n&&r&&(null==t||t.style.setProperty("min-height",n+"px"),null==t||t.style.setProperty("min-probable-width",r+"px"))})(e.id),e.innerHTML="",e.id=Ot(e.id)}),Ve(()=>window.apntag.clearRequest())},Bt="noGroupedPlacements",Ft=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},Ht=e=>{var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return[];const{placements:n,queryConfig:r,deviceType:i}=l.get(),o=n[i].filter(Ft)||[],s=e?document.querySelector(e):document;if(!s)return[];const a=o.reduce((e,t)=>{const n=(e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t})(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=o.filter(({id:e})=>e.match(t)),a=(null==r?void 0:r.queryByDataDevice)?`div[id^="${e}"][data-device=${i}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,d=s.querySelectorAll(a),c=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{const r=Ut(e,t,n),i=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=Fe[Math.floor(36*Math.random())];return t})(6)}`;return e.id=i,e.setAttribute("data-advertory-ad-rendered","true"),r.finnBlink&&!r.finnBlink.renderOnlyWithAdBlock&&e.setAttribute("data-is-finn-blink-placement","true"),(e=>{var t;const n=e.id;n&&Ne.setData("initialClassNames",{[n]:{wrapper:null===(t=e.parentElement)||void 0===t?void 0:t.className.split(" "),container:e.className.split(" ")}})})(e),Object.assign(Object.assign({},r),{id:i})});return(e=>{const{keywordsConfig:t}=l.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(xt!==window.location.pathname&&(Lt.clear(),xt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),r=null!==(t=Lt.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${p()}-count`]=r,Lt.set(n,r+1),e})):e})(c)});return(e=>{const t=Array.from(document.querySelectorAll('div[class^="advertory"]'));return e.sort((e,n)=>t.findIndex(t=>t.id===e.id)-t.findIndex(e=>e.id===n.id))})(a)},Ut=(e,t,n)=>{const r=n[t],i=n[n.length-1],o=n.filter(({id:t})=>t===e.id)[0];return(null==e?void 0:e.id)===(null==r?void 0:r.id)?r:(null==e?void 0:e.id)===(null==i?void 0:i.id)?i:o||i},Vt=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=l.get(),r=(null==t?void 0:t[n])||{},i=Object.values(r).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=Ot(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),s=((e,t)=>{const n={};for(const[r,i]of Object.entries(t))n[r]=e.filter(e=>i.includes(Ot(e.id)));return n})(e,r),a=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(Ot(e.id))))(e,new Set([...a,...i]));return Object.assign(Object.assign(Object.assign({},s),o),{[Bt]:d})},zt=(e,t,n)=>{const r=document.getElementById(`div_utif_${e}`);if(!r)return;const{apntag:i}=window,[o,s]=t;if(!r.dataset.lockedsize&&s&&o)r.style.width=`${o}px`,r.style.height=`${s}px`,n&&(i.resizeAd(r.id,[o,s]),r.dataset.lockedsize="true",r.dataset.lockedwidth=o.toString(),r.dataset.lockedheight=s.toString());else if(null==r?void 0:r.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=r.dataset;e&&t&&i.resizeAd(r.id,[e,t])}},Wt=["netboard","board"];class Kt{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,r;const{editionName:i}=e,o=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),s=JSON.stringify(null!==(r=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==r?r:[]),a=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return a.searchParams.append("editionName",i),o&&a.searchParams.append("urlData",o),s&&a.searchParams.append("excludedItems",s),l&&a.searchParams.append("spid",l),d&&a.searchParams.append("envid",d),a.toString()}fetchData(e){return N(this,void 0,void 0,function*(){var t,n;const r=yield this.identityFacade.getIdentityUser(),i=null!==(n=yield null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId())&&void 0!==n?n:"",o=(null==r?void 0:r.userId)?String(r.userId):"",s=this.buildUrl(e,{envId:i,spid:o});try{_("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield ve.get(s,e);return _("Fetch operation completed successfully."),t}catch(e){_("Error during fetch operation:",e)}return null})}}class Jt{getDrEditionUTMParams(e,t){var n;const{title:r,clientName:i,creativeId:o}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:s}=t,a=r.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:s,utm_campaign:i,utm_medium:a},o&&{utm_id:`df-${o}`})}getUrlSearchParams(e,t,n){if(!e)return"";const r=this.getDrEditionUTMParams(t,n),i=new URLSearchParams(decodeURIComponent(e.search)),o=new URLSearchParams(e.search);return Object.entries(r).forEach(([e,t])=>{i.has(e)||o.set(e,null!=t?t:"")}),o.toString().replace(/\+/g,"%20")}getUrlWithParams(e,t){var n;const r=null===(n=null==e?void 0:e.pulseData)||void 0===n?void 0:n.url;if(!r)return"";const i=this.getDrEditionUTMParams(e,t),o=new URL(r);return Object.entries(i).forEach(([e,t])=>{o.searchParams.has(e)||o.searchParams.set(e,null!=t?t:"")}),o.toString()}handleVideo(e,t){return N(this,void 0,void 0,function*(){const{id:n,autoplay:r,mute:i,videoLoop:o,vendor:s}=t.videoConfiguration;e.classList.add("vgtv-video-container"),Object.assign(e.dataset,{vgtvVideoId:n,vgtvVendor:s,vgtvAutoplay:r,vgtvMuted:i,vgtvLoop:!!o,vgtvNa:!0,vgtvRecommended:!1,vgtvPulseProvider:"vg",vgtvPulseProductTag:"partnerstudio"})})}getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:r,pathname:i}=new URL(n);if(!r.includes("www.vg.no")&&!i.includes("annonsorinnhold"))return[n];const o=i.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Gt{constructor(e,t,n,r){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=r,this.drEditionAds=[]}fetchAndRenderAd(e,t){return N(this,void 0,void 0,function*(){var n,r;const{drEditionConfig:{containerSelector:i},renderAsBackfill:o=!1}=t,s=e.querySelector(i);if(!s)return void _(`Container with selector "${i}" not found.`);const a=yield this.drEditionService.fetchData(t);return(null==a?void 0:a.itemId)||o?!(null==a?void 0:a.itemId)&&o?(_("No Dr. Edition ads available to render. Collapsing whole placement."),void _t(e.id)):((null==a?void 0:a.itemId)&&o&&(_("Dr. Edition ad available to render as a Xandr backfill."),Dt(e.id)),void(a&&(a.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(a.css,"style"),this.rendererManager.render(s,a,t),yield null===(n=this.videoManager)||void 0===n?void 0:n.handle(a,t),this.drEditionAds.push(a),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(a.itemId),this.observeAdView(e,a,t),null===(r=e.querySelector("a"))||void 0===r||r.addEventListener("pointerup",()=>null)))):(_("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),void this.showBackfill(e))})}observeAdView(e,t,n){this.observeCarousel(e,t,n)||((e,t,n={threshold:.5})=>{new IntersectionObserver(([e],n)=>{e.isIntersecting&&(t(),n.disconnect())},n).observe(e)})(e,()=>this.pulseManager.trackContentView(e,t,n),{threshold:.5})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const r=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";Dt(r)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const r=e.querySelector(".dr-edition-slider");if(!r)return!1;let i=null;const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(i&&clearTimeout(i),i=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...r.children].forEach(e=>{o.observe(e)})})},{threshold:[.9]});return[...r.children].forEach(e=>{o.observe(e)}),!0}}class Yt{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){if(!(null==t?void 0:t.itemId))return;const{getConsentSync:r}=R(n.tcf),i=!!r(),o=n.device===F.MOBILE?t.mobileHTML:t.desktopHTML;const s=i?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");e.innerHTML=s,e.querySelectorAll("a").forEach(e=>{var r,i,o;e.search=null!==(o=null===(i=(r=this.newsroomStrategy).getUrlSearchParams)||void 0===i?void 0:i.call(r,e,t,n))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,t,n)})}}class Qt{constructor(e){this.strategy=e}handle(e,t){return N(this,void 0,void 0,function*(){const{videoConfiguration:{id:n,preview:r}={}}=e;(n||r)&&(yield this.importScript(t),yield this.createVideoElement(e,t))})}importScript(e){return N(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield Me(t)}catch(e){_("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return N(this,void 0,void 0,function*(){const n=document.createElement("div"),{node:r}=e.videoConfiguration,i=[...document.querySelectorAll(`#${r}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(e,t))return;this.strategy.handleVideo(n,e),null==i||i.appendChild(n),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==i?void 0:i.parentNode;if(!o)return;const s=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");s!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,r,i;const{preview:{url:o,thumbnail:s}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const a=document.querySelector(".dr-edition-preview .preview-video");return!!a&&(a.setAttribute("playsinline",""),!(!a||!s)&&(null===(i=(r=t.drEditionConfig).addPreviewVideo)||void 0===i||i.call(r,a),!0))}}class Xt{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t,n,r){return{}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getTeaserElementText(e,t){if(!e)return"";const n=e.querySelector({title:".dr-edition-title",subtitle:".dr-edition-subtitle",image:"img.teaser-main-image"}[t]);if(!n)return"";if("image"===t)return n.src||"";const r=null==n?void 0:n.textContent;return r?r.trim():""}getEventTarget(e,t){const{itemId:n,pulseData:{url:r}={}}=t,i=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=i?i:""),type:"Page",url:r}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e,t,n){return N(this,void 0,void 0,function*(){var r,i,o,s,a;if(!this.pulse)return;const d=this.getEventInput(e,t,n,"view");(null===(r=this.pulse)||void 0===r?void 0:r.trackViewUIElement)?null===(o=null===(i=this.pulse)||void 0===i?void 0:i.trackViewUIElement)||void 0===o||o.call(i,d):null===(a=null===(s=this.pulse)||void 0===s?void 0:s.trackElementView)||void 0===a||a.call(s,d)})}trackContentClick(e,t,n){return N(this,void 0,void 0,function*(){var r,i,o,s;if(!this.pulse)return;const a=this.getEventInput(e,t,n,"click");this.pulse.trackClickUIElement?null===(i=(r=this.pulse).trackClickUIElement)||void 0===i||i.call(r,a):null===(s=(o=this.pulse).trackElementClick)||void 0===s||s.call(o,a)})}}class Zt extends Xt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){const{pulseData:{title:r,clientName:i="",creativeId:o}={}}=t,{columnName:s,primaryPosition:a}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:r,placement:{columnName:s,primaryPosition:a},"spt:custom":{is_sponsored:!0,sponsor:i,"spt:creativeId":o},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}class en extends Xt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var r,i,o,s,a,d;const{itemId:l,pulseData:{clientName:c,creativeId:u}={}}=t,v=n.editionName,p=this.mapPageType(this.pageType),g=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(s=null===(o=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getPulseObjectId)||void 0===o?void 0:o.call(i))&&void 0!==s?s:v,"@type":"UIElement",position:v,elementType:"Article",custom:{customer:c,creativeId:null!=u?u:l},page:{"@id":null!=g?g:v,"@type":p,url:location.origin},tags:null===(d=null===(a=this.newsroomStrategy)||void 0===a?void 0:a.getTags)||void 0===d?void 0:d.call(a,e)}}getEventInput(e,t,n,r){return{object:this.getEventBaseData(e,t,n),partnerstudio:this.getEventPartnerstudioData(e,t,n,r),target:this.getEventTarget(e,t),provider:this.getProviderData()}}getEventPartnerstudioData(e,t,n,r){var i,o,s,a;const{pulseData:{algorithm:d="sov",clientName:l,creativeId:c,editionId:u,itemId:v,url:p,probability:g}={}}=t,h=Math.floor(Date.now()/1e3),m=this.getTeaserElementText(e,"title"),y=this.getTeaserElementText(e,"subtitle"),f=this.getTeaserElementText(e,"image"),w=null!==(a=null!==(s=null===(o=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getUrlWithParams)||void 0===o?void 0:o.call(i,t,n))&&void 0!==s?s:p)&&void 0!==a?a:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:h,title:m,type:r,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}}const tn="front",nn=e=>N(void 0,void 0,void 0,function*(){var t,n;return(null===(t=null===window||void 0===window?void 0:window.SVP)||void 0===t?void 0:t.Player)?new window.SVP.Player(e):((()=>{const e="svp-player-sdk",t=document.querySelector(e),n=Array.from(document.querySelectorAll('script[src^="https://cdn.stream.schibsted.media/player"]'));if(t||n.length>0)return;const r=document.createElement("script");r.id=e,r.src="https://cdn.stream.schibsted.media/player/3.78.1/player.min.js",r.async=!0;try{r.src=r.src.replace("player.min","player.next.min")}catch(e){console.error("Failed to set player.next.min source:",e)}document.head.insertBefore(r,document.head.firstChild)})(),(null===(n=window.SVP)||void 0===n?void 0:n.isLoaded)?new window.SVP.Player(e):yield new Promise(t=>{window.addEventListener("onSvpPlayerReady",()=>t(new window.SVP.Player(e)))}))}),rn={ContentMutePlugin:e=>{window.SVP.Player.Plugins.register({getName:()=>"ContentMutePlugin",initialize(){},setup(){const t=this.player.config.get("mute");this.container=e||this.player.getContainer(),this.muted=t,t&&this.listenToOnce(this.player,"ready",this.renderButtonElement,this)},getButtonElement(){const e=document.createElement("button");e.className="player-plugin-content-mute";const t=document.createElement("span");return t.className="volume-button-icon",e.appendChild(t),e},renderButtonElement(){this.buttonElement=this.getButtonElement(),this.buttonElement.addEventListener("click",this.onButtonClick.bind(this)),this.container.appendChild(this.buttonElement),this.isVideo()||(this.buttonElement.style.display="none"),this.getJWPlayer()&&this.getJWPlayer().on("mute",this.onMuteChange,this)},onButtonClick(){this.getJWPlayer()&&(this.container.classList.add("has-interacted"),this.muted=!this.muted,this.getJWPlayer().setMute(this.muted))},onMuteChange(e){this.muted=e.mute,this.muted?this.buttonElement.classList.remove("content-video-volume-on"):this.buttonElement.classList.add("content-video-volume-on")},isVideo(){return"video"===this.player.getRawAsset().assetType},getJWPlayer(){return this.player.model.player}})},IntegrationMenu:()=>{window.SVP.Player.Plugins.register({getName:()=>"IntegrationMenu",setup(){return N(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return ii})})}})}};class on{handleVideo(e,t){return N(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:r,mute:i,vendor:o}}){yield N(void 0,void 0,void 0,function*(){return yield new Promise(e=>{var t;Boolean(null===(t=window.SVP)||void 0===t?void 0:t.Player)?e(!0):window.addEventListener("onSvpPlayerReady",()=>e(!0))})});const s=["ContentMutePlugin"],a=this.createPlayerOverlay(e);var d,l;l=a,null==(d=s)||d.forEach(e=>{rn[e](l)});const c={id:t,node:n,autoplay:r,mute:i,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},u=yield nn(c);u.once("assetReady",()=>{((e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})})(u,s)}),u.once("ready",()=>{const t=e;new MutationObserver(e=>{e.forEach(({type:e,attributeName:n})=>{"attributes"===e&&"class"===n&&(t.classList.contains("jw-state-playing")?a.classList.add("is-playing"):a.classList.remove("is-playing"),t.classList.contains("jw-flag-user-inactive")?a.classList.add("is-inactive"):a.classList.remove("is-inactive"))})}).observe(t,{attributes:!0,attributeFilter:["class"]})}),u.once("PulseStats:ready",()=>N(this,void 0,void 0,function*(){const e=yield u.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"e24",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===tn?"sdrn:e24:frontpage:front":`sdrn:e24:article:${t}`}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];if(!n.includes("https://e24.no/annonsorinnhold/"))return[n];const{pathname:r}=new URL(n),i=r.split("/").filter(Boolean);return i.length?[...i.slice(1),n]:[n]}createPlayerOverlay(e){const t=document.createElement("div");t.classList.add("cm-custom-video-overlay"),e.parentElement&&(t.innerHTML=e.parentElement.innerHTML,e.parentElement.replaceChild(t,e));return t.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),t.classList.add("has-interacted")}),t}}const sn="https://www.aftonbladet.se/video-player-extras/latest/";class an{handleVideo(e,t){return N(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:r,mute:i,vendor:o}}){const s={id:t,node:n,autoplay:r,mute:i,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${sn}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${sn}external-link.js`]:{name:"ExternalLink"}}};yield nn(s),this.addEditionVideoClass(e)})}addEditionVideoClass(e){var t;(null===(t=null==e?void 0:e.parentElement)||void 0===t?void 0:t.parentElement)&&e.parentElement.parentElement.classList.add("dr-edition-video-player")}getPulseObjectId(){return""}getPulsePageId(){return""}}class dn{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const ln=(e,t,n)=>{const{publisher:r,pageType:i,country:o}=e,s={[C]:new Jt,[O]:new on,[k]:new an}[r]||new dn,a=new(o===u.SE?Zt:en)(n,s,i),d=new Kt(t,null==n?void 0:n.pulseTracker),l=new Yt(s,a),c=new Qt(s);return new Gt(d,l,c,a)},cn=(e,t,n)=>{const{wrapperSelector:r}=null==e?void 0:e.drEditionConfig,i=document.querySelectorAll(r),o=new IntersectionObserver((r,i)=>((e,t,n,r,i)=>{const o=ln(n,r,i);e.forEach(e=>{var r,i,s;if(!e.isIntersecting)return;const a=e.target,d=null!==(r=a.dataset.editionName)&&void 0!==r?r:"",l=null!==(i=a.dataset.pulseColumnname)&&void 0!==i?i:"",c=null!==(s=a.dataset.pulsePrimaryposition)&&void 0!==s?s:"";o.fetchAndRenderAd(a,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(a)})})(r,i,e,t,n),{rootMargin:"400% 0px"});i.forEach(e=>o.observe(e))},un=[],vn=(e,t)=>N(void 0,void 0,void 0,function*(){var n;const{pulse:r,tcf:i,deviceType:o,drEdition:s,publisher:a,pageType:d,country:l}=e,c=((e,t)=>{var n;const{deviceType:r,placements:i,drEdition:{fallbackGlobalEditionName:o}={}}=e,s=i[r]||i.desktop,a=Ot(t.targetId),d=s.find(e=>e.id===a),l=Wt.some(e=>a.startsWith(e)),c=un.includes(a),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(un.push(a),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(e,t);if(!c)return;if(!(null==r?void 0:r.instance))return void _("Pulse has not been passed as a prop, aborting");const u=yield se(),v=new ae(u),p=ln({publisher:a,pageType:d,country:l},v,null==r?void 0:r.instance),g=document.getElementById(t.targetId);if(!g||!s)return;g.classList.value="";const h=document.createElement("div");h.className=s.containerSelector.replace(/^[.#:[\]]+/,""),g.innerHTML=h.outerHTML;const m={editionName:(null===(n=null==c?void 0:c.drEdition)||void 0===n?void 0:n.editionName)||"",drEditionConfig:s,device:o,tcf:i,renderAsBackfill:!0};yield p.fetchAndRenderAd(g,m)}),pn="collapseAd",gn="hideAd",hn="resizeAd",mn="renderDrEditionFallback",yn="wallpaperImageUrl",fn="wallpaperColor",wn="velvet",bn=[hn,yn,fn,pn,gn,mn,wn],En=e=>{if("object"==typeof e)return e;if(t=e,Nt.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:yn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:fn,wallpaperColor:t}}if(e.startsWith(mn)){const t=e.split(":")[1];return{name:mn,targetId:t}}if(e.startsWith(pn)||e.startsWith(gn)){const t=e.split(":")[1];return{name:pn,targetId:t}}if(e.includes("name")&&bn.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},In=e=>{if(!["http://acdn.adnxs-simple.com","https://acdn.adnxs-simple.com","https://crcdn01.adnxs-simple.com","http://crcdn01.adnxs-simple.com","https://acdn.adnxs.com","http://acdn.adnxs.com","https://adsdk.microsoft.com","https://adsdk.bing.net","https://adsdkprod.azureedge.net"].includes(e.origin.trim()))return;const{data:t}=e;if(!t)return;const n=En(t);if(!n)return;if(!n.name||!bn.some(e=>n.name===e))return;const{name:r,targetId:i,wallpaperImageUrl:o,wallpaperColor:s,cmd:a,size:d}=n;r===wn&&a&&a.includes("close")&&dispatchEvent(new CustomEvent("advertory:closeTakeover",{})),r!==pn&&r!==gn||!i||_t(i),r===hn&&i&&a&&zt(i,a),r===mn&&i&&(_t(i),vn(l.get(),{targetId:i})),"resizeMediationAd"===r&&i&&d&&zt(i,d,!0),r===yn&&o&&(e=>{const t=document.querySelector(`.${jt}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),r===fn&&s&&(e=>{const t=document.querySelector(`.${jt}`);t&&(t.style.backgroundColor=e)})(s)},An=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),Sn=(e,t)=>{if(tt(t))return _(`loading finn blink ad with full ads chain for ${t}`),void(()=>{const{publisher:e,country:t,finnBlink:n}=l.get(),{loadFinnBlinkAd:r,wallpaperHandlers:{adjustAdToHorseshoe:i}}=l.getHandlers(),o=window.apntag,s={publisher:e,country:t,finnBlink:n},a=e=>{Dt(e),Ve(()=>o.showTag(e))};return{withXandrAd:a,withFinnBlinkAd:e=>N(void 0,void 0,void 0,function*(){yield r(e,s,null)}),withFullAdsChain:e=>N(void 0,void 0,void 0,function*(){yield r(e,s,a,()=>{Ne.getData("horseshoe").isAvailable&&i(e)})})}})().withFullAdsChain(t);Ve(()=>(_("core showTag",{id:t}),e.showTag(t)))},Tn=(e,t)=>N(void 0,void 0,void 0,function*(){yield ze,yield We;const n=new IntersectionObserver((e,t)=>((e,t,n)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:r}=e,i=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(r),o=document.getElementById(i);_("core log from intersection observer handler",{targetId:i,element:o}),n(window.apntag,i),o&&(t.unobserve(o),t.disconnect())})})(e,t,Sn),An(t));n.observe(e)}),Cn=new Map,Pn=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],kn=".brandstudio-premium-content-widget",On=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),xn=({adWrapper:e,placementContainer:t})=>{const n=On({adWrapper:e,placementContainer:t});var r;null==e||e.style.setProperty("height",`${n}px`),Mt(r=t),r.innerHTML=""},Ln=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},jn=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=l.get(),r=Pn.includes(n)&&Boolean(t.closest(kn));const i=r?t.closest(kn):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,s=n&&t.matches("iframe, article")&&e;if(!n||!r&&!s||r&&!i)return;if(s)return Ln(e),void o.disconnect();const a=t.closest('[style*="height"]'),d=i;a&&d.contains(a)?Ln(a):d.hasAttribute("style")&&Ln(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},$n=(e,t,n,r,i,o)=>{var s;const a=performance.now(),d=null!==(s=Cn.get(t))&&void 0!==s?s:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(r,i)&&n<0;a-d>=i&&l&&(Cn.set(t,a),((e,t,n)=>{const r=null==n?void 0:n.parentElement;r&&n&&xn({adWrapper:r,placementContainer:n}),Ve(()=>{e.setKeywords([t],{[`${v()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},Nn=(e,t,n,r)=>{const i=new IntersectionObserver((e,t)=>((e,t,n,r)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:i,boundingClientRect:o}=e;t(window.apntag,i.id,o.y,n,r,i)})})(e,$n,n,r),An(t));i.observe(e)},_n=(e,t=6)=>{const n=[];for(let r=0;r<e.length;r+=t){const i=e.slice(r,r+t);n.push(i)}return n},Dn=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),qn=(e,t=0)=>{const n=e.getBoundingClientRect(),r=window.innerHeight;return n.bottom>-t&&n.top<r+t},Mn=(e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,r=document.querySelector(`#${n}`),i=null==r?void 0:r.parentElement;if(!i||!r)return;jn({adWrapper:i,placementContainer:r});const{delayTime:o=1e3}=t,s=(new Date).getTime();if(r&&"true"!==r.dataset.subscribedForRefresh){const e=(e=>{var t;const{deviceType:n,preloadMarginsConfig:r}=l.get(),i=null==r?void 0:r[n];return((e,t)=>t[e])(null!==(t=e.dataset.priority)&&void 0!==t?t:"normal",(({high:e,normal:t,low:n}={})=>{var r,i,o,s,a,d;return{high:{refreshMargin:null!==(r=null==e?void 0:e.refreshMargin)&&void 0!==r?r:600,renderMargin:null!==(i=null==e?void 0:e.renderMargin)&&void 0!==i?i:300},normal:{refreshMargin:null!==(o=null==t?void 0:t.refreshMargin)&&void 0!==o?o:300,renderMargin:null!==(s=null==t?void 0:t.renderMargin)&&void 0!==s?s:150},low:{refreshMargin:null!==(a=null==n?void 0:n.refreshMargin)&&void 0!==a?a:100,renderMargin:null!==(d=null==n?void 0:n.renderMargin)&&void 0!==d?d:50}}})(i)).refreshMargin})(r);r.dataset.subscribedForRefresh="true",r.dataset.refresh&&Nn(r,e,s,o)}},Rn=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=l.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),Un(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},Bn=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:r}=l.get();if(!t)return;e.forEach(({id:e})=>{const t=Fn(e);t&&(t.dataset.bfCacheRefresh="true")});const i=t=>{const r=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const i of r){const r=e.find(e=>{var t;return e.id===(null===(t=i.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),o=null==r?void 0:r.threshold;qn(i,o)&&r&&(qt(r.id),n.length&&i.classList.remove(...n),Un([r],t))}};r&&document.addEventListener("visibilitychange",()=>i(!0)),window.addEventListener("pageshow",e=>{const t=()=>{window.scrollY>0&&(window.removeEventListener("scroll",t),i(!1))};e.persisted&&(Dn()?window.addEventListener("scroll",t,{passive:!0}):i(!1))})},Fn=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},Hn=e=>{const{id:t,allowedFormats:n}=e,r=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(Fn(t)),i=(e=>1===e[0]&&1===e[1])(r),o={sizes:[r],allowedFormats:i?n:n.filter(e=>"native"!==e),allowSmallerSizes:!1};return i||(o.native=void 0),o},Un=(e,t=!1)=>{const n=6,{requestSize:r=n}=l.get(),i=e.map(({id:e})=>e),o=_n(i,r);if(t)for(const t of e){const e=Hn(t);window.apntag.modifyTag(t.id,e)}for(const e of o)Ve(()=>window.apntag.refresh(e))};const Vn="#fff",zn="#0098da",Wn="splash",Kn="welcomePage",Jn="topscroller",Gn="velvet",Yn="takeover-displayed",Qn=()=>{const{takeover:{enabled:e=!1}={}}=l.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||e&&!Xn())},Xn=()=>{var e;return"true"===B((null===(e=l.get().takeover)||void 0===e?void 0:e.cookieCapName)||Yn)},Zn=(e,t)=>[[1,1],[1920,1080]].some(([n,r])=>n===e&&r===t),er=()=>{const{takeover:e}=l.get();return Boolean(null==e?void 0:e.topscroller)},tr=()=>{var e,t,n;const r=document.location.hostname,i=(null===(e=l.get().takeover)||void 0===e?void 0:e.cookieCapName)||Yn,o=void 0===(null===(t=l.get().takeover)||void 0===t?void 0:t.cookieCapTime)?14400:null===(n=l.get().takeover)||void 0===n?void 0:n.cookieCapTime;o&&(window.document.cookie=`${i}=true; max-age=${o}; domain=${r}; path=/`)},nr=e=>{var t;const n=!!(null===(t=l.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return Ye(e)&&n},rr=(e,t)=>{var n;if(t===Jn){const{topscroller:t}=e;return null!=t?t:{}}if(t===Wn){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},ir=(e,t)=>{t!==Wn?(e=>{var t,n,r;const i=null===(n=null===(t=l.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(r=l.get().takeover)||void 0===r?void 0:r.topscroller;if(!i||o)return;const s=document.querySelector(i),a=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),c=document.querySelector(".advertory-welcome-page-scroll");if(!(s&&a&&c&&d))return;const u=null==s?void 0:s.offsetHeight,v=Qe(e)?"60svh":`calc(100svh - ${u}px)`,p=Qe(e)?"calc(40svh + 30px)":`calc(${u}px + 30px)`;a.style.setProperty("height",v,"important"),d.style.setProperty("height",v,"important"),c.style.setProperty("bottom",p,"important")})(e):(e=>{var t;if(!(null===(t=l.get().takeover)||void 0===t?void 0:t.splash))return;const n=document.querySelector(".advertory-splash-navbar-wrapper"),r=document.querySelector(`#${e.targetId}`);if(!n||!r)return;const i=`calc(100svh - ${n.offsetHeight}px)`;r.style.setProperty("height",i,"important")})(e)},or=lt([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n .adform-adbox {\n height: 100% !important;\n width: 100% !important;\n }\n img {\n height: 100% !important;\n width: 100% !important;\n object-fit: cover !important;\n object-position: top !important;\n }\n ",e.contentDocument.head.appendChild(t)})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),sr=(e,t=!0)=>{(e===Kn||e===Jn)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},ar=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},dr=e=>{document.body.style.overflow=e?"initial":"hidden"},lr=e=>{const t=ur(e),n=cr(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),dr(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},cr=e=>{const t=()=>lr(e);return window.addEventListener("advertory:closeTakeover",t),ar(),t},ur=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&lr(e)};return ar(),window.addEventListener("keydown",t),t},vr=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(ur(e),cr(e),ar(),t.addEventListener("click",()=>{lr(e)}),dr(!1))},pr=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),cr(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},gr=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>lr(e))})(e)},hr=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=l.get(),n=e.querySelectorAll(".advertory-splash-navbar-wrapper"),r=document.querySelector(".advertory-takeover-label");Array.from(n).forEach(e=>e.style.display="flex"),t&&r&&(r.style.display="flex",r.innerText=It.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},mr=e=>{const t=document.querySelectorAll(".advertory-topscroller-elements");Array.from(t).forEach(e=>e.style.display="flex");const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=It.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},yr=e=>{const t=document.querySelectorAll(".advertory-welcome-page-elements");Array.from(t).forEach(e=>{e.style.display="flex",e.style.animation="elementsAnimation 1.5s ease-out forwards"});const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=It.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},fr=e=>{e.classList.toggle("advertory-impact-wrapper",!0)},wr=()=>{const e=document.querySelector(".welcome-page-wrapper, .topscroller-wrapper, .advertory-splash-wrapper");if(!e)return;let t=0;new IntersectionObserver(e=>{e.forEach(e=>{var n;if(e.isIntersecting){window.dispatchEvent(new CustomEvent("advertory:takeoverInView"));(null!==(n=Array.from(e.target.classList))&&void 0!==n?n:[]).includes("advertory-splash-wrapper")&&(()=>{const e=window.scrollY||0;document.body.dataset.scrollY=e.toString(),document.body.style.top="0",document.body.classList.add("page-locked"),document.documentElement.scrollTop=0})(),t++}else t>0&&window.dispatchEvent(new CustomEvent("advertory:takeoverNotInView"))})},{root:null,rootMargin:"0px",threshold:0}).observe(e)},br=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${or})()`,e+t.outerHTML})(e)),n},Er=e=>{const t=(e=>{const{requests:t}=window.apntag,n=dt(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,r=dt(e)?1:0;n&&(n.tags[e].adResponse.ads[r].rtb.banner.content=t)})(e,br(t))},Ir=e=>{const{takeover:t}=l.get(),{targetId:n}=e,r=document.querySelector(`#${n}`),i=document.querySelector(".advertory-takeover-wrapper");if(!r||!i||!t)return;const o=(e=>{const{width:t,height:n}=e;return Zn(t,n)?Wn:st(e,w)?Gn:er()?Jn:Kn})(e),s=i.offsetHeight,a=window.scrollY>s;i.style.display="block",!a&&sr(o,!1),((e,t)=>{({[Kn]:yr,[Wn]:hr,[Jn]:mr,[Gn]:fr})[t](e)})(i,o),wr(),((e,t)=>{({[Kn]:pr,[Jn]:pr,[Wn]:vr,[Gn]:gr})[t](e)})(i,o),((e,t,n)=>{if(!n)return;({[Kn]:()=>{const{buttonLabel:r}=rr(n,t);["#advertory-welcome-page-scroll-label","#advertory-welcome-page-scroll-image"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(n.innerText=null!=r?r:"")})},[Wn]:()=>{const{themeColors:r,logotype:i,buttonLabel:o,showArrowIcon:s}=rr(n,t);["#advertory-splash-close-label",".advertory-splash-close","#advertory-splash-logotype",".advertory-splash-navbar-wrapper"].forEach(t=>{const n=e.querySelector(`${t}`);if(n){if("#advertory-splash-close-label"===t&&(n.innerText=null!=o?o:""),".advertory-splash-close"===t&&s){const e=document.createElement("img");e.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAfQAAAH0Bx0gPAAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNtdPJCYBADEDRzzRmE3ZgEV6tRHHpzELiIQrBZRajA7lk4EE2RIQjgApYgdbmY8EJaADZo3sDBKAvQa4JRYZc5D6pyJiDPMuKTCkkXp8icwxJd1mRxSC1/Q94328luJroGqNrkdyrzAfHVHzOG+8CKlLk+LO+AAAAAElFTkSuQmCC"),e.setAttribute("alt","close ad"),n.appendChild(e)}if("#advertory-splash-logotype"===t&&i&&(n.setAttribute("src",i.url),n.setAttribute("alt",i.alt)),".advertory-splash-navbar-wrapper"===t&&r){const{backgroundColor:e,color:t}=r;n.style.setProperty("background-color",null!=e?e:Vn,"important"),n.style.color=null!=t?t:zn}}})},[Jn]:()=>{const{buttonLabel:r,showArrowIcon:i,showCloseButton:o=!0}=rr(n,t);["#advertory-topscroller-scroll-label","#advertory-topscroller-scroll-image",".advertory-topscroller-close"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(".advertory-topscroller-close"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||i||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=r?r:""))})},[Gn]:()=>{}})[t]()})(i,o,t),tr(),!a&&sr(o,!0),ir(e,o)};Et(".advertory-brandmetrics-survey{width:100%}");const Ar="advertory-brandmetrics-survey",Sr=()=>N(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n}=l.get();if(!e||n)return;const r=(e=>{const{ppid1:t,ppid2:n}=Pe.getPPIDs(),{ppid1:r,ppid2:i}=ke.getPPIDs(),o=(new Ce).add(n,Q[e]).add(t,X[e]).add(i,Z[e]).add(r,ee[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{N(void 0,[e,t,...n],void 0,function*(e,t,n=!0){if(document.getElementById(t))return;const r=document.createElement("img");r.src=e,r.id=null!=t?t:"",n&&(r.style.display="none"),document.body.appendChild(r)})})(`https://sch-map.norstatsurveys.com/api/nids/${t===u.NO?"schibsted":"schibstedse"}/map/${r}`,"norstat")}),Tr={nativeAd:e=>Je(e)&&!et(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:Ge,fullscreenScroll:Ke,topscroller:e=>Ye(e)&&er(),splash:e=>Ye(e)&&Zn(e.width,e.height),welcomePage:Ye,wallpaper:Xe,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:it,hFormat:ot,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!ot(e)&&!it(e),topboard:e=>e.targetId.startsWith("topboard")&&!Ye(e),widescreen:e=>e.targetId.startsWith("widescreen"),insider:e=>e.targetId.startsWith("insider"),sponsorstripe:et,brandboard:e=>(e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!nt(e))(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!rt(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>(e=>e.targetId.startsWith("netboard"))(e)||(e=>e.targetId.startsWith("board"))(e),panorama:nt,midboard:rt},Cr=({adObj:e,preferredTestIdData:t})=>{var n,r;const i=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!i)return;const o=null===(r=document.querySelector(`#${i}`))||void 0===r?void 0:r.parentElement;if(!o)return;if(((e,t)=>{var n,r,i,o;const s=null===(o=null===(i=null===(r=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===r?void 0:r.tags)||void 0===i?void 0:i[e])||void 0===o?void 0:o.invCode;s&&(t.dataset.invCode=s)})(i,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const s="DIV"===(null==o?void 0:o.tagName);e&&s&&((e,t)=>{var n,r;for(const[i,o]of Object.entries(Tr))if(o(e)){if("nativeAd"===i){const o="default";t.dataset.testid=`${i}-${null!==(r=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==r?r:o}`;break}t.dataset.testid=i;break}})(e,o)},Pr=e=>{var t;return(null===(t=Object.entries(Tr).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},kr=new Map;kr.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),kr.set("panorama",{scale:.79,transformOrigin:"center center"}),kr.set("outstream",{scale:.79,transformOrigin:"center center"}),kr.set("integration",{scale:.79,transformOrigin:"center center"}),kr.set("toppanorama",{scale:.8,transformOrigin:"left center"});const Or=e=>{if(!((null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.clientWidth)>767&&(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.clientWidth)<=853))return;var t,n;const r=Pr(e),i=kr.get(r),o=document.querySelector(`#${e.targetId}`);if(!o||!i)return;if(o.style.transformOrigin=i.transformOrigin,o.style.transform=`scale(${i.scale})`,!(null==i?void 0:i.cogwheelAdjust))return;const s=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),a=null==o?void 0:o.offsetWidth;s&&"number"==typeof a&&!isNaN(a)&&s.style.setProperty("right",String(-1*a*.2)+"px")},xr=e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.querySelector("iframe"),r=null==n?void 0:n.parentElement,{siteSpecificConfig:{publisherClassName:i,fullWidthFormatClassName:o}={}}=l.get();if(!t||!n||!r)return;const s=window.innerWidth,a=Math.round(s/1080*1920);t.style.width="100%",t.style.height=`${a}px`,t.classList.add(`advertory-${i}-${o}__vertical-full-width-ad`);const d=((e,t)=>{const n=e.width,r=(null!=t?t:window.screen.width)/n;return r<1?r:1})(e,t.offsetWidth);r.style.transform=`scale(${d})`,r.style.transformOrigin="left top"},Lr=(e,t)=>t?Object.assign(Object.assign({},e),{"aa-sch-ssa-native-ad":"true","aa-sch-ssa-format":"NATIVE_CONTENT","aa-sch-ssa-market":"XNO","aa-sch-ssa-cat":["ssa_1","ssa_2","ssa_3","ssa_4","ssa_5","ssa_6","ssa_7","ssa_8","ssa_9","ssa_10","ssa_11","ssa_12","ssa_13","ssa_14","ssa_15","ssa_16","ssa_17","ssa_18","ssa_19","ssa_20","ssa_21","ssa_22","ssa_23","ssa_24","ssa_25","ssa_26","ssa_27","ssa_28","ssa_29","ssa_30"]}):e,jr=e=>`externalImpId:'${e}'`,$r=e=>{var t;const{forwardExternalImpId:n=!1,tracker:r}=l.get(),i=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${p()}-count`],r=e.positionConfig.find(e=>e.adPositionIndex===n);if(!r)return e;const i=r.keywords?Object.assign(Object.assign({},e.keywords),r.keywords):e.keywords;return Object.assign(Object.assign({},e),{sizes:null!==(t=null==r?void 0:r.sizes)&&void 0!==t?t:e.sizes,keywords:i})})(e),{id:o,sizes:s,keywords:a,allowedFormats:d,invCode:c,ssa:u=!1,nativeCustomProperties:v,safeframeConfig:g,resizeAdParentDiv:h=!1,dynamicSizeWidthCheck:m=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Qn())return e;const n=null===(t=e.keywords)||void 0===t?void 0:t["no-sno-adformat"],r=null==n?void 0:n.filter(e=>e!==Jn),i=Object.assign(Object.assign({},e.keywords),n&&{"no-sno-adformat":r}),o=e.sizes.filter(([e,t])=>4!==e||4!==t);return Object.assign(Object.assign({},e),{sizes:o,keywords:i})})(i),y=Object.assign({invCode:c,sizes:s,targetId:o,keywords:Lr(a,u),allowedFormats:d,resizeAdParentDiv:h,dynamicSizeWidthCheck:m},g&&{safeframeConfig:g}),f=(e=>{var t,n,r,i,o,s,a;return e?(null===(t=null==e?void 0:e.instance)||void 0===t?void 0:t.state)?(null===(r=null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)||void 0===r?void 0:r.pageViewId)?(_("Tracker state pageViewId is:",null===(o=null===(i=null==e?void 0:e.instance)||void 0===i?void 0:i.state)||void 0===o?void 0:o.pageViewId),null===(a=null===(s=null==e?void 0:e.instance)||void 0===s?void 0:s.state)||void 0===a?void 0:a.pageViewId):(_("Tracker state does not contain field pageViewId or it is empty"),""):(_("Tracker state is empty"),""):(_("Tracker is not configured in initAdvertory function"),"")})(r);n&&f&&(_("External Impression ID assigned to defineTag:",jr(f)),y.externalImpId=jr(f));const w=(e=>Object.entries({video:{required:!1},address:{required:!1},saleprice:{required:!1},rating:{required:!1},price:{required:!1},phone:{required:!1},likes:{required:!1},downloads:{required:!1},customIcon2:{required:!1}}).reduce((t,[n,r])=>((null==e?void 0:e.includes(n))&&(t[n]=r),t),{customTitle1:{required:!1},customTitle2:{required:!1},customTitle3:{required:!1},customTitle4:{required:!1},title:{required:!1},body:{required:!1},image:{required:!1},icon:{required:!1},sponsoredBy:{required:!1},cta:{required:!1},clickUrl:{required:!1},desc2:{required:!1},displayUrl:{required:!1},description:{required:!1}}))(v);return(null===(t=e.allowedFormats)||void 0===t?void 0:t.includes("native"))&&(y.native=w),y},Nr=e=>{if(!e)return e;const t=e[`${v()}-targetid`],n=t?Ot(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${v()}-targetid`]:[n]})},_r=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${v()}-geo`]&&{[`${v()}-geo`]:["geo-test-value"]}),e[`${v()}-geofence`]&&{[`${v()}-geofence`]:["geofence-test-value"]}),e[`${v()}-weather`]&&{[`${v()}-weather`]:["weather-test-value"]}),Dr=e=>{(e=>{const t=new URLSearchParams(window.location.search);if("true"!==t.get("scrollToFirstInvCode"))return;const n=t.get("ast_override_inv_code");if(!n)return;const r=n.split(",")[0].split(":")[0],i=e.find(e=>e.invCode===r),o=document.querySelector(`[id^=${null==i?void 0:i.id}]`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})})(e),(()=>{var e;const t=new URLSearchParams(window.location.search).get("scrollToDrEditionPlacement");if(!t)return;const n=null!==(e=document.querySelector(`[id*="${t}}"]`))&&void 0!==e?e:document.querySelector(`a[aria-label*="${t}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"start"})})()},qr=()=>N(void 0,void 0,void 0,function*(){try{(()=>{const e=document.createElement("script");e.setAttribute("src","https://ads.inventory.schibsted.io/ad-service/ad-banner-sponsor-advertisement/ad.js"),e.setAttribute("type","text/javascript"),e.setAttribute("async","true"),document.head.appendChild(e)})(),(()=>{const e=document.createElement("div");e.setAttribute("id","ads-advertory-anchor"),e.classList.add("subscribe_box"),e.classList.add("ad-box"),e.classList.add("leftAd"),e.classList.add("netboard"),e.classList.add("advert"),e.classList.add("module"),e.classList.add("banner"),e.classList.add("leaderboard"),e.classList.add("adsbygoogle"),e.classList.add("ad-banner"),e.classList.add("ad-container"),e.classList.add("adsbox"),e.classList.add("sidebar-ads"),e.classList.add("banner-ads"),e.style.opacity="0",e.style.width="1px",e.style.height="1px",e.style.minWidth="0px",e.style.minHeight="0px",e.style.maxWidth="1px",e.style.maxHeight="1px",e.style.position="absolute",e.style.top="0",e.style.boxSizing="border-box",e.style.margin="0",e.style.padding="0",document.body.appendChild(e)})()}catch(e){console.error("Error running adblock scripts:",e)}}),Mr={arrayMerge:(e,t)=>t},Rr=e=>N(void 0,void 0,void 0,function*(){if(!(e=>{const{editableConfiguration:{useS3Config:t=!1,pageTypeToFetch:n}={},siteSpecificConfig:r}=e;return Boolean(t&&n&&(null==r?void 0:r.publisherClassName))})(e))return e;try{const t=yield(e=>N(void 0,void 0,void 0,function*(){const t=(e=>{const{siteSpecificConfig:t,editableConfiguration:{pageTypeToFetch:n}={}}=e;return(null==t?void 0:t.publisherClassName)&&n?`https://alertory-cdn.staging.inventory.schibsted.io/editable-configurations/${t.publisherClassName}/${n.toUpperCase()}.json`:null})(e);if(!t)return null;const n=new AbortController,r=setTimeout(()=>n.abort(),5e3);try{return yield ve.get(t,{method:"GET",signal:n.signal})}catch(e){throw _("Failed to fetch S3 config",{error:e,url:t}),e}finally{clearTimeout(r)}}))(e);return t?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:r,refresh:o,placements:s,threshold:a,batchSize:d}=t,l=i.all([e.placements,s],Mr),c=i(e.pageOptions,{keywords:r},Mr),u=i(e.appearanceConfig,{defaultThreshold:a},Mr),v=i(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:o},Mr);return Object.assign(Object.assign({},e),{placements:l,requestSize:null!=d?d:e.requestSize,pageOptions:c,appearanceConfig:u,refreshConfig:v})})({siteConfig:e,configOverrides:t}):e}catch(t){return _("Error fetching S3 config, using site config",{error:t}),e}});let Br,Fr=[];const Hr=["takeover","wallpaper"],Ur=e=>{const t=(e=>{const t=Ne.getData("alertoryConfigKeywords"),{queryConfig:n,placements:r,tcf:i,glimr:o,appearanceConfig:s,requestSize:d=a,publisher:l,country:c,pageType:u,deviceType:v,isMobileApp:p=!1,pageOptions:{member:g},takeover:h,fullscreenScroll:m}=e;return{xandr:{member:g,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:l,country:c,pageType:u,deviceType:v,placements:r,tcf:i,requestSize:d,isMobileApp:p},o&&{glimr:o}),n&&{queryConfig:n}),s&&{appearanceConfig:s}),h&&{takeover:h}),m&&{fullscreenScroll:m})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},Vr=()=>N(void 0,void 0,void 0,function*(){const{pageOptions:e}=l.get(),{preparePageOptions:t}=l.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=l.get();return{sandboxAdIframe:e,sandboxAttributes:["allow-same-origin","allow-scripts","allow-top-navigation-by-user-activation","allow-popups","allow-popups-to-escape-sandbox","allow-forms"]}})(),r=yield t(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},e),{renderingManagement:Object.assign({},n)}));(e=>{const t=Ne.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=_r(e);Ne.setData("alertoryConfigKeywords",n)})(r.keywords),Ve(()=>Br.setPageOpts(r))}),zr=e=>{const{prebid:t}=l.get();Wr(e),(null==t?void 0:t.enabled)?(_("core loadPlacements prebid enabled"),Re()):(_("core load tags invoked without prebid enabled"),Kr(e))},Wr=e=>{const{prepareTag:t}=l.getHandlers(),n=[];(e=>{const t=["skyscraperright_1","topboard","wallpaper","skyscraperleft_1"];return e.sort((e,n)=>{const r=t.findIndex(t=>e.id.includes(t)),i=t.findIndex(e=>n.id.includes(e));return-1!==r&&-1===i?-1:-1===r&&-1!==i?1:r-i})})(e).forEach(e=>{_("core defineTags",{placement:e});const r=$r(e);if(!e.id.includes("takeover")||Qn()){const i=t(r),o=(e=>{const{allowedFormats:t,invCode:n,keywords:r,sizes:i}=e;return{adTypes:t,invCode:n,keywords:Nr(r),sizes:i}})(i);n.push(o),Ve(()=>(_("core defineTag - add to the queue",{placement:e,preparedTag:i}),Br.defineTag(i)))}}),(e=>{var t,n,r;(null===(r=null===(n=null===(t=window.advertory)||void 0===t?void 0:t.alertoryConfig)||void 0===n?void 0:n.xandr)||void 0===r?void 0:r.tags)&&e.length&&window.advertory.alertoryConfig.xandr.tags.push(e)})(n)},Kr=e=>{const t=e.map(({id:e})=>e);Ve(()=>(_("core loadTags",{placementsIdsToLoad:t}),Br.loadTags([...t])))},Jr=(e,t)=>N(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:r}=l.get(),{threshold:i,refresh:o,priority:s="normal"}=e,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),d=null==n?void 0:n.defaultThreshold[r];a&&(_("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:i,deviceDefaultThreshold:d}),yield Tn(a,null!=i?i:d)),a&&o&&(_("core showAd - setup refreshing",{placement:e,adObj:t}),a.dataset.refresh=o.toString(),a.dataset.priority=s)}),Gr=e=>e.some(({id:e})=>Hr.some(t=>e.includes(t))),Yr=e=>N(void 0,void 0,void 0,function*(){var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return;const n=6,{requestSize:r=n}=l.get(),i=Vt(e);for(const e of Object.keys(i)){const t=i[e];Gr(t)?zr(t):t.length&&Qr(t,r)}}),Qr=(e,t)=>{const n=_n(e,t);for(const e of n)_("core loadAds with lazy loading",{placementsToLoad:e}),Xr(e)},Xr=e=>{const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=l.get(),r=[];if(!t)return _("lazy load is not enabled",{placements:e}),void zr(e);const i=new IntersectionObserver((t,n)=>{t.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(t=>{_("lazy load is enabled - handler start",{loadedPlacementIds:r,placements:e});const i=e.every(e=>r.includes(e.id)),o=e.map(e=>e.id);!i&&r.push(...o),!i&&zr(e),_("lazy load is enabled - handler stop",{loadedPlacementIds:r,placements:e,arePlacementsLoaded:i,placementIds:o}),n.disconnect()})},{rootMargin:n});e.forEach(e=>{const t=document.getElementById(e.id);t&&(_("lazy loading - observe element",{placementId:e.id,element:t}),i.observe(t))})},Zr=()=>N(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:t,wallpaperHandlers:{initWallpaperAd:n,adjustAdToHorseshoe:r}}=l.getHandlers(),{wallpaper:i,fullscreenScroll:o}=l.get(),s=[];Ve(()=>{Br.onEvent("adRequested",()=>{e.adRequested()}),Br.onEvent("adAvailable",r=>N(void 0,void 0,void 0,function*(){var s,a,d,c,u,v;_("core adAvailable start",{placementsAvailable:Fr,adObj:r,isFullscreenScrollAd:Ke(r),isFinnBlink:tt(r.targetId),isNativeAd:Je(r),isMediation:L(r),isTakeoverAd:Ye(r),isCollapseAd:Ze(r),isWallpaperAd:Xe(r)});const p=null===(d=null===(a=null===(s=null===window||void 0===window?void 0:window.apntag)||void 0===s?void 0:s.requests)||void 0===a?void 0:a.tags[r.targetId])||void 0===d?void 0:d.adResponse.ads;L(r)&&p&&(null===(c=p[1])||void 0===c?void 0:c.rtb)&&(r.banner=null===(v=null===(u=p[1])||void 0===u?void 0:u.rtb)||void 0===v?void 0:v.banner),Ke(r)&&kt(r),Ke(r)&&!tt(r.targetId)&&Pt(r,o),!Je(r)||L(r)||tt(r.targetId)||t(r,l.get()),Ye(r)&&!Ze(r)&&(Er(r.targetId),Ir(r)),Xe(r)&&(n(()=>Ve(()=>window.apntag.showTag(r.targetId)),i),Ne.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(r)&&Ne.setData("horseshoe",{isAvailable:!0}),Cr({adObj:r}),(e=>{var t;const n=null==e?void 0:e.targetId;if(!n)return;const r=null===(t=document.querySelector(`#${n}`))||void 0===t?void 0:t.parentElement;r&&((e,t)=>{const{height:n,width:r,native:i}=e;i?t.dataset.adSizes="[1,1]":n&&r&&(t.dataset.adSizes=`[${r},${n}]`)})(e,r)})(r),e.adAvailable(r);const g=Fr.find(({id:e})=>e===r.targetId);g&&(yield Jr(g,r),Fr=Fr.filter(e=>e.id!==g.id)),_("core adAvailable stop",{placementsAvailable:Fr,adObj:r,isFullscreenScrollAd:Ke(r),isFinnBlink:tt(r.targetId),isNativeAd:Je(r),isMediation:L(r),isTakeoverAd:Ye(r),isCollapseAd:Ze(r),isWallpaperAd:Xe(r)})})),Br.onEvent("adLoaded",n=>{const{refreshConfig:i,appearanceConfig:o}=l.get(),a=document.getElementById(n.targetId);tt(n.targetId)&&(e=>{const{fullscreenScroll:t}=l.get(),{initNativeAd:n}=l.getHandlers();Ke(e)&&Pt(e,t),Je(e)&&n(e,l.get())})(n);s.includes(n.targetId)&&Je(n)&&(t(n,l.get()),Cr({adObj:n})),!s.includes(n.targetId)&&L(n)&&s.push(n.targetId),Ze(n)&&_t(n.targetId),Ye(n)&&((e,t)=>{var n;const r="100%",i="100%";e.resizeAd(t,[r,i]);const o=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(o),t=e.width,n=e.height;t===r&&n===i||(o.style.width=r,o.style.height=i)}}).observe(o,{attributes:!0,attributeFilter:["style"]})})(Br,n.targetId),Ge(n)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:r}={}}=l.get();if(!t||!n||!r)return;const i=t.parentElement;i&&(t.classList.add(`advertory-${n}-${r}__full-width-ad`),i.classList.add(`advertory-${n}-${r}-wrapper__full-width-ad`))})(n),(e=>st(e,m))(n)&&xr(n),Mn(n,i),(null==o?void 0:o.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(n.targetId);var d,c;Ne.getData("horseshoe").isAvailable&&r(n.targetId),e.adLoaded(n),d=n.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${d}`)&&(null===(c=window.gdpr)||void 0===c?void 0:c.setupButton)&&window.gdpr.setupButton(d),a&&a.classList.add("ad-loaded"),Or(n),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:n.targetId,adFormat:Pr(n)}}))}),Br.onEvent("adNoBid",t=>N(void 0,void 0,void 0,function*(){_t(t.targetId),yield vn(l.get(),t),nr(t)&&tr(),e.adNoBid(t)})),Br.onEvent("adError",(t,n)=>{nr(n)&&tr(),e.adError(t,n)}),Br.onEvent("adCollapse",()=>{e.adCollapse()}),Br.onEvent("adRequestFailure",t=>{_t(t.targetId),e.adRequestFailure(t)}),Br.onEvent("adBadRequest",t=>{_t(t.targetId),e.adBadRequest(t)}),Br.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),Br.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),ei=(e,t)=>N(void 0,void 0,void 0,function*(){var n,r;l.set(e),l.setHandlers(t),Ne.initialize(),window.addEventListener("message",In,!1),Br=window.apntag||{anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}},window.apntag=Br,_("Apn tag is set up on window"),yield ge(),_("User permission has been fetched"),yield Promise.allSettled([N(void 0,void 0,void 0,function*(){const{prebid:e}=l.get();(null==e?void 0:e.enabled)&&(yield Me(null==e?void 0:e.url))}),(n={country:e.country,tracker:e.tracker},N(void 0,[n],void 0,function*({country:e,tracker:t,timeout:n=1e3}){t&&(yield Promise.allSettled([Pe.processPPIDs(t,n),ke.processPPIDs(t,e)])).forEach((e,t)=>{"rejected"===e.status&&_(`Cannot fetch PPIDs v${t+2}`,e.reason)})})),N(void 0,void 0,void 0,function*(){const{astUrl:e}=l.get();yield Me(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),N(void 0,void 0,void 0,function*(){const{gptUrl:e}=l.get();yield Me(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),N(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n}=l.get(),{getConsentSync:r}=R(n),i=r();if(e&&t&&i){if(yield Me(t),document.querySelector(`.${Ar}`))return window._brandmetrics=window._brandmetrics||[],void window._brandmetrics.push({cmd:"_loadsurvey"});new MutationObserver((e,t)=>{for(const n of e){if("childList"!==n.type)return;Array.from(n.addedNodes).some(e=>{var t;return null===(t=e.outerHTML)||void 0===t?void 0:t.includes(Ar)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),we(),N(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=l.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield Me(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield Sr(),_("Libraries have been loaded and trackers have been set"),yield(r=t.librariesToLoad,N(void 0,void 0,void 0,function*(){const e=r.map(e=>Me(e));yield Promise.all(e)})),yield Zr(),yield Vr(),_("Page options have been set"),Ur(e),_("Advertory is setup on window"),Fr=Ht(),Rn(Fr),Bn(Fr),yield Yr(Fr),_(`Ads has been loaded ${Fr}`),Dr(Fr),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>N(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;const n=yield se(),r=new ae(n);cn({publisher:e.publisher,drEditionConfig:e.drEdition,device:e.deviceType,pageType:e.pageType,country:e.country},r,null===(t=e.pulse)||void 0===t?void 0:t.instance)}))(e)}),ti=(e,t)=>N(void 0,void 0,void 0,function*(){const{initConsentManager:n}=R(e.tcf),r=yield Rr(e);var i;yield qr(),yield(i=n,N(void 0,void 0,void 0,function*(){return yield new Promise(e=>{i().then(t=>{e(null!=t?t:null)}).catch(t=>{e(null)})})})),_("TCF resolved successfully"),yield ei(r,t),_("Run function resolved successfully")}),ni=((e,t)=>n=>{return r=Object.assign(Object.assign({},n),{siteSpecificConfig:t}),i=e,N(void 0,void 0,void 0,function*(){yield ti(r,i)});var r,i})({initNativeAd:Ue,wallpaperHandlers:{initWallpaperAd:Ue,adjustAdToHorseshoe:Ue},loadFinnBlinkAd:He,replaceAdsWithFinnBlink:He,preparePageOptions:je,prepareTag:e=>{const{keywords:t,targetId:n,invCode:r}=e,i=(e=>{const{isMobileApp:t}=l.get();return t?(e=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":"atb"))(e):e})(r),o=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,r=`${v()}-adformat`,i=t?t[r]:[];if(!i)return{};const o=(Array.isArray(i)?i:[i]).filter(e=>!(e in A)||window.innerWidth>=A[e]);return{[r]:n?o:i}})(e),s=(e=>{const t=`${v()}-targetid`;return e?{[t]:[e]}:{}})(n),a=S(),d=(e=>$(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(r),c=((e,t)=>$(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{})(r);return Object.assign(Object.assign({},e),{invCode:i,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),o),s),d),a),rendererOptions:c})},siteEvents:e,librariesToLoad:[]},{publisherClassName:x,fullWidthFormatClassName:"panorama",classesToRemoveOnRefresh:[]}),ri=Et("[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-slider-time{display:none}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container{padding:0 6px;height:36px}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon{margin-right:3px;height:unset;width:unset;bottom:0}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-volume,[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-playback{display:flex}");var ii=Object.freeze({__proto__:null,default:ri});exports.initAdvertoryPackage=ni,exports.updateAdvertory=(e,t)=>N(void 0,void 0,void 0,function*(){var n;if(!(null===(n=null===window||void 0===window?void 0:window.advertory)||void 0===n?void 0:n.initialized))return[];const{clearAds:r,reloadExistingAds:i,renderFinnBlinkPlacements:o,contextSelector:s}=null!=t?t:{};if(r)return Rt(),[];i&&(Rt(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{Dt(e.id)})),c(null!=e?e:{}),yield Vr();let a=Ht(s);return o&&(a=a.filter(e=>tt(e.id))),a.length>0&&(Fr=[...Fr,...a.map(e=>Object.assign({},e))],Rn(a),Bn(a),yield Yr(a)),Fr});
|
|
1
|
+
"use strict";require("react/jsx-runtime");const e={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r;var i=t(function(){if(r)return n;r=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map(function(e){return i(e,n)})}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function d(e,t,n){var r={};return n.isMergeableObject(e)&&s(e).forEach(function(t){r[t]=i(e[t],n)}),s(t).forEach(function(o){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(a(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):r[o]=i(t[o],n))}),r}function l(t,n,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||e,r.cloneUnlessOtherwiseSpecified=i;var s=Array.isArray(n);return s===Array.isArray(t)?s?r.arrayMerge(t,n,r):d(t,n,r):i(n,r)}return l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return l(e,n,t)},{})},n=l}());const o=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],s={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},a=6;class d{set(e){this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of o){const r=e[n];void 0!==r&&(t[n]=r)}Object.assign(this.config,t),Object.prototype.hasOwnProperty.call(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=i(d.DEFAULT_SITE_HANDLERS,e)}}d.DEFAULT_SITE_HANDLERS={siteEvents:s,initNativeAd:function(){}};const l=new d,c=l.modifyConfigProperties.bind(l),u={NO:"no",SE:"se"},v=()=>{const{country:e}=l.get();return e===u.NO?"no-sno":"se-generic"},p=()=>{const{country:e,publisher:t}=l.get();return`${e}-${t}`},g="ABSOLUTE_FULLSCREEN",h="ANY_FULLSCREEN",m="VERTICAL_FULLWIDTH",y="FULLWIDTH",f="TAKEOVER",w="VELVET_TAKEOVER",b="WALLPAPER",E="COLLAPSE",I={ANY_FULLSCREEN:[{width:6,height:6},{width:1920,height:1080},{width:3,height:3}],ABSOLUTE_FULLSCREEN:[{width:6,height:6}],VERTICAL_FULLWIDTH:[{width:1080,height:1920}],FIXED_FULLSCREEN:[{width:1920,height:1080},{width:3,height:3}],FULLWIDTH:[{width:5},{width:400,height:400}],NATIVE_AD:[{width:1,height:1}],TAKEOVER:[{width:4,height:4}],VELVET_TAKEOVER:[{width:7,height:7}],WALLPAPER:[{width:2,height:2}],COLLAPSE:[{width:2,height:1}]},A={wallpaper:1600,"l-format":1600},S=()=>{if(!window.location.search.includes("kv_"))return{};const e={},t=(()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e)})();return Object.keys(t).forEach(n=>{n.startsWith("kv_")&&(e[n.slice(3)]=t[n])}),e},T="svd",C="vg",P="godare",k="aftonbladet",O="e24",x="tv4",L=e=>{const{source:t}=e;return"csm"===t},j={[C]:["board","netboard","backfill","outstream"],[k]:["panorama","outstream"],[P]:["panorama","outstream"],[T]:["wph-article-panorama","wph-front-panorama"]},$=e=>{var t;const{publisher:n}=l.get();return!!j[n]&&!!(null===(t=j[n])||void 0===t?void 0:t.some(t=>e.includes(t)))};function N(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{d(r.next(e))}catch(e){o(e)}}function a(e){try{d(r.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}d((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const _=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},D="cmp:loaded";let q,M=!1;const B=e=>{const t=!!(null==e?void 0:e.enabled),n=(null==e?void 0:e.timeout)||3e3,r=(i="bypass_tcf",new URLSearchParams(window.location.search).get(i));var i;const o=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(_("TCF bypass param detected, returning consent: true"),!0):(_("TCF is not enabled, returning consent: true"),!0))(t,r))return!0;if(M)return null;if(!q)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const n=q.getConsentedToAllSync();return _(`TCF consented to all is: ${n}`),q.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(_("Getting TCF consent manager..."),window._tcf_)return _("TCF consent manager is already available"),q=window._tcf_,void e(q);_("TCF consent manager is not available");const r=()=>{_("CMP loaded, resolving consent manager..."),i&&clearTimeout(i),window._tcf_?(q=window._tcf_,e(q)):t(new Error("CMP loaded but window._tcf_ is not defined"))},i=setTimeout(()=>{document.removeEventListener(D,r),M=!0,t(new Error("Timeout waiting for CMP to load"))},n);_("Listening for CMP loaded event..."),document.addEventListener(D,r,{once:!0})}):Promise.resolve(null),getConsentSync:o,getConsentAsync:()=>N(void 0,void 0,void 0,function*(){const t=o();return!(null==e?void 0:e.enabled)||(null!==t?t:yield new Promise((e,t)=>{try{if(!q)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");q.isConsentedToAll(t=>{e(t)})}catch(e){t(e)}}))})}};function R(e){const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null}const F={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},H=9826;class U{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=F.DESKTOP,isMobileApp:t}=l.get();if(t){return{"aa-sch-supply_type":`app_${e===F.MOBILE?"phone":F.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return N(this,void 0,void 0,function*(){return Object.assign(Object.assign({},e),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},e.keywords),this.getSupplyTypeKeywords()),this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(e.keywords)),user:{externalUid:this.getExternalUid(),dnt:this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){const e=this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}}getUserId(){return function(){const e=R("_pulse2data");return e?e.split(",")[2]:void 0}()}getExternalUid(){return function(){const{tcf:e}=l.get(),{getConsentSync:t}=B(e);if(!t())return;const n=R("_pulse2data");return n?n.split(",")[9]:void 0}()}isTrackingForbidden(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===this.getExternalUid()}getMember(){const{pageOptions:{member:e},testMember:t=H}=l.get();return window.location.search.includes("inventory_test=true")?t:e}getCMPValue(e){return localStorage.getItem(`CMP:${e}`)?"0"===localStorage.getItem(`CMP:${e}`)?"0":"1":"0"}getPublisherKeywords(){const{publisher:e}=l.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return N(this,void 0,void 0,function*(){const{tcf:e}=l.get(),{getConsentAsync:t}=B(e);return{"aa-sch-cmp_advertising":(yield t())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=l.get();return{"aa-sch-page_type":e}}getCountryCodeKeywords(e){return{"aa-sch-country_code":e}}getInventoryTypeKeywords(){return{"aa-sch-inventory_type":"editorial"}}getHasContextKeywords(e){const t=e["aa-sch-context_keyword"];return{"aa-sch-has_context_keyword":Array.isArray(t)&&t.length?1:0}}getPageOptionsFormatDevice(e="desktop"){return"mobile"===e?"phone":e}getSponsorsKeywords(){var e;const{publisher:t,keywordsConfig:n}=l.get(),r=null===(e=null==n?void 0:n.sponsors)||void 0===e?void 0:e.split(":").map(e=>`${t}_${e}`);return r?{"no-sno-news-sponsors":r}:{}}}const V=new U;V.prepare.bind(V);function z(e=!1){var t,n;const r=null===(n=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===n?void 0:n.toLocaleLowerCase(),i=(()=>{const e=window.navigator.userAgent.toLowerCase(),t=[["win","windows"],["macintosh","macos"],["x11","linux"],["android","android"],["ipad","ios"],["iphone","ios"]].find(([t])=>e.includes(t));return t?t[1]:"unknown"})();return{OS:i,mobileOS:["ios","android"].includes(i)?i:"unknown",isHybridApp:r.includes("hermes"),appMode:e?"hybrid":"notinapp"}}class W extends U{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=F.DESKTOP}=l.get();return{"se-generic-sitemode":this.getPageOptionsFormatDevice(e)}}}getScreenKeywords(){const e=function(){const e=window.innerWidth,t=window.innerHeight,n=document.documentElement.clientWidth,r=document.documentElement.clientHeight;return{width:e||n||0,height:t||r||0}}(),t={width:null!==(r=null===(n=window.screen)||void 0===n?void 0:n.width)&&void 0!==r?r:0,height:null!==(o=null===(i=window.screen)||void 0===i?void 0:i.height)&&void 0!==o?o:0};var n,r,i,o;return{"se-generic-viewportheight":e.height,"se-generic-viewportwidth":e.width,"se-generic-screenheight":t.height,"se-generic-screenwidth":t.width}}getExternalIdSrc(){const e=this.getExternalUid(),t=this.getUserId();return e?{"se-generic-externalid_src":Number(!!e)+Number(!!t)}:{"se-generic-externalid_src":0}}getAppTypeKeywords(){const{isMobileApp:e}=l.get(),{appMode:t,mobileOS:n}=z(e);return{"se-generic-appmode":t,"se-generic-mobileos":n}}getPublisherGroup(){return{"se-generic-publishergroup":"schibsted"}}}const K=864e5,J=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return _("Error with parsing localStorage data"),null}},t=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:t,setWithTimestamp:(e,n,r=K)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=K)=>{const r=e(t);if(!r)return null;if(!n)return r;try{const{expirationTime:e,data:t}=JSON.parse(r);return(new Date).getTime()<=e?t:null}catch(e){return _("Error with parsing localStorage data"),null}}}})(),G={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return _(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,t)=>{try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){_(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){_(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},Y="advertory:ppids-cache",Q={[u.SE]:`SCH${u.SE.toUpperCase()}-EnvHash`,[u.NO]:`SCH${u.NO.toUpperCase()}-EnvHash`},X={[u.SE]:`SCH${u.SE.toUpperCase()}-UserHash`,[u.NO]:`SCH${u.NO.toUpperCase()}-UserHash`},Z={[u.SE]:`sch${u.SE}-envhash-v3`,[u.NO]:`sch${u.NO}-envhash-v3`},ee={[u.SE]:`sch${u.SE}-userhash-v3`,[u.NO]:`sch${u.NO}-userhash-v3`},te={[u.SE]:`'sch${u.SE}-iosid-v3'`,[u.NO]:`'sch${u.NO}-iosid-v3'`},ne={[u.SE]:`sch${u.SE}-androidid-v3`,[u.NO]:`sch${u.NO}-androidid-v3`},re={[u.SE]:"sdrn:schibsted.com:user",[u.NO]:"sdrn:spid.no:user"},ie=e=>N(void 0,void 0,void 0,function*(){const t=yield e.getEnvironmentId();if(!t)return null;return`sdrn:schibsted:environment:${t}`}),oe=(e,t)=>N(void 0,void 0,void 0,function*(){const n=yield e.getUserId();if(!n)return null;return`${re[t]}:${n}`}),se=()=>N(void 0,void 0,void 0,function*(){return yield new Promise(e=>{if("undefined"!=typeof window)if(window.Identity)e(window.Identity);else{const t=()=>{e(window.Identity)};window.addEventListener("identity-initialized",t,{once:!0})}else e(void 0)})});class ae{constructor(e){this.identity=e,this.getIdentityUser=this.getIdentityUser.bind(this),this.isUserLoggedIn=this.isUserLoggedIn.bind(this),this.onIdentityLogout=this.onIdentityLogout.bind(this)}getIdentityUser(){return N(this,void 0,void 0,function*(){var e;try{const t=yield null===(e=this.identity)||void 0===e?void 0:e.getUser();return null!=t?t:null}catch(e){return _("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return N(this,void 0,void 0,function*(){var e,t;return null!==(t=yield null===(e=this.identity)||void 0===e?void 0:e.isLoggedIn())&&void 0!==t&&t})}onIdentityLogout(e){var t;null===(t=this.identity)||void 0===t||t.on("logout",e)}}const de="advertory-session",le=e=>{const{privacyBroker:{storageKeyPrefix:t=de}={}}=l.get();return t+"-"+e},ce=()=>{const{privacyBroker:{storageKeyPrefix:e=de}={}}=l.get(),t=sessionStorage;for(const n in t)0===n.indexOf(e+"-")&&G.remove(n)},ue={LOCAL:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",DEV:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",PRE:"https://user-permissions.privacy-pre.schibsted.io/privacy/v2",PRO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_NO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_FI:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_DK:"https://user-permissions.privacy.schibsted.com/privacy/v2"},ve={get:(e,t)=>N(void 0,void 0,void 0,function*(){const n=yield fetch(e,t);if(!n.ok)throw new Error(n.statusText);return yield n.json()}),post:(e,t,n)=>N(void 0,void 0,void 0,function*(){const r=JSON.stringify(n),i=yield fetch(e,{method:"POST",headers:t,body:r});if(!i.ok)throw new Error(i.statusText);return yield i.json()})},pe=e=>N(void 0,[e],void 0,function*({endpoint:e,identityFacade:t,environment:n}){var r;ce();const i=yield(e=>N(void 0,void 0,void 0,function*(){const t=new Headers;t.set("Content-Type","application/json");const n=yield e.getIdentityUser();return n&&t.set("Authorization",`SPIDSIG ${n.sig}`),t}))(t);try{const t=null!==(r=ue[n])&&void 0!==r?r:ue.PRO;return yield ve.get(`${t}${e}`,{headers:i})}catch(e){return _("[PrivacyBroker] Failed to fetch permissions",e),null}}),ge=()=>N(void 0,void 0,void 0,function*(){var e,t;const{privacyBroker:{enabled:n,clientId:r}={},tracker:{instance:i}={},country:o}=l.get();if(!n||!i||!r)return _("[Privacy Broker]: Data not present",{enabled:n,trackerInstance:i}),null;const s=yield se(),a=new ae(s);if(!s||!a)return _("[Privacy Broker]: Data not present",{identity:s,identityFacade:a}),null;const d=yield a.isUserLoggedIn();a.onIdentityLogout(()=>{_("[Privacy Broker]: clearPermissions"),ce()}),_("[Privacy Broker]: Creating endpoint for fetching permissions started");const c=null!==(e=yield oe(i,o))&&void 0!==e?e:"",u=null!==(t=yield ie(i))&&void 0!==t?t:"",v=d?c:u,p=yield((e,t,n)=>N(void 0,void 0,void 0,function*(){const r=`/schacc/${t}/user/${n}/permissions`,i=`/anonymous/${t}/user/${n}/permissions`;return(yield e.getIdentityUser())?r:i}))(a,r,v);_(`[Privacy Broker]: Endpoint created ${p}`);const g=(e=>!!G.get(le(e)))(v),h=le(v);if(g){_("[Privacy Broker]: SessionStorage cached",{key:h,permissions:sessionStorage.getItem(h)});return G.get(h)}_("[Privacy Broker]: Fetching permissions...");const m=yield(e=>N(void 0,[e],void 0,function*({endpoint:e,timeout:t,identityFacade:n,environment:r}){return yield Promise.race([pe({endpoint:e,environment:r,identityFacade:n}),new Promise(e=>setTimeout(()=>e(null),t))])}))({endpoint:p,timeout:500,identityFacade:a,environment:s.env});return m?(_("[Privacy Broker]: Permissions fetched",m),f=v,(null==(y=m)?void 0:y.permissions)&&G.set(le(f),y.permissions),m):(_("[Privacy Broker]: Permissions not found",{permissions:m,isLoggedIn:d,identifiedId:v,country:o}),null);var y,f}),he="glimrTags",me=["glwe_","glwet_"],ye={geofenceTags:[],geoTags:[],weatherTags:[]},fe=()=>N(void 0,void 0,void 0,function*(){const{privacyBroker:e}=l.get();if(null==e?void 0:e.enabled){const e=(e=>{const t=null==e?void 0:e.find(e=>e.purpose.includes("targeted_advertising"));if(_("targeted_advertising permissions",t),!(null==t?void 0:t.data)||!Array.isArray(null==t?void 0:t.data))return!1;const n=null==t?void 0:t.data.find(e=>e.includes("geolocation"));return _("geolocation permission",n),!!n})(yield N(void 0,void 0,void 0,function*(){var e,t;const{country:n,tracker:{instance:r}={}}=l.get(),i=yield se();if(!r||!i)return _("[Privacy Broker] No tracker found."),null;const o=new ae(i),s=yield o.isUserLoggedIn(),a=null!==(e=yield oe(r,n))&&void 0!==e?e:"",d=null!==(t=yield ie(r))&&void 0!==t?t:"",c=le(s?a:d);return G.get(c)||null}));return e}return!0}),we=()=>N(void 0,void 0,void 0,function*(){const{glimr:e}=l.get();if(!(yield fe())||!(null==e?void 0:e.enabled))return void _("No consent for glimr data fetching.");const t=yield(n=500,N(void 0,void 0,void 0,function*(){return yield Promise.race([N(void 0,void 0,void 0,function*(){const e=yield import("glimr-sdk");return e.default||e}),new Promise(e=>setTimeout(()=>e(!1),n))])}));var n;if(t)try{t.setTagCacheTimeInSeconds(300),yield new Promise(n=>{t.getTags(e.clientId,(e,t)=>{J.setWithTimestamp(he,{tags:e,tagMappings:t}),n(!0)})})}catch(e){_(`Error during getting glimr data: ${e}`)}else _("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),be={svd:"svd",vg:"vg",godare:"godare",aftenposten:"no-aftenposten",sa:"no-stavangeraftenblad",bt:"no-bergenstidende",aftonbladet:"aftonbladet",e24:"e24",minmote:"minmote",pent:"pent",godt:"godt",tek:"no-tek"},Ee=e=>me.some(t=>e.startsWith(t)),Ie=e=>e.startsWith("glgc_"),Ae=e=>!Ee(e)&&!Ie(e),Se=e=>{const t=Te();if(!t)return ye;const n=((e=[])=>e.filter(Ee))(t),r=((e=[])=>e.filter(Ie))(t),i=((e=[],t)=>{const n=e.filter(Ae);if(t){const{publisher:e}=l.get(),t=be[e]||e;n.push(t)}return n})(t,e);return{geoTags:i,geofenceTags:r,weatherTags:n}},Te=()=>{const e=J.getByTimestamp(he);return e&&"string"!=typeof e?null==e?void 0:e.tags:null};class Ce{constructor(){this.eids=[]}add(e,t){return e&&this.eids.push({id:e,source:t}),this}buildRyEids(){return this.eids.map(({id:e,source:t})=>({source:t,uids:[{id:e,atype:1,ext:{stype:"ppuid"}}]}))}buildEids(){return[...this.eids]}buildVideoEids(){return this.eids.map(({id:e,source:t})=>`${t},${e}`).join("|")}buildNorstatPath(){const e=this.eids[0];return e?`${e.source}-${e.id}`:""}buildNorstatQuery(e){const t=new URLSearchParams;return this.eids.slice(1).forEach(({id:n,source:r})=>{t.append(e,`${r}-${n}`)}),t}}const Pe=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return N(this,arguments,void 0,function*(e,t=1e4){var n,r;const i=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=i.xandr)||void 0===n?void 0:n.ppId1,null===(r=i.xandr)||void 0===r?void 0:r.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||_("PPIDv2s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:""}}setPPIDs(e,t){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:""}},ke=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return N(this,void 0,void 0,function*(){var n,r,i,o,s,a,d,l,c,u,v;const p=J.get(Y),g=yield this.getNewPPIDs(e,t);if(this.shouldHash(p,g)){const t=null!==(n=e.hasherUrl)&&void 0!==n?n:"https://hasher.schibsted.com/api/v1/hash",l=this.createHasherPayload(g),c=yield this.hashPPIDs(l,t);return c?(this.cachePPIDs(l,c,null===(r=g.idfv)||void 0===r?void 0:r.plain,null===(i=g.anId)||void 0===i?void 0:i.plain),void this.setPPIDs(null!==(o=c.userId)&&void 0!==o?o:"",null!==(s=c.environmentId)&&void 0!==s?s:"",null===(a=g.idfv)||void 0===a?void 0:a.plain,null===(d=g.anId)||void 0===d?void 0:d.plain)):void this.setPPIDs("","")}this.setPPIDs(null!==(l=null==p?void 0:p.userId.hashed)&&void 0!==l?l:"",null!==(c=null==p?void 0:p.environmentId.hashed)&&void 0!==c?c:"",null===(u=null==g?void 0:g.idfv)||void 0===u?void 0:u.plain,null===(v=null==g?void 0:g.anId)||void 0===v?void 0:v.plain)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||_("PPIDv3s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:"",idfv:this.idfv,anId:this.anId}}setPPIDs(e,t,n,r){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:"",this.idfv=null!=n?n:null,this.anId=null!=r?r:null}shouldHash(e,t){var n,r;if(!e)return!0;for(const i in e){if((null===(n=e[i])||void 0===n?void 0:n.plain)!==(null===(r=t[i])||void 0===r?void 0:r.plain))return!0}return!1}cachePPIDs(e,t,n,r){const i=Object.assign(Object.assign({clientId:{plain:e.clientId},userId:{plain:e.userId,hashed:t.userId},environmentId:{plain:e.environmentId,hashed:t.environmentId},trackerType:{plain:e.trackerType},trackerVersion:{plain:e.trackerVersion}},n?{idfv:{plain:n}}:{}),r?{anId:{plain:r}}:{});J.set(Y,i)}hashPPIDs(e,t){return N(this,void 0,void 0,function*(){try{const n=new Headers({"Content-Type":"application/json"});return yield ve.post(t,n,e)}catch(e){return _("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return N(this,arguments,void 0,function*({clientId:e,instance:t},n){const r=yield oe(t,n),i=yield ie(t),o=window.advertory_idfv,s=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:e},userId:{plain:r},environmentId:{plain:i},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},o?{idfv:{plain:o}}:{}),s?{anId:{plain:s}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:r,environmentId:i}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:r.plain,environmentId:i.plain}}},Oe=e=>{const{ppid1:t,ppid2:n}=Pe.getPPIDs(),{ppid1:r,ppid2:i,idfv:o,anId:s}=ke.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new Ce).add(n,Q[e]).add(t,X[e]).add(i,Z[e]).add(r,ee[e]).add(o,te[e]).add(s,ne[e]).buildEids()}]}},xe=e=>{const{ppid1:t,ppid2:n}=Pe.getPPIDs(),{ppid1:r,ppid2:i,idfv:o,anId:s}=ke.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new Ce).add(n,Q[e]).add(t,X[e]).add(i,Z[e]).add(r,ee[e]).add(o,te[e]).add(s,ne[e]).buildRyEids()}}]}}};const Le=new class extends W{prepare(e){return N(this,void 0,void 0,function*(){const t=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"aa-sch-country_code":u.SE},this.getPublisherKeywords()),this.getSupplyTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),this.getScreenKeywords()),yield N(void 0,void 0,void 0,function*(){const{glimr:e}=l.get(),{addPublisherToGeo:t}={},n=yield fe();if(!(null==e?void 0:e.enabled)||!n)return _("No consent for getting glimr tags."),{};const r=v(),i=Se(t);return{[`${r}-geo`]:i.geoTags,[`${r}-weather`]:i.weatherTags,[`${r}-geofence`]:i.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=Pe.getPPIDs();return{"aa-sch-schuserhash":e?"1":"0","aa-sch-schenvhash":t?"1":"0"}})()),e.keywords);return Object.assign(Object.assign({},e),{keywords:t,user:Object.assign({},Oe(u.SE)),member:this.getMember()})})}};var je=Le.prepare.bind(Le);class $e{initialize(){this.DATA=Object.assign({},$e.INITIAL_DATA)}getData(e){if(!this.DATA)throw new Error("Storage was accessed with invalid data.");return this.DATA[e]}setData(e,t){if(!this.DATA)throw new Error("Storage was accessed before it had been initialized.");this.DATA[e]=Object.assign(Object.assign({},this.DATA[e]),t)}}$e.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const Ne=new $e,_e=()=>(window.apntag||(window.apntag={anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}}),window.apntag),De=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),qe=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:r=!1}={}}=l.get(),i=[`${v()}-geo`],o=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...r?i:[]],s=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),a=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:s}}},a)}},Me=(e,...t)=>N(void 0,[e,...t],void 0,function*(e,{timeout:t}={timeout:1e3}){document.querySelector(`script[src="${e}"]:not([type="module"])`)||(yield new Promise((n,r)=>{const i=document.createElement("script");i.async=!0,i.src=e;const o=()=>{a(),n()},s=()=>{a(),r(new Error(`Failed to load ${e}`))},a=()=>{i.removeEventListener("load",o),i.removeEventListener("error",s),clearTimeout(d)};i.addEventListener("load",o),i.addEventListener("error",s);const d=setTimeout(()=>{a(),r(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(i)}).catch(e=>{console.error(e)}))}),Be=()=>{const{prebid:e,tcf:t,country:n}=l.get(),{getConsentSync:r}=B(t),i=r(),{initNativeAd:o}=l.getHandlers();if(!(null==e?void 0:e.enabled))return;const s=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:r=>{const i=_e(),{prebid:{relevantCbTimeout:o}={}}=l.get(),s="relevantCb"===r&&o?o:n[r].timeout,a=setTimeout(()=>{!n[r].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${r}'`),e=!0,i.loadTags&&i.loadTags())},s);t.push(a)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),a=_e(),d=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=_e();return{user:e,keywords:t}})();s.failsafeOnTimeout("relevantCb");const{user:{externalUid:c=""}={},keywords:u}=d;(()=>{const e=De();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(s.getCancel()||!a.loadTags)return _("core loadTags() call was cancelled",{cancel:s.getCancel(),apnTagLoadTags:!a.loadTags,condition:"or"}),void s.cleanup();const t=De();s.events.relevantCb.done=!0,s.failsafeOnTimeout("auctionCb");const r=i?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};_("prebid consentManagement",r),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},xe(n)),qe(u,c))),_("core add prebid config",Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},xe(n)),qe(u,c))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{s.getCancel()||(s.events.auctionCb.done=!0,a.loadTags(e)),s.cleanup()}},customNativeRender:e=>{Re(e,o)}}),_("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{s.getCancel()||(s.events.auctionCb.done=!0,a.loadTags(e))}},customNativeRender:e=>{Re(e,o)}})})},Re=(e,t)=>{var n;const{divId:r,native:i,bid:o}=e,s=document.querySelectorAll(`[id^=${r}]`)[0],a=`RY-${s.id}`;((e,t)=>{e.childNodes.forEach(e=>e.style.cssText="position: absolute; z-index: -1;");const n=document.createElement("div");n.setAttribute("id",t),e.appendChild(n)})(s,a);const d=null===(n=s.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:i,targetId:a},l.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},Fe="0123456789abcdefghijklmnopqrstuvwxyz",He=()=>Promise.resolve(),Ue=()=>{},Ve=e=>{window.apntag.anq.push(e)},ze=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),We=new Promise(e=>{if("undefined"==typeof document||!document.hidden)return void e();const t=()=>{document.hidden||(document.removeEventListener("visibilitychange",t),e())};document.addEventListener("visibilitychange",t,{once:!0})}),Ke=e=>{const{banner:t,targetId:n}=e;return!(!t||(null==n?void 0:n.includes("takeover")))&&st(e,h)},Je=e=>{const{native:t}=e;return!!t},Ge=e=>st(e,y),Ye=e=>{const{targetId:t}=e;return t.includes("takeover")||st(e,f)},Qe=e=>st(e,f),Xe=e=>st(e,b),Ze=e=>st(e,E),et=e=>e.targetId.includes("sponsorstripe"),tt=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},nt=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),rt=e=>e.targetId.startsWith("midboard"),it=e=>e.width>=1260&&e.width<=1280,ot=e=>e.width>=1600&&e.width<=1620,st=(e,t)=>{const n=I[t];if(!n)return!1;return!!n.find(t=>{var n,r;const i=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,o=(null===(r=e.banner)||void 0===r?void 0:r.height)||e.height,s=t.width===i,a=!t.height||t.height===o;return s&&a})},at=e=>e.includes("snoap.no"),dt=e=>{var t,n,r,i,o;return!!(null===(o=null===(i=null===(r=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags[e])||void 0===r?void 0:r.adResponse)||void 0===i?void 0:i.ads[1])||void 0===o?void 0:o.rtb)},lt=(e,t=(...e)=>{})=>{const n=t.toString();if(0===e.length)return n;const r=n.substring(0,n.indexOf("=>")).replace("(","").replace(")","").split(",").map(e=>e.trim()),i=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),o=r.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...o,i).toString()},ct=lt([],()=>{const e=({width:e,height:t})=>{var n;const r=null===(n=document.querySelector("#sf_align"))||void 0===n?void 0:n.querySelector("div");if(!r)return;const{clientWidth:i,clientHeight:o}=r,s=e/i,a=t/o;r.style.transform=`scale(${s},${a})`,r.style.transformOrigin="left top"},t=()=>{const{innerWidth:t,innerHeight:n}=window;e({width:t,height:n})};window.addEventListener("resize",t=>{if(!t.currentTarget)return;const n={width:innerWidth,height:innerHeight};e(n)});const n=window.frameElement;(null==n?void 0:n.contentWindow)?n.contentWindow.document.body.onload=t:document.body.onload=t}),ut=e=>{const t=lt([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n adfm-ad {\n height: 100% !important;\n width: 100% !important;\n }\n ",e.contentDocument.head.appendChild(t);const n=e.contentDocument.querySelector("iframe");if(!(null==n?void 0:n.contentDocument))return;const r=n.contentDocument.createElement("style");r.textContent="\n #image {\n background-size: cover !important;\n }\n ",new MutationObserver((e,t)=>{n.contentDocument&&(n.contentDocument.head.appendChild(r),t.disconnect())}).observe(e.contentDocument,{childList:!0,subtree:!0})})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),n=document.createElement("script");n.textContent=`(${t})()`;return e+n.outerHTML},vt=[],pt={},gt=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const r=mt(e);n?(ht(r,n),yt(e,r,t)):(ht(r,n),ft(e,r,t))})},ht=(e,t)=>{var n,r;const i=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!i)return;const o=t?"showFullscreen":"hideFullscreen";null===(r=i.contentWindow)||void 0===r||r.postMessage(`advertory:${o}-${e}`,"*")},mt=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},yt=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),vt.includes(t)||vt.push(t),n&&window.addEventListener("scroll",pt[t],{passive:!0})},ft=(e,t,n)=>{vt.includes(t)&&(n&&window.removeEventListener("scroll",pt[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},wt=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:r=[".skyscraper_r"],headerZIndex:i=3}=t,o=[],s=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&o.push(n)}),r.forEach(e=>{const t=document.querySelector(e);t&&s.push(t)}),()=>{o.length&&bt(e,o,i,0),s.length&&bt(e,s,i,40)}},bt=(e,t,n,r)=>{const i=e.offsetHeight,o=window.scrollY,s=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let a;a=s>o?(s-o)/t-r:(o+t-(s+i))/t;const d=a<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=a.toString()})};function Et(e){if(!e||"undefined"==typeof window)return;const t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}Et('body.fullscreen-scroll-in-screen{overflow-x:hidden}.advertory-fullscreen-scroll-wrapper{visibility:hidden;overflow:visible;width:100% !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;position:relative;margin:var(--advertory-fullscreen-scroll-wrapper-margin);z-index:1;display:block !important;min-height:250px;padding:0 !important;clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh);-webkit-clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh)}.advertory-fullscreen-scroll-wrapper>div{position:fixed;top:0;left:0;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;width:100vw !important;overflow:hidden}html[data-app-platform=iOS] .advertory-fullscreen-scroll-wrapper>div{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important;top:unset !important;bottom:env(safe-area-inset-bottom) !important}.advertory-fullscreen-scroll-wrapper>div>iframe{height:inherit !important;width:inherit !important;display:none !important}.advertory-fullscreen-scroll-wrapper.in-screen{visibility:visible;overflow:visible;width:100vw !important}.advertory-fullscreen-scroll-wrapper.in-screen>div>iframe{display:block !important}.advertory-fullscreen-scroll-wrapper.in-screen:before{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-150dvh;padding:0 !important}.advertory-fullscreen-scroll-wrapper.in-screen:after{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-50dvh}.advertory-fullscreen-scroll{position:fixed;top:var(--advertory-fullscreen-scroll-top, 0px);left:var(--advertory-fullscreen-scroll-left, 0px);width:var(--advertory-fullscreen-scroll-vw, 100vw);height:var(--advertory-fullscreen-scroll-vh, 100vh);overflow:hidden}.advertory-fullscreen-scroll::before{content:attr(data-ad-label);box-sizing:border-box;position:fixed;top:0}html[data-app-platform=iOS] .advertory-fullscreen-scroll::before{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix, 0px)) !important}.advertory-fullscreen-scroll::before{left:calc(50vw - 628px);width:calc(100% - 36px);max-width:1250px;text-align:left;background-color:hsla(0,0%,100%,.6);color:#212121;font-family:Ester Blenda,Arial,sans-serif;font-size:11px;font-weight:400;font-style:normal;text-transform:lowercase;line-height:1;margin:16px 2px;padding:10px;z-index:1;visibility:inherit !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll::before{left:16px}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:calc(50vw - 623px);right:unset}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:22px;right:unset}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]::before{padding-left:32px}.advertory-fullscreen-scroll>div[id*=utif]{display:block;width:var(--advertory-fullscreen-scroll-vw, 100vw) !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[id*=utif]{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important}.advertory-fullscreen-scroll>div[id*=utif]{overflow:hidden}.advertory-fullscreen-scroll>div[id*=utif]>iframe{display:block;height:inherit !important;width:inherit !important}.advertory-fullscreen-scroll>div[role=button]{z-index:1;opacity:1;background:rgba(0,0,0,0) !important;left:unset;position:fixed !important;right:calc(50vw - 623px);top:19px !important;width:26px !important;height:26px !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[role=button]{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix) + 19px) !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll>div[role=button]{right:22px}}');const It={no:{adText:"ANNONSE",adFrom:"ANNONSE FRA",adContent:"ANNONSØRINNHOLD",adContentFrom:"ANNONSØRINNHOLD FRA"},se:{adText:"ANNONS",adFrom:"ANNONS FRÅN",adContent:"EXTERN LÄNK",adContentFrom:"EXTERN LÄNK FRÅN"}};let At=null;const St=(e,t)=>{let n=e;return n=(e=>{const t=document.createElement("script");return t.textContent="\n {\n const frame = window.frameElement;\n \n if (frame) {\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n window.addEventListener('message', function(event) {\n if (event.data === 'advertory:showFullscreen-'+document.body.id) {\n document.body.style.display= \"block\";\n } else if (event.data === 'advertory:hideFullscreen-'+document.body.id) {\n document.body.style.display= \"none\";\n }\n });\n }\n }\n ",e+t.outerHTML})(e),n=(e=>{const t=document.createElement("script");return t.textContent=`(${ct})()`,e+t.outerHTML})(n),n=(e=>{if((e=>e.includes("google"))(e))return e;const t=document.createElement("div");t.innerHTML=e;const n=t.querySelector("img");return n?(n.style.width="100%",n.style.height="100%",n.style.objectFit="cover",n.style.position="fixed",t.innerHTML):e})(n),n=(e=>{if(at(e))return e;const t=document.createElement("style");return t.textContent="\n .GoogleActiveViewClass, .GoogleActiveViewElement {\n transform: translate(calc(-50% + 50vw), 0);\n width: 100vw !important;\n height: 100vh !important;\n }\n .GoogleActiveViewClass img, .GoogleActiveViewElement img {\n width: 100vw;\n height: 100vh;\n object-fit: cover;\n }\n .GoogleActiveViewClass iframe {\n width: 100vw !important;\n height: 100vh !important;\n }\n ",e+t.outerHTML})(n),(e=>e.includes("adform"))(n)&&(n=(e=>{const t=document.createElement("script");t.textContent='\n var frame = window.frameElement;\n if (frame) {\n frame.style.removeProperty("width");\n frame.style.removeProperty("height");\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n var iframe = document.querySelector("adfm-ad iframe");\n if (iframe) {\n var image = iframe.contentWindow.document.getElementById("image");\n if (!image) return;\n image.style.backgroundSize = "cover";\n } else {\n var iframe = document.querySelector(".adform-adbox iframe");\n if (iframe) {\n var style = document.createElement("style");\n style.textContent = "#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}";\n iframe.contentDocument.body.append(style);\n iframe.style = "width: 100vw; height: 100vh;";\n } else {\n var observer = new MutationObserver(function(mutations, obs) {\n for (var mutation of mutations) {\n var iframe = mutation.addedNodes[0];\n if (iframe && iframe.nodeName === "IFRAME") {\n iframe.style = "width: 100vw; height: 100vh;";\n iframe.dataset.contents += "<style>#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}</style>";\n obs.disconnect();\n }\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n }\n }\n ';const n=document.createElement("style");return n.textContent="\n html, body, adfm-ad, #sf_align, .adform-adbox, .adform-adbox img {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover;\n max-width: 100vw;\n }\n ",e+n.outerHTML+t.outerHTML})(n)),(e=>e.includes("529299503"))(n)&&(n=ut(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>at(e)?e:e.replace("<iframe ","<iframe onload=\"\n var f = document.querySelector('iframe');\n if (!f) return;\n var s = f.style;\n s.transform = 'scale(' + (window.innerHeight / Number(f.height)).toFixed(2) + ')';\n s.right = parseInt((Number(f.width) - window.innerWidth) / 2) + 'px';\n s.bottom = parseInt((Number(f.height) - window.innerHeight) / 2) + 'px';\n s.position = 'relative';\n \" "))(n)),at(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</iframe>","</iframe><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),(e=>e.includes("kreateam.io"))(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</div>","</div><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),dt(t)&&(n=(e=>{const t=document.createElement("script");t.textContent='var frame = window.frameElement;\n if (frame) {\n frame.style.width = "100vw";\n frame.style.height = "100vh";\n }';const n=document.createElement("div");return n.innerHTML=e,n.appendChild(t),n.innerHTML})(n)),n},Tt=()=>{At=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,r=e?e.offsetLeft:0,i=document.documentElement;i.style.setProperty("--advertory-fullscreen-scroll-vh",`${t}px`),i.style.setProperty("--advertory-fullscreen-scroll-vw",`${n}px`),i.style.setProperty("--advertory-fullscreen-scroll-left",`${r}px`)},Ct=()=>{At||(At=window.requestAnimationFrame(Tt))},Pt=(e,t)=>{var n,r,i,o;const{country:s}=l.get(),{targetId:a}=e;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(n=null==t?void 0:t.iosSafeAreaTopFix)&&void 0!==n?n:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:r="#fff",margin:i="16px 0",beforeContentValue:o=""}=e,s=t/2,a=document.createElement("style");a.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${s}px),\n ${r} calc(50% - ${s}px),\n ${r} calc(50% + ${s}px),\n ${n} calc(50% + ${s}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${i};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${o&&"clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);\n -webkit-clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);"}\n }\n\n .advertory-fullscreen-scroll-wrapper:before, .advertory-fullscreen-scroll-wrapper:after {\n background: var(--background);\n content: '${o}' !important;\n }`,a.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(a)})(null!==(r=null==t?void 0:t.overlayStyles)&&void 0!==r?r:{});const d=document.getElementById(a),c=null==d?void 0:d.parentElement;d&&c&&(((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,r=new IntersectionObserver(e=>gt(e,n),{}),i=mt(e);r.observe(e),n&&(pt[i]=wt(e,t))})(c,t),d.className="advertory-fullscreen-scroll",st(e,g)&&(d.style.position="absolute"),c.className="advertory-fullscreen-scroll-wrapper",c.dataset.showTagSubscribeId=a,d.setAttribute("data-ad-label",It[s].adText),(null==t?void 0:t.moveCogwheelToTheLeft)&&(d.dataset.moveCogwheelToTheLeft="true"),Ct(),window.addEventListener("resize",Ct),null===(i=window.visualViewport)||void 0===i||i.addEventListener("resize",Ct),null===(o=window.visualViewport)||void 0===o||o.addEventListener("scroll",Ct))},kt=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=dt(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,r=dt(e)?1:0;n&&(n.tags[e].adResponse.ads[r].rtb.banner.content=t)})(e,St(t,e))},Ot=e=>{const t=e.split("-"),n=t[t.length-1];return 6===n.length&&n.match(/^[a-zA-Z0-9]+$/)?t.slice(0,-1).join("-"):e};let xt="";const Lt=new Map,jt="advertory-wallpaper-background",$t=()=>{const e=document.querySelector(`.${jt}`);e&&e.remove()},Nt=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,_t=e=>{if(window.location.href.includes("collapse_ad=0"))return;const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.setProperty("width","0","important"),t.style.setProperty("height","0","important"),t.style.setProperty("display","none","important"),n.style.setProperty("display","none","important"),e.includes("wallpaper")&&$t())},Dt=e=>{const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("display"),n.style.removeProperty("display"))},qt=e=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement,r=(null==n?void 0:n.offsetHeight)||0;n&&(n.style.minHeight=`${r}px`)},Mt=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:r}=(e=>{const t=Ne.getData("initialClassNames")[e.id];return{wrapper:(null==t?void 0:t.wrapper)?t.wrapper.join(" "):"",container:(null==t?void 0:t.container)?t.container.join(" "):""}})(e);e.className=n,t.className=r},Bt=()=>{$t();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{_t(e.id),Mt(e),(e=>{const t=document.querySelector(`#${e}`),n=null==t?void 0:t.getAttribute("data-probable-height"),r=null==t?void 0:t.getAttribute("data-probable-width");n&&r&&(null==t||t.style.setProperty("min-height",n+"px"),null==t||t.style.setProperty("min-probable-width",r+"px"))})(e.id),e.innerHTML="",e.id=Ot(e.id)}),Ve(()=>window.apntag.clearRequest())},Rt="noGroupedPlacements",Ft=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},Ht=e=>{var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return[];const{placements:n,queryConfig:r,deviceType:i}=l.get(),o=n[i].filter(Ft)||[],s=e?document.querySelector(e):document;if(!s)return[];const a=o.reduce((e,t)=>{const n=(e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t})(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=o.filter(({id:e})=>e.match(t)),a=(null==r?void 0:r.queryByDataDevice)?`div[id^="${e}"][data-device=${i}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,d=s.querySelectorAll(a),c=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{const r=Ut(e,t,n),i=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=Fe[Math.floor(36*Math.random())];return t})(6)}`;return e.id=i,e.setAttribute("data-advertory-ad-rendered","true"),r.finnBlink&&!r.finnBlink.renderOnlyWithAdBlock&&e.setAttribute("data-is-finn-blink-placement","true"),(e=>{var t;const n=e.id;n&&Ne.setData("initialClassNames",{[n]:{wrapper:null===(t=e.parentElement)||void 0===t?void 0:t.className.split(" "),container:e.className.split(" ")}})})(e),Object.assign(Object.assign({},r),{id:i})});return(e=>{const{keywordsConfig:t}=l.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(xt!==window.location.pathname&&(Lt.clear(),xt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),r=null!==(t=Lt.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${p()}-count`]=r,Lt.set(n,r+1),e})):e})(c)});return(e=>{const t=Array.from(document.querySelectorAll('div[class^="advertory"]'));return e.sort((e,n)=>t.findIndex(t=>t.id===e.id)-t.findIndex(e=>e.id===n.id))})(a)},Ut=(e,t,n)=>{const r=n[t],i=n[n.length-1],o=n.filter(({id:t})=>t===e.id)[0];return(null==e?void 0:e.id)===(null==r?void 0:r.id)?r:(null==e?void 0:e.id)===(null==i?void 0:i.id)?i:o||i},Vt=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=l.get(),r=(null==t?void 0:t[n])||{},i=Object.values(r).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=Ot(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),s=((e,t)=>{const n={};for(const[r,i]of Object.entries(t))n[r]=e.filter(e=>i.includes(Ot(e.id)));return n})(e,r),a=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(Ot(e.id))))(e,new Set([...a,...i]));return Object.assign(Object.assign(Object.assign({},s),o),{[Rt]:d})},zt=(e,t,n)=>{const r=document.getElementById(`div_utif_${e}`);if(!r)return;const{apntag:i}=window,[o,s]=t;if(!r.dataset.lockedsize&&s&&o)r.style.width=`${o}px`,r.style.height=`${s}px`,n&&(i.resizeAd(r.id,[o,s]),r.dataset.lockedsize="true",r.dataset.lockedwidth=o.toString(),r.dataset.lockedheight=s.toString());else if(null==r?void 0:r.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=r.dataset;e&&t&&i.resizeAd(r.id,[e,t])}},Wt=["netboard","board"];class Kt{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,r;const{editionName:i}=e,o=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),s=JSON.stringify(null!==(r=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==r?r:[]),a=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return a.searchParams.append("editionName",i),o&&a.searchParams.append("urlData",o),s&&a.searchParams.append("excludedItems",s),l&&a.searchParams.append("spid",l),d&&a.searchParams.append("envid",d),a.toString()}fetchData(e){return N(this,void 0,void 0,function*(){var t,n;const r=yield this.identityFacade.getIdentityUser(),i=null!==(n=yield null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId())&&void 0!==n?n:"",o=(null==r?void 0:r.userId)?String(r.userId):"",s=this.buildUrl(e,{envId:i,spid:o});try{_("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield ve.get(s,e);return _("Fetch operation completed successfully."),t}catch(e){_("Error during fetch operation:",e)}return null})}}class Jt{getDrEditionUTMParams(e,t){var n;const{title:r,clientName:i,creativeId:o}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:s}=t,a=r.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:s,utm_campaign:i,utm_medium:a},o&&{utm_id:`df-${o}`})}getUrlSearchParams(e,t,n){if(!e)return"";const r=this.getDrEditionUTMParams(t,n),i=new URLSearchParams(decodeURIComponent(e.search)),o=new URLSearchParams(e.search);return Object.entries(r).forEach(([e,t])=>{i.has(e)||o.set(e,null!=t?t:"")}),o.toString().replace(/\+/g,"%20")}getUrlWithParams(e,t){var n;const r=null===(n=null==e?void 0:e.pulseData)||void 0===n?void 0:n.url;if(!r)return"";const i=this.getDrEditionUTMParams(e,t),o=new URL(r);return Object.entries(i).forEach(([e,t])=>{o.searchParams.has(e)||o.searchParams.set(e,null!=t?t:"")}),o.toString()}handleVideo(e,t){return N(this,void 0,void 0,function*(){const{id:n,autoplay:r,mute:i,videoLoop:o,vendor:s}=t.videoConfiguration;e.classList.add("vgtv-video-container"),Object.assign(e.dataset,{vgtvVideoId:n,vgtvVendor:s,vgtvAutoplay:r,vgtvMuted:i,vgtvLoop:!!o,vgtvNa:!0,vgtvRecommended:!1,vgtvPulseProvider:"vg",vgtvPulseProductTag:"partnerstudio"})})}getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:r,pathname:i}=new URL(n);if(!r.includes("www.vg.no")&&!i.includes("annonsorinnhold"))return[n];const o=i.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Gt{constructor(e,t,n,r){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=r,this.drEditionAds=[]}fetchAndRenderAd(e,t){return N(this,void 0,void 0,function*(){var n,r;const{drEditionConfig:{containerSelector:i},renderAsBackfill:o=!1}=t,s=e.querySelector(i);if(!s)return void _(`Container with selector "${i}" not found.`);const a=yield this.drEditionService.fetchData(t);return(null==a?void 0:a.itemId)||o?!(null==a?void 0:a.itemId)&&o?(_("No Dr. Edition ads available to render. Collapsing whole placement."),void _t(e.id)):((null==a?void 0:a.itemId)&&o&&(_("Dr. Edition ad available to render as a Xandr backfill."),Dt(e.id)),void(a&&(a.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(a.css,"style"),this.rendererManager.render(s,a,t),yield null===(n=this.videoManager)||void 0===n?void 0:n.handle(a,t),this.drEditionAds.push(a),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(a.itemId),this.observeAdView(e,a,t),null===(r=e.querySelector("a"))||void 0===r||r.addEventListener("pointerup",()=>null)))):(_("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),void this.showBackfill(e))})}observeAdView(e,t,n){this.observeCarousel(e,t,n)||((e,t,n={threshold:.5})=>{new IntersectionObserver(([e],n)=>{e.isIntersecting&&(t(),n.disconnect())},n).observe(e)})(e,()=>this.pulseManager.trackContentView(e,t,n),{threshold:.5})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const r=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";Dt(r)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const r=e.querySelector(".dr-edition-slider");if(!r)return!1;let i=null;const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(i&&clearTimeout(i),i=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...r.children].forEach(e=>{o.observe(e)})})},{threshold:[.9]});return[...r.children].forEach(e=>{o.observe(e)}),!0}}class Yt{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){if(!(null==t?void 0:t.itemId))return;const{getConsentSync:r}=B(n.tcf),i=!!r(),o=n.device===F.MOBILE?t.mobileHTML:t.desktopHTML;const s=i?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");e.innerHTML=s,e.querySelectorAll("a").forEach(e=>{var r,i,o;e.search=null!==(o=null===(i=(r=this.newsroomStrategy).getUrlSearchParams)||void 0===i?void 0:i.call(r,e,t,n))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,t,n)})}}class Qt{constructor(e){this.strategy=e}handle(e,t){return N(this,void 0,void 0,function*(){const{videoConfiguration:{id:n,preview:r}={}}=e;(n||r)&&(yield this.importScript(t),yield this.createVideoElement(e,t))})}importScript(e){return N(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield Me(t)}catch(e){_("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return N(this,void 0,void 0,function*(){const n=document.createElement("div"),{node:r}=e.videoConfiguration,i=[...document.querySelectorAll(`#${r}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(e,t))return;this.strategy.handleVideo(n,e),null==i||i.appendChild(n),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==i?void 0:i.parentNode;if(!o)return;const s=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");s!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,r,i;const{preview:{url:o,thumbnail:s}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const a=document.querySelector(".dr-edition-preview .preview-video");return!!a&&(a.setAttribute("playsinline",""),!(!a||!s)&&(null===(i=(r=t.drEditionConfig).addPreviewVideo)||void 0===i||i.call(r,a),!0))}}class Xt{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t,n,r){return{}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getTeaserElementText(e,t){if(!e)return"";const n=e.querySelector({title:".dr-edition-title",subtitle:".dr-edition-subtitle",image:"img.teaser-main-image"}[t]);if(!n)return"";if("image"===t)return n.src||"";const r=null==n?void 0:n.textContent;return r?r.trim():""}getEventTarget(e,t){const{itemId:n,pulseData:{url:r}={}}=t,i=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=i?i:""),type:"Page",url:r}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e,t,n){return N(this,void 0,void 0,function*(){var r,i,o,s,a;if(!this.pulse)return;const d=this.getEventInput(e,t,n,"view");(null===(r=this.pulse)||void 0===r?void 0:r.trackViewUIElement)?null===(o=null===(i=this.pulse)||void 0===i?void 0:i.trackViewUIElement)||void 0===o||o.call(i,d):null===(a=null===(s=this.pulse)||void 0===s?void 0:s.trackElementView)||void 0===a||a.call(s,d)})}trackContentClick(e,t,n){return N(this,void 0,void 0,function*(){var r,i,o,s;if(!this.pulse)return;const a=this.getEventInput(e,t,n,"click");this.pulse.trackClickUIElement?null===(i=(r=this.pulse).trackClickUIElement)||void 0===i||i.call(r,a):null===(s=(o=this.pulse).trackElementClick)||void 0===s||s.call(o,a)})}}class Zt extends Xt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){const{pulseData:{title:r,clientName:i="",creativeId:o}={}}=t,{columnName:s,primaryPosition:a}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:r,placement:{columnName:s,primaryPosition:a},"spt:custom":{is_sponsored:!0,sponsor:i,"spt:creativeId":o},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}class en extends Xt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var r,i,o,s,a,d;const{itemId:l,pulseData:{clientName:c,creativeId:u}={}}=t,v=n.editionName,p=this.mapPageType(this.pageType),g=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(s=null===(o=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getPulseObjectId)||void 0===o?void 0:o.call(i))&&void 0!==s?s:v,"@type":"UIElement",position:v,elementType:"Article",custom:{customer:c,creativeId:null!=u?u:l},page:{"@id":null!=g?g:v,"@type":p,url:location.origin},tags:null===(d=null===(a=this.newsroomStrategy)||void 0===a?void 0:a.getTags)||void 0===d?void 0:d.call(a,e)}}getEventInput(e,t,n,r){return{object:this.getEventBaseData(e,t,n),partnerstudio:this.getEventPartnerstudioData(e,t,n,r),target:this.getEventTarget(e,t),provider:this.getProviderData()}}getEventPartnerstudioData(e,t,n,r){var i,o,s,a;const{pulseData:{algorithm:d="sov",clientName:l,creativeId:c,editionId:u,itemId:v,url:p,probability:g}={}}=t,h=Math.floor(Date.now()/1e3),m=this.getTeaserElementText(e,"title"),y=this.getTeaserElementText(e,"subtitle"),f=this.getTeaserElementText(e,"image"),w=null!==(a=null!==(s=null===(o=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getUrlWithParams)||void 0===o?void 0:o.call(i,t,n))&&void 0!==s?s:p)&&void 0!==a?a:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:h,title:m,type:r,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}}const tn="front",nn=e=>N(void 0,void 0,void 0,function*(){var t,n;return(null===(t=null===window||void 0===window?void 0:window.SVP)||void 0===t?void 0:t.Player)?new window.SVP.Player(e):((()=>{const e="svp-player-sdk",t=document.querySelector(e),n=Array.from(document.querySelectorAll('script[src^="https://cdn.stream.schibsted.media/player"]'));if(t||n.length>0)return;const r=document.createElement("script");r.id=e,r.src="https://cdn.stream.schibsted.media/player/3.78.1/player.min.js",r.async=!0;try{r.src=r.src.replace("player.min","player.next.min")}catch(e){console.error("Failed to set player.next.min source:",e)}document.head.insertBefore(r,document.head.firstChild)})(),(null===(n=window.SVP)||void 0===n?void 0:n.isLoaded)?new window.SVP.Player(e):yield new Promise(t=>{window.addEventListener("onSvpPlayerReady",()=>t(new window.SVP.Player(e)))}))}),rn={ContentMutePlugin:e=>{window.SVP.Player.Plugins.register({getName:()=>"ContentMutePlugin",initialize(){},setup(){const t=this.player.config.get("mute");this.container=e||this.player.getContainer(),this.muted=t,t&&this.listenToOnce(this.player,"ready",this.renderButtonElement,this)},getButtonElement(){const e=document.createElement("button");e.className="player-plugin-content-mute";const t=document.createElement("span");return t.className="volume-button-icon",e.appendChild(t),e},renderButtonElement(){this.buttonElement=this.getButtonElement(),this.buttonElement.addEventListener("click",this.onButtonClick.bind(this)),this.container.appendChild(this.buttonElement),this.isVideo()||(this.buttonElement.style.display="none"),this.getJWPlayer()&&this.getJWPlayer().on("mute",this.onMuteChange,this)},onButtonClick(){this.getJWPlayer()&&(this.container.classList.add("has-interacted"),this.muted=!this.muted,this.getJWPlayer().setMute(this.muted))},onMuteChange(e){this.muted=e.mute,this.muted?this.buttonElement.classList.remove("content-video-volume-on"):this.buttonElement.classList.add("content-video-volume-on")},isVideo(){return"video"===this.player.getRawAsset().assetType},getJWPlayer(){return this.player.model.player}})},IntegrationMenu:()=>{window.SVP.Player.Plugins.register({getName:()=>"IntegrationMenu",setup(){return N(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return ri})})}})}};class on{handleVideo(e,t){return N(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:r,mute:i,vendor:o}}){yield N(void 0,void 0,void 0,function*(){return yield new Promise(e=>{var t;Boolean(null===(t=window.SVP)||void 0===t?void 0:t.Player)?e(!0):window.addEventListener("onSvpPlayerReady",()=>e(!0))})});const s=["ContentMutePlugin"],a=this.createPlayerOverlay(e);var d,l;l=a,null==(d=s)||d.forEach(e=>{rn[e](l)});const c={id:t,node:n,autoplay:r,mute:i,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},u=yield nn(c);u.once("assetReady",()=>{((e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})})(u,s)}),u.once("ready",()=>{const t=e;new MutationObserver(e=>{e.forEach(({type:e,attributeName:n})=>{"attributes"===e&&"class"===n&&(t.classList.contains("jw-state-playing")?a.classList.add("is-playing"):a.classList.remove("is-playing"),t.classList.contains("jw-flag-user-inactive")?a.classList.add("is-inactive"):a.classList.remove("is-inactive"))})}).observe(t,{attributes:!0,attributeFilter:["class"]})}),u.once("PulseStats:ready",()=>N(this,void 0,void 0,function*(){const e=yield u.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"e24",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===tn?"sdrn:e24:frontpage:front":`sdrn:e24:article:${t}`}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];if(!n.includes("https://e24.no/annonsorinnhold/"))return[n];const{pathname:r}=new URL(n),i=r.split("/").filter(Boolean);return i.length?[...i.slice(1),n]:[n]}createPlayerOverlay(e){const t=document.createElement("div");t.classList.add("cm-custom-video-overlay"),e.parentElement&&(t.innerHTML=e.parentElement.innerHTML,e.parentElement.replaceChild(t,e));return t.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),t.classList.add("has-interacted")}),t}}const sn="https://www.aftonbladet.se/video-player-extras/latest/";class an{handleVideo(e,t){return N(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:r,mute:i,vendor:o}}){const s={id:t,node:n,autoplay:r,mute:i,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${sn}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${sn}external-link.js`]:{name:"ExternalLink"}}};yield nn(s),this.addEditionVideoClass(e)})}addEditionVideoClass(e){var t;(null===(t=null==e?void 0:e.parentElement)||void 0===t?void 0:t.parentElement)&&e.parentElement.parentElement.classList.add("dr-edition-video-player")}getPulseObjectId(){return""}getPulsePageId(){return""}}class dn{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const ln=(e,t,n)=>{const{publisher:r,pageType:i,country:o}=e,s={[C]:new Jt,[O]:new on,[k]:new an}[r]||new dn,a=new(o===u.SE?Zt:en)(n,s,i),d=new Kt(t,null==n?void 0:n.pulseTracker),l=new Yt(s,a),c=new Qt(s);return new Gt(d,l,c,a)},cn=(e,t,n)=>{const{wrapperSelector:r}=null==e?void 0:e.drEditionConfig,i=document.querySelectorAll(r),o=new IntersectionObserver((r,i)=>((e,t,n,r,i)=>{const o=ln(n,r,i);e.forEach(e=>{var r,i,s;if(!e.isIntersecting)return;const a=e.target,d=null!==(r=a.dataset.editionName)&&void 0!==r?r:"",l=null!==(i=a.dataset.pulseColumnname)&&void 0!==i?i:"",c=null!==(s=a.dataset.pulsePrimaryposition)&&void 0!==s?s:"";o.fetchAndRenderAd(a,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(a)})})(r,i,e,t,n),{rootMargin:"400% 0px"});i.forEach(e=>o.observe(e))},un=[],vn=(e,t)=>N(void 0,void 0,void 0,function*(){var n;const{pulse:r,tcf:i,deviceType:o,drEdition:s,publisher:a,pageType:d,country:l}=e,c=((e,t)=>{var n;const{deviceType:r,placements:i,drEdition:{fallbackGlobalEditionName:o}={}}=e,s=i[r]||i.desktop,a=Ot(t.targetId),d=s.find(e=>e.id===a),l=Wt.some(e=>a.startsWith(e)),c=un.includes(a),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(un.push(a),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(e,t);if(!c)return;if(!(null==r?void 0:r.instance))return void _("Pulse has not been passed as a prop, aborting");const u=yield se(),v=new ae(u),p=ln({publisher:a,pageType:d,country:l},v,null==r?void 0:r.instance),g=document.getElementById(t.targetId);if(!g||!s)return;g.classList.value="";const h=document.createElement("div");h.className=s.containerSelector.replace(/^[.#:[\]]+/,""),g.innerHTML=h.outerHTML;const m={editionName:(null===(n=null==c?void 0:c.drEdition)||void 0===n?void 0:n.editionName)||"",drEditionConfig:s,device:o,tcf:i,renderAsBackfill:!0};yield p.fetchAndRenderAd(g,m)}),pn="collapseAd",gn="hideAd",hn="resizeAd",mn="renderDrEditionFallback",yn="wallpaperImageUrl",fn="wallpaperColor",wn="velvet",bn=[hn,yn,fn,pn,gn,mn,wn],En=e=>{if("object"==typeof e)return e;if(t=e,Nt.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:yn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:fn,wallpaperColor:t}}if(e.startsWith(mn)){const t=e.split(":")[1];return{name:mn,targetId:t}}if(e.startsWith(pn)||e.startsWith(gn)){const t=e.split(":")[1];return{name:pn,targetId:t}}if(e.includes("name")&&bn.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},In=e=>{if(!["http://acdn.adnxs-simple.com","https://acdn.adnxs-simple.com","https://crcdn01.adnxs-simple.com","http://crcdn01.adnxs-simple.com","https://acdn.adnxs.com","http://acdn.adnxs.com","https://adsdk.microsoft.com","https://adsdk.bing.net","https://adsdkprod.azureedge.net"].includes(e.origin.trim()))return;const{data:t}=e;if(!t)return;const n=En(t);if(!n)return;if(!n.name||!bn.some(e=>n.name===e))return;const{name:r,targetId:i,wallpaperImageUrl:o,wallpaperColor:s,cmd:a,size:d}=n;r===wn&&a&&a.includes("close")&&dispatchEvent(new CustomEvent("advertory:closeTakeover",{})),r!==pn&&r!==gn||!i||_t(i),r===hn&&i&&a&&zt(i,a),r===mn&&i&&(_t(i),vn(l.get(),{targetId:i})),"resizeMediationAd"===r&&i&&d&&zt(i,d,!0),r===yn&&o&&(e=>{const t=document.querySelector(`.${jt}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),r===fn&&s&&(e=>{const t=document.querySelector(`.${jt}`);t&&(t.style.backgroundColor=e)})(s)},An=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),Sn=(e,t)=>{if(tt(t))return _(`loading finn blink ad with full ads chain for ${t}`),void(()=>{const{publisher:e,country:t,finnBlink:n}=l.get(),{loadFinnBlinkAd:r,wallpaperHandlers:{adjustAdToHorseshoe:i}}=l.getHandlers(),o=window.apntag,s={publisher:e,country:t,finnBlink:n},a=e=>{Dt(e),Ve(()=>o.showTag(e))};return{withXandrAd:a,withFinnBlinkAd:e=>N(void 0,void 0,void 0,function*(){yield r(e,s,null)}),withFullAdsChain:e=>N(void 0,void 0,void 0,function*(){yield r(e,s,a,()=>{Ne.getData("horseshoe").isAvailable&&i(e)})})}})().withFullAdsChain(t);Ve(()=>(_("core showTag",{id:t}),e.showTag(t)))},Tn=(e,t)=>N(void 0,void 0,void 0,function*(){yield ze,yield We;const n=new IntersectionObserver((e,t)=>((e,t,n)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:r}=e,i=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(r),o=document.getElementById(i);_("core log from intersection observer handler",{targetId:i,element:o}),n(window.apntag,i),o&&(t.unobserve(o),t.disconnect())})})(e,t,Sn),An(t));n.observe(e)}),Cn=new Map,Pn=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],kn=".brandstudio-premium-content-widget",On=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),xn=({adWrapper:e,placementContainer:t})=>{const n=On({adWrapper:e,placementContainer:t});var r;null==e||e.style.setProperty("height",`${n}px`),Mt(r=t),r.innerHTML=""},Ln=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},jn=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=l.get(),r=Pn.includes(n)&&Boolean(t.closest(kn));const i=r?t.closest(kn):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,s=n&&t.matches("iframe, article")&&e;if(!n||!r&&!s||r&&!i)return;if(s)return Ln(e),void o.disconnect();const a=t.closest('[style*="height"]'),d=i;a&&d.contains(a)?Ln(a):d.hasAttribute("style")&&Ln(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},$n=(e,t,n,r,i,o)=>{var s;const a=performance.now(),d=null!==(s=Cn.get(t))&&void 0!==s?s:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(r,i)&&n<0;a-d>=i&&l&&(Cn.set(t,a),((e,t,n)=>{const r=null==n?void 0:n.parentElement;r&&n&&xn({adWrapper:r,placementContainer:n}),Ve(()=>{e.setKeywords([t],{[`${v()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},Nn=(e,t,n,r)=>{const i=new IntersectionObserver((e,t)=>((e,t,n,r)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:i,boundingClientRect:o}=e;t(window.apntag,i.id,o.y,n,r,i)})})(e,$n,n,r),An(t));i.observe(e)},_n=(e,t=6)=>{const n=[];for(let r=0;r<e.length;r+=t){const i=e.slice(r,r+t);n.push(i)}return n},Dn=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),qn=(e,t=0)=>{const n=e.getBoundingClientRect(),r=window.innerHeight;return n.bottom>-t&&n.top<r+t},Mn=(e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,r=document.querySelector(`#${n}`),i=null==r?void 0:r.parentElement;if(!i||!r)return;jn({adWrapper:i,placementContainer:r});const{delayTime:o=1e3}=t,s=(new Date).getTime();if(r&&"true"!==r.dataset.subscribedForRefresh){const e=(e=>{var t;const{deviceType:n,preloadMarginsConfig:r}=l.get(),i=null==r?void 0:r[n];return((e,t)=>t[e])(null!==(t=e.dataset.priority)&&void 0!==t?t:"normal",(({high:e,normal:t,low:n}={})=>{var r,i,o,s,a,d;return{high:{refreshMargin:null!==(r=null==e?void 0:e.refreshMargin)&&void 0!==r?r:600,renderMargin:null!==(i=null==e?void 0:e.renderMargin)&&void 0!==i?i:300},normal:{refreshMargin:null!==(o=null==t?void 0:t.refreshMargin)&&void 0!==o?o:300,renderMargin:null!==(s=null==t?void 0:t.renderMargin)&&void 0!==s?s:150},low:{refreshMargin:null!==(a=null==n?void 0:n.refreshMargin)&&void 0!==a?a:100,renderMargin:null!==(d=null==n?void 0:n.renderMargin)&&void 0!==d?d:50}}})(i)).refreshMargin})(r);r.dataset.subscribedForRefresh="true",r.dataset.refresh&&Nn(r,e,s,o)}},Bn=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=l.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),Un(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},Rn=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:r}=l.get();if(!t)return;e.forEach(({id:e})=>{const t=Fn(e);t&&(t.dataset.bfCacheRefresh="true")});const i=t=>{const r=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const i of r){const r=e.find(e=>{var t;return e.id===(null===(t=i.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),o=null==r?void 0:r.threshold;qn(i,o)&&r&&(qt(r.id),n.length&&i.classList.remove(...n),Un([r],t))}};r&&document.addEventListener("visibilitychange",()=>i(!0)),window.addEventListener("pageshow",e=>{const t=()=>{window.scrollY>0&&(window.removeEventListener("scroll",t),i(!1))};e.persisted&&(Dn()?window.addEventListener("scroll",t,{passive:!0}):i(!1))})},Fn=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},Hn=e=>{const{id:t,allowedFormats:n}=e,r=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(Fn(t)),i=(e=>1===e[0]&&1===e[1])(r),o={sizes:[r],allowedFormats:i?n:n.filter(e=>"native"!==e),allowSmallerSizes:!1};return i||(o.native=void 0),o},Un=(e,t=!1)=>{const n=6,{requestSize:r=n}=l.get(),i=e.map(({id:e})=>e),o=_n(i,r);if(t)for(const t of e){const e=Hn(t);window.apntag.modifyTag(t.id,e)}for(const e of o)Ve(()=>window.apntag.refresh(e))};const Vn="#fff",zn="#0098da",Wn="splash",Kn="welcomePage",Jn="topscroller",Gn="velvet",Yn="takeover-displayed",Qn=()=>{const{takeover:{enabled:e=!1}={}}=l.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||e&&!Xn())},Xn=()=>{var e;return"true"===R((null===(e=l.get().takeover)||void 0===e?void 0:e.cookieCapName)||Yn)},Zn=(e,t)=>[[1,1],[1920,1080]].some(([n,r])=>n===e&&r===t),er=()=>{const{takeover:e}=l.get();return Boolean(null==e?void 0:e.topscroller)},tr=()=>{var e,t,n;const r=document.location.hostname,i=(null===(e=l.get().takeover)||void 0===e?void 0:e.cookieCapName)||Yn,o=void 0===(null===(t=l.get().takeover)||void 0===t?void 0:t.cookieCapTime)?14400:null===(n=l.get().takeover)||void 0===n?void 0:n.cookieCapTime;o&&(window.document.cookie=`${i}=true; max-age=${o}; domain=${r}; path=/`)},nr=e=>{var t;const n=!!(null===(t=l.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return Ye(e)&&n},rr=(e,t)=>{var n;if(t===Jn){const{topscroller:t}=e;return null!=t?t:{}}if(t===Wn){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},ir=(e,t)=>{t!==Wn?(e=>{var t,n,r;const i=null===(n=null===(t=l.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(r=l.get().takeover)||void 0===r?void 0:r.topscroller;if(!i||o)return;const s=document.querySelector(i),a=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),c=document.querySelector(".advertory-welcome-page-scroll");if(!(s&&a&&c&&d))return;const u=null==s?void 0:s.offsetHeight,v=Qe(e)?"60svh":`calc(100svh - ${u}px)`,p=Qe(e)?"calc(40svh + 30px)":`calc(${u}px + 30px)`;a.style.setProperty("height",v,"important"),d.style.setProperty("height",v,"important"),c.style.setProperty("bottom",p,"important")})(e):(e=>{var t;if(!(null===(t=l.get().takeover)||void 0===t?void 0:t.splash))return;const n=document.querySelector(".advertory-splash-navbar-wrapper"),r=document.querySelector(`#${e.targetId}`);if(!n||!r)return;const i=`calc(100svh - ${n.offsetHeight}px)`;r.style.setProperty("height",i,"important")})(e)},or=lt([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n .adform-adbox {\n height: 100% !important;\n width: 100% !important;\n }\n img {\n height: 100% !important;\n width: 100% !important;\n object-fit: cover !important;\n object-position: top !important;\n }\n ",e.contentDocument.head.appendChild(t)})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),sr=(e,t=!0)=>{(e===Kn||e===Jn)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},ar=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},dr=e=>{document.body.style.overflow=e?"initial":"hidden"},lr=e=>{const t=ur(e),n=cr(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),dr(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},cr=e=>{const t=()=>lr(e);return window.addEventListener("advertory:closeTakeover",t),ar(),t},ur=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&lr(e)};return ar(),window.addEventListener("keydown",t),t},vr=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(ur(e),cr(e),ar(),t.addEventListener("click",()=>{lr(e)}),dr(!1))},pr=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),cr(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},gr=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>lr(e))})(e)},hr=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=l.get(),n=e.querySelectorAll(".advertory-splash-navbar-wrapper"),r=document.querySelector(".advertory-takeover-label");Array.from(n).forEach(e=>e.style.display="flex"),t&&r&&(r.style.display="flex",r.innerText=It.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},mr=e=>{const t=document.querySelectorAll(".advertory-topscroller-elements");Array.from(t).forEach(e=>e.style.display="flex");const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=It.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},yr=e=>{const t=document.querySelectorAll(".advertory-welcome-page-elements");Array.from(t).forEach(e=>{e.style.display="flex",e.style.animation="elementsAnimation 1.5s ease-out forwards"});const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=It.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},fr=e=>{e.classList.toggle("advertory-impact-wrapper",!0)},wr=()=>{const e=document.querySelector(".welcome-page-wrapper, .topscroller-wrapper, .advertory-splash-wrapper");if(!e)return;let t=0;new IntersectionObserver(e=>{e.forEach(e=>{var n;if(e.isIntersecting){window.dispatchEvent(new CustomEvent("advertory:takeoverInView"));(null!==(n=Array.from(e.target.classList))&&void 0!==n?n:[]).includes("advertory-splash-wrapper")&&(()=>{const e=window.scrollY||0;document.body.dataset.scrollY=e.toString(),document.body.style.top="0",document.body.classList.add("page-locked"),document.documentElement.scrollTop=0})(),t++}else t>0&&window.dispatchEvent(new CustomEvent("advertory:takeoverNotInView"))})},{root:null,rootMargin:"0px",threshold:0}).observe(e)},br=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${or})()`,e+t.outerHTML})(e)),n},Er=e=>{const t=(e=>{const{requests:t}=window.apntag,n=dt(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,r=dt(e)?1:0;n&&(n.tags[e].adResponse.ads[r].rtb.banner.content=t)})(e,br(t))},Ir=e=>{const{takeover:t}=l.get(),{targetId:n}=e,r=document.querySelector(`#${n}`),i=document.querySelector(".advertory-takeover-wrapper");if(!r||!i||!t)return;const o=(e=>{const{width:t,height:n}=e;return Zn(t,n)?Wn:st(e,w)?Gn:er()?Jn:Kn})(e),s=i.offsetHeight,a=window.scrollY>s;i.style.display="block",!a&&sr(o,!1),((e,t)=>{({[Kn]:yr,[Wn]:hr,[Jn]:mr,[Gn]:fr})[t](e)})(i,o),wr(),((e,t)=>{({[Kn]:pr,[Jn]:pr,[Wn]:vr,[Gn]:gr})[t](e)})(i,o),((e,t,n)=>{if(!n)return;({[Kn]:()=>{const{buttonLabel:r}=rr(n,t);["#advertory-welcome-page-scroll-label","#advertory-welcome-page-scroll-image"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(n.innerText=null!=r?r:"")})},[Wn]:()=>{const{themeColors:r,logotype:i,buttonLabel:o,showArrowIcon:s}=rr(n,t);["#advertory-splash-close-label",".advertory-splash-close","#advertory-splash-logotype",".advertory-splash-navbar-wrapper"].forEach(t=>{const n=e.querySelector(`${t}`);if(n){if("#advertory-splash-close-label"===t&&(n.innerText=null!=o?o:""),".advertory-splash-close"===t&&s){const e=document.createElement("img");e.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAfQAAAH0Bx0gPAAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNtdPJCYBADEDRzzRmE3ZgEV6tRHHpzELiIQrBZRajA7lk4EE2RIQjgApYgdbmY8EJaADZo3sDBKAvQa4JRYZc5D6pyJiDPMuKTCkkXp8icwxJd1mRxSC1/Q94328luJroGqNrkdyrzAfHVHzOG+8CKlLk+LO+AAAAAElFTkSuQmCC"),e.setAttribute("alt","close ad"),n.appendChild(e)}if("#advertory-splash-logotype"===t&&i&&(n.setAttribute("src",i.url),n.setAttribute("alt",i.alt)),".advertory-splash-navbar-wrapper"===t&&r){const{backgroundColor:e,color:t}=r;n.style.setProperty("background-color",null!=e?e:Vn,"important"),n.style.color=null!=t?t:zn}}})},[Jn]:()=>{const{buttonLabel:r,showArrowIcon:i,showCloseButton:o=!0}=rr(n,t);["#advertory-topscroller-scroll-label","#advertory-topscroller-scroll-image",".advertory-topscroller-close"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(".advertory-topscroller-close"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||i||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=r?r:""))})},[Gn]:()=>{}})[t]()})(i,o,t),tr(),!a&&sr(o,!0),ir(e,o)};Et(".advertory-brandmetrics-survey{width:100%}");const Ar="advertory-brandmetrics-survey",Sr=()=>N(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n}=l.get();if(!e||n)return;const r=(e=>{const{ppid1:t,ppid2:n}=Pe.getPPIDs(),{ppid1:r,ppid2:i}=ke.getPPIDs(),o=(new Ce).add(n,Q[e]).add(t,X[e]).add(i,Z[e]).add(r,ee[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{N(void 0,[e,t,...n],void 0,function*(e,t,n=!0){if(document.getElementById(t))return;const r=document.createElement("img");r.src=e,r.id=null!=t?t:"",n&&(r.style.display="none"),document.body.appendChild(r)})})(`https://sch-map.norstatsurveys.com/api/nids/${t===u.NO?"schibsted":"schibstedse"}/map/${r}`,"norstat")}),Tr={nativeAd:e=>Je(e)&&!et(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:Ge,fullscreenScroll:Ke,topscroller:e=>Ye(e)&&er(),splash:e=>Ye(e)&&Zn(e.width,e.height),welcomePage:Ye,wallpaper:Xe,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:it,hFormat:ot,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!ot(e)&&!it(e),topboard:e=>e.targetId.startsWith("topboard")&&!Ye(e),widescreen:e=>e.targetId.startsWith("widescreen"),insider:e=>e.targetId.startsWith("insider"),sponsorstripe:et,brandboard:e=>(e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!nt(e))(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!rt(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>(e=>e.targetId.startsWith("netboard"))(e)||(e=>e.targetId.startsWith("board"))(e),panorama:nt,midboard:rt},Cr=({adObj:e,preferredTestIdData:t})=>{var n,r;const i=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!i)return;const o=null===(r=document.querySelector(`#${i}`))||void 0===r?void 0:r.parentElement;if(!o)return;if(((e,t)=>{var n,r,i,o;const s=null===(o=null===(i=null===(r=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===r?void 0:r.tags)||void 0===i?void 0:i[e])||void 0===o?void 0:o.invCode;s&&(t.dataset.invCode=s)})(i,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const s="DIV"===(null==o?void 0:o.tagName);e&&s&&((e,t)=>{var n,r;for(const[i,o]of Object.entries(Tr))if(o(e)){if("nativeAd"===i){const o="default";t.dataset.testid=`${i}-${null!==(r=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==r?r:o}`;break}t.dataset.testid=i;break}})(e,o)},Pr=e=>{var t;return(null===(t=Object.entries(Tr).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},kr=new Map;kr.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),kr.set("panorama",{scale:.79,transformOrigin:"center center"}),kr.set("outstream",{scale:.79,transformOrigin:"center center"}),kr.set("integration",{scale:.79,transformOrigin:"center center"}),kr.set("toppanorama",{scale:.8,transformOrigin:"left center"});const Or=e=>{if(!((null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.clientWidth)>767&&(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.clientWidth)<=853))return;var t,n;const r=Pr(e),i=kr.get(r),o=document.querySelector(`#${e.targetId}`);if(!o||!i)return;if(o.style.transformOrigin=i.transformOrigin,o.style.transform=`scale(${i.scale})`,!(null==i?void 0:i.cogwheelAdjust))return;const s=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),a=null==o?void 0:o.offsetWidth;s&&"number"==typeof a&&!isNaN(a)&&s.style.setProperty("right",String(-1*a*.2)+"px")},xr=e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.querySelector("iframe"),r=null==n?void 0:n.parentElement,{siteSpecificConfig:{publisherClassName:i,fullWidthFormatClassName:o}={}}=l.get();if(!t||!n||!r)return;const s=window.innerWidth,a=Math.round(s/1080*1920);t.style.width="100%",t.style.height=`${a}px`,t.classList.add(`advertory-${i}-${o}__vertical-full-width-ad`);const d=((e,t)=>{const n=e.width,r=(null!=t?t:window.screen.width)/n;return r<1?r:1})(e,t.offsetWidth);r.style.transform=`scale(${d})`,r.style.transformOrigin="left top"},Lr=(e,t)=>t?Object.assign(Object.assign({},e),{"aa-sch-ssa-native-ad":"true","aa-sch-ssa-format":"NATIVE_CONTENT","aa-sch-ssa-market":"XNO","aa-sch-ssa-cat":["ssa_1","ssa_2","ssa_3","ssa_4","ssa_5","ssa_6","ssa_7","ssa_8","ssa_9","ssa_10","ssa_11","ssa_12","ssa_13","ssa_14","ssa_15","ssa_16","ssa_17","ssa_18","ssa_19","ssa_20","ssa_21","ssa_22","ssa_23","ssa_24","ssa_25","ssa_26","ssa_27","ssa_28","ssa_29","ssa_30"]}):e,jr=e=>`externalImpId:'${e}'`,$r=e=>{var t;const{forwardExternalImpId:n=!1,tracker:r}=l.get(),i=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${p()}-count`],r=e.positionConfig.find(e=>e.adPositionIndex===n);if(!r)return e;const i=r.keywords?Object.assign(Object.assign({},e.keywords),r.keywords):e.keywords;return Object.assign(Object.assign({},e),{sizes:null!==(t=null==r?void 0:r.sizes)&&void 0!==t?t:e.sizes,keywords:i})})(e),{id:o,sizes:s,keywords:a,allowedFormats:d,invCode:c,ssa:u=!1,nativeCustomProperties:v,safeframeConfig:g,resizeAdParentDiv:h=!1,dynamicSizeWidthCheck:m=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Qn())return e;const n=null===(t=e.keywords)||void 0===t?void 0:t["no-sno-adformat"],r=null==n?void 0:n.filter(e=>e!==Jn),i=Object.assign(Object.assign({},e.keywords),n&&{"no-sno-adformat":r}),o=e.sizes.filter(([e,t])=>4!==e||4!==t);return Object.assign(Object.assign({},e),{sizes:o,keywords:i})})(i),y=Object.assign({invCode:c,sizes:s,targetId:o,keywords:Lr(a,u),allowedFormats:d,resizeAdParentDiv:h,dynamicSizeWidthCheck:m},g&&{safeframeConfig:g}),f=(e=>{var t,n,r,i,o,s,a;return e?(null===(t=null==e?void 0:e.instance)||void 0===t?void 0:t.state)?(null===(r=null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)||void 0===r?void 0:r.pageViewId)?(_("Tracker state pageViewId is:",null===(o=null===(i=null==e?void 0:e.instance)||void 0===i?void 0:i.state)||void 0===o?void 0:o.pageViewId),null===(a=null===(s=null==e?void 0:e.instance)||void 0===s?void 0:s.state)||void 0===a?void 0:a.pageViewId):(_("Tracker state does not contain field pageViewId or it is empty"),""):(_("Tracker state is empty"),""):(_("Tracker is not configured in initAdvertory function"),"")})(r);n&&f&&(_("External Impression ID assigned to defineTag:",jr(f)),y.externalImpId=jr(f));const w=(e=>Object.entries({video:{required:!1},address:{required:!1},saleprice:{required:!1},rating:{required:!1},price:{required:!1},phone:{required:!1},likes:{required:!1},downloads:{required:!1},customIcon2:{required:!1}}).reduce((t,[n,r])=>((null==e?void 0:e.includes(n))&&(t[n]=r),t),{customTitle1:{required:!1},customTitle2:{required:!1},customTitle3:{required:!1},customTitle4:{required:!1},title:{required:!1},body:{required:!1},image:{required:!1},icon:{required:!1},sponsoredBy:{required:!1},cta:{required:!1},clickUrl:{required:!1},desc2:{required:!1},displayUrl:{required:!1},description:{required:!1}}))(v);return(null===(t=e.allowedFormats)||void 0===t?void 0:t.includes("native"))&&(y.native=w),y},Nr=e=>{if(!e)return e;const t=e[`${v()}-targetid`],n=t?Ot(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${v()}-targetid`]:[n]})},_r=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${v()}-geo`]&&{[`${v()}-geo`]:["geo-test-value"]}),e[`${v()}-geofence`]&&{[`${v()}-geofence`]:["geofence-test-value"]}),e[`${v()}-weather`]&&{[`${v()}-weather`]:["weather-test-value"]}),Dr=e=>{(e=>{const t=new URLSearchParams(window.location.search);if("true"!==t.get("scrollToFirstInvCode"))return;const n=t.get("ast_override_inv_code");if(!n)return;const r=n.split(",")[0].split(":")[0],i=e.find(e=>e.invCode===r),o=document.querySelector(`[id^=${null==i?void 0:i.id}]`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})})(e),(()=>{var e;const t=new URLSearchParams(window.location.search).get("scrollToDrEditionPlacement");if(!t)return;const n=null!==(e=document.querySelector(`[id*="${t}}"]`))&&void 0!==e?e:document.querySelector(`a[aria-label*="${t}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"start"})})()},qr=()=>N(void 0,void 0,void 0,function*(){try{(()=>{const e=document.createElement("script");e.setAttribute("src","https://ads.inventory.schibsted.io/ad-service/ad-banner-sponsor-advertisement/ad.js"),e.setAttribute("type","text/javascript"),e.setAttribute("async","true"),document.head.appendChild(e)})(),(()=>{const e=document.createElement("div");e.setAttribute("id","ads-advertory-anchor"),e.classList.add("subscribe_box"),e.classList.add("ad-box"),e.classList.add("leftAd"),e.classList.add("netboard"),e.classList.add("advert"),e.classList.add("module"),e.classList.add("banner"),e.classList.add("leaderboard"),e.classList.add("adsbygoogle"),e.classList.add("ad-banner"),e.classList.add("ad-container"),e.classList.add("adsbox"),e.classList.add("sidebar-ads"),e.classList.add("banner-ads"),e.style.opacity="0",e.style.width="1px",e.style.height="1px",e.style.minWidth="0px",e.style.minHeight="0px",e.style.maxWidth="1px",e.style.maxHeight="1px",e.style.position="absolute",e.style.top="0",e.style.boxSizing="border-box",e.style.margin="0",e.style.padding="0",document.body.appendChild(e)})()}catch(e){console.error("Error running adblock scripts:",e)}}),Mr={arrayMerge:(e,t)=>t},Br=e=>N(void 0,void 0,void 0,function*(){if(!(e=>{const{editableConfiguration:{useS3Config:t=!1,pageTypeToFetch:n}={},siteSpecificConfig:r}=e;return Boolean(t&&n&&(null==r?void 0:r.publisherClassName))})(e))return e;try{const t=yield(e=>N(void 0,void 0,void 0,function*(){const t=(e=>{const{siteSpecificConfig:t,editableConfiguration:{pageTypeToFetch:n}={}}=e;return(null==t?void 0:t.publisherClassName)&&n?`https://alertory-cdn.staging.inventory.schibsted.io/editable-configurations/${t.publisherClassName}/${n.toUpperCase()}.json`:null})(e);if(!t)return null;const n=new AbortController,r=setTimeout(()=>n.abort(),5e3);try{return yield ve.get(t,{method:"GET",signal:n.signal})}catch(e){throw _("Failed to fetch S3 config",{error:e,url:t}),e}finally{clearTimeout(r)}}))(e);return t?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:r,refresh:o,placements:s,threshold:a,batchSize:d}=t,l=i.all([e.placements,s],Mr),c=i(e.pageOptions,{keywords:r},Mr),u=i(e.appearanceConfig,{defaultThreshold:a},Mr),v=i(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:o},Mr);return Object.assign(Object.assign({},e),{placements:l,requestSize:null!=d?d:e.requestSize,pageOptions:c,appearanceConfig:u,refreshConfig:v})})({siteConfig:e,configOverrides:t}):e}catch(t){return _("Error fetching S3 config, using site config",{error:t}),e}});let Rr,Fr=[];const Hr=["takeover","wallpaper"],Ur=e=>{const t=(e=>{const t=Ne.getData("alertoryConfigKeywords"),{queryConfig:n,placements:r,tcf:i,glimr:o,appearanceConfig:s,requestSize:d=a,publisher:l,country:c,pageType:u,deviceType:v,isMobileApp:p=!1,pageOptions:{member:g},takeover:h,fullscreenScroll:m}=e;return{xandr:{member:g,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:l,country:c,pageType:u,deviceType:v,placements:r,tcf:i,requestSize:d,isMobileApp:p},o&&{glimr:o}),n&&{queryConfig:n}),s&&{appearanceConfig:s}),h&&{takeover:h}),m&&{fullscreenScroll:m})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},Vr=()=>N(void 0,void 0,void 0,function*(){const{pageOptions:e}=l.get(),{preparePageOptions:t}=l.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=l.get();return{sandboxAdIframe:e,sandboxAttributes:["allow-same-origin","allow-scripts","allow-top-navigation-by-user-activation","allow-popups","allow-popups-to-escape-sandbox","allow-forms"]}})(),r=yield t(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},e),{renderingManagement:Object.assign({},n)}));(e=>{const t=Ne.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=_r(e);Ne.setData("alertoryConfigKeywords",n)})(r.keywords),Ve(()=>Rr.setPageOpts(r))}),zr=e=>{const{prebid:t}=l.get();Wr(e),(null==t?void 0:t.enabled)?(_("core loadPlacements prebid enabled"),Be()):(_("core load tags invoked without prebid enabled"),Kr(e))},Wr=e=>{const{prepareTag:t}=l.getHandlers(),n=[];(e=>{const t=["skyscraperright_1","topboard","wallpaper","skyscraperleft_1"];return e.sort((e,n)=>{const r=t.findIndex(t=>e.id.includes(t)),i=t.findIndex(e=>n.id.includes(e));return-1!==r&&-1===i?-1:-1===r&&-1!==i?1:r-i})})(e).forEach(e=>{_("core defineTags",{placement:e});const r=$r(e);if(!e.id.includes("takeover")||Qn()){const i=t(r),o=(e=>{const{allowedFormats:t,invCode:n,keywords:r,sizes:i}=e;return{adTypes:t,invCode:n,keywords:Nr(r),sizes:i}})(i);n.push(o),Ve(()=>(_("core defineTag - add to the queue",{placement:e,preparedTag:i}),Rr.defineTag(i)))}}),(e=>{var t,n,r;(null===(r=null===(n=null===(t=window.advertory)||void 0===t?void 0:t.alertoryConfig)||void 0===n?void 0:n.xandr)||void 0===r?void 0:r.tags)&&e.length&&window.advertory.alertoryConfig.xandr.tags.push(e)})(n)},Kr=e=>{const t=e.map(({id:e})=>e);Ve(()=>(_("core loadTags",{placementsIdsToLoad:t}),Rr.loadTags([...t])))},Jr=(e,t)=>N(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:r}=l.get(),{threshold:i,refresh:o,priority:s="normal"}=e,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),d=null==n?void 0:n.defaultThreshold[r];a&&(_("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:i,deviceDefaultThreshold:d}),yield Tn(a,null!=i?i:d)),a&&o&&(_("core showAd - setup refreshing",{placement:e,adObj:t}),a.dataset.refresh=o.toString(),a.dataset.priority=s)}),Gr=e=>e.some(({id:e})=>Hr.some(t=>e.includes(t))),Yr=e=>N(void 0,void 0,void 0,function*(){var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return;const n=6,{requestSize:r=n}=l.get(),i=Vt(e);for(const e of Object.keys(i)){const t=i[e],n=_n(t,r);for(const e of n)Gr(e)?(_("core loadAds without lazy loading",{placementsToLoad:e}),zr(e)):e.length&&(_("core loadAds with lazy loading",{placementsToLoad:e}),Qr(e))}}),Qr=e=>{const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=l.get(),r=[];if(!t)return _("lazy load is not enabled",{placements:e}),void zr(e);const i=new IntersectionObserver((t,n)=>{t.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(t=>{_("lazy load is enabled - handler start",{loadedPlacementIds:r,placements:e});const i=e.every(e=>r.includes(e.id)),o=e.map(e=>e.id);!i&&r.push(...o),!i&&zr(e),_("lazy load is enabled - handler stop",{loadedPlacementIds:r,placements:e,arePlacementsLoaded:i,placementIds:o}),n.disconnect()})},{rootMargin:n});e.forEach(e=>{const t=document.getElementById(e.id);t&&(_("lazy loading - observe element",{placementId:e.id,element:t}),i.observe(t))})},Xr=()=>N(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:t,wallpaperHandlers:{initWallpaperAd:n,adjustAdToHorseshoe:r}}=l.getHandlers(),{wallpaper:i,fullscreenScroll:o}=l.get(),s=[];Ve(()=>{Rr.onEvent("adRequested",()=>{e.adRequested()}),Rr.onEvent("adAvailable",r=>N(void 0,void 0,void 0,function*(){var s,a,d,c,u,v;_("core adAvailable start",{placementsAvailable:Fr,adObj:r,isFullscreenScrollAd:Ke(r),isFinnBlink:tt(r.targetId),isNativeAd:Je(r),isMediation:L(r),isTakeoverAd:Ye(r),isCollapseAd:Ze(r),isWallpaperAd:Xe(r)});const p=null===(d=null===(a=null===(s=null===window||void 0===window?void 0:window.apntag)||void 0===s?void 0:s.requests)||void 0===a?void 0:a.tags[r.targetId])||void 0===d?void 0:d.adResponse.ads;L(r)&&p&&(null===(c=p[1])||void 0===c?void 0:c.rtb)&&(r.banner=null===(v=null===(u=p[1])||void 0===u?void 0:u.rtb)||void 0===v?void 0:v.banner),Ke(r)&&kt(r),Ke(r)&&!tt(r.targetId)&&Pt(r,o),!Je(r)||L(r)||tt(r.targetId)||t(r,l.get()),Ye(r)&&!Ze(r)&&(Er(r.targetId),Ir(r)),Xe(r)&&(n(()=>Ve(()=>window.apntag.showTag(r.targetId)),i),Ne.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(r)&&Ne.setData("horseshoe",{isAvailable:!0}),Cr({adObj:r}),(e=>{var t;const n=null==e?void 0:e.targetId;if(!n)return;const r=null===(t=document.querySelector(`#${n}`))||void 0===t?void 0:t.parentElement;r&&((e,t)=>{const{height:n,width:r,native:i}=e;i?t.dataset.adSizes="[1,1]":n&&r&&(t.dataset.adSizes=`[${r},${n}]`)})(e,r)})(r),e.adAvailable(r);const g=Fr.find(({id:e})=>e===r.targetId);g&&(yield Jr(g,r),Fr=Fr.filter(e=>e.id!==g.id)),_("core adAvailable stop",{placementsAvailable:Fr,adObj:r,isFullscreenScrollAd:Ke(r),isFinnBlink:tt(r.targetId),isNativeAd:Je(r),isMediation:L(r),isTakeoverAd:Ye(r),isCollapseAd:Ze(r),isWallpaperAd:Xe(r)})})),Rr.onEvent("adLoaded",n=>{const{refreshConfig:i,appearanceConfig:o}=l.get(),a=document.getElementById(n.targetId);tt(n.targetId)&&(e=>{const{fullscreenScroll:t}=l.get(),{initNativeAd:n}=l.getHandlers();Ke(e)&&Pt(e,t),Je(e)&&n(e,l.get())})(n);s.includes(n.targetId)&&Je(n)&&(t(n,l.get()),Cr({adObj:n})),!s.includes(n.targetId)&&L(n)&&s.push(n.targetId),Ze(n)&&_t(n.targetId),Ye(n)&&((e,t)=>{var n;const r="100%",i="100%";e.resizeAd(t,[r,i]);const o=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(o),t=e.width,n=e.height;t===r&&n===i||(o.style.width=r,o.style.height=i)}}).observe(o,{attributes:!0,attributeFilter:["style"]})})(Rr,n.targetId),Ge(n)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:r}={}}=l.get();if(!t||!n||!r)return;const i=t.parentElement;i&&(t.classList.add(`advertory-${n}-${r}__full-width-ad`),i.classList.add(`advertory-${n}-${r}-wrapper__full-width-ad`))})(n),(e=>st(e,m))(n)&&xr(n),Mn(n,i),(null==o?void 0:o.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(n.targetId);var d,c;Ne.getData("horseshoe").isAvailable&&r(n.targetId),e.adLoaded(n),d=n.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${d}`)&&(null===(c=window.gdpr)||void 0===c?void 0:c.setupButton)&&window.gdpr.setupButton(d),a&&a.classList.add("ad-loaded"),Or(n),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:n.targetId,adFormat:Pr(n)}}))}),Rr.onEvent("adNoBid",t=>N(void 0,void 0,void 0,function*(){_t(t.targetId),yield vn(l.get(),t),nr(t)&&tr(),e.adNoBid(t)})),Rr.onEvent("adError",(t,n)=>{nr(n)&&tr(),e.adError(t,n)}),Rr.onEvent("adCollapse",()=>{e.adCollapse()}),Rr.onEvent("adRequestFailure",t=>{_t(t.targetId),e.adRequestFailure(t)}),Rr.onEvent("adBadRequest",t=>{_t(t.targetId),e.adBadRequest(t)}),Rr.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),Rr.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),Zr=(e,t)=>N(void 0,void 0,void 0,function*(){var n,r;l.set(e),l.setHandlers(t),Ne.initialize(),window.addEventListener("message",In,!1),Rr=window.apntag||{anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}},window.apntag=Rr,_("Apn tag is set up on window"),yield ge(),_("User permission has been fetched"),yield Promise.allSettled([N(void 0,void 0,void 0,function*(){const{prebid:e}=l.get();(null==e?void 0:e.enabled)&&(yield Me(null==e?void 0:e.url))}),(n={country:e.country,tracker:e.tracker},N(void 0,[n],void 0,function*({country:e,tracker:t,timeout:n=1e3}){t&&(yield Promise.allSettled([Pe.processPPIDs(t,n),ke.processPPIDs(t,e)])).forEach((e,t)=>{"rejected"===e.status&&_(`Cannot fetch PPIDs v${t+2}`,e.reason)})})),N(void 0,void 0,void 0,function*(){const{astUrl:e}=l.get();yield Me(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),N(void 0,void 0,void 0,function*(){const{gptUrl:e}=l.get();yield Me(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),N(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n}=l.get(),{getConsentSync:r}=B(n),i=r();if(e&&t&&i){if(yield Me(t),document.querySelector(`.${Ar}`))return window._brandmetrics=window._brandmetrics||[],void window._brandmetrics.push({cmd:"_loadsurvey"});new MutationObserver((e,t)=>{for(const n of e){if("childList"!==n.type)return;Array.from(n.addedNodes).some(e=>{var t;return null===(t=e.outerHTML)||void 0===t?void 0:t.includes(Ar)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),we(),N(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=l.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield Me(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield Sr(),_("Libraries have been loaded and trackers have been set"),yield(r=t.librariesToLoad,N(void 0,void 0,void 0,function*(){const e=r.map(e=>Me(e));yield Promise.all(e)})),yield Xr(),yield Vr(),_("Page options have been set"),Ur(e),_("Advertory is setup on window"),Fr=Ht(),Bn(Fr),Rn(Fr),yield Yr(Fr),_("Ads has been loaded",Fr),Dr(Fr),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>N(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;const n=yield se(),r=new ae(n);cn({publisher:e.publisher,drEditionConfig:e.drEdition,device:e.deviceType,pageType:e.pageType,country:e.country},r,null===(t=e.pulse)||void 0===t?void 0:t.instance)}))(e)}),ei=(e,t)=>N(void 0,void 0,void 0,function*(){const{initConsentManager:n}=B(e.tcf),r=yield Br(e);var i;yield qr(),yield(i=n,N(void 0,void 0,void 0,function*(){return yield new Promise(e=>{i().then(t=>{e(null!=t?t:null)}).catch(t=>{e(null)})})})),_("TCF resolved successfully"),yield Zr(r,t),_("Run function resolved successfully")}),ti=((e,t)=>n=>{return r=Object.assign(Object.assign({},n),{siteSpecificConfig:t}),i=e,N(void 0,void 0,void 0,function*(){yield ei(r,i)});var r,i})({initNativeAd:Ue,wallpaperHandlers:{initWallpaperAd:Ue,adjustAdToHorseshoe:Ue},loadFinnBlinkAd:He,replaceAdsWithFinnBlink:He,preparePageOptions:je,prepareTag:e=>{const{keywords:t,targetId:n,invCode:r}=e,i=(e=>{const{isMobileApp:t}=l.get();return t?(e=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":"atb"))(e):e})(r),o=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,r=`${v()}-adformat`,i=t?t[r]:[];if(!i)return{};const o=(Array.isArray(i)?i:[i]).filter(e=>!(e in A)||window.innerWidth>=A[e]);return{[r]:n?o:i}})(e),s=(e=>{const t=`${v()}-targetid`;return e?{[t]:[e]}:{}})(n),a=S(),d=(e=>$(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(r),c=((e,t)=>$(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{})(r);return Object.assign(Object.assign({},e),{invCode:i,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),o),s),d),a),rendererOptions:c})},siteEvents:e,librariesToLoad:[]},{publisherClassName:x,fullWidthFormatClassName:"panorama",classesToRemoveOnRefresh:[]}),ni=Et("[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-slider-time{display:none}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container{padding:0 6px;height:36px}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon{margin-right:3px;height:unset;width:unset;bottom:0}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-volume,[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-playback{display:flex}");var ri=Object.freeze({__proto__:null,default:ni});exports.initAdvertoryPackage=ti,exports.updateAdvertory=(e,t)=>N(void 0,void 0,void 0,function*(){var n;if(!(null===(n=null===window||void 0===window?void 0:window.advertory)||void 0===n?void 0:n.initialized))return[];const{clearAds:r,reloadExistingAds:i,renderFinnBlinkPlacements:o,contextSelector:s}=null!=t?t:{};if(r)return Bt(),[];i&&(Bt(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{Dt(e.id)})),c(null!=e?e:{}),yield Vr();let a=Ht(s);return o&&(a=a.filter(e=>tt(e.id))),a.length>0&&(Fr=[...Fr,...a.map(e=>Object.assign({},e))],Bn(a),Rn(a),yield Yr(a)),Fr});
|