'use strict';let responseData,$beaconEventUrl,current_Locale=document.documentElement.lang.toLowerCase(),currentLang=current_Locale.includes("-")?current_Locale.split("-")[0]:"en",currentCountry=current_Locale.includes("-")?current_Locale.split("-")[1]:"us"; const featureContentClass=document.querySelector(".feature-boost-update"),highlightContentClass=document.querySelector(".highlight-boost-update"),hideElement=document.querySelector(".boost-content-hide"),beconsDisabled=document.querySelector("meta[name\x3d'boostapi']").getAttribute("content"),featureAssetsRequest='{"ver":"1.1","privacy":1,"assets":[{"id":1,"required":1,"data":{"type":514}},{"id":2,"required":1,"data":{"type":2}},{"id":3,"required":1,"data":{"type":12}},{"id":4,"required":1,"img":{"w":800,"h":450,"type":3}},{"id":5,"required":1,"img":{"w":630,"h":474,"type":3}},{"id":6,"required":1,"img":{"w":530,"h":397,"type":3}},{"id":7,"required":1,"img":{"w":863,"h":557,"type":3}},{"id":8,"required":1,"img":{"w":1083,"h":609,"type":3}}]}', highlightAssetsRequest='{"ver":"1.1","privacy":1,"assets":[{"id":1,"required":1,"data":{"type":514}},{"id":2,"required":1,"data":{"type":2}},{"id":3,"required":1,"data":{"type":12}},{"id":4,"required":1,"img":{"w":539,"h":440,"type":3}},{"id":5,"required":1,"img":{"w":859,"h":540,"type":3}},{"id":6,"required":1,"img":{"w":1083,"h":600,"type":3}},{"id":7,"required":1,"img":{"w":1399,"h":600,"type":3}},{"id":8,"required":1,"img":{"w":1920,"h":600,"type":3}}]}',hightlighImgWidth=[1399,1920,1083,859], featureImgWidth=[630,800,530,863];var MVFired=!1;function generateRandomId(){return"10000000100040008000100000000000".replace(/[018]/g,a=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)).toUpperCase()}function getCookie(a){const b=document.cookie.split(";");for(let d=0;d(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16))} function callBoostAPI(a,b,d,c,f,e){b={id:generateRandomId(),imp:[{id:generateHyphenatedId(),tagId:d,"native":{request:b}}],site:{page:window.location.href,content:{ext:{locale:f}},publisher:{ext:{propertyid:c}}},device:{userAgent:"",ip:"",language:currentLang,geo:{country:currentCountry}},user:{ext:{anid:getCookie("ANID"),muid:getCookie("MUID")}},ext:{appId:""},test:0,stubResponse:!1};$.ajax({url:a,type:"post",contentType:"applicationhttps://www.microsoft.com/json",data:JSON.stringify(b),timeout:2E3,success:function(g){responseData= g},error:function(g,h,k){console.log("data-error")},complete:function(){e()}})}const boostConfigValue=window.boostApiRequest.BoostConfig;let assetRequestDetails=featureContentClass?featureAssetsRequest:highlightContentClass?highlightAssetsRequest:"";callBoostAPI(boostConfigValue.EndPointURL,assetRequestDetails,boostConfigValue.TagId,boostConfigValue.PropertyId,current_Locale,boostPromotionData); function boostHideShowComponent(a){hideElement&&hideElement.classList.add("d-none");a&&(a.classList.remove("d-none"),a.classList.add("boost-enabled"));$(window).scroll(function(){isElementInViewport50(document.querySelector(".boost-enabled"))&&!MVFired&&(fireBeacon(responseData.imp[0].Promotions[0].Beacons[0].MVFeedbackurl),MVFired=!0)})} function boostPromotionData(){if(void 0!=responseData&&""!=responseData&&null!=responseData){const a=responseData.imp[0].Promotions[0];featureContentClass&&(featureContentUpdate(featureContentClass,a),"beacons-disabled"!=beconsDisabled&&fireBeaconCalls(featureContentClass));highlightContentClass&&(highlightContentUpdate(highlightContentClass,a),"beacons-disabled"!=beconsDisabled&&fireBeaconCalls(highlightContentClass));isElementInViewport50(document.querySelector(".boost-enabled"))&&(fireBeacon(responseData.imp[0].Promotions[0].Beacons[0].MVFeedbackurl), MVFired=!0)}} function updateContent(a,b,d,c){if(a=a.querySelector(b))switch(d){case "text":a.textContent=c;break;case "link":a.textContent=c.text;a.setAttribute("href",c.url);a.setAttribute("aria-label",c.text);a.setAttribute("data-bi-cn",c.text);a.setAttribute("data-bi-ecn",c.text);a.classList.contains("cta")&&(d=document.createElement("span"),d.className="glyph",d.setAttribute("aria-hidden","true"),a.appendChild(d));break;case "image":updateSourceAndImageElementWithWidthMapping(c.imgArray,a,c.imgWidth);break; default:console.warn("Unknown update type:",d)}}function featureContentUpdate(a,b){const d=b.images;updateContent(a,".feature-card .card-body \x3e :first-child","text",b.title);updateContent(a,".feature-card .card-body \x3e :first-child + *","text",b.longTitle+" "+b.description);updateContent(a,".feature-card .link-group a","link",{text:b.actionText,url:b.targetUrl});updateContent(a,".feature-card .card picture img","image",{imgArray:d,imgWidth:featureImgWidth});boostHideShowComponent(a)} function highlightContentUpdate(a,b){updateContent(a,".highlight .card-img-overlay .card-background img","image",{imgArray:b.images,imgWidth:hightlighImgWidth});updateContent(a,".highlight .card-img-overlay .card-foreground .card-body :nth-child(1) :first-child","text",b.title);updateContent(a,".highlight .card-img-overlay .card-foreground .card-body :nth-child(2)","text",b.longTitle+" "+b.description);updateContent(a,".highlight .card-img-overlay .card-foreground .card-body :nth-child(3) a","link", {text:b.actionText,url:b.targetUrl});boostHideShowComponent(a)}function fireBeaconCalls(a){var b=responseData.imp[0].Promotions[0].Beacons;b&&0{}).catch(b=>{console.error("Beacon failed to fire:",b)})} function captureTelemetryPageAction(a){$beaconEventUrl&&fireEventBeacon($beaconEventUrl,"click")}function attachTelemetryHandler(a){a.querySelectorAll("a").forEach(function(b){b.addEventListener("click",function(d){const c=d.target.closest("a");c&&c.innerHTML&&(d.target.setAttribute("telemetry",!0),captureTelemetryPageAction.call(this,c.dataset))})})} function createWidthToImageMap(a,b){var d={};a.forEach(c=>{c.width==b[0]?d[1084]=c:c.width==b[1]?d[1400]=c:c.width==b[2]?d[860]=c:c.width==b[3]&&(d[540]=c)});return d} function updateSourceAndImageElementWithWidthMapping(a,b,d){var c=createWidthToImageMap(a,d);c&&0{var e=f.getAttribute("media");e=parseInt(e.match(/\d+/)[0]);(e=c[e])?f.setAttribute("srcset",e.imageUrl):f.remove()}),b&&c[540]&&(b.setAttribute("src",c[540].imageUrl),b.setAttribute("alt",c[540].altText)))} function isElementInViewport50(a){if(!a)return!1;a=a.getBoundingClientRect();const b=a.width,d=Math.max(0,Math.min(a.right,window.innerWidth)-Math.max(a.left,0));return Math.max(0,Math.min(a.bottom,window.innerHeight)-Math.max(a.top,0))>=a.height/2&&d>=b/2};