@schibsted/advertory 2.63.21 → 2.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/core/aftenposten/es/index.css +1 -1
  2. package/core/aftenposten/es/index.js +1 -1
  3. package/core/aftenposten/index.js +1 -1
  4. package/core/aftenpostenv2/es/index.css +1 -1
  5. package/core/aftenpostenv2/es/index.js +1 -1
  6. package/core/aftonbladet/es/index.css +1 -1
  7. package/core/aftonbladetv2/es/index.css +1 -1
  8. package/core/bt/es/index.css +1 -1
  9. package/core/bt/es/index.js +1 -1
  10. package/core/bt/index.js +1 -1
  11. package/core/e24/es/index.css +1 -1
  12. package/core/e24/es/index.js +1 -1
  13. package/core/e24/index.js +1 -1
  14. package/core/godare/index.js +1 -1
  15. package/core/godt/index.js +1 -1
  16. package/core/koket/es/index.css +1 -1
  17. package/core/minmote/index.js +1 -1
  18. package/core/pent/index.js +1 -1
  19. package/core/sa/es/index.css +1 -1
  20. package/core/sa/es/index.js +1 -1
  21. package/core/sa/index.js +1 -1
  22. package/core/svd/es/index.css +1 -1
  23. package/core/svd/index.js +1 -1
  24. package/core/svdv2/es/index.css +1 -1
  25. package/core/tek/index.js +1 -1
  26. package/core/vg/es/index.css +1 -1
  27. package/core/vg/es/index.js +1 -1
  28. package/core/vg/index.js +1 -1
  29. package/core/vgv2/es/index.css +1 -1
  30. package/core/vgv2/es/index.js +1 -1
  31. package/features/ad-native/index.js +1 -1
  32. package/package.json +1 -1
  33. package/sites/aftenposten/es/index.css +1 -1
  34. package/sites/aftenposten/index.js +1 -1
  35. package/sites/aftenpostenv2/es/index.css +1 -1
  36. package/sites/aftonbladet/es/index.css +1 -1
  37. package/sites/aftonbladetv2/es/index.css +1 -1
  38. package/sites/bt/es/index.css +1 -1
  39. package/sites/bt/index.js +1 -1
  40. package/sites/e24/es/index.css +1 -1
  41. package/sites/fotbollskanalen/es/index.css +1 -1
  42. package/sites/koket/es/index.css +1 -1
  43. package/sites/sa/es/index.css +1 -1
  44. package/sites/sa/index.js +1 -1
  45. package/sites/svd/es/index.css +1 -1
  46. package/sites/svd/index.js +1 -1
  47. package/sites/svdv2/es/index.css +1 -1
  48. package/sites/tv4/es/index.css +1 -1
  49. package/sites/tvnu/index.js +1 -1
  50. package/sites/vg/es/index.css +1 -1
  51. package/sites/vg/index.js +1 -1
  52. package/sites/vgv2/es/index.css +1 -1
  53. package/types/features/ad-native/sites/shared/templates/no/native-seamless/index.d.ts +4 -0
  54. package/types/features/ad-native/sites/shared/templates/no/seamless-image/index.d.ts +0 -4
