MSN i.delete(e),has:e=>i.has(e)});const s=”__RequestDataInstance__”;class a{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=c(“OSATE”,this.cookie),t=!!e&&”1″===e,n=c(“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=r.get(s);return e||(n.g.TEST_ENV?d({href:”http://localhost:8080/”,innerHeight:768,devicePixelRatio:1,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}):d({href:”http://localhost:8080/”,innerHeight:0,devicePixelRatio:0,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}))}static resetInstance(e){const t=new a(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);return r.set(s,t),t}}function c(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 d=a.resetInstance,l=()=>a.getInstance();function u(){return o()?window.location.search:l().url.search}var p,h;!function(e){e.Anon=”ANON”,e.AppAnon=”APP_ANON”,e.Unknown=””}(p||(p={})),function(e){e.AnonCookieExists=”ace”,e.AppAnonCookieExists=”aace”}(h||(h={}));const g=”child”;function w(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}function f(e){try{if(e)return JSON.parse(e)}catch(e){}return null}const m=”prg-pr2-“,v=”prg-pw-“,b=”prg-“,y=”prg-1sw-“;function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;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}function C(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:””,n=b;var o,i;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?n=v:t.toLocaleLowerCase()===”windowsShell”.toLocaleLowerCase()||t.toLocaleLowerCase()===”windowsShellV2″.toLocaleLowerCase()?n=y:t.toLocaleLowerCase()!==”winWidgets”.toLocaleLowerCase()||(null===(o=window)||void 0===o||null===(o=o.location)||void 0===o||null===(o=o.search)||void 0===o?void 0:o.includes(“reqsrc=vp”))||null!==(i=window)&&void 0!==i&&null!==(i=i.location)&&void 0!==i&&null!==(i=i.search)&&void 0!==i&&i.includes(“vptest”)||(n=m),n}function S(e){var t;return document.head.dataset[e]||(null===(t=A())||void 0===t?void 0:t.dataset[e])}let I;function A(){return void 0===I&&(I=document.getElementsByClassName(“peregrine-widget-settings”)[0]||null),I}function q(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():[]}const _=”Authorization”;var x,O;!function(e){e.Presentation=”presentation”}(x||(x={})),function(e){e.Unknown=”Unknown”,e.Portrait=”Portrait”,e.Landscape=”Landscape”}(O||(O={}));var L,E;!function(e){e[e.Undefined=0]=”Undefined”,e[e.Basic=1]=”Basic”,e[e.Advanced=2]=”Advanced”,e[e.Premium=3]=”Premium”}(L||(L={})),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”}(E||(E={}));new Set([“winp0dash”,”winp1taskbar”,”winp1taskbarent”,”winp1taskbardirect”,”winp1taskbardirectent”,”winp1taskbarent”,”winp2juntaskbar”,”winp2juntaskbarent”,”winp2″,”winp2ent”,”winp2fp”,”winp2fpent”,”winp2fptaskbar”,”winp2fptaskbarent”,”winp2fptaskbarhover”,”winp2fptaskbarhoverent”,”winp2widget”,”winp2widgetent”]);const T=new Set([“finance-app-win”,”weather-app-win”,”winpstoreapp”]),N=(new Set([“msedgdhp”,”msedgdhphdr”,”msedgntphdr”,”msedgntp”,”msedgdhp”,”entnewsntp”]),new Set([“hpmsn”]));new Set([“chromentpnews”]);function W(){var e;return o()?f(document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===e?void 0:e.getAttribute(“data-client-settings”))):null}const R=”feed/personalize/settings”;function P(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 M=new class{constructor(){o()?(this.isDebugEnabled=(P(window.location.href,”debug”)||””).toLowerCase()in{1:1,true:1}||”vp”===(P(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 F{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=f(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 f(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;M.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=z(Y,!0),t=e&&f(e),{login_hint:n}=t||{};return n&&t})),ee=Q((()=>!!z(Y)));function te(){try{return localStorage}catch(e){return null}}const ne=”__PageExperimentInstance__”;function oe(e){r.set(ne,e)}function ie(e){if(!r.has(ne)&&o()){var t;oe(re(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=r.get(ne);return n&&n.has(e)}function re(e){const t=(e||””).replace(/(^f:|;.*$)/g,””).split(“,”);return new Set(t)}const se=”uxlogin”,ae=”uxlogout”,ce=”uxedit”,de=”useRedirect”,le=”uxswitch”,ue=Q((()=>{const e=te();return e&&”1″===e.getItem(se)||o()&&location.search&&location.search.includes(`${se}=1`)}));const pe=Q((()=>{const e=function(){try{return sessionStorage}catch(e){return null}}();return e&&!!e.getItem(ae)}));const he=Q((()=>{const e=te();return e&&”1″===e.getItem(ce)}));const ge=Q((()=>{const e=te(),t=!ie(“prg-noredirect”)&&e&&”1″===e.getItem(de)&&function(){const e=document.head.dataset.clientSettings||””,{browser:t}=f(e)||{},{browserType:n=””}=t||{};return!!/safari/i.test(n)}();return t}));const we=Q((()=>{const e=te();return e&&”1″===e.getItem(le)}));const fe={bingHomepageMobile:”binghomepagemobile”,outlookMobile:”OnOOutlookMobile”,msnCopilot:”cp_msn_news”,officeMobile:”OnOOfficeMobile”,sapphire:”OnOStartApp”,skype:”OnOSkype”,freFullPage:”emmxFre”,winWeatherApp:”weather-app-win”,xiaomiApp:”xmweather-“,launcher:”launcherntp”,launcherInterests:”launcherInterests”,swiftKey:”swiftKey”,winMoneyApp:”finance-app-win”},me=”superappdhp”,ve=[“ios”,”android”,”ipados”],be=”_ocidIsomorphicKey”,ye=()=>(r.get(be)||r.set(be,Fe(“ocid”).toLowerCase()),r.get(be)),ke=”_platformFlagKey”,Ce=”_hostAppNameKey”,Se=”_clientTypeKey”,Ie=()=>(r.get(ke)||r.set(ke,Fe(“chpltfm”)),r.get(ke)),Ae=()=>{if(!r.get(Ce)){const e=Ie();r.set(Ce,e.toLowerCase().split(“-“)[0])}return r.get(Ce)},qe=()=>{if(!r.get(Se)){const e=Ie();r.set(Se,e.toLowerCase().split(“-“)[1])}return r.get(Se)};function _e(){if(!o()||Re())return!1;const e=window.sapphireWebViewBridge,t=window.webkit,n=e&&e.send,i=t&&t.messageHandlers&&t.messageHandlers.send&&t.messageHandlers.send.postMessage;return!(!n&&!i)}function xe(){const e=Ie()&&”outlook”===Ae()&&ve.includes(qe()),t=ye()===fe.outlookMobile.toLowerCase();return e||t}function Oe(){const e=Ie()&&[“office”,”union”].includes(Ae())&&ve.includes(qe()),t=ye()===fe.officeMobile.toLowerCase();return e||t}function Le(){const e=ye()===fe.skype.toLowerCase()||”skype”===Ae();return o()&&(null===(t=window.skypeWebviewBridge)||void 0===t?void 0:t.isSkype)||e;var t}function Ee(){return!(!o()||Re())&&(_e()||ye()===fe.sapphire.toLowerCase()||ye()===me.toLowerCase())}function Te(){const e=Fe(“edge”);return(“emmx”===Ae()||”1″===e)&&Ee()||”mmx”===ye()}function Ne(){return”3rdp”===Ae()||ye().startsWith(fe.xiaomiApp)||Re()}function We(){return[fe.launcher.toLowerCase(),fe.launcherInterests.toLowerCase()].includes(ye())&&Ee()}function Re(){return ye().toLowerCase()===fe.swiftKey.toLowerCase()||”swiftkey”==Ae().toLowerCase()}function Pe(){return-1!==window.location.href.indexOf(“huawei”)||-1!==window.location.href.indexOf(“airfind”)||-1!==window.location.href.indexOf(“aloha”)||”vivo”===ye()&&Ne()}const Me=Q((()=>_e()||Le()||Oe()||xe()||Ee()||ye()===fe.winWeatherApp.toLowerCase()||ye()===fe.winMoneyApp.toLowerCase()||Te()||Ne()||We()||Re()||Pe()||-1!==window.location.href.indexOf(“metaos=true”)));function Fe(e){try{return new URL(location.href).searchParams.get(e)||””}catch(e){return””}}const De=W()||{},Ue={newsAndInterests:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,distribution:1,superApp:1,channelmobile:1,edgeMobile:1},$e={edgeChromium:1},je={winWidgets:1},He={edgeChromium:1,shopping:1,newsAndInterests:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,msn:1},Be={edgeChromium:1,channelmobile:1,cgHomePage:1,distribution:1,newsAndInterests:1,windowsNewsPlus:1,winWidgets:1,webWidgets:1,windowsShell:1,windowsShellV2:1,superApp:1,edgeMobile:1},Je=Q((()=>De&&De.apptype)),Ge=(Q((()=>o()&&Je()in je)),Q((()=>o()&&!Me()&&!(Je()in Ue)&&!ze()&&!Xe()))),Ve=Q((()=>Ge()&&!(Je()in $e)));Q((()=>Ge()&&(!(Je()in $e)||!ee()))),Q((()=>Ge()&&!Ye()&&!Ze()));const Ke=Q((()=>Ze()||Ye())),ze=Q((()=>!(Je()in He)&&et()&&function(){if(“homePage”==Je())return!0;const e=new URLSearchParams(u()).get(“ocid”)||(null==De?void 0:De.ocid),t=null==e?void 0:e.toLowerCase();if(N.has(t)&&ie(“prg-msn-id”))return!0;const n=!N.has(t)&&!T.has(t);return n}()&&!function(){const e=”windows”==Je()&&”windowshp”==(De&&De.pagetype)&&(o()?window.location.href:l().url.href).includes(`${R}`);return e}())),Xe=()=>o()&&document&&document.body&&document.body.getElementsByClassName(“peregrine-widgets”).length>0;Q((()=>Je()in Be||ze()));function Qe(){const e=H;if(e)return M.log(“dual-auth: tryGet1SAuthToken returned live tokens”),e;const t=J();if(t)return M.log(`dual-auth: tryGet1SAuthToken returned cached tokens that are ${G()}`),t;M.log(“dual-auth: tryGet1SAuthToken returned empty tokens”)}function Ye(){return Ve()&&ue()||function(){const e=Ve()&&!tt()&&!ue()&&Z()&&(“expired”==G()||he());return e}()||pe()||ge()}function Ze(){return Ve()&&!Z()&&we()}const et=Q((()=>{const{browser:e}=De,{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)}));Q((()=>Ve()&&!ze()));const tt=()=>{const e=Z();if(!e)return!1;let t;switch(e.account_type){case”MSA”:t=Ve()?”ace”:”aace”;break;case”AAD”:t=Ve()?”WID”:”APP_WID”;break;default:return!1}return!!z(t)};const nt=”__core_auth_authHeaderPromiseParts__”,ot=()=>r.get(nt);let it;function rt(){return it}!function(){let e;const t={promise:new Promise((t=>e=t)),resolver:e};r.set(nt,t)}();const st=Q((()=>f(z(“AL_STATE”,!0))));class at{constructor(){this.childCookieName=”child”,this.command=”command”,this.domInfo=document.head.dataset.info,this.canvasInfo=document.head.dataset.canvasInfo||””}init(e,t){this.clientSettings=e||W(),this.authCookieName=rt()||window._authCookieName||””,this.bundle=window._webWorkerBundle||””,t=t||{};const n=this.buildWebWorkerUrl(this.clientSettings,t),o=window.webWorker=this.createWebWorkerInstance(n);o?this.initCore(o):console.warn(“Error while initializing the web worker.”)}initCore(e){const t=window.webWorkerMessages=[];e.onmessage=e=>{t.push(e.data)};const n=window.webWorkerErrors=[];e.onerror=e=>{n.push(e)},Ke()&&ot().promise.then((t=>e.postMessage({id:”AuthHeaders”,type:this.command,payload:t||{}})))}createWebWorkerInstance(e){return new Worker(e,{name:”web-worker”})}shouldFetchAppAnonCookie(){return!0}getAudienceMode(e){te();const t=z(this.authCookieName),n=z(this.childCookieName),{child:o}=t&&JSON.parse(t)||{};return t&&(1===o||n)?”kids”:e.audienceMode||”adult”}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=o()?window.devicePixelRatio:l().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(X(this.authCookieName),”aace”,”1″)+this.qs(X(“muid”),”muid”)+this.qs(X(this.childCookieName),”child”)+this.qs(X(“cbypass”),”cbypass”)+this.qs(this.cookieBannerConsentRequired().toString(),”ccRequired”)+this.qs(X(“ecasession”),”ecasession”)+this.qs(X(“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…
Continue reading