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