@@ -1 +1 @@
1
- import"react/jsx-runtime";const e="ABSOLUTE_FULLSCREEN",t="ANY_FULLSCREEN",n="VERTICAL_FULLWIDTH",i="FULLWIDTH",o="TAKEOVER",r="VELVET_TAKEOVER",a="WALLPAPER",s="COLLAPSE",d={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}]},l={wallpaper:1600,"l-format":1600},c=e=>{const{banner:n,targetId:i}=e;return!(!n||(null==i?void 0:i.includes("takeover")))&&C(e,t)},u=e=>{const{native:t}=e;return!!t},v=e=>C(e,i),p=e=>{const{targetId:t}=e;return t.includes("takeover")||C(e,o)},g=e=>C(e,o),m=e=>C(e,a),h=e=>C(e,s),y=e=>e.targetId.includes("sponsorstripe"),f=e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!T(e),w=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},b=e=>e.targetId.startsWith("netboard"),E=e=>e.targetId.startsWith("board"),T=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),I=e=>e.targetId.startsWith("midboard"),k=e=>e.targetId.includes("widescreen"),S=e=>e.width>=1260&&e.width<=1280,A=e=>e.width>=1600&&e.width<=1620,C=(e,t)=>{const n=d[t];if(!n)return!1;return!!n.find(t=>{var n,i;const o=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,r=(null===(i=e.banner)||void 0===i?void 0:i.height)||e.height,a=t.width===o,s=!t.height||t.height===r;return a&&s})},$="0123456789abcdefghijklmnopqrstuvwxyz",O=(e,t)=>{e.style.display=t},P=e=>{window.apntag.anq.push(e)},L=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),x=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})}),N=e=>{const{targetId:t}=e,n=document.querySelector(`div[id^="${t}"]`);if(!n)return;const i=n.parentElement;if(!i)return;t.includes("integration_godt-menu")&&j(i)},j=e=>{const t=e.parentElement;t&&(t.style.display="none")},_=()=>{const e=document.querySelector(".advertory-vg-ad-native-sponsorstripe"),t=document.querySelector("#advertory-vg-sponsorstripe-info");e&&t&&((e,t)=>{const n=e.querySelector("#sponsorstripe-info-open-button"),i=e.querySelector("#sponsorstripe-info-close-button"),o=e.querySelector(".ad-wrapper");o&&(null==n||n.addEventListener("click",()=>{O(o,"none"),O(t,"flex")}),null==i||i.addEventListener("click",()=>{O(o,"flex"),O(t,"none")}))})(e,t)};function q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D,M;var B=q(function(){if(M)return D;M=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 n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,i){return e.concat(t).map(function(e){return n(e,i)})}function o(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 r(e,t){try{return t in e}catch(e){return!1}}function a(e,t,i){var a={};return i.isMergeableObject(e)&&o(e).forEach(function(t){a[t]=n(e[t],i)}),o(t).forEach(function(o){(function(e,t){return r(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(r(e,o)&&i.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(o,i)(e[o],t[o],i):a[o]=n(t[o],i))}),a}function s(t,o,r){(r=r||{}).arrayMerge=r.arrayMerge||i,r.isMergeableObject=r.isMergeableObject||e,r.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(o);return s===Array.isArray(t)?s?r.arrayMerge(t,o,r):a(t,o,r):n(o,r)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},D=s}());const R=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],F={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},V=6;class z{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 R){const i=e[n];void 0!==i&&(t[n]=i)}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)),Object.prototype.hasOwnProperty.call(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}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=B(z.DEFAULT_SITE_HANDLERS,e)}}z.DEFAULT_SITE_HANDLERS={siteEvents:F,initNativeAd:function(){}};const U=new z,H=U.modifyConfigProperties.bind(U);function W(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class K{initialize(){this.DATA=Object.assign({},K.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)}}K.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const G=new K,J="advertory-wallpaper-background",Y="advertory-with-horseshoe",Q=()=>{const e=document.querySelector(`.${J}`);e&&e.remove()},X=e=>{const t=e.getBoundingClientRect().top;requestAnimationFrame(()=>(e=>{if(!document.body)return;const t=document.querySelector(`.${J}`);t&&t.style.setProperty("top",`${e}px`)})(t+15))},Z=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,ee=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")&&Q())},te=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"))},ne=()=>{const{publisher:e,country:t,finnBlink:n}=U.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:o}}=U.getHandlers(),r=window.apntag,a={publisher:e,country:t,finnBlink:n},s=e=>{te(e),P(()=>r.showTag(e))};return{withXandrAd:s,withFinnBlinkAd:e=>W(void 0,void 0,void 0,function*(){yield i(e,a,null)}),withFullAdsChain:e=>W(void 0,void 0,void 0,function*(){yield i(e,a,s,()=>{G.getData("horseshoe").isAvailable&&o(e)})})}},ie={Blink:"Blink"},oe=new Map,re=e=>{var t;if(!oe.has(e)){const t=import(/* webpackIgnore: true */e).then(e=>(e=>{for(const[t,n]of Object.entries(ie)){const i=e[t];null!=i&&(window[n]=i)}})(e)).catch(t=>{throw oe.delete(e),t});oe.set(e,t)}return null!==(t=oe.get(e))&&void 0!==t?t:Promise.resolve()},ae="https://assets.finn.no/pkg/distribution-fixed/v1/FINNExternalDistribution.modern.js",se=(e,t,n,i)=>{const o=t.parentElement;if(!o)return;const r=e?`-${e}`:"",a=i?`__${i}`:"",s=`advertory${r}-${n}${a}`,d=`advertory${r}-${n}-wrapper${a}`;t.classList.remove(...t.classList),o.classList.remove(...o.classList),t.classList.add(s),o.classList.add(d),t.dataset.adType=n},de={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},le=e=>e===de.MOBILE,ce="finn-blink",ue="native-ad",ve=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},pe=()=>W(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)}}),ge=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},me=(e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={}}=U.get(),i=document.createElement("div"),o=document.createElement("div");return o.id=e,i.appendChild(o),se(n,o,ce),ve(`Creating blink container for: ${e}`),i},he=(e,t)=>{var n;(ve(`Appending ${t.id} after ${e.id}`),e.parentElement&&(n=e.parentElement,!Array.from(n.children).some(e=>e.classList.contains("advertory-finn-blink-wrapper"))))?(e.parentElement.style.display="none",e.parentElement.insertAdjacentElement("afterend",t)):ve(`Cannot perform afterend on: ${e.id}`)},ye=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),fe=e=>{const{source:t}=e;return"csm"===t},we=e=>{const{deviceType:t}=U.get();navigator&&navigator.userAgent.match(/firefox/i)&&(e=>e===de.DESKTOP||"tablet"===e)(t)&&be(e)},be=e=>{var t,n,i,o,r,a,s,d;const l=fe(e)?1:0,c=null===(i=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags)||void 0===i?void 0:i[e.targetId];if(null===(d=null===(s=null===(a=null===(r=null===(o=null==c?void 0:c.adResponse)||void 0===o?void 0:o.ads)||void 0===r?void 0:r[l])||void 0===a?void 0:a.rtb)||void 0===s?void 0:s.banner)||void 0===d?void 0:d.content){const e="<style>body { margin:0 !important; }</style>";c.adResponse.ads[l].rtb.banner.content+=e}},Ee={adRequested:()=>{},adAvailable:e=>{f(e)&&(e=>{const t=document.getElementById(e.targetId);t&&t.parentElement&&t.parentElement.classList.add("brandboard-container")})(e),we(e)},adLoaded:e=>{y(e)&&_()},adNoBid:e=>{const{finnBlink:t}=U.get();N(e),(b(e)||E(e)||f(e))&&((e,t)=>{W(void 0,void 0,void 0,function*(){const{deviceType:n}=U.get();if(!t||!le(n))return;yield re(ae);const{replacementConfig:i}=t,o=document.querySelector(`[id^="${e}"]`);if(!o||!(null==i?void 0:i.sizes))return;const{sizes:r}=i,a=ge(e),s=me(a);o.dataset.finnBlinkId=a,o.dataset.noBidAd="true",he(o,s),ne().withFinnBlinkAd(a)})})(e.targetId,t)},adError:(e,t)=>N(t),adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},Te=e=>new URLSearchParams(window.location.search).get(e),Ie=e=>new Promise(t=>{if(!window._tcf_||!(null==e?void 0:e.enabled))return void t(!1);const n=(()=>{if(!window._tcf_)return null;const e=window._tcf_.getPermissionSync("CMP:advertising");if(null===e)return null;const t=Number(e);return ve("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let i=!1;const o=e=>{i||(ve("Resolving advertising permission value obtained"),i=!0,t(e))},r=setTimeout(()=>{ve("Advertising permission timed out, resolving with false"),o(!1)},3e3);window._tcf_.onTcfReady(()=>{ve("On Tcf Ready called, waiting for permission"),clearTimeout(r)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(r);const t=Number(e);ve("Advertising permission value obtained asynchronously: ",e),o(Boolean(t))})}),ke={NO:"no",SE:"se"},Se="cmp:loaded";let Ae,Ce=!1;const $e=(e,t,n)=>{const i=!!(null==e?void 0:e.enabled),o=(null==e?void 0:e.timeout)||3e3,r=Te("bypass_tcf"),a=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(ve("TCF bypass param detected, returning consent: true"),!0):(ve("TCF is not enabled, returning consent: true"),!0))(i,r))return!0;if(Ce)return null;if(!Ae)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=Ae.getConsentedToAllSync();return ve(`TCF consented to all is: ${t}`),Ae.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(ve("Getting TCF consent manager..."),window._tcf_)return ve("TCF consent manager is already available"),Ae=window._tcf_,void e(Ae);ve("TCF consent manager is not available");const n=()=>{ve("CMP loaded, resolving consent manager..."),i&&clearTimeout(i),window._tcf_?(Ae=window._tcf_,e(Ae)):t(new Error("CMP loaded but window._tcf_ is not defined"))},i=setTimeout(()=>{document.removeEventListener(Se,n),Ce=!0,t(new Error("Timeout waiting for CMP to load"))},o);ve("Listening for CMP loaded event..."),document.addEventListener(Se,n,{once:!0})}):Promise.resolve(null),getConsentSync:a,getConsentAsync:()=>W(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ve(`Schibsted Ad Choices override value is set, returning override value: ${e.schibstedAdChoicesOverrideValue}`),Boolean(Number(e.schibstedAdChoicesOverrideValue));const i=(null==e?void 0:e.schibstedAdChoicesEnabled)&&n===ke.SE,r=(null==e?void 0:e.schibstedAdChoicesEnabled)&&!t&&n===ke.NO;if(i||r)return ve("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield Ie(e);if(!(null==e?void 0:e.enabled))return!0;const s=a();return null!==s?s:yield new Promise((e,t)=>{try{if(!Ae)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");let t=!1;const n=n=>{t||(t=!0,e(n))},i=setTimeout(()=>{ve("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);Ae.onTcfReady(()=>{ve("On Tcf Ready called, waiting for consent"),clearTimeout(i)}),Ae.isConsentedToAll(t=>{clearTimeout(i),e(t)})}catch(e){t(e)}})})}},Oe=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},Pe=()=>{const e=Oe("_pulse2data");return e?e.split(",")[2]:void 0},Le=9826;class xe{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=de.DESKTOP,isMobileApp:t}=U.get();if(t){return{"aa-sch-supply_type":`app_${e===de.MOBILE?"phone":de.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return W(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()),yield this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(e.keywords)),user:{externalUid:yield this.getExternalUid(),dnt:yield this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){return W(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}})}getUserId(){return Pe()}getExternalUid(){return W(this,void 0,void 0,function*(){return yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=$e(e,t,n);if(!(yield i()))return;const o=Oe("_pulse2data");return o?o.split(",")[9]:void 0})})}isTrackingForbidden(){return W(this,void 0,void 0,function*(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===(yield this.getExternalUid())})}getMember(){const{pageOptions:{member:e},testMember:t=Le}=U.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}=U.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return W(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=$e(e,t,n);return{"aa-sch-cmp_advertising":(yield i())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=U.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}=U.get(),i=null===(e=null==n?void 0:n.sponsors)||void 0===e?void 0:e.split(":").map(e=>`${t}_${e}`);return i?{"no-sno-news-sponsors":i}:{}}}const Ne=new xe;function je(e=!1){var t,n;const i=null===(n=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===n?void 0:n.toLocaleLowerCase(),o=(()=>{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:o,mobileOS:["ios","android"].includes(o)?o:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}Ne.prepare.bind(Ne);const _e=["aLOLE","xBqQj","1KaqJ","1nzXzK","opm8zV","4qKXKR","Ad9QgE"];function qe(e){return t=window.location.pathname.split("/").slice(-2,-1).pop()||"",_e.includes(t)?{"no-sno-news-section":`${e}_doedsfall`}:{};var t}class De extends xe{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=de.DESKTOP}=U.get();return{"no-sno-device":this.getPageOptionsFormatDevice(e)}}}getAppTypeKeywords(){const{deviceType:e,isMobileApp:t}=U.get(),{OS:n,isHybridApp:i}=je(t);return{"no-sno-apptype":n&&e&&i?`${n}_${this.getPageOptionsFormatDevice()}_hybrid`:"none"}}getObituariesKeywords(e){return qe(e)}getSectionPageTypeKeywords(){var e,t;const{pageOptions:n,pageType:i}=U.get(),o=null!==(t=null===(e=n.keywords["no-sno-news-section"])||void 0===e?void 0:e.toString())&&void 0!==t?t:"ettan";return{"no-sno-section-page_type":`${o.split("_").pop()||o}_${"article"===i?"article":"front"}`}}}const Me=864e5,Be=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return ve("Error with parsing localStorage data"),null}},t=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:t,setWithTimestamp:(e,n,i=Me)=>{const o={data:n,expirationTime:(new Date).getTime()+i};t(e,JSON.stringify(o))},getByTimestamp:(t,n=Me)=>{const i=e(t);if(!i)return null;if(!n)return i;try{const{expirationTime:e,data:t}=JSON.parse(i);return(new Date).getTime()<=e?t:null}catch(e){return ve("Error with parsing localStorage data"),null}}}})(),Re="glimrTags",Fe=["glwe_","glwet_"],Ve={geofenceTags:[],geoTags:[],weatherTags:[]},ze=(e,t,n,...i)=>W(void 0,[e,t,n,...i],void 0,function*(e,t,n,i="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return ve(`Schibsted Consent to Pay is not enabled, returning true for ${i}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ve(`Schibsted Ad Choices override value is set, returning override value: ${null==e?void 0:e.schibstedAdChoicesOverrideValue} for ${i}`),Boolean(Number(null==e?void 0:e.schibstedAdChoicesOverrideValue));const{getConsentAsync:o}=$e(e,t,n);return(yield o())?(ve(`Schibsted Ad Choices consent given according to TCF consent manager for ${i}`),!0):(ve(`Schibsted Ad Choices consent not given according to TCF consent manager for ${i}`),!1)}),Ue=()=>W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();if(null==e?void 0:e.schibstedConsentToPayEnabled){return yield ze(e,t,n,"glimr")}const{getConsentAsync:i}=$e(e,t,n);return yield i()}),He=()=>W(void 0,void 0,void 0,function*(){const{glimr:e}=U.get();if(!(yield Ue())||!(null==e?void 0:e.enabled))return void ve("No consent for glimr data fetching.");const t=yield(n=500,W(void 0,void 0,void 0,function*(){return yield Promise.race([W(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)=>{Be.setWithTimestamp(Re,{tags:e,tagMappings:t}),n(!0)})})}catch(e){ve(`Error during getting glimr data: ${e}`)}else ve("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),We=()=>{const{country:e}=U.get();return e===ke.NO?"no-sno":"se-generic"},Ke=()=>{const{country:e,publisher:t}=U.get();return`${e}-${t}`},Ge={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"},Je=e=>Fe.some(t=>e.startsWith(t)),Ye=e=>e.startsWith("glgc_"),Qe=e=>!Je(e)&&!Ye(e),Xe=e=>{const t=Ze();if(!t)return Ve;const n=((e=[])=>e.filter(Je))(t),i=((e=[])=>e.filter(Ye))(t),o=((e=[],t)=>{const n=e.filter(Qe);if(t){const{publisher:e}=U.get(),t=Ge[e]||e;n.push(t)}return n})(t,e);return{geoTags:o,geofenceTags:i,weatherTags:n}},Ze=()=>{const e=Be.getByTimestamp(Re);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},et={get:(e,t)=>W(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)=>W(void 0,void 0,void 0,function*(){const i=JSON.stringify(n),o=yield fetch(e,{method:"POST",headers:t,body:i});if(!o.ok)throw new Error(o.statusText);return yield o.json()})},tt="advertory:ppids-cache",nt={[ke.SE]:`SCH${ke.SE.toUpperCase()}-EnvHash`,[ke.NO]:`SCH${ke.NO.toUpperCase()}-EnvHash`},it={[ke.SE]:`SCH${ke.SE.toUpperCase()}-UserHash`,[ke.NO]:`SCH${ke.NO.toUpperCase()}-UserHash`},ot={[ke.SE]:`sch${ke.SE}-envhash-v3`,[ke.NO]:`sch${ke.NO}-envhash-v3`},rt={[ke.SE]:`sch${ke.SE}-userhash-v3`,[ke.NO]:`sch${ke.NO}-userhash-v3`},at={[ke.SE]:`'sch${ke.SE}-iosid-v3'`,[ke.NO]:`'sch${ke.NO}-iosid-v3'`},st={[ke.SE]:`sch${ke.SE}-androidid-v3`,[ke.NO]:`sch${ke.NO}-androidid-v3`},dt={[ke.SE]:"sdrn:schibsted.com:user",[ke.NO]:"sdrn:spid.no:user"};class lt{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:i})=>{t.append(e,`${i}-${n}`)}),t}}const ct=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return W(this,arguments,void 0,function*(e,t=1e4){var n,i;const o=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=o.xandr)||void 0===n?void 0:n.ppId1,null===(i=o.xandr)||void 0===i?void 0:i.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||ve("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:""}},ut=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return W(this,void 0,void 0,function*(){var n,i,o,r,a,s,d,l,c,u,v;const p=Be.get(tt),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===(i=g.idfv)||void 0===i?void 0:i.plain,null===(o=g.anId)||void 0===o?void 0:o.plain),void this.setPPIDs(null!==(r=c.userId)&&void 0!==r?r:"",null!==(a=c.environmentId)&&void 0!==a?a:"",null===(s=g.idfv)||void 0===s?void 0:s.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||ve("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,i){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:"",this.idfv=null!=n?n:null,this.anId=null!=i?i:null}shouldHash(e,t){var n,i;if(!e)return!0;for(const o in e){if((null===(n=e[o])||void 0===n?void 0:n.plain)!==(null===(i=t[o])||void 0===i?void 0:i.plain))return!0}return!1}cachePPIDs(e,t,n,i){const o=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}}:{}),i?{anId:{plain:i}}:{});Be.set(tt,o)}hashPPIDs(e,t){return W(this,void 0,void 0,function*(){try{const n=new Headers({"Content-Type":"application/json"});return yield et.post(t,n,e)}catch(e){return ve("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return W(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield((e,t)=>W(void 0,void 0,void 0,function*(){const n=yield e.getUserId();return n?`${dt[t]}:${n}`:null}))(t,n),o=yield(e=>W(void 0,void 0,void 0,function*(){const t=yield e.getEnvironmentId();return t?`sdrn:schibsted:environment:${t}`:null}))(t),r=window.advertory_idfv,a=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:e},userId:{plain:i},environmentId:{plain:o},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},r?{idfv:{plain:r}}:{}),a?{anId:{plain:a}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:i,environmentId:o}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:i.plain,environmentId:o.plain}}},vt=e=>W(void 0,void 0,void 0,function*(){const{tracker:t,tcf:n,country:i,isMobileApp:o}=e;if(!(yield ze(n,o,i,"setXandrPPIDs")))return;if(!t)return;(yield Promise.allSettled([ct.processPPIDs(t,null==n?void 0:n.timeout),ut.processPPIDs(t,i)])).forEach((e,t)=>{if("rejected"===e.status){ve(`Cannot fetch PPIDs v${t+2}`,e.reason)}})}),pt=e=>{const{ppid1:t,ppid2:n}=ct.getPPIDs(),{ppid1:i,ppid2:o,idfv:r,anId:a}=ut.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new lt).add(n,nt[e]).add(t,it[e]).add(o,ot[e]).add(i,rt[e]).add(r,at[e]).add(a,st[e]).buildEids()}]}},gt=e=>{const{ppid1:t,ppid2:n}=ct.getPPIDs(),{ppid1:i,ppid2:o,idfv:r,anId:a}=ut.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new lt).add(n,nt[e]).add(t,it[e]).add(o,ot[e]).add(i,rt[e]).add(r,at[e]).add(a,st[e]).buildRyEids()}}]}}};const mt=new class extends De{prepare(e){return W(this,void 0,void 0,function*(){const t=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.getCountryCodeKeywords(ke.NO)),this.getInventoryTypeKeywords()),this.getPublisherKeywords()),yield this.getFormattedExternalIdKeywords()),this.getSupplyTypeKeywords()),this.getPageTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),yield this.getAdvertisingConsentKeywords()),this.getHasContextKeywords(e.keywords)),yield W(void 0,void 0,void 0,function*(){const{glimr:e}=U.get(),{addPublisherToGeo:t}={},n=yield Ue();if(!(null==e?void 0:e.enabled)||!n)return ve("No consent for getting glimr tags."),{};const i=We(),o=Xe(t);return{[`${i}-geo`]:o.geoTags,[`${i}-weather`]:o.weatherTags,[`${i}-geofence`]:o.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=ct.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(Object.assign({},pt(ke.NO)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var ht=mt.prepare.bind(mt);const yt=()=>{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},ft={SVD:"svd",VG:"vg",GODARE:"godare",AFTENPOSTEN:"aftenposten",SA:"sa",BT:"bt",AFTONBLADET:"aftonbladet",E24:"e24",MINMOTE:"minmote",PENT:"pent",GODT:"godt",TEK:"tekno",KLART:"klart",TVNU:"tvnu",POLARIS:"polaris",KOKET:"koket",TV4:"tv4",FOTBOLLSKANALEN:"fotbollskanalen"},wt={[ft.VG]:["board","netboard","backfill","outstream"],[ft.AFTONBLADET]:["panorama","outstream"],[ft.GODARE]:["panorama","outstream"],[ft.SVD]:["wph-article-panorama","wph-front-panorama"]},bt=e=>{var t;const{publisher:n}=U.get();return!!wt[n]&&!!(null===(t=wt[n])||void 0===t?void 0:t.some(t=>e.includes(t)))},Et=()=>(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),Tt=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),It=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=U.get(),o=[`${We()}-geo`],r=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...i?o:[]],a=Object.fromEntries(Object.entries(e).filter(([e])=>r.includes(e))),s=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:a}}},s)}},kt=(e,...t)=>W(void 0,[e,...t],void 0,function*(e,{timeout:t}={timeout:1e3}){document.querySelector(`script[src="${e}"]:not([type="module"])`)||(yield new Promise((n,i)=>{const o=document.createElement("script");o.async=!0,o.src=e;const r=()=>{s(),n()},a=()=>{s(),i(new Error(`Failed to load ${e}`))},s=()=>{o.removeEventListener("load",r),o.removeEventListener("error",a),clearTimeout(d)};o.addEventListener("load",r),o.addEventListener("error",a);const d=setTimeout(()=>{s(),i(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(o)}).catch(e=>{console.error(e)}))}),St=e=>e.includes("snoap.no"),At=e=>{var t,n,i,o,r;return!!(null===(r=null===(o=null===(i=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags[e])||void 0===i?void 0:i.adResponse)||void 0===o?void 0:o.ads[1])||void 0===r?void 0:r.rtb)},Ct=(e,t=(...e)=>{})=>{const n=t.toString();if(0===e.length)return n;const i=n.substring(0,n.indexOf("=>")).replace("(","").replace(")","").split(",").map(e=>e.trim()),o=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),r=i.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...r,o).toString()},$t=Ct([],()=>{const e=({width:e,height:t})=>{var n;const i=null===(n=document.querySelector("#sf_align"))||void 0===n?void 0:n.querySelector("div");if(!i)return;const{clientWidth:o,clientHeight:r}=i,a=e/o,s=t/r;i.style.transform=`scale(${a},${s})`,i.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}),Ot=e=>{const t=Ct([],()=>{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 i=n.contentDocument.createElement("style");i.textContent="\n #image {\n background-size: cover !important;\n }\n ",new MutationObserver((e,t)=>{n.contentDocument&&(n.contentDocument.head.appendChild(i),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},Pt=[],Lt={},xt=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=jt(e);n?(Nt(i,n),_t(e,i,t)):(Nt(i,n),qt(e,i,t))})},Nt=(e,t)=>{var n,i;const o=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;const r=t?"showFullscreen":"hideFullscreen";null===(i=o.contentWindow)||void 0===i||i.postMessage(`advertory:${r}-${e}`,"*")},jt=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},_t=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),Pt.includes(t)||Pt.push(t),n&&window.addEventListener("scroll",Lt[t],{passive:!0})},qt=(e,t,n)=>{Pt.includes(t)&&(n&&window.removeEventListener("scroll",Lt[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},Dt=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:i=[".skyscraper_r"],headerZIndex:o=3}=t,r=[],a=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&r.push(n)}),i.forEach(e=>{const t=document.querySelector(e);t&&a.push(t)}),()=>{r.length&&Mt(e,r,o,0),a.length&&Mt(e,a,o,40)}},Mt=(e,t,n,i)=>{const o=e.offsetHeight,r=window.scrollY,a=e.getBoundingClientRect().top+r;t.forEach(e=>{const t=e.offsetHeight;let s;s=a>r?(a-r)/t-i:(r+t-(a+o))/t;const d=s<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=s.toString()})},Bt={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 Rt=null;const Ft=(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=`(${$t})()`,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(St(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=Ot(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>St(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)),St(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)),At(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},Vt=()=>{Rt=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,i=e?e.offsetLeft:0,o=document.documentElement;o.style.setProperty("--advertory-fullscreen-scroll-vh",`${t}px`),o.style.setProperty("--advertory-fullscreen-scroll-vw",`${n}px`),o.style.setProperty("--advertory-fullscreen-scroll-left",`${i}px`)},zt=()=>{Rt||(Rt=window.requestAnimationFrame(Vt))},Ut=(t,n)=>{var i,o,r,a;const{country:s}=U.get(),{targetId:d}=t;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(i=null==n?void 0:n.iosSafeAreaTopFix)&&void 0!==i?i:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:i="#fff",margin:o="16px 0",beforeContentValue:r=""}=e,a=t/2,s=document.createElement("style");s.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${a}px),\n ${i} calc(50% - ${a}px),\n ${i} calc(50% + ${a}px),\n ${n} calc(50% + ${a}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${o};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${r&&"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: '${r}' !important;\n }`,s.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(s)})(null!==(o=null==n?void 0:n.overlayStyles)&&void 0!==o?o:{});const l=document.getElementById(d),c=null==l?void 0:l.parentElement;if(!l||!c)return;((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,i=new IntersectionObserver(e=>xt(e,n),{}),o=jt(e);i.observe(e),n&&(Lt[o]=Dt(e,t))})(c,n),l.className="advertory-fullscreen-scroll";const u=C(t,e)?"absolute":"fixed";l.style.position=u,c.className="advertory-fullscreen-scroll-wrapper",c.dataset.showTagSubscribeId=d,l.setAttribute("data-ad-label",Bt[s].adText),(null==n?void 0:n.moveCogwheelToTheLeft)&&(l.dataset.moveCogwheelToTheLeft="true"),zt(),window.addEventListener("resize",zt),null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",zt),null===(a=window.visualViewport)||void 0===a||a.addEventListener("scroll",zt)},Ht=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=At(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,i=At(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ft(t,e))},Wt=()=>W(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,country:n,isMobileApp:i,fullscreenScroll:o}=U.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:r}=U.getHandlers(),{getConsentAsync:a}=$e(t,i,n),s=yield a(),d=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:i=>{const o=Et(),{prebid:{relevantCbTimeout:r}={}}=U.get(),a="relevantCb"===i&&r?r:n[i].timeout,s=setTimeout(()=>{!n[i].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${i}'`),e=!0,o.loadTags&&o.loadTags())},a);t.push(s)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),l=Et(),u=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=Et();return{user:e,keywords:t}})();d.failsafeOnTimeout("relevantCb");const{user:{externalUid:v=""}={},keywords:p}=u;(()=>{const e=Tt();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(d.getCancel()||!l.loadTags)return ve("core loadTags() call was cancelled",{cancel:d.getCancel(),apnTagLoadTags:!l.loadTags,condition:"or"}),void d.cleanup();const t=Tt();d.events.relevantCb.done=!0,d.failsafeOnTimeout("auctionCb");const i=s?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};ve("prebid consentManagement",i),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},gt(n)),It(p,v))),ve("core add prebid config",Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},gt(n)),It(p,v))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,l.loadTags(e)),d.cleanup()}},customNativeRender:e=>{Kt(e,r)},directRenderFn:e=>{const{settings:t,renderFn:n}=e,{bid:i,adDiv:r}=t||{};if(!r)return;const a=n(t),s=Object.assign(Object.assign({},i),{targetId:r.id,banner:!0});c(s)&&(Ut(s,o),(e=>{const t=()=>{const t=e.contentDocument;if(!(null==t?void 0:t.body))return;const n=()=>{const e=t.querySelector("iframe");if(!e)return!1;const n=()=>{var t;const n=null===(t=e.contentDocument)||void 0===t?void 0:t.querySelector(".adn-ttpa-container");n&&(n.style.setProperty("bottom","10px","important"),n.style.setProperty("top","unset","important"))};return e.addEventListener("load",n),n(),!0};if(n())return;const i=new MutationObserver(()=>{n()&&i.disconnect()});i.observe(t.body,{childList:!0,subtree:!0})};e.addEventListener("load",t),t()})(a))}}),ve("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,l.loadTags(e))}},customNativeRender:e=>{Kt(e,r)},directRenderFn:()=>{}})})}),Kt=(e,t)=>{var n;const{divId:i,native:o,bid:r}=e,a=document.querySelectorAll(`[id^=${i}]`)[0],s=`RY-${a.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)})(a,s);const d=null===(n=a.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:o,targetId:s},U.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:r.adId}),"*")};let Gt="";const Jt=new Map,Yt=e=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement,i=(null==n?void 0:n.offsetHeight)||0;n&&(n.style.minHeight=`${i}px`)},Qt=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=G.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=i},Xt=()=>{Q();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{ee(e.id),Qt(e),(e=>{const t=document.querySelector(`#${e}`),n=null==t?void 0:t.getAttribute("data-probable-height"),i=null==t?void 0:t.getAttribute("data-probable-width");n&&i&&(null==t||t.style.setProperty("min-height",n+"px"),null==t||t.style.setProperty("min-probable-width",i+"px"))})(e.id),e.innerHTML="",e.id=ge(e.id)}),P(()=>window.apntag.clearRequest())},Zt="noGroupedPlacements",en=e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t},tn=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},nn=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:i,deviceType:o}=U.get(),r=n[o].filter(tn)||[],a=e?document.querySelector(e):document;if(!a)return[];const s=r.reduce((e,t)=>{const n=en(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=r.filter(({id:e})=>e.match(t)),s=(null==i?void 0:i.queryByDataDevice)?`div[id^="${e}"][data-device=${o}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,d=a.querySelectorAll(s),l=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{var i;const o=on(e,t,n),r=o.finnBlink&&!o.finnBlink.renderOnlyWithAdBlock,a=r&&(null===(i=o.finnBlink)||void 0===i?void 0:i.loadOnlyFinnBlink),s=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=$[Math.floor(36*Math.random())];return t})(6)}`;return e.id=s,e.setAttribute("data-advertory-ad-rendered","true"),r&&e.setAttribute("data-is-finn-blink-placement","true"),a&&e.setAttribute("data-is-finn-blink-only-placement","true"),(e=>{var t;const n=e.id;n&&G.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({},o),{id:s})});return(e=>{const{keywordsConfig:t}=U.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(Gt!==window.location.pathname&&(Jt.clear(),Gt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=Jt.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${Ke()}-count`]=i,Jt.set(n,i+1),e})):e})(l)});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))})(s)},on=(e,t,n)=>{const i=n[t],o=n[n.length-1],r=n.filter(({id:t})=>t===e.id)[0];return(null==e?void 0:e.id)===(null==i?void 0:i.id)?i:(null==e?void 0:e.id)===(null==o?void 0:o.id)?o:r||o},rn=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=U.get(),i=(null==t?void 0:t[n])||{},o=Object.values(i).flat(),r=(e=>{const t={};return e.forEach(e=>{const n=ge(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),a=((e,t)=>{const n={};for(const[i,o]of Object.entries(t))n[i]=e.filter(e=>o.includes(ge(e.id)));return n})(e,i),s=Object.keys(r),d=((e,t)=>e.filter(e=>!t.has(ge(e.id))))(e,new Set([...s,...o]));return Object.assign(Object.assign(Object.assign({},a),r),{[Zt]:d})},an=(e,t,n)=>{const i=document.getElementById(`div_utif_${e}`);if(!i)return;const{apntag:o}=window,[r,a]=t;if(!i.dataset.lockedsize&&a&&r)i.style.width=`${r}px`,i.style.height=`${a}px`,n&&(o.resizeAd(i.id,[r,a]),i.dataset.lockedsize="true",i.dataset.lockedwidth=r.toString(),i.dataset.lockedheight=a.toString());else if(null==i?void 0:i.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=i.dataset;e&&t&&o.resizeAd(i.id,[e,t])}},sn=["netboard","board"];class dn{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,i;const{editionName:o}=e,r=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),a=JSON.stringify(null!==(i=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==i?i:[]),s=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return s.searchParams.append("editionName",o),r&&s.searchParams.append("urlData",r),a&&s.searchParams.append("excludedItems",a),l&&s.searchParams.append("spid",l),d&&s.searchParams.append("envid",d),s.toString()}fetchData(e){return W(this,void 0,void 0,function*(){var t,n,i;const o=yield this.identityFacade.getIdentityUser(),r=null!==(i=yield null===(n=null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId)||void 0===n?void 0:n.call(t))&&void 0!==i?i:"",a=(null==o?void 0:o.userId)?String(o.userId):"",s=this.buildUrl(e,{envId:r,spid:a});try{ve("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield et.get(s,e);return ve("Fetch operation completed successfully."),t}catch(e){ve("Error during fetch operation:",e)}return null})}}let ln=class{getDrEditionUTMParams(e,t){var n;const{title:i="",clientName:o,creativeId:r}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:a}=t,s=i.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:a,utm_campaign:o,utm_medium:s},r&&{utm_id:`df-${r}`})}getUrlSearchParams(e,t,n){if(!e)return"";const i=this.getDrEditionUTMParams(t,n),o=new URLSearchParams(decodeURIComponent(e.search)),r=new URLSearchParams(e.search);return Object.entries(i).forEach(([e,t])=>{o.has(e)||r.set(e,null!=t?t:"")}),r.toString().replace(/\+/g,"%20")}getUrlWithParams(e,t){var n;const i=null===(n=null==e?void 0:e.pulseData)||void 0===n?void 0:n.url;if(!i)return"";const o=this.getDrEditionUTMParams(e,t),r=new URL(i);return Object.entries(o).forEach(([e,t])=>{r.searchParams.has(e)||r.searchParams.set(e,null!=t?t:"")}),r.toString()}handleVideo(e,t){return W(this,void 0,void 0,function*(){const{id:n,autoplay:i,mute:o,videoLoop:r,vendor:a}=t.videoConfiguration;e.classList.add("vgtv-video-container"),Object.assign(e.dataset,{vgtvVideoId:n,vgtvVendor:a,vgtvAutoplay:i,vgtvMuted:o,vgtvLoop:!!r,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:i,pathname:o}=new URL(n);if(!i.includes("www.vg.no")&&!o.includes("annonsorinnhold"))return[n];const r=o.split("/");return r.length?[...r.filter(Boolean).slice(1).map(e=>e),n]:[n]}};const cn=e=>{const t=e.parentElement;t?t.classList.remove("dr-edition-lock-height"):ve("Dr. Edition container does not have a parent element, cannot remove height lock.")};class un{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(e,t){return W(this,void 0,void 0,function*(){var n,i;const{drEditionConfig:{containerSelector:o},renderAsBackfill:r=!1}=t,a=e.querySelector(o);if(!a)return void ve(`Container with selector "${o}" not found.`);const s=yield this.drEditionService.fetchData(t);return(null==s?void 0:s.itemId)||r?!(null==s?void 0:s.itemId)&&r?(ve("No Dr. Edition ads available to render. Collapsing whole placement."),ee(e.id),void cn(a)):((null==s?void 0:s.itemId)&&r&&(ve("Dr. Edition ad available to render as a Xandr backfill."),te(e.id)),void(s?(s.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(s.css,"style"),yield this.rendererManager.render(a,s,t),yield null===(n=this.videoManager)||void 0===n?void 0:n.handle(s,t),cn(a),this.drEditionAds.push(s),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(s.itemId),this.observeAdView(e,s,t),null===(i=e.querySelector("a"))||void 0===i||i.addEventListener("pointerup",()=>null)):cn(a))):(ve("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(a),this.showBackfill(e),void cn(a))})}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 i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";te(i)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const i=e.querySelector(".dr-edition-slider");if(!i)return!1;let o=null;const r=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(o&&clearTimeout(o),o=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...i.children].forEach(e=>{r.observe(e)})})},{threshold:[.9]});return[...i.children].forEach(e=>{r.observe(e)}),!0}}class vn{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){return W(this,void 0,void 0,function*(){if(!(null==t?void 0:t.itemId))return;const{getConsentAsync:i}=$e(n.tcf,n.isMobileApp,n.country),o=yield i(),r=le(n.device)?t.mobileHTML:t.desktopHTML,a=o?r:r.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");e.innerHTML=a,e.querySelectorAll("a").forEach(e=>{var i,o,r;e.search=null!==(r=null===(o=(i=this.newsroomStrategy).getUrlSearchParams)||void 0===o?void 0:o.call(i,e,t,n))&&void 0!==r?r:"",e.onclick=()=>this.pulseManager.trackContentClick(e,t,n)})})}}class pn{constructor(e){this.strategy=e}handle(e,t){return W(this,void 0,void 0,function*(){const{videoConfiguration:{id:n,preview:i}={}}=e;(n||i)&&(yield this.importScript(t),yield this.createVideoElement(e,t))})}importScript(e){return W(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield kt(t)}catch(e){ve("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return W(this,void 0,void 0,function*(){const n=document.createElement("div"),{node:i}=e.videoConfiguration,o=[...document.querySelectorAll(`#${i}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(e,t))return;this.strategy.handleVideo(n,e),null==o||o.appendChild(n),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const r=null==o?void 0:o.parentNode;if(!r)return;const a=r.closest("a");r.addEventListener("click",e=>{const t=e.target.closest("a");a!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,i,o;const{preview:{url:r,thumbnail:a}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!r)return!1;const s=document.querySelector(".dr-edition-preview .preview-video");return!!s&&(s.setAttribute("src",r),s.setAttribute("playsinline",""),!(!s||!a)&&(null===(o=(i=t.drEditionConfig).addPreviewVideo)||void 0===o||o.call(i,s),!0))}}let gn=class{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t,n,i){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 i=null==n?void 0:n.textContent;return i?i.trim():""}getEventTarget(e,t){const{itemId:n,pulseData:{url:i}={}}=t,o=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=o?o:""),type:"Page",url:i}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e,t,n){return W(this,void 0,void 0,function*(){var i,o,r,a,s,d,l,c;const u=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:n.editionName}});if(window.dispatchEvent(u),!this.pulse)return;const v=this.getEventInput(e,t,n,"view");(null===(i=this.pulse)||void 0===i?void 0:i.trackLegacyViewUIElement)?null===(r=null===(o=this.pulse)||void 0===o?void 0:o.trackLegacyViewUIElement)||void 0===r||r.call(o,v):(null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)?null===(d=null===(s=this.pulse)||void 0===s?void 0:s.trackViewUIElement)||void 0===d||d.call(s,v):null===(c=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===c||c.call(l,v)})}trackContentClick(e,t,n){return W(this,void 0,void 0,function*(){var i,o,r,a,s,d;if(!this.pulse)return;const l=this.getEventInput(e,t,n,"click");this.pulse.trackLegacyClickUIElement?null===(o=(i=this.pulse).trackLegacyClickUIElement)||void 0===o||o.call(i,l):this.pulse.trackClickUIElement?null===(a=(r=this.pulse).trackClickUIElement)||void 0===a||a.call(r,l):null===(d=(s=this.pulse).trackElementClick)||void 0===d||d.call(s,l)})}};class mn extends gn{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){const{pulseData:{title:i,clientName:o="",creativeId:r}={}}=t,{columnName:a,primaryPosition:s}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:i,placement:{columnName:a,primaryPosition:s},"spt:custom":{is_sponsored:!0,sponsor:o,"spt:creativeId":r},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}let hn=class extends gn{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var i,o,r,a,s,d;const{itemId:l,pulseData:{clientName:c,creativeId:u}={}}=t,v=n.editionName,p=this.mapPageType(this.pageType),g=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(a=null===(r=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getPulseObjectId)||void 0===r?void 0:r.call(o))&&void 0!==a?a: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===(s=this.newsroomStrategy)||void 0===s?void 0:s.getTags)||void 0===d?void 0:d.call(s,e)}}getEventInput(e,t,n,i){return{object:this.getEventBaseData(e,t,n),partnerstudio:this.getEventPartnerstudioData(e,t,n,i),target:this.getEventTarget(e,t),provider:this.getProviderData()}}getEventPartnerstudioData(e,t,n,i){var o,r,a,s;const{pulseData:{algorithm:d="sov",clientName:l,creativeId:c,editionId:u,itemId:v,url:p,probability:g}={}}=t,m=Math.floor(Date.now()/1e3),h=this.getTeaserElementText(e,"title"),y=this.getTeaserElementText(e,"subtitle"),f=this.getTeaserElementText(e,"image"),w=null!==(s=null!==(a=null===(r=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getUrlWithParams)||void 0===r?void 0:r.call(o,t,n))&&void 0!==a?a:p)&&void 0!==s?s:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:m,title:h,type:i,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}};const yn={FRONT:"front",ARTICLE:"article",OTHER:"other"},fn=(e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})},wn=e=>W(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 i=document.createElement("script");i.id=e,i.src="https://cdn.stream.schibsted.media/player/3.78.1/player.min.js",i.async=!0;try{i.src=i.src.replace("player.min","player.next.min")}catch(e){console.error("Failed to set player.next.min source:",e)}document.head.insertBefore(i,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)))}))}),bn={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 W(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Dr})})}})}},En=(e,t)=>{null==e||e.forEach(e=>{bn[e](t)})};class Tn{handleVideo(e,t){return W(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:o,vendor:r}}){yield W(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 a=["ContentMutePlugin"],s=this.createPlayerOverlay(e);En(a,s);const d={id:t,node:n,autoplay:i,mute:o,vendor:r,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},l=yield wn(d);l.once("assetReady",()=>{fn(l,a)}),l.once("ready",()=>{const t=e;new MutationObserver(e=>{e.forEach(({type:e,attributeName:n})=>{"attributes"===e&&"class"===n&&(t.classList.contains("jw-state-playing")?s.classList.add("is-playing"):s.classList.remove("is-playing"),t.classList.contains("jw-flag-user-inactive")?s.classList.add("is-inactive"):s.classList.remove("is-inactive"))})}).observe(t,{attributes:!0,attributeFilter:["class"]})}),l.once("PulseStats:ready",()=>W(this,void 0,void 0,function*(){const e=yield l.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===yn.FRONT?"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:i}=new URL(n),o=i.split("/").filter(Boolean);return o.length?[...o.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 In="https://www.aftonbladet.se/video-player-extras/latest/";class kn{handleVideo(e,t){return W(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:o,vendor:r}}){const a={id:t,node:n,autoplay:i,mute:o,vendor:r,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${In}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${In}external-link.js`]:{name:"ExternalLink"}}};yield wn(a),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""}}const Sn=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);class An{handleVideo(e,t){return W(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:o,vendor:r}}){const a={id:t,node:n,autoplay:i,mute:o,vendor:r,locale:"se",autopause:"viewable",maxBitrate:600,sharing:!1,recommended:!1,pulse:{provider:"svdse",decorator:(e,t)=>Object.assign(Object.assign({},Sn(e)?e:{}),{provider:Object.assign(Object.assign({},Sn(null==e?void 0:e.provider)?e.provider:{}),{productTag:"partnerstudio"})})},skin:{name:"svd-player",url:""},settings:{pulse:{host:"se-aftonbladet.videoplaza.tv",contentMetadata:{category:"SvD",tags:["standard-linears","pause",`video-${t}`]},requestSettings:{}}}},s=yield wn(a);s.once("PulseStats:ready",()=>W(this,void 0,void 0,function*(){const e=yield s.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"svdse",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===yn.FRONT?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}let Cn=class{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}};const $n=(e,t,n)=>{var i;const{publisher:o,pageType:r,country:a}=e,s={[ft.VG]:new ln,[ft.E24]:new Tn,[ft.AFTONBLADET]:new kn,[ft.SVD]:new An}[o]||new Cn,d=new(a===ke.SE?mn:hn)(n,s,r),l=new dn(t,null!==(i=null==n?void 0:n.pulseTracker)&&void 0!==i?i:n),c=new vn(s,d),u=new pn(s);return new un(l,c,u,d)},On=()=>W(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 Pn{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 W(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 ve("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return W(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 Ln=(e,t,n)=>{const{wrapperSelector:i}=null==e?void 0:e.drEditionConfig,o=document.querySelectorAll(i),r=new IntersectionObserver((i,o)=>((e,t,n,i,o)=>{const r=$n(n,i,o);e.forEach(e=>{var i,o,a;if(!e.isIntersecting)return;const s=e.target,d=null!==(i=s.dataset.editionName)&&void 0!==i?i:"",l=null!==(o=s.dataset.pulseColumnname)&&void 0!==o?o:"",c=null!==(a=s.dataset.pulsePrimaryposition)&&void 0!==a?a:"";r.fetchAndRenderAd(s,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(s)})})(i,o,e,t,n),{rootMargin:"400% 0px"});o.forEach(e=>r.observe(e))},xn=[],Nn=(e,t)=>W(void 0,void 0,void 0,function*(){var n;const{pulse:i,tcf:o,deviceType:r,drEdition:a,publisher:s,pageType:d,country:l,isMobileApp:c}=e;if(!(yield ze(o,c,l,"handleDrEditionBackfill")))return;const u=((e,t)=>{var n;const{deviceType:i,placements:o,drEdition:{fallbackGlobalEditionName:r}={}}=e,a=o[i]||o.desktop,s=ge(t.targetId),d=a.find(e=>e.id===s),l=sn.some(e=>s.startsWith(e)),c=xn.includes(s),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||r;return d&&l&&!c&&u?(xn.push(s),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(e,t);if(!u)return;if(!(null==i?void 0:i.instance))return void ve("Pulse has not been passed as a prop, aborting");const v=yield On(),p=new Pn(v),g=$n({publisher:s,pageType:d,country:l},p,null==i?void 0:i.instance),m=document.getElementById(t.targetId);if(!m||!a)return;m.classList.value="";const h=document.createElement("div");h.className=a.containerSelector.replace(/^[.#:[\]]+/,""),m.innerHTML=h.outerHTML;const y={editionName:(null===(n=null==u?void 0:u.drEdition)||void 0===n?void 0:n.editionName)||"",drEditionConfig:a,device:r,tcf:o,isMobileApp:c,country:l,renderAsBackfill:!0};yield g.fetchAndRenderAd(m,y)}),jn="collapseAd",_n="hideAd",qn="resizeAd",Dn="renderDrEditionFallback",Mn="wallpaperImageUrl",Bn="wallpaperColor",Rn="velvet",Fn=[qn,Mn,Bn,jn,_n,Dn,Rn];let Vn;const zn=e=>{if("object"==typeof e)return e;if(t=e,Z.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:Mn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:Bn,wallpaperColor:t}}if(e.startsWith(Dn)){const t=e.split(":")[1];return{name:Dn,targetId:t}}if(e.startsWith(jn)||e.startsWith(_n)){const t=e.split(":")[1];return{name:jn,targetId:t}}if(e.includes("name")&&Fn.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},Un=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=zn(t);if(!n)return;if(!n.name||!Fn.some(e=>n.name===e))return;const{name:i,targetId:o,wallpaperImageUrl:r,wallpaperColor:a,cmd:s,size:d}=n;i===Rn&&s&&(s.includes("noScroll")&&(Vn=(e=>{if(!e)return()=>{};const t=e.style.overflow;return e.style.setProperty("overflow","hidden"),()=>{e.style.setProperty("overflow",t)}})(document.querySelector("body"))),(s.includes("close")||s.includes("ended"))&&(null==Vn||Vn(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),i!==jn&&i!==_n||!o||ee(o),i===qn&&o&&s&&an(o,s),i===Dn&&o&&(ee(o),Nn(U.get(),{targetId:o})),"resizeMediationAd"===i&&o&&d&&an(o,d,!0),i===Mn&&r&&(e=>{const t=document.querySelector(`.${J}`);t&&(t.style.backgroundImage=`url(${e})`)})(r),i===Bn&&a&&(e=>{const t=document.querySelector(`.${J}`);t&&(t.style.backgroundColor=e)})(a)},Hn=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),Wn=(e,t,n)=>{const i="true"===n.dataset.isFinnBlinkOnlyPlacement;return w(t)&&i?(ve(`loading finn blink ad for blink only placement for ${t}`),void ne().withFinnBlinkAd(t)):w(t)?(ve(`loading finn blink ad with full ads chain for ${t}`),void ne().withFullAdsChain(t)):void P(()=>(ve("core showTag",{id:t}),e.showTag(t)))},Kn=(e,t)=>W(void 0,void 0,void 0,function*(){yield L,yield x;const n=new IntersectionObserver((t,n)=>((e,t,n,i)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:o}=e,r=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(o),a=document.getElementById(r);ve("core log from intersection observer handler",{targetId:r,element:a}),n(window.apntag,r,i),a&&(t.unobserve(a),t.disconnect())})})(t,n,Wn,e),Hn(t));n.observe(e)}),Gn=new Map,Jn=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],Yn=".brandstudio-premium-content-widget",Qn=({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=Qn({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),Qt(i=t),i.innerHTML=""},Zn=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},ei=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=U.get(),i=Jn.includes(n)&&Boolean(t.closest(Yn));const o=i?t.closest(Yn):null,r=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,a=n&&t.matches("iframe, article")&&e;if(!n||!i&&!a||i&&!o)return;if(a)return Zn(e),void r.disconnect();const s=t.closest('[style*="height"]'),d=o;s&&d.contains(s)?Zn(s):d.hasAttribute("style")&&Zn(d),r.disconnect()})})});try{r.observe(t,{childList:!0,subtree:!0})}catch(e){r.disconnect()}},ti=(e,t,n,i,o,r)=>{var a;const s=performance.now(),d=null!==(a=Gn.get(t))&&void 0!==a?a:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,o)&&n<0;s-d>=o&&l&&(Gn.set(t,s),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&Xn({adWrapper:i,placementContainer:n}),P(()=>{e.setKeywords([t],{[`${We()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,r))},ni=(e,t,n)=>{const i=new IntersectionObserver((e,i)=>((e,t,n,i)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:o,boundingClientRect:r}=e;t(window.apntag,o.id,r.y,n,i,o)})})(e,ti,t,n),Hn(300));i.observe(e)},ii=(e,t=6)=>{const n=[];for(let i=0;i<e.length;i+=t){const o=e.slice(i,i+t);n.push(o)}return n},oi=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},ri=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=U.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),ci(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},ai=(e,t,n)=>{const i=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const o of i){const i=e.find(e=>{var t;return e.id===(null===(t=o.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),r=null==i?void 0:i.threshold;oi(o,r)&&i&&(Yt(i.id),n.length&&o.classList.remove(...n),ci([i],t))}},si=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=U.get();t&&(e.forEach(({id:e})=>{const t=di(e);t&&(t.dataset.bfCacheRefresh="true")}),i?((e,t)=>{document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&ai(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const i=()=>{window.scrollY>0&&(window.removeEventListener("scroll",i),ai(e,!1,t))};n.persisted&&(ye()?window.addEventListener("scroll",i,{passive:!0}):ai(e,!1,t))})})(e,n))},di=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},li=e=>{const{id:t,allowedFormats:n}=e,i=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(di(t)),o=(e=>1===e[0]&&1===e[1])(i),r={sizes:[i],allowedFormats:o?n:n.filter(e=>"native"!==e),allowSmallerSizes:!1};return o||(r.native=void 0),r},ci=(e,t=!1)=>{const{requestSize:n=V}=U.get(),i=e.map(({id:e})=>e),o=ii(i,n);if(t)for(const t of e){const e=li(t);window.apntag.modifyTag(t.id,e)}for(const e of o)P(()=>window.apntag.refresh(e))};const ui="#fff",vi="#0098da",pi="splash",gi="welcomePage",mi="topscroller",hi="velvet",yi="takeover-displayed",fi="takeover-visit-count",wi=14400,bi=()=>{const e=Oe(fi);return e?parseInt(e):0},Ei=()=>{const{takeover:{enabled:e=!1,secondVisitEnabled:t=!1}={}}=U.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||!(!e||(()=>{var e;const t=(null===(e=U.get().takeover)||void 0===e?void 0:e.cookieCapName)||yi;return"true"===Oe(t)})())&&(!t||Ti()))},Ti=()=>{const e=bi();return 0===e?((()=>{const e=bi(),{takeover:{cookieCapTime:t=wi}={}}=U.get(),n=document.location.hostname;window.document.cookie=`${fi}=${e+1}; max-age=${t}; domain=${n}; path=/`})(),!1):1===e},Ii=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),ki=()=>{const{takeover:e}=U.get();return Boolean(null==e?void 0:e.topscroller)},Si=()=>W(void 0,void 0,void 0,function*(){const e=document.location.hostname,{takeover:{cookieCapName:t=yi,cookieCapTime:n=wi}={},isMobileApp:i,tcf:o,country:r}=U.get(),a=yield ze(o,i,r,"ad-takeover-cookiecap");n&&a&&(window.document.cookie=`${t}=true; max-age=${n}; domain=${e}; path=/`)}),Ai=e=>{var t;const n=!!(null===(t=U.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return p(e)&&n},Ci=(e,t)=>{var n;if(t===mi){const{topscroller:t}=e;return null!=t?t:{}}if(t===pi){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},$i=(e,t)=>{t!==pi?(e=>{var t,n,i;const o=null===(n=null===(t=U.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,r=null===(i=U.get().takeover)||void 0===i?void 0:i.topscroller;if(!o||r)return;const a=document.querySelector(o),s=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),l=document.querySelector(".advertory-welcome-page-scroll");if(!(a&&s&&l&&d))return;const c=null==a?void 0:a.offsetHeight,u=g(e)?"60svh":`calc(100svh - ${c}px)`,v=g(e)?"calc(40svh + 30px)":`calc(${c}px + 30px)`;s.style.setProperty("height",u,"important"),d.style.setProperty("height",u,"important"),l.style.setProperty("bottom",v,"important")})(e):(e=>{var t;if(!(null===(t=U.get().takeover)||void 0===t?void 0:t.splash))return;const n=document.querySelector(".advertory-splash-navbar-wrapper"),i=document.querySelector(`#${e.targetId}`);if(!n||!i)return;const o=`calc(100svh - ${n.offsetHeight}px)`;i.style.setProperty("height",o,"important")})(e)},Oi=Ct([],()=>{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})}),Pi=(e,t=!0)=>{(e===gi||e===mi)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},Li=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},xi=e=>{document.body.style.overflow=e?"initial":"hidden"},Ni=e=>{const t=_i(e),n=ji(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),xi(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},ji=e=>{const t=()=>Ni(e);return window.addEventListener("advertory:closeTakeover",t),Li(),t},_i=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&Ni(e)};return Li(),window.addEventListener("keydown",t),t},qi=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(_i(e),ji(e),Li(),t.addEventListener("click",()=>{Ni(e)}),xi(!1))},Di=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),ji(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},Mi=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>Ni(e))})(e)},Bi=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=U.get(),n=e.querySelectorAll(".advertory-splash-navbar-wrapper"),i=document.querySelector(".advertory-takeover-label");Array.from(n).forEach(e=>e.style.display="flex"),t&&i&&(i.style.display="flex",i.innerText=Bt.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},Ri=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=Bt.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},Fi=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=Bt.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},Vi=e=>{const t=document.querySelector(".advertory-takeover-label");t&&(t.style.display="flex",t.innerText=Bt.se.adText,e.classList.toggle("advertory-impact-wrapper",!0))},zi=()=>{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)},Ui=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${Oi})()`,e+t.outerHTML})(e)),n},Hi=e=>{const t=(e=>{const{requests:t}=window.apntag,n=At(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,i=At(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ui(t))},Wi=e=>W(void 0,void 0,void 0,function*(){const{takeover:t}=U.get(),{targetId:n}=e,i=document.querySelector(`#${n}`),o=document.querySelector(".advertory-takeover-wrapper");if(!i||!o||!t)return;const a=(e=>{const{width:t,height:n}=e;return Ii(t,n)?pi:C(e,r)?hi:ki()?mi:gi})(e),s=o.offsetHeight,d=window.scrollY>s;o.style.display="block",!d&&Pi(a,!1),((e,t)=>{({[gi]:Fi,[pi]:Bi,[mi]:Ri,[hi]:Vi})[t](e)})(o,a),zi(),((e,t)=>{({[gi]:Di,[mi]:Di,[pi]:qi,[hi]:Mi})[t](e)})(o,a),((e,t,n)=>{if(!n)return;({[gi]:()=>{const{buttonLabel:i}=Ci(n,t);["#advertory-welcome-page-scroll-label","#advertory-welcome-page-scroll-image"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(n.innerText=null!=i?i:"")})},[pi]:()=>{const{themeColors:i,logotype:o,buttonLabel:r,showArrowIcon:a}=Ci(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!=r?r:""),".advertory-splash-close"===t&&a){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&&o&&(n.setAttribute("src",o.url),n.setAttribute("alt",o.alt)),".advertory-splash-navbar-wrapper"===t&&i){const{backgroundColor:e,color:t}=i;n.style.setProperty("background-color",null!=e?e:ui,"important"),n.style.color=null!=t?t:vi}}})},[mi]:()=>{const{buttonLabel:i,showArrowIcon:o,showCloseButton:r=!0}=Ci(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||r||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=i?i:""))})},[hi]:()=>{}})[t]()})(o,a,t),yield Si(),!d&&Pi(a,!0),$i(e,a)}),Ki="advertory-brandmetrics-survey",Gi=()=>W(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n,tcf:i}=U.get(),o=yield ze(i,n,t,"norstat");if(!e||n||!o)return;const r=(e=>{const{ppid1:t,ppid2:n}=ct.getPPIDs(),{ppid1:i,ppid2:o}=ut.getPPIDs(),r=(new lt).add(n,nt[e]).add(t,it[e]).add(o,ot[e]).add(i,rt[e]);return`${r.buildNorstatPath()}?${r.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{W(void 0,[e,t,...n],void 0,function*(e,t,n=!0){if(document.getElementById(t))return;const i=document.createElement("img");i.src=e,i.id=null!=t?t:"",n&&(i.style.display="none"),document.body.appendChild(i)})})(`https://sch-map.norstatsurveys.com/api/nids/${t===ke.NO?"schibsted":"schibstedse"}/map/${r}`,"norstat")}),Ji={nativeAd:e=>u(e)&&!y(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:v,fullscreenScroll:c,topscroller:e=>p(e)&&ki(),splash:e=>p(e)&&Ii(e.width,e.height),welcomePage:p,wallpaper:m,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:S,hFormat:A,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!A(e)&&!S(e),topboard:e=>e.targetId.startsWith("topboard")&&!p(e),widescreen:k,insider:e=>e.targetId.startsWith("insider"),sponsorstripe:y,brandboard:e=>f(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!I(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>b(e)||E(e),panorama:T,midboard:I},Yi=({adObj:e,preferredTestIdData:t})=>{var n,i;const o=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!o)return;const r=null===(i=document.querySelector(`#${o}`))||void 0===i?void 0:i.parentElement;if(!r)return;if(((e,t)=>{var n,i,o,r;const a=null===(r=null===(o=null===(i=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===i?void 0:i.tags)||void 0===o?void 0:o[e])||void 0===r?void 0:r.invCode;a&&(t.dataset.invCode=a)})(o,r),null==t?void 0:t.testId)return void(r.dataset.testid=t.testId);const a="DIV"===(null==r?void 0:r.tagName);e&&a&&((e,t)=>{var n,i;for(const[o,r]of Object.entries(Ji))if(r(e)){if("nativeAd"===o){const r="default";t.dataset.testid=`${o}-${null!==(i=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==i?i:r}`;break}t.dataset.testid=o;break}})(e,r)},Qi=e=>{var t;return(null===(t=Object.entries(Ji).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},Xi=(e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1},Zi=new Map;Zi.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),Zi.set("panorama",{scale:.79,transformOrigin:"center center"}),Zi.set("outstream",{scale:.79,transformOrigin:"center center"}),Zi.set("integration",{scale:.79,transformOrigin:"center center"}),Zi.set("toppanorama",{scale:.8,transformOrigin:"left center"});const eo=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 i=Qi(e),o=Zi.get(i),r=document.querySelector(`#${e.targetId}`);if(!r||!o)return;if(r.style.transformOrigin=o.transformOrigin,r.style.transform=`scale(${o.scale})`,!(null==o?void 0:o.cogwheelAdjust))return;const a=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),s=null==r?void 0:r.offsetWidth;a&&"number"==typeof s&&!isNaN(s)&&a.style.setProperty("right",String(-1*s*.2)+"px")},to=e=>{var n,i,o,r,a,s;const{adScaleConfig:d,deviceType:l}=U.get();if(!(null==d?void 0:d.enabled))return;if(C(e,t))return;const c=null!==(n=d.adsToBeScaled[l])&&void 0!==n?n:[],u=en(e.targetId.split("-")[0]);if(!c.includes(u))return;const v=null!==(o=null===(i=d.offset)||void 0===i?void 0:i[u])&&void 0!==o?o:0,p=document.getElementById(e.targetId),g=null!==(r=null==p?void 0:p.offsetWidth)&&void 0!==r?r:window.screen.width,m=null!==(s=null===(a=null==p?void 0:p.parentElement)||void 0===a?void 0:a.offsetWidth)&&void 0!==s?s:window.screen.width;((e,t=window.screen.width)=>{const n=Xi(e,t),i=document.querySelector(`iframe[id^="utif_${e.targetId}"]`);i&&(i.style.transform=`scale(${n})`,i.style.transformOrigin="left top")})(e,(g<m?g:m)-v)},no=(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,io=e=>`externalImpId:'${e}'`,oo=e=>{var t;const{forwardExternalImpId:n=!1,tracker:i}=U.get(),o=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${Ke()}-count`],i=e.positionConfig.find(e=>e.adPositionIndex===n);if(!i)return e;const o=i.keywords?Object.assign(Object.assign({},e.keywords),i.keywords):e.keywords;return Object.assign(Object.assign({},e),{sizes:null!==(t=null==i?void 0:i.sizes)&&void 0!==t?t:e.sizes,keywords:o})})(e),{id:r,sizes:a,keywords:s,allowedFormats:d,invCode:l,ssa:c=!1,nativeCustomProperties:u,safeframeConfig:v,dynamicSizeWidthCheck:p=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Ei())return e;const n=null===(t=e.keywords)||void 0===t?void 0:t["no-sno-adformat"],i=null==n?void 0:n.filter(e=>e!==mi),o=Object.assign(Object.assign({},e.keywords),n&&{"no-sno-adformat":i}),r=e.sizes.filter(([e,t])=>4!==e||4!==t);return Object.assign(Object.assign({},e),{sizes:r,keywords:o})})(o),g=Object.assign({invCode:l,sizes:a,targetId:r,keywords:no(s,c),allowedFormats:d,dynamicSizeWidthCheck:p},v&&{safeframeConfig:v}),m=(e=>{var t,n,i,o,r,a,s;return e?(null===(t=null==e?void 0:e.instance)||void 0===t?void 0:t.state)?(null===(i=null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)||void 0===i?void 0:i.pageViewId)?(ve("Tracker state pageViewId is:",null===(r=null===(o=null==e?void 0:e.instance)||void 0===o?void 0:o.state)||void 0===r?void 0:r.pageViewId),null===(s=null===(a=null==e?void 0:e.instance)||void 0===a?void 0:a.state)||void 0===s?void 0:s.pageViewId):(ve("Tracker state does not contain field pageViewId or it is empty"),""):(ve("Tracker state is empty"),""):(ve("Tracker is not configured in initAdvertory function"),"")})(i);n&&m&&(ve("External Impression ID assigned to defineTag:",io(m)),g.externalImpId=io(m));const h=(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,i])=>((null==e?void 0:e.includes(n))&&(t[n]=i),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}}))(u);return(null===(t=e.allowedFormats)||void 0===t?void 0:t.includes("native"))&&(g.native=h),g},ro=e=>!e.includes("takeover")||Ei(),ao=e=>{const{publisher:t=""}=U.get(),n=document.querySelector(`#${e}`);if(!n)return;const i=`-${t}`;n.classList.remove(`advertory${i}-finn-blink`),n.classList.remove(`advertory${i}-finn-blink-wrapper`)},so=e=>{if(!e)return e;const t=e[`${We()}-targetid`],n=t?ge(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${We()}-targetid`]:[n]})},lo=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${We()}-geo`]&&{[`${We()}-geo`]:["geo-test-value"]}),e[`${We()}-geofence`]&&{[`${We()}-geofence`]:["geofence-test-value"]}),e[`${We()}-weather`]&&{[`${We()}-weather`]:["weather-test-value"]}),co=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 i=n.split(",")[0].split(":")[0],o=e.find(e=>e.invCode===i),r=document.querySelector(`[id^=${null==o?void 0:o.id}]`);r&&r.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"})})()},uo=(e,t)=>W(void 0,void 0,void 0,function*(){return yield new Promise(t=>{e().then(e=>{t(null!=e?e:null)}).catch(e=>{t(null)})})}),vo={arrayMerge:(e,t)=>t},po=e=>W(void 0,void 0,void 0,function*(){if(!(e=>{const{editableConfiguration:{useS3Config:t=!1,pageTypeToFetch:n}={},siteSpecificConfig:i}=e;return Boolean(t&&n&&(null==i?void 0:i.publisherClassName))})(e))return e;try{const t=yield(e=>W(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,i=setTimeout(()=>n.abort(),5e3);try{return yield et.get(t,{method:"GET",signal:n.signal})}catch(e){throw ve("Failed to fetch S3 config",{error:e,url:t}),e}finally{clearTimeout(i)}}))(e);return t?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:i,refresh:o,placements:r,threshold:a,batchSize:s}=t,d=B.all([e.placements,r],vo),l=B(e.pageOptions,{keywords:i},vo),c=B(e.appearanceConfig,{defaultThreshold:a},vo),u=B(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:o},vo);return Object.assign(Object.assign({},e),{placements:d,requestSize:null!=s?s:e.requestSize,pageOptions:l,appearanceConfig:c,refreshConfig:u})})({siteConfig:e,configOverrides:t}):e}catch(t){return ve("Error fetching S3 config, using site config",{error:t}),e}}),go=".advertory-right-column-track",mo="--advertory-right-column-track-height",ho=e=>e.getBoundingClientRect().top+window.scrollY,yo=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},fo=(e,t)=>{const n=(i=t,`${Math.max(0,Math.round(i))}px`);var i;document.body.style.setProperty(e,n)},wo=(e,t)=>`${e}-${t}`,bo=(e,t,n)=>{var i;const o=Array.from(null!==(i=e.querySelectorAll(t))&&void 0!==i?i:[]),r=(e=>e.map(e=>{var t;return null===(t=document.querySelector(`[id^="${e}"]`))||void 0===t?void 0:t.parentElement}).map((e,t)=>({point:e,originalIndex:t})).filter(e=>Boolean(e.point)))(n);if(0===r.length)return;const a=ho(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=yo(e);fo("--advertory-newsroom-header-height",t)})(),r.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const i=ho(e),o=wo(mo,t),r=i-n,a=wo("--advertory-right-column-split-point-height",t),s=yo(e);fo(o,r),fo(a,s)})(e,t+1,a),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=wo("--advertory-right-column-ad-height",t),i=yo(e);fo(n,i)})(o[t])});((e,t)=>{const n=ho(e);fo(mo,n-t)})(r[Math.min(o.length,r.length-1)].point,a)};let Eo=!1;class To{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:i,pathname:o}=new URL(n);if(!i.includes("www.vg.no")&&!o.includes("annonsorinnhold"))return[n];const r=o.split("/");return r.length?[...r.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Io{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class ko{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){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()||""}getEventTarget(e){const{url:t,title:n,itemId:i}=this.parseKilkayaData(e);return{id:i,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e){return W(this,void 0,void 0,function*(){var t,n,i,o,r,a,s,d,l;const c=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:null===(t=this.parseKilkayaData(e))||void 0===t?void 0:t.placement}});if(window.dispatchEvent(c),!this.pulse)return;const u=this.getEventInput(e,"view");(null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)?null===(o=null===(i=this.pulse)||void 0===i?void 0:i.trackLegacyViewUIElement)||void 0===o||o.call(i,u):(null===(r=this.pulse)||void 0===r?void 0:r.trackViewUIElement)?null===(s=null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)||void 0===s||s.call(a,u):null===(l=null===(d=this.pulse)||void 0===d?void 0:d.trackElementView)||void 0===l||l.call(d,u)})}trackContentClick(e){return W(this,void 0,void 0,function*(){var t,n,i,o,r,a;if(!this.pulse)return;const s=this.getEventInput(e,"click");this.pulse.trackLegacyClickUIElement?null===(n=(t=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(t,s):this.pulse.trackClickUIElement?null===(o=(i=this.pulse).trackClickUIElement)||void 0===o||o.call(i,s):null===(a=(r=this.pulse).trackElementClick)||void 0===a||a.call(r,s)})}}class So extends ko{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,i,o,r,a;const{clientName:s,creativeId:d,itemId:l,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),v=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(o=null===(i=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===i?void 0:i.call(n))&&void 0!==o?o:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:s,creativeId:null!=d?d:l},page:{"@id":null!=v?v:c,"@type":u,url:location.origin},tags:null===(a=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getTags)||void 0===a?void 0:a.call(r,e)}}getEventTarget(e){const{link:t,itemId:n,title:i}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=i?i:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const Ao="[data-k5a-teaser-analytics]",Co=(e,t,n)=>{const i=document.querySelectorAll("k5a-stream");if(!i.length)return;const o=new So(e,t,n),r=new WeakMap,a=e=>{const t=r.get(e);t&&(t.disconnect(),r.delete(e))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,i=n.querySelector(Ao);Boolean(null==i?void 0:i.dataset.k5aTeaserAnalytics)?(o.trackContentView(n),t.unobserve(e.target),a(n)):((e,t)=>{if(r.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(Ao);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(o.trackContentView(e),t.unobserve(e),a(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),r.set(e,n)})(n,t)})},{threshold:.5});i.forEach(e=>{s.observe(e),e.addEventListener("click",()=>o.trackContentClick(e))})};class $o{handleKilkayaStreamTracking({pulse:e,pageType:t,publisher:n}){if(!(null==e?void 0:e.instance))return;const i={[ft.VG]:new To}[n]||new Io;Co(e.instance,i,t)}injectKilkayaMeta(e){const t=document.createElement("script");t.textContent=`var k5aMeta = { consent: ${e} };`,document.head.appendChild(t)}observeForKilkayaBackfills(){document.addEventListener("K5A:EmptyStreamSlot",e=>{var t;const n=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.streamSlot;if(!n)return;const i=n.parentElement;i&&(ve(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(i))})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";te(i)}loadKilkayaScript(e){return W(this,void 0,void 0,function*(){yield kt(e)})}run(e){return W(this,void 0,void 0,function*(){const{tcf:t,isMobileApp:n,country:i,kilkaya:o}=e;if(!(null==o?void 0:o.enabled))return;const r=yield ze(t,n,i,"kilkaya");r&&(this.observeForKilkayaBackfills(),this.injectKilkayaMeta(r),yield this.loadKilkayaScript(o.url),this.handleKilkayaStreamTracking(e))})}}const Oo=1e4,Po=e=>e.some(e=>e.some(e=>!!e&&oi(e,0))),Lo=()=>{const{widescreenSwitching:e}=U.get(),{enabled:t,rotationInterval:n=Oo,widescreenIdPrefix:i}=null!=e?e:{};if(!t)return;const o=((e="widescreen")=>{const{pageSectionsSelectors:{right:t}={}}=U.get();return t?Array.from(document.querySelectorAll(t)).map(t=>Array.from(t.querySelectorAll(`div[id^="${e}"]`))):[]})(i);let r=0,a=Date.now(),s=Po(o);if(!o.length)return;const d=(e,t,n)=>{e.forEach(e=>{e&&e.style.setProperty(t,n)})},l=e=>1===e?0:1;(e=>{e.forEach(e=>{e[0]&&(e[0].style.display="block"),e[1]&&(e[1].style.display="none")})})(o);const c=((e,t)=>{let n=null;return(...i)=>{null===n&&(e(...i),n=setTimeout(()=>{n=null},t))}})(()=>{s||(s=Po(o)||s,a=Date.now());Date.now()-a>=n&&((()=>{const e=l(r),t=o.map(e=>e[r]),n=o.map(t=>t[e]);d(t,"opacity","0"),setTimeout(()=>{d(t,"display","none"),d(n,"opacity","0"),d(n,"display","block"),setTimeout(()=>{d(n,"opacity","1")},450)},450)})(),r=l(r),a=Date.now())},1e3);window.addEventListener("scroll",c)},xo={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return ve(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,t)=>{try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ve(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){ve(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},No="finn_blink_id",jo=e=>W(void 0,void 0,void 0,function*(){const{id:t,hashed_email:n,theme:i}=e,o=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}(e,["id","hashed_email","theme"]),r=window[ie.Blink];if(!r)return;const a=new r({remote:"https://www.finn.no/distribution-front/external/carousel",id:t,hashed_email:n,theme:i});yield a.inject(o)}),_o=e=>{var t,n;const i=document.querySelector(`[id^="${e}"]`);return null!==(n=null===(t=null==i?void 0:i.dataset)||void 0===t?void 0:t.finnBlinkId)&&void 0!==n?n:e},qo=(e,t)=>{const{finnBlink:{enabled:n}={}}=U.get(),i=(null==t?void 0:t.enabled)||(e=>{var t;const n=document.querySelector(`[id^="${e}"]`);return!!(null===(t=null==n?void 0:n.dataset)||void 0===t?void 0:t.noBidAd)})(e);if(!i||!n)return null;const{limit:o,height:r,requireImage:a,theme:s,rec:d,distributionTypes:l,position:c,offset:u,advertoryTheme:v}=t||{};return{selector:`#${_o(e)}`,enabled:i,position:null!=c?c:e,distributionTypes:null!=l?l:[],limit:null!=o?o:100,height:null!=r?r:100,offset:null!=u?u:200,requireImage:a,rec:d,theme:"dark"===s?"dark":"light",advertoryTheme:v}},Do=(e,t,n)=>W(void 0,void 0,void 0,function*(){const{placements:i,deviceType:o}=U.get();ve(`rendering finn blink ad for ${e}`);const r=ge(e),a=i[o].find(e=>e.id===r),s=qo(e,null==a?void 0:a.finnBlink),{publisher:d,country:l,finnBlink:c}=t,{userId:u,uuid:v,channel:p,theme:g}=null!=c?c:{},m=null!=p?p:`${d}.${l}`,h=(e=>{if(!e){const e=Pe();return null!=e?e:""}return e})(u),y="dark"===g?"dark":"light";if(!(null==s?void 0:s.enabled))return ve(`Finn blink is not enabled on placement: ${e}`),n&&n(e),void ao(e);if((e=>{var t;const n=_o(e),i=document.querySelector(`[id^="${n}"]`);return!!(null===(t=null==i?void 0:i.classList)||void 0===t?void 0:t.contains("finn"))})(e))ve(`Finn blink already loaded ${e}`);else try{const e=yield W(void 0,void 0,void 0,function*(){const{finnBlink:{identifierUrl:e}={}}=U.get(),t=xo.get(No),n=Te("finncode");if(!e||n)return"";if(!t){const t=yield et.get(e,{credentials:"include"}),{finn_blink_id:n}=t;if(!n)throw new Error("getFinnBlinkIdentifier: No finn_blink_id found");return xo.set(No,n),n}return t});yield jo(Object.assign(Object.assign({},s),{hashed_email:e,channel:m,id:h,theme:y,uuid:v})).then(()=>{((e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={},pageType:i}=U.get(),o=document.querySelector(`#${e}`);if(!o)return;if(o.classList.add("disable-cogwheel"),!n)return;se(n,o,ce,null!=t?t:i),Yi({preferredTestIdData:{targetId:e,testId:"finn"}})})(s.selector.replace("#",""),s.advertoryTheme)})}catch(t){ve(`Finn blink error ${t}`),n&&n(e),!n&&ee(e),ao(e)}}),Mo=e=>document.querySelector(`#${e}`);let Bo,Ro=[];const Fo=["takeover","wallpaper"],Vo=e=>{const t=(e=>{const t=G.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:o,glimr:r,appearanceConfig:a,requestSize:s=V,publisher:d,country:l,pageType:c,deviceType:u,isMobileApp:v=!1,pageOptions:{member:p},takeover:g,fullscreenScroll:m,useAppTabletInvCode:h}=e;return{xandr:{member:p,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:d,country:l,pageType:c,deviceType:u,placements:i,tcf:o,requestSize:s,isMobileApp:v,useAppTabletInvCode:h},r&&{glimr:r}),n&&{queryConfig:n}),a&&{appearanceConfig:a}),g&&{takeover:g}),m&&{fullscreenScroll:m})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},zo=()=>W(void 0,void 0,void 0,function*(){const{pageOptions:e}=U.get(),{preparePageOptions:t}=U.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=U.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"]}})(),i=yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();return(yield ze(e,t,n,"page-options"))?{}:{userSync:{disabled:!0}}}),o=yield t(Object.assign(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},e),{renderingManagement:Object.assign({},n)}),i));(e=>{const t=G.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=lo(e);G.setData("alertoryConfigKeywords",n)})(o.keywords),P(()=>Bo.setPageOpts(o))}),Uo=e=>W(void 0,void 0,void 0,function*(){const{prebid:t,tcf:n,isMobileApp:i,country:o}=U.get();Ho(e);const r=yield ze(n,i,o,"prebid");(null==t?void 0:t.enabled)&&r?(ve("core loadPlacements prebid enabled"),yield Wt()):(ve("core load tags invoked without prebid enabled"),Wo(e))}),Ho=e=>{const{prepareTag:t}=U.getHandlers(),n=[];(e=>{const t=["skyscraperright_1","topboard","wallpaper","skyscraperleft_1"];return e.sort((e,n)=>{const i=t.findIndex(t=>e.id.includes(t)),o=t.findIndex(e=>n.id.includes(e));return-1!==i&&-1===o?-1:-1===i&&-1!==o?1:i-o})})(e).forEach(e=>{ve("core defineTags",{placement:e});const i=oo(e);if(ro(e.id)){const o=t(i),r=(e=>{const{allowedFormats:t,invCode:n,keywords:i,sizes:o}=e;return{adTypes:t,invCode:n,keywords:so(i),sizes:o}})(o);n.push(r),P(()=>(ve("core defineTag - add to the queue",{placement:e,preparedTag:o}),Bo.defineTag(o)))}}),(e=>{var t,n,i;(null===(i=null===(n=null===(t=window.advertory)||void 0===t?void 0:t.alertoryConfig)||void 0===n?void 0:n.xandr)||void 0===i?void 0:i.tags)&&e.length&&window.advertory.alertoryConfig.xandr.tags.push(e)})(n)},Wo=e=>{const t=e.filter(({id:e})=>ro(e)).map(({id:e})=>e);t.length&&P(()=>(ve("core loadTags",{placementsIdsToLoad:t}),Bo.loadTags([...t])))},Ko=(e,t)=>W(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:i}=U.get(),{threshold:o,refresh:r}=e,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),s=null==n?void 0:n.defaultThreshold[i];a&&(ve("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:o,deviceDefaultThreshold:s}),yield Kn(a,null!=o?o:s)),a&&r&&(ve("core showAd - setup refreshing",{placement:e,adObj:t}),a.dataset.refresh=r.toString())}),Go=e=>e.some(({id:e})=>Fo.some(t=>e.includes(t))),Jo=e=>W(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,i]=(e=>e.reduce(([e,t],n)=>{var i;return(null===(i=null==n?void 0:n.finnBlink)||void 0===i?void 0:i.loadOnlyFinnBlink)?[[...e,n],t]:[e,[...t,n]]},[[],[]]))(e),o=(e=>{const{requestSize:t=V,queryConfig:{placementBatches:n}={},deviceType:i}=U.get(),o=rn(e),r=Object.keys((null==n?void 0:n[i])||{}).map(e=>o[e]||[]).filter(e=>e.length>0),a=new Set(r.flat().map(({id:e})=>e)),s=e.filter(({id:e})=>!a.has(e));return[...r,...ii(s,t)]})(i);for(const e of o)Go(e)?(ve("core loadAds without lazy loading",{placementsToLoad:e}),yield Uo(e)):e.length&&(ve("core loadAds with lazy loading",{placementsToLoad:e}),yield Yo(e));yield(e=>W(void 0,void 0,void 0,function*(){if(!e.length)return;const{appearanceConfig:t,deviceType:n}=U.get(),i=null==t?void 0:t.defaultThreshold[n];for(const t of e){const{threshold:e,id:n}=t,o=Mo(n);o&&(yield Kn(o,null!=e?e:i))}}))(n)}),Yo=e=>W(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=U.get(),i=[];if(!t)return ve("lazy load is not enabled",{placements:e}),void(yield Uo(e));const o=new IntersectionObserver((t,n)=>{t.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(t=>{ve("lazy load is enabled - handler start",{loadedPlacementIds:i,placements:e});const o=e.every(e=>i.includes(e.id)),r=e.map(e=>e.id);!o&&i.push(...r),!o&&Uo(e),ve("lazy load is enabled - handler stop",{loadedPlacementIds:i,placements:e,arePlacementsLoaded:o,placementIds:r}),n.disconnect()})},{rootMargin:n});e.forEach(e=>{const t=document.getElementById(e.id);t&&(ve("lazy loading - observe element",{placementId:e.id,element:t}),o.observe(t))})}),Qo=()=>W(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:t,wallpaperHandlers:{initWallpaperAd:i,adjustAdToHorseshoe:o}}=U.getHandlers(),{wallpaper:r,fullscreenScroll:a}=U.get(),s=[];P(()=>{Bo.onEvent("adRequested",()=>{e.adRequested()}),Bo.onEvent("adAvailable",n=>W(void 0,void 0,void 0,function*(){var o,s,d,l,v,g;ve("core adAvailable start",{placementsAvailable:Ro,adObj:n,isFullscreenScrollAd:c(n),isFinnBlink:w(n.targetId),isNativeAd:u(n),isMediation:fe(n),isTakeoverAd:p(n),isCollapseAd:h(n),isWallpaperAd:m(n)});const y=null===(d=null===(s=null===(o=null===window||void 0===window?void 0:window.apntag)||void 0===o?void 0:o.requests)||void 0===s?void 0:s.tags[n.targetId])||void 0===d?void 0:d.adResponse.ads;fe(n)&&y&&(null===(l=y[1])||void 0===l?void 0:l.rtb)&&(n.banner=null===(g=null===(v=y[1])||void 0===v?void 0:v.rtb)||void 0===g?void 0:g.banner),c(n)&&Ht(n),k(n)&&Lo(),c(n)&&!w(n.targetId)&&Ut(n,a),!u(n)||fe(n)||w(n.targetId)||t(n,U.get()),p(n)&&!h(n)&&(Hi(n.targetId),yield Wi(n)),m(n)&&(i(()=>P(()=>window.apntag.showTag(n.targetId)),r),G.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(n)&&G.setData("horseshoe",{isAvailable:!0}),Yi({adObj:n}),(e=>{var t;const n=null==e?void 0:e.targetId;if(!n)return;const i=null===(t=document.querySelector(`#${n}`))||void 0===t?void 0:t.parentElement;i&&((e,t)=>{const{height:n,width:i,native:o}=e;o?t.dataset.adSizes="[1,1]":n&&i&&(t.dataset.adSizes=`[${i},${n}]`)})(e,i)})(n),e.adAvailable(n);const f=Ro.find(({id:e})=>e===n.targetId);f&&(yield Ko(f,n),Ro=Ro.filter(e=>e.id!==f.id)),ve("core adAvailable stop",{placementsAvailable:Ro,adObj:n,isFullscreenScrollAd:c(n),isFinnBlink:w(n.targetId),isNativeAd:u(n),isMediation:fe(n),isTakeoverAd:p(n),isCollapseAd:h(n),isWallpaperAd:m(n)})})),Bo.onEvent("adLoaded",i=>{const{refreshConfig:r,appearanceConfig:a}=U.get(),d=document.getElementById(i.targetId);w(i.targetId)&&(e=>{const{fullscreenScroll:t}=U.get(),{initNativeAd:n}=U.getHandlers();c(e)&&Ut(e,t),u(e)&&n(e,U.get())})(i);s.includes(i.targetId)&&u(i)&&(t(i,U.get()),Yi({adObj:i})),!s.includes(i.targetId)&&fe(i)&&s.push(i.targetId),h(i)&&ee(i.targetId),p(i)&&((e,t)=>{var n;const i="100%",o="100%";e.resizeAd(t,[i,o]);const r=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!r)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(r),t=e.width,n=e.height;t===i&&n===o||(r.style.width=i,r.style.height=o)}}).observe(r,{attributes:!0,attributeFilter:["style"]})})(Bo,i.targetId),v(i)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=U.get();if(!t||!n||!i)return;const o=t.parentElement;o&&(t.classList.add(`advertory-${n}-${i}__full-width-ad`),o.classList.add(`advertory-${n}-${i}-wrapper__full-width-ad`))})(i),(e=>C(e,n))(i)&&(e=>{var t;const n=document.querySelector(`#${e.targetId}`),i=null===(t=document.querySelector(`#${e.targetId}`))||void 0===t?void 0:t.parentElement,o=null==n?void 0:n.querySelector("iframe"),r=null==o?void 0:o.parentElement,{siteSpecificConfig:{publisherClassName:a,fullWidthFormatClassName:s}={}}=U.get();if(!(n&&o&&r&&i))return;i.classList.add(`advertory-${a}-${s}__vertical-full-width-ad-wrapper`);const d=window.innerWidth,l=Math.round(d/1080*1920);n.style.width="100%",n.style.height=`${l}px`,n.classList.add(`advertory-${a}-${s}__vertical-full-width-ad`);const c=Xi(e,n.offsetWidth);r.style.transform=`scale(${c})`,r.style.transformOrigin="left top"})(i),((e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,i=document.querySelector(`#${n}`),o=null==i?void 0:i.parentElement;if(!o||!i)return;ei({adWrapper:o,placementContainer:i});const{delayTime:r=1e3}=t,a=(new Date).getTime();i&&"true"!==i.dataset.subscribedForRefresh&&(i.dataset.subscribedForRefresh="true",i.dataset.refresh&&ni(i,a,r))})(i,r),(null==a?void 0:a.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(i.targetId);var l,g;G.getData("horseshoe").isAvailable&&o(i.targetId),to(i),e.adLoaded(i),l=i.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${l}`)&&(null===(g=window.gdpr)||void 0===g?void 0:g.setupButton)&&window.gdpr.setupButton(l),d&&(d.classList.add("ad-loaded"),(e=>{var t;const{siteSpecificConfig:n}=U.get(),i=null!==(t=null==n?void 0:n.mainColumnWidth)&&void 0!==t?t:1/0;e.clientWidth>i&&e.setAttribute("data-two-column-ad-layout","true")})(d)),eo(i),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:i.targetId,adFormat:Qi(i)}}))}),Bo.onEvent("adNoBid",t=>W(void 0,void 0,void 0,function*(){ee(t.targetId),yield Nn(U.get(),t),Ai(t)&&(yield Si()),e.adNoBid(t)})),Bo.onEvent("adError",(t,n)=>W(void 0,void 0,void 0,function*(){Ai(n)&&(yield Si()),e.adError(t,n)})),Bo.onEvent("adCollapse",()=>{e.adCollapse()}),Bo.onEvent("adRequestFailure",t=>{ee(t.targetId),e.adRequestFailure(t)}),Bo.onEvent("adBadRequest",t=>{ee(t.targetId),e.adBadRequest(t)}),Bo.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),Bo.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),Xo=(e,t)=>W(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:i,reloadExistingAds:o,renderFinnBlinkPlacements:r,contextSelector:a}=null!=t?t:{};if(i)return Xt(),[];o&&(Xt(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{te(e.id)})),H(null!=e?e:{}),yield zo();let s=nn(a);return r&&(s=s.filter(e=>w(e.id))),s.length>0&&(Ro=[...Ro,...s.map(e=>Object.assign({},e))],ri(s),si(s),yield Jo(s)),Ro}),Zo=(e,t)=>W(void 0,void 0,void 0,function*(){var n;U.set(e),U.setHandlers(t),G.initialize(),window.addEventListener("message",Un,!1),Bo=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=Bo,ve("Apn tag is set up on window"),yield Promise.allSettled([W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();(yield ze(e,t,n,"xandr-endpoint"))||Bo.setEndpoint("ib.adnxs-simple.com",!0)}),W(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n,country:i}=U.get(),o=yield ze(t,n,i,"prebid");(null==e?void 0:e.enabled)&&o&&(yield kt(null==e?void 0:e.url))}),vt(e),W(void 0,void 0,void 0,function*(){const{astUrl:e}=U.get();yield kt(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),W(void 0,void 0,void 0,function*(){const{gptUrl:e,tcf:t,isMobileApp:n,country:i}=U.get();(yield ze(t,n,i,"gpt-endpoint"))&&(yield kt(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js"))}),W(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:i,country:o}=U.get(),{getConsentAsync:r}=$e(n,i,o),a=yield r();if(e&&t&&a){if(yield kt(t),document.querySelector(`.${Ki}`))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(Ki)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),He(),W(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=U.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield kt(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield Gi(),ve("Libraries have been loaded and trackers have been set"),yield(n=t.librariesToLoad,W(void 0,void 0,void 0,function*(){const e=n.map(e=>kt(e));yield Promise.all(e)})),yield Qo(),yield zo(),ve("Page options have been set"),Vo(e),ve("Advertory is setup on window"),Ro=nn(),ri(Ro),si(Ro),yield Jo(Ro),ve("Ads has been loaded",Ro),co(Ro),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>W(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;if(!(yield ze(e.tcf,e.isMobileApp,e.country,"handleDrEdition")))return;const n=yield On(),i=new Pn(n);Ln({publisher:e.publisher,drEditionConfig:e.drEdition,device:e.deviceType,pageType:e.pageType,country:e.country},i,null===(t=e.pulse)||void 0===t?void 0:t.instance)}))(e),(e=>{if(!(null==e?void 0:e.enabled)||Eo)return;const{splitPointIDs:t,adSelector:n,trackSelector:i=go}=e,o=document.querySelector(i);if(!o)return;Eo=!0;const r=()=>{bo(o,n,t)};r(),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),window.addEventListener("load",r),window.addEventListener("advertory:adLoaded",()=>{requestAnimationFrame(r)}),new ResizeObserver(r).observe(o)})(e.rightColumnSplit),yield(e=>W(void 0,void 0,void 0,function*(){const t=new $o;yield t.run(e)}))(e)}),er=(e,t)=>W(void 0,void 0,void 0,function*(){yield((e,t)=>W(void 0,void 0,void 0,function*(){const{initConsentManager:n,getConsentAsync:i}=$e(e.tcf,e.isMobileApp,e.country),o=yield po(e);yield pe(),yield uo(n),yield uo(i),ve("TCF resolved successfully"),yield Zo(o,t),ve("Run function resolved successfully")}))(e,t)}),tr="native_override_desc2",nr=(e,t,n)=>{var i;const{image:o,icon:r,sponsoredBy:a,title:s,clickUrl:d,cta:l,body:c,desc2:u,video:v,description:p,customTitle1:g,customTitle2:m,customTitle3:h,customTitle4:y,customIcon2:f}=e,w=(e,t="")=>{var n;return e?null!==(n=e.url)&&void 0!==n?n:e:t};return Object.assign({containerId:n,img:w(o),imgWidth:null==o?void 0:o.width,imgHeight:null==o?void 0:o.height,imgAltText:null!=s?s:"",logo:w(r),sponsoredBy:null!=a?a:"",title:null!=s?s:"",url:null!=d?d:"",cta:null!=l?l:"",description:null!==(i=null!=c?c:p)&&void 0!==i?i:"",desc2:null!=u?u:"",video:v,customTitle1:null!=g?g:"",customTitle2:null!=m?m:"",customTitle3:null!=h?h:"",customTitle4:null!=y?y:"",logo2:w(f)},t)},ir=(e,t)=>{const n=(i=tr,window.location.href.includes(i));var i;const o=new URLSearchParams(window.location.search).get(tr),r=t.includes("native_recirc");return n&&o?o:(null==e?void 0:e.includes("recirc"))?r?"native_recirc":"recirc":(null==e?void 0:e.includes("sponsor"))?"sponsorstripe":null},or=(e,t)=>{const n=document.querySelector(`#${t}`);if(n)for(const t of Object.keys(e))n.style.setProperty(t,e[t])},rr=(e,t,n,i)=>{const o=document.querySelector(`#${e}`);o&&t&&(o.innerHTML=t,((e,t)=>{const n=e.parentElement,{publisher:i,pageType:o}=t,r=i&&Object.values(ft).includes(i);n&&r&&se(i,e,ue,o)})(o,n),i())},ar=e=>{var t;const n=document.querySelector(`#${e.targetId}`);if(!n||!(null===(t=e.native)||void 0===t?void 0:t.clickTrackers))return;(null==n?void 0:n.querySelectorAll("a.ad-link")).forEach(t=>{"true"!==t.dataset.tracked&&(t.addEventListener("click",()=>{var t,n;for(const i of null!==(n=null===(t=e.native)||void 0===t?void 0:t.clickTrackers)&&void 0!==n?n:[])cr(i)}),t.dataset.tracked="true")})},sr=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(lr):window.apntag.fireImpressionTrackers(e);const n=new CustomEvent("advertory:nativeImpression",{detail:{ad:e}});window.dispatchEvent(n)},dr=(e,t)=>{var n;let i=!1;const o=document.querySelector(`#${e.targetId}`);if(!o||!e.native)return;const{deviceType:r,appearanceConfig:a,nativeTrackingConfig:{fireImpressionsBasedOnAppearanceThreshold:s=!1}={}}=t,d=s?{rootMargin:`${l=null!==(n=null==a?void 0:a.defaultThreshold[null!=r?r:de.DESKTOP])&&void 0!==n?n:0}px 0px ${l}px 0px`}:{};var l;const c=new IntersectionObserver(t=>{if(!i)for(const n of t)if(n.isIntersecting){i=!0,sr(e),c.disconnect();break}},d);c.observe(o)},lr=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?cr(e):window.navigator.sendBeacon(e)},cr=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},ur=(e,t,n)=>{const i=((e,t,n)=>{var i;const{displayTemplates:o,videoTemplates:r}=n,a="default";if(!e.native)return null;const{native:s,targetId:d}=e,{desc2:l=a}=e.native,c=l.toLowerCase(),u=null!==(i=ir(e.targetId,l))&&void 0!==i?i:c,v=Bt[t.language||ke.NO],p=nr(s,v,d);return(s.video?r[u]:o[u]||o.default)(p,t)})(e,t,n);rr(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{ar(e),dr(e,t)})(e,t)})},vr="viewable",pr="adClick";var gr=e=>(t,n,i)=>{const{video:o,img:r,url:a}=t,{publisher:s,productTag:d}=n,{pluginsNames:l,videoLoop:c}=i||{};if(!(null==o?void 0:o.content))return null;const u=Math.ceil(1e5*Math.random()),v=r||"https://custom.inventory.schibsted.io/1x1-00000000.png",p=`ad-player-${u}`,g=mr(o.content,a),m=hr({id:u,nodeId:p,poster:v,tagURL:g,publisher:s,productTag:d,videoLoop:c});return yr({playerConfig:m,clickUrl:a,pluginsNames:l}),`${e(t,n,p)}`};const mr=(e,t)=>{const n=(new DOMParser).parseFromString(e,"text/xml"),i=n.querySelector("ClickThrough"),o=n.querySelector("VideoClicks");if(i){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(n.createCDATASection(t))}else if(o){const e=n.createElement("ClickThrough");e.appendChild(n.createCDATASection(t)),o.appendChild(e)}return URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(n)],{type:"text/xml"}))},hr=({id:e,nodeId:t,poster:n,tagURL:i,publisher:o="",productTag:r="xandr",videoLoop:a=!1})=>({id:e,poster:n,vendor:"appnexus",node:t,mute:!0,autoplay:a,repeat:a,skin:{name:"inventory-player",url:"https://ads.inventory.schibsted.io/styles/player.css"},settings:{jw:{stretching:"fill",advertising:{client:"vast",tag:i}}},pulse:{provider:o.toLowerCase(),decorator:e=>Object.assign(Object.assign({},Sn(e)?e:{}),{provider:Object.assign(Object.assign({},Sn(null==e?void 0:e.provider)?e.provider:{}),{productTag:r})})}}),yr=e=>W(void 0,void 0,void 0,function*(){const{playerConfig:t,pluginsNames:n,clickUrl:i}=e,{repeat:o}=t,r=yield wn(t);En(n),r.once("assetReady",()=>{fn(r,n)}),r.on(vr,e=>{const{viewable:t}=e;t?r.play():r.pause()}),r.on(pr,()=>{window.open(i,"_blank")}),o&&r.on("pause",()=>{r.play()})}),fr=(e,t,n)=>{const i=e===yn.ARTICLE||e===yn.OTHER?.79:1;return{desktopTitleSize:t?Number(t)*i+"px":"clamp(22px, 3.6rem, 59px)",mobileTitleSize:n?`${n}px`:"clamp(22px, 3.6rem, 59px)"}},wr={0:633,1:395,2:562,3:541,4:630,5:549,6:596,7:493,8:579,9:596,A:702,B:651,C:644,D:724,E:598,F:560,G:690,H:773,I:356,J:344,K:680,L:576,M:897,N:714,O:725,P:618,Q:725,R:675,S:555,T:610,U:710,V:703,W:1004,X:745,Y:684,Z:608,"Æ":906,"Ø":727,"Å":702,a:541,b:595,c:479,d:612,e:480,f:383,g:528,h:629,i:322,j:303,k:603,l:315,m:916,n:636,o:563,p:607,q:595,r:481,s:445,t:367,u:632,v:573,w:815,x:586,y:574,z:540,"æ":743,"ø":569,"ö":563,"å":541,"ä":541,"é":480,"è":480,"(":343,")":343,"«":567,"»":567,".":253,",":257,"!":259,"?":446,"¿":441,"*":410,"&":783,"-":334,"–":545,":":276,";":278,"%":744,$:549,"€":722,"#":519,"+":600,"=":600,'"':389,"'":202,"`":347,"’":237,"\\":395,"/":395,"@":844," ":181,"­":0},br=(e,t)=>{const n={"É":"E","é":"e","ü":"u"," ":" "};return[...e].reduce((e,i)=>e+(wr[n[i]||i]||wr.m)*t/1e3,0)},Er=(e,t,n=12,i=300)=>{let o=n,r=i,a=n;for(;o<=r;){const n=Math.floor((o+r)/2);br(e,n)<=t?(a=n,o=n+1):r=n-1}const s=((e,t,n,i)=>{const o=Math.floor(e/t*(n-2));return o<i?i:o})(a,br(e,a),t,n);return{fontSize:s,content:e}},Tr=(e,t)=>{const[n,i]=(e=>{const t=e.trim().split(/\s+/);if(t.length<=1)return[e,""];let n=[e,""],i=1/0;for(let e=1;e<t.length;e++){const o=t.slice(0,e).join(" "),r=t.slice(e).join(" "),a=Math.abs(o.length-r.length);a<i&&(i=a,n=[o,r])}return n})(e);return[Er(n,t),Er(i,t)]},Ir=({title:e,options:t})=>{if(!t)return e;const{pageType:n,appearanceConfig:{mainColumnWidth:i}={}}=t,o=n===yn.ARTICLE||n===yn.OTHER?"em":"rem";return Tr(e,(i||734)-64).map(({content:e,fontSize:t})=>`<span style="display: block; font-size: ${`${(t||16)/16}${o}`}">${e}</span>`).join("")},kr=({containerId:e,url:t,adContent:n,logo:i,description:o,title:r,customTitle1:a,customTitle2:s},d,l)=>{const{desktopTitleSize:c,mobileTitleSize:u}=fr(null==d?void 0:d.pageType,a,s),v=Ir({title:r,options:d});return or({"--desktopTitleSize":`${c}`,"--mobileTitleSize":`${u}`},e),`<article class="advertory-vg-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${n}</span>\n <img alt="${r}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${null!=l?l:0}"></div>\n </div>\n </div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-text-container">\n <div class="ad-description">${o}</div>\n <h2 class="ad-title">\n ${v}\n </h2>\n </div>\n </a>\n </div>\n </div>\n </div>\n </article>`},Sr=({containerId:e,adText:t,url:n,adFrom:i,sponsoredBy:o,title:r},a,s)=>`<article class="advertory-vg-ad-native-video">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${t}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${s}"></div>\n </div>\n </div>\n <a class="ad-link" href="${n}" target="_blank">\n <div class="ad-text-container">\n <span class="sponsored-by">\n ${i} ${o}\n </span>\n <span class="title">${r}</span>\n </div>\n </a>\n </div>\n </article>`,Ar=({containerId:e,adText:t,url:n},i,o)=>{return`<article class="advertory-vg-ad-native-ukesmeny-video">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${r=t,r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${o}"></div>\n </div>\n <a class="ad-link" href="${n}" target="_blank"></a>\n </div>\n </div>\n </article>`;var r},Cr=["IntegrationMenu"],$r={CONTENT:(e,t)=>{const{video:n}=e;return(null==n?void 0:n.content)?gr(kr)(e,t):(({containerId:e,url:t,adContent:n,logo:i,imgAltText:o,img:r,description:a,title:s,customTitle1:d,customTitle2:l,imgWidth:c,imgHeight:u},v)=>{const{desktopTitleSize:p,mobileTitleSize:g}=fr(null==v?void 0:v.pageType,d,l),m=c?`width="${c}"`:"",h=u?`height="${u}"`:"",y=Ir({title:s,options:v});return or({"--desktopTitleSize":`${p}`,"--mobileTitleSize":`${g}`},e),`<article class="advertory-vg-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-header">\n <span>${n}</span>\n <img alt="${s}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <img alt="${o}" class="ad-image" src="${r}" loading="lazy" ${m} ${h} />\n </div>\n <div class="ad-text-container">\n <div class="ad-description">${a}</div>\n <h2 class="ad-title">\n ${y}\n </h2>\n </div>\n </div>\n </a>\n </article>`})(e,t)},INHOUSE:({containerId:e,url:t,title:n,img:i,logo:o,sponsoredBy:r,imgWidth:a,imgHeight:s})=>`<article class="advertory-vg-ad-native-inhouse flexible">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" loading="lazy" ${a?`width="${a}"`:""} ${s?`height="${s}"`:""} />\n ${o&&`<img alt="${r}" class="ad-logo" src="${o}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">\n <span class="sponsor-name">${r}</span>${r?"- En tjeneste fra VG":""}\n </span>\n <span class="ad-title">${n}</span>\n </div>\n </div>\n </a>\n </article>`,SPONSORSTRIPE:({title:e,sponsoredBy:t,logo:n})=>`\n <article class="advertory-vg-ad-native-sponsorstripe">\n <div id="advertory-vg-sponsorstripe-info" class="ad-info">\n <button id="sponsorstripe-info-close-button" class="ad-info-close-button" aria-label="Lukk">\n \n <svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11" fill="none">\n <path d="M0.992123 0.0487634C1.05718 -0.0162892 1.1627 -0.0162197 1.2278 0.0487634L5.14642 3.96738C5.21145 4.03235 5.31701 4.03226 5.3821 3.96738L9.30007 0.0494144C9.36515 -0.015673 9.47066 -0.015673 9.53574 0.0494144L10.4798 0.992774C10.5448 1.05783 10.5447 1.16336 10.4798 1.22845L6.56178 5.14642C6.4967 5.2115 6.49671 5.31701 6.56178 5.3821L10.4798 9.30007C10.5448 9.3651 10.5447 9.47064 10.4798 9.53574L9.53574 10.4798C9.47064 10.5447 9.3651 10.5448 9.30007 10.4798L5.3821 6.56178C5.31701 6.49671 5.2115 6.4967 5.14642 6.56178L1.22845 10.4798C1.16336 10.5447 1.05783 10.5448 0.992774 10.4798L0.0494145 9.53574C-0.0156729 9.47066 -0.0156729 9.36515 0.0494145 9.30007L3.96738 5.3821C4.03226 5.31701 4.03235 5.21145 3.96738 5.14642L0.0487635 1.2278C-0.0162198 1.1627 -0.0162892 1.05718 0.0487635 0.992123L0.992123 0.0487634Z" fill="#470000"/>\n </svg>\n </button>\n <p class="ad-info-description">\n Annonsøren som presenterer denne saken har betalt for profilering av logoen i artikler som omhandler ${e.split(" ")[0].toLowerCase()}. \n <a class="ad-info-link" href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232">\n Les mer\n </a>\n </p>\n </div>\n <div class="ad-wrapper">\n <button id="sponsorstripe-info-open-button" class="ad-info-open-button" aria-label="Sponset innhold - Klikk for detaljer">i</button>\n <span class="ad-title">${e}</span>\n <div class="ad-logo-wrapper">\n <img alt="${t}" class="ad-logo" src="${n}" />\n </div>\n </div>\n </article>`,UKESMENY_SPONSORSTRIPE:({containerId:e,sponsoredBy:t,url:n,logo:i,title:o,customTitle1:r,customTitle2:a},{appearanceConfig:s})=>{const{isDarkModeEnabled:d}=null!=s?s:{},l=r?`${r}px`:"clamp(10px, 2rem, 30px)",c=a?`${a}px`:"clamp(10px, 1.8rem, 30px)",u=((e=":export{}")=>{const[,t]=e.split(":export{"),n=t.slice(0,-1).split(";").map(e=>e.split(":"));return Object.fromEntries(n)})(),v=d?u["c-white-primary"]:u["c-brown-primary"];or({"--desktopTitleSize":`${l}`,"--mobileTitleSize":`${c}`,"--fontColor":`${v}`},e);const p=`${e}-description`;return`<article class="advertory-vg-ad-native-ukesmeny-sponsor-stripe">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <a class="ad-link" href="${n}" target="_blank">\n <span style="--desktopTitleSize: ${l}; --mobileTitleSize: ${c};" class="title">${o}</span>\n </a>\n <a class="ad-link" href="${n}" target="_blank"> \n <img alt="${t}" class="ad-logo" src="${i}" />\n </a>\n <div class="info-button-wrapper" onClick="${(e=>`\n const adDescription = window.document.getElementById('${e}');\n adDescription.classList.toggle('hide');\n `)(p)}"><div class="info-button"></div></div>\n </div>\n <div id="${p}" class="description hide"> <span>Annonsøren som presenterer ukemenyen har betalt for profilering av logoen på VG-forsiden og Godt.no, og annonsen mellom oppskriftene.</span> <a href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232" target="_blank">Les mer</a></div>\n </div>\n </article>`},UKESMENY:({containerId:e,url:t,imgAltText:n,img:i})=>`<article class="advertory-vg-ad-native-ukesmeny">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header"><span>Annonse</span></div>\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" />\n </div>\n </div>\n </a>\n </article>`,UKESMENY_VIDEO:(e,t)=>gr(Ar)(e,t,{pluginsNames:Cr,videoLoop:true}),DEFAULT:({containerId:e,url:t,adText:n,img:i,logo:o,adFrom:r,sponsoredBy:a,title:s,imgWidth:d,imgHeight:l})=>`<article class="advertory-vg-ad-native">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header"><span>${n}</span></div>\n <div class="ad-image-container">\n <img alt="${s}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n ${o&&`<img alt="${a}" class="ad-logo" src="${o}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">${r} ${a}</span>\n <span class="title">${s}</span>\n </div>\n </div>\n </a>\n</article>`,RECIRC:({containerId:e,url:t,title:n,img:i,adText:o,sponsoredBy:r,logo:a,description:s,imgWidth:d,imgHeight:l})=>`<article class="advertory-shared-ad-native-recirc">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n <img alt="${r}" class="ad-logo" src="${a}" loading="lazy" />\n </div>\n <div class="ad-text-container">\n <span class="ad-sponsor">${o} ${r}</span>\n <h6 class="ad-title">${n}</h6>\n <span class="ad-description">${s}</span>\n </div>\n </div>\n </a>\n </article>`,PODME:({url:e,title:t,description:n,img:i,logo:o})=>`<article class="advertory-vg-ad-native-podme">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-content">\n <div class="ad-main-content">\n <div class="ad-text-container">\n <span class="ad-title">${t}</span>\n <span class="ad-description">${n}</span>\n </div>\n <div class="ad-small-image-container">\n <img alt="${t}" class="ad-small-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-logo">\n <img alt="Podme logo" src="${o}" loading="lazy" />\n </div>\n </div>\n </div>\n </div>\n </a>\n</article>`,PODME_SECTION:({url:e,title:t,description:n,img:i,logo:o})=>`<article class="advertory-vg-ad-native-podme-section">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-text-container">\n <span class="ad-title">\n ${t}\n </span>\n <span class="ad-description">\n ${n}\n </div>\n </div>\n <div class="ad-image-container">\n <img alt="podme-ad" class="ad-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-logo-container">\n <img alt="podme-logo" class="ad-logo" src="${o}" loading="lazy" />\n </div>\n </div>\n </a>\n</article>`,FISHFINGER:({img:e,title:t,sponsoredBy:n,logo:i,url:o})=>`<article class="advertory-vg-ad-native-fishfinger">\n <a class="ad-link" href="${o}" rel="noopener noreferrer" target="_blank">\n <div class="ad-content">\n <img class="ad-image" src="${e}" alt="${n}" />\n <span class="ad-title">${t}</span>\n <img class="ad-logo" src="${i}" alt="${n}" />\n </div>\n </a>\n </article>`,SHOPPING:({containerId:e,url:t,logo:n,imgAltText:i,img:o,description:r,title:a,imgWidth:s,imgHeight:d},l)=>`<article class="advertory-vg-ad-native-affiliate">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-header">\n <span>ANNONSE</span>\n ${n?`<img alt="${a}" class="ad-logo" src="${n}" loading="lazy" />`:""}\n </div>\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${o}" loading="lazy" ${s?`width="${s}"`:""} ${d?`height="${d}"`:""} />\n </div>\n <div id="testxd" class="ad-text-container">\n ${r?`<div class="ad-description">${r}</div>`:""}\n <h2 id="scalable-text-container" class="ad-title">\n ${Ir({title:a,options:l})}\n </h2>\n </div>\n </div>\n </a>\n </article>`,DEFAULT_VIDEO:(e,t)=>gr(Sr)(e,t)},Or={NATIVE_TEMPLATE:({containerId:e,url:t,sponsoredBy:n,title:i,img:o,adText:r})=>`<article class="advertory-no-ad-native-default">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${o}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${r}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`,NATIVE_RECIRC:({containerId:e,url:t,sponsoredBy:n,title:i,img:o,adText:r})=>`<article class="advertory-no-ad-native-recirc">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${o}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${r}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`,NATIVE_SEAMLESS_IMAGE:({containerId:e,url:t,adText:n,img:i,cta:o,description:r,logo:a,sponsoredBy:s,title:d})=>`<article class="advertory-no-ad-native-seamless-image">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header">\n <div class="ad-header-text">\n <div class="sponsored-by">${s}</div>\n <div class="ad-annons"><span>${n}</span></div>\n </div>\n ${a&&`<img alt="${s}" class="ad-logo" src="${a}" loading="lazy" />`}\n </div>\n <div class="ad-image-container">\n <img alt="${d}" class="ad-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-text-container">\n <span class="description">${r}</span>\n <button class="ad-action">${o}</button>\n </div>\n </div>\n </a>\n </div>\n </article>`},Pr={displayTemplates:{content:$r.CONTENT,content_internal:$r.CONTENT,inhouse:$r.INHOUSE,sponsorstripe:$r.SPONSORSTRIPE,"ukesmeny-stripe":$r.UKESMENY_SPONSORSTRIPE,ukesmeny:$r.UKESMENY,sponsor:$r.SPONSORSTRIPE,sponsortop:$r.SPONSORSTRIPE,standard:$r.STANDARD,recirc:$r.RECIRC,podme:$r.PODME,podme_section:$r.PODME_SECTION,fishfinger:$r.FISHFINGER,shopping:$r.SHOPPING,native:Or.NATIVE_TEMPLATE,native_recirc:Or.NATIVE_RECIRC,default:$r.DEFAULT,seamless_image:Or.NATIVE_SEAMLESS_IMAGE},videoTemplates:{content:$r.CONTENT,recirc:$r.DEFAULT_VIDEO,default:$r.DEFAULT_VIDEO,menu:$r.UKESMENY_VIDEO}},Lr=(e,t)=>{e.style.position="fixed",e.style.transform=`translateY(${t}px)`},xr=(e,t)=>{const n=document.querySelector(t),i=document.querySelector(`#${e}`);if(!i||!n)return;const o=i.parentElement,r=new IntersectionObserver(([e])=>((e,t,n)=>{const i=e?t.offsetHeight:0;Lr(n,i)})(e.isIntersecting,n,o)),a=new ResizeObserver(()=>((e,t)=>{Lr(t,e.offsetHeight)})(n,o));r.observe(n),a.observe(n)},Nr=e=>document.querySelector(e)||document.querySelector(`[class*="${e}"]`),jr=(e,t)=>{if(!t||!y(e))return;const{toggleEnabled:n,headerSelector:i,containersSelectors:o}=t,{targetId:r}=e;if(!n)return;const a=document.querySelector(".advertory-takeover-wrapper"),s=[()=>i&&xr(r,i),()=>o&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n)return;const[i,o]=t;if(!i)return;const r=()=>{const e=Nr(i),t=o?Nr(o):null,r=n.querySelector("article");if(!r||!e)return;const a=e.getBoundingClientRect().left,s=((e,t)=>{const n=e.getBoundingClientRect(),i=null==t?void 0:t.getBoundingClientRect();return i?i.right-n.left:n.width})(e,t);r.style.left=`${a}px`,r.style.width=`${s}px`};r(),new ResizeObserver(r).observe(document.body)})(r,o),()=>a&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n||!t)return;new IntersectionObserver(([e])=>{n.style.visibility=e.isIntersecting?"hidden":"visible"}).observe(t)})(r,a)];s.forEach(e=>e())},_r=e=>{e.style.removeProperty("min-height"),e.style.removeProperty("min-width")},qr=((e,t)=>n=>er(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;u(e)&&_r(i);const{pageType:o=yn.FRONT,nativeTrackingConfig:r,appearanceConfig:a,deviceType:s}=null!=t?t:{},d={language:ke.NO,publisher:ft.VG,deviceType:s,pageType:o,nativeTrackingConfig:r,appearanceConfig:a,productTag:"partnerstudio"};ur(e,d,Pr),jr(e,null==t?void 0:t.sponsorstripe)},wallpaperHandlers:{initWallpaperAd:(e,t)=>{if(!t)return;const{options:{appMainContainerSelector:n,wallpaperAnchorSelector:i}={}}=t;(e=>{const t=document.querySelector(e||"#application");if(!t)return;Q();const n=document.createElement("div");n.classList.add(J),document.body.insertBefore(n,t.nextSibling),n.style.setProperty("position","fixed"),n.style.setProperty("width","100%"),n.style.setProperty("height","calc(100% - var(--header-height, 0px) - 15px)"),n.style.setProperty("background-position","center top"),n.style.setProperty("background-repeat","no-repeat")})(n),(e=>{const t=e||".advertory-wrapper-common-skyscraperleft_1",n=document.querySelector(t);n&&(X(n),window.addEventListener("scroll",()=>X(n)))})(i),e()},adjustAdToHorseshoe:e=>{var t;const n=document.querySelector(`#${e}`);n&&(null===(t=n.parentElement)||void 0===t||t.classList.add(Y),n.classList.add(Y))}},loadFinnBlinkAd:(e,t,n,i)=>W(void 0,void 0,void 0,function*(){const{isMobileApp:o}=U.get();if(ve(`loadFinnBlinkAd: loading finn blink ad for ${e}`),!(yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=$e(e,t,n),o=yield i();return!(!(null==e?void 0:e.enabled)||!o)||(ve("Skip loading finn blink ad due to missing TCF consent."),!1)}))||o)return n&&n(e),ao(e),void(!n&&ee(e));try{yield re(ae)}catch(e){console.error(e)}yield Do(e,t,n),i&&i()}),replaceAdsWithFinnBlink:e=>W(void 0,void 0,void 0,function*(){if(!e)return;yield re(ae);const{replacementConfig:t}=e;if(!((()=>{const e=document.getElementById("ads-advertory-anchor");return!(e&&"none"!==getComputedStyle(e).display&&window.advertoryFluepapir)})()&&(null==t?void 0:t.adsToReplace)&&(null==t?void 0:t.sizes)&&e.enabled))return void ve(`Finn blink configuration is incorrect: ${JSON.stringify(t)}`);const{adsToReplace:n,sizes:i}=t;n.forEach(([e,t])=>{const n=document.querySelector(`[id^="${e}"]`);if(!n)return;const i=me(t);(e=>{ve(`Hiding old ad container: ${e.id}`),e.style.setProperty("display","none","important")})(n),he(n,i),n.dataset.finnBlinkId=t,ne().withFullAdsChain(e)})}),preparePageOptions:ht,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,{useAppTabletInvCode:o=!0}=U.get(),r=((e,t)=>{const{isMobileApp:n}=U.get();return n?((e,t)=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":t?"atb":e))(e,t):e})(i,o),a=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,i=`${We()}-adformat`,o=t?t[i]:[];if(!o)return{};const r=(Array.isArray(o)?o:[o]).filter(e=>!(e in l)||window.innerWidth>=l[e]);return{[i]:n?r:o}})(e),s=(e=>{const t=`${We()}-targetid`;return e?{[t]:[e]}:{}})(n),d=yt(),c=(e=>bt(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(i),u=((e,t)=>bt(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{})(i);return Object.assign(Object.assign({},e),{invCode:r,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),a),s),c),d),rendererOptions:u})},siteEvents:Ee,librariesToLoad:[]},{publisherClassName:ft.VG,fullWidthFormatClassName:"netboard"});var Dr=Object.freeze({__proto__:null,default:""});export{qr as initAdvertoryPackage,Xo as updateAdvertory};
1
+ import"react/jsx-runtime";const e="ABSOLUTE_FULLSCREEN",t="ANY_FULLSCREEN",n="VERTICAL_FULLWIDTH",i="FULLWIDTH",o="TAKEOVER",r="VELVET_TAKEOVER",a="WALLPAPER",s="COLLAPSE",d={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}]},l={wallpaper:1600,"l-format":1600},c=e=>{const{banner:n,targetId:i}=e;return!(!n||(null==i?void 0:i.includes("takeover")))&&C(e,t)},u=e=>{const{native:t}=e;return!!t},v=e=>C(e,i),p=e=>{const{targetId:t}=e;return t.includes("takeover")||C(e,o)},g=e=>C(e,o),m=e=>C(e,a),h=e=>C(e,s),y=e=>e.targetId.includes("sponsorstripe"),f=e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!T(e),w=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},b=e=>e.targetId.startsWith("netboard"),E=e=>e.targetId.startsWith("board"),T=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),I=e=>e.targetId.startsWith("midboard"),k=e=>e.targetId.includes("widescreen"),S=e=>e.width>=1260&&e.width<=1280,A=e=>e.width>=1600&&e.width<=1620,C=(e,t)=>{const n=d[t];if(!n)return!1;return!!n.find(t=>{var n,i;const o=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,r=(null===(i=e.banner)||void 0===i?void 0:i.height)||e.height,a=t.width===o,s=!t.height||t.height===r;return a&&s})},$="0123456789abcdefghijklmnopqrstuvwxyz",O=(e,t)=>{e.style.display=t},P=e=>{window.apntag.anq.push(e)},L=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),x=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})}),N=e=>{const{targetId:t}=e,n=document.querySelector(`div[id^="${t}"]`);if(!n)return;const i=n.parentElement;if(!i)return;t.includes("integration_godt-menu")&&j(i)},j=e=>{const t=e.parentElement;t&&(t.style.display="none")},_=()=>{const e=document.querySelector(".advertory-vg-ad-native-sponsorstripe"),t=document.querySelector("#advertory-vg-sponsorstripe-info");e&&t&&((e,t)=>{const n=e.querySelector("#sponsorstripe-info-open-button"),i=e.querySelector("#sponsorstripe-info-close-button"),o=e.querySelector(".ad-wrapper");o&&(null==n||n.addEventListener("click",()=>{O(o,"none"),O(t,"flex")}),null==i||i.addEventListener("click",()=>{O(o,"flex"),O(t,"none")}))})(e,t)};function q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D,M;var B=q(function(){if(M)return D;M=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 n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,i){return e.concat(t).map(function(e){return n(e,i)})}function o(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 r(e,t){try{return t in e}catch(e){return!1}}function a(e,t,i){var a={};return i.isMergeableObject(e)&&o(e).forEach(function(t){a[t]=n(e[t],i)}),o(t).forEach(function(o){(function(e,t){return r(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(r(e,o)&&i.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(o,i)(e[o],t[o],i):a[o]=n(t[o],i))}),a}function s(t,o,r){(r=r||{}).arrayMerge=r.arrayMerge||i,r.isMergeableObject=r.isMergeableObject||e,r.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(o);return s===Array.isArray(t)?s?r.arrayMerge(t,o,r):a(t,o,r):n(o,r)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},D=s}());const R=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],F={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},V=6;class z{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 R){const i=e[n];void 0!==i&&(t[n]=i)}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)),Object.prototype.hasOwnProperty.call(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}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=B(z.DEFAULT_SITE_HANDLERS,e)}}z.DEFAULT_SITE_HANDLERS={siteEvents:F,initNativeAd:function(){}};const U=new z,H=U.modifyConfigProperties.bind(U);function W(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class K{initialize(){this.DATA=Object.assign({},K.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)}}K.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const G=new K,J="advertory-wallpaper-background",Y="advertory-with-horseshoe",Q=()=>{const e=document.querySelector(`.${J}`);e&&e.remove()},X=e=>{const t=e.getBoundingClientRect().top;requestAnimationFrame(()=>(e=>{if(!document.body)return;const t=document.querySelector(`.${J}`);t&&t.style.setProperty("top",`${e}px`)})(t+15))},Z=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,ee=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")&&Q())},te=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"))},ne=()=>{const{publisher:e,country:t,finnBlink:n}=U.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:o}}=U.getHandlers(),r=window.apntag,a={publisher:e,country:t,finnBlink:n},s=e=>{te(e),P(()=>r.showTag(e))};return{withXandrAd:s,withFinnBlinkAd:e=>W(void 0,void 0,void 0,function*(){yield i(e,a,null)}),withFullAdsChain:e=>W(void 0,void 0,void 0,function*(){yield i(e,a,s,()=>{G.getData("horseshoe").isAvailable&&o(e)})})}},ie={Blink:"Blink"},oe=new Map,re=e=>{var t;if(!oe.has(e)){const t=import(/* webpackIgnore: true */e).then(e=>(e=>{for(const[t,n]of Object.entries(ie)){const i=e[t];null!=i&&(window[n]=i)}})(e)).catch(t=>{throw oe.delete(e),t});oe.set(e,t)}return null!==(t=oe.get(e))&&void 0!==t?t:Promise.resolve()},ae="https://assets.finn.no/pkg/distribution-fixed/v1/FINNExternalDistribution.modern.js",se=(e,t,n,i)=>{const o=t.parentElement;if(!o)return;const r=e?`-${e}`:"",a=i?`__${i}`:"",s=`advertory${r}-${n}${a}`,d=`advertory${r}-${n}-wrapper${a}`;t.classList.remove(...t.classList),o.classList.remove(...o.classList),t.classList.add(s),o.classList.add(d),t.dataset.adType=n},de={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},le=e=>e===de.MOBILE,ce="finn-blink",ue="native-ad",ve=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},pe=()=>W(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)}}),ge=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},me=(e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={}}=U.get(),i=document.createElement("div"),o=document.createElement("div");return o.id=e,i.appendChild(o),se(n,o,ce),ve(`Creating blink container for: ${e}`),i},he=(e,t)=>{var n;(ve(`Appending ${t.id} after ${e.id}`),e.parentElement&&(n=e.parentElement,!Array.from(n.children).some(e=>e.classList.contains("advertory-finn-blink-wrapper"))))?(e.parentElement.style.display="none",e.parentElement.insertAdjacentElement("afterend",t)):ve(`Cannot perform afterend on: ${e.id}`)},ye=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),fe=e=>{const{source:t}=e;return"csm"===t},we=e=>{const{deviceType:t}=U.get();navigator&&navigator.userAgent.match(/firefox/i)&&(e=>e===de.DESKTOP||"tablet"===e)(t)&&be(e)},be=e=>{var t,n,i,o,r,a,s,d;const l=fe(e)?1:0,c=null===(i=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags)||void 0===i?void 0:i[e.targetId];if(null===(d=null===(s=null===(a=null===(r=null===(o=null==c?void 0:c.adResponse)||void 0===o?void 0:o.ads)||void 0===r?void 0:r[l])||void 0===a?void 0:a.rtb)||void 0===s?void 0:s.banner)||void 0===d?void 0:d.content){const e="<style>body { margin:0 !important; }</style>";c.adResponse.ads[l].rtb.banner.content+=e}},Ee={adRequested:()=>{},adAvailable:e=>{f(e)&&(e=>{const t=document.getElementById(e.targetId);t&&t.parentElement&&t.parentElement.classList.add("brandboard-container")})(e),we(e)},adLoaded:e=>{y(e)&&_()},adNoBid:e=>{const{finnBlink:t}=U.get();N(e),(b(e)||E(e)||f(e))&&((e,t)=>{W(void 0,void 0,void 0,function*(){const{deviceType:n}=U.get();if(!t||!le(n))return;yield re(ae);const{replacementConfig:i}=t,o=document.querySelector(`[id^="${e}"]`);if(!o||!(null==i?void 0:i.sizes))return;const{sizes:r}=i,a=ge(e),s=me(a);o.dataset.finnBlinkId=a,o.dataset.noBidAd="true",he(o,s),ne().withFinnBlinkAd(a)})})(e.targetId,t)},adError:(e,t)=>N(t),adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},Te=e=>new URLSearchParams(window.location.search).get(e),Ie=e=>new Promise(t=>{if(!window._tcf_||!(null==e?void 0:e.enabled))return void t(!1);const n=(()=>{if(!window._tcf_)return null;const e=window._tcf_.getPermissionSync("CMP:advertising");if(null===e)return null;const t=Number(e);return ve("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let i=!1;const o=e=>{i||(ve("Resolving advertising permission value obtained"),i=!0,t(e))},r=setTimeout(()=>{ve("Advertising permission timed out, resolving with false"),o(!1)},3e3);window._tcf_.onTcfReady(()=>{ve("On Tcf Ready called, waiting for permission"),clearTimeout(r)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(r);const t=Number(e);ve("Advertising permission value obtained asynchronously: ",e),o(Boolean(t))})}),ke={NO:"no",SE:"se"},Se="cmp:loaded";let Ae,Ce=!1;const $e=(e,t,n)=>{const i=!!(null==e?void 0:e.enabled),o=(null==e?void 0:e.timeout)||3e3,r=Te("bypass_tcf"),a=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(ve("TCF bypass param detected, returning consent: true"),!0):(ve("TCF is not enabled, returning consent: true"),!0))(i,r))return!0;if(Ce)return null;if(!Ae)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=Ae.getConsentedToAllSync();return ve(`TCF consented to all is: ${t}`),Ae.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(ve("Getting TCF consent manager..."),window._tcf_)return ve("TCF consent manager is already available"),Ae=window._tcf_,void e(Ae);ve("TCF consent manager is not available");const n=()=>{ve("CMP loaded, resolving consent manager..."),i&&clearTimeout(i),window._tcf_?(Ae=window._tcf_,e(Ae)):t(new Error("CMP loaded but window._tcf_ is not defined"))},i=setTimeout(()=>{document.removeEventListener(Se,n),Ce=!0,t(new Error("Timeout waiting for CMP to load"))},o);ve("Listening for CMP loaded event..."),document.addEventListener(Se,n,{once:!0})}):Promise.resolve(null),getConsentSync:a,getConsentAsync:()=>W(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ve(`Schibsted Ad Choices override value is set, returning override value: ${e.schibstedAdChoicesOverrideValue}`),Boolean(Number(e.schibstedAdChoicesOverrideValue));const i=(null==e?void 0:e.schibstedAdChoicesEnabled)&&n===ke.SE,r=(null==e?void 0:e.schibstedAdChoicesEnabled)&&!t&&n===ke.NO;if(i||r)return ve("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield Ie(e);if(!(null==e?void 0:e.enabled))return!0;const s=a();return null!==s?s:yield new Promise((e,t)=>{try{if(!Ae)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");let t=!1;const n=n=>{t||(t=!0,e(n))},i=setTimeout(()=>{ve("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);Ae.onTcfReady(()=>{ve("On Tcf Ready called, waiting for consent"),clearTimeout(i)}),Ae.isConsentedToAll(t=>{clearTimeout(i),e(t)})}catch(e){t(e)}})})}},Oe=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},Pe=()=>{const e=Oe("_pulse2data");return e?e.split(",")[2]:void 0},Le=9826;class xe{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=de.DESKTOP,isMobileApp:t}=U.get();if(t){return{"aa-sch-supply_type":`app_${e===de.MOBILE?"phone":de.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return W(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()),yield this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(e.keywords)),user:{externalUid:yield this.getExternalUid(),dnt:yield this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){return W(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}})}getUserId(){return Pe()}getExternalUid(){return W(this,void 0,void 0,function*(){return yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=$e(e,t,n);if(!(yield i()))return;const o=Oe("_pulse2data");return o?o.split(",")[9]:void 0})})}isTrackingForbidden(){return W(this,void 0,void 0,function*(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===(yield this.getExternalUid())})}getMember(){const{pageOptions:{member:e},testMember:t=Le}=U.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}=U.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return W(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=$e(e,t,n);return{"aa-sch-cmp_advertising":(yield i())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=U.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}=U.get(),i=null===(e=null==n?void 0:n.sponsors)||void 0===e?void 0:e.split(":").map(e=>`${t}_${e}`);return i?{"no-sno-news-sponsors":i}:{}}}const Ne=new xe;function je(e=!1){var t,n;const i=null===(n=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===n?void 0:n.toLocaleLowerCase(),o=(()=>{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:o,mobileOS:["ios","android"].includes(o)?o:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}Ne.prepare.bind(Ne);const _e=["aLOLE","xBqQj","1KaqJ","1nzXzK","opm8zV","4qKXKR","Ad9QgE"];function qe(e){return t=window.location.pathname.split("/").slice(-2,-1).pop()||"",_e.includes(t)?{"no-sno-news-section":`${e}_doedsfall`}:{};var t}class De extends xe{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=de.DESKTOP}=U.get();return{"no-sno-device":this.getPageOptionsFormatDevice(e)}}}getAppTypeKeywords(){const{deviceType:e,isMobileApp:t}=U.get(),{OS:n,isHybridApp:i}=je(t);return{"no-sno-apptype":n&&e&&i?`${n}_${this.getPageOptionsFormatDevice()}_hybrid`:"none"}}getObituariesKeywords(e){return qe(e)}getSectionPageTypeKeywords(){var e,t;const{pageOptions:n,pageType:i}=U.get(),o=null!==(t=null===(e=n.keywords["no-sno-news-section"])||void 0===e?void 0:e.toString())&&void 0!==t?t:"ettan";return{"no-sno-section-page_type":`${o.split("_").pop()||o}_${"article"===i?"article":"front"}`}}}const Me=864e5,Be=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return ve("Error with parsing localStorage data"),null}},t=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:t,setWithTimestamp:(e,n,i=Me)=>{const o={data:n,expirationTime:(new Date).getTime()+i};t(e,JSON.stringify(o))},getByTimestamp:(t,n=Me)=>{const i=e(t);if(!i)return null;if(!n)return i;try{const{expirationTime:e,data:t}=JSON.parse(i);return(new Date).getTime()<=e?t:null}catch(e){return ve("Error with parsing localStorage data"),null}}}})(),Re="glimrTags",Fe=["glwe_","glwet_"],Ve={geofenceTags:[],geoTags:[],weatherTags:[]},ze=(e,t,n,...i)=>W(void 0,[e,t,n,...i],void 0,function*(e,t,n,i="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return ve(`Schibsted Consent to Pay is not enabled, returning true for ${i}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ve(`Schibsted Ad Choices override value is set, returning override value: ${null==e?void 0:e.schibstedAdChoicesOverrideValue} for ${i}`),Boolean(Number(null==e?void 0:e.schibstedAdChoicesOverrideValue));const{getConsentAsync:o}=$e(e,t,n);return(yield o())?(ve(`Schibsted Ad Choices consent given according to TCF consent manager for ${i}`),!0):(ve(`Schibsted Ad Choices consent not given according to TCF consent manager for ${i}`),!1)}),Ue=()=>W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();if(null==e?void 0:e.schibstedConsentToPayEnabled){return yield ze(e,t,n,"glimr")}const{getConsentAsync:i}=$e(e,t,n);return yield i()}),He=()=>W(void 0,void 0,void 0,function*(){const{glimr:e}=U.get();if(!(yield Ue())||!(null==e?void 0:e.enabled))return void ve("No consent for glimr data fetching.");const t=yield(n=500,W(void 0,void 0,void 0,function*(){return yield Promise.race([W(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)=>{Be.setWithTimestamp(Re,{tags:e,tagMappings:t}),n(!0)})})}catch(e){ve(`Error during getting glimr data: ${e}`)}else ve("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),We=()=>{const{country:e}=U.get();return e===ke.NO?"no-sno":"se-generic"},Ke=()=>{const{country:e,publisher:t}=U.get();return`${e}-${t}`},Ge={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"},Je=e=>Fe.some(t=>e.startsWith(t)),Ye=e=>e.startsWith("glgc_"),Qe=e=>!Je(e)&&!Ye(e),Xe=e=>{const t=Ze();if(!t)return Ve;const n=((e=[])=>e.filter(Je))(t),i=((e=[])=>e.filter(Ye))(t),o=((e=[],t)=>{const n=e.filter(Qe);if(t){const{publisher:e}=U.get(),t=Ge[e]||e;n.push(t)}return n})(t,e);return{geoTags:o,geofenceTags:i,weatherTags:n}},Ze=()=>{const e=Be.getByTimestamp(Re);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},et={get:(e,t)=>W(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)=>W(void 0,void 0,void 0,function*(){const i=JSON.stringify(n),o=yield fetch(e,{method:"POST",headers:t,body:i});if(!o.ok)throw new Error(o.statusText);return yield o.json()})},tt="advertory:ppids-cache",nt={[ke.SE]:`SCH${ke.SE.toUpperCase()}-EnvHash`,[ke.NO]:`SCH${ke.NO.toUpperCase()}-EnvHash`},it={[ke.SE]:`SCH${ke.SE.toUpperCase()}-UserHash`,[ke.NO]:`SCH${ke.NO.toUpperCase()}-UserHash`},ot={[ke.SE]:`sch${ke.SE}-envhash-v3`,[ke.NO]:`sch${ke.NO}-envhash-v3`},rt={[ke.SE]:`sch${ke.SE}-userhash-v3`,[ke.NO]:`sch${ke.NO}-userhash-v3`},at={[ke.SE]:`'sch${ke.SE}-iosid-v3'`,[ke.NO]:`'sch${ke.NO}-iosid-v3'`},st={[ke.SE]:`sch${ke.SE}-androidid-v3`,[ke.NO]:`sch${ke.NO}-androidid-v3`},dt={[ke.SE]:"sdrn:schibsted.com:user",[ke.NO]:"sdrn:spid.no:user"};class lt{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:i})=>{t.append(e,`${i}-${n}`)}),t}}const ct=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return W(this,arguments,void 0,function*(e,t=1e4){var n,i;const o=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=o.xandr)||void 0===n?void 0:n.ppId1,null===(i=o.xandr)||void 0===i?void 0:i.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||ve("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:""}},ut=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return W(this,void 0,void 0,function*(){var n,i,o,r,a,s,d,l,c,u,v;const p=Be.get(tt),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===(i=g.idfv)||void 0===i?void 0:i.plain,null===(o=g.anId)||void 0===o?void 0:o.plain),void this.setPPIDs(null!==(r=c.userId)&&void 0!==r?r:"",null!==(a=c.environmentId)&&void 0!==a?a:"",null===(s=g.idfv)||void 0===s?void 0:s.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||ve("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,i){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:"",this.idfv=null!=n?n:null,this.anId=null!=i?i:null}shouldHash(e,t){var n,i;if(!e)return!0;for(const o in e){if((null===(n=e[o])||void 0===n?void 0:n.plain)!==(null===(i=t[o])||void 0===i?void 0:i.plain))return!0}return!1}cachePPIDs(e,t,n,i){const o=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}}:{}),i?{anId:{plain:i}}:{});Be.set(tt,o)}hashPPIDs(e,t){return W(this,void 0,void 0,function*(){try{const n=new Headers({"Content-Type":"application/json"});return yield et.post(t,n,e)}catch(e){return ve("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return W(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield((e,t)=>W(void 0,void 0,void 0,function*(){const n=yield e.getUserId();return n?`${dt[t]}:${n}`:null}))(t,n),o=yield(e=>W(void 0,void 0,void 0,function*(){const t=yield e.getEnvironmentId();return t?`sdrn:schibsted:environment:${t}`:null}))(t),r=window.advertory_idfv,a=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:e},userId:{plain:i},environmentId:{plain:o},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},r?{idfv:{plain:r}}:{}),a?{anId:{plain:a}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:i,environmentId:o}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:i.plain,environmentId:o.plain}}},vt=e=>W(void 0,void 0,void 0,function*(){const{tracker:t,tcf:n,country:i,isMobileApp:o}=e;if(!(yield ze(n,o,i,"setXandrPPIDs")))return;if(!t)return;(yield Promise.allSettled([ct.processPPIDs(t,null==n?void 0:n.timeout),ut.processPPIDs(t,i)])).forEach((e,t)=>{if("rejected"===e.status){ve(`Cannot fetch PPIDs v${t+2}`,e.reason)}})}),pt=e=>{const{ppid1:t,ppid2:n}=ct.getPPIDs(),{ppid1:i,ppid2:o,idfv:r,anId:a}=ut.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new lt).add(n,nt[e]).add(t,it[e]).add(o,ot[e]).add(i,rt[e]).add(r,at[e]).add(a,st[e]).buildEids()}]}},gt=e=>{const{ppid1:t,ppid2:n}=ct.getPPIDs(),{ppid1:i,ppid2:o,idfv:r,anId:a}=ut.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new lt).add(n,nt[e]).add(t,it[e]).add(o,ot[e]).add(i,rt[e]).add(r,at[e]).add(a,st[e]).buildRyEids()}}]}}};const mt=new class extends De{prepare(e){return W(this,void 0,void 0,function*(){const t=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.getCountryCodeKeywords(ke.NO)),this.getInventoryTypeKeywords()),this.getPublisherKeywords()),yield this.getFormattedExternalIdKeywords()),this.getSupplyTypeKeywords()),this.getPageTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),yield this.getAdvertisingConsentKeywords()),this.getHasContextKeywords(e.keywords)),yield W(void 0,void 0,void 0,function*(){const{glimr:e}=U.get(),{addPublisherToGeo:t}={},n=yield Ue();if(!(null==e?void 0:e.enabled)||!n)return ve("No consent for getting glimr tags."),{};const i=We(),o=Xe(t);return{[`${i}-geo`]:o.geoTags,[`${i}-weather`]:o.weatherTags,[`${i}-geofence`]:o.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=ct.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(Object.assign({},pt(ke.NO)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var ht=mt.prepare.bind(mt);const yt=()=>{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},ft={SVD:"svd",VG:"vg",GODARE:"godare",AFTENPOSTEN:"aftenposten",SA:"sa",BT:"bt",AFTONBLADET:"aftonbladet",E24:"e24",MINMOTE:"minmote",PENT:"pent",GODT:"godt",TEK:"tekno",KLART:"klart",TVNU:"tvnu",POLARIS:"polaris",KOKET:"koket",TV4:"tv4",FOTBOLLSKANALEN:"fotbollskanalen"},wt={[ft.VG]:["board","netboard","backfill","outstream"],[ft.AFTONBLADET]:["panorama","outstream"],[ft.GODARE]:["panorama","outstream"],[ft.SVD]:["wph-article-panorama","wph-front-panorama"]},bt=e=>{var t;const{publisher:n}=U.get();return!!wt[n]&&!!(null===(t=wt[n])||void 0===t?void 0:t.some(t=>e.includes(t)))},Et=()=>(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),Tt=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),It=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=U.get(),o=[`${We()}-geo`],r=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...i?o:[]],a=Object.fromEntries(Object.entries(e).filter(([e])=>r.includes(e))),s=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:a}}},s)}},kt=(e,...t)=>W(void 0,[e,...t],void 0,function*(e,{timeout:t}={timeout:1e3}){document.querySelector(`script[src="${e}"]:not([type="module"])`)||(yield new Promise((n,i)=>{const o=document.createElement("script");o.async=!0,o.src=e;const r=()=>{s(),n()},a=()=>{s(),i(new Error(`Failed to load ${e}`))},s=()=>{o.removeEventListener("load",r),o.removeEventListener("error",a),clearTimeout(d)};o.addEventListener("load",r),o.addEventListener("error",a);const d=setTimeout(()=>{s(),i(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(o)}).catch(e=>{console.error(e)}))}),St=e=>e.includes("snoap.no"),At=e=>{var t,n,i,o,r;return!!(null===(r=null===(o=null===(i=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags[e])||void 0===i?void 0:i.adResponse)||void 0===o?void 0:o.ads[1])||void 0===r?void 0:r.rtb)},Ct=(e,t=(...e)=>{})=>{const n=t.toString();if(0===e.length)return n;const i=n.substring(0,n.indexOf("=>")).replace("(","").replace(")","").split(",").map(e=>e.trim()),o=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),r=i.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...r,o).toString()},$t=Ct([],()=>{const e=({width:e,height:t})=>{var n;const i=null===(n=document.querySelector("#sf_align"))||void 0===n?void 0:n.querySelector("div");if(!i)return;const{clientWidth:o,clientHeight:r}=i,a=e/o,s=t/r;i.style.transform=`scale(${a},${s})`,i.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}),Ot=e=>{const t=Ct([],()=>{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 i=n.contentDocument.createElement("style");i.textContent="\n #image {\n background-size: cover !important;\n }\n ",new MutationObserver((e,t)=>{n.contentDocument&&(n.contentDocument.head.appendChild(i),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},Pt=[],Lt={},xt=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=jt(e);n?(Nt(i,n),_t(e,i,t)):(Nt(i,n),qt(e,i,t))})},Nt=(e,t)=>{var n,i;const o=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;const r=t?"showFullscreen":"hideFullscreen";null===(i=o.contentWindow)||void 0===i||i.postMessage(`advertory:${r}-${e}`,"*")},jt=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},_t=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),Pt.includes(t)||Pt.push(t),n&&window.addEventListener("scroll",Lt[t],{passive:!0})},qt=(e,t,n)=>{Pt.includes(t)&&(n&&window.removeEventListener("scroll",Lt[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},Dt=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:i=[".skyscraper_r"],headerZIndex:o=3}=t,r=[],a=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&r.push(n)}),i.forEach(e=>{const t=document.querySelector(e);t&&a.push(t)}),()=>{r.length&&Mt(e,r,o,0),a.length&&Mt(e,a,o,40)}},Mt=(e,t,n,i)=>{const o=e.offsetHeight,r=window.scrollY,a=e.getBoundingClientRect().top+r;t.forEach(e=>{const t=e.offsetHeight;let s;s=a>r?(a-r)/t-i:(r+t-(a+o))/t;const d=s<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=s.toString()})},Bt={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 Rt=null;const Ft=(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=`(${$t})()`,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(St(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=Ot(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>St(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)),St(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)),At(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},Vt=()=>{Rt=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,i=e?e.offsetLeft:0,o=document.documentElement;o.style.setProperty("--advertory-fullscreen-scroll-vh",`${t}px`),o.style.setProperty("--advertory-fullscreen-scroll-vw",`${n}px`),o.style.setProperty("--advertory-fullscreen-scroll-left",`${i}px`)},zt=()=>{Rt||(Rt=window.requestAnimationFrame(Vt))},Ut=(t,n)=>{var i,o,r,a;const{country:s}=U.get(),{targetId:d}=t;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(i=null==n?void 0:n.iosSafeAreaTopFix)&&void 0!==i?i:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:i="#fff",margin:o="16px 0",beforeContentValue:r=""}=e,a=t/2,s=document.createElement("style");s.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${a}px),\n ${i} calc(50% - ${a}px),\n ${i} calc(50% + ${a}px),\n ${n} calc(50% + ${a}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${o};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${r&&"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: '${r}' !important;\n }`,s.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(s)})(null!==(o=null==n?void 0:n.overlayStyles)&&void 0!==o?o:{});const l=document.getElementById(d),c=null==l?void 0:l.parentElement;if(!l||!c)return;((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,i=new IntersectionObserver(e=>xt(e,n),{}),o=jt(e);i.observe(e),n&&(Lt[o]=Dt(e,t))})(c,n),l.className="advertory-fullscreen-scroll";const u=C(t,e)?"absolute":"fixed";l.style.position=u,c.className="advertory-fullscreen-scroll-wrapper",c.dataset.showTagSubscribeId=d,l.setAttribute("data-ad-label",Bt[s].adText),(null==n?void 0:n.moveCogwheelToTheLeft)&&(l.dataset.moveCogwheelToTheLeft="true"),zt(),window.addEventListener("resize",zt),null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",zt),null===(a=window.visualViewport)||void 0===a||a.addEventListener("scroll",zt)},Ht=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=At(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,i=At(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ft(t,e))},Wt=()=>W(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,country:n,isMobileApp:i,fullscreenScroll:o}=U.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:r}=U.getHandlers(),{getConsentAsync:a}=$e(t,i,n),s=yield a(),d=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:i=>{const o=Et(),{prebid:{relevantCbTimeout:r}={}}=U.get(),a="relevantCb"===i&&r?r:n[i].timeout,s=setTimeout(()=>{!n[i].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${i}'`),e=!0,o.loadTags&&o.loadTags())},a);t.push(s)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),l=Et(),u=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=Et();return{user:e,keywords:t}})();d.failsafeOnTimeout("relevantCb");const{user:{externalUid:v=""}={},keywords:p}=u;(()=>{const e=Tt();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(d.getCancel()||!l.loadTags)return ve("core loadTags() call was cancelled",{cancel:d.getCancel(),apnTagLoadTags:!l.loadTags,condition:"or"}),void d.cleanup();const t=Tt();d.events.relevantCb.done=!0,d.failsafeOnTimeout("auctionCb");const i=s?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};ve("prebid consentManagement",i),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},gt(n)),It(p,v))),ve("core add prebid config",Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},gt(n)),It(p,v))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,l.loadTags(e)),d.cleanup()}},customNativeRender:e=>{Kt(e,r)},directRenderFn:e=>{const{settings:t,renderFn:n}=e,{bid:i,adDiv:r}=t||{};if(!r)return;const a=n(t),s=Object.assign(Object.assign({},i),{targetId:r.id,banner:!0});c(s)&&(Ut(s,o),(e=>{const t=()=>{const t=e.contentDocument;if(!(null==t?void 0:t.body))return;const n=()=>{const e=t.querySelector("iframe");if(!e)return!1;const n=()=>{var t;const n=null===(t=e.contentDocument)||void 0===t?void 0:t.querySelector(".adn-ttpa-container");n&&(n.style.setProperty("bottom","10px","important"),n.style.setProperty("top","unset","important"))};return e.addEventListener("load",n),n(),!0};if(n())return;const i=new MutationObserver(()=>{n()&&i.disconnect()});i.observe(t.body,{childList:!0,subtree:!0})};e.addEventListener("load",t),t()})(a))}}),ve("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,l.loadTags(e))}},customNativeRender:e=>{Kt(e,r)},directRenderFn:()=>{}})})}),Kt=(e,t)=>{var n;const{divId:i,native:o,bid:r}=e,a=document.querySelectorAll(`[id^=${i}]`)[0],s=`RY-${a.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)})(a,s);const d=null===(n=a.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:o,targetId:s},U.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:r.adId}),"*")};let Gt="";const Jt=new Map,Yt=e=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement,i=(null==n?void 0:n.offsetHeight)||0;n&&(n.style.minHeight=`${i}px`)},Qt=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=G.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=i},Xt=()=>{Q();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{ee(e.id),Qt(e),(e=>{const t=document.querySelector(`#${e}`),n=null==t?void 0:t.getAttribute("data-probable-height"),i=null==t?void 0:t.getAttribute("data-probable-width");n&&i&&(null==t||t.style.setProperty("min-height",n+"px"),null==t||t.style.setProperty("min-probable-width",i+"px"))})(e.id),e.innerHTML="",e.id=ge(e.id)}),P(()=>window.apntag.clearRequest())},Zt="noGroupedPlacements",en=e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t},tn=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},nn=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:i,deviceType:o}=U.get(),r=n[o].filter(tn)||[],a=e?document.querySelector(e):document;if(!a)return[];const s=r.reduce((e,t)=>{const n=en(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=r.filter(({id:e})=>e.match(t)),s=(null==i?void 0:i.queryByDataDevice)?`div[id^="${e}"][data-device=${o}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,d=a.querySelectorAll(s),l=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{var i;const o=on(e,t,n),r=o.finnBlink&&!o.finnBlink.renderOnlyWithAdBlock,a=r&&(null===(i=o.finnBlink)||void 0===i?void 0:i.loadOnlyFinnBlink),s=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=$[Math.floor(36*Math.random())];return t})(6)}`;return e.id=s,e.setAttribute("data-advertory-ad-rendered","true"),r&&e.setAttribute("data-is-finn-blink-placement","true"),a&&e.setAttribute("data-is-finn-blink-only-placement","true"),(e=>{var t;const n=e.id;n&&G.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({},o),{id:s})});return(e=>{const{keywordsConfig:t}=U.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(Gt!==window.location.pathname&&(Jt.clear(),Gt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=Jt.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${Ke()}-count`]=i,Jt.set(n,i+1),e})):e})(l)});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))})(s)},on=(e,t,n)=>{const i=n[t],o=n[n.length-1],r=n.filter(({id:t})=>t===e.id)[0];return(null==e?void 0:e.id)===(null==i?void 0:i.id)?i:(null==e?void 0:e.id)===(null==o?void 0:o.id)?o:r||o},rn=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=U.get(),i=(null==t?void 0:t[n])||{},o=Object.values(i).flat(),r=(e=>{const t={};return e.forEach(e=>{const n=ge(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),a=((e,t)=>{const n={};for(const[i,o]of Object.entries(t))n[i]=e.filter(e=>o.includes(ge(e.id)));return n})(e,i),s=Object.keys(r),d=((e,t)=>e.filter(e=>!t.has(ge(e.id))))(e,new Set([...s,...o]));return Object.assign(Object.assign(Object.assign({},a),r),{[Zt]:d})},an=(e,t,n)=>{const i=document.getElementById(`div_utif_${e}`);if(!i)return;const{apntag:o}=window,[r,a]=t;if(!i.dataset.lockedsize&&a&&r)i.style.width=`${r}px`,i.style.height=`${a}px`,n&&(o.resizeAd(i.id,[r,a]),i.dataset.lockedsize="true",i.dataset.lockedwidth=r.toString(),i.dataset.lockedheight=a.toString());else if(null==i?void 0:i.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=i.dataset;e&&t&&o.resizeAd(i.id,[e,t])}},sn=["netboard","board"];class dn{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,i;const{editionName:o}=e,r=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),a=JSON.stringify(null!==(i=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==i?i:[]),s=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return s.searchParams.append("editionName",o),r&&s.searchParams.append("urlData",r),a&&s.searchParams.append("excludedItems",a),l&&s.searchParams.append("spid",l),d&&s.searchParams.append("envid",d),s.toString()}fetchData(e){return W(this,void 0,void 0,function*(){var t,n,i;const o=yield this.identityFacade.getIdentityUser(),r=null!==(i=yield null===(n=null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId)||void 0===n?void 0:n.call(t))&&void 0!==i?i:"",a=(null==o?void 0:o.userId)?String(o.userId):"",s=this.buildUrl(e,{envId:r,spid:a});try{ve("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield et.get(s,e);return ve("Fetch operation completed successfully."),t}catch(e){ve("Error during fetch operation:",e)}return null})}}let ln=class{getDrEditionUTMParams(e,t){var n;const{title:i="",clientName:o,creativeId:r}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:a}=t,s=i.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:a,utm_campaign:o,utm_medium:s},r&&{utm_id:`df-${r}`})}getUrlSearchParams(e,t,n){if(!e)return"";const i=this.getDrEditionUTMParams(t,n),o=new URLSearchParams(decodeURIComponent(e.search)),r=new URLSearchParams(e.search);return Object.entries(i).forEach(([e,t])=>{o.has(e)||r.set(e,null!=t?t:"")}),r.toString().replace(/\+/g,"%20")}getUrlWithParams(e,t){var n;const i=null===(n=null==e?void 0:e.pulseData)||void 0===n?void 0:n.url;if(!i)return"";const o=this.getDrEditionUTMParams(e,t),r=new URL(i);return Object.entries(o).forEach(([e,t])=>{r.searchParams.has(e)||r.searchParams.set(e,null!=t?t:"")}),r.toString()}handleVideo(e,t){return W(this,void 0,void 0,function*(){const{id:n,autoplay:i,mute:o,videoLoop:r,vendor:a}=t.videoConfiguration;e.classList.add("vgtv-video-container"),Object.assign(e.dataset,{vgtvVideoId:n,vgtvVendor:a,vgtvAutoplay:i,vgtvMuted:o,vgtvLoop:!!r,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:i,pathname:o}=new URL(n);if(!i.includes("www.vg.no")&&!o.includes("annonsorinnhold"))return[n];const r=o.split("/");return r.length?[...r.filter(Boolean).slice(1).map(e=>e),n]:[n]}};const cn=e=>{const t=e.parentElement;t?t.classList.remove("dr-edition-lock-height"):ve("Dr. Edition container does not have a parent element, cannot remove height lock.")};class un{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(e,t){return W(this,void 0,void 0,function*(){var n,i;const{drEditionConfig:{containerSelector:o},renderAsBackfill:r=!1}=t,a=e.querySelector(o);if(!a)return void ve(`Container with selector "${o}" not found.`);const s=yield this.drEditionService.fetchData(t);return(null==s?void 0:s.itemId)||r?!(null==s?void 0:s.itemId)&&r?(ve("No Dr. Edition ads available to render. Collapsing whole placement."),ee(e.id),void cn(a)):((null==s?void 0:s.itemId)&&r&&(ve("Dr. Edition ad available to render as a Xandr backfill."),te(e.id)),void(s?(s.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(s.css,"style"),yield this.rendererManager.render(a,s,t),yield null===(n=this.videoManager)||void 0===n?void 0:n.handle(s,t),cn(a),this.drEditionAds.push(s),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(s.itemId),this.observeAdView(e,s,t),null===(i=e.querySelector("a"))||void 0===i||i.addEventListener("pointerup",()=>null)):cn(a))):(ve("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(a),this.showBackfill(e),void cn(a))})}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 i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";te(i)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const i=e.querySelector(".dr-edition-slider");if(!i)return!1;let o=null;const r=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(o&&clearTimeout(o),o=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...i.children].forEach(e=>{r.observe(e)})})},{threshold:[.9]});return[...i.children].forEach(e=>{r.observe(e)}),!0}}class vn{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){return W(this,void 0,void 0,function*(){if(!(null==t?void 0:t.itemId))return;const{getConsentAsync:i}=$e(n.tcf,n.isMobileApp,n.country),o=yield i(),r=le(n.device)?t.mobileHTML:t.desktopHTML,a=o?r:r.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");e.innerHTML=a,e.querySelectorAll("a").forEach(e=>{var i,o,r;e.search=null!==(r=null===(o=(i=this.newsroomStrategy).getUrlSearchParams)||void 0===o?void 0:o.call(i,e,t,n))&&void 0!==r?r:"",e.onclick=()=>this.pulseManager.trackContentClick(e,t,n)})})}}class pn{constructor(e){this.strategy=e}handle(e,t){return W(this,void 0,void 0,function*(){const{videoConfiguration:{id:n,preview:i}={}}=e;(n||i)&&(yield this.importScript(t),yield this.createVideoElement(e,t))})}importScript(e){return W(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield kt(t)}catch(e){ve("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return W(this,void 0,void 0,function*(){const n=document.createElement("div"),{node:i}=e.videoConfiguration,o=[...document.querySelectorAll(`#${i}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(e,t))return;this.strategy.handleVideo(n,e),null==o||o.appendChild(n),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const r=null==o?void 0:o.parentNode;if(!r)return;const a=r.closest("a");r.addEventListener("click",e=>{const t=e.target.closest("a");a!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,i,o;const{preview:{url:r,thumbnail:a}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!r)return!1;const s=document.querySelector(".dr-edition-preview .preview-video");return!!s&&(s.setAttribute("src",r),s.setAttribute("playsinline",""),!(!s||!a)&&(null===(o=(i=t.drEditionConfig).addPreviewVideo)||void 0===o||o.call(i,s),!0))}}let gn=class{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t,n,i){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 i=null==n?void 0:n.textContent;return i?i.trim():""}getEventTarget(e,t){const{itemId:n,pulseData:{url:i}={}}=t,o=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=o?o:""),type:"Page",url:i}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e,t,n){return W(this,void 0,void 0,function*(){var i,o,r,a,s,d,l,c;const u=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:n.editionName}});if(window.dispatchEvent(u),!this.pulse)return;const v=this.getEventInput(e,t,n,"view");(null===(i=this.pulse)||void 0===i?void 0:i.trackLegacyViewUIElement)?null===(r=null===(o=this.pulse)||void 0===o?void 0:o.trackLegacyViewUIElement)||void 0===r||r.call(o,v):(null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)?null===(d=null===(s=this.pulse)||void 0===s?void 0:s.trackViewUIElement)||void 0===d||d.call(s,v):null===(c=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===c||c.call(l,v)})}trackContentClick(e,t,n){return W(this,void 0,void 0,function*(){var i,o,r,a,s,d;if(!this.pulse)return;const l=this.getEventInput(e,t,n,"click");this.pulse.trackLegacyClickUIElement?null===(o=(i=this.pulse).trackLegacyClickUIElement)||void 0===o||o.call(i,l):this.pulse.trackClickUIElement?null===(a=(r=this.pulse).trackClickUIElement)||void 0===a||a.call(r,l):null===(d=(s=this.pulse).trackElementClick)||void 0===d||d.call(s,l)})}};class mn extends gn{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){const{pulseData:{title:i,clientName:o="",creativeId:r}={}}=t,{columnName:a,primaryPosition:s}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:i,placement:{columnName:a,primaryPosition:s},"spt:custom":{is_sponsored:!0,sponsor:o,"spt:creativeId":r},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}let hn=class extends gn{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var i,o,r,a,s,d;const{itemId:l,pulseData:{clientName:c,creativeId:u}={}}=t,v=n.editionName,p=this.mapPageType(this.pageType),g=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(a=null===(r=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getPulseObjectId)||void 0===r?void 0:r.call(o))&&void 0!==a?a: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===(s=this.newsroomStrategy)||void 0===s?void 0:s.getTags)||void 0===d?void 0:d.call(s,e)}}getEventInput(e,t,n,i){return{object:this.getEventBaseData(e,t,n),partnerstudio:this.getEventPartnerstudioData(e,t,n,i),target:this.getEventTarget(e,t),provider:this.getProviderData()}}getEventPartnerstudioData(e,t,n,i){var o,r,a,s;const{pulseData:{algorithm:d="sov",clientName:l,creativeId:c,editionId:u,itemId:v,url:p,probability:g}={}}=t,m=Math.floor(Date.now()/1e3),h=this.getTeaserElementText(e,"title"),y=this.getTeaserElementText(e,"subtitle"),f=this.getTeaserElementText(e,"image"),w=null!==(s=null!==(a=null===(r=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getUrlWithParams)||void 0===r?void 0:r.call(o,t,n))&&void 0!==a?a:p)&&void 0!==s?s:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:m,title:h,type:i,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}};const yn={FRONT:"front",ARTICLE:"article",OTHER:"other"},fn=(e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})},wn=e=>W(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 i=document.createElement("script");i.id=e,i.src="https://cdn.stream.schibsted.media/player/3.78.1/player.min.js",i.async=!0;try{i.src=i.src.replace("player.min","player.next.min")}catch(e){console.error("Failed to set player.next.min source:",e)}document.head.insertBefore(i,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)))}))}),bn={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 W(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Dr})})}})}},En=(e,t)=>{null==e||e.forEach(e=>{bn[e](t)})};class Tn{handleVideo(e,t){return W(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:o,vendor:r}}){yield W(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 a=["ContentMutePlugin"],s=this.createPlayerOverlay(e);En(a,s);const d={id:t,node:n,autoplay:i,mute:o,vendor:r,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},l=yield wn(d);l.once("assetReady",()=>{fn(l,a)}),l.once("ready",()=>{const t=e;new MutationObserver(e=>{e.forEach(({type:e,attributeName:n})=>{"attributes"===e&&"class"===n&&(t.classList.contains("jw-state-playing")?s.classList.add("is-playing"):s.classList.remove("is-playing"),t.classList.contains("jw-flag-user-inactive")?s.classList.add("is-inactive"):s.classList.remove("is-inactive"))})}).observe(t,{attributes:!0,attributeFilter:["class"]})}),l.once("PulseStats:ready",()=>W(this,void 0,void 0,function*(){const e=yield l.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===yn.FRONT?"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:i}=new URL(n),o=i.split("/").filter(Boolean);return o.length?[...o.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 In="https://www.aftonbladet.se/video-player-extras/latest/";class kn{handleVideo(e,t){return W(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:o,vendor:r}}){const a={id:t,node:n,autoplay:i,mute:o,vendor:r,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${In}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${In}external-link.js`]:{name:"ExternalLink"}}};yield wn(a),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""}}const Sn=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);class An{handleVideo(e,t){return W(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:o,vendor:r}}){const a={id:t,node:n,autoplay:i,mute:o,vendor:r,locale:"se",autopause:"viewable",maxBitrate:600,sharing:!1,recommended:!1,pulse:{provider:"svdse",decorator:(e,t)=>Object.assign(Object.assign({},Sn(e)?e:{}),{provider:Object.assign(Object.assign({},Sn(null==e?void 0:e.provider)?e.provider:{}),{productTag:"partnerstudio"})})},skin:{name:"svd-player",url:""},settings:{pulse:{host:"se-aftonbladet.videoplaza.tv",contentMetadata:{category:"SvD",tags:["standard-linears","pause",`video-${t}`]},requestSettings:{}}}},s=yield wn(a);s.once("PulseStats:ready",()=>W(this,void 0,void 0,function*(){const e=yield s.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"svdse",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===yn.FRONT?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}let Cn=class{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}};const $n=(e,t,n)=>{var i;const{publisher:o,pageType:r,country:a}=e,s={[ft.VG]:new ln,[ft.E24]:new Tn,[ft.AFTONBLADET]:new kn,[ft.SVD]:new An}[o]||new Cn,d=new(a===ke.SE?mn:hn)(n,s,r),l=new dn(t,null!==(i=null==n?void 0:n.pulseTracker)&&void 0!==i?i:n),c=new vn(s,d),u=new pn(s);return new un(l,c,u,d)},On=()=>W(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 Pn{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 W(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 ve("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return W(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 Ln=(e,t,n)=>{const{wrapperSelector:i}=null==e?void 0:e.drEditionConfig,o=document.querySelectorAll(i),r=new IntersectionObserver((i,o)=>((e,t,n,i,o)=>{const r=$n(n,i,o);e.forEach(e=>{var i,o,a;if(!e.isIntersecting)return;const s=e.target,d=null!==(i=s.dataset.editionName)&&void 0!==i?i:"",l=null!==(o=s.dataset.pulseColumnname)&&void 0!==o?o:"",c=null!==(a=s.dataset.pulsePrimaryposition)&&void 0!==a?a:"";r.fetchAndRenderAd(s,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(s)})})(i,o,e,t,n),{rootMargin:"400% 0px"});o.forEach(e=>r.observe(e))},xn=[],Nn=(e,t)=>W(void 0,void 0,void 0,function*(){var n;const{pulse:i,tcf:o,deviceType:r,drEdition:a,publisher:s,pageType:d,country:l,isMobileApp:c}=e;if(!(yield ze(o,c,l,"handleDrEditionBackfill")))return;const u=((e,t)=>{var n;const{deviceType:i,placements:o,drEdition:{fallbackGlobalEditionName:r}={}}=e,a=o[i]||o.desktop,s=ge(t.targetId),d=a.find(e=>e.id===s),l=sn.some(e=>s.startsWith(e)),c=xn.includes(s),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||r;return d&&l&&!c&&u?(xn.push(s),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(e,t);if(!u)return;if(!(null==i?void 0:i.instance))return void ve("Pulse has not been passed as a prop, aborting");const v=yield On(),p=new Pn(v),g=$n({publisher:s,pageType:d,country:l},p,null==i?void 0:i.instance),m=document.getElementById(t.targetId);if(!m||!a)return;m.classList.value="";const h=document.createElement("div");h.className=a.containerSelector.replace(/^[.#:[\]]+/,""),m.innerHTML=h.outerHTML;const y={editionName:(null===(n=null==u?void 0:u.drEdition)||void 0===n?void 0:n.editionName)||"",drEditionConfig:a,device:r,tcf:o,isMobileApp:c,country:l,renderAsBackfill:!0};yield g.fetchAndRenderAd(m,y)}),jn="collapseAd",_n="hideAd",qn="resizeAd",Dn="renderDrEditionFallback",Mn="wallpaperImageUrl",Bn="wallpaperColor",Rn="velvet",Fn=[qn,Mn,Bn,jn,_n,Dn,Rn];let Vn;const zn=e=>{if("object"==typeof e)return e;if(t=e,Z.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:Mn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:Bn,wallpaperColor:t}}if(e.startsWith(Dn)){const t=e.split(":")[1];return{name:Dn,targetId:t}}if(e.startsWith(jn)||e.startsWith(_n)){const t=e.split(":")[1];return{name:jn,targetId:t}}if(e.includes("name")&&Fn.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},Un=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=zn(t);if(!n)return;if(!n.name||!Fn.some(e=>n.name===e))return;const{name:i,targetId:o,wallpaperImageUrl:r,wallpaperColor:a,cmd:s,size:d}=n;i===Rn&&s&&(s.includes("noScroll")&&(Vn=(e=>{if(!e)return()=>{};const t=e.style.overflow;return e.style.setProperty("overflow","hidden"),()=>{e.style.setProperty("overflow",t)}})(document.querySelector("body"))),(s.includes("close")||s.includes("ended"))&&(null==Vn||Vn(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),i!==jn&&i!==_n||!o||ee(o),i===qn&&o&&s&&an(o,s),i===Dn&&o&&(ee(o),Nn(U.get(),{targetId:o})),"resizeMediationAd"===i&&o&&d&&an(o,d,!0),i===Mn&&r&&(e=>{const t=document.querySelector(`.${J}`);t&&(t.style.backgroundImage=`url(${e})`)})(r),i===Bn&&a&&(e=>{const t=document.querySelector(`.${J}`);t&&(t.style.backgroundColor=e)})(a)},Hn=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),Wn=(e,t,n)=>{const i="true"===n.dataset.isFinnBlinkOnlyPlacement;return w(t)&&i?(ve(`loading finn blink ad for blink only placement for ${t}`),void ne().withFinnBlinkAd(t)):w(t)?(ve(`loading finn blink ad with full ads chain for ${t}`),void ne().withFullAdsChain(t)):void P(()=>(ve("core showTag",{id:t}),e.showTag(t)))},Kn=(e,t)=>W(void 0,void 0,void 0,function*(){yield L,yield x;const n=new IntersectionObserver((t,n)=>((e,t,n,i)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:o}=e,r=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(o),a=document.getElementById(r);ve("core log from intersection observer handler",{targetId:r,element:a}),n(window.apntag,r,i),a&&(t.unobserve(a),t.disconnect())})})(t,n,Wn,e),Hn(t));n.observe(e)}),Gn=new Map,Jn=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],Yn=".brandstudio-premium-content-widget",Qn=({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=Qn({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),Qt(i=t),i.innerHTML=""},Zn=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},ei=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=U.get(),i=Jn.includes(n)&&Boolean(t.closest(Yn));const o=i?t.closest(Yn):null,r=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,a=n&&t.matches("iframe, article")&&e;if(!n||!i&&!a||i&&!o)return;if(a)return Zn(e),void r.disconnect();const s=t.closest('[style*="height"]'),d=o;s&&d.contains(s)?Zn(s):d.hasAttribute("style")&&Zn(d),r.disconnect()})})});try{r.observe(t,{childList:!0,subtree:!0})}catch(e){r.disconnect()}},ti=(e,t,n,i,o,r)=>{var a;const s=performance.now(),d=null!==(a=Gn.get(t))&&void 0!==a?a:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,o)&&n<0;s-d>=o&&l&&(Gn.set(t,s),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&Xn({adWrapper:i,placementContainer:n}),P(()=>{e.setKeywords([t],{[`${We()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,r))},ni=(e,t,n)=>{const i=new IntersectionObserver((e,i)=>((e,t,n,i)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:o,boundingClientRect:r}=e;t(window.apntag,o.id,r.y,n,i,o)})})(e,ti,t,n),Hn(300));i.observe(e)},ii=(e,t=6)=>{const n=[];for(let i=0;i<e.length;i+=t){const o=e.slice(i,i+t);n.push(o)}return n},oi=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},ri=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=U.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),ci(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},ai=(e,t,n)=>{const i=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const o of i){const i=e.find(e=>{var t;return e.id===(null===(t=o.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),r=null==i?void 0:i.threshold;oi(o,r)&&i&&(Yt(i.id),n.length&&o.classList.remove(...n),ci([i],t))}},si=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=U.get();t&&(e.forEach(({id:e})=>{const t=di(e);t&&(t.dataset.bfCacheRefresh="true")}),i?((e,t)=>{document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&ai(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const i=()=>{window.scrollY>0&&(window.removeEventListener("scroll",i),ai(e,!1,t))};n.persisted&&(ye()?window.addEventListener("scroll",i,{passive:!0}):ai(e,!1,t))})})(e,n))},di=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},li=e=>{const{id:t,allowedFormats:n}=e,i=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(di(t)),o=(e=>1===e[0]&&1===e[1])(i),r={sizes:[i],allowedFormats:o?n:n.filter(e=>"native"!==e),allowSmallerSizes:!1};return o||(r.native=void 0),r},ci=(e,t=!1)=>{const{requestSize:n=V}=U.get(),i=e.map(({id:e})=>e),o=ii(i,n);if(t)for(const t of e){const e=li(t);window.apntag.modifyTag(t.id,e)}for(const e of o)P(()=>window.apntag.refresh(e))};const ui="#fff",vi="#0098da",pi="splash",gi="welcomePage",mi="topscroller",hi="velvet",yi="takeover-displayed",fi="takeover-visit-count",wi=14400,bi=()=>{const e=Oe(fi);return e?parseInt(e):0},Ei=()=>{const{takeover:{enabled:e=!1,secondVisitEnabled:t=!1}={}}=U.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||!(!e||(()=>{var e;const t=(null===(e=U.get().takeover)||void 0===e?void 0:e.cookieCapName)||yi;return"true"===Oe(t)})())&&(!t||Ti()))},Ti=()=>{const e=bi();return 0===e?((()=>{const e=bi(),{takeover:{cookieCapTime:t=wi}={}}=U.get(),n=document.location.hostname;window.document.cookie=`${fi}=${e+1}; max-age=${t}; domain=${n}; path=/`})(),!1):1===e},Ii=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),ki=()=>{const{takeover:e}=U.get();return Boolean(null==e?void 0:e.topscroller)},Si=()=>W(void 0,void 0,void 0,function*(){const e=document.location.hostname,{takeover:{cookieCapName:t=yi,cookieCapTime:n=wi}={},isMobileApp:i,tcf:o,country:r}=U.get(),a=yield ze(o,i,r,"ad-takeover-cookiecap");n&&a&&(window.document.cookie=`${t}=true; max-age=${n}; domain=${e}; path=/`)}),Ai=e=>{var t;const n=!!(null===(t=U.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return p(e)&&n},Ci=(e,t)=>{var n;if(t===mi){const{topscroller:t}=e;return null!=t?t:{}}if(t===pi){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},$i=(e,t)=>{t!==pi?(e=>{var t,n,i;const o=null===(n=null===(t=U.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,r=null===(i=U.get().takeover)||void 0===i?void 0:i.topscroller;if(!o||r)return;const a=document.querySelector(o),s=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),l=document.querySelector(".advertory-welcome-page-scroll");if(!(a&&s&&l&&d))return;const c=null==a?void 0:a.offsetHeight,u=g(e)?"60svh":`calc(100svh - ${c}px)`,v=g(e)?"calc(40svh + 30px)":`calc(${c}px + 30px)`;s.style.setProperty("height",u,"important"),d.style.setProperty("height",u,"important"),l.style.setProperty("bottom",v,"important")})(e):(e=>{var t;if(!(null===(t=U.get().takeover)||void 0===t?void 0:t.splash))return;const n=document.querySelector(".advertory-splash-navbar-wrapper"),i=document.querySelector(`#${e.targetId}`);if(!n||!i)return;const o=`calc(100svh - ${n.offsetHeight}px)`;i.style.setProperty("height",o,"important")})(e)},Oi=Ct([],()=>{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})}),Pi=(e,t=!0)=>{(e===gi||e===mi)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},Li=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},xi=e=>{document.body.style.overflow=e?"initial":"hidden"},Ni=e=>{const t=_i(e),n=ji(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),xi(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},ji=e=>{const t=()=>Ni(e);return window.addEventListener("advertory:closeTakeover",t),Li(),t},_i=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&Ni(e)};return Li(),window.addEventListener("keydown",t),t},qi=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(_i(e),ji(e),Li(),t.addEventListener("click",()=>{Ni(e)}),xi(!1))},Di=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),ji(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},Mi=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>Ni(e))})(e)},Bi=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=U.get(),n=e.querySelectorAll(".advertory-splash-navbar-wrapper"),i=document.querySelector(".advertory-takeover-label");Array.from(n).forEach(e=>e.style.display="flex"),t&&i&&(i.style.display="flex",i.innerText=Bt.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},Ri=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=Bt.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},Fi=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=Bt.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},Vi=e=>{const t=document.querySelector(".advertory-takeover-label");t&&(t.style.display="flex",t.innerText=Bt.se.adText,e.classList.toggle("advertory-impact-wrapper",!0))},zi=()=>{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)},Ui=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${Oi})()`,e+t.outerHTML})(e)),n},Hi=e=>{const t=(e=>{const{requests:t}=window.apntag,n=At(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,i=At(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ui(t))},Wi=e=>W(void 0,void 0,void 0,function*(){const{takeover:t}=U.get(),{targetId:n}=e,i=document.querySelector(`#${n}`),o=document.querySelector(".advertory-takeover-wrapper");if(!i||!o||!t)return;const a=(e=>{const{width:t,height:n}=e;return Ii(t,n)?pi:C(e,r)?hi:ki()?mi:gi})(e),s=o.offsetHeight,d=window.scrollY>s;o.style.display="block",!d&&Pi(a,!1),((e,t)=>{({[gi]:Fi,[pi]:Bi,[mi]:Ri,[hi]:Vi})[t](e)})(o,a),zi(),((e,t)=>{({[gi]:Di,[mi]:Di,[pi]:qi,[hi]:Mi})[t](e)})(o,a),((e,t,n)=>{if(!n)return;({[gi]:()=>{const{buttonLabel:i}=Ci(n,t);["#advertory-welcome-page-scroll-label","#advertory-welcome-page-scroll-image"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(n.innerText=null!=i?i:"")})},[pi]:()=>{const{themeColors:i,logotype:o,buttonLabel:r,showArrowIcon:a}=Ci(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!=r?r:""),".advertory-splash-close"===t&&a){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&&o&&(n.setAttribute("src",o.url),n.setAttribute("alt",o.alt)),".advertory-splash-navbar-wrapper"===t&&i){const{backgroundColor:e,color:t}=i;n.style.setProperty("background-color",null!=e?e:ui,"important"),n.style.color=null!=t?t:vi}}})},[mi]:()=>{const{buttonLabel:i,showArrowIcon:o,showCloseButton:r=!0}=Ci(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||r||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=i?i:""))})},[hi]:()=>{}})[t]()})(o,a,t),yield Si(),!d&&Pi(a,!0),$i(e,a)}),Ki="advertory-brandmetrics-survey",Gi=()=>W(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n,tcf:i}=U.get(),o=yield ze(i,n,t,"norstat");if(!e||n||!o)return;const r=(e=>{const{ppid1:t,ppid2:n}=ct.getPPIDs(),{ppid1:i,ppid2:o}=ut.getPPIDs(),r=(new lt).add(n,nt[e]).add(t,it[e]).add(o,ot[e]).add(i,rt[e]);return`${r.buildNorstatPath()}?${r.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{W(void 0,[e,t,...n],void 0,function*(e,t,n=!0){if(document.getElementById(t))return;const i=document.createElement("img");i.src=e,i.id=null!=t?t:"",n&&(i.style.display="none"),document.body.appendChild(i)})})(`https://sch-map.norstatsurveys.com/api/nids/${t===ke.NO?"schibsted":"schibstedse"}/map/${r}`,"norstat")}),Ji={nativeAd:e=>u(e)&&!y(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:v,fullscreenScroll:c,topscroller:e=>p(e)&&ki(),splash:e=>p(e)&&Ii(e.width,e.height),welcomePage:p,wallpaper:m,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:S,hFormat:A,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!A(e)&&!S(e),topboard:e=>e.targetId.startsWith("topboard")&&!p(e),widescreen:k,insider:e=>e.targetId.startsWith("insider"),sponsorstripe:y,brandboard:e=>f(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!I(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>b(e)||E(e),panorama:T,midboard:I},Yi=({adObj:e,preferredTestIdData:t})=>{var n,i;const o=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!o)return;const r=null===(i=document.querySelector(`#${o}`))||void 0===i?void 0:i.parentElement;if(!r)return;if(((e,t)=>{var n,i,o,r;const a=null===(r=null===(o=null===(i=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===i?void 0:i.tags)||void 0===o?void 0:o[e])||void 0===r?void 0:r.invCode;a&&(t.dataset.invCode=a)})(o,r),null==t?void 0:t.testId)return void(r.dataset.testid=t.testId);const a="DIV"===(null==r?void 0:r.tagName);e&&a&&((e,t)=>{var n,i;for(const[o,r]of Object.entries(Ji))if(r(e)){if("nativeAd"===o){const r="default";t.dataset.testid=`${o}-${null!==(i=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==i?i:r}`;break}t.dataset.testid=o;break}})(e,r)},Qi=e=>{var t;return(null===(t=Object.entries(Ji).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},Xi=(e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1},Zi=new Map;Zi.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),Zi.set("panorama",{scale:.79,transformOrigin:"center center"}),Zi.set("outstream",{scale:.79,transformOrigin:"center center"}),Zi.set("integration",{scale:.79,transformOrigin:"center center"}),Zi.set("toppanorama",{scale:.8,transformOrigin:"left center"});const eo=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 i=Qi(e),o=Zi.get(i),r=document.querySelector(`#${e.targetId}`);if(!r||!o)return;if(r.style.transformOrigin=o.transformOrigin,r.style.transform=`scale(${o.scale})`,!(null==o?void 0:o.cogwheelAdjust))return;const a=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),s=null==r?void 0:r.offsetWidth;a&&"number"==typeof s&&!isNaN(s)&&a.style.setProperty("right",String(-1*s*.2)+"px")},to=e=>{var n,i,o,r,a,s;const{adScaleConfig:d,deviceType:l}=U.get();if(!(null==d?void 0:d.enabled))return;if(C(e,t))return;const c=null!==(n=d.adsToBeScaled[l])&&void 0!==n?n:[],u=en(e.targetId.split("-")[0]);if(!c.includes(u))return;const v=null!==(o=null===(i=d.offset)||void 0===i?void 0:i[u])&&void 0!==o?o:0,p=document.getElementById(e.targetId),g=null!==(r=null==p?void 0:p.offsetWidth)&&void 0!==r?r:window.screen.width,m=null!==(s=null===(a=null==p?void 0:p.parentElement)||void 0===a?void 0:a.offsetWidth)&&void 0!==s?s:window.screen.width;((e,t=window.screen.width)=>{const n=Xi(e,t),i=document.querySelector(`iframe[id^="utif_${e.targetId}"]`);i&&(i.style.transform=`scale(${n})`,i.style.transformOrigin="left top")})(e,(g<m?g:m)-v)},no=(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,io=e=>`externalImpId:'${e}'`,oo=e=>{var t;const{forwardExternalImpId:n=!1,tracker:i}=U.get(),o=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${Ke()}-count`],i=e.positionConfig.find(e=>e.adPositionIndex===n);if(!i)return e;const o=i.keywords?Object.assign(Object.assign({},e.keywords),i.keywords):e.keywords;return Object.assign(Object.assign({},e),{sizes:null!==(t=null==i?void 0:i.sizes)&&void 0!==t?t:e.sizes,keywords:o})})(e),{id:r,sizes:a,keywords:s,allowedFormats:d,invCode:l,ssa:c=!1,nativeCustomProperties:u,safeframeConfig:v,dynamicSizeWidthCheck:p=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Ei())return e;const n=null===(t=e.keywords)||void 0===t?void 0:t["no-sno-adformat"],i=null==n?void 0:n.filter(e=>e!==mi),o=Object.assign(Object.assign({},e.keywords),n&&{"no-sno-adformat":i}),r=e.sizes.filter(([e,t])=>4!==e||4!==t);return Object.assign(Object.assign({},e),{sizes:r,keywords:o})})(o),g=Object.assign({invCode:l,sizes:a,targetId:r,keywords:no(s,c),allowedFormats:d,dynamicSizeWidthCheck:p},v&&{safeframeConfig:v}),m=(e=>{var t,n,i,o,r,a,s;return e?(null===(t=null==e?void 0:e.instance)||void 0===t?void 0:t.state)?(null===(i=null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)||void 0===i?void 0:i.pageViewId)?(ve("Tracker state pageViewId is:",null===(r=null===(o=null==e?void 0:e.instance)||void 0===o?void 0:o.state)||void 0===r?void 0:r.pageViewId),null===(s=null===(a=null==e?void 0:e.instance)||void 0===a?void 0:a.state)||void 0===s?void 0:s.pageViewId):(ve("Tracker state does not contain field pageViewId or it is empty"),""):(ve("Tracker state is empty"),""):(ve("Tracker is not configured in initAdvertory function"),"")})(i);n&&m&&(ve("External Impression ID assigned to defineTag:",io(m)),g.externalImpId=io(m));const h=(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,i])=>((null==e?void 0:e.includes(n))&&(t[n]=i),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}}))(u);return(null===(t=e.allowedFormats)||void 0===t?void 0:t.includes("native"))&&(g.native=h),g},ro=e=>!e.includes("takeover")||Ei(),ao=e=>{const{publisher:t=""}=U.get(),n=document.querySelector(`#${e}`);if(!n)return;const i=`-${t}`;n.classList.remove(`advertory${i}-finn-blink`),n.classList.remove(`advertory${i}-finn-blink-wrapper`)},so=e=>{if(!e)return e;const t=e[`${We()}-targetid`],n=t?ge(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${We()}-targetid`]:[n]})},lo=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${We()}-geo`]&&{[`${We()}-geo`]:["geo-test-value"]}),e[`${We()}-geofence`]&&{[`${We()}-geofence`]:["geofence-test-value"]}),e[`${We()}-weather`]&&{[`${We()}-weather`]:["weather-test-value"]}),co=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 i=n.split(",")[0].split(":")[0],o=e.find(e=>e.invCode===i),r=document.querySelector(`[id^=${null==o?void 0:o.id}]`);r&&r.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"})})()},uo=(e,t)=>W(void 0,void 0,void 0,function*(){return yield new Promise(t=>{e().then(e=>{t(null!=e?e:null)}).catch(e=>{t(null)})})}),vo={arrayMerge:(e,t)=>t},po=e=>W(void 0,void 0,void 0,function*(){if(!(e=>{const{editableConfiguration:{useS3Config:t=!1,pageTypeToFetch:n}={},siteSpecificConfig:i}=e;return Boolean(t&&n&&(null==i?void 0:i.publisherClassName))})(e))return e;try{const t=yield(e=>W(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,i=setTimeout(()=>n.abort(),5e3);try{return yield et.get(t,{method:"GET",signal:n.signal})}catch(e){throw ve("Failed to fetch S3 config",{error:e,url:t}),e}finally{clearTimeout(i)}}))(e);return t?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:i,refresh:o,placements:r,threshold:a,batchSize:s}=t,d=B.all([e.placements,r],vo),l=B(e.pageOptions,{keywords:i},vo),c=B(e.appearanceConfig,{defaultThreshold:a},vo),u=B(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:o},vo);return Object.assign(Object.assign({},e),{placements:d,requestSize:null!=s?s:e.requestSize,pageOptions:l,appearanceConfig:c,refreshConfig:u})})({siteConfig:e,configOverrides:t}):e}catch(t){return ve("Error fetching S3 config, using site config",{error:t}),e}}),go=".advertory-right-column-track",mo="--advertory-right-column-track-height",ho=e=>e.getBoundingClientRect().top+window.scrollY,yo=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},fo=(e,t)=>{const n=(i=t,`${Math.max(0,Math.round(i))}px`);var i;document.body.style.setProperty(e,n)},wo=(e,t)=>`${e}-${t}`,bo=(e,t,n)=>{var i;const o=Array.from(null!==(i=e.querySelectorAll(t))&&void 0!==i?i:[]),r=(e=>e.map(e=>{var t;return null===(t=document.querySelector(`[id^="${e}"]`))||void 0===t?void 0:t.parentElement}).map((e,t)=>({point:e,originalIndex:t})).filter(e=>Boolean(e.point)))(n);if(0===r.length)return;const a=ho(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=yo(e);fo("--advertory-newsroom-header-height",t)})(),r.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const i=ho(e),o=wo(mo,t),r=i-n,a=wo("--advertory-right-column-split-point-height",t),s=yo(e);fo(o,r),fo(a,s)})(e,t+1,a),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=wo("--advertory-right-column-ad-height",t),i=yo(e);fo(n,i)})(o[t])});((e,t)=>{const n=ho(e);fo(mo,n-t)})(r[Math.min(o.length,r.length-1)].point,a)};let Eo=!1;class To{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:i,pathname:o}=new URL(n);if(!i.includes("www.vg.no")&&!o.includes("annonsorinnhold"))return[n];const r=o.split("/");return r.length?[...r.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Io{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class ko{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){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()||""}getEventTarget(e){const{url:t,title:n,itemId:i}=this.parseKilkayaData(e);return{id:i,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e){return W(this,void 0,void 0,function*(){var t,n,i,o,r,a,s,d,l;const c=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:null===(t=this.parseKilkayaData(e))||void 0===t?void 0:t.placement}});if(window.dispatchEvent(c),!this.pulse)return;const u=this.getEventInput(e,"view");(null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)?null===(o=null===(i=this.pulse)||void 0===i?void 0:i.trackLegacyViewUIElement)||void 0===o||o.call(i,u):(null===(r=this.pulse)||void 0===r?void 0:r.trackViewUIElement)?null===(s=null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)||void 0===s||s.call(a,u):null===(l=null===(d=this.pulse)||void 0===d?void 0:d.trackElementView)||void 0===l||l.call(d,u)})}trackContentClick(e){return W(this,void 0,void 0,function*(){var t,n,i,o,r,a;if(!this.pulse)return;const s=this.getEventInput(e,"click");this.pulse.trackLegacyClickUIElement?null===(n=(t=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(t,s):this.pulse.trackClickUIElement?null===(o=(i=this.pulse).trackClickUIElement)||void 0===o||o.call(i,s):null===(a=(r=this.pulse).trackElementClick)||void 0===a||a.call(r,s)})}}class So extends ko{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,i,o,r,a;const{clientName:s,creativeId:d,itemId:l,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),v=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(o=null===(i=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===i?void 0:i.call(n))&&void 0!==o?o:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:s,creativeId:null!=d?d:l},page:{"@id":null!=v?v:c,"@type":u,url:location.origin},tags:null===(a=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getTags)||void 0===a?void 0:a.call(r,e)}}getEventTarget(e){const{link:t,itemId:n,title:i}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=i?i:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const Ao="[data-k5a-teaser-analytics]",Co=(e,t,n)=>{const i=document.querySelectorAll("k5a-stream");if(!i.length)return;const o=new So(e,t,n),r=new WeakMap,a=e=>{const t=r.get(e);t&&(t.disconnect(),r.delete(e))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,i=n.querySelector(Ao);Boolean(null==i?void 0:i.dataset.k5aTeaserAnalytics)?(o.trackContentView(n),t.unobserve(e.target),a(n)):((e,t)=>{if(r.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(Ao);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(o.trackContentView(e),t.unobserve(e),a(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),r.set(e,n)})(n,t)})},{threshold:.5});i.forEach(e=>{s.observe(e),e.addEventListener("click",()=>o.trackContentClick(e))})};class $o{handleKilkayaStreamTracking({pulse:e,pageType:t,publisher:n}){if(!(null==e?void 0:e.instance))return;const i={[ft.VG]:new To}[n]||new Io;Co(e.instance,i,t)}injectKilkayaMeta(e){const t=document.createElement("script");t.textContent=`var k5aMeta = { consent: ${e} };`,document.head.appendChild(t)}observeForKilkayaBackfills(){document.addEventListener("K5A:EmptyStreamSlot",e=>{var t;const n=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.streamSlot;if(!n)return;const i=n.parentElement;i&&(ve(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(i))})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";te(i)}loadKilkayaScript(e){return W(this,void 0,void 0,function*(){yield kt(e)})}run(e){return W(this,void 0,void 0,function*(){const{tcf:t,isMobileApp:n,country:i,kilkaya:o}=e;if(!(null==o?void 0:o.enabled))return;const r=yield ze(t,n,i,"kilkaya");r&&(this.observeForKilkayaBackfills(),this.injectKilkayaMeta(r),yield this.loadKilkayaScript(o.url),this.handleKilkayaStreamTracking(e))})}}const Oo=1e4,Po=e=>e.some(e=>e.some(e=>!!e&&oi(e,0))),Lo=()=>{const{widescreenSwitching:e}=U.get(),{enabled:t,rotationInterval:n=Oo,widescreenIdPrefix:i}=null!=e?e:{};if(!t)return;const o=((e="widescreen")=>{const{pageSectionsSelectors:{right:t}={}}=U.get();return t?Array.from(document.querySelectorAll(t)).map(t=>Array.from(t.querySelectorAll(`div[id^="${e}"]`))):[]})(i);let r=0,a=Date.now(),s=Po(o);if(!o.length)return;const d=(e,t,n)=>{e.forEach(e=>{e&&e.style.setProperty(t,n)})},l=e=>1===e?0:1;(e=>{e.forEach(e=>{e[0]&&(e[0].style.display="block"),e[1]&&(e[1].style.display="none")})})(o);const c=((e,t)=>{let n=null;return(...i)=>{null===n&&(e(...i),n=setTimeout(()=>{n=null},t))}})(()=>{s||(s=Po(o)||s,a=Date.now());Date.now()-a>=n&&((()=>{const e=l(r),t=o.map(e=>e[r]),n=o.map(t=>t[e]);d(t,"opacity","0"),setTimeout(()=>{d(t,"display","none"),d(n,"opacity","0"),d(n,"display","block"),setTimeout(()=>{d(n,"opacity","1")},450)},450)})(),r=l(r),a=Date.now())},1e3);window.addEventListener("scroll",c)},xo={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return ve(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,t)=>{try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ve(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){ve(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},No="finn_blink_id",jo=e=>W(void 0,void 0,void 0,function*(){const{id:t,hashed_email:n,theme:i}=e,o=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}(e,["id","hashed_email","theme"]),r=window[ie.Blink];if(!r)return;const a=new r({remote:"https://www.finn.no/distribution-front/external/carousel",id:t,hashed_email:n,theme:i});yield a.inject(o)}),_o=e=>{var t,n;const i=document.querySelector(`[id^="${e}"]`);return null!==(n=null===(t=null==i?void 0:i.dataset)||void 0===t?void 0:t.finnBlinkId)&&void 0!==n?n:e},qo=(e,t)=>{const{finnBlink:{enabled:n}={}}=U.get(),i=(null==t?void 0:t.enabled)||(e=>{var t;const n=document.querySelector(`[id^="${e}"]`);return!!(null===(t=null==n?void 0:n.dataset)||void 0===t?void 0:t.noBidAd)})(e);if(!i||!n)return null;const{limit:o,height:r,requireImage:a,theme:s,rec:d,distributionTypes:l,position:c,offset:u,advertoryTheme:v}=t||{};return{selector:`#${_o(e)}`,enabled:i,position:null!=c?c:e,distributionTypes:null!=l?l:[],limit:null!=o?o:100,height:null!=r?r:100,offset:null!=u?u:200,requireImage:a,rec:d,theme:"dark"===s?"dark":"light",advertoryTheme:v}},Do=(e,t,n)=>W(void 0,void 0,void 0,function*(){const{placements:i,deviceType:o}=U.get();ve(`rendering finn blink ad for ${e}`);const r=ge(e),a=i[o].find(e=>e.id===r),s=qo(e,null==a?void 0:a.finnBlink),{publisher:d,country:l,finnBlink:c}=t,{userId:u,uuid:v,channel:p,theme:g}=null!=c?c:{},m=null!=p?p:`${d}.${l}`,h=(e=>{if(!e){const e=Pe();return null!=e?e:""}return e})(u),y="dark"===g?"dark":"light";if(!(null==s?void 0:s.enabled))return ve(`Finn blink is not enabled on placement: ${e}`),n&&n(e),void ao(e);if((e=>{var t;const n=_o(e),i=document.querySelector(`[id^="${n}"]`);return!!(null===(t=null==i?void 0:i.classList)||void 0===t?void 0:t.contains("finn"))})(e))ve(`Finn blink already loaded ${e}`);else try{const e=yield W(void 0,void 0,void 0,function*(){const{finnBlink:{identifierUrl:e}={}}=U.get(),t=xo.get(No),n=Te("finncode");if(!e||n)return"";if(!t){const t=yield et.get(e,{credentials:"include"}),{finn_blink_id:n}=t;if(!n)throw new Error("getFinnBlinkIdentifier: No finn_blink_id found");return xo.set(No,n),n}return t});yield jo(Object.assign(Object.assign({},s),{hashed_email:e,channel:m,id:h,theme:y,uuid:v})).then(()=>{((e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={},pageType:i}=U.get(),o=document.querySelector(`#${e}`);if(!o)return;if(o.classList.add("disable-cogwheel"),!n)return;se(n,o,ce,null!=t?t:i),Yi({preferredTestIdData:{targetId:e,testId:"finn"}})})(s.selector.replace("#",""),s.advertoryTheme)})}catch(t){ve(`Finn blink error ${t}`),n&&n(e),!n&&ee(e),ao(e)}}),Mo=e=>document.querySelector(`#${e}`);let Bo,Ro=[];const Fo=["takeover","wallpaper"],Vo=e=>{const t=(e=>{const t=G.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:o,glimr:r,appearanceConfig:a,requestSize:s=V,publisher:d,country:l,pageType:c,deviceType:u,isMobileApp:v=!1,pageOptions:{member:p},takeover:g,fullscreenScroll:m,useAppTabletInvCode:h}=e;return{xandr:{member:p,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:d,country:l,pageType:c,deviceType:u,placements:i,tcf:o,requestSize:s,isMobileApp:v,useAppTabletInvCode:h},r&&{glimr:r}),n&&{queryConfig:n}),a&&{appearanceConfig:a}),g&&{takeover:g}),m&&{fullscreenScroll:m})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},zo=()=>W(void 0,void 0,void 0,function*(){const{pageOptions:e}=U.get(),{preparePageOptions:t}=U.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=U.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"]}})(),i=yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();return(yield ze(e,t,n,"page-options"))?{}:{userSync:{disabled:!0}}}),o=yield t(Object.assign(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},e),{renderingManagement:Object.assign({},n)}),i));(e=>{const t=G.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=lo(e);G.setData("alertoryConfigKeywords",n)})(o.keywords),P(()=>Bo.setPageOpts(o))}),Uo=e=>W(void 0,void 0,void 0,function*(){const{prebid:t,tcf:n,isMobileApp:i,country:o}=U.get();Ho(e);const r=yield ze(n,i,o,"prebid");(null==t?void 0:t.enabled)&&r?(ve("core loadPlacements prebid enabled"),yield Wt()):(ve("core load tags invoked without prebid enabled"),Wo(e))}),Ho=e=>{const{prepareTag:t}=U.getHandlers(),n=[];(e=>{const t=["skyscraperright_1","topboard","wallpaper","skyscraperleft_1"];return e.sort((e,n)=>{const i=t.findIndex(t=>e.id.includes(t)),o=t.findIndex(e=>n.id.includes(e));return-1!==i&&-1===o?-1:-1===i&&-1!==o?1:i-o})})(e).forEach(e=>{ve("core defineTags",{placement:e});const i=oo(e);if(ro(e.id)){const o=t(i),r=(e=>{const{allowedFormats:t,invCode:n,keywords:i,sizes:o}=e;return{adTypes:t,invCode:n,keywords:so(i),sizes:o}})(o);n.push(r),P(()=>(ve("core defineTag - add to the queue",{placement:e,preparedTag:o}),Bo.defineTag(o)))}}),(e=>{var t,n,i;(null===(i=null===(n=null===(t=window.advertory)||void 0===t?void 0:t.alertoryConfig)||void 0===n?void 0:n.xandr)||void 0===i?void 0:i.tags)&&e.length&&window.advertory.alertoryConfig.xandr.tags.push(e)})(n)},Wo=e=>{const t=e.filter(({id:e})=>ro(e)).map(({id:e})=>e);t.length&&P(()=>(ve("core loadTags",{placementsIdsToLoad:t}),Bo.loadTags([...t])))},Ko=(e,t)=>W(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:i}=U.get(),{threshold:o,refresh:r}=e,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),s=null==n?void 0:n.defaultThreshold[i];a&&(ve("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:o,deviceDefaultThreshold:s}),yield Kn(a,null!=o?o:s)),a&&r&&(ve("core showAd - setup refreshing",{placement:e,adObj:t}),a.dataset.refresh=r.toString())}),Go=e=>e.some(({id:e})=>Fo.some(t=>e.includes(t))),Jo=e=>W(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,i]=(e=>e.reduce(([e,t],n)=>{var i;return(null===(i=null==n?void 0:n.finnBlink)||void 0===i?void 0:i.loadOnlyFinnBlink)?[[...e,n],t]:[e,[...t,n]]},[[],[]]))(e),o=(e=>{const{requestSize:t=V,queryConfig:{placementBatches:n}={},deviceType:i}=U.get(),o=rn(e),r=Object.keys((null==n?void 0:n[i])||{}).map(e=>o[e]||[]).filter(e=>e.length>0),a=new Set(r.flat().map(({id:e})=>e)),s=e.filter(({id:e})=>!a.has(e));return[...r,...ii(s,t)]})(i);for(const e of o)Go(e)?(ve("core loadAds without lazy loading",{placementsToLoad:e}),yield Uo(e)):e.length&&(ve("core loadAds with lazy loading",{placementsToLoad:e}),yield Yo(e));yield(e=>W(void 0,void 0,void 0,function*(){if(!e.length)return;const{appearanceConfig:t,deviceType:n}=U.get(),i=null==t?void 0:t.defaultThreshold[n];for(const t of e){const{threshold:e,id:n}=t,o=Mo(n);o&&(yield Kn(o,null!=e?e:i))}}))(n)}),Yo=e=>W(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=U.get(),i=[];if(!t)return ve("lazy load is not enabled",{placements:e}),void(yield Uo(e));const o=new IntersectionObserver((t,n)=>{t.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(t=>{ve("lazy load is enabled - handler start",{loadedPlacementIds:i,placements:e});const o=e.every(e=>i.includes(e.id)),r=e.map(e=>e.id);!o&&i.push(...r),!o&&Uo(e),ve("lazy load is enabled - handler stop",{loadedPlacementIds:i,placements:e,arePlacementsLoaded:o,placementIds:r}),n.disconnect()})},{rootMargin:n});e.forEach(e=>{const t=document.getElementById(e.id);t&&(ve("lazy loading - observe element",{placementId:e.id,element:t}),o.observe(t))})}),Qo=()=>W(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:t,wallpaperHandlers:{initWallpaperAd:i,adjustAdToHorseshoe:o}}=U.getHandlers(),{wallpaper:r,fullscreenScroll:a}=U.get(),s=[];P(()=>{Bo.onEvent("adRequested",()=>{e.adRequested()}),Bo.onEvent("adAvailable",n=>W(void 0,void 0,void 0,function*(){var o,s,d,l,v,g;ve("core adAvailable start",{placementsAvailable:Ro,adObj:n,isFullscreenScrollAd:c(n),isFinnBlink:w(n.targetId),isNativeAd:u(n),isMediation:fe(n),isTakeoverAd:p(n),isCollapseAd:h(n),isWallpaperAd:m(n)});const y=null===(d=null===(s=null===(o=null===window||void 0===window?void 0:window.apntag)||void 0===o?void 0:o.requests)||void 0===s?void 0:s.tags[n.targetId])||void 0===d?void 0:d.adResponse.ads;fe(n)&&y&&(null===(l=y[1])||void 0===l?void 0:l.rtb)&&(n.banner=null===(g=null===(v=y[1])||void 0===v?void 0:v.rtb)||void 0===g?void 0:g.banner),c(n)&&Ht(n),k(n)&&Lo(),c(n)&&!w(n.targetId)&&Ut(n,a),!u(n)||fe(n)||w(n.targetId)||t(n,U.get()),p(n)&&!h(n)&&(Hi(n.targetId),yield Wi(n)),m(n)&&(i(()=>P(()=>window.apntag.showTag(n.targetId)),r),G.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(n)&&G.setData("horseshoe",{isAvailable:!0}),Yi({adObj:n}),(e=>{var t;const n=null==e?void 0:e.targetId;if(!n)return;const i=null===(t=document.querySelector(`#${n}`))||void 0===t?void 0:t.parentElement;i&&((e,t)=>{const{height:n,width:i,native:o}=e;o?t.dataset.adSizes="[1,1]":n&&i&&(t.dataset.adSizes=`[${i},${n}]`)})(e,i)})(n),e.adAvailable(n);const f=Ro.find(({id:e})=>e===n.targetId);f&&(yield Ko(f,n),Ro=Ro.filter(e=>e.id!==f.id)),ve("core adAvailable stop",{placementsAvailable:Ro,adObj:n,isFullscreenScrollAd:c(n),isFinnBlink:w(n.targetId),isNativeAd:u(n),isMediation:fe(n),isTakeoverAd:p(n),isCollapseAd:h(n),isWallpaperAd:m(n)})})),Bo.onEvent("adLoaded",i=>{const{refreshConfig:r,appearanceConfig:a}=U.get(),d=document.getElementById(i.targetId);w(i.targetId)&&(e=>{const{fullscreenScroll:t}=U.get(),{initNativeAd:n}=U.getHandlers();c(e)&&Ut(e,t),u(e)&&n(e,U.get())})(i);s.includes(i.targetId)&&u(i)&&(t(i,U.get()),Yi({adObj:i})),!s.includes(i.targetId)&&fe(i)&&s.push(i.targetId),h(i)&&ee(i.targetId),p(i)&&((e,t)=>{var n;const i="100%",o="100%";e.resizeAd(t,[i,o]);const r=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!r)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(r),t=e.width,n=e.height;t===i&&n===o||(r.style.width=i,r.style.height=o)}}).observe(r,{attributes:!0,attributeFilter:["style"]})})(Bo,i.targetId),v(i)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=U.get();if(!t||!n||!i)return;const o=t.parentElement;o&&(t.classList.add(`advertory-${n}-${i}__full-width-ad`),o.classList.add(`advertory-${n}-${i}-wrapper__full-width-ad`))})(i),(e=>C(e,n))(i)&&(e=>{var t;const n=document.querySelector(`#${e.targetId}`),i=null===(t=document.querySelector(`#${e.targetId}`))||void 0===t?void 0:t.parentElement,o=null==n?void 0:n.querySelector("iframe"),r=null==o?void 0:o.parentElement,{siteSpecificConfig:{publisherClassName:a,fullWidthFormatClassName:s}={}}=U.get();if(!(n&&o&&r&&i))return;i.classList.add(`advertory-${a}-${s}__vertical-full-width-ad-wrapper`);const d=window.innerWidth,l=Math.round(d/1080*1920);n.style.width="100%",n.style.height=`${l}px`,n.classList.add(`advertory-${a}-${s}__vertical-full-width-ad`);const c=Xi(e,n.offsetWidth);r.style.transform=`scale(${c})`,r.style.transformOrigin="left top"})(i),((e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,i=document.querySelector(`#${n}`),o=null==i?void 0:i.parentElement;if(!o||!i)return;ei({adWrapper:o,placementContainer:i});const{delayTime:r=1e3}=t,a=(new Date).getTime();i&&"true"!==i.dataset.subscribedForRefresh&&(i.dataset.subscribedForRefresh="true",i.dataset.refresh&&ni(i,a,r))})(i,r),(null==a?void 0:a.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(i.targetId);var l,g;G.getData("horseshoe").isAvailable&&o(i.targetId),to(i),e.adLoaded(i),l=i.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${l}`)&&(null===(g=window.gdpr)||void 0===g?void 0:g.setupButton)&&window.gdpr.setupButton(l),d&&(d.classList.add("ad-loaded"),(e=>{var t;const{siteSpecificConfig:n}=U.get(),i=null!==(t=null==n?void 0:n.mainColumnWidth)&&void 0!==t?t:1/0;e.clientWidth>i&&e.setAttribute("data-two-column-ad-layout","true")})(d)),eo(i),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:i.targetId,adFormat:Qi(i)}}))}),Bo.onEvent("adNoBid",t=>W(void 0,void 0,void 0,function*(){ee(t.targetId),yield Nn(U.get(),t),Ai(t)&&(yield Si()),e.adNoBid(t)})),Bo.onEvent("adError",(t,n)=>W(void 0,void 0,void 0,function*(){Ai(n)&&(yield Si()),e.adError(t,n)})),Bo.onEvent("adCollapse",()=>{e.adCollapse()}),Bo.onEvent("adRequestFailure",t=>{ee(t.targetId),e.adRequestFailure(t)}),Bo.onEvent("adBadRequest",t=>{ee(t.targetId),e.adBadRequest(t)}),Bo.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),Bo.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),Xo=(e,t)=>W(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:i,reloadExistingAds:o,renderFinnBlinkPlacements:r,contextSelector:a}=null!=t?t:{};if(i)return Xt(),[];o&&(Xt(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{te(e.id)})),H(null!=e?e:{}),yield zo();let s=nn(a);return r&&(s=s.filter(e=>w(e.id))),s.length>0&&(Ro=[...Ro,...s.map(e=>Object.assign({},e))],ri(s),si(s),yield Jo(s)),Ro}),Zo=(e,t)=>W(void 0,void 0,void 0,function*(){var n;U.set(e),U.setHandlers(t),G.initialize(),window.addEventListener("message",Un,!1),Bo=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=Bo,ve("Apn tag is set up on window"),yield Promise.allSettled([W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();(yield ze(e,t,n,"xandr-endpoint"))||Bo.setEndpoint("ib.adnxs-simple.com",!0)}),W(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n,country:i}=U.get(),o=yield ze(t,n,i,"prebid");(null==e?void 0:e.enabled)&&o&&(yield kt(null==e?void 0:e.url))}),vt(e),W(void 0,void 0,void 0,function*(){const{astUrl:e}=U.get();yield kt(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),W(void 0,void 0,void 0,function*(){const{gptUrl:e,tcf:t,isMobileApp:n,country:i}=U.get();(yield ze(t,n,i,"gpt-endpoint"))&&(yield kt(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js"))}),W(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:i,country:o}=U.get(),{getConsentAsync:r}=$e(n,i,o),a=yield r();if(e&&t&&a){if(yield kt(t),document.querySelector(`.${Ki}`))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(Ki)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),He(),W(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=U.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield kt(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield Gi(),ve("Libraries have been loaded and trackers have been set"),yield(n=t.librariesToLoad,W(void 0,void 0,void 0,function*(){const e=n.map(e=>kt(e));yield Promise.all(e)})),yield Qo(),yield zo(),ve("Page options have been set"),Vo(e),ve("Advertory is setup on window"),Ro=nn(),ri(Ro),si(Ro),yield Jo(Ro),ve("Ads has been loaded",Ro),co(Ro),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>W(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;if(!(yield ze(e.tcf,e.isMobileApp,e.country,"handleDrEdition")))return;const n=yield On(),i=new Pn(n);Ln({publisher:e.publisher,drEditionConfig:e.drEdition,device:e.deviceType,pageType:e.pageType,country:e.country},i,null===(t=e.pulse)||void 0===t?void 0:t.instance)}))(e),(e=>{if(!(null==e?void 0:e.enabled)||Eo)return;const{splitPointIDs:t,adSelector:n,trackSelector:i=go}=e,o=document.querySelector(i);if(!o)return;Eo=!0;const r=()=>{bo(o,n,t)};r(),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),window.addEventListener("load",r),window.addEventListener("advertory:adLoaded",()=>{requestAnimationFrame(r)}),new ResizeObserver(r).observe(o)})(e.rightColumnSplit),yield(e=>W(void 0,void 0,void 0,function*(){const t=new $o;yield t.run(e)}))(e)}),er=(e,t)=>W(void 0,void 0,void 0,function*(){yield((e,t)=>W(void 0,void 0,void 0,function*(){const{initConsentManager:n,getConsentAsync:i}=$e(e.tcf,e.isMobileApp,e.country),o=yield po(e);yield pe(),yield uo(n),yield uo(i),ve("TCF resolved successfully"),yield Zo(o,t),ve("Run function resolved successfully")}))(e,t)}),tr="native_override_desc2",nr=(e,t,n)=>{var i;const{image:o,icon:r,sponsoredBy:a,title:s,clickUrl:d,cta:l,body:c,desc2:u,video:v,description:p,customTitle1:g,customTitle2:m,customTitle3:h,customTitle4:y,customIcon2:f}=e,w=(e,t="")=>{var n;return e?null!==(n=e.url)&&void 0!==n?n:e:t};return Object.assign({containerId:n,img:w(o),imgWidth:null==o?void 0:o.width,imgHeight:null==o?void 0:o.height,imgAltText:null!=s?s:"",logo:w(r),sponsoredBy:null!=a?a:"",title:null!=s?s:"",url:null!=d?d:"",cta:null!=l?l:"",description:null!==(i=null!=c?c:p)&&void 0!==i?i:"",desc2:null!=u?u:"",video:v,customTitle1:null!=g?g:"",customTitle2:null!=m?m:"",customTitle3:null!=h?h:"",customTitle4:null!=y?y:"",logo2:w(f)},t)},ir=(e,t)=>{const n=(i=tr,window.location.href.includes(i));var i;const o=new URLSearchParams(window.location.search).get(tr),r=t.includes("native_recirc");return n&&o?o:(null==e?void 0:e.includes("recirc"))?r?"native_recirc":"recirc":(null==e?void 0:e.includes("sponsor"))?"sponsorstripe":null},or=(e,t)=>{const n=document.querySelector(`#${t}`);if(n)for(const t of Object.keys(e))n.style.setProperty(t,e[t])},rr=(e,t,n,i)=>{const o=document.querySelector(`#${e}`);o&&t&&(o.innerHTML=t,((e,t)=>{const n=e.parentElement,{publisher:i,pageType:o}=t,r=i&&Object.values(ft).includes(i);n&&r&&se(i,e,ue,o)})(o,n),i())},ar=e=>{var t;const n=document.querySelector(`#${e.targetId}`);if(!n||!(null===(t=e.native)||void 0===t?void 0:t.clickTrackers))return;(null==n?void 0:n.querySelectorAll("a.ad-link")).forEach(t=>{"true"!==t.dataset.tracked&&(t.addEventListener("click",()=>{var t,n;for(const i of null!==(n=null===(t=e.native)||void 0===t?void 0:t.clickTrackers)&&void 0!==n?n:[])cr(i)}),t.dataset.tracked="true")})},sr=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(lr):window.apntag.fireImpressionTrackers(e);const n=new CustomEvent("advertory:nativeImpression",{detail:{ad:e}});window.dispatchEvent(n)},dr=(e,t)=>{var n;let i=!1;const o=document.querySelector(`#${e.targetId}`);if(!o||!e.native)return;const{deviceType:r,appearanceConfig:a,nativeTrackingConfig:{fireImpressionsBasedOnAppearanceThreshold:s=!1}={}}=t,d=s?{rootMargin:`${l=null!==(n=null==a?void 0:a.defaultThreshold[null!=r?r:de.DESKTOP])&&void 0!==n?n:0}px 0px ${l}px 0px`}:{};var l;const c=new IntersectionObserver(t=>{if(!i)for(const n of t)if(n.isIntersecting){i=!0,sr(e),c.disconnect();break}},d);c.observe(o)},lr=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?cr(e):window.navigator.sendBeacon(e)},cr=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},ur=(e,t,n)=>{const i=((e,t,n)=>{var i;const{displayTemplates:o,videoTemplates:r}=n,a="default";if(!e.native)return null;const{native:s,targetId:d}=e,{desc2:l=a}=e.native,c=l.toLowerCase(),u=null!==(i=ir(e.targetId,l))&&void 0!==i?i:c,v=Bt[t.language||ke.NO],p=nr(s,v,d);return(s.video?r[u]:o[u]||o.default)(p,t)})(e,t,n);rr(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{ar(e),dr(e,t)})(e,t)})},vr="viewable",pr="adClick";var gr=e=>(t,n,i)=>{const{video:o,img:r,url:a}=t,{publisher:s,productTag:d}=n,{pluginsNames:l,videoLoop:c}=i||{};if(!(null==o?void 0:o.content))return null;const u=Math.ceil(1e5*Math.random()),v=r||"https://custom.inventory.schibsted.io/1x1-00000000.png",p=`ad-player-${u}`,g=mr(o.content,a),m=hr({id:u,nodeId:p,poster:v,tagURL:g,publisher:s,productTag:d,videoLoop:c});return yr({playerConfig:m,clickUrl:a,pluginsNames:l}),`${e(t,n,p)}`};const mr=(e,t)=>{const n=(new DOMParser).parseFromString(e,"text/xml"),i=n.querySelector("ClickThrough"),o=n.querySelector("VideoClicks");if(i){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(n.createCDATASection(t))}else if(o){const e=n.createElement("ClickThrough");e.appendChild(n.createCDATASection(t)),o.appendChild(e)}return URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(n)],{type:"text/xml"}))},hr=({id:e,nodeId:t,poster:n,tagURL:i,publisher:o="",productTag:r="xandr",videoLoop:a=!1})=>({id:e,poster:n,vendor:"appnexus",node:t,mute:!0,autoplay:a,repeat:a,skin:{name:"inventory-player",url:"https://ads.inventory.schibsted.io/styles/player.css"},settings:{jw:{stretching:"fill",advertising:{client:"vast",tag:i}}},pulse:{provider:o.toLowerCase(),decorator:e=>Object.assign(Object.assign({},Sn(e)?e:{}),{provider:Object.assign(Object.assign({},Sn(null==e?void 0:e.provider)?e.provider:{}),{productTag:r})})}}),yr=e=>W(void 0,void 0,void 0,function*(){const{playerConfig:t,pluginsNames:n,clickUrl:i}=e,{repeat:o}=t,r=yield wn(t);En(n),r.once("assetReady",()=>{fn(r,n)}),r.on(vr,e=>{const{viewable:t}=e;t?r.play():r.pause()}),r.on(pr,()=>{window.open(i,"_blank")}),o&&r.on("pause",()=>{r.play()})}),fr=(e,t,n)=>{const i=e===yn.ARTICLE||e===yn.OTHER?.79:1;return{desktopTitleSize:t?Number(t)*i+"px":"clamp(22px, 3.6rem, 59px)",mobileTitleSize:n?`${n}px`:"clamp(22px, 3.6rem, 59px)"}},wr={0:633,1:395,2:562,3:541,4:630,5:549,6:596,7:493,8:579,9:596,A:702,B:651,C:644,D:724,E:598,F:560,G:690,H:773,I:356,J:344,K:680,L:576,M:897,N:714,O:725,P:618,Q:725,R:675,S:555,T:610,U:710,V:703,W:1004,X:745,Y:684,Z:608,"Æ":906,"Ø":727,"Å":702,a:541,b:595,c:479,d:612,e:480,f:383,g:528,h:629,i:322,j:303,k:603,l:315,m:916,n:636,o:563,p:607,q:595,r:481,s:445,t:367,u:632,v:573,w:815,x:586,y:574,z:540,"æ":743,"ø":569,"ö":563,"å":541,"ä":541,"é":480,"è":480,"(":343,")":343,"«":567,"»":567,".":253,",":257,"!":259,"?":446,"¿":441,"*":410,"&":783,"-":334,"–":545,":":276,";":278,"%":744,$:549,"€":722,"#":519,"+":600,"=":600,'"':389,"'":202,"`":347,"’":237,"\\":395,"/":395,"@":844," ":181,"­":0},br=(e,t)=>{const n={"É":"E","é":"e","ü":"u"," ":" "};return[...e].reduce((e,i)=>e+(wr[n[i]||i]||wr.m)*t/1e3,0)},Er=(e,t,n=12,i=300)=>{let o=n,r=i,a=n;for(;o<=r;){const n=Math.floor((o+r)/2);br(e,n)<=t?(a=n,o=n+1):r=n-1}const s=((e,t,n,i)=>{const o=Math.floor(e/t*(n-2));return o<i?i:o})(a,br(e,a),t,n);return{fontSize:s,content:e}},Tr=(e,t)=>{const[n,i]=(e=>{const t=e.trim().split(/\s+/);if(t.length<=1)return[e,""];let n=[e,""],i=1/0;for(let e=1;e<t.length;e++){const o=t.slice(0,e).join(" "),r=t.slice(e).join(" "),a=Math.abs(o.length-r.length);a<i&&(i=a,n=[o,r])}return n})(e);return[Er(n,t),Er(i,t)]},Ir=({title:e,options:t})=>{if(!t)return e;const{pageType:n,appearanceConfig:{mainColumnWidth:i}={}}=t,o=n===yn.ARTICLE||n===yn.OTHER?"em":"rem";return Tr(e,(i||734)-64).map(({content:e,fontSize:t})=>`<span style="display: block; font-size: ${`${(t||16)/16}${o}`}">${e}</span>`).join("")},kr=({containerId:e,url:t,adContent:n,logo:i,description:o,title:r,customTitle1:a,customTitle2:s},d,l)=>{const{desktopTitleSize:c,mobileTitleSize:u}=fr(null==d?void 0:d.pageType,a,s),v=Ir({title:r,options:d});return or({"--desktopTitleSize":`${c}`,"--mobileTitleSize":`${u}`},e),`<article class="advertory-vg-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${n}</span>\n <img alt="${r}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${null!=l?l:0}"></div>\n </div>\n </div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-text-container">\n <div class="ad-description">${o}</div>\n <h2 class="ad-title">\n ${v}\n </h2>\n </div>\n </a>\n </div>\n </div>\n </div>\n </article>`},Sr=({containerId:e,adText:t,url:n,adFrom:i,sponsoredBy:o,title:r},a,s)=>`<article class="advertory-vg-ad-native-video">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${t}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${s}"></div>\n </div>\n </div>\n <a class="ad-link" href="${n}" target="_blank">\n <div class="ad-text-container">\n <span class="sponsored-by">\n ${i} ${o}\n </span>\n <span class="title">${r}</span>\n </div>\n </a>\n </div>\n </article>`,Ar=({containerId:e,adText:t,url:n},i,o)=>{return`<article class="advertory-vg-ad-native-ukesmeny-video">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${r=t,r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${o}"></div>\n </div>\n <a class="ad-link" href="${n}" target="_blank"></a>\n </div>\n </div>\n </article>`;var r},Cr=["IntegrationMenu"],$r={CONTENT:(e,t)=>{const{video:n}=e;return(null==n?void 0:n.content)?gr(kr)(e,t):(({containerId:e,url:t,adContent:n,logo:i,imgAltText:o,img:r,description:a,title:s,customTitle1:d,customTitle2:l,imgWidth:c,imgHeight:u},v)=>{const{desktopTitleSize:p,mobileTitleSize:g}=fr(null==v?void 0:v.pageType,d,l),m=c?`width="${c}"`:"",h=u?`height="${u}"`:"",y=Ir({title:s,options:v});return or({"--desktopTitleSize":`${p}`,"--mobileTitleSize":`${g}`},e),`<article class="advertory-vg-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-header">\n <span>${n}</span>\n <img alt="${s}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <img alt="${o}" class="ad-image" src="${r}" loading="lazy" ${m} ${h} />\n </div>\n <div class="ad-text-container">\n <div class="ad-description">${a}</div>\n <h2 class="ad-title">\n ${y}\n </h2>\n </div>\n </div>\n </a>\n </article>`})(e,t)},INHOUSE:({containerId:e,url:t,title:n,img:i,logo:o,sponsoredBy:r,imgWidth:a,imgHeight:s})=>`<article class="advertory-vg-ad-native-inhouse flexible">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" loading="lazy" ${a?`width="${a}"`:""} ${s?`height="${s}"`:""} />\n ${o&&`<img alt="${r}" class="ad-logo" src="${o}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">\n <span class="sponsor-name">${r}</span>${r?"- En tjeneste fra VG":""}\n </span>\n <span class="ad-title">${n}</span>\n </div>\n </div>\n </a>\n </article>`,SPONSORSTRIPE:({title:e,sponsoredBy:t,logo:n})=>`\n <article class="advertory-vg-ad-native-sponsorstripe">\n <div id="advertory-vg-sponsorstripe-info" class="ad-info">\n <button id="sponsorstripe-info-close-button" class="ad-info-close-button" aria-label="Lukk">\n \n <svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11" fill="none">\n <path d="M0.992123 0.0487634C1.05718 -0.0162892 1.1627 -0.0162197 1.2278 0.0487634L5.14642 3.96738C5.21145 4.03235 5.31701 4.03226 5.3821 3.96738L9.30007 0.0494144C9.36515 -0.015673 9.47066 -0.015673 9.53574 0.0494144L10.4798 0.992774C10.5448 1.05783 10.5447 1.16336 10.4798 1.22845L6.56178 5.14642C6.4967 5.2115 6.49671 5.31701 6.56178 5.3821L10.4798 9.30007C10.5448 9.3651 10.5447 9.47064 10.4798 9.53574L9.53574 10.4798C9.47064 10.5447 9.3651 10.5448 9.30007 10.4798L5.3821 6.56178C5.31701 6.49671 5.2115 6.4967 5.14642 6.56178L1.22845 10.4798C1.16336 10.5447 1.05783 10.5448 0.992774 10.4798L0.0494145 9.53574C-0.0156729 9.47066 -0.0156729 9.36515 0.0494145 9.30007L3.96738 5.3821C4.03226 5.31701 4.03235 5.21145 3.96738 5.14642L0.0487635 1.2278C-0.0162198 1.1627 -0.0162892 1.05718 0.0487635 0.992123L0.992123 0.0487634Z" fill="#470000"/>\n </svg>\n </button>\n <p class="ad-info-description">\n Annonsøren som presenterer denne saken har betalt for profilering av logoen i artikler som omhandler ${e.split(" ")[0].toLowerCase()}. \n <a class="ad-info-link" href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232">\n Les mer\n </a>\n </p>\n </div>\n <div class="ad-wrapper">\n <button id="sponsorstripe-info-open-button" class="ad-info-open-button" aria-label="Sponset innhold - Klikk for detaljer">i</button>\n <span class="ad-title">${e}</span>\n <div class="ad-logo-wrapper">\n <img alt="${t}" class="ad-logo" src="${n}" />\n </div>\n </div>\n </article>`,UKESMENY_SPONSORSTRIPE:({containerId:e,sponsoredBy:t,url:n,logo:i,title:o,customTitle1:r,customTitle2:a},{appearanceConfig:s})=>{const{isDarkModeEnabled:d}=null!=s?s:{},l=r?`${r}px`:"clamp(10px, 2rem, 30px)",c=a?`${a}px`:"clamp(10px, 1.8rem, 30px)",u=((e=":export{}")=>{const[,t]=e.split(":export{"),n=t.slice(0,-1).split(";").map(e=>e.split(":"));return Object.fromEntries(n)})(),v=d?u["c-white-primary"]:u["c-brown-primary"];or({"--desktopTitleSize":`${l}`,"--mobileTitleSize":`${c}`,"--fontColor":`${v}`},e);const p=`${e}-description`;return`<article class="advertory-vg-ad-native-ukesmeny-sponsor-stripe">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <a class="ad-link" href="${n}" target="_blank">\n <span style="--desktopTitleSize: ${l}; --mobileTitleSize: ${c};" class="title">${o}</span>\n </a>\n <a class="ad-link" href="${n}" target="_blank"> \n <img alt="${t}" class="ad-logo" src="${i}" />\n </a>\n <div class="info-button-wrapper" onClick="${(e=>`\n const adDescription = window.document.getElementById('${e}');\n adDescription.classList.toggle('hide');\n `)(p)}"><div class="info-button"></div></div>\n </div>\n <div id="${p}" class="description hide"> <span>Annonsøren som presenterer ukemenyen har betalt for profilering av logoen på VG-forsiden og Godt.no, og annonsen mellom oppskriftene.</span> <a href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232" target="_blank">Les mer</a></div>\n </div>\n </article>`},UKESMENY:({containerId:e,url:t,imgAltText:n,img:i})=>`<article class="advertory-vg-ad-native-ukesmeny">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header"><span>Annonse</span></div>\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" />\n </div>\n </div>\n </a>\n </article>`,UKESMENY_VIDEO:(e,t)=>gr(Ar)(e,t,{pluginsNames:Cr,videoLoop:true}),DEFAULT:({containerId:e,url:t,adText:n,img:i,logo:o,adFrom:r,sponsoredBy:a,title:s,imgWidth:d,imgHeight:l})=>`<article class="advertory-vg-ad-native">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header"><span>${n}</span></div>\n <div class="ad-image-container">\n <img alt="${s}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n ${o&&`<img alt="${a}" class="ad-logo" src="${o}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">${r} ${a}</span>\n <span class="title">${s}</span>\n </div>\n </div>\n </a>\n</article>`,RECIRC:({containerId:e,url:t,title:n,img:i,adText:o,sponsoredBy:r,logo:a,description:s,imgWidth:d,imgHeight:l})=>`<article class="advertory-shared-ad-native-recirc">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n <img alt="${r}" class="ad-logo" src="${a}" loading="lazy" />\n </div>\n <div class="ad-text-container">\n <span class="ad-sponsor">${o} ${r}</span>\n <h6 class="ad-title">${n}</h6>\n <span class="ad-description">${s}</span>\n </div>\n </div>\n </a>\n </article>`,PODME:({url:e,title:t,description:n,img:i,logo:o})=>`<article class="advertory-vg-ad-native-podme">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-content">\n <div class="ad-main-content">\n <div class="ad-text-container">\n <span class="ad-title">${t}</span>\n <span class="ad-description">${n}</span>\n </div>\n <div class="ad-small-image-container">\n <img alt="${t}" class="ad-small-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-logo">\n <img alt="Podme logo" src="${o}" loading="lazy" />\n </div>\n </div>\n </div>\n </div>\n </a>\n</article>`,PODME_SECTION:({url:e,title:t,description:n,img:i,logo:o})=>`<article class="advertory-vg-ad-native-podme-section">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-text-container">\n <span class="ad-title">\n ${t}\n </span>\n <span class="ad-description">\n ${n}\n </div>\n </div>\n <div class="ad-image-container">\n <img alt="podme-ad" class="ad-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-logo-container">\n <img alt="podme-logo" class="ad-logo" src="${o}" loading="lazy" />\n </div>\n </div>\n </a>\n</article>`,FISHFINGER:({img:e,title:t,sponsoredBy:n,logo:i,url:o})=>`<article class="advertory-vg-ad-native-fishfinger">\n <a class="ad-link" href="${o}" rel="noopener noreferrer" target="_blank">\n <div class="ad-content">\n <img class="ad-image" src="${e}" alt="${n}" />\n <span class="ad-title">${t}</span>\n <img class="ad-logo" src="${i}" alt="${n}" />\n </div>\n </a>\n </article>`,SHOPPING:({containerId:e,url:t,logo:n,imgAltText:i,img:o,description:r,title:a,imgWidth:s,imgHeight:d},l)=>`<article class="advertory-vg-ad-native-affiliate">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-header">\n <span>ANNONSE</span>\n ${n?`<img alt="${a}" class="ad-logo" src="${n}" loading="lazy" />`:""}\n </div>\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${o}" loading="lazy" ${s?`width="${s}"`:""} ${d?`height="${d}"`:""} />\n </div>\n <div id="testxd" class="ad-text-container">\n ${r?`<div class="ad-description">${r}</div>`:""}\n <h2 id="scalable-text-container" class="ad-title">\n ${Ir({title:a,options:l})}\n </h2>\n </div>\n </div>\n </a>\n </article>`,DEFAULT_VIDEO:(e,t)=>gr(Sr)(e,t)},Or={NATIVE_TEMPLATE:({containerId:e,url:t,sponsoredBy:n,title:i,img:o,adText:r})=>`<article class="advertory-no-ad-native-default">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${o}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${r}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`,NATIVE_RECIRC:({containerId:e,url:t,sponsoredBy:n,title:i,img:o,adText:r})=>`<article class="advertory-no-ad-native-recirc">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${o}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${r}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`,NATIVE_SEAMLESS:({containerId:e,url:t,adText:n,img:i,cta:o,description:r,logo:a,sponsoredBy:s,title:d,customTitle2:l})=>`<article class="advertory-no-ad-native-seamless">\n <div class="ad-info" id="${e}-button">\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header">\n <div class="ad-brand">\n ${a&&`<img alt="${s}" class="ad-logo" src="${a}" loading="lazy" />`}\n <div class="ad-brand-text">\n <div class="sponsored-by">${s}</div>\n <div class="ad-annons">${n}</div>\n </div>\n </div>\n <h2 class="ad-headline">${d}</h2>\n </div>\n <div class="ad-image-container">\n <img alt="${d}" class="ad-image" src="${i}" loading="lazy">\n </div>\n <div class="ad-footer">\n <div class="ad-row">\n <div class="ad-text-wrapper">\n <div class="ad-domain">${l}</div>\n <div class="ad-description">${r}</div>\n </div>\n <div class="ad-action">${o}</div>\n </div>\n </div>\n </div>\n </a>\n </div>\n </article>`},Pr={displayTemplates:{content:$r.CONTENT,content_internal:$r.CONTENT,inhouse:$r.INHOUSE,sponsorstripe:$r.SPONSORSTRIPE,"ukesmeny-stripe":$r.UKESMENY_SPONSORSTRIPE,ukesmeny:$r.UKESMENY,sponsor:$r.SPONSORSTRIPE,sponsortop:$r.SPONSORSTRIPE,standard:$r.STANDARD,recirc:$r.RECIRC,podme:$r.PODME,podme_section:$r.PODME_SECTION,fishfinger:$r.FISHFINGER,shopping:$r.SHOPPING,native:Or.NATIVE_TEMPLATE,native_recirc:Or.NATIVE_RECIRC,seamless:Or.NATIVE_SEAMLESS,default:$r.DEFAULT},videoTemplates:{content:$r.CONTENT,recirc:$r.DEFAULT_VIDEO,default:$r.DEFAULT_VIDEO,menu:$r.UKESMENY_VIDEO}},Lr=(e,t)=>{e.style.position="fixed",e.style.transform=`translateY(${t}px)`},xr=(e,t)=>{const n=document.querySelector(t),i=document.querySelector(`#${e}`);if(!i||!n)return;const o=i.parentElement,r=new IntersectionObserver(([e])=>((e,t,n)=>{const i=e?t.offsetHeight:0;Lr(n,i)})(e.isIntersecting,n,o)),a=new ResizeObserver(()=>((e,t)=>{Lr(t,e.offsetHeight)})(n,o));r.observe(n),a.observe(n)},Nr=e=>document.querySelector(e)||document.querySelector(`[class*="${e}"]`),jr=(e,t)=>{if(!t||!y(e))return;const{toggleEnabled:n,headerSelector:i,containersSelectors:o}=t,{targetId:r}=e;if(!n)return;const a=document.querySelector(".advertory-takeover-wrapper"),s=[()=>i&&xr(r,i),()=>o&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n)return;const[i,o]=t;if(!i)return;const r=()=>{const e=Nr(i),t=o?Nr(o):null,r=n.querySelector("article");if(!r||!e)return;const a=e.getBoundingClientRect().left,s=((e,t)=>{const n=e.getBoundingClientRect(),i=null==t?void 0:t.getBoundingClientRect();return i?i.right-n.left:n.width})(e,t);r.style.left=`${a}px`,r.style.width=`${s}px`};r(),new ResizeObserver(r).observe(document.body)})(r,o),()=>a&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n||!t)return;new IntersectionObserver(([e])=>{n.style.visibility=e.isIntersecting?"hidden":"visible"}).observe(t)})(r,a)];s.forEach(e=>e())},_r=e=>{e.style.removeProperty("min-height"),e.style.removeProperty("min-width")},qr=((e,t)=>n=>er(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;u(e)&&_r(i);const{pageType:o=yn.FRONT,nativeTrackingConfig:r,appearanceConfig:a,deviceType:s}=null!=t?t:{},d={language:ke.NO,publisher:ft.VG,deviceType:s,pageType:o,nativeTrackingConfig:r,appearanceConfig:a,productTag:"partnerstudio"};ur(e,d,Pr),jr(e,null==t?void 0:t.sponsorstripe)},wallpaperHandlers:{initWallpaperAd:(e,t)=>{if(!t)return;const{options:{appMainContainerSelector:n,wallpaperAnchorSelector:i}={}}=t;(e=>{const t=document.querySelector(e||"#application");if(!t)return;Q();const n=document.createElement("div");n.classList.add(J),document.body.insertBefore(n,t.nextSibling),n.style.setProperty("position","fixed"),n.style.setProperty("width","100%"),n.style.setProperty("height","calc(100% - var(--header-height, 0px) - 15px)"),n.style.setProperty("background-position","center top"),n.style.setProperty("background-repeat","no-repeat")})(n),(e=>{const t=e||".advertory-wrapper-common-skyscraperleft_1",n=document.querySelector(t);n&&(X(n),window.addEventListener("scroll",()=>X(n)))})(i),e()},adjustAdToHorseshoe:e=>{var t;const n=document.querySelector(`#${e}`);n&&(null===(t=n.parentElement)||void 0===t||t.classList.add(Y),n.classList.add(Y))}},loadFinnBlinkAd:(e,t,n,i)=>W(void 0,void 0,void 0,function*(){const{isMobileApp:o}=U.get();if(ve(`loadFinnBlinkAd: loading finn blink ad for ${e}`),!(yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=$e(e,t,n),o=yield i();return!(!(null==e?void 0:e.enabled)||!o)||(ve("Skip loading finn blink ad due to missing TCF consent."),!1)}))||o)return n&&n(e),ao(e),void(!n&&ee(e));try{yield re(ae)}catch(e){console.error(e)}yield Do(e,t,n),i&&i()}),replaceAdsWithFinnBlink:e=>W(void 0,void 0,void 0,function*(){if(!e)return;yield re(ae);const{replacementConfig:t}=e;if(!((()=>{const e=document.getElementById("ads-advertory-anchor");return!(e&&"none"!==getComputedStyle(e).display&&window.advertoryFluepapir)})()&&(null==t?void 0:t.adsToReplace)&&(null==t?void 0:t.sizes)&&e.enabled))return void ve(`Finn blink configuration is incorrect: ${JSON.stringify(t)}`);const{adsToReplace:n,sizes:i}=t;n.forEach(([e,t])=>{const n=document.querySelector(`[id^="${e}"]`);if(!n)return;const i=me(t);(e=>{ve(`Hiding old ad container: ${e.id}`),e.style.setProperty("display","none","important")})(n),he(n,i),n.dataset.finnBlinkId=t,ne().withFullAdsChain(e)})}),preparePageOptions:ht,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,{useAppTabletInvCode:o=!0}=U.get(),r=((e,t)=>{const{isMobileApp:n}=U.get();return n?((e,t)=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":t?"atb":e))(e,t):e})(i,o),a=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,i=`${We()}-adformat`,o=t?t[i]:[];if(!o)return{};const r=(Array.isArray(o)?o:[o]).filter(e=>!(e in l)||window.innerWidth>=l[e]);return{[i]:n?r:o}})(e),s=(e=>{const t=`${We()}-targetid`;return e?{[t]:[e]}:{}})(n),d=yt(),c=(e=>bt(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(i),u=((e,t)=>bt(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{})(i);return Object.assign(Object.assign({},e),{invCode:r,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),a),s),c),d),rendererOptions:u})},siteEvents:Ee,librariesToLoad:[]},{publisherClassName:ft.VG,fullWidthFormatClassName:"netboard"});var Dr=Object.freeze({__proto__:null,default:""});export{qr as initAdvertoryPackage,Xo as updateAdvertory};