import{c as t,G as e,S as o,H as a,I as n}from"./_auto-entry_aftonbladet-BfQGRad2.js";export{E as calculateScaleFactor,K as getAspectRatio,J as scaleAdIpadAirPortrait}from"./_auto-entry_aftonbladet-BfQGRad2.js";import"react/jsx-runtime";const d=d=>{var l,i,r,s,c,u;const{adScaleConfig:f,pageContext:{deviceType:v}}=t.get();if(!(null==f?void 0:f.enabled))return;if(e(d,o.ANY_FULLSCREEN))return;const p=null!==(l=f.adsToBeScaled[v])&&void 0!==l?l:[],m=a(d.targetId.split("-")[0]);if(!p.includes(m))return;const g=null!==(r=null===(i=f.offset)||void 0===i?void 0:i[m])&&void 0!==r?r:0,w=document.getElementById(d.targetId),E=null!==(s=null==w?void 0:w.offsetWidth)&&void 0!==s?s:window.screen.width,I=null!==(u=null===(c=null==w?void 0:w.parentElement)||void 0===c?void 0:c.offsetWidth)&&void 0!==u?u:window.screen.width;n(d,(E<I?E:I)-g)};export{n as scaleAd,d as scaleAds};
