MSN

[]
MSN r.delete(e),has:e=>r.has(e)});function c(){return!(“undefined”==typeof window||!window.document||!window.document.createElement||window.isRenderServiceEnv)}function d(e){let t,n=!1;const o=function(){return n||(n=!0,t=e()),t};return o.cache={clear:()=>{n=!1,t=void 0}},o}const l={bingHomepageMobile:”binghomepagemobile”,outlookMobile:”OnOOutlookMobile”,officeMobile:”OnOOfficeMobile”,sapphire:”OnOStartApp”,skype:”OnOSkype”,freFullPage:”emmxFre”,winWeatherApp:”weather-app-win”,xiaomiApp:”xmweather-“,launcher:”launcherntp”,launcherInterests:”launcherInterests”,swiftKey:”swiftKey”,winMoneyApp:”finance-app-win”},u=”superappdhp”,p=[“ios”,”android”,”ipados”],h=”_ocidIsomorphicKey”,g=()=>(a.get(h)||a.set(h,T(“ocid”).toLowerCase()),a.get(h)),w=”_platformFlagKey”,m=”_hostAppNameKey”,f=”_clientTypeKey”,b=()=>(a.get(w)||a.set(w,T(“chpltfm”)),a.get(w)),v=()=>{if(!a.get(m)){const e=b();a.set(m,e.toLowerCase().split(“-“)[0])}return a.get(m)},y=()=>{if(!a.get(f)){const e=b();a.set(f,e.toLowerCase().split(“-“)[1])}return a.get(f)};function k(){if(!c()||O())return!1;const e=window.sapphireWebViewBridge,t=window.webkit,n=e&&e.send,o=t&&t.messageHandlers&&t.messageHandlers.send&&t.messageHandlers.send.postMessage;return!(!n&&!o)}function S(){const e=b()&&”outlook”===v()&&p.includes(y()),t=g()===l.outlookMobile.toLowerCase();return e||t}function C(){const e=b()&&[“office”,”union”].includes(v())&&p.includes(y()),t=g()===l.officeMobile.toLowerCase();return e||t}function A(){const e=g()===l.skype.toLowerCase()||”skype”===v();return c()&&(null===(t=window.skypeWebviewBridge)||void 0===t?void 0:t.isSkype)||e;var t}function I(){return!(!c()||O())&&(k()||g()===l.sapphire.toLowerCase()||g()===u.toLowerCase())}function _(){const e=T(“edge”);return(“emmx”===v()||”1″===e)&&I()||”mmx”===g()}function E(){return”3rdp”===v()||g().startsWith(l.xiaomiApp)||O()}function q(){return[l.launcher.toLowerCase(),l.launcherInterests.toLowerCase()].includes(g())&&I()}function O(){return g().toLowerCase()===l.swiftKey.toLowerCase()||”swiftkey”==v().toLowerCase()}function x(){return-1!==window.location.href.indexOf(“huawei”)||-1!==window.location.href.indexOf(“airfind”)||-1!==window.location.href.indexOf(“aloha”)||”vivo”===g()&&E()}const L=d((()=>k()||A()||C()||S()||I()||g()===l.winWeatherApp.toLowerCase()||g()===l.winMoneyApp.toLowerCase()||_()||E()||q()||O()||x()||-1!==window.location.href.indexOf(“metaos=true”)));function T(e){try{return new URL(location.href).searchParams.get(e)||””}catch(e){return””}}let P,N;function W(e){try{return decodeURIComponent(e)}catch(e){}}function M(e,t){if(!e)return null;if(t)return R(e);if(!P){const e=”undefined”!=typeof document&&document.cookie.split(“; “);P={};const t=e&&e.length;for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:20;this.maxLength=e,this.list=[]}push(e){this.list.push(e),this.list.length>this.maxLength&&this.list.shift()}get data(){return this.list}};function $(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:F.Alert,r=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,d=arguments.length>6?arguments[6]:void 0;try{const l=function(){if(!o){const e=document.head.getAttribute(“data-client-settings”);e&&(o=JSON.parse(e))}return o}(),u=s(),p=function(e){if(e){const{pcsInfo:t,pageGenTime:n}=e,o=new Date(n).getTime(),i=!t||[“prod”,”prod-ssr”,”prod-ssrntp”].includes(t.env);N=i?”browser.events.data.msn.com”:”events-sandbox.data.msn.com”;return{cors:”true”,”content-type”:”application/x-json-stream”,”client-id”:”NO_AUTH”,”client-version”:”1DS-Web-JS-2.2.2″,apikey:i?”0ded60c75e44443aa3484c42c1c43fe8-9fc57d3f-fdac-4bcf-b927-75eafe60192e-7279″:”f8857dedc6f54ca8962cfb713e01e7d7-e9250191-fe0b-446f-95ae-07516262f98c-7028″,”upload-time”:o,w:”0″,anoncknm:”app_anon”}}return null}(l);let h=””;p&&p.apikey&&””!==p.apikey&&(h=function(e){if(e){const t=e.indexOf(“-“);if(t>0)return e.substring(0,t)}return””}(p.apikey));const g=function(e,t,n,o,i,s){let r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:F.Alert,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:””;if(n){i=i||{};const{apptype:u,audienceMode:p,pagetype:h,pageGenTime:g,bundleInfo:w,deviceFormFactor:m=””,fd_muid:f,os:b}=n;i.pageGenTime=g,i.build=w&&w.v,i.appType=u;const v=function(e,t,n){const o=n&&”phone”===n.toLowerCase(),i=t&&”enterprise”===t;let s=”Edge”;O()?s=”swiftKey”:q()?s=”Launcher”:function(){var e;if(!c())return!1;const t=document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===e?void 0:e.getAttribute(“data-client-settings”));if(t){const e=JSON.parse(t);return e&&e.pagetype&&”bingHomepageMobile”===e.pagetype}return!1}()&&(s=”bingHomepageMobile”);return{bingHomepage:”binghomepage”,mmx:”emmx”,edge:”spartan”,edgeChromium:i?”entnews”:”anaheim”,hybrid:”spartan”,hub:o?”prime_mobile”:”prime”,microsoftNews:”msnews”,office:”entnews”,views:o?”prime_mobile”:”prime”,homePage:o?”prime_mobile”:”prime”,windowsShell:”windowsshell”,edgeMobile:s}[e]}(u,p,m),y=v||u,k=document.getElementsByTagName(“html”)[0].getAttribute(“lang”);let S,C=””,A=”muid”;try{if(“edgeChromium”===u&&”object”==typeof window&&window.location&&window.location.search){const e=new URLSearchParams(window.location.search);S=e.has(“startpage”)?”msedgdhp”:”msedgntp”,”enterprise”===p?S=”entnewsntp”:”xbox”===b&&(S=”xboxntp”)}window&&window.getCookieConsentRequired&&”function”==typeof window.getCookieConsentRequired&&window.getCookieConsentRequired()||(C=(null===(l=window)||void 0===l?void 0:l.__muid)||M(“muid”))}catch{}C||(C=n.aid,A=”aid”);const I={name:”MS.News.Web.AppError”,time:g,ver:”4.0″,iKey:`o:${o}`,data:{baseData:{},baseType:”MS.News.Web.Base”,page:{name:”default”,product:y,type:H(h),content:j[u]??{category:”standaloneError”},ocid:S},browser:{clientId:C,clientIdType:A},flight:{id:s,tmpl:a},request:{activityId:n.aid,requestId:n.aid,afdMuid:f},locale:{mkt:k},extSchema:{id:e,severity:r,pb:i,message:t}}};var d;if(C&&”muid”===A)I.ext={…null==I?void 0:I.ext,user:{…null==I||null===(d=I.ext)||void 0===d?void 0:d.user,localId:`t:${C}`}};return”object”==typeof window&&(window.isSSREnabled&&(I.data.flight.tmpl+=”;ssr-enabled:1″),window.isSSRCompleted&&(I.data.flight.tmpl+=”;ssr-completed:1″)),I?JSON.stringify(I):null}var l;return null}(t,e,l,h,n,u,i,d);if(a&&!function(e){if(null==e)return!1;return e.startsWith(“1”)||e.startsWith(“2”)||e.startsWith(“3”)||e.startsWith(“4″)}(null==l?void 0:l.aid))return console.error(g),void console.error(`This App error Id: ${t} will not be sent due to app error sampling!`);if(p&&g){console.error(g),U.push(g);const e=”https://”+N+”/OneCollector/1.0″+function(e){return”?”+Object.keys(e).map((function(t){return t+”=”+encodeURIComponent(e[t])})).join(“&”)}(p);if(r&&!performance.getEntriesByType(“visibility-state”).some((e=>”visible”===e.name))){const t=()=>{“visible”===document.visibilityState&&navigator.sendBeacon(e,g)};document.addEventListener(“visibilitychange”,t,{once:!0})}else navigator.sendBeacon(e,g)}}catch{}}const j={homePage:{vertical:”homepage”,category:””,id:””,domainId:”13041″,title:”undefined”!=typeof document?document.title:””}};function H(e){let t=e;switch(e){case”windowsshellhp”:t=”dhp”;break;case”video”:t=”watch”;break;case”EdgeMobile”:t=_()?”ntp”:”dhp”}return t}function B(e){$(“Error when loading bundle: “+e,20202,{…arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}})}function J(e,t,n,o,i){$(“JS Exception”,20203,{source:t,customMessage:e,line:n,column:o,stack:i&&i.stack})}function G(e){$(“JS Exception”,20203,{customMessage:e&&e.reason&&e.reason.message,stack:e&&e.reason&&e.reason.stack})}const V=”experience”,K=Object.create(null),X=2;function z(e,t){if(!(t=t||Array.from(document.scripts).find((t=>t.src.indexOf(`/${e}.`)>-1))))return;const n=function(e,t){const n=document.createElement(“script”);return n.type=”text/javascript”,n.crossOrigin=”anonymous”,n.src=e,n.onerror=()=>{let e=K[t]||0;K[t]=++e,e{delete K[t];const e=window._pageTimings.retriedBundles;window._pageTimings.retriedBundles=e?`${e},${t}`:t,Y()},n}((o=t.src,K[e],o),e);var o;setTimeout((()=>t.replaceWith(n)),100)}function Q(){const[e={}]=performance.getEntriesByType(“navigation”);return e.type}function Y(){if(!Object.values(K).every((e=>e===X)))return;let e=””;Object.keys(K).forEach((t=>{e=e?`${e},${t}`:t,delete K[t]})),e&&$(`Error when loading bundle(s): ${e}`,20202,{timeElapsed:Math.round(performance.now()),navType:Q()})}function Z(e){try{if(e)return JSON.parse(e)}catch(e){}return null}”undefined”!=typeof window&&window.document&&window.document.createElement&&(window._pageTimings=window._pageTimings||{},window.requestIdleCallback=window.requestIdleCallback||window.setTimeout);const ee=”Authorization”;var te,ne;!function(e){e.Presentation=”presentation”}(te||(te={})),function(e){e.Unknown=”Unknown”,e.Portrait=”Portrait”,e.Landscape=”Landscape”}(ne||(ne={}));var oe,ie;!function(e){e[e.Undefined=0]=”Undefined”,e[e.Basic=1]=”Basic”,e[e.Advanced=2]=”Advanced”,e[e.Premium=3]=”Premium”}(oe||(oe={})),function(e){e.Init=”init”,e.Config=”config”,e.Targeted=”targeted”,e.Sticky=”sticky”,e.NoSticky=”no_sticky”,e.Admin=”admin”,e.Forced=”forced”,e.Manual=”manual”}(ie||(ie={}));new Set([“winp0dash”,”winp1taskbar”,”winp1taskbarent”,”winp1taskbardirect”,”winp1taskbardirectent”,”winp1taskbarent”,”winp2juntaskbar”,”winp2juntaskbarent”,”winp2″,”winp2ent”,”winp2fp”,”winp2fpent”,”winp2fptaskbar”,”winp2fptaskbarent”,”winp2fptaskbarhover”,”winp2fptaskbarhoverent”,”winp2widget”,”winp2widgetent”]);const se=new Set([“finance-app-win”,”weather-app-win”,”winpstoreapp”]),re=(new Set([“msedgdhp”,”msedgdhphdr”,”msedgntphdr”,”msedgntp”,”msedgdhp”,”entnewsntp”]),new Set([“hpmsn”]));new Set([“chromentpnews”]);function ae(){var e;return c()?Z(document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===e?void 0:e.getAttribute(“data-client-settings”))):null}const ce=”feed/personalize/settings”;function de(e,t){const n=t.replace(/[[]]/g,”\$&”),o=new RegExp(“[?&]”+n+”(=([^&#]*)|&|#|$)”).exec(e);if(!o)return null;const i=o[2];return decodeURIComponent(i.replace(/+/g,” “))||””}let le=new class{constructor(){c()?(this.isDebugEnabled=(de(window.location.href,”debug”)||””).toLowerCase()in{1:1,true:1}||”vp”===(de(window.location.href,”reqsrc”)||””).toLowerCase(),this.isDebugEnabled&&!n.g.TEST_ENV&&(window.webpackRequire=n)):this.isDebugEnabled=!1}getLoggingService(){return null}isDebug(){return this.isDebugEnabled}setDebug(e){this.isDebugEnabled=e}setTags(e){}log(e,t){this.isDebug()&&console.info(e)}logError(e){console.error(e)}logCallback(e){this.isDebug()&&console.info(e())}logObjects(){this.isDebug()&&console.log(…arguments)}logSingleObject(e,t){this.isDebug()&&console.log(e)}};class ue{get supported(){return!!this.storage}constructor(e){this.storage=e}getItem(e){if(this.supported)return this.storage.getItem(e)}getObject(e,t){const n=this.getItem(e);if(null!=n){const e=Z(n);if(null!=e)return e}return t}key(e){if(this.supported&&e>=0)return this.storage.key(e)}keys(){return this.supported?Object.keys(this.storage):[]}setObject(e,t){void 0!==t?this.setItem(e,JSON.stringify(t)):this.removeItem(e)}removeObject(e){const t=this.removeItem(e);if(null!=t)return Z(t)}setItem(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.supported)try{if(!t)throw”Attempted to store null/undefined value: “+t;this.storage.setItem(e,t)}catch(e){if(!n)throw e;le.logError(e)}else if(!n)throw new Error(“WebStorage not supported”)}get length(){if(this.supported)return this.storage.length}removeItem(e){if(this.supported){const t=this.getItem(e);return this.storage.removeItem(e),t}}clear(){this.supported&&this.storage.clear()}removeSubstringKeys(e){if(!this.supported||!e)return;const t=[];for(let n=0;n{const e=M(ye,!0),t=e&&Z(e),{login_hint:n}=t||{};return n&&t})),Se=d((()=>!!M(ye)));const Ce=”__RequestDataInstance__”;class Ae{constructor(e,t){if(this.url=new URL(e.href),this.innerHeight=e.innerHeight,this.devicePixelRatio=e.devicePixelRatio,this.canUseCssGrid=e.canUseCssGrid,this.requestId=e.requestId,this.cookie=e.cookie,this.referer=e.referer,this.userAgent=e.userAgent,this.clientData=e.clientData,this.oneServiceHeaders=function(e){try{if(e)return JSON.parse(e)}catch(e){}}(e.oneServiceHeaders)||{},this.isPssrMode=t,t){const e=Ie(“OSATE”,this.cookie),t=!!e&&”1″===e,n=Ie(“OSAT”,this.cookie);if(t&&n||!e&&!n)return this.msalAuthReady=!0,void(n&&(this.oneServiceHeaders.Authorization=`Bearer ${n}`));this.msalAuthReady=!1,this.pssrRejectedReason=e&&!t?”interactiveLogin”:e&&!n?”missOSAT”:”missOSATE”}}static getInstance(){const e=a.get(Ce);return e||(n.g.TEST_ENV?_e({href:”http://localhost:8080/”,innerHeight:768,devicePixelRatio:1,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}):_e({href:”http://localhost:8080/”,innerHeight:0,devicePixelRatio:0,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}))}static resetInstance(e){const t=new Ae(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);return a.set(Ce,t),t}}function Ie(e,t){if(t&&e){const n=new RegExp(“\b”+e+”\s*=\s*([^;]*)”,”i”).exec(t);return n&&n.length>1?n[1]:null}return null}const _e=Ae.resetInstance,Ee=()=>Ae.getInstance();function qe(){return c()?window.location.search:Ee().url.search}function Oe(){try{return localStorage}catch(e){return null}}const xe=”__PageExperimentInstance__”;function Le(e){a.set(xe,e)}function Te(e){if(!a.has(xe)&&c()){var t;Le(Pe(document.head.dataset.info||(null===(t=window.document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===t||null===(t=t.dataset)||void 0===t?void 0:t.info)||””))}const n=a.get(xe);return n&&n.has(e)}function Pe(e){const t=(e||””).replace(/(^f:|;.*$)/g,””).split(“,”);return new Set(t)}const Ne=”uxlogin”,We=”uxlogout”,Me=”uxedit”,Re=”useRedirect”,De=”uxswitch”,Fe=d((()=>{const e=Oe();return e&&”1″===e.getItem(Ne)||c()&&location.search&&location.search.includes(`${Ne}=1`)}));const Ue=d((()=>{const e=function(){try{return sessionStorage}catch(e){return null}}();return e&&!!e.getItem(We)}));const $e=d((()=>{const e=Oe();return e&&”1″===e.getItem(Me)}));const je=d((()=>{const e=Oe(),t=!Te(“prg-noredirect”)&&e&&”1″===e.getItem(Re)&&function(){const e=document.head.dataset.clientSettings||””,{browser:t}=Z(e)||{},{browserType:n=””}=t||{};return!!/safari/i.test(n)}();return t}));const He=d((()=>{const e=Oe();return e&&”1″===e.getItem(De)}));const Be=ae()||{},Je={newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,distribution:1,superApp:1,channeldesktop:1,channelmobile:1,edgeMobile:1},Ge={edgeChromium:1},Ve={winWidgets:1},Ke={edgeChromium:1,shopping:1,newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,msn:1},Xe={edgeChromium:1,channeldesktop:1,channelmobile:1,cgHomePage:1,distribution:1,newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,superApp:1,edgeMobile:1},ze=d((()=>Be&&Be.apptype)),Qe=(d((()=>c()&&ze()in Ve)),d((()=>c()&&!L()&&!(ze()in Je)&&!et()&&!tt()))),Ye=d((()=>Qe()&&!(ze()in Ge)));d((()=>Qe()&&(!(ze()in Ge)||!Se()))),d((()=>Qe()&&!it()&&!st()));const Ze=d((()=>st()||it())),et=d((()=>!(ze()in Ke)&&rt()&&function(){if(“homePage”==ze()&&Te(“prg-msn-id”))return!0;const e=new URLSearchParams(qe()).get(“ocid”)||(null==Be?void 0:Be.ocid),t=null==e?void 0:e.toLowerCase(),n=!re.has(t)&&”homePage”!==ze()&&!se.has(t);return n}()&&!function(){const e=”windows”==ze()&&”windowshp”==(Be&&Be.pagetype)&&(c()?window.location.href:Ee().url.href).includes(`${ce}`);return e}())),tt=()=>c()&&document&&document.body&&document.body.getElementsByClassName(“peregrine-widgets”).length>0;d((()=>ze()in Xe||et()));function nt(){const e=me;if(e)return le.log(“dual-auth: tryGet1SAuthToken returned live tokens”),e;const t=fe();if(t)return le.log(`dual-auth: tryGet1SAuthToken returned cached tokens that are ${be()}`),t;le.log(“dual-auth: tryGet1SAuthToken returned empty tokens”)}function ot(e){const t={};return e&&(t[ee]=`Bearer ${e}`),t}function it(){return Ye()&&Fe()||function(){const e=Ye()&&!at()&&!Fe()&&ke()&&(“expired”==be()||$e());return e}()||Ue()||je()}function st(){return Ye()&&!ke()&&He()}const rt=d((()=>{const{browser:e}=Be,{browserType:t=””,detected:n={}}=e||{},{browserType:o=””}=n||{};return/edgeChromium/i.test(t)||/edgeAndroid/i.test(t)||/edgeiOS/i.test(t)||/edge/i.test(o)}));d((()=>Ye()&&!et()));const at=()=>{const e=ke();if(!e)return!1;let t;switch(e.account_type){case”MSA”:t=Ye()?”ace”:”aace”;break;case”AAD”:t=Ye()?”WID”:”APP_WID”;break;default:return!1}return!!M(t)};const ct=”__core_auth_authHeaderPromiseParts__”,dt=()=>a.get(ct);var lt;!function(){let e;const t={promise:new Promise((t=>e=t)),resolver:e};a.set(ct,t)}(),function(e){e.GLOBAL=”GLOBAL”,e.GCC_MODERATE=”GCC_MODERATE”}(lt||(lt={}));let ut;function pt(){return ut}const ht=d((()=>Z(M(“AL_STATE”,!0))));const gt=()=>{const e=M(“elt”,!0),t=e&&Z(e),{access_token:n,account_type:o,login_hint:i,region_scope:s}=t||{};return(n||o||i||s)&&t};function wt(e){if(“undefined”==typeof window||!window.document||window.isRenderServiceEnv)return;const t=window.trustedTypes;if(!t||!t.createPolicy)return;const n=window.trustedTypePolicies||(window.trustedTypePolicies={});if(n[e])return n[e];const o=t.createPolicy(e,{createScriptURL:e=>{const t=function(e){const t=[“ntp.msn.com”,”ntp.msn.cn”,”assets.msn.cn”,”assets.msn.com”,”www.bing.com”,”assets2.msn.com”,”assets2.msn.cn”,”www.clarity.ms”,”int.msn.com”,”r.bing.com”,”business.bing.com”,”staticview.msn.com”,”staticview.msn.cn”,”edge.microsoft.com”,”edge-staging.microsoft.com”,document.location.hostname];let n;try{n=new URL(e,location.origin)}catch(e){return”about:blank#error”}if(n.hostname&&!t.includes(n.hostname))return”about:blank#error”;return e}(e);return t}});return n[e]=o,o}class mt{constructor(){this.childCookieName=”child”,this.domInfo=document.head.dataset.info,this.canvasInfo=document.head.dataset.canvasInfo||””,this.command=”command”}init(e,t){this.clientSettings=e||ae(),this.authCookieName=pt()||window._authCookieName||””,this.bundle=window._webWorkerBundle||””,t=t||{};const n=this.buildWebWorkerUrl(this.clientSettings,t),o=this.clientSettings.apptype;let i;if(o&&”edgeChromium”===o){if(i=this.tryGetWebWorkerUsingPolicy(n,”webWorkerUrlPolicy”),!i)return void console.warn(“Error in creating trusted types compliant web worker”)}else i=window.webWorker=new Worker(n,{name:”web-worker”});const s=window.webWorkerMessages=[];i.onmessage=e=>{s.push(e.data)};const r=window.webWorkerErrors=[];if(i.onerror=e=>{r.push(e)},window.chrome){const e=this.getAudienceMode(this.clientSettings),t=window.webWorker&&window.chrome&&window.chrome.ntpSettingsPrivate;t&&”function”==typeof t.getPref&&(t.getPref(“ntp.news_feed_display”,(e=>{e&&e.value&&i.postMessage({id:”FeedDisplaySetting”,type:this.command,payload:e.value})})),t.getPref(“ntp.layout_mode”,(e=>{e&&e.value&&i.postMessage({id:”LayoutModeSetting”,type:this.command,payload:e.value})})),t.getPref(“new_device_fre.has_user_seen_new_fre”,(e=>{e&&i.postMessage({id:”NewUserFre”,type:this.command,payload:e.value})}))),t&&”function”==typeof t.getConfigData&&t.getConfigData((e=>{const t=(null==e?void 0:e.enabledFeatures)||[];t.includes(“msReducedNtpAdsForNewDevice_stage1″)&&i.postMessage({id:”EdgeNoAds”,type:this.command,payload:!0}),t.includes(“msReducedNtpAdsForNewDevice_stage2″)&&i.postMessage({id:”EdgeReduceAds”,type:this.command,payload:!0})})),”enterprise”===e&&this.clientSettings.browser&&”edgeChromium”===this.clientSettings.browser.browserType&&parseInt(this.clientSettings.browser.version)>=87?this.getEnterpriseAccessToken().then((e=>{e&&i.postMessage({id:”AuthTokenEnterprise”,type:this.command,payload:ot(e)})})):i.postMessage({id:”AuthTokenEnterprise”,type:this.command,payload:{}}),”adult”!==e&&”enterprise”!==e||this.sendPageConfiguration()}Ze()&&dt().promise.then((e=>i.postMessage({id:”AuthHeaders”,type:this.command,payload:e||{}})))}buildWebWorkerUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return(this.bundle||””)+”#”+this.qsFromDocument()+this.qsFromCookies()+this.qsFromDataAttribute(e||this.clientSettings)+this.qsMisc(t)+this.qsAuth(e||this.clientSettings)+this.qsFromUrl()+this.qsFromServiceWorker()+this.qsSelectedPivot()+this.qsXboxXToken()}qs(e,t,n){return e?t+”=”+(n||e)+”&”:””}qsFromDocument(){var e;return this.qs(document.getElementsByTagName(“html”)[0].getAttribute(“lang”),”lang”)+this.qs(encodeURIComponent(window.location.href),”adsReferer”)+this.qs(null===(e=c()?window.devicePixelRatio:Ee().devicePixelRatio)||void 0===e?void 0:e.toString(),”devicePixelRatio”)}qsFromServiceWorker(){if(!navigator.serviceWorker||!navigator.serviceWorker.controller)return””;const e=navigator.serviceWorker.controller;if(“activated”!==e.state||!e.scriptURL)return””;if(e.scriptURL){const t=new URL(e.scriptURL).searchParams.toString();return t?”&”+t+”&”:””}return””}qsFromCookies(){return this.qs(D(this.authCookieName),”aace”,”1″)+this.qs(D(“muid”),”muid”)+this.qs(D(this.childCookieName),”child”)+this.qs(D(“cbypass”),”cbypass”)+this.qs(this.cookieBannerConsentRequired().toString(),”ccRequired”)+this.qs(D(“ecasession”),”ecasession”)+this.qs(D(“TOptOut”),”browserOptOut”)}qsFromDataAttributeHelper(e,t,n){return e&&e.featureFlags&&e.featureFlags.wpoEnabled&&t&&!t.includes(“remwpofltww”)&&(t=this.appendWpoFlightsToInfo(e,t)),this.qs(e.pcsInfo&&e.pcsInfo.env||e.env,”env”)+this.qs(e.aid,”aid”)+this.qs(e.apptype,”apptype”)+this.qs(e.pagetype,”pagetype”)+this.qs(e.audienceMode,”audienceMode”)+this.qs(e.configIndexDocId,”configIndexDocId”)+this.qs(e.deviceFormFactor,”deviceFormFactor”)+this.qs(e.domain,”domain”)+this.qs(e.configRootUrl,”configRootUrl”)+this.qs(this.getHighestCbid(e.cbid,e.apptype),”cbid”)+this.qs(e.ocid,”ocid”)+this.qs(e.os,”os”)+this.qs(JSON.stringify(e.locale),”locale”)+this.qs(e.geo_lat,”lat”)+this.qs(e.geo_long,”long”)+this.qs(JSON.stringify(e.featureFlags),”featureFlags”)+this.qs(JSON.stringify(e.browser),”browser”)+this.qs(JSON.stringify(e.servicesEndpoints),”servicesEndpoints”)+this.qs(e.bundleInfo&&e.bundleInfo.v||””,”buildVersion”)+this.qs(t,”dataInfo”)+this.qs(n,”canvasInfo”)}qsSelectedPivot(){const e=”selectedPivot”;let t;try{const n=Oe();n&&(t=n.getItem(e))}catch(e){console.warn(“Error getting pivot id from local storage. “+e)}return this.qs(t,e)}qsXboxXToken(){const e=”xboxXTokenId”;let t;try{const n=Oe();n&&(t=n.getItem(e))}catch(e){console.warn(“Error getting xbox XToken from local storage. “+e)}return this.qs(t,e)}appendWpoFlightsToInfo(e,t){const n=this.getWpoFlightsFromLocalStorage(e);if(n&&n.length){const e=”;”,o=t.split(e);for(let e=0;ee.id))}}catch(e){console.warn(`Error getting wpo flights from ls for ${o} Error:${e}`)}return null}getHighestCbid(e,t){try{const n=Oe(),o=parseInt(e),i=parseInt(JSON.parse(n.getItem(`cbid_${t||””}`)));let s;if(o&&!isNaN(o)&&i&&!isNaN(i)&&(s=o>i?o:i),s=s||o||i,s)return window._cbid=s.toString()}catch(e){console.warn(“Error getting highest CBID”+e)}}getAudienceMode(e){Oe();const t=M(this.authCookieName),n=M(this.childCookieName),{child:o}=t&&JSON.parse(t)||{};return t&&(1===o||n)?”kids”:e.audienceMode||”adult”}sendPageConfiguration(){const e=this.clientSettings.pagetype;if(e){const t=M&&M(“pglt-edgeChromium-“+e);if(t)return void window.webWorker.postMessage({id:”PageConfiguration”,type:this.command,payload:t})}window.webWorker.postMessage({id:”PageConfiguration”,type:this.command,payload:!1})}qsFromDataAttribute(e){let t,n,o;const i=Oe();if(i){const o=JSON.parse(i.getItem(“shd_”+e.pagetype)||null);o&&o.clientSettings&&o.info&&(t={…o.clientSettings,bundleInfo:e.bundleInfo},n=o.info)}return(!t||!n||e.pageGenTime>=t.pageGenTime)&&(t=e,n=this.domInfo,o=this.canvasInfo),t.audienceMode=this.getAudienceMode(t),this.qsFromDataAttributeHelper(t,n,o)}qsFromUrl(){const e=location.search;return e&&e.length?e.substring(1,e.length):””}getEnterpriseAccessToken(){return new Promise((e=>{window.chrome&&window.chrome.authPrivate?window.chrome.authPrivate.getPrimaryAccountInfo((t=>{t&&”GCC_MODERATE”!==t.region_scope||e(“”);const n={account_id:t.account_id,account_type:t.account_type,client_id:”d7b530a4-7680-4c23-a8bf-c52c121d2e87″,scope_or_resource:”https://enterprisenews.microsoft.com”};window.chrome.authPrivate.acquireAccessTokenSilently(n,(t=>{t.is_success?e(t.access_token):e(“”)}))})):e(“”)}))}qsMisc(e){return this.qs(performance.timeOrigin&&performance.timeOrigin.toString(),”mainTimeOrigin”)+this.qs(e.disableWWConfig&&”1″,”disableWWConfig”)}qsAuth(e){let t=this.qs(Ye()&&”1″,”disableWWAuth”);if(!Ze()){const e=Ye()&&nt()||{};t+=this.qs(encodeURIComponent(JSON.stringify(ot(e.accessToken))),”authHeaders”)}return t+=this.qs(function(e){const t=e||pt()||”al_app_anon”,n=ht();return!(!n||!([“anon”,”al_anon”].includes(t)&&n.AL_ANON||[“app_anon”,”al_app_anon”].includes(t)&&n.AL_APP_ANON))}()&&”1″,”isAccountLinked”),t+=this.qs(this.shouldFetchAppAnonCookie()&&”1″,”fetchAppAnonCookie”),t}cookieBannerConsentRequired(){const e=null!=document.getElementById(“consent-banner-container”)&&null===M(“MSCC”),t=null!=document.getElementById(“onetrust-sdk”)&&null===M(“eupubconsent-v2”);return e||t}shouldFetchAppAnonCookie(){if(!rt())return!0;return”MSA”===(()=>{const e=gt();if(e){if(“MSA”===e.account_type)return”MSA”;if(“AAD”===e.account_type)return”AAD”}})()||R(“lt”)?!R(“aace”):void 0}tryGetWebWorkerUsingPolicy(e,t){const n=wt(t);if(n){const t=n.createScriptURL(e),o=t&&t.toString();if(!o||”about:blank#error”===o)return;window.webWorker=new Worker(t,{name:”web-worker”})}else window.webWorker=new Worker(e,{name:”web-worker”});return window.webWorker}}function ft(e){return new Promise((t=>setTimeout(t,e)))}var bt,vt;!function(e){e.Anon=”ANON”,e.AppAnon=”APP_ANON”,e.Unknown=””}(bt||(bt={})),function(e){e.AnonCookieExists=”ace”,e.AppAnonCookieExists=”aace”}(vt||(vt={}));const yt=”child”;function kt(e,t){if(e){const n=new RegExp(“\b”+t+”\s*=\s*([^;]*)”,”i”).exec(e);return n&&n.length>1?n[1]:null}return null}const St=”prg-pr2-“,Ct=”prg-pr2-only”,At=”prg-pw-“,It=”prg-“,_t=”prg-1sw-“;function Et(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:It;const n=t.length,o=[];return e&&e.length&&(e.forEach((e=>{const i=e&&e.trim();i&&i.length>=n&&i.substring(0,n).toLowerCase()===t&&o.push(i.toLowerCase())})),o.sort()),o}const qt=”allfltstocrs”,Ot=”canvasfltstocrs”;function xt(e){var t;return document.head.dataset[e]||(null===(t=Tt())||void 0===t?void 0:t.dataset[e])}let Lt;function Tt(){return void 0===Lt&&(Lt=document.getElementsByClassName(“peregrine-widget-settings”)[0]||null),Lt}function Pt(e){var t;if(!e||!e.startsWith(“f:”))return;const n=(e.match(/f:s*([^;]+)/i)||[])[1];return n?null===(t=n.toLowerCase().split(“,”))||void 0===t?void 0:t.sort():[]}!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};try{var n,o,i;if(!c())return t;const s=Z(xt(“clientSettings”))||{};let r=null===(n=s.apptype)||void 0===n?void 0:n.toLocaleLowerCase();const a=e.crsOptions||{};”winwidgets”!==r&&”homepage”!==r&&”travel”!==r||(a.crsPrefetch=!0),null!==(o=s.widgetAttributes)&&void 0!==o&&null!==(o=o.clientPerf)&&void 0!==o&&o.earlyCRSCall&&(a.crsPrefetch=!0),”edgechromium”===r&&(r=”edgechr”);const d=!(null===(i=s.widgetAttributes)||void 0===i||null===(i=i.clientPerf)||void 0===i||!i.shouldUsePWOnlyFlights),{all:l,prg:u}=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:””;const n=Pt(xt(“info”))||[];let o=Pt(xt(“canvasInfo”));if(!o){const i=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:””,n=It;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?n=At:t.toLocaleLowerCase()===”windowsShell”.toLocaleLowerCase()||t.toLocaleLowerCase()===”windowsShellV2″.toLocaleLowerCase()?n=_t:e&&e.includes(Ct)&&t.toLocaleLowerCase()===”winWidgets”.toLocaleLowerCase()&&(n=St),n}(n,e,t);o=Et(n,i)}return{all:n,prg:o}}(d,r),p=function(e){if(null!=e&&e.includes(qt))return`appFlight=${qt}`;if(null!=e&&e.includes(Ot))return`appFlight=${Ot}`}(l);(a.crsPrefetch||l.includes(“inlinecrscall”)||l.includes(`icrscall-${r}`))&&(!function(e,t,n,o){const i=function(e,t){let n;const o=decodeURIComponent(kt(e,”aace”)),{child:i}=o&&Z(o)||{},s=kt(e,yt);return n=o&&(1===i||s)?”kids”:t.audienceMode||”adult”,n}(document.cookie,e),{apptype:s,browser:r,domain:a,bundleInfo:{v:d}={},deviceFormFactor:l,locale:{content:u,display:p}={},ocid:h,os:g,pagetype:w,servicesEndpoints:{crs:m}={}}=e,f=(Tt()?c()?window.location.hostname:Ee().url.hostname:a)||””;if(!s||!d||!m)return;const b={audienceMode:i,browser:r,deviceFormFactor:l,domain:f,locale:{content:u,display:p},ocid:h,os:g,platform:”web”,pageType:w,pageExperiments:t},v=new URLSearchParams([[“expType”,”AppConfig”],[“expInstance”,”default”],[“apptype”,s],[“v”,d]]),y=qe(),k=y.includes(“?item=”)||y.includes(“&item=”)?”&citem=dev:true&instance=Int1″:””,S=o?`&${o}`:””,C=`${m.path}${m.v}/config/?${v}&targetScope=${JSON.stringify(b)}${k}${S}`,A=e=>{const t=new URL(`https://${e}${C}`),{timeout:o=5e3}=n;let i;if(window.crsRequestData={url:t.toString()},o>=0){const e=new AbortController;setTimeout((()=>e.abort()),o),i=e.signal}return fetch(t,{signal:i})},I=”msn.”+(function(e,t){return!!(e.hostname.toLowerCase().endsWith(“.cn”)||t.isChinaCompliance||t.useCnDomain||e.search.match(/item=revip:cn/))}(location,e)?”cn”:”com”),{domain:_}=m,E=_&&new URL(_).host;let q=A(E||`assets.${I}`);n.disableFallback||(q=q.catch((()=>{const{hostname:e}=location,t=e.match(/.msn.(com|cn)$/)?e:`www.${I}`;return A(t)})));window.crsPromise=q}(s,u,a,p),t.inlineCRS=!0)}catch(e){console.error(“InlineHeadCommon: “+e)}}();const Nt=document.head.attributes[“data-info”].value;let Wt;if(Nt){const e=Nt.split(“;”).find((e=>e.startsWith(“f:”)));e&&(Wt=e.substring(2),Wt.indexOf(“1sw-pcsreturnhp”)>-1&&$(“PCS returned. Executing inline JS.”,8e4,{customMessage:location.href},F.Deprecated))}function Mt(e){var t;return((null===(t=document.head)||void 0===t||null===(t=t.getAttribute(“data-info”))||void 0===t?void 0:t.split(“;”).find((e=>e.startsWith(“f:”))))||””).includes(e)}Mt(“hp-noww”)||(new mt).init(),window.onerror=J,void 0!==window.onunhandledrejection&&(window.onunhandledrejection=G),window.onErrorHandler=B,function(){const e=[“vendors”,”microsoft”,”common”];window.addEventListener(“load”,(()=>{window._pageTimings.navType=Q(),window.requestIdleCallback((()=>{const t=function(e){const t=window.homePageWebpackChunks;if(!t)return[…e,V];if(t.length>e.length)return[];t.forEach((t=>e.splice(e.indexOf(t[0][0]),1))),t.push===Array.prototype.push&&e.push(V);return e}(e);t.length&&t.forEach((e=>z(e)))}))}),{once:!0})}(),(Mt(“prg-sdkpreload”)||Mt(“prg-renderoptimize”)||Mt(“prg-use-waterfall”))&&async function(e){window.apntag=window.apntag||{anq:[]},window.apntag.anq=window.apntag.anq||[],await async function(e){if(!c())return;const{src:t,id:n,async:o=!0,container:i=document.head,retryNumber:s=0,retryDelayMs:r=0}=e;try{await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;if(t<=1)return e();let o,i=1;do{try{o=await e()}catch(e){if(i===t)throw e&&e.message&&(e.message=`${e.message} after ${i} attempts`),e;await ft(n)}}while(!o&&++ifunction(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return new Promise(((i,s)=>{const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:”anonymous”,i=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;if(!c())throw new Error(“createScriptTag is unsupported server side. This call should be wrapped in canUseDOM().”);const r=document.createElement(“script”);return t&&(r.id=t),i&&r.setAttribute(“class”,i),s&&(r.onload=s),r.type=”text/javascript”,e&&(window&&window.trustedTypesURLValidation?r.src=window.trustedTypesURLValidation(e,”scriptSrcUrlPolicy”):r.src=e,r.async=n,r.crossOrigin=o),window&&window.NONCE_ID&&(r.nonce=window.NONCE_ID),r}(e,t,o,void 0,void 0,(()=>i(!0)));r.crossOrigin=void 0,r.onerror=s,n.prepend(r)}))}(t,n,i,o)),s,r)}catch(e){$(“Failed to download Static JS”,11103,{scriptId:n,scriptSrc:t},F.Alert)}}({id:”display-sdk”,src:e?”https://adsdk.microsoft.com/ast/ast.js”:”https://acdn.adnxs.com/ast/ast.js”,container:document.head,retryDelayMs:200,retryNumber:5})}()}(); ]]> {t=o,s=e}),window._idbConfigOpenPromise=(()=>{try{const d=o.open(“wwConfigs”,1);return new Promise((o,c)=>{d.onerror=(()=>{c(new Error(“Config IDB preload open failure: “+d.error))}),d.onsuccess=(()=>{r[n+”open-End”]=performance.now();const c=d.result;o(c),r[n+”getAllObjects-Start”]=performance.now();const a=c.transaction(e,”readonly”).objectStore(e).openCursor();a.onsuccess=function(){const o=this.result;o?(i[o.key]=o.value,o.continue()):(r[n+”getAllObjects-End”]=performance.now(),t())},a.onerror=(()=>{s(new Error(“Config IDB preload read failure”))})}),d.onupgradeneeded=(()=>{d.result.createObjectStore(e)})})}catch(o){return Promise.reject(new Error(“Config IDB preload open failure: “+o))}})()}preloadConfigIDB(); ]]> onErrorHandler(s.src);s.nonce=””;s.crossOrigin=”anonymous”;document.body.appendChild(s);} ]]>

You May Also Like

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다