@schibsted/advertory 2.44.0-test-art-4 → 2.44.5-art-v5

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 (155) hide show
  1. package/core/aftenposten/es/index.css +1 -0
  2. package/core/aftenposten/es/index.d.ts +699 -0
  3. package/core/aftenposten/es/index.js +1 -0
  4. package/core/aftenposten/es/package.json +9 -0
  5. package/core/aftenposten/index.d.ts +699 -0
  6. package/core/aftenposten/index.js +1 -0
  7. package/core/aftenposten/package.json +9 -0
  8. package/core/aftonbladet/es/index.css +1 -1
  9. package/core/aftonbladet/es/index.js +1 -1
  10. package/core/aftonbladet/index.js +1 -1
  11. package/core/aftonbladetv2/es/index.css +1 -0
  12. package/core/aftonbladetv2/es/index.d.ts +701 -0
  13. package/core/aftonbladetv2/es/index.js +1 -0
  14. package/core/aftonbladetv2/es/package.json +9 -0
  15. package/core/bt/es/index.css +1 -0
  16. package/core/bt/es/index.d.ts +699 -0
  17. package/core/bt/es/index.js +1 -0
  18. package/core/bt/es/package.json +9 -0
  19. package/core/bt/index.d.ts +699 -0
  20. package/core/bt/index.js +1 -0
  21. package/core/bt/package.json +9 -0
  22. package/core/e24/es/index.css +1 -1
  23. package/core/e24/es/index.js +1 -1
  24. package/core/e24/index.js +1 -1
  25. package/core/e24v2/es/index.css +1 -0
  26. package/core/e24v2/es/index.d.ts +699 -0
  27. package/core/e24v2/es/index.js +1 -0
  28. package/core/e24v2/es/package.json +9 -0
  29. package/core/godare/index.d.ts +699 -0
  30. package/core/godare/index.js +1 -0
  31. package/core/godare/package.json +9 -0
  32. package/core/godt/index.d.ts +701 -0
  33. package/core/godt/index.js +1 -0
  34. package/core/godt/package.json +9 -0
  35. package/core/klart/index.d.ts +701 -0
  36. package/core/klart/index.js +1 -0
  37. package/core/klart/package.json +9 -0
  38. package/core/kompakt/index.d.ts +699 -0
  39. package/core/kompakt/index.js +1 -0
  40. package/core/kompakt/package.json +9 -0
  41. package/core/minmote/index.d.ts +701 -0
  42. package/core/minmote/index.js +1 -0
  43. package/core/minmote/package.json +9 -0
  44. package/core/pent/index.d.ts +699 -0
  45. package/core/pent/index.js +1 -0
  46. package/core/pent/package.json +9 -0
  47. package/core/sa/es/index.css +1 -0
  48. package/core/sa/es/index.d.ts +699 -0
  49. package/core/sa/es/index.js +1 -0
  50. package/core/sa/es/package.json +9 -0
  51. package/core/sa/index.d.ts +699 -0
  52. package/core/sa/index.js +1 -0
  53. package/core/sa/package.json +9 -0
  54. package/core/svd/es/index.css +1 -0
  55. package/core/svd/es/index.d.ts +701 -0
  56. package/core/svd/es/index.js +1 -0
  57. package/core/svd/es/package.json +9 -0
  58. package/core/svd/index.d.ts +701 -0
  59. package/core/svd/index.js +1 -0
  60. package/core/svd/package.json +9 -0
  61. package/core/tek/index.d.ts +701 -0
  62. package/core/tek/index.js +1 -0
  63. package/core/tek/package.json +9 -0
  64. package/core/vg/es/index.css +1 -0
  65. package/core/vg/es/index.d.ts +699 -0
  66. package/core/vg/es/index.js +1 -0
  67. package/core/vg/es/package.json +9 -0
  68. package/core/vg/index.d.ts +699 -0
  69. package/core/vg/index.js +1 -0
  70. package/core/vg/package.json +9 -0
  71. package/core/vgv2/es/index.css +1 -0
  72. package/core/vgv2/es/index.d.ts +699 -0
  73. package/core/vgv2/es/index.js +1 -0
  74. package/core/vgv2/es/package.json +9 -0
  75. package/package.json +1 -1
  76. package/sites/aftenposten/es/index.css +1 -0
  77. package/sites/aftenposten/es/index.d.ts +29 -0
  78. package/sites/aftenposten/es/index.js +1 -0
  79. package/sites/aftenposten/es/package.json +9 -0
  80. package/sites/aftenposten/index.d.ts +29 -0
  81. package/sites/aftenposten/index.js +1 -0
  82. package/sites/aftenposten/package.json +9 -0
  83. package/sites/aftonbladet/es/index.css +1 -1
  84. package/sites/aftonbladetv2/es/index.css +1 -0
  85. package/sites/aftonbladetv2/es/index.d.ts +29 -0
  86. package/sites/aftonbladetv2/es/index.js +1 -0
  87. package/sites/aftonbladetv2/es/package.json +9 -0
  88. package/sites/bt/es/index.css +1 -0
  89. package/sites/bt/es/index.d.ts +29 -0
  90. package/sites/bt/es/index.js +1 -0
  91. package/sites/bt/es/package.json +9 -0
  92. package/sites/bt/index.d.ts +29 -0
  93. package/sites/bt/index.js +1 -0
  94. package/sites/bt/package.json +9 -0
  95. package/sites/e24/es/index.css +1 -1
  96. package/sites/e24v2/es/index.css +1 -0
  97. package/sites/e24v2/es/index.d.ts +33 -0
  98. package/sites/e24v2/es/index.js +1 -0
  99. package/sites/e24v2/es/package.json +9 -0
  100. package/sites/godare/index.d.ts +25 -0
  101. package/sites/godare/index.js +1 -0
  102. package/sites/godare/package.json +9 -0
  103. package/sites/klart/index.d.ts +25 -0
  104. package/sites/klart/index.js +1 -0
  105. package/sites/klart/package.json +9 -0
  106. package/sites/minmote/index.d.ts +19 -0
  107. package/sites/minmote/index.js +1 -0
  108. package/sites/minmote/package.json +9 -0
  109. package/sites/sa/es/index.css +1 -0
  110. package/sites/sa/es/index.d.ts +29 -0
  111. package/sites/sa/es/index.js +1 -0
  112. package/sites/sa/es/package.json +9 -0
  113. package/sites/sa/index.d.ts +29 -0
  114. package/sites/sa/index.js +1 -0
  115. package/sites/sa/package.json +9 -0
  116. package/sites/svd/es/index.css +1 -0
  117. package/sites/svd/es/index.d.ts +29 -0
  118. package/sites/svd/es/index.js +1 -0
  119. package/sites/svd/es/package.json +9 -0
  120. package/sites/svd/index.d.ts +29 -0
  121. package/sites/svd/index.js +1 -0
  122. package/sites/svd/package.json +9 -0
  123. package/sites/vg/es/index.css +1 -0
  124. package/sites/vg/es/index.d.ts +27 -0
  125. package/sites/vg/es/index.js +1 -0
  126. package/sites/vg/es/package.json +9 -0
  127. package/sites/vg/index.d.ts +27 -0
  128. package/sites/vg/index.js +1 -0
  129. package/sites/vg/package.json +9 -0
  130. package/sites/vgv2/es/index.css +1 -0
  131. package/sites/vgv2/es/index.d.ts +27 -0
  132. package/sites/vgv2/es/index.js +1 -0
  133. package/sites/vgv2/es/package.json +9 -0
  134. package/styles/aftenposten/index.js +3 -0
  135. package/styles/aftenposten/styles.css +1 -0
  136. package/styles/aftonbladetv2/index.js +3 -0
  137. package/styles/aftonbladetv2/styles.css +1 -0
  138. package/styles/bt/index.js +3 -0
  139. package/styles/bt/styles.css +1 -0
  140. package/styles/e24v2/index.js +3 -0
  141. package/styles/e24v2/styles.css +1 -0
  142. package/styles/godare/index.js +3 -0
  143. package/styles/godare/styles.css +1 -0
  144. package/styles/klart/index.js +3 -0
  145. package/styles/klart/styles.css +1 -0
  146. package/styles/kompakt/index.js +3 -0
  147. package/styles/kompakt/styles.css +1 -0
  148. package/styles/sa/index.js +3 -0
  149. package/styles/sa/styles.css +1 -0
  150. package/styles/svd/index.js +3 -0
  151. package/styles/svd/styles.css +1 -0
  152. package/styles/vg/index.js +3 -0
  153. package/styles/vg/styles.css +1 -0
  154. package/styles/vgv2/index.js +3 -0
  155. package/styles/vgv2/styles.css +1 -0
@@ -0,0 +1 @@
1
+ import"react/jsx-runtime";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,n;var i=e(function(){if(n)return t;n=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map(function(e){return r(e,n)})}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function d(e,t,n){var i={};return n.isMergeableObject(e)&&s(e).forEach(function(t){i[t]=r(e[t],n)}),s(t).forEach(function(o){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(a(e,o)&&n.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):i[o]=r(t[o],n))}),i}function l(t,n,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||e,i.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(t)?s?i.arrayMerge(t,n,i):d(t,n,i):r(n,i)}return l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return l(e,n,t)},{})},t=l}());const r=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],o={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},s=6;class a{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))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=i(a.DEFAULT_SITE_HANDLERS,e)}}a.DEFAULT_SITE_HANDLERS={siteEvents:o,initNativeAd:function(){}};const d=new a,l=d.modifyConfigProperties.bind(d),c={NO:"no",SE:"se"},u=()=>{const{country:e}=d.get();return e===c.NO?"no-sno":"se-generic"},v=()=>{const{country:e,publisher:t}=d.get();return`${e}-${t}`},p="ABSOLUTE_FULLSCREEN",g="ANY_FULLSCREEN",m="VERTICAL_FULLWIDTH",h="FULLWIDTH",y="TAKEOVER",f="WALLPAPER",w="COLLAPSE",b={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}],WALLPAPER:[{width:2,height:2}],COLLAPSE:[{width:2,height:1}]},E={wallpaper:1600,"l-format":1600},T=e=>new URLSearchParams(window.location.search).get(e),I=()=>{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},S={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",POLARIS:"polaris"},C=e=>{const{source:t}=e;return"csm"===t},$={[S.VG]:["board","netboard","backfill","outstream"],[S.AFTONBLADET]:["panorama","outstream"],[S.GODARE]:["panorama","outstream"],[S.SVD]:["wph-article-panorama","wph-front-panorama"]},k=e=>{var t;const{publisher:n}=d.get();return!!$[n]&&!!(null===(t=$[n])||void 0===t?void 0:t.some(t=>e.includes(t)))};function A(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{d(i.next(e))}catch(e){o(e)}}function a(e){try{d(i.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}d((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class O{initialize(){this.DATA=Object.assign({},O.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)}}O.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const P=new O,L=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},x=864e5,N=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return L("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=x)=>{const r={data:n,expirationTime:(new Date).getTime()+i};t(e,JSON.stringify(r))},getByTimestamp:(t,n=x)=>{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 L("Error with parsing localStorage data"),null}}}})(),j={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return L(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,t)=>{try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){L(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){L(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},_="advertory:ppids-cache",q={[c.SE]:`SCH${c.SE.toUpperCase()}-EnvHash`,[c.NO]:`SCH${c.NO.toUpperCase()}-EnvHash`},D={[c.SE]:`SCH${c.SE.toUpperCase()}-UserHash`,[c.NO]:`SCH${c.NO.toUpperCase()}-UserHash`},M={[c.SE]:`sch${c.SE}-envhash-v3`,[c.NO]:`sch${c.NO}-envhash-v3`},R={[c.SE]:`sch${c.SE}-userhash-v3`,[c.NO]:`sch${c.NO}-userhash-v3`},B={[c.SE]:`'sch${c.SE}-iosid-v3'`,[c.NO]:`'sch${c.NO}-iosid-v3'`},F={[c.SE]:`sch${c.SE}-androidid-v3`,[c.NO]:`sch${c.NO}-androidid-v3`},H={[c.SE]:"sdrn:schibsted.com:user",[c.NO]:"sdrn:spid.no:user"},z=e=>A(void 0,void 0,void 0,function*(){const t=yield e.getEnvironmentId();if(!t)return null;return`sdrn:schibsted:environment:${t}`}),U=(e,t)=>A(void 0,void 0,void 0,function*(){const n=yield e.getUserId();if(!n)return null;return`${H[t]}:${n}`}),V=()=>A(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 W{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 A(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 L("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return A(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 K="advertory-session",G=e=>{const{privacyBroker:{storageKeyPrefix:t=K}={}}=d.get();return t+"-"+e},J=()=>{const{privacyBroker:{storageKeyPrefix:e=K}={}}=d.get(),t=sessionStorage;for(const n in t)0===n.indexOf(e+"-")&&j.remove(n)},Y={LOCAL:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",DEV:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",PRE:"https://user-permissions.privacy-pre.schibsted.io/privacy/v2",PRO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_NO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_FI:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_DK:"https://user-permissions.privacy.schibsted.com/privacy/v2"},Q={get:(e,t)=>A(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)=>A(void 0,void 0,void 0,function*(){const i=JSON.stringify(n),r=yield fetch(e,{method:"POST",headers:t,body:i});if(!r.ok)throw new Error(r.statusText);return yield r.json()})},Z=e=>A(void 0,[e],void 0,function*({endpoint:e,identityFacade:t,environment:n}){var i;J();const r=yield(e=>A(void 0,void 0,void 0,function*(){const t=new Headers;t.set("Content-Type","application/json");const n=yield e.getIdentityUser();return n&&t.set("Authorization",`SPIDSIG ${n.sig}`),t}))(t);try{const t=null!==(i=Y[n])&&void 0!==i?i:Y.PRO;return yield Q.get(`${t}${e}`,{headers:r})}catch(e){return L("[PrivacyBroker] Failed to fetch permissions",e),null}}),X=()=>A(void 0,void 0,void 0,function*(){var e,t;const{privacyBroker:{enabled:n,clientId:i}={},tracker:{instance:r}={},country:o}=d.get(),s=yield V(),a=new W(s);if(!(n&&s&&r&&i))return L("[Privacy Broker]: Data not present",{enabled:n,identity:s,trackerInstance:r}),null;const l=yield a.isUserLoggedIn();a.onIdentityLogout(()=>{L("[Privacy Broker]: clearPermissions"),J()});const c=null!==(e=yield U(r,o))&&void 0!==e?e:"",u=null!==(t=yield z(r))&&void 0!==t?t:"",v=l?c:u,p=yield((e,t,n)=>A(void 0,void 0,void 0,function*(){const i=`/schacc/${t}/user/${n}/permissions`,r=`/anonymous/${t}/user/${n}/permissions`;return(yield e.getIdentityUser())?i:r}))(a,i,v),g=(e=>!!j.get(G(e)))(v),m=G(v);if(g){L("[Privacy Broker]: SessionStorage cached",{key:m,permissions:sessionStorage.getItem(m)});return j.get(m)}const h=yield(e=>A(void 0,[e],void 0,function*({endpoint:e,timeout:t,identityFacade:n,environment:i}){return yield Promise.race([Z({endpoint:e,environment:i,identityFacade:n}),new Promise(e=>setTimeout(()=>e(null),t))])}))({endpoint:p,timeout:500,identityFacade:a,environment:s.env});return h?(f=v,(null==(y=h)?void 0:y.permissions)&&j.set(G(f),y.permissions),h):(L("[Privacy Broker]: Permissions not found",{permissions:h,isLoggedIn:l,identifiedId:v,country:o}),null);var y,f}),ee="cmp:loaded";let te,ne=!1;const ie=e=>{const t=!!(null==e?void 0:e.enabled),n=(null==e?void 0:e.timeout)||3e3,i=T("bypass_tcf");return{initConsentManager:()=>new Promise((e,t)=>{if(L("Getting TCF consent manager..."),window._tcf_)return L("TCF consent manager is already available"),te=window._tcf_,void e(te);L("TCF consent manager is not available");const i=()=>{L("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(te=window._tcf_,e(te)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(ee,i),ne=!0,t(new Error("Timeout waiting for CMP to load"))},n);L("Listening for CMP loaded event..."),document.addEventListener(ee,i,{once:!0})}),getConsentSync:()=>{if(((e,t)=>e?!!t&&(L("TCF bypass param detected, returning consent: true"),!0):(L("TCF is not enabled, returning consent: true"),!0))(t,i))return!0;if(ne)return null;if(!te)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const e=te.getConsentedToAllSync();return L(`TCF consented to all is: ${e}`),te.getConsentedToAllSync()}}},re="glimrTags",oe=["glwe_","glwet_"],se={geofenceTags:[],geoTags:[],weatherTags:[]},ae=()=>A(void 0,void 0,void 0,function*(){const{privacyBroker:e,tcf:t}=d.get(),{getConsentSync:n}=ie(t),i=n();if(null==e?void 0:e.enabled){const e=(e=>{const t=null==e?void 0:e.find(e=>e.purpose.includes("targeted_advertising"));if(L("targeted_advertising permissions",t),!(null==t?void 0:t.data)||!Array.isArray(null==t?void 0:t.data))return!1;const n=null==t?void 0:t.data.find(e=>e.includes("geolocation"));return L("geolocation permission",n),!!n})(yield A(void 0,void 0,void 0,function*(){var e,t;const{country:n,tracker:{instance:i}={}}=d.get(),r=yield V();if(!i||!r)return L("[Privacy Broker] No tracker found."),null;const o=new W(r),s=yield o.isUserLoggedIn(),a=null!==(e=yield U(i,n))&&void 0!==e?e:"",l=null!==(t=yield z(i))&&void 0!==t?t:"",c=G(s?a:l);return j.get(c)||null}));return e}return!!i}),de=()=>A(void 0,void 0,void 0,function*(){const{glimr:e}=d.get();if(!(yield ae())||!(null==e?void 0:e.enabled))return void L("No consent for glimr data fetching.");const t=yield(n=500,A(void 0,void 0,void 0,function*(){return yield Promise.race([A(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)=>{N.setWithTimestamp(re,{tags:e,tagMappings:t}),n(!0)})})}catch(e){L(`Error during getting glimr data: ${e}`)}else L("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),le={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"},ce=e=>oe.some(t=>e.startsWith(t)),ue=e=>e.startsWith("glgc_"),ve=e=>!ce(e)&&!ue(e),pe=e=>{const t=ge();if(!t)return se;const n=((e=[])=>e.filter(ce))(t),i=((e=[])=>e.filter(ue))(t),r=((e=[],t)=>{const n=e.filter(ve);if(t){const{publisher:e}=d.get(),t=le[e]||e;n.push(t)}return n})(t,e);return{geoTags:r,geofenceTags:i,weatherTags:n}},ge=()=>{const e=N.getByTimestamp(re);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},me=()=>(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),he=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),ye=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=d.get(),r=[`${u()}-geo`],o=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...i?r:[]],s=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),a=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:s}}},a)}};class fe{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 we=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return A(this,arguments,void 0,function*(e,t=1e4){var n,i;const r=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=r.xandr)||void 0===n?void 0:n.ppId1,null===(i=r.xandr)||void 0===i?void 0:i.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||L("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:""}},be=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return A(this,void 0,void 0,function*(){var n,i,r,o,s,a,d,l,c,u;const v=N.get(_),p=yield this.getNewPPIDs(e,t);if(this.shouldHash(v,p)){const e=this.createHasherPayload(p),t=yield this.hashPPIDs(e);return t?(this.cachePPIDs(e,t,null===(n=p.idfv)||void 0===n?void 0:n.plain,null===(i=p.anId)||void 0===i?void 0:i.plain),void this.setPPIDs(null!==(r=t.userId)&&void 0!==r?r:"",null!==(o=t.environmentId)&&void 0!==o?o:"",null===(s=p.idfv)||void 0===s?void 0:s.plain,null===(a=p.anId)||void 0===a?void 0:a.plain)):void this.setPPIDs("","")}this.setPPIDs(null!==(d=null==v?void 0:v.userId.hashed)&&void 0!==d?d:"",null!==(l=null==v?void 0:v.environmentId.hashed)&&void 0!==l?l:"",null===(c=null==p?void 0:p.idfv)||void 0===c?void 0:c.plain,null===(u=null==p?void 0:p.anId)||void 0===u?void 0:u.plain)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||L("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 r in e){if((null===(n=e[r])||void 0===n?void 0:n.plain)!==(null===(i=t[r])||void 0===i?void 0:i.plain))return!0}return!1}cachePPIDs(e,t,n,i){const r=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}}:{});N.set(_,r)}hashPPIDs(e){return A(this,void 0,void 0,function*(){try{const t=new Headers({"Content-Type":"application/json"});return yield Q.post("https://hasher.schibsted.com/api/v1/hash",t,e)}catch(e){return L("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return A(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield U(t,n),r=yield z(t),o=window.advertory_idfv,s=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:e},userId:{plain:i},environmentId:{plain:r},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},o?{idfv:{plain:o}}:{}),s?{anId:{plain:s}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:i,environmentId:r}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:i.plain,environmentId:r.plain}}},Ee=e=>{const{ppid1:t,ppid2:n}=we.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=be.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new fe).add(n,q[e]).add(t,D[e]).add(r,M[e]).add(i,R[e]).add(o,B[e]).add(s,F[e]).buildEids()}]}},Te=e=>{const{ppid1:t,ppid2:n}=we.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=be.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new fe).add(n,q[e]).add(t,D[e]).add(r,M[e]).add(i,R[e]).add(o,B[e]).add(s,F[e]).buildRyEids()}}]}}},Ie=(e,...t)=>A(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 r=document.createElement("script");r.async=!0,r.src=e;const o=()=>{a(),n()},s=()=>{a(),i(new Error(`Failed to load ${e}`))},a=()=>{r.removeEventListener("load",o),r.removeEventListener("error",s),clearTimeout(d)};r.addEventListener("load",o),r.addEventListener("error",s);const d=setTimeout(()=>{a(),i(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(r)}).catch(e=>{console.error(e)}))}),Se=()=>{const{prebid:e,tcf:t,country:n}=d.get(),{getConsentSync:i}=ie(t),r=i(),{initNativeAd:o}=d.getHandlers();if(!(null==e?void 0:e.enabled))return;const s=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:i=>{const r=me(),{prebid:{relevantCbTimeout:o}={}}=d.get(),s="relevantCb"===i&&o?o:n[i].timeout,a=setTimeout(()=>{!n[i].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${i}'`),e=!0,r.loadTags&&r.loadTags())},s);t.push(a)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),a=me(),l=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=me();return{user:e,keywords:t}})();s.failsafeOnTimeout("relevantCb");const{user:{externalUid:c=""}={},keywords:u}=l;(()=>{const e=he();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(s.getCancel()||!a.loadTags)return L("core loadTags() call was cancelled",{cancel:s.getCancel(),apnTagLoadTags:!a.loadTags,condition:"or"}),void s.cleanup();const t=he();s.events.relevantCb.done=!0,s.failsafeOnTimeout("auctionCb");const i=r?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};L("prebid consentManagement",i),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},Te(n)),ye(u,c))),L("core add prebid config",Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},Te(n)),ye(u,c))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{s.getCancel()||(s.events.auctionCb.done=!0,a.loadTags(e)),s.cleanup()}},customNativeRender:e=>{Ce(e,o)}}),L("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{s.getCancel()||(s.events.auctionCb.done=!0,a.loadTags(e))}},customNativeRender:e=>{Ce(e,o)}})})},Ce=(e,t)=>{var n;const{divId:i,native:r,bid:o}=e,s=document.querySelectorAll(`[id^=${i}]`)[0],a=`RY-${s.id}`;((e,t)=>{e.childNodes.forEach(e=>e.style.cssText="position: absolute; z-index: -1;");const n=document.createElement("div");n.setAttribute("id",t),e.appendChild(n)})(s,a);const l=null===(n=s.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:r,targetId:a},d.get()),null==l||l.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},$e="0123456789abcdefghijklmnopqrstuvwxyz",ke=(e,t)=>{e.style.display=t},Ae=e=>{window.apntag.anq.push(e)},Oe=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),Pe=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})}),Le=e=>{const{banner:t,targetId:n}=e;return!(!t||(null==n?void 0:n.includes("takeover")))&&Ke(e,g)},xe=e=>{const{native:t}=e;return!!t},Ne=e=>Ke(e,h),je=e=>{const{targetId:t}=e;return t.includes("takeover")||Ke(e,y)},_e=e=>Ke(e,y),qe=e=>Ke(e,f),De=e=>Ke(e,w),Me=e=>e.targetId.includes("sponsorstripe"),Re=e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!ze(e),Be=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},Fe=e=>e.targetId.startsWith("netboard"),He=e=>e.targetId.startsWith("board"),ze=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),Ue=e=>e.targetId.startsWith("midboard"),Ve=e=>e.width>=1260&&e.width<=1280,We=e=>e.width>=1600&&e.width<=1620,Ke=(e,t)=>{const n=b[t];if(!n)return!1;return!!n.find(t=>{var n,i;const r=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,o=(null===(i=e.banner)||void 0===i?void 0:i.height)||e.height,s=t.width===r,a=!t.height||t.height===o;return s&&a})},Ge=e=>e.includes("snoap.no"),Je=e=>{var t,n,i,r,o;return!!(null===(o=null===(r=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===r?void 0:r.ads[1])||void 0===o?void 0:o.rtb)},Ye=(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()),r=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),o=i.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...o,r).toString()},Qe=Ye([],()=>{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:r,clientHeight:o}=i,s=e/r,a=t/o;i.style.transform=`scale(${s},${a})`,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}),Ze=e=>{const t=Ye([],()=>{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},Xe=[],et={},tt=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=it(e);n?(nt(i,n),rt(e,i,t)):(nt(i,n),ot(e,i,t))})},nt=(e,t)=>{var n,i;const r=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!r)return;const o=t?"showFullscreen":"hideFullscreen";null===(i=r.contentWindow)||void 0===i||i.postMessage(`advertory:${o}-${e}`,"*")},it=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},rt=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),Xe.includes(t)||Xe.push(t),n&&window.addEventListener("scroll",et[t],{passive:!0})},ot=(e,t,n)=>{Xe.includes(t)&&(n&&window.removeEventListener("scroll",et[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},st=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:i=[".skyscraper_r"],headerZIndex:r=3}=t,o=[],s=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&o.push(n)}),i.forEach(e=>{const t=document.querySelector(e);t&&s.push(t)}),()=>{o.length&&at(e,o,r,0),s.length&&at(e,s,r,40)}},at=(e,t,n,i)=>{const r=e.offsetHeight,o=window.scrollY,s=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let a;a=s>o?(s-o)/t-i:(o+t-(s+r))/t;const d=a<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=a.toString()})},dt={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 lt=null;const ct=(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=`(${Qe})()`,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(Ge(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=Ze(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>Ge(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)),Ge(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)),Je(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},ut=()=>{lt=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,i=e?e.offsetTop:0,r=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-top",`${i}px`),o.style.setProperty("--advertory-fullscreen-scroll-left",`${r}px`)},vt=()=>{lt||(lt=window.requestAnimationFrame(ut))},pt=(e,t)=>{var n,i,r;const{country:o}=d.get(),{targetId:s}=e;(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:i="#fff",margin:r="16px 0",beforeContentValue:o=""}=e,s=t/2,a=document.createElement("style");a.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${s}px),\n ${i} calc(50% - ${s}px),\n ${i} calc(50% + ${s}px),\n ${n} calc(50% + ${s}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${r};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${o&&"clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);\n -webkit-clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);"}\n }\n\n .advertory-fullscreen-scroll-wrapper:before, .advertory-fullscreen-scroll-wrapper:after {\n background: var(--background);\n content: '${o}' !important;\n }`,a.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(a)})(null!==(n=null==t?void 0:t.overlayStyles)&&void 0!==n?n:{});const a=document.getElementById(s),l=null==a?void 0:a.parentElement;a&&l&&(((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,i=new IntersectionObserver(e=>tt(e,n),{}),r=it(e);i.observe(e),n&&(et[r]=st(e,t))})(l,t),a.className="advertory-fullscreen-scroll",Ke(e,p)&&(a.style.position="absolute"),l.className="advertory-fullscreen-scroll-wrapper",l.dataset.showTagSubscribeId=s,a.setAttribute("data-ad-label",dt[o].adText),(null==t?void 0:t.moveCogwheelToTheLeft)&&(a.dataset.moveCogwheelToTheLeft="true"),vt(),window.addEventListener("resize",vt),null===(i=window.visualViewport)||void 0===i||i.addEventListener("resize",vt),null===(r=window.visualViewport)||void 0===r||r.addEventListener("scroll",vt))},gt=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=Je(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=Je(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,ct(t,e))},mt=e=>{const t=e.split("-"),n=t[t.length-1];return 6===n.length&&n.match(/^[a-zA-Z0-9]+$/)?t.slice(0,-1).join("-"):e};let ht="";const yt=new Map,ft="advertory-wallpaper-background",wt="advertory-with-horseshoe",bt=()=>{const e=document.querySelector(`.${ft}`);e&&e.remove()},Et=e=>{const t=e.getBoundingClientRect().top;requestAnimationFrame(()=>(e=>{if(!document.body)return;const t=document.querySelector(`.${ft}`);t&&t.style.setProperty("top",`${e}px`)})(t+15))},Tt=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,It=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")&&bt())},St=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"))},Ct=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`)},$t=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=P.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},kt=()=>{bt();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{It(e.id),$t(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=mt(e.id)}),Ae(()=>window.apntag.clearRequest())},At="noGroupedPlacements",Ot=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},Pt=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:r}=d.get(),o=n[r].filter(Ot)||[],s=e?document.querySelector(e):document;if(!s)return[];const a=o.reduce((e,t)=>{const n=(e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t})(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=o.filter(({id:e})=>e.match(t)),a=(null==i?void 0:i.queryByDataDevice)?`div[id^="${e}"][data-device=${r}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,l=s.querySelectorAll(a),c=Array.from(l).filter(({id:e})=>e.match(t)).map((e,t)=>{const i=Lt(e,t,n),r=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=$e[Math.floor(36*Math.random())];return t})(6)}`;return e.id=r,e.setAttribute("data-advertory-ad-rendered","true"),i.finnBlink&&!i.finnBlink.renderOnlyWithAdBlock&&e.setAttribute("data-is-finn-blink-placement","true"),(e=>{var t;const n=e.id;n&&P.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({},i),{id:r})});return(e=>{const{keywordsConfig:t}=d.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(ht!==window.location.pathname&&(yt.clear(),ht=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=yt.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${v()}-count`]=i,yt.set(n,i+1),e})):e})(c)});return(e=>{const t=Array.from(document.querySelectorAll('div[class^="advertory"]'));return e.sort((e,n)=>t.findIndex(t=>t.id===e.id)-t.findIndex(e=>e.id===n.id))})(a)},Lt=(e,t,n)=>{const i=n[t],r=n[n.length-1],o=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==r?void 0:r.id)?r:o||r},xt=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=d.get(),i=(null==t?void 0:t[n])||{},r=Object.values(i).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=mt(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),s=((e,t)=>{const n={};for(const[i,r]of Object.entries(t))n[i]=e.filter(e=>r.includes(mt(e.id)));return n})(e,i),a=Object.keys(o),l=((e,t)=>e.filter(e=>!t.has(mt(e.id))))(e,new Set([...a,...r]));return Object.assign(Object.assign(Object.assign({},s),o),{[At]:l})},Nt=(e,t,n)=>{const i=document.getElementById(`div_utif_${e}`);if(!i)return;const{apntag:r}=window,[o,s]=t;if(!i.dataset.lockedsize&&s&&o)i.style.width=`${o}px`,i.style.height=`${s}px`,n&&(r.resizeAd(i.id,[o,s]),i.dataset.lockedsize="true",i.dataset.lockedwidth=o.toString(),i.dataset.lockedheight=s.toString());else if(null==i?void 0:i.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=i.dataset;e&&t&&r.resizeAd(i.id,[e,t])}},jt=["netboard","board"];class _t{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,i;const{editionName:r}=e,o=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),s=JSON.stringify(null!==(i=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==i?i:[]),a=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return a.searchParams.append("editionName",r),o&&a.searchParams.append("urlData",o),s&&a.searchParams.append("excludedItems",s),l&&a.searchParams.append("spid",l),d&&a.searchParams.append("envid",d),a.toString()}fetchData(e){return A(this,void 0,void 0,function*(){var t,n;const i=yield this.identityFacade.getIdentityUser(),r=null!==(n=yield null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId())&&void 0!==n?n:"",o=(null==i?void 0:i.userId)?String(i.userId):"",s=this.buildUrl(e,{envId:r,spid:o});try{L("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield Q.get(s,e);return L("Fetch operation completed successfully."),t}catch(e){L("Error during fetch operation:",e)}return null})}}class qt{getDrEditionUTMParams(e,t){var n;const{title:i,clientName:r,creativeId:o}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:s}=t,a=i.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:s,utm_campaign:r,utm_medium:a},o&&{utm_id:`df-${o}`})}getUrlSearchParams(e,t,n){if(!e)return"";const i=this.getDrEditionUTMParams(t,n),r=new URLSearchParams(decodeURIComponent(e.search)),o=new URLSearchParams(e.search);return Object.entries(i).forEach(([e,t])=>{r.has(e)||o.set(e,null!=t?t:"")}),o.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 r=this.getDrEditionUTMParams(e,t),o=new URL(i);return Object.entries(r).forEach(([e,t])=>{o.searchParams.has(e)||o.searchParams.set(e,null!=t?t:"")}),o.toString()}handleVideo(e,t){return A(this,void 0,void 0,function*(){const{id:n,autoplay:i,mute:r,videoLoop:o,vendor:s}=t.videoConfiguration;e.classList.add("vgtv-video-container"),Object.assign(e.dataset,{vgtvVideoId:n,vgtvVendor:s,vgtvAutoplay:i,vgtvMuted:r,vgtvLoop:!!o,vgtvNa:!0,vgtvRecommended:!1,vgtvPulseProvider:"vg",vgtvPulseProductTag:"partnerstudio"})})}getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:i,pathname:r}=new URL(n);if(!i.includes("www.vg.no")&&!r.includes("annonsorinnhold"))return[n];const o=r.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Dt{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(e,t){return A(this,void 0,void 0,function*(){var n,i;const{drEditionConfig:{containerSelector:r},renderAsBackfill:o=!1}=t,s=e.querySelector(r);if(!s)return void L(`Container with selector "${r}" not found.`);const a=yield this.drEditionService.fetchData(t);return(null==a?void 0:a.itemId)||o?!(null==a?void 0:a.itemId)&&o?(L("No Dr. Edition ads available to render. Collapsing whole placement."),void It(e.id)):((null==a?void 0:a.itemId)&&o&&(L("Dr. Edition ad available to render as a Xandr backfill."),St(e.id)),void(a&&(a.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(a.css,"style"),this.rendererManager.render(s,a,t),yield null===(n=this.videoManager)||void 0===n?void 0:n.handle(a,t),this.drEditionAds.push(a),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(a.itemId),this.observeAdView(e,a,t),null===(i=e.querySelector("a"))||void 0===i||i.addEventListener("pointerup",()=>null)))):(L("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),void this.showBackfill(e))})}observeAdView(e,t,n){this.observeCarousel(e,t,n)||((e,t,n={threshold:.5})=>{new IntersectionObserver(([e],n)=>{e.isIntersecting&&(t(),n.disconnect())},n).observe(e)})(e,()=>this.pulseManager.trackContentView(e,t,n),{threshold:.5})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";St(i)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const i=e.querySelector(".dr-edition-slider");if(!i)return!1;let r=null;const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(r&&clearTimeout(r),r=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...i.children].forEach(e=>{o.observe(e)})})},{threshold:[.9]});return[...i.children].forEach(e=>{o.observe(e)}),!0}}const Mt={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},Rt=e=>e===Mt.MOBILE;class Bt{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){if(!(null==t?void 0:t.itemId))return;const{getConsentSync:i}=ie(n.tcf),r=!!i(),o=Rt(n.device)?t.mobileHTML:t.desktopHTML,s=r?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");e.innerHTML=s,e.querySelectorAll("a").forEach(e=>{var i,r,o;e.search=null!==(o=null===(r=(i=this.newsroomStrategy).getUrlSearchParams)||void 0===r?void 0:r.call(i,e,t,n))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,t,n)})}}class Ft{constructor(e){this.strategy=e}handle(e,t){return A(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 A(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield Ie(t)}catch(e){L("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return A(this,void 0,void 0,function*(){const n=document.createElement("div"),{node:i}=e.videoConfiguration,r=[...document.querySelectorAll(`#${i}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(e,t))return;this.strategy.handleVideo(n,e),null==r||r.appendChild(n),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==r?void 0:r.parentNode;if(!o)return;const s=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");s!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,i,r;const{preview:{url:o,thumbnail:s}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const a=document.querySelector(".dr-edition-preview .preview-video");return!!a&&(a.setAttribute("playsinline",""),!(!a||!s)&&(null===(r=(i=t.drEditionConfig).addPreviewVideo)||void 0===r||r.call(i,a),!0))}}class Ht{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,r=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:i}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e,t,n){return A(this,void 0,void 0,function*(){var i,r,o,s,a;if(!this.pulse)return;const d=this.getEventInput(e,t,n,"view");(null===(i=this.pulse)||void 0===i?void 0:i.trackViewUIElement)?null===(o=null===(r=this.pulse)||void 0===r?void 0:r.trackViewUIElement)||void 0===o||o.call(r,d):null===(a=null===(s=this.pulse)||void 0===s?void 0:s.trackElementView)||void 0===a||a.call(s,d)})}trackContentClick(e,t,n){return A(this,void 0,void 0,function*(){var i,r,o,s;if(!this.pulse)return;const a=this.getEventInput(e,t,n,"click");this.pulse.trackClickUIElement?null===(r=(i=this.pulse).trackClickUIElement)||void 0===r||r.call(i,a):null===(s=(o=this.pulse).trackElementClick)||void 0===s||s.call(o,a)})}}class zt extends Ht{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:r="",creativeId:o}={}}=t,{columnName:s,primaryPosition:a}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:i,placement:{columnName:s,primaryPosition:a},"spt:custom":{is_sponsored:!0,sponsor:r,"spt: creativeId":o},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}class Ut extends Ht{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var i,r,o,s,a,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!==(s=null===(o=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulseObjectId)||void 0===o?void 0:o.call(r))&&void 0!==s?s:v,"@type":"UIElement",position:v,elementType:"Article",custom:{customer:c,creativeId:null!=u?u:l},page:{"@id":null!=g?g:v,"@type":p,url:location.origin},tags:null===(d=null===(a=this.newsroomStrategy)||void 0===a?void 0:a.getTags)||void 0===d?void 0:d.call(a,e)}}getEventInput(e,t,n,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 r,o,s,a;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!==(a=null!==(s=null===(o=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getUrlWithParams)||void 0===o?void 0:o.call(r,t,n))&&void 0!==s?s:p)&&void 0!==a?a:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:m,title:h,type:i,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}}const Vt={FRONT:"front",ARTICLE:"article",OTHER:"other"},Wt=(e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})},Kt=e=>A(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)))}))}),Gt={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 A(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return lo})})}})}},Jt=(e,t)=>{null==e||e.forEach(e=>{Gt[e](t)})};class Yt{handleVideo(e,t){return A(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){yield A(void 0,void 0,void 0,function*(){return yield new Promise(e=>{var t;Boolean(null===(t=window.SVP)||void 0===t?void 0:t.Player)?e(!0):window.addEventListener("onSvpPlayerReady",()=>e(!0))})});const s=["ContentMutePlugin"],a=this.createPlayerOverlay(e);Jt(s,a);const d={id:t,node:n,autoplay:i,mute:r,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},l=yield Kt(d);l.once("assetReady",()=>{Wt(l,s)}),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")?a.classList.add("is-playing"):a.classList.remove("is-playing"),t.classList.contains("jw-flag-user-inactive")?a.classList.add("is-inactive"):a.classList.remove("is-inactive"))})}).observe(t,{attributes:!0,attributeFilter:["class"]})}),l.once("PulseStats:ready",()=>A(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===Vt.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),r=i.split("/").filter(Boolean);return r.length?[...r.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 Qt="https://www.aftonbladet.se/video-player-extras/latest/";class Zt{handleVideo(e,t){return A(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){const s={id:t,node:n,autoplay:i,mute:r,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${Qt}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${Qt}external-link.js`]:{name:"ExternalLink"}}};yield Kt(s),this.addEditionVideoClass(e)})}addEditionVideoClass(e){var t;(null===(t=null==e?void 0:e.parentElement)||void 0===t?void 0:t.parentElement)&&e.parentElement.parentElement.classList.add("dr-edition-video-player")}getPulseObjectId(){return""}getPulsePageId(){return""}}class Xt{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const en=(e,t,n)=>{const{publisher:i,pageType:r,country:o}=e,s={[S.VG]:new qt,[S.E24]:new Yt,[S.AFTONBLADET]:new Zt}[i]||new Xt,a=new(o===c.SE?zt:Ut)(n,s,r),d=new _t(t,null==n?void 0:n.pulseTracker),l=new Bt(s,a),u=new Ft(s);return new Dt(d,l,u,a)},tn=(e,t,n)=>{const{wrapperSelector:i}=null==e?void 0:e.drEditionConfig,r=document.querySelectorAll(i),o=new IntersectionObserver((i,r)=>((e,t,n,i,r)=>{const o=en(n,i,r);e.forEach(e=>{var i,r,s;if(!e.isIntersecting)return;const a=e.target,d=null!==(i=a.dataset.editionName)&&void 0!==i?i:"",l=null!==(r=a.dataset.pulseColumnname)&&void 0!==r?r:"",c=null!==(s=a.dataset.pulsePrimaryposition)&&void 0!==s?s:"";o.fetchAndRenderAd(a,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(a)})})(i,r,e,t,n),{rootMargin:"400% 0px"});r.forEach(e=>o.observe(e))},nn=[],rn=(e,t)=>A(void 0,void 0,void 0,function*(){var n;const{pulse:i,tcf:r,deviceType:o,drEdition:s,publisher:a,pageType:d,country:l}=e,c=((e,t)=>{var n;const{deviceType:i,placements:r,drEdition:{fallbackGlobalEditionName:o}={}}=e,s=r[i]||r.desktop,a=mt(t.targetId),d=s.find(e=>e.id===a),l=jt.some(e=>a.startsWith(e)),c=nn.includes(a),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(nn.push(a),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(e,t);if(!c)return;if(!(null==i?void 0:i.instance))return void L("Pulse has not been passed as a prop, aborting");const u=yield V(),v=new W(u),p=en({publisher:a,pageType:d,country:l},v,null==i?void 0:i.instance),g=document.getElementById(t.targetId);if(!g||!s)return;g.classList.value="";const m=document.createElement("div");m.className=s.containerSelector.replace(/^[.#:[\]]+/,""),g.innerHTML=m.outerHTML;const h={editionName:(null===(n=null==c?void 0:c.drEdition)||void 0===n?void 0:n.editionName)||"",drEditionConfig:s,device:o,tcf:r,renderAsBackfill:!0};yield p.fetchAndRenderAd(g,h)}),on="collapseAd",sn="hideAd",an="resizeAd",dn="renderDrEditionFallback",ln="wallpaperImageUrl",cn="wallpaperColor",un=[an,ln,cn,on,sn,dn],vn=e=>{if("object"==typeof e)return e;if(t=e,Tt.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:ln,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:cn,wallpaperColor:t}}if(e.startsWith(dn)){const t=e.split(":")[1];return{name:dn,targetId:t}}if(e.startsWith(on)||e.startsWith(sn)){const t=e.split(":")[1];return{name:on,targetId:t}}if(e.includes("name")&&un.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},pn=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=vn(t);if(!n)return;if(!n.name||!un.some(e=>n.name===e))return;const{name:i,targetId:r,wallpaperImageUrl:o,wallpaperColor:s,cmd:a,size:l}=n;i!==on&&i!==sn||!r||It(r),i===an&&r&&a&&Nt(r,a),i===dn&&r&&(It(r),rn(d.get(),{targetId:r})),"resizeMediationAd"===i&&r&&l&&Nt(r,l,!0),i===ln&&o&&(e=>{const t=document.querySelector(`.${ft}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),i===cn&&s&&(e=>{const t=document.querySelector(`.${ft}`);t&&(t.style.backgroundColor=e)})(s)},gn=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),mn=()=>{const{publisher:e,country:t,finnBlink:n}=d.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:r}}=d.getHandlers(),o=window.apntag,s={publisher:e,country:t,finnBlink:n},a=e=>{St(e),Ae(()=>o.showTag(e))};return{withXandrAd:a,withFinnBlinkAd:e=>A(void 0,void 0,void 0,function*(){yield i(e,s,null)}),withFullAdsChain:e=>A(void 0,void 0,void 0,function*(){yield i(e,s,a,()=>{P.getData("horseshoe").isAvailable&&r(e)})})}},hn=(e,t)=>{if(Be(t))return L(`loading finn blink ad with full ads chain for ${t}`),void mn().withFullAdsChain(t);Ae(()=>(L("core showTag",{id:t}),e.showTag(t)))},yn=(e,t)=>A(void 0,void 0,void 0,function*(){yield Oe,yield Pe;const n=new IntersectionObserver((e,t)=>((e,t,n)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:i}=e,r=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(i),o=document.getElementById(r);L("core log from intersection observer handler",{targetId:r,element:o}),n(window.apntag,r),o&&(t.unobserve(o),t.disconnect())})})(e,t,hn),gn(t));n.observe(e)}),fn=new Map,wn=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],bn=".brandstudio-premium-content-widget",En=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),Tn=({adWrapper:e,placementContainer:t})=>{const n=En({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),$t(i=t),i.innerHTML=""},In=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},Sn=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=d.get(),i=wn.includes(n)&&Boolean(t.closest(bn));const r=i?t.closest(bn):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,s=n&&t.matches("iframe, article")&&e;if(!n||!i&&!s||i&&!r)return;if(s)return In(e),void o.disconnect();const a=t.closest('[style*="height"]'),d=r;a&&d.contains(a)?In(a):d.hasAttribute("style")&&In(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},Cn=(e,t,n,i,r,o)=>{var s;const a=performance.now(),d=null!==(s=fn.get(t))&&void 0!==s?s:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,r)&&n<0;a-d>=r&&l&&(fn.set(t,a),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&Tn({adWrapper:i,placementContainer:n}),Ae(()=>{e.setKeywords([t],{[`${u()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},$n=(e,t,n,i)=>{const r=new IntersectionObserver((e,t)=>((e,t,n,i)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:r,boundingClientRect:o}=e;t(window.apntag,r.id,o.y,n,i,r)})})(e,Cn,n,i),gn(t));r.observe(e)},kn=(e,t=6)=>{const n=[];for(let i=0;i<e.length;i+=t){const r=e.slice(i,i+t);n.push(r)}return n},An=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),On=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},Pn=(e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,i=document.querySelector(`#${n}`),r=null==i?void 0:i.parentElement;if(!r||!i)return;Sn({adWrapper:r,placementContainer:i});const{delayTime:o=1e3}=t,s=(new Date).getTime();if(i&&"true"!==i.dataset.subscribedForRefresh){const e=(e=>{var t;const{deviceType:n,preloadMarginsConfig:i}=d.get(),r=null==i?void 0:i[n];return((e,t)=>t[e])(null!==(t=e.dataset.priority)&&void 0!==t?t:"normal",(({high:e,normal:t,low:n}={})=>{var i,r,o,s,a,d;return{high:{refreshMargin:null!==(i=null==e?void 0:e.refreshMargin)&&void 0!==i?i:600,renderMargin:null!==(r=null==e?void 0:e.renderMargin)&&void 0!==r?r:300},normal:{refreshMargin:null!==(o=null==t?void 0:t.refreshMargin)&&void 0!==o?o:300,renderMargin:null!==(s=null==t?void 0:t.renderMargin)&&void 0!==s?s:150},low:{refreshMargin:null!==(a=null==n?void 0:n.refreshMargin)&&void 0!==a?a:100,renderMargin:null!==(d=null==n?void 0:n.renderMargin)&&void 0!==d?d:50}}})(r)).refreshMargin})(i);i.dataset.subscribedForRefresh="true",i.dataset.refresh&&$n(i,e,s,o)}},Ln=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=d.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),Nn(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},xn=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=d.get();if(!t)return;e.forEach(({id:e})=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement;n&&(n.dataset.bfCacheRefresh="true")});const r=()=>{const t=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const i of t){const t=e.find(e=>{var t;return e.id===(null===(t=i.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),r=null==t?void 0:t.threshold;On(i,r)&&t&&(Ct(t.id),n.length&&i.classList.remove(...n),Nn([t]))}};i&&document.addEventListener("visibilitychange",r),window.addEventListener("pageshow",e=>{const t=()=>{window.scrollY>0&&(window.removeEventListener("scroll",t),r())};e.persisted&&(An()?window.addEventListener("scroll",t,{passive:!0}):r())})},Nn=e=>{const t=6,{requestSize:n=t}=d.get(),i=e.map(({id:e})=>e),r=kn(i,n);for(const e of r)Ae(()=>window.apntag.refresh(e))};const jn="#fff",_n="#0098da",qn="splash",Dn="welcomePage",Mn="topscroller";function Rn(e){const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null}function Bn(){const e=Rn("_pulse2data");return e?e.split(",")[2]:void 0}const Fn="takeover-displayed",Hn=()=>{const{takeover:{enabled:e=!1}={}}=d.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||e&&!zn())},zn=()=>{var e;return"true"===Rn((null===(e=d.get().takeover)||void 0===e?void 0:e.cookieCapName)||Fn)},Un=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),Vn=()=>{const{takeover:e}=d.get();return Boolean(null==e?void 0:e.topscroller)},Wn=()=>{var e,t,n;const i=document.location.hostname,r=(null===(e=d.get().takeover)||void 0===e?void 0:e.cookieCapName)||Fn,o=void 0===(null===(t=d.get().takeover)||void 0===t?void 0:t.cookieCapTime)?14400:null===(n=d.get().takeover)||void 0===n?void 0:n.cookieCapTime;o&&(window.document.cookie=`${r}=true; max-age=${o}; domain=${i}; path=/`)},Kn=e=>{var t;const n=!!(null===(t=d.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return je(e)&&n},Gn=(e,t)=>{var n;if(t===Mn){const{topscroller:t}=e;return null!=t?t:{}}if(t===qn){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},Jn=(e,t)=>{t!==qn?(e=>{var t,n,i;const r=null===(n=null===(t=d.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(i=d.get().takeover)||void 0===i?void 0:i.topscroller;if(!r||o)return;const s=document.querySelector(r),a=document.querySelector(".welcome-page-wrapper"),l=document.querySelector(`#${e.targetId}`),c=document.querySelector(".advertory-welcome-page-scroll");if(!(s&&a&&c&&l))return;const u=null==s?void 0:s.offsetHeight,v=_e(e)?"60svh":`calc(100svh - ${u}px)`,p=_e(e)?"calc(40svh + 30px)":`calc(${u}px + 30px)`;a.style.setProperty("height",v,"important"),l.style.setProperty("height",v,"important"),c.style.setProperty("bottom",p,"important")})(e):(e=>{var t;if(!(null===(t=d.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 r=`calc(100svh - ${n.offsetHeight}px)`;i.style.setProperty("height",r,"important")})(e)},Yn=Ye([],()=>{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})}),Qn=(e,t=!0)=>{(e===Dn||e===Mn)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},Zn=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},Xn=e=>{document.body.style.overflow=e?"initial":"hidden"},ei=e=>{const t=ni(e),n=ti(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),Xn(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},ti=e=>{const t=()=>ei(e);return window.addEventListener("advertory:closeTakeover",t),Zn(),t},ni=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&ei(e)};return Zn(),window.addEventListener("keydown",t),t},ii=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(ni(e),ti(e),t.addEventListener("click",()=>{ei(e),Zn()}),Xn(!1))},ri=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),ti(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},oi=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=d.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=dt.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},si=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=dt.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},ai=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=dt.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},di=()=>{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)},li=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${Yn})()`,e+t.outerHTML})(e)),n},ci=e=>{const t=(e=>{const{requests:t}=window.apntag,n=Je(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=Je(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,li(t))},ui=(e,t)=>{const{takeover:n}=d.get(),{targetId:i}=e,r=document.querySelector(`#${i}`),o=document.querySelector(".advertory-takeover-wrapper");if(!r||!o||!n)return;const s=(e=>{const{width:t,height:n}=e;return Un(t,n)?qn:Vn()?Mn:Dn})(e),a=o.offsetHeight,l=window.scrollY>a;var c,u;o.style.display="block",!l&&Qn(s,!1),((e,t)=>{({[Dn]:ai,[qn]:oi,[Mn]:si})[t](e)})(o,s),di(),c=o,u=s,{[Dn]:ri,[Mn]:ri,[qn]:ii}[u](c),((e,t,n)=>{if(!n)return;({[Dn]:()=>{const{buttonLabel:i}=Gn(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:"")})},[qn]:()=>{const{themeColors:i,logotype:r,buttonLabel:o,showArrowIcon:s}=Gn(n,t);["#advertory-splash-close-label",".advertory-splash-close","#advertory-splash-logotype",".advertory-splash-navbar-wrapper"].forEach(t=>{const n=e.querySelector(`${t}`);if(n){if("#advertory-splash-close-label"===t&&(n.innerText=null!=o?o:""),".advertory-splash-close"===t&&s){const e=document.createElement("img");e.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAfQAAAH0Bx0gPAAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNtdPJCYBADEDRzzRmE3ZgEV6tRHHpzELiIQrBZRajA7lk4EE2RIQjgApYgdbmY8EJaADZo3sDBKAvQa4JRYZc5D6pyJiDPMuKTCkkXp8icwxJd1mRxSC1/Q94328luJroGqNrkdyrzAfHVHzOG+8CKlLk+LO+AAAAAElFTkSuQmCC"),e.setAttribute("alt","close ad"),n.appendChild(e)}if("#advertory-splash-logotype"===t&&r&&(n.setAttribute("src",r.url),n.setAttribute("alt",r.alt)),".advertory-splash-navbar-wrapper"===t&&i){const{backgroundColor:e,color:t}=i;n.style.setProperty("background-color",null!=e?e:jn,"important"),n.style.color=null!=t?t:_n}}})},[Mn]:()=>{const{buttonLabel:i,showArrowIcon:r,showCloseButton:o=!0}=Gn(n,t);["#advertory-topscroller-scroll-label","#advertory-topscroller-scroll-image",".advertory-topscroller-close"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(".advertory-topscroller-close"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||r||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=i?i:""))})}})[t]()})(o,s,n),Wn(),!l&&Qn(s,!0),Jn(e,s)},vi="advertory-brandmetrics-survey",pi=()=>A(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n}=d.get();if(!e||n)return;const i=(e=>{const{ppid1:t,ppid2:n}=we.getPPIDs(),{ppid1:i,ppid2:r}=be.getPPIDs(),o=(new fe).add(n,q[e]).add(t,D[e]).add(r,M[e]).add(i,R[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{A(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===c.NO?"schibsted":"schibstedse"}/map/${i}`,"norstat")}),gi={nativeAd:e=>xe(e)&&!Me(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:Ne,fullscreenScroll:Le,topscroller:e=>je(e)&&Vn(),splash:e=>je(e)&&Un(e.width,e.height),welcomePage:je,wallpaper:qe,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:Ve,hFormat:We,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!We(e)&&!Ve(e),topboard:e=>e.targetId.startsWith("topboard")&&!je(e),widescreen:e=>e.targetId.startsWith("widescreen"),insider:e=>e.targetId.startsWith("insider"),sponsorstripe:Me,brandboard:e=>Re(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!Ue(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>Fe(e)||He(e),panorama:ze,midboard:Ue},mi=({adObj:e,preferredTestIdData:t})=>{var n,i;const r=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!r)return;const o=null===(i=document.querySelector(`#${r}`))||void 0===i?void 0:i.parentElement;if(!o)return;if(((e,t)=>{var n,i,r,o;const s=null===(o=null===(r=null===(i=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===i?void 0:i.tags)||void 0===r?void 0:r[e])||void 0===o?void 0:o.invCode;s&&(t.dataset.invCode=s)})(r,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const s="DIV"===(null==o?void 0:o.tagName);e&&s&&((e,t)=>{var n,i;for(const[r,o]of Object.entries(gi))if(o(e)){if("nativeAd"===r){const o="default";t.dataset.testid=`${r}-${null!==(i=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==i?i:o}`;break}t.dataset.testid=r;break}})(e,o)},hi=e=>{var t;return(null===(t=Object.entries(gi).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},yi=new Map;yi.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),yi.set("panorama",{scale:.79,transformOrigin:"center center"}),yi.set("outstream",{scale:.79,transformOrigin:"center center"}),yi.set("integration",{scale:.79,transformOrigin:"center center"}),yi.set("toppanorama",{scale:.8,transformOrigin:"left center"});const fi=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=hi(e),r=yi.get(i),o=document.querySelector(`#${e.targetId}`);if(!o||!r)return;if(o.style.transformOrigin=r.transformOrigin,o.style.transform=`scale(${r.scale})`,!(null==r?void 0:r.cogwheelAdjust))return;const s=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),a=null==o?void 0:o.offsetWidth;s&&"number"==typeof a&&!isNaN(a)&&s.style.setProperty("right",String(-1*a*.2)+"px")},wi=e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.querySelector("iframe"),i=null==n?void 0:n.parentElement,{siteSpecificConfig:{publisherClassName:r,fullWidthFormatClassName:o}={}}=d.get();if(!t||!n||!i)return;const s=window.innerWidth,a=Math.round(s/1080*1920);t.style.width="100%",t.style.height=`${a}px`,t.classList.add(`advertory-${r}-${o}__vertical-full-width-ad`);const l=((e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1})(e,t.offsetWidth);i.style.transform=`scale(${l})`,i.style.transformOrigin="left top"},bi=(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,Ei=e=>`externalImpId:'${e}'`,Ti=e=>{var t;const{forwardExternalImpId:n=!1,tracker:i}=d.get(),{id:r,sizes:o,keywords:s,allowedFormats:a,invCode:l,ssa:c=!1,nativeCustomProperties:u,safeframeConfig:p,resizeAdParentDiv:g=!1,dynamicSizeWidthCheck:m=!1}=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${v()}-count`],i=e.positionConfig.find(e=>e.adPositionIndex===n);if(!i)return e;const r=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:r})})(e),h=Object.assign({invCode:l,sizes:o,targetId:r,keywords:bi(s,c),allowedFormats:a,resizeAdParentDiv:g,dynamicSizeWidthCheck:m},p&&{safeframeConfig:p}),y=(e=>{var t,n,i,r,o,s,a;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)?(L("Tracker state pageViewId is:",null===(o=null===(r=null==e?void 0:e.instance)||void 0===r?void 0:r.state)||void 0===o?void 0:o.pageViewId),null===(a=null===(s=null==e?void 0:e.instance)||void 0===s?void 0:s.state)||void 0===a?void 0:a.pageViewId):(L("Tracker state does not contain field pageViewId or it is empty"),""):(L("Tracker state is empty"),""):(L("Tracker is not configured in initAdvertory function"),"")})(i);n&&y&&(L("External Impression ID assigned to defineTag:",Ei(y)),h.externalImpId=Ei(y));const f=(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"))&&(h.native=f),h},Ii=(e,t,n,i)=>{const r=t.parentElement;if(!r)return;const o=e?`-${e}`:"",s=i?`__${i}`:"",a=`advertory${o}-${n}${s}`,d=`advertory${o}-${n}-wrapper${s}`;t.classList.remove(...t.classList),r.classList.remove(...r.classList),t.classList.add(a),r.classList.add(d),t.dataset.adType=n},Si="finn-blink",Ci="native-ad",$i=e=>{const{publisher:t=""}=d.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`)},ki=e=>{if(!e)return e;const t=e[`${u()}-targetid`],n=t?mt(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${u()}-targetid`]:[n]})},Ai=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${u()}-geo`]&&{[`${u()}-geo`]:["geo-test-value"]}),e[`${u()}-geofence`]&&{[`${u()}-geofence`]:["geofence-test-value"]}),e[`${u()}-weather`]&&{[`${u()}-weather`]:["weather-test-value"]}),Oi=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],r=e.find(e=>e.invCode===i),o=document.querySelector(`[id^=${null==r?void 0:r.id}]`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})})(e),(()=>{var e;const t=new URLSearchParams(window.location.search).get("scrollToDrEditionPlacement");if(!t)return;const n=null!==(e=document.querySelector(`[id*="${t}}"]`))&&void 0!==e?e:document.querySelector(`a[aria-label*="${t}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"start"})})()},Pi=()=>A(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)}}),Li={arrayMerge:(e,t)=>t},xi=e=>A(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=>A(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 Q.get(t,{method:"GET",signal:n.signal})}catch(e){throw L("Failed to fetch S3 config",{error:e,url:t}),e}finally{clearTimeout(i)}}))(e);return t?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:r,refresh:o,placements:s,threshold:a,batchSize:d}=t,l=i.all([e.placements,s],Li),c=i(e.pageOptions,{keywords:r},Li),u=i(e.appearanceConfig,{defaultThreshold:a},Li),v=i(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:o},Li);return Object.assign(Object.assign({},e),{placements:l,requestSize:null!=d?d:e.requestSize,pageOptions:c,appearanceConfig:u,refreshConfig:v})})({siteConfig:e,configOverrides:t}):e}catch(t){return L("Error fetching S3 config, using site config",{error:t}),e}});let Ni,ji=[];const _i=["takeover","wallpaper"],qi=e=>{const t=(e=>{const t=P.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:r,glimr:o,appearanceConfig:a,requestSize:d=s,publisher:l,country:c,pageType:u,deviceType:v,isMobileApp:p=!1,pageOptions:{member:g},takeover:m,fullscreenScroll:h}=e;return{xandr:{member:g,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:l,country:c,pageType:u,deviceType:v,placements:i,tcf:r,requestSize:d,isMobileApp:p},o&&{glimr:o}),n&&{queryConfig:n}),a&&{appearanceConfig:a}),m&&{takeover:m}),h&&{fullscreenScroll:h})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},Di=()=>A(void 0,void 0,void 0,function*(){const{pageOptions:e}=d.get(),{preparePageOptions:t}=d.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=d.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 t(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},e),{renderingManagement:Object.assign({},n)}));(e=>{const t=P.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=Ai(e);P.setData("alertoryConfigKeywords",n)})(i.keywords),Ae(()=>Ni.setPageOpts(i))}),Mi=e=>{const{prebid:t}=d.get();Ri(e),(null==t?void 0:t.enabled)?(L("core loadPlacements prebid enabled"),Se()):(L("core load tags invoked without prebid enabled"),Bi(e))},Ri=e=>{const{prepareTag:t}=d.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)),r=t.findIndex(e=>n.id.includes(e));return-1!==i&&-1===r?-1:-1===i&&-1!==r?1:i-r})})(e).forEach(e=>{L("core defineTags",{placement:e});const i=Ti(e);if(!e.id.includes("takeover")||Hn()){const r=t(i),o=(e=>{const{allowedFormats:t,invCode:n,keywords:i,sizes:r}=e;return{adTypes:t,invCode:n,keywords:ki(i),sizes:r}})(r);n.push(o),Ae(()=>(L("core defineTag - add to the queue",{placement:e,preparedTag:r}),Ni.defineTag(r)))}}),(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)},Bi=e=>{const t=e.map(({id:e})=>e);Ae(()=>(L("core loadTags",{placementsIdsToLoad:t}),Ni.loadTags([...t])))},Fi=(e,t)=>A(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:i}=d.get(),{threshold:r,refresh:o,priority:s="normal"}=e,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),l=null==n?void 0:n.defaultThreshold[i];a&&(L("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:r,deviceDefaultThreshold:l}),yield yn(a,null!=r?r:l)),a&&o&&(L("core showAd - setup refreshing",{placement:e,adObj:t}),a.dataset.refresh=o.toString(),a.dataset.priority=s)}),Hi=e=>e.some(({id:e})=>_i.some(t=>e.includes(t))),zi=e=>A(void 0,void 0,void 0,function*(){var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return;const n=6,{requestSize:i=n}=d.get(),r=xt(e);for(const e of Object.keys(r)){const t=r[e];Hi(t)?Mi(t):t.length&&Ui(t,i)}}),Ui=(e,t)=>{const n=kn(e,t);for(const e of n)L("core loadAds with lazy loading",{placementsToLoad:e}),Vi(e)},Vi=e=>{const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=d.get(),i=[];if(!t)return L("lazy load is not enabled",{placements:e}),void Mi(e);const r=new IntersectionObserver((t,n)=>{t.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(t=>{L("lazy load is enabled - handler start",{loadedPlacementIds:i,placements:e});const r=e.every(e=>i.includes(e.id)),o=e.map(e=>e.id);!r&&i.push(...o),!r&&Mi(e),L("lazy load is enabled - handler stop",{loadedPlacementIds:i,placements:e,arePlacementsLoaded:r,placementIds:o}),n.disconnect()})},{rootMargin:n});e.forEach(e=>{const t=document.getElementById(e.id);t&&(L("lazy loading - observe element",{placementId:e.id,element:t}),r.observe(t))})},Wi=()=>A(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:t,wallpaperHandlers:{initWallpaperAd:n,adjustAdToHorseshoe:i}}=d.getHandlers(),{wallpaper:r,fullscreenScroll:o}=d.get(),s=[];Ae(()=>{Ni.onEvent("adRequested",()=>{e.adRequested()}),Ni.onEvent("adAvailable",i=>A(void 0,void 0,void 0,function*(){var s,a,l,c,u,v;L("core adAvailable start",{placementsAvailable:ji,adObj:i,isFullscreenScrollAd:Le(i),isFinnBlink:Be(i.targetId),isNativeAd:xe(i),isMediation:C(i),isTakeoverAd:je(i),isCollapseAd:De(i),isWallpaperAd:qe(i)});const p=null===(l=null===(a=null===(s=null===window||void 0===window?void 0:window.apntag)||void 0===s?void 0:s.requests)||void 0===a?void 0:a.tags[i.targetId])||void 0===l?void 0:l.adResponse.ads;C(i)&&p&&(null===(c=p[1])||void 0===c?void 0:c.rtb)&&(i.banner=null===(v=null===(u=p[1])||void 0===u?void 0:u.rtb)||void 0===v?void 0:v.banner),Le(i)&&gt(i),Le(i)&&!Be(i.targetId)&&pt(i,o),!xe(i)||C(i)||Be(i.targetId)||t(i,d.get()),je(i)&&!De(i)&&(ci(i.targetId),ui(i)),qe(i)&&(n(()=>Ae(()=>window.apntag.showTag(i.targetId)),r),P.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(i)&&P.setData("horseshoe",{isAvailable:!0}),mi({adObj:i}),e.adAvailable(i);const g=ji.find(({id:e})=>e===i.targetId);g&&(yield Fi(g,i),ji=ji.filter(e=>e.id!==g.id)),L("core adAvailable stop",{placementsAvailable:ji,adObj:i,isFullscreenScrollAd:Le(i),isFinnBlink:Be(i.targetId),isNativeAd:xe(i),isMediation:C(i),isTakeoverAd:je(i),isCollapseAd:De(i),isWallpaperAd:qe(i)})})),Ni.onEvent("adLoaded",n=>{const{refreshConfig:r,appearanceConfig:o}=d.get(),a=document.getElementById(n.targetId);Be(n.targetId)&&(e=>{const{fullscreenScroll:t}=d.get(),{initNativeAd:n}=d.getHandlers();Le(e)&&pt(e,t),xe(e)&&n(e,d.get())})(n);s.includes(n.targetId)&&xe(n)&&(t(n,d.get()),mi({adObj:n})),!s.includes(n.targetId)&&C(n)&&s.push(n.targetId),De(n)&&It(n.targetId),je(n)&&((e,t)=>{var n;const i="100%",r="100%";e.resizeAd(t,[i,r]);const o=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(o),t=e.width,n=e.height;t===i&&n===r||(o.style.width=i,o.style.height=r)}}).observe(o,{attributes:!0,attributeFilter:["style"]})})(Ni,n.targetId),Ne(n)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=d.get();if(!t||!n||!i)return;const r=t.parentElement;r&&(t.classList.add(`advertory-${n}-${i}__full-width-ad`),r.classList.add(`advertory-${n}-${i}-wrapper__full-width-ad`))})(n),(e=>Ke(e,m))(n)&&wi(n),Pn(n,r),(null==o?void 0:o.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(n.targetId);var l,c;P.getData("horseshoe").isAvailable&&i(n.targetId),e.adLoaded(n),l=n.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${l}`)&&(null===(c=window.gdpr)||void 0===c?void 0:c.setupButton)&&window.gdpr.setupButton(l),a&&a.classList.add("ad-loaded"),fi(n),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:n.targetId,adFormat:hi(n)}}))}),Ni.onEvent("adNoBid",t=>A(void 0,void 0,void 0,function*(){It(t.targetId),yield rn(d.get(),t),Kn(t)&&Wn(),e.adNoBid(t)})),Ni.onEvent("adError",(t,n)=>{Kn(n)&&Wn(),e.adError(t,n)}),Ni.onEvent("adCollapse",()=>{e.adCollapse()}),Ni.onEvent("adRequestFailure",t=>{It(t.targetId),e.adRequestFailure(t)}),Ni.onEvent("adBadRequest",t=>{It(t.targetId),e.adBadRequest(t)}),Ni.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),Ni.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),Ki=(e,t)=>A(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:r,renderFinnBlinkPlacements:o,contextSelector:s}=null!=t?t:{};if(i)return kt(),[];r&&(kt(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{St(e.id)})),l(null!=e?e:{}),yield Di();let a=Pt(s);return o&&(a=a.filter(e=>Be(e.id))),a.length>0&&(ji=[...ji,...a.map(e=>Object.assign({},e))],Ln(a),xn(a),yield zi(a)),ji}),Gi=(e,t)=>A(void 0,void 0,void 0,function*(){var n;d.set(e),d.setHandlers(t),P.initialize(),window.addEventListener("message",pn,!1),Ni=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=Ni,yield X(),yield Promise.allSettled([A(void 0,void 0,void 0,function*(){const{prebid:e}=d.get();(null==e?void 0:e.enabled)&&(yield Ie(null==e?void 0:e.url))}),(n={country:e.country,tracker:e.tracker},A(void 0,[n],void 0,function*({country:e,tracker:t,timeout:n=1e3}){t&&(yield Promise.allSettled([we.processPPIDs(t,n),be.processPPIDs(t,e)])).forEach((e,t)=>{"rejected"===e.status&&L(`Cannot fetch PPIDs v${t+2}`,e.reason)})})),A(void 0,void 0,void 0,function*(){const{astUrl:e}=d.get();yield Ie(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),A(void 0,void 0,void 0,function*(){const{gptUrl:e}=d.get();yield Ie(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),A(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n}=d.get(),{getConsentSync:i}=ie(n),r=i();if(e&&t&&r){if(yield Ie(t),document.querySelector(`.${vi}`))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(vi)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),de(),A(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=d.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield Ie(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield pi(),yield Wi(),yield Di(),qi(e),ji=Pt(),Ln(ji),xn(ji),yield zi(ji),Oi(ji),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>A(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;const n=yield V(),i=new W(n);tn({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)}),Ji=(e,t)=>A(void 0,void 0,void 0,function*(){const{initConsentManager:n}=ie(e.tcf),i=yield xi(e);var r;yield Pi(),yield(r=n,A(void 0,void 0,void 0,function*(){return yield new Promise(e=>{r().then(t=>{e(null!=t?t:null)}).catch(t=>{e(null)})})})),yield Gi(i,t)}),Yi={Blink:"Blink"},Qi=(e,...t)=>A(void 0,[e,...t],void 0,function*(e,{timeout:t}={timeout:1e3}){Array.from(document.querySelectorAll('script[type="module"]')).some(t=>{var n;return null===(n=t.textContent)||void 0===n?void 0:n.includes(`import(${JSON.stringify(e)})`)})||(yield new Promise((n,i)=>{const r=document.createElement("script");r.async=!0,r.type="module",r.textContent=`(async () => {\n try {\n const moduleNamespace = await import(${JSON.stringify(e)});\n const allowedExports = ${JSON.stringify(Yi)};\n\n for (const key of Object.keys(allowedExports)) {\n const exportedValue = moduleNamespace[key];\n \n if (exportedValue !== undefined) {\n window[allowedExports[key]] = exportedValue;\n }\n }\n } catch (error) {\n console.error('ESM load failed: ', error);\n }\n })();`;const o=()=>{a(),n()},s=()=>{a(),i(new Error(`Failed to load ${e}`))},a=()=>{r.removeEventListener("load",o),r.removeEventListener("error",s),clearTimeout(d)};r.addEventListener("load",o),r.addEventListener("error",s);const d=setTimeout(()=>{a(),i(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(r)}).catch(e=>{console.error(e)}))}),Zi="https://assets.finn.no/pkg/distribution-fixed/v1/FINNExternalDistribution.modern.js",Xi="finn_blink_id",er=e=>A(void 0,void 0,void 0,function*(){const{id:t,hashed_email:n,theme:i}=e,r=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 r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["id","hashed_email","theme"]),o=window[Yi.Blink];if(!o)return;const s=new o({remote:"https://www.finn.no/distribution-front/external/carousel",id:t,hashed_email:n,theme:i});yield s.inject(r)}),tr=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},nr=(e,t)=>{const{finnBlink:{enabled:n}={}}=d.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:r,height:o,requireImage:s,theme:a,rec:l,distributionTypes:c,position:u,offset:v,advertoryTheme:p}=t||{};return{selector:`#${tr(e)}`,enabled:i,position:null!=u?u:e,distributionTypes:null!=c?c:[],limit:null!=r?r:100,height:null!=o?o:100,offset:null!=v?v:200,requireImage:s,rec:l,theme:"dark"===a?"dark":"light",advertoryTheme:p}},ir=(e,t,n)=>A(void 0,void 0,void 0,function*(){const{placements:i,deviceType:r}=d.get();L(`rendering finn blink ad for ${e}`);const o=mt(e),s=i[r].find(e=>e.id===o),a=nr(e,null==s?void 0:s.finnBlink),{publisher:l,country:c,finnBlink:u}=t,{userId:v,uuid:p,channel:g,theme:m}=null!=u?u:{},h=null!=g?g:`${l}.${c}`,y=(e=>{if(!e){const e=Bn();return null!=e?e:""}return e})(v),f="dark"===m?"dark":"light";if(!(null==a?void 0:a.enabled))return L(`Finn blink is not enabled on placement: ${e}`),n&&n(e),void $i(e);if((e=>{var t;const n=tr(e),i=document.querySelector(`[id^="${n}"]`);return!!(null===(t=null==i?void 0:i.classList)||void 0===t?void 0:t.contains("finn"))})(e))L(`Finn blink already loaded ${e}`);else try{const e=yield A(void 0,void 0,void 0,function*(){const{finnBlink:{identifierUrl:e}={}}=d.get(),t=j.get(Xi),n=T("finncode");if(!e||n)return"";if(!t){const t=yield Q.get(e,{credentials:"include"}),{finn_blink_id:n}=t;if(!n)throw new Error("getFinnBlinkIdentifier: No finn_blink_id found");return j.set(Xi,n),n}return t});yield er(Object.assign(Object.assign({},a),{hashed_email:e,channel:h,id:y,theme:f,uuid:p})).then(()=>{((e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={},pageType:i}=d.get(),r=document.querySelector(`#${e}`);if(!r)return;if(r.classList.add("disable-cogwheel"),!n)return;Ii(n,r,Si,null!=t?t:i),mi({preferredTestIdData:{targetId:e,testId:"finn"}})})(a.selector.replace("#",""),a.advertoryTheme)})}catch(t){L(`Finn blink error ${t}`),n&&n(e),!n&&It(e),$i(e)}}),rr=(e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={}}=d.get(),i=document.createElement("div"),r=document.createElement("div");return r.id=e,i.appendChild(r),Ii(n,r,Si),L(`Creating blink container for: ${e}`),i},or=(e,t)=>{var n;(L(`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)):L(`Cannot perform afterend on: ${e.id}`)},sr={publisherClassName:S.VG,fullWidthFormatClassName:"netboard"},ar=()=>{const{brandboard:e}=d.get();if(!e)return{sidebar:null,articles:[]};const t=document.querySelector(e.sidebarContainerSelector),n=t?Array.from(t.querySelectorAll(e.sidebarItemsContainerSelector)):[];return{sidebar:t,articles:n}},dr=e=>{const{articles:t}=ar();if(!t.length)return;const n=e.getBoundingClientRect(),i=n.top+window.scrollY;(e=>{e.forEach(e=>{e.style.marginTop="0px"})})(t);const r=((e,t)=>e.find(e=>!e.hidden&&e.getBoundingClientRect().bottom+window.scrollY>=t))(t,i);if(!r)return;const o=((e,t,n)=>{const i=e.getBoundingClientRect(),r=i.bottom+window.scrollY-t;return i.height-r+n})(r,i,n.height);r.style.marginTop=`calc(${o}px + 1rem)`},lr=e=>{dr(e),(e=>{const{sidebar:t}=ar();if(!t)return;new ResizeObserver(()=>dr(e)).observe(t)})(e)},cr=e=>{const t=document.getElementById(e.targetId);if(!t)return;const n=new IntersectionObserver(([t],n)=>{t.isIntersecting&&((e=>{const t=document.querySelector(`#${e}`);if(!(null==t?void 0:t.parentElement))return;t.parentElement.classList.add("brandboard-container");const n=t.parentElement;lr(n)})(e.targetId),n.disconnect())});n.observe(t)},ur=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")&&vr(i)},vr=e=>{const t=e.parentElement;t&&(t.style.display="none")},pr=e=>{const{deviceType:t}=d.get();navigator&&navigator.userAgent.match(/firefox/i)&&(e=>e===Mt.DESKTOP||"tablet"===e)(t)&&gr(e)},gr=e=>{var t,n,i,r,o,s,a,d;const l=C(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===(a=null===(s=null===(o=null===(r=null==c?void 0:c.adResponse)||void 0===r?void 0:r.ads)||void 0===o?void 0:o[l])||void 0===s?void 0:s.rtb)||void 0===a?void 0:a.banner)||void 0===d?void 0:d.content){const e="<style>body { margin:0 !important; }</style>";c.adResponse.ads[l].rtb.banner.content+=e}},mr={adRequested:()=>{},adAvailable:e=>{Re(e)&&cr(e),pr(e)},adLoaded:e=>{Me(e)&&(()=>{const e=document.querySelector("#advertory-vg-sponsorstripe-info");if(e){const t=document.querySelector("#sponsorstripe-info-open-button"),n=document.querySelector("#sponsorstripe-info-close-button");null==t||t.addEventListener("click",()=>ke(e,"flex")),null==n||n.addEventListener("click",()=>ke(e,"none"))}})()},adNoBid:e=>{const{finnBlink:t}=d.get();ur(e),(Fe(e)||He(e)||Re(e))&&((e,t)=>{A(void 0,void 0,void 0,function*(){const{deviceType:n}=d.get();if(!t||!Rt(n))return;yield Qi(Zi);const{replacementConfig:i}=t,r=document.querySelector(`[id^="${e}"]`);if(!r||!(null==i?void 0:i.sizes))return;const{sizes:o}=i,s=mt(e),a=rr(s);r.dataset.finnBlinkId=s,r.dataset.noBidAd="true",or(r,a),mn().withFinnBlinkAd(s)})})(e.targetId,t)},adError:(e,t)=>ur(t),adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},hr=9826;class yr{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=Mt.DESKTOP,isMobileApp:t}=d.get();if(t){return{"aa-sch-supply_type":`app_${e===Mt.MOBILE?"phone":Mt.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return A(this,void 0,void 0,function*(){return Object.assign(Object.assign({},e),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},e.keywords),this.getSupplyTypeKeywords()),this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(e.keywords)),user:{externalUid:this.getExternalUid(),dnt:this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){const e=this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}}getUserId(){return Bn()}getExternalUid(){return function(){const{tcf:e}=d.get(),{getConsentSync:t}=ie(e);if(!t())return;const n=Rn("_pulse2data");return n?n.split(",")[9]:void 0}()}isTrackingForbidden(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===this.getExternalUid()}getMember(){const{pageOptions:{member:e},testMember:t=hr}=d.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}=d.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){const{tcf:e}=d.get(),{getConsentSync:t}=ie(e);return{"aa-sch-cmp_advertising":t()?"1":"0"}}getPageTypeKeywords(){const{pageType:e}=d.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}=d.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 fr=new yr;function wr(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(),r=(()=>{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:r,mobileOS:["ios","android"].includes(r)?r:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}fr.prepare.bind(fr);const br=["aLOLE","xBqQj","1KaqJ","1nzXzK","opm8zV","4qKXKR","Ad9QgE"];function Er(e){return t=window.location.pathname.split("/").slice(-2,-1).pop()||"",br.includes(t)?{"no-sno-news-section":`${e}_doedsfall`}:{};var t}class Tr extends yr{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=Mt.DESKTOP}=d.get();return{"no-sno-device":this.getPageOptionsFormatDevice(e)}}}getAppTypeKeywords(){const{deviceType:e,isMobileApp:t}=d.get(),{OS:n,isHybridApp:i}=wr(t);return{"no-sno-apptype":n&&e&&i?`${n}_${this.getPageOptionsFormatDevice()}_hybrid`:"none"}}getObituariesKeywords(e){return Er(e)}}const Ir=new class extends Tr{prepare(e){return A(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(c.NO)),this.getInventoryTypeKeywords()),this.getPublisherKeywords()),this.getFormattedExternalIdKeywords()),this.getSupplyTypeKeywords()),this.getPageTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),this.getAdvertisingConsentKeywords()),this.getHasContextKeywords(e.keywords)),yield A(void 0,void 0,void 0,function*(){const{glimr:e}=d.get(),{addPublisherToGeo:t}={},n=yield ae();if(!(null==e?void 0:e.enabled)||!n)return L("No consent for getting glimr tags."),{};const i=u(),r=pe(t);return{[`${i}-geo`]:r.geoTags,[`${i}-weather`]:r.weatherTags,[`${i}-geofence`]:r.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=we.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({},Ee(c.NO)),{externalUid:this.getExternalUid()}),member:this.getMember()})})}};var Sr=Ir.prepare.bind(Ir);const Cr="native_override_desc2",$r=(e,t,n)=>{var i;const{image:r,icon:o,sponsoredBy:s,title:a,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(r),imgWidth:null==r?void 0:r.width,imgHeight:null==r?void 0:r.height,imgAltText:null!=a?a:"",logo:w(o),sponsoredBy:null!=s?s:"",title:null!=a?a:"",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)},kr=(e,t)=>{const n=(i=Cr,window.location.href.includes(i));var i;const r=new URLSearchParams(window.location.search).get(Cr),o=t.includes("native_recirc");return n&&r?r:(null==e?void 0:e.includes("recirc"))?o?"native_recirc":"recirc":(null==e?void 0:e.includes("sponsor"))?"sponsorstripe":null},Ar=(e,t)=>{const n=document.querySelector(`#${t}`);if(n)for(const t of Object.keys(e))n.style.setProperty(t,e[t])},Or=(e,t,n,i)=>{const r=document.querySelector(`#${e}`);r&&t&&(r.innerHTML=t,((e,t)=>{const n=e.parentElement,{publisher:i,pageType:r}=t,o=i&&Object.values(S).includes(i);n&&o&&Ii(i,e,Ci,r)})(r,n),i())},Pr=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:[])jr(i)}),t.dataset.tracked="true")})},Lr=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(Nr):window.apntag.fireImpressionTrackers(e)},xr=(e,t)=>{var n;let i=!1;const r=document.querySelector(`#${e.targetId}`);if(!r||!e.native)return;const{deviceType:o,appearanceConfig:s,nativeTrackingConfig:{fireImpressionsBasedOnAppearanceThreshold:a=!1}={}}=t,d=a?{rootMargin:`${l=null!==(n=null==s?void 0:s.defaultThreshold[null!=o?o:Mt.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,Lr(e),c.disconnect();break}},d);c.observe(r)},Nr=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?jr(e):window.navigator.sendBeacon(e)},jr=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},_r=(e,t,n)=>{const i=((e,t,n)=>{var i;const{displayTemplates:r,videoTemplates:o}=n,s="default";if(!e.native)return null;const{native:a,targetId:d}=e,{desc2:l=s}=e.native,u=l.toLowerCase(),v=null!==(i=kr(e.targetId,l))&&void 0!==i?i:u,p=dt[t.language||c.NO],g=$r(a,p,d);return(a.video?o[v]:r[v]||r.default)(g,t)})(e,t,n);Or(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{Pr(e),xr(e,t)})(e,t)})},qr=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),Dr="viewable",Mr="adClick";var Rr=e=>(t,n,i)=>{const{video:r,img:o,url:s}=t,{publisher:a,productTag:d}=n;if(!(null==r?void 0:r.content))return null;const l=Math.ceil(1e5*Math.random()),c=o||"https://custom.inventory.schibsted.io/1x1-00000000.png",u=`ad-player-${l}`,v=Br(r.content,s),p=Fr(l,u,c,v,a,d);return Hr({playerConfig:p,clickUrl:s,pluginsNames:i}),`${e(t,n,u)}`};const Br=(e,t)=>{const n=(new DOMParser).parseFromString(e,"text/xml"),i=n.querySelector("ClickThrough"),r=n.querySelector("VideoClicks");if(i){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(n.createCDATASection(t))}else if(r){const e=n.createElement("ClickThrough");e.appendChild(n.createCDATASection(t)),r.appendChild(e)}return URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(n)],{type:"text/xml"}))},Fr=(e,t,n,i,r="",o="xandr")=>({id:e,poster:n,vendor:"appnexus",node:t,mute:!0,skin:{name:"inventory-player",url:"https://ads.inventory.schibsted.io/styles/player.css"},settings:{jw:{stretching:"fill",advertising:{client:"vast",tag:i}}},pulse:{provider:r.toLowerCase(),decorator:e=>Object.assign(Object.assign({},qr(e)?e:{}),{provider:Object.assign(Object.assign({},qr(null==e?void 0:e.provider)?e.provider:{}),{productTag:o})})}}),Hr=e=>A(void 0,void 0,void 0,function*(){const{playerConfig:t,pluginsNames:n,clickUrl:i}=e,r=yield Kt(t);Jt(n),r.once("assetReady",()=>{Wt(r,n)}),r.on(Dr,e=>{const{viewable:t}=e;t?r.play():r.pause()}),r.on(Mr,()=>{window.open(i,"_blank")})}),zr=(e,t,n)=>{const i=e===Vt.ARTICLE||e===Vt.OTHER?.79:1;return{desktopTitleSize:t?Number(t)*i+"px":"clamp(22px, 3.6rem, 59px)",mobileTitleSize:n?`${n}px`:"clamp(22px, 3.6rem, 59px)"}},Ur={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},Vr=(e,t)=>{const n={"É":"E","é":"e","ü":"u"," ":" "};return[...e].reduce((e,i)=>e+(Ur[n[i]||i]||Ur.m)*t/1e3,0)},Wr=(e,t,n=12,i=300)=>{let r=n,o=i,s=n;for(;r<=o;){const n=Math.floor((r+o)/2);Vr(e,n)<=t?(s=n,r=n+1):o=n-1}const a=((e,t,n,i)=>{const r=Math.floor(e/t*(n-2));return r<i?i:r})(s,Vr(e,s),t,n);return{fontSize:a,content:e}},Kr=(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 r=t.slice(0,e).join(" "),o=t.slice(e).join(" "),s=Math.abs(r.length-o.length);s<i&&(i=s,n=[r,o])}return n})(e);return[Wr(n,t),Wr(i,t)]},Gr=({title:e,options:t})=>{if(!t)return e;const{pageType:n,appearanceConfig:{mainColumnWidth:i}={}}=t,r=n===Vt.ARTICLE||n===Vt.OTHER?"em":"rem";return Kr(e,(i||734)-64).map(({content:e,fontSize:t})=>`<span style="display: block; font-size: ${`${(t||16)/16}${r}`}">${e}</span>`).join("")},Jr=({containerId:e,url:t,adContent:n,logo:i,description:r,title:o,customTitle1:s,customTitle2:a},d,l)=>{const{desktopTitleSize:c,mobileTitleSize:u}=zr(null==d?void 0:d.pageType,s,a),v=Gr({title:o,options:d});return Ar({"--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="${o}" 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">${r}</div>\n <h2 class="ad-title">\n ${v}\n </h2>\n </div>\n </a>\n </div>\n </div>\n </div>\n </article>`},Yr=({containerId:e,adText:t,url:n,adFrom:i,sponsoredBy:r,title:o},s,a)=>`<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="${a}"></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} ${r}\n </span>\n <span class="title">${o}</span>\n </div>\n </a>\n </div>\n </article>`,Qr=({containerId:e,adText:t,url:n},i,r)=>{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>${o=t,o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${r}"></div>\n </div>\n <a class="ad-link" href="${n}" target="_blank"></a>\n </div>\n </div>\n </article>`;var o},Zr=["IntegrationMenu"],Xr={CONTENT:(e,t)=>{const{video:n}=e;return(null==n?void 0:n.content)?Rr(Jr)(e,t):(({containerId:e,url:t,adContent:n,logo:i,imgAltText:r,img:o,description:s,title:a,customTitle1:d,customTitle2:l,imgWidth:c,imgHeight:u},v)=>{const{desktopTitleSize:p,mobileTitleSize:g}=zr(null==v?void 0:v.pageType,d,l),m=c?`width="${c}"`:"",h=u?`height="${u}"`:"",y=Gr({title:a,options:v});return Ar({"--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="${a}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <img alt="${r}" class="ad-image" src="${o}" loading="lazy" ${m} ${h} />\n </div>\n <div class="ad-text-container">\n <div class="ad-description">${s}</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:r,sponsoredBy:o,imgWidth:s,imgHeight:a})=>`<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" ${s?`width="${s}"`:""} ${a?`height="${a}"`:""} />\n ${r&&`<img alt="${o}" class="ad-logo" src="${r}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">\n <span class="sponsor-name">${o}</span>${o?"- 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})=>`<article class="advertory-vg-ad-native-sponsorstripe">\n <div id="advertory-vg-sponsorstripe-info" class="ad-info">\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\n href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232"\n class="ad-info-link"\n >\n Les mer\n </a>\n </p>\n <button id="sponsorstripe-info-close-button" aria-label="Lukk">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n aria-hidden="true"\n >\n <path\n d="M6.91075 11.9107L8.8215 9.99999L6.91075 8.08925C6.58532 7.76381 6.58532 7.23618 6.91075 6.91074C7.23619 6.5853 7.76383 6.5853 8.08926 6.91074L10 8.82148L11.9108 6.91074C12.2362 6.5853 12.7638 6.5853 13.0893 6.91074C13.4147 7.23618 13.4147 7.76381 13.0893 8.08925L11.1785 9.99999L13.0893 11.9107C13.4147 12.2362 13.4147 12.7638 13.0893 13.0892C12.7638 13.4147 12.2362 13.4147 11.9108 13.0892L10 11.1785L8.08926 13.0892C7.76383 13.4147 7.23619 13.4147 6.91075 13.0892C6.58532 12.7638 6.58532 12.2362 6.91075 11.9107Z"\n fill="white"\n />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M10 19.1667C4.9374 19.1667 0.833344 15.0626 0.833344 9.99999C0.833344 4.93738 4.9374 0.833328 10 0.833328C15.0626 0.833328 19.1667 4.93738 19.1667 9.99999C19.1667 15.0626 15.0626 19.1667 10 19.1667ZM10 17.5C14.1421 17.5 17.5 14.1421 17.5 9.99999C17.5 5.85786 14.1421 2.49999 10 2.49999C5.85787 2.49999 2.50001 5.85786 2.50001 9.99999C2.50001 14.1421 5.85787 17.5 10 17.5Z"\n fill="white"\n />\n </svg>\n </button>\n </div>\n <div class="ad-wrapper">\n <button id="sponsorstripe-info-open-button" class="ad-open-button" aria-label="Sponset innhold - Klikk for detaljer">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n aria-hidden="true"\n >\n <path\n d="M10 5.83333C9.53977 5.83333 9.16668 6.20642 9.16668 6.66666C9.16668 7.1269 9.53977 7.49999 10 7.49999C10.4602 7.49999 10.8333 7.1269 10.8333 6.66666C10.8333 6.20642 10.4602 5.83333 10 5.83333Z"\n fill="white"\n />\n <path\n d="M9.16668 9.16666C9.16668 8.70642 9.53977 8.33333 10 8.33333C10.4602 8.33333 10.8333 8.70642 10.8333 9.16666V13.3333C10.8333 13.7936 10.4602 14.1667 10 14.1667C9.53977 14.1667 9.16668 13.7936 9.16668 13.3333V9.16666Z"\n fill="white"\n />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M10 19.1667C4.9374 19.1667 0.833344 15.0626 0.833344 9.99999C0.833344 4.93738 4.9374 0.833328 10 0.833328C15.0626 0.833328 19.1667 4.93738 19.1667 9.99999C19.1667 15.0626 15.0626 19.1667 10 19.1667ZM10 17.5C14.1421 17.5 17.5 14.1421 17.5 9.99999C17.5 5.85786 14.1421 2.49999 10 2.49999C5.85787 2.49999 2.50001 5.85786 2.50001 9.99999C2.50001 14.1421 5.85787 17.5 10 17.5Z"\n fill="white"\n />\n </svg>\n </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:r,customTitle1:o,customTitle2:s},{appearanceConfig:a})=>{const{isDarkModeEnabled:d}=null!=a?a:{},l=o?`${o}px`:"clamp(10px, 2rem, 30px)",c=s?`${s}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"];Ar({"--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">${r}</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)=>Rr(Qr)(e,t,Zr),DEFAULT:({containerId:e,url:t,adText:n,img:i,logo:r,adFrom:o,sponsoredBy:s,title:a,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="${a}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n ${r&&`<img alt="${s}" class="ad-logo" src="${r}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">${o} ${s}</span>\n <span class="title">${a}</span>\n </div>\n </div>\n </a>\n</article>`,RECIRC:({containerId:e,url:t,title:n,img:i,adText:r,sponsoredBy:o,logo:s,description:a,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="${o}" class="ad-logo" src="${s}" loading="lazy" />\n </div>\n <div class="ad-text-container">\n <span class="ad-sponsor">${r} ${o}</span>\n <h6 class="ad-title">${n}</h6>\n <span class="ad-description">${a}</span>\n </div>\n </div>\n </a>\n </article>`,PODME:({url:e,title:t,description:n,img:i,logo:r})=>`<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="${r}" 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:r})=>`<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="${r}" loading="lazy" />\n </div>\n </div>\n </a>\n</article>`,FISHFINGER:({img:e,title:t,sponsoredBy:n,logo:i,url:r})=>`<article class="advertory-vg-ad-native-fishfinger">\n <a class="ad-link" href="${r}" 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:r,description:o,title:s,imgWidth:a,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="${s}" class="ad-logo" src="${n}" loading="lazy" />`:""}\n </div>\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${r}" loading="lazy" ${a?`width="${a}"`:""} ${d?`height="${d}"`:""} />\n </div>\n <div id="testxd" class="ad-text-container">\n ${o?`<div class="ad-description">${o}</div>`:""}\n <h2 id="scalable-text-container" class="ad-title">\n ${Gr({title:s,options:l})}\n </h2>\n </div>\n </div>\n </a>\n </article>`,DEFAULT_VIDEO:(e,t)=>Rr(Yr)(e,t),SEAMLESS_IMAGE:({containerId:e,url:t,adText:n,img:i,cta:r,description:o,logo:s,sponsoredBy:a,title:d})=>`<article class="advertory-vg-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">${a}</div>\n <div class="ad-annons"><span>${n}</span></div>\n </div>\n ${s&&`<img alt="${a}" class="ad-logo" src="${s}" 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">${o}</span>\n <button class="ad-action">${r}</button>\n </div>\n </div>\n </a>\n </div>\n </article>`},eo={NATIVE_TEMPLATE:({containerId:e,url:t,sponsoredBy:n,title:i,img:r,adText:o})=>`<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="${r}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${o}</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:r,adText:o})=>`<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="${r}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${o}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`},to={displayTemplates:{content:Xr.CONTENT,content_internal:Xr.CONTENT,inhouse:Xr.INHOUSE,sponsorstripe:Xr.SPONSORSTRIPE,"ukesmeny-stripe":Xr.UKESMENY_SPONSORSTRIPE,ukesmeny:Xr.UKESMENY,sponsor:Xr.SPONSORSTRIPE,sponsortop:Xr.SPONSORSTRIPE,standard:Xr.STANDARD,recirc:Xr.RECIRC,podme:Xr.PODME,podme_section:Xr.PODME_SECTION,fishfinger:Xr.FISHFINGER,shopping:Xr.SHOPPING,native:eo.NATIVE_TEMPLATE,native_recirc:eo.NATIVE_RECIRC,default:Xr.DEFAULT,seamless_image:Xr.SEAMLESS_IMAGE},videoTemplates:{content:Xr.CONTENT,recirc:Xr.DEFAULT_VIDEO,default:Xr.DEFAULT_VIDEO,menu:Xr.UKESMENY_VIDEO}},no=(e,t,n)=>{e.style.position=t,e.style.transform=`translateY(${n}px)`},io=(e,t)=>{const n=document.querySelector(t),i=document.querySelector(`#${e}`);if(!i||!n)return;const r=i.parentElement,o=new IntersectionObserver(([e])=>((e,t,n)=>{const i=window.getComputedStyle(t).position,r=e?i:"fixed",o=e?t.offsetHeight:0;no(n,r,o)})(e.isIntersecting,n,r)),s=new ResizeObserver(()=>((e,t)=>{const n=window.getComputedStyle(e).position;no(t,n,e.offsetHeight)})(n,r));o.observe(n),s.observe(n)},ro=e=>document.querySelector(e)||document.querySelector(`[class*="${e}"]`),oo=(e,t)=>{if(!t||!Me(e))return;const{toogleEnabled:n,headerSelector:i,containersSelectors:r}=t,{targetId:o}=e;if(!n)return;const s=document.querySelector(".advertory-takeover-wrapper"),a=[()=>i&&io(o,i),()=>r&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n)return;const[i,r]=t;if(!i)return;const o=()=>{const e=ro(i),t=r?ro(r):null,o=n.querySelector("article");if(!o||!e)return;const s=e.getBoundingClientRect().left,a=((e,t)=>{const n=e.getBoundingClientRect(),i=null==t?void 0:t.getBoundingClientRect();return i?i.right-n.left:n.width})(e,t);o.style.left=`${s}px`,o.style.width=`${a}px`};o(),new ResizeObserver(o).observe(document.body)})(o,r),()=>s&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n||!t)return;new IntersectionObserver(([e])=>{n.style.visibility=e.isIntersecting?"hidden":"visible"}).observe(t)})(o,s)];a.forEach(e=>e())},so=e=>{e.style.removeProperty("min-height"),e.style.removeProperty("min-width")},ao=((e,t)=>n=>{return i=Object.assign(Object.assign({},n),{siteSpecificConfig:t}),r=e,A(void 0,void 0,void 0,function*(){yield Ji(i,r)});var i,r})({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;xe(e)&&so(i);const{pageType:r=Vt.FRONT,nativeTrackingConfig:o,appearanceConfig:s,deviceType:a}=null!=t?t:{},d={language:c.NO,publisher:S.VG,deviceType:a,pageType:r,nativeTrackingConfig:o,appearanceConfig:s,productTag:"partnerstudio"};_r(e,d,to),oo(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;bt();const n=document.createElement("div");n.classList.add(ft),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, 0) - 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&&(Et(n),window.addEventListener("scroll",()=>Et(n)))})(i),e()},adjustAdToHorseshoe:e=>{var t;const n=document.querySelector(`#${e}`);n&&(null===(t=n.parentElement)||void 0===t||t.classList.add(wt),n.classList.add(wt))}},loadFinnBlinkAd:(e,t,n,i)=>A(void 0,void 0,void 0,function*(){const{isMobileApp:r}=d.get();if(L(`loadFinnBlinkAd: loading finn blink ad for ${e}`),!(()=>{const{tcf:e}=d.get(),{getConsentSync:t}=ie(e),n=t();return!(!(null==e?void 0:e.enabled)||!n)||(L("Skip loading finn blink ad due to missing TCF consent."),!1)})()||r)return n&&n(e),void $i(e);yield Qi(Zi),yield ir(e,t,n),i&&i()}),replaceAdsWithFinnBlink:e=>A(void 0,void 0,void 0,function*(){if(!e)return;yield Qi(Zi);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 L(`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=rr(t);(e=>{L(`Hiding old ad container: ${e.id}`),e.style.setProperty("display","none","important")})(n),or(n,i),n.dataset.finnBlinkId=t,mn().withFullAdsChain(e)})}),preparePageOptions:Sr,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,r=(e=>{const{isMobileApp:t}=d.get();return t?(e=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":"atb"))(e):e})(i),o=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,i=`${u()}-adformat`,r=t?t[i]:[];if(!r)return{};const o=(Array.isArray(r)?r:[r]).filter(e=>!(e in E)||window.innerWidth>=E[e]);return{[i]:n?o:r}})(e),s=(e=>{const t=`${u()}-targetid`;return e?{[t]:[e]}:{}})(n),a=I(),l=(e=>k(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(i),c=((e,t)=>k(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),o),s),l),a),rendererOptions:c})},siteEvents:mr},sr);var lo=Object.freeze({__proto__:null,default:""});export{ao as initAdvertoryPackage,Ki as updateAdvertory};
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@sch-inventory/advertory/core/vgv2",
3
+ "private": true,
4
+ "main": "./index.js",
5
+ "module": "./index.js",
6
+ "peerDependencies": {
7
+ "react": ">=17 <20"
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schibsted/advertory",
3
- "version": "2.44.0-test-art-4",
3
+ "version": "2.44.5-art-v5",
4
4
  "scripts": {
5
5
  "build": "node node_modules/rollup/dist/bin/rollup -c rollup-config/default.mjs && npm run post:build",
6
6
  "build:dev": "MODE=dev npm run build",