hover),
    :host(:${v.b}) {
        --elevation: 4;
        ${g.XC};
    }

    :host(:hover),
    :host(:${v.b}),
    :host([selected]) {
        background: white;
    }

    .heading {
        color: ${f.Q5n}
    }
`,S=w.i`
    :host {
        background: rgba(255, 255, 255, 0.2);
    }

    :host(:hover) {
        border-color: #F0F0EF;
    }

    :host(:hover),
    :host([selected]),
    :host(:${v.b}) {
        background: rgba(255, 255, 255, 0.5);
    }

    .heading {
        color: ${f.CHi}
    }
`,I=w.i`
    ${(0,y.j)("inline-flex")} :host {
        height: 32px;
        padding-top: 4px;
        padding-bottom: 4px;
        padding-inline: 4px 12px;
        border-radius: calc(${f.rSr} * 5px);
        outline: none;
        cursor: pointer;
        align-items: center;
        border: 1px solid transparent;
        box-sizing: border-box;
    }

    :host([selected]),
    :host(:${v.b}),
    :host(:hover) {
        padding-inline-start: 6px;
    }

    :host(:${v.b}) {
        border-color: ${f.Avx}
    }

    .heading {
        max-width: 82px;
        font-weight: 600;
        font-size: var(--type-ramp-minus-1-font-size);
        line-height: var(--type-ramp-minus-1-line-height);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    .image {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        margin-inline-end: 8px;
    }

    :host(:hover) .image,
    :host(:${v.b}) .image {
        display: none;
    }

    .icon {
        width: 20px;
        height: 20px;
        margin-inline-end: 10px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        border: 1px solid transparent;
        box-sizing: border-box;
    }

    .check-icon {
        background: ${f.Avx};
        border-color: ${f.Avx};
        fill: white;
    }

    .add-icon {
        background: #FFFFFF;
        border-color: rgba(0, 0, 0, 0.25);
        fill: #212121;
        display: none;
    }

    :host(:hover) .add-icon,
    :host(:${v.b}) .add-icon {
        display: flex;
    }
`.withBehaviors(new b.Y(T,S));var $=r(99478),P=r(68402),O='<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.76 3.2c.3.29.32.76.04 1.06l-4.25 4.5a.75.75 0 0 1-1.08.02L2.22 6.53a.75.75 0 0 1 1.06-1.06l1.7 1.7L8.7 3.24a.75.75 0 0 1 1.06-.04Z"/></svg>';const C=i.d`
    <template
        tabindex="0"
        role="button"
        title="${e=>e.selected?(0,$.WU)(e.unfollowAriaLabel,e.heading):(0,$.WU)(e.followAriaLabel,e.heading)}"
        aria-label="${e=>e.selected?(0,$.WU)(e.unfollowAriaLabel,e.heading):(0,$.WU)(e.followAriaLabel,e.heading)}"
        aria-pressed="${e=>!!e.selected}"
        @click="${e=>e.toggleSelected&&e.toggleSelected()}"
        @keypress="${(e,t)=>e.handleKeyPress&&e.handleKeyPress(t.event)}"
        data-t="${e=>e.selected?e.unselectTelemetryTag:e.selectTelemetryTag}"
    >
        ${(0,n.g)((e=>e.selected),i.d`
            <span class="icon check-icon">${O}</span>
        `)}
        ${(0,n.g)((e=>!e.selected),i.d`
            <img class="image" src="${e=>e.imgSrc}"/>
            <span class="icon add-icon">${P.Z}</span>
        `)}
        <span class="heading">${e=>e.heading}</span>
    </template>
`;let E=class extends m{};E=(0,h.gn)([(0,u.M)({name:"msn-follow-pill-button",template:C,styles:I})],E);const k=i.d`
    <msn-follow-pill-button
        class="focusable-artifact pill"
        img-src=${e=>e.imgSrc}
        follow-aria-label=${e=>e.selectAriaLabel}
        unfollow-aria-label=${e=>e.unselectAriaLabel}
        heading=${e=>e.name}
        selected=${e=>e.selected}
        select-telemetry-tag=${e=>e.selectTelemetryTag}
        unselect-telemetry-tag=${e=>e.unselectTelemetryTag}
        @selected-state-changed="${(e,t)=>e.updateItemSelection&&e.updateItemSelection(t.event)}"
    >
        ${e=>e.name}
    </msn-follow-pill-button>
`,x=i.d`
    <div class="pill-row">
        ${(0,l.rx)((e=>e),k,{positioning:!0})}
    </div>
`,F=i.d`
    <div class="pill-rows">
        ${(0,l.rx)((e=>e.RecommendedInterestsVM.pillTemplateContent.content),x,{positioning:!0})}
    </div>
`;class A extends u.H{toggleSelected(){this.selected=!this.selected,this.$emit("selected-state-changed",{selected:this.selected})}handleKeyPress(e){e&&"Enter"===e.key&&this.toggleSelected()}}(0,h.gn)([(0,p.Lj)({attribute:"img-src"})],A.prototype,"imgSrc",void 0),(0,h.gn)([p.Lj],A.prototype,"heading",void 0),(0,h.gn)([(0,p.Lj)({attribute:"follow-aria-label"})],A.prototype,"followAriaLabel",void 0),(0,h.gn)([(0,p.Lj)({attribute:"unfollow-aria-label"})],A.prototype,"unfollowAriaLabel",void 0),(0,h.gn)([(0,p.Lj)({mode:"boolean"})],A.prototype,"selected",void 0),(0,h.gn)([(0,p.Lj)({attribute:"select-telemetry-tag"})],A.prototype,"selectTelemetryTag",void 0),(0,h.gn)([(0,p.Lj)({attribute:"unselect-telemetry-tag"})],A.prototype,"unselectTelemetryTag",void 0);var M=r(40082),R=r(15933);const L=w.i`
    :host(:hover) {
        outline: 1px solid transparent;
        box-shadow: 0 0 0 1px ${f.QOc};
    }
`,U=w.i`
    ${(0,y.j)("flex")} :host {
        --elevation: 4;
        cursor: pointer;
        overflow: hidden;
        ${g.XC};
        width: var(--width, 84px);
        height: var(--height, 84px);
        border-radius: calc(var(--layer-corner-radius) * 1.5px);
        outline: none;
        align-items: center;
        position: relative;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;   
    }

    .check-icon {
        background: ${f.Avx};
        border: 1px solid ${f.Avx};
        fill: white;
    }

    .icon-container {
        width: 100%;
        position: absolute;
        top: 0px;
        display: flex;
        justify-content: flex-end;
    }

    .icon {
        margin: 6px;
        width: 20px;
        height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 100%;
    }

    :host(:hover) {
        --elevation: 16;
    }

    :host(:hover) .mask,
    :host(:${v.b}) .mask {
        background-image: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(29, 29, 29, 0.65) 71.52%);
    }

    :host(:${v.b}) {
        outline: 1px solid transparent;
        box-shadow: 0 0 0 1px ${f.Avx};
    }

    .follow-icon {
        background: #FFFFFF;
        border: 1px solid rgba(0, 0, 0, 0.25);
        fill: #212121;
    }

    .heading {
        width: 85%;
        margin: 8px 6px;
        color: white;
        text-align: start;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 600;
        font-size: var(--type-ramp-minus-1-font-size);
        line-height: var(--type-ramp-minus-1-line-height);
        max-height: calc(var(--type-ramp-minus-1-line-height) * 2);
        position: absolute;
        bottom: 0;
    }

    .image {
        width: 100%;
    }

    .mask {
        position: absolute;
        top: 30%;
        left: 0;
        width: 100%;
        height: 70%;
        background-image: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(29, 29, 29, 0.65) 71.52%);
    }
`.withBehaviors((0,M.vF)(w.i`
                .icon > svg {
                    fill: ${R.H.ButtonFace};
                }
                
                .icon {
                    background: ${R.H.ButtonText};
                }
                
                :host(:hover) .icon,
                :host(:${v.b}) .icon {
                    background: ${R.H.HighlightText};
                }
                
                :host(:hover) .icon > svg,
                :host(:${v.b}) .icon > svg {
                    fill: ${R.H.Highlight};
                }
            `),new b.Y(w.i``,L)),G=i.d`
    <template
        tabindex="0"
        role="button"
        title="${e=>e.selected?e.unfollowAriaLabel&&(0,$.WU)(e.unfollowAriaLabel,e.heading):e.followAriaLabel&&(0,$.WU)(e.followAriaLabel,e.heading)}"
        aria-label="${e=>e.selected?e.unfollowAriaLabel&&(0,$.WU)(e.unfollowAriaLabel,e.heading):e.followAriaLabel&&(0,$.WU)(e.followAriaLabel,e.heading)}"
        @click="${e=>e.toggleSelected&&e.toggleSelected()}"
        @keypress="${(e,t)=>e.handleKeyPress&&e.handleKeyPress(t.event)}"
        data-t="${e=>e.selected?e.unselectTelemetryTag:e.selectTelemetryTag}"
    >
        <img role="none" class="image" src="${e=>e.imgSrc}"/>
        <div class="mask"></div>
        <span role="presentation" class="heading" part="heading">
            ${e=>e.heading}
        </span>
        <div role="none" class="icon-container">
            <span class="icon${e=>e.selected?" check-icon":" follow-icon"}">
                ${e=>e.selected?i.d`${O}`:i.d`${P.Z}`}
            </span>
        </div>
    </template>
`;let H=class extends A{};H=(0,h.gn)([(0,u.M)({name:"msn-follow-square-card",template:G,styles:U})],H);const j=i.d`
    <msn-follow-square-card
        class="focusable-artifact"
        img-src=${e=>e.imgSrc}
        follow-aria-label=${e=>e.selectAriaLabel}
        unfollow-aria-label=${e=>e.unselectAriaLabel}
        heading=${e=>e.name}
        selected=${e=>e.selected}
        select-telemetry-tag=${e=>e.selectTelemetryTag}
        unselect-telemetry-tag=${e=>e.unselectTelemetryTag}
        @selected-state-changed="${(e,t)=>e.updateItemSelection&&e.updateItemSelection(t.event)}"
    >
    </msn-follow-square-card>
`,D=i.d`
    ${(0,l.rx)((e=>e.RecommendedInterestsVM.squareTemplateContent.content),j)}
`;const q=i.d`
    <fluent-button
        slot="bottom-start"
        tabindex="0"
        class="see-more-button bottom-end-button"
        title="${e=>e.strings.seeMoreBtnAriaLabel}"
        aria-label="${e=>e.strings.seeMoreBtnAriaLabel}"
        role="button"
        ?disabled="${e=>e.RecommendedInterestsVM.disableSeeMoreButton||null}"
        data-t="${e=>{var t,r;return null===(r=null===(t=e.RecommendedInterestsVM)||void 0===t?void 0:t.telemetry)||void 0===r?void 0:r.refresh}}"
        @click="${(e,t)=>e.seeMoreBtnClickHandler(t)}"
    >
        <span slot="start">${'<svg width="8" height="12" viewBox="0 0 8 12"><path d="M5.35 2.85a.5.5 0 0 0 0-.7L4.1.9a.5.5 0 0 0-.7.7l.4.4A4 4 0 0 0 .9 8.54a.5.5 0 0 0 .78-.63A3 3 0 0 1 3.79 3l-.4.39a.5.5 0 1 0 .71.7l1.25-1.25Zm.84.38a.5.5 0 0 0-.01.7A3 3 0 0 1 4.22 9l.38-.39a.5.5 0 1 0-.7-.7L2.65 9.15a.5.5 0 0 0 0 .7L3.9 11.1a.5.5 0 0 0 .7-.7l-.4-.4a4 4 0 0 0 2.7-6.75.5.5 0 0 0-.7-.02Z"/></svg>'}</span>
        ${e=>e.strings.seeMoreBtnText}
    </fluent-button>
`,W=i.d`
    ${(0,n.g)((e=>e.RecommendedInterestsVM.squareTemplateContent),D)}
    ${(0,n.g)((e=>e.RecommendedInterestsVM.pillTemplateContent),F)}
`,B=i.d`
    <div class="heading-container" tabindex="0" role="heading" aria-level="1">
        <h1 class="heading">${e=>e.strings.header}</h1>
        <h2 class="sub-heading">${e=>e.strings.subHeader}</h2>
    </div>
`,N=i.d`
    <div class="inline-toast">
        <span>${e=>e.showInlineErrorToast?e.strings.inlineToastErrorText:e.strings.inlineToastInterestText}</span>
    <div>
`;const z=i.d`
    <div class="grid ${e=>function(e){return e.RecommendedInterestsVM.squareTemplateContent?"square-tmpl":"pill-tmpl"}(e)}">
        ${B}
        <div class="stage-content" aria-live="polite">
            ${W}
        </div>
        <div class="footer">
            ${q}
            ${a}
        </div>
    </div>
    ${(0,n.g)((e=>e.showInlineInterestToast),i.d`${N}`)}
    ${(0,n.g)((e=>e.showInlineErrorToast),i.d`${N}`)}
    ${c}
`,V=i.d`
    <template
        data-t="${e=>{var t,r;return null===(r=null===(t=e.RecommendedInterestsVM)||void 0===t?void 0:t.telemetry)||void 0===r?void 0:r.modules.RecommendedInterests}}"
    >
        <div class="background">
            ${(0,n.g)((e=>!e.RecommendedInterestsVM.errorPage),z)}
            ${(0,n.g)((e=>e.RecommendedInterestsVM.errorPage),o)}
        </div>
    </template>
`},10851:function(e,t,r){r.r(t),r.d(t,{ImageSize:function(){return p},RecommendedInterests:function(){return me},RecommendedInterestsCardDarkModeStyle:function(){return Re},RecommendedInterestsCardLightModeStyle:function(){return Le},RecommendedInterestsFlightIds:function(){return v},RecommendedInterestsStyles:function(){return Me},RecommendedInterestsTelemetryNames:function(){return h},RecommendedInterestsTemplate:function(){return ge.z},ToolingInfo:function(){return Ue},discoverSectionId:function(){return S},fallbackErrorImage:function(){return g},followedInterestsUrl:function(){return b},followedSectionId:function(){return I},localeFormatString:function(){return T},personalizeBaseUrl:function(){return w},personalizeUrl:function(){return y},recommendedInterestsDoneState:function(){return f},requiredInterestSelectedCount:function(){return u},topicCardBackupImageUrl:function(){return m}});var i=r(64690),n=r(84925),s=r(12517),o=r(84289),a=r(83227);const d=(0,i.e)(a.x.recommendedInterests,"A recommended interests Web Component experience",Object.assign(Object.assign(Object.assign({},(0,n.lH)("template","","",["Square","Pill"])),(0,s.u)({header:"",subHeader:"",interestBtnFollowAriaLabel:"",interestBtnUnfollowAriaLabel:"",moreInterestsHeader:"",moreInterestsSubHeader:"",moreInterestsBtnAriaLabel:"",moreInterestsBtnText:"",refreshToastText:"",refreshToastBtnText:"",seeMoreBtnAriaLabel:"",seeMoreBtnText:"",seeMoreModalBtnText:"",updateBtnText:"",hideThisText:"",inlineToastInterestText:"",inlineToastErrorText:""})),(0,o.JJ)("enableInlineToast","","")));var c=r(33940),l=r(9683);const h={RecommendedInterests:"RecommendedInterests"},u=1,p={Pill:{width:24,height:24},Square:{width:84,height:84},ErrorPageImage:{width:300,height:154}},m="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AAtCmK3.img",g={url:"https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AAOKN34.img"},f=-2,v=["prg-1sw-cldp1","prg-1sw-cldp4","prg-1sw-clds1","prg-1sw-clds4"],y="/{locale}/feed/personalize",b="/{locale}/feed/personalize#followed-interests",w="https://www.msn.com",T="{locale}",S="discover-interests",I="followed-interests";var $,P=r(65135),O=r(38156),C=r(66925),E=r(85334),k=r(16517),x=r(9375),F=r(65620),A=r(87697),M=r(48328),R=r(45588),L=r(60483),U=r(54804);!function(e){e.RecommendedInterests="PersonalizeInterestsCard",e.refresh="RefreshInterests",e.seeMorePageButton="SeeMorePageButton",e.toast="FeedUpdated",e.topic="TopicCard",e.updateFeed="UpdateFeed",e.dismissBtn="DismissButton"}($||($={}));const G={refresh:{name:$.refresh,behavior:O.wu.More,type:O.c9.ActionButton,action:O.Aw.Click,content:{headline:$.refresh}},seeMorePageButton:{name:$.seeMorePageButton,behavior:O.wu.Navigate,action:O.Aw.Click,content:{headline:$.seeMorePageButton}},updateFeed:{name:$.updateFeed,behavior:O.wu.Navigate,action:O.Aw.Click,content:{headline:$.updateFeed}},dismissBtn:{name:$.dismissBtn,behavior:O.wu.Hide,action:O.Aw.Click,content:{headline:$.dismissBtn}}};function H(e){const t=e&&e.contract&&e.contract.ext||void 0;return Object.assign(Object.assign({},function(e,t){const r={};return Object.keys(e).forEach((i=>{r[i]=new L.D(Object.assign(Object.assign({},e[i]),{ext:t})).getMetadataTag()})),r}(G,t)),{modules:Object.assign({},j(t)),getSelectTelemetryTag:q(t),getUnselectTelemetryTag:W(t)})}function j(e){return{RecommendedInterests:new L.D({name:$.RecommendedInterests,type:O.c9.Module,ext:e}).getMetadataTag(),FeedUpdatedToast:new L.D({name:$.toast,type:O.c9.Module}).getMetadataTag()}}function D(e,t,r){const i=function(e,t){const r=B[(e=e||{}).type];return r?r(e,t):{}}(e,t);return new L.D({name:i.name,type:O.c9.ActionButton,behavior:t?O.wu.Follow:O.wu.Unfollow,ext:r,content:Object.assign(Object.assign({},i.content||{}),{id:null==e?void 0:e.id})}).getMetadataTag()}function q(e){return t=>D(t,!0,e)}function W(e){return t=>D(t,!1,e)}const B={[M.e7.Topic]:function(e,t){const r=e;return{name:`${$.topic}_${null==r?void 0:r.title}`,content:{headline:t?`${null==r?void 0:r.title} unfollowed. Click to follow.`:`${null==r?void 0:r.title} followed. Click to unfollow.`,type:O.uH.Topic}}}};var N=r(74045),z=r(26007),V=r(53790),J=r(53909),Y=r(12968);class X{constructor(e){this.refreshCount=0,this.recommendedInterestsProps=e,this.initializeTemplate(),this.setSeeMoreButtonDisabledState()}refresh(e){this.refreshCount++;const t=this.pages[this.refreshCount],{RecommendedInterestsVM:r,updateRecommendedInterestsVM:i}=this.recommendedInterestsProps;r.squareTemplateContent?r.squareTemplateContent.content=t:r.pillTemplateContent.content=t,this.setSeeMoreButtonDisabledState(),i(),this.setFocusOnDisabledState(e)}setSeeMoreButtonDisabledState(){const{recommendedInterestsRoot:e}=this.recommendedInterestsProps;this.refreshCount>=this.pages.length-1&&(e.RecommendedInterestsVM.disableSeeMoreButton=!0)}setFocusOnDisabledState(e){this.refreshCount>=this.pages.length-1&&e&&Y.SO.queueUpdate((()=>{this.recommendedInterestsProps.recommendedInterestsRoot.shadowRoot.querySelector(".focusable-artifact").focus()}))}}var K=r(99478);function Q(e,t,r,i){if(!(null==e?void 0:e.url))return"";e.url=e.url.replace("http:","https:");const n={width:t.width,height:t.height,format:i||J.D3.JPG,enableDpiScaling:!1,focalRegion:e.focalRegion,quality:J.pG,mode:r?J.vc.Crop:J.vc.Scale};return(0,J.mL)(e.url,n)}function _(e,t,r,i){const n={url:m},{strings:s,telemetry:o}=r;return Object.assign(Object.assign({},e),{imgSrc:Q(e.image||n,t,!0),name:e.title,selected:e.selected,selectAriaLabel:(0,K.WU)(s.interestBtnFollowAriaLabel,e.title),selectTelemetryTag:null==o?void 0:o.getSelectTelemetryTag(e),unselectAriaLabel:(0,K.WU)(s.interestBtnUnfollowAriaLabel,e.title),unselectTelemetryTag:null==o?void 0:o.getUnselectTelemetryTag(e),updateItemSelection:t=>{i(e,t)}})}class Z extends X{initializeTemplate(){this.recommendedInterestsProps.RecommendedInterestsVM.pillTemplateContent={content:this.mapPages(this.recommendedInterestsProps.initialArtifacts)}}mapPages(e){const t=Math.ceil(e.length/10);this.pages=[];for(let r=0;r<t;r++){const t=10*r;this.pages.push(this.mapPage(e,t))}return this.pages[0]}mapPage(e,t){const r=[];for(let i=0;i<5;i++){const n=t+2*i;if(n>=e.length)break;r.push(this.mapRow(e,n))}return r}mapRow(e,t){const r=[],i=t+2;for(let n=t;n<Math.min(i,e.length);n++)r.push(_(e[n],p.Pill,this.recommendedInterestsProps.RecommendedInterestsVM,this.recommendedInterestsProps.updateItemSelection));return r}}var ee;!function(e){e.Square="Square",e.Pill="Pill"}(ee||(ee={}));class te extends X{initializeTemplate(){this.recommendedInterestsProps.RecommendedInterestsVM.squareTemplateContent={content:this.mapPages(this.recommendedInterestsProps.initialArtifacts)}}mapPages(e){const t=Math.ceil(e.length/6);this.pages=[];for(let r=0;r<t;r++){const t=6*r;this.pages.push(this.mapPage(e,t))}return this.pages[0]}mapPage(e,t){const r=[],i=t+6;for(let n=t;n<Math.min(i,e.length);n+=1)r.push(_(e[n],p.Square,this.recommendedInterestsProps.RecommendedInterestsVM,this.recommendedInterestsProps.updateItemSelection));return r}}var re=r(68364),ie=r(26415),ne=r(88257),se=r(4977),oe=r(60164),ae=r(53076),de=r(82891),ce=r(82423);class le{constructor(e,t){this.firedTopicsDataConnectorError=!1,this.locale=e,(0,ce.oU)(ae.z.TopicData).then((e=>{this.topicsDataConnector=e})),this.freServiceClient=t}selectTopic(e,t){let r;if(this.topicsDataConnector){let i=this.topicsDataConnector.getCurrentState().topicMap[e.id];i||(ne.G.topic.getActionSender(this.topicsDataConnector).send(this.mapTopicArtifactToInterestsTopic(e,this.locale)),i=this.topicsDataConnector.getCurrentState().topicMap[e.id]),r=t?(null==i?void 0:i.isInferred)?this.topicsDataConnector.followTopic(e.id,null,!0):this.topicsDataConnector.followTopic(e.id):this.topicsDataConnector.unfollowTopic(e.id)}else r=this.freServiceClient.updateArtifactInActionsEndpoint(e,t),this.firedTopicsDataConnectorError||(this.firedTopicsDataConnectorError=!0,(0,re.H)(ie._7Q,"Topic Data Connector is not defined, falling back to fre service client"));return r}mapTopicArtifactToInterestsTopic(e,t){const r=e||{};return{followState:se.t.Unfollowed,id:r.id,imgSrc:r.image&&r.image.url,name:r.title,feedType:oe.u.SysTag,locale:t||r.locale,href:r.id&&r.title&&(0,de.Xw)(r.id,r.title)}}}var he=r(9610),ue=r(32804),pe=r(35928);class me extends he.l{constructor(){super(),this.showInlineInterestToast=!1,this.showInlineErrorToast=!1,this.doneClickHandler=()=>(0,c.mG)(this,void 0,void 0,(function*(){yield this.freServiceClient.setDoneFreState(f),V.q.refreshRiver.getGlobalActionSender().send(),this.openRefreshToast()})),this.dismissClickHandler=()=>{this.cardActionClickHandler&&this.cardActionClickHandler("recommendedInterestsCard",N.O7.enabled^N.O7.hidden^N.O7.dismiss,null,!1,null,void 0,!1,null,this.dismissDoneHandler)},this.seeMoreBtnClickHandler=e=>{this.mapper.refresh(e)},this.resetInlineErrorToast=()=>{clearTimeout(this.inlineToastTimer),this.inlineToastTimer=setTimeout((()=>{this.showInlineErrorToast&&(this.showInlineErrorToast=!1)}),3e3)},this.errorPageClickHandler=e=>{e&&"Enter"!==e.code&&"Space"!==e.code||(e&&P.M0.sendActionEvent(e.currentTarget,O.Aw.KeyPress),this.navigateToPersonalizePage())},this.updateItemSelection=(e,t)=>{const r=t&&t.detail&&t.detail.selected;this.TopicDataConnectorWrapper.selectTopic(e,r).then(this.handleUpdate),this.RecommendedInterestsVM.totalSelected+=r?1:-1,me.locallyFollowedTopics[e.id]=r;const i=this.shouldDisableNextStageButton();this.RecommendedInterestsVM.disableDoneButton!==i&&(this.RecommendedInterestsVM.disableDoneButton=i),this.updateRecommendedInterestsVM()},this.updateRecommendedInterestsVM=()=>{this.RecommendedInterestsVM=Object.assign({},this.RecommendedInterestsVM)},this.shouldDisableNextStageButton=()=>this.RecommendedInterestsVM.totalSelected<u,this.openRefreshToast=()=>{C.h.renderToast({id:"recommended-interests-refresh",toastType:E.p.Refresh,inputText:this.strings.refreshToastText,buttonText:this.strings.refreshToastBtnText,onClick:()=>this.navigateToPersonalizePage(!0),moduleTelemetryTags:this.RecommendedInterestsVM.telemetry.modules.FeedUpdatedToast})},this.handleUpdate=e=>{e?!this.config.enableInlineToast||me.inlineInterestToastShown||this.showInlineInterestToast||this.showInlineErrorToast||(this.showInlineInterestToast=!0,me.inlineInterestToastShown=!0,setTimeout((()=>{this.showInlineInterestToast=!1}),3e3)):this.config.enableInlineToast?(this.showInlineErrorToast=!0,this.resetInlineErrorToast()):C.h.renderToast({id:"recommended-interests-failure",toastType:E.p.RecommendedInterestsFailure})},this.dismissDoneHandler=()=>{this.RecommendedInterestsVM.totalSelected>0?this.doneClickHandler():this.freServiceClient.setDoneFreState(f)}}recommendedInterestsArtifactChanged(e,t){const r=this.getSubCardIdString(t&&t.subCards),i=me.previousIds&&r!=me.previousIds;me.previousIds&&(me.previouslySelected=0,t&&t.subCards.forEach((e=>{me.locallyFollowedTopics[e.id]&&(e.selected=!0,me.previouslySelected+=1)}))),i||me.previousIds||!this.RecommendedInterestsVM||this.initializeStageProps(),i&&this.RecommendedInterestsVM&&(this.RecommendedInterestsVM.totalSelected=me.previouslySelected,this.RecommendedInterestsVM.disableDoneButton=0==me.previouslySelected,this.RecommendedInterestsVM.disableSeeMoreButton=!1,this.initializeStageProps(),this.freServiceClient.incrementUserImpression()),me.previousIds=r}experienceConnected(){this.RecommendedInterestsVM={telemetry:H(this.parentTelemetry),strings:this.strings,totalSelected:me.previouslySelected,disableDoneButton:0==me.previouslySelected},this.initializeFreServiceClient(),this.recommendedInterestsArtifact&&this.initializeStageProps()}shadowDomPopulated(){this.direction||(this.direction=ue.o7V.getValueFor(this)||z.N.ltr,ue.o7V.subscribe(this,this)),this.dispatchEvent(new Event("telemetrynodeadded")),function(){(0,c.mG)(this,void 0,void 0,(function*(){if(U.Al.CurrentFlightSet&&(0,R.DM)()){let e;for(let t=0;t<v.length;t++){const r=v[t];if(U.Al.CurrentFlightSet.has(r)){e=r;break}}e&&(0,R.SI)(e)}}))}(),me.shouldFireInitialFreImpression&&(this.freServiceClient.incrementUserImpression(),me.shouldFireInitialFreImpression=!1)}getExperienceType(){return a.x.recommendedInterests}handleChange(){this.direction=ue.o7V.getValueFor(this)}initializeStageProps(){if(this.recommendedInterestsArtifact&&function(e){let t=!0;const r=e&&e.length||0;return r<5?(t=!1,(0,re.H)(ie.SJe,"RecommendedInterests received too little cards, showing error card.",`count: ${r}`)):r<18&&(0,re.H)(ie.lub,"RecommendedInterests received less than full expected amount, but will render them.",`count: ${r}`),e&&e.map((e=>{let t=["id","type"];e.type&&(t=t.concat(["title","image"]));const r=t.filter((t=>!e[t]));e.image&&!e.image.url&&r.push("image url"),r.length&&(0,re.H)(Object.assign({},ie.bH3),`RecommendedInterests received ${e.type} artifact with id ${e.id} missing properties`,r.join())})),t}(this.recommendedInterestsArtifact.subCards)){this.TopicDataConnectorWrapper||(this.TopicDataConnectorWrapper=new le(this.recommendedInterestsArtifact.locale,this.freServiceClient));const e={RecommendedInterestsVM:this.RecommendedInterestsVM,updateItemSelection:this.updateItemSelection,initialArtifacts:this.recommendedInterestsArtifact.subCards,updateRecommendedInterestsVM:this.updateRecommendedInterestsVM,recommendedInterestsRoot:this};this.setMapperFromConfig(e),this.updateRecommendedInterestsVM()}else this.mapErrorPage()}setMapperFromConfig(e){if(this.config.template===ee.Square)this.mapper=new te(e);else this.mapper=new Z(e)}initializeFreServiceClient(){this.freServiceClient||(this.freServiceClient=(0,l._n)())}mapErrorPage(){this.RecommendedInterestsVM.errorPage=!0,this.RecommendedInterestsVM.errorImage=Q(this.recommendedInterestsArtifact.images&&this.recommendedInterestsArtifact.images[0]||g,p.ErrorPageImage,!1,J.D3.PNG)}navigateToPersonalizePage(e){this.config.useRouterToNavigate?this.navigateToPersonalizeWithRouter(e):this.goToPersonalizeCallback?this.navigateToWindowsHPPersonalizeWithCallback(e):this.navigateToWindowsHPPersonalizeWithoutRouter(e)}navigateToPersonalizeWithRouter(e){const t={noScroll:!0,pageType:"MyInterests",scrollToFollowedInterests:e};pe.Nd.navigate("personalize",t)}navigateToWindowsHPPersonalizeWithoutRouter(e){const t=new URL((e?b:y).replace(T,k.jG.CurrentMarket),w),r=(0,x.ku)();r&&t.searchParams.set("ocid",r),window.open(t.href,"_blank")}navigateToWindowsHPPersonalizeWithCallback(e){e?this.goToPersonalizeCallback(I):this.goToPersonalizeCallback(S)}getSubCardIdString(e){return e&&e.map((e=>e.id)).toString()}}me.locallyFollowedTopics={},me.previouslySelected=0,me.shouldFireInitialFreImpression=!0,me.inlineInterestToastShown=!1,(0,c.gn)([(0,F.Lj)({attribute:"button-caption"})],me.prototype,"buttonCaption",void 0),(0,c.gn)([(0,F.Lj)({attribute:"card-size"})],me.prototype,"cardSize",void 0),(0,c.gn)([A.LO],me.prototype,"recommendedInterestsArtifact",void 0),(0,c.gn)([A.LO],me.prototype,"parentContainerElement",void 0),(0,c.gn)([A.LO],me.prototype,"showInlineInterestToast",void 0),(0,c.gn)([A.LO],me.prototype,"showInlineErrorToast",void 0),(0,c.gn)([A.LO],me.prototype,"direction",void 0),(0,c.gn)([A.LO],me.prototype,"RecommendedInterestsVM",void 0);var ge=r(27292),fe=r(40082),ve=r(16859),ye=r(22674),be=r(15933),we=r(53046),Te=r(62734);const Se=we.i`
    :host .background .dismiss {
        right: 16px;
    }
`,Ie=we.i`
    :host .background .dismiss {
        left: 16px;
    }
`,$e=we.i`
    fluent-button.see-more-button::part(start) {
        margin-inline-end: 7px;
    }

    fluent-button.see-more-button svg {
        display: flex;
    }
`,Pe=we.i`
    .grid.pill-tmpl {
        grid-template-rows: 40px 192px 24px;
        grid-gap: 8px;
    }

    .pill-rows {
        display: grid;
        grid-auto-rows: 32px;
        grid-gap: 8px;
    }

    .pill-row {
        display: flex;
        gap: 8px;
    }

    .pill {
        height: 32px;
        max-width: 130px;
        min-width: 130px;
    }
`,Oe=we.i`
    .grid.square-tmpl {
        grid-template-rows: 40px 176px 24px;
        grid-gap: 16px;
    }

    .square-tmpl .stage-content {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        display: grid;
    }
`,Ce=we.i`
    .see-more {
        cursor: pointer;
        height: 100%;
    }

    .see-more .footer {
        justify-content: center;
        margin-top: 20px;
    }

    .see-more .header {
        display: block;
        height: 154px;
        margin-bottom: 16px;
    }

    .see-more .heading {
        font-weight: 700;
    }

    .see-more .sub-heading {
        -webkit-line-clamp: 2;
        font-size: var(--type-ramp-minus-1-font-size, 12px);
        line-height: var(--type-ramp-minus-1-line-height, 16px);
    }

    .see-more .bottom-end-button::part(control) {
        max-width: 260px;
        padding: 0 20px;
    }
`,Ee=we.i`
    .heading,
    .sub-heading {
        margin-block: 0;
        -webkit-line-clamp: 1;
        line-height: normal;
        text-overflow: ellipsis;
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }

    .heading {
        font-weight: 600;
        font-size: var(--type-ramp-plus-1-font-size, 16px);
    }

    .sub-heading {
        color:  #9A9A9A;
        font-size: var(--type-ramp-base-font-size, 14px);
        font-weight: 400;
    }
`,ke=we.i`
    .inline-toast {
        align-items: center;
        background: linear-gradient(154.25deg, #7C78CE 0%, #C476C2 100%);
        border-radius: 0px 0px 6px 6px;
        bottom: 0;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
        color: white;
        display: flex;
        font-size: var(--type-ramp-minus-1-font-size, 12px);
        height: 48px;
        justify-content: center;
        position: absolute;
        width: 300px;
        z-index: 1;
    }

    .inline-toast span {
        text-align: center;
        width: 268px;
    }
`,xe=we.i`
    :host .background .dismiss {
        position: absolute;
        top: 16px;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 28px;
        min-width: 28px;
        padding: 0px;
        outline: none;
        border-radius: 100%;
        background-color: rgba(0, 0, 0, 0.54);
        fill: #FFFFFF;
        cursor: pointer;
        border-radius: 100%;
        border: 2px solid transparent;
        transition: opacity 0.1s linear 0s;
        opacity: 0;
        z-index: 4;
    }

    :host(:hover) .background .dismiss,
    :host(:focus-within) .background .dismiss {
        opacity: 1;
    }

    :host .background .dismiss:hover,
    :host .background .dismiss:focus-visible {
        background-color: rgba(0, 0, 0, 0.62);
    }

    :host .background .dismiss:focus-visible {
        border-color: var(--focus-stroke-outer);
    }
`,Fe=we.i`
    :host .stage-container,
    :host .grid {
        --neutral-fill-hover: #FFFFFF26;
        --neutral-fill-rest: #FFFFFF1A;
        --neutral-fill-active: #FFFFFF14;
        --note-color: #FFFFFF8C;
    }

    :host .background {
        background: radial-gradient(100% 193.51% at 100% 0%, #2B3033 0%, #2B2E33 16.92%, #332B30 32.81%, #33292F 48.8%, #332B30 63.79%, #2B2C33 81.34%, #2D3238 100%, #2B2F33 100%);
    }
`,Ae=we.i`
    :host .background {
        background: radial-gradient(100% 193.51% at 100% 0%, #EDF4F8 0%, #EFF2FA 16.92%, #FAEFF6 34.8%, #FAE6F2 48.8%, #FAF0F7 63.79%, #F1F1FB 81.34%, #F0F4F8 100%);
    }
`,Me=we.i`
    ${$e}
    ${Pe}
    ${Ce}
    ${Oe}
    ${Ee}
    ${ke}
    ${xe}

    :host .background {
        --elevation: 4;
        width: 100%;
        height: 100%;
        border-radius: calc(var(--layer-corner-radius) * 1px);
        --neutral-fill-hover: #00000024;
        --neutral-fill-rest: #00000012;
        --neutral-fill-active: #0000000F;
        --note-color: #0000008C;

        ${Te.XC};
    }

    .heading,
    .sub-heading {
        text-align: center;
    }

    .grid {
        display: grid;
        position: absolute;
        inset: 16px;
    }

    .footer {
        display: flex;
        justify-content: space-between;
    }

    .bottom-end-button {
        border-radius: 20px;
        height: 24px;
    }

    .bottom-end-button::part(content) {
        text-overflow: ellipsis;
        overflow: hidden;
        font-size: var(--type-ramp-minus-1-font-size, 12px);
        line-height: var(--type-ramp-minus-1-line-height, 16px);
    }
    
    .bottom-end-button::part(control) {
        max-width: 130px;
        padding: 0 11px;
    }
`.withBehaviors(new ve.Y(Ae,Fe),new ye.O(Se,Ie),(0,fe.vF)(we.i`
            :host {
                forced-color-adjust: none;
            }
            .done-message,
            .heading,
            .sub-heading{
                color: ${be.H.LinkText};
                background: ${be.H.ButtonFace};
            }
        `)),Re={"--recommended-interests-background":"radial-gradient(100% 193.51% at 100% 0%, #2B3033 0%, #2B2E33 16.92%, #332B30 32.81%, #33292F 48.8%, #332B30 63.79%, #2B2C33 81.34%, #2D3238 100%, #2B2F33 100%)"},Le={"--recommended-interests-background":"radial-gradient(100% 193.51% at 100% 0%, #EDF4F8 0%, #EFF2FA 16.92%, #FAEFF6 34.8%, #FAE6F2 48.8%, #FAF0F7 63.79%, #F1F1FB 81.34%, #F0F4F8 100%)"},Ue={experienceConfigSchema:d}},74045:function(e,t,r){var i,n;r.d(t,{KE:function(){return o},O7:function(){return i},Qp:function(){return a},Us:function(){return n},XQ:function(){return s}}),function(e){e[e.none=0]="none",e[e.enabled=1]="enabled",e[e.saved=2]="saved",e[e.hide=4]="hide",e[e.showMore=8]="showMore",e[e.showFewer=16]="showFewer",e[e.mute=32]="mute",e[e.hidden=64]="hidden",e[e.report=128]="report",e[e.adFeedbackSubmitted=256]="adFeedbackSubmitted",e[e.hideTopic=512]="hideTopic",e[e.dismiss=1024]="dismiss",e[e.adPrivacy=2048]="adPrivacy"}(i||(i={})),function(e){e.Hide="Hide",e.Like="Like",e.Disabled="Disabled",e.Dislike="Dislike",e.Mute="Mute",e.Save="Save",e.Share="Share",e.ShowMore="ShowMore",e.ShowFewer="ShowFewer",e.Divider="Divider",e.Report="Report",e.ManageInterests="ManageInterests",e.ReportAd="ReportAd",e.AdPrivacy="AdPrivacy",e.HideTopic="HideTopic"}(n||(n={}));const s=e=>{const t=[],r={AdultImage:"AdultImage",RacyImage:"RacyImage",TextProfanity:"TextProfanity",SubstanceAbuse:"SubstanceAbuse",Violence:"Violence",Misinformation:"Misinformation",Other:"Other"};return e&&Object.keys(e).forEach((i=>{e[i]&&t.push(r[i])})),t},o="/service/feedback/api/reportanissue",a="https://assets.msn.cn/service/feedback/api/reportanissue"},45588:function(e,t,r){r.d(t,{DM:function(){return l},HQ:function(){return u},SI:function(){return h},SM:function(){return p},fI:function(){return m},uC:function(){return c},yl:function(){return d}});var i=r(33940),n=r(54804),s=r(16517),o=r(26415),a=r(65135);function d(){return(0,i.mG)(this,void 0,void 0,(function*(){document.documentElement&&document.documentElement.setAttribute("data-clarity-unmask","true"),yield c("https://www.clarity.ms/tag/3j9o3mfoml")}))}function c(e){return(0,i.mG)(this,void 0,void 0,(function*(){return new Promise(((t,r)=>{const i=window,n="clarity";i[n]=i[n]||function(...e){(i[n].q=i[n].q||[]).push(e)};const s=function(e){const t=document.createElement("script");return t.id="clarityScript",t.type="text/javascript",t.async=!0,t.crossOrigin="anonymous",t.src=e,t}(e);s.onload=()=>{t()},s.onerror=t=>{a.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.KKn),{message:"Failed to load clarity script",pb:Object.assign(Object.assign({},o.KKn.pb),{customMessage:`Error occurred while loading external script for clarity, script url: ${e}`})})),r(t)},document.head.appendChild(s)}))}))}function l(){return window.clarity}function h(e){window.clarity&&null!=e&&window.clarity("set",e,"1")}function u(){n.Al.CurrentFlightSet.forEach((e=>{h(e)}));const e=s.jG.UserId;e&&m("MUID",e);const t=a.M0.getRequestId();t&&m("RequestId",t)}function p(e){window.clarity&&null!=e&&e.length>0&&m("Flights",e)}function m(e,t){window.clarity&&null!=t&&window.clarity("set",e,t.toString())}},48328:function(e,t,r){var i;r.d(t,{Hf:function(){return o},Ik:function(){return s},Kr:function(){return n},e7:function(){return i},hp:function(){return a}}),function(e){e.Publisher="Publisher",e.Article="Article",e.Topic="Topic"}(i||(i={}));const n={Publisher:{actionType:"More",targetType:"SourceProvider"},Article:{actionType:"Like"},Topic:{actionType:"Follow"}};var s,o;!function(e){e.Get="GET",e.Post="POST",e.Delete="DELETE"}(s||(s={})),function(e){e.Providers="Providers",e.ArticlesMulti="ArticlesMulti",e.Confirmation="Confirmation",e.Topics="Topics",e.Upsell="Upsell"}(o||(o={}));const a=-1},9683:function(e,t,r){r.d(t,{_n:function(){return w}});var i=r(33940),n=r(48328),s=r(33954),o=r(26415),a=r(33799),d=r(16517),c=r(67267),l=r(63535),h=r(51671),u=r(87298);class p{constructor(e){this.fetchImpl=e,this.actionsEndpoint="./Graph/Actions",this.defaultOcid="Peregrine"}sendPostActionRequest(e,t=this.defaultOcid,r=!0){return(0,i.mG)(this,void 0,void 0,(function*(){const n=JSON.stringify(e),s={method:"POST",body:n,headers:yield c.$.getOneServiceHeaders()};(yield(0,h.hC)())&&(s.credentials="include");const o=(0,l.PH)(this.actionsEndpoint);(yield c.$.getCommonParams2(t,r)).forEach((e=>e.value&&o.searchParams.set(e.key,e.value)));return yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,s);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for Post request: ${o.href} with params ${JSON.stringify(s)}`;throw new Error(t)}return e}))),`postAction${n}`)}))}sendDeleteActionRequest(e,t=this.defaultOcid,r=!0){return(0,i.mG)(this,void 0,void 0,(function*(){const n=yield c.$.getBaseRequestData("DELETE");(yield(0,h.hC)())&&(n.credentials="include");let s="";const o=Object.keys(e),a=o.length;for(let t=0;t<a;t++)s+=`${o[t]} eq '${e[o[t]]}'`,t!=a-1&&a>1&&(s+=" and ");const d={key:"$filter",value:s},p=(0,l.PH)(this.actionsEndpoint);[d,...yield c.$.getCommonParams2(t,r)].forEach((e=>e.value&&p.searchParams.set(e.key,e.value)));return yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(p.href,n);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for Delete request: ${p.href} with params: ${JSON.stringify(n)}`;throw new Error(t)}return e}))),`deleteAction${s}`)}))}}var m=r(51125),g=r(65135),f=r(33379),v=r(791);class y extends class{constructor(e){this.fetchImpl=e,this.ocid="feeds",this.freServiceEndpoint="news/fre",this.userEndpoint="./msn/user",this.addPageInfoToOcid=!0,this.actionsClient=new p(e),"newsAndInterests"===d.jG.AppType||"windowsNewsPlus"===d.jG.AppType||"winWidgets"===d.jG.AppType?(this.addPageInfoToOcid=!1,this.ocid="winp2"):"gaming"===d.jG.AppType&&(this.addPageInfoToOcid=!1,this.ocid="startgg-feeds")}getFreArtifacts(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){const r=(0,l.PH)(this.freServiceEndpoint);r.searchParams.set("bypass_trigger","true"),e&&r.searchParams.set("query",e),t&&r.searchParams.set("$top",t.toString());return[...(yield(0,h.XJ)())===a.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,this.addPageInfoToOcid):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,this.addPageInfoToOcid),{key:m.i$,value:Date.now().toString()}].forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)})),this.getFreArtifactsWithUrl(r.href)}))}getFreArtifactsWithUrl(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e||"-1"===e)return null;const t={method:n.Ik.Get,credentials:"include",headers:yield c.$.getOneServiceHeaders()};try{const r=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){return yield this.fetchImpl(e,t)}))),"getFreArtifacts");if(!r.ok)throw Error(`[FreServiceClient.getFreArtifacts] Failed with response: ${JSON.stringify(r)}`);const n=r.headers&&r.headers.get("ddd-tmpl");return g.M0.addOrUpdateTmplString(n),r.json()}catch(e){throw s.k.logError(e.message),e}}))}setFreArtifactForUser(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){if(e&&t){const r={method:t,credentials:"include",headers:yield c.$.getOneServiceHeaders()};(0,l.PH)(this.freServiceEndpoint);let n=0;try{if(n=(yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){return yield this.fetchImpl(e,r)}))),"setFreArtifact")).status,n>=400){const e=`OneService returned error response. Status: ${n} for done action`;throw new Error(e)}}catch(e){return s.k.logError(e.message),n}return n}return g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.G7x),{message:`Any of the required parameters was not properly set by the caller. callbackUrl: ${e} method: ${t}.`})),0}))}updateArtifactInActionsEndpoint(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){let r;n.Kr[e.type]&&(r=Object.assign({},n.Kr[e.type])),r.targetId=e.id;try{t?yield this.actionsClient.sendPostActionRequest(r,this.ocid,this.addPageInfoToOcid):yield this.actionsClient.sendDeleteActionRequest(r,this.ocid,this.addPageInfoToOcid),(0,m.T1)()}catch(r){return g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.rNk),{message:"Fre Actions call failed",pb:Object.assign(Object.assign({},o.rNk.pb),{customMessage:`artifact: ${JSON.stringify(e)} following: ${t} error message: ${r}`})})),!1}return!0}))}setDoneFreState(e){return(0,i.mG)(this,void 0,void 0,(function*(){yield this.setFreState(JSON.stringify({stage:e||n.hp}),o.YVg)}))}setMaybeLaterFreState(){return(0,i.mG)(this,void 0,void 0,(function*(){yield this.setFreState(JSON.stringify({dismiss_timestamp:new Date(Date.now()).toJSON()}),o.GJW)}))}incrementUserImpression(){return(0,i.mG)(this,void 0,void 0,(function*(){let e=0;try{const t=yield this.getFreState();e=Number(t.impressionCount)||0}catch(e){if(g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.tCQ),{message:"Error getting the stored count",pb:Object.assign(Object.assign({},o.tCQ.pb),{customMessage:`${e}`})})),!(e instanceof SyntaxError))return}yield this.setFreState(JSON.stringify({impressionCount:e+1}),o.yRR)}))}getFreState(){return(0,i.mG)(this,void 0,void 0,(function*(){const e=yield v.N.getPdpUserPreference(!0),t=e&&(e.is404?{}:e.value&&e.value[0]);if(!t)throw"User object invalid or missing from response";return t.freMultiStepState?JSON.parse(t.freMultiStepState):{}}))}setFreState(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){const r={method:"POST",body:JSON.stringify({freMultiStepState:e}),headers:yield c.$.getOneServiceHeaders()};(yield(0,h.XJ)())===a.Hy.SignedIn&&(r.credentials="include");const n=(0,l.PH)(this.userEndpoint);(yield c.$.getCommonParams2(this.ocid,this.addPageInfoToOcid)).forEach((e=>e.value&&n.searchParams.set(e.key,e.value)));try{yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.href,r);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for call to set user state`;throw new Error(t)}return e.json()}))),"sendFreDoneAction")}catch(r){g.M0.sendAppErrorEvent(Object.assign(Object.assign({},t),{message:"Service call to set fre state failed",pb:Object.assign(Object.assign({},t.pb),{customMessage:`state: ${e} error: ${r}`})}))}}))}getShuffleState(){return(0,i.mG)(this,void 0,void 0,(function*(){try{const e=(yield this.getFreState()).shuffle||{};e.impressionCount||(e.impressionCount=0),e.dismissTimestamp=e.dismissTimestamp?new Date(e.dismissTimestamp):null,e.impressionDates=e.impressionDates?e.impressionDates.map((e=>new Date(e))):[],e.setNumbersSeenOn||(e.setNumbersSeenOn={});for(const t in e.setNumbersSeenOn)e.setNumbersSeenOn[t]=new Date(e.setNumbersSeenOn[t]);return e}catch(e){return g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.rNk),{message:"Service call to get fre state failed",pb:Object.assign(Object.assign({},o.rNk.pb),{customMessage:e.message})})),null}}))}setShuffleState(e){return(0,i.mG)(this,void 0,void 0,(function*(){yield this.setFreState(JSON.stringify({shuffle:e}),o.pY1)}))}}{constructor(e){let t;t=e||((0,f.N)()?window.fetch.bind(window):fetch),super(t)}}let b;const w=e=>b||(b=new y(e),b)},30113:function(e,t,r){var i;r.d(t,{m:function(){return i}}),function(e){e.small="OneByOne",e.medium="OneByTwo",e.large="OneByThree"}(i||(i={}))},11708:function(e,t,r){var i;r.d(t,{f:function(){return i}}),function(e){e.AiCharacter="aicharacterCardEnabled",e.AutosMarketplaceCard="autosmarketplaceCardEnabled",e.HoroscopeCard="horoscopeCardEnabled",e.WeatherCard="weatherCardEnabled",e.SportsCard="sportsCardEnabled",e.MoneyCard="moneyCardEnabled",e.FinanceCard="financeCardEnabled",e.OnThisDayCard="onthisdayCardEnabled",e.ShoppingCard="shoppingCardEnabled",e.ShoppingEventCard="eventSDCardShoppingEnabled",e.TrafficCard="trafficCardEnabled",e.EsportsCard="esportsCardEnabled",e.EsportsStreamsCard="esportsStreamsCardEnabled",e.ElectionsCard="genericelectionCardEnabled",e.LotteryCard="lotteryCardEnabled",e.QnaCard="qnaCardEnabled",e.RecipesCard="recipeCardEnabled",e.InspirationCard="inspirationCardEnabled",e.TravelCard="travelCardEnabled",e.HealthCard="healthCardEnabled",e.TopStoriesCard="topstoriesCardEnabled",e.TrendingTopics="TrendingTopicsUpsellEnabled",e.LocalGuideCard="localGuideCardEnabled",e.GroceryCard="groceryCardEnabled",e.RewardsCard="rewardsCardEnabled",e.RecommendedSearchesCard="recommendedSearchesCardEnabled",e.PersonalizedOffersCard="personalizedoffersCardEnabled",e.PollsCard="pollsCardEnabled",e.MarketPlaceCard="marketplaceCardEnabled",e.QuizCard="quizCardEnabled",e.CasualGamesCard="esportsCardEnabled",e.CommuteCard="commuteCardEnabled",e.Crypto="CryptoCard",e.MarketBrief="MarketBriefCard"}(i||(i={}))},83152:function(e,t,r){var i;r.d(t,{L:function(){return i}}),function(e){e.Location="Location",e.Weather="Weather",e.Finance="Finance",e.Team="Team",e.League="League",e.Player="Player",e.Traffic="Traffic",e.Widget="Widget",e.TopicFeed="TopicFeed"}(i||(i={}))},791:function(e,t,r){r.d(t,{N:function(){return b}});var i=r(33940),n=r(33954),s=r(26415),o=r(68364),a=r(33799),d=r(16517),c=r(94788),l=r(67267),h=r(63535),u=r(87298),p=r(83152),m=r(11708),g=r(30113),f=r(65135),v=r(33379),y=r(51671);const b=new class extends class{constructor(e){this.fetchImpl=e,this.userUpdateEndpoint="msn/user",this.pdpServiceEndpoint="graph/actions",this.locationsServiceEndPoint="v1/news/users/me/locations",this.userActionServiceEndPoint="news/users/me/actions",this.ocid="Peregrine",this.ocidOverride=!1}getUserDefaultLocation(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t={method:"GET",headers:yield l.$.getOneServiceHeaders(),credentials:"include"},r=(0,h.PH)(this.locationsServiceEndPoint);let n;[...l.$.getCommonParams2(this.ocid,!this.ocidOverride),{key:"autodetect",value:e&&`${e}`}].forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)}));try{n=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(r.href,t);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: getUserDefaultLocation}`;throw new Error(t)}return e}))),"getUserDefaultLocation")}catch(e){return n}return n}))}addToFavoriteLocation(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){const r="Location",n="Follow",s={method:"POST",body:JSON.stringify({actionType:n,targetType:r,definitionName:t,degree:"FavoriteLocation",metaData:e}),headers:yield l.$.getOneServiceHeaders(),credentials:"include"},o=(0,h.PH)(this.pdpServiceEndpoint);let c;((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));try{c=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,s);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: Location`;throw new Error(t)}return e.json()}))),"addToFavoriteLocation")}catch(e){return!1}return!0}))}removeFavoriteLocation(e){return(0,i.mG)(this,void 0,void 0,(function*(){return yield this.deleteFromPdp(p.L.Location,"definitionName",[e])}))}removeLocation(e){return(0,i.mG)(this,void 0,void 0,(function*(){return yield this.deleteFromPdp(p.L.Location,"definitionName",[e])}))}updatePdpHomeLocation(e,t,r={},n){return(0,i.mG)(this,void 0,void 0,(function*(){const s=p.L.Location,o="Follow",c=yield this.getRequestInit({method:"POST"},r);c.body=JSON.stringify({actionType:o,targetType:s,definitionName:t,degree:"DefaultLocation",metaData:e});const m=(0,h.PH)(this.pdpServiceEndpoint);return((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&m.searchParams.set(e.key,e.value)})),yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(m.href,c);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${s}`;throw new Error(t)}return e}))),"setPdpHomeLocation"),this.tryInvalidateBulkFetchedPdpTargetType(s),!0}))}updateTrafficMyRoutes(e,t,r,s,o,a){return(0,i.mG)(this,void 0,void 0,(function*(){const d=r.replace(/[^a-zA-Z0-9\-.,_]/g,""),c=p.L.Traffic,h="Follow",m={method:"POST",body:JSON.stringify({actionType:h,targetType:c,targetId:d,degree:e,definitionName:t,metadata:s,createdDateTime:a}),headers:yield l.$.getOneServiceHeaders(),credentials:"include"},g=yield this.getTrafficPdpUrl(null,null,o);try{yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(g.href,m);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${c}`;throw new Error(t)}return e.json()}))),"updateTrafficMyRoutes");this.tryInvalidateBulkFetchedPdpTargetType(c)}catch(e){return n.k.logError(e.message),!1}return!0}))}deleteTrafficMyRoutes(e,t,r){return(0,i.mG)(this,void 0,void 0,(function*(){const n={method:"DELETE",headers:yield this.getOneserviceHeaders(),credentials:"include"},s=yield this.getTrafficPdpUrl(e,t,r);try{yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(s.href,n);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${p.L.Traffic}`;throw new Error(t)}return e}))),"deleteTrafficFromPdp"),this.tryInvalidateBulkFetchedPdpTargetType(p.L.Traffic)}catch(e){return!1}return!0}))}getTrafficMyRoutes(e,t){var r;return(0,i.mG)(this,void 0,void 0,(function*(){const n={method:"GET",headers:yield this.getOneserviceHeaders(),credentials:"include"},s=yield this.getTrafficPdpUrl(e,null,t);try{const e=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(s.href,n);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${p.L.Traffic}`;throw new Error(t)}return e}))),"getTrafficFromPdp");return null===(r=yield e.json())||void 0===r?void 0:r.value}catch(e){return null}}))}getTrafficPdpUrl(e,t,r){return(0,i.mG)(this,void 0,void 0,(function*(){const i=(0,h.PH)(this.pdpServiceEndpoint),n=(yield(0,y.XJ)())===a.Hy.SignedIn,s=(0,d.Yq)().UserId,o=n?l.$.getOneServiceParamsWithAuth(s,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(s,this.ocid,!this.ocidOverride);if(e||t){const r=`targetType eq '${p.L.Traffic}'`,n=e?`degree eq '${e}'`:"",s=t?`definitionName eq '${t}'`:"";i.searchParams.set("$filter",`actionType eq 'Follow' and (${r})${n?` and (${n})`:""}${s?` and (${s})`:""}`)}return[...o,...r||[]].forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)})),i}))}addToWatchList(e,t=0,r={},n={}){return(0,i.mG)(this,void 0,void 0,(function*(){const s=p.L.Finance,o="Follow",c={method:"POST",body:JSON.stringify({actionType:o,targetType:s,targetId:e,metadata:Object.assign({securityType:t,tickerId:this.generateUUID()},n)}),headers:yield this.getOneserviceHeaders(r),credentials:"include"},m=(0,h.PH)(this.pdpServiceEndpoint),g="zh-cn"!==(0,d.Yq)().CurrentMarket;let f;((yield(0,y.XJ)())===a.Hy.SignedIn&&g?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&m.searchParams.set(e.key,e.value)}));try{f=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(m.href,c);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${s}`;throw new Error(t)}return e.json()}))),"addToWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(s)}catch(e){return!1}return!0}))}addListToWatchList(e,t={},r={}){return(0,i.mG)(this,void 0,void 0,(function*(){const n=p.L.Finance,s="Follow",o={method:"POST",body:JSON.stringify(e.map((e=>({actionType:s,targetType:n,targetId:e.key,metadata:Object.assign({securityType:e.value,tickerId:this.generateUUID()},r)})))),headers:yield this.getOneserviceHeaders(t),credentials:"include"},c=(0,h.PH)(this.pdpServiceEndpoint),m="zh-cn"!==(0,d.Yq)().CurrentMarket;let g;((yield(0,y.XJ)())===a.Hy.SignedIn&&m?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&c.searchParams.set(e.key,e.value)}));try{g=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(c.href,o);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${n}`;throw new Error(t)}return e.json()}))),"addToWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(n)}catch(e){return!1}return!0}))}generateUUID(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?r:3&r|8).toString(16)}))}sortWatchList(e,t={}){var r;return(0,i.mG)(this,void 0,void 0,(function*(){const n=p.L.Finance,s="Follow",o=yield b.readPdpWithTargetType(p.L.Finance,!0,200,t),c=o&&(null===(r=o.value)||void 0===r?void 0:r.filter((e=>e.actionType===s&&e.targetId)));if(!c||c.length<e.length)return!1;const m={};let g=e.length;c.forEach((t=>{let r=e.findIndex((e=>e===t.targetId));r<0&&(r=g,g++),m[t.targetId]=JSON.stringify({actionType:s,targetId:t.targetId,targetType:n,rank:r,metadata:t.metadata})}));const f={method:"PUT",body:JSON.stringify(m),headers:yield this.getOneserviceHeaders(t),credentials:"include"},v=(0,h.PH)(this.pdpServiceEndpoint);((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&v.searchParams.set(e.key,e.value)}));try{yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(v.href,f);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${n}`;throw new Error(t)}return e.json()}))),"sortWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(p.L.Finance)}catch(e){return!1}return!0}))}updateWeatherInterests(e,t,r,s={},o){return(0,i.mG)(this,void 0,void 0,(function*(){const t=p.L.Weather,i={method:"POST",body:JSON.stringify({actionType:"Follow",targetType:t,targetId:e,metadata:{UserAction:{0:{UpdateTime:new Date,Location:r}}}}),headers:yield this.getOneserviceHeaders(s),credentials:"include"},c=(0,h.PH)(this.pdpServiceEndpoint);((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(null!=o?o:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(null!=o?o:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&c.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(c.href,i);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update weather interests call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}updateWeatherSettings(e,t,r={},n){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!t)return!0;let i="";i=e&&!t?'{"weatherDisplayUnit":"'+e+'"}':!e&&t?'{"userSettings":{"weatherLocationSettingMode":"'+t+'"}}':'{"weatherDisplayUnit":"'+e+'","userSettings":{"weatherLocationSettingMode":"'+t+'"}}';const s=yield this.getRequestInit({method:"POST"},r);s.body=i;const o=(0,h.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));const c=yield this.fetchImpl(o.href,s);if(c.status>=400){const e=`OneService returned error response. Status: ${c.status} for update weather setting call`;throw new Error(e)}return!0}))}updateFinanceInterests(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const t={financeInterests:e},r=JSON.stringify(t),i=yield this.getRequestInit({method:"POST"});i.body=r;const n=(0,h.PH)(this.userUpdateEndpoint),s="zh-cn"!==(0,d.Yq)().CurrentMarket;((yield(0,y.XJ)())===a.Hy.SignedIn&&s?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));const o=yield this.fetchImpl(n.href,i);if(o.status>=400){const e=`OneService returned error response. Status: ${o.status} for update finance interests call`;throw new Error(e)}return!0}))}updateUserSettings(e,t={},r){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e)return!0;const i=[];let s;for(s in e)null!=e[s]&&i.push('"'+s+'": '+JSON.stringify(e[s]));const o='{"userSettings":{'+i.join(", ")+"}}",c=yield this.getRequestInit({method:"POST"},t);c.body=o;const u=(0,h.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(null!=r?r:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(null!=r?r:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&u.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(u.href,c);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update weather setting call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}getPdpUserPreference(e,t={},r){return(0,i.mG)(this,void 0,void 0,(function*(){const s=yield this.getRequestInit({method:"GET"},t),o=(0,h.PH)(this.userUpdateEndpoint);[...(yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(r||(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(r||(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)].forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));try{const e=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,s);if(!e.ok){if(e.status>=400&&e.status<500&&408!=e.status)return e;throw Error(e.statusText)}return e}))),"readPDPData");if(!e.ok&&404!=e.status)throw Error(`code=${e.status}, ${e.statusText}`);return Object.assign(Object.assign({},yield e.json()),{is404:404==e.status})}catch(t){if(n.k.logError(t.message),e)throw Error(t.message);return null}}))}updatePdpLayoutPreference(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t={method:"PUT",credentials:"include",body:JSON.stringify({dummyid:{userLayoutPreference:e}})},r=(0,h.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(r.href,t);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update layout preference setting call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}updateSegmentCardsEnableStatus(e,t=null){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const r=[];if(t){let e;for(e in t)null!=t[e]&&r.push('"'+e+'": '+JSON.stringify(t[e]))}const i=e.map((e=>e.cardType!=m.f.TopStoriesCard?`\\"${e.cardType}\\":${e.enabled?'\\"1\\"':'\\"0\\"'}`:"")).join(","),n=r.length>0?'{"segmentCardSettings":"{'+i+'}","userSettings":{'+r.join(", ")+"}}":'{"segmentCardSettings":"{'+i+'}"}';return this.updateUserPreference(n)}))}updateProductivityCardsEnableStatus(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t=`{userSettings:{enterpriseCardsEnabled:"{${e.map((e=>`\\"is${e.cardType}Enabled\\":${e.enabled?"true":"false"}`)).join(",")}}"}}`;return this.updateUserPreference(t)}))}updateGamingCardsEnableStatus(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t=`{userSettings:{gamingCards:"{${e.map((e=>`\\"is${e.cardType}Enabled\\":${e.enabled?"true":"false"}`)).join(",")}}"}}`;return this.updateUserPreference(t)}))}updateCommunitySettingsOptOutStatus(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t={};e.forEach((e=>{t[e.settingType]=e.optedOut?"1":"0"}));const r={communitySettings:t};return this.updateUserPreference(JSON.stringify(r))}))}updateWidgetSettings(e,t={},r){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const i=e.map((e=>({actionType:"Follow",targetId:e.cardType,targetType:p.L.Widget,metadata:{prongsv2:{region:e.region,size:g.m[e.size],position:e.position}}})));return this.sendGenericActionRequest({additionalHeaders:t,endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(i),appError:r})}))}muteWidget(e,t={},r){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e||!e.length)return!1;const i=e.map((e=>({actionType:"Mute",targetId:e,targetType:p.L.Widget})));return this.sendGenericActionRequest({additionalHeaders:t,endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(i),appError:r})}))}disableSpotlightCard(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const r={actionType:"Disabled",definitionName:e,targetType:p.L.TopicFeed};return this.sendGenericActionRequest({endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(r),appError:t})}))}enableSpotlightCard(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){return!!e&&(yield this.deleteFromPdp(p.L.TopicFeed,"definitionName",[e],{},void 0,"Disabled",t))}))}sendGenericActionRequest(e){return(0,i.mG)(this,void 0,void 0,(function*(){const{additionalHeaders:t,additionalParams:r,endpoint:n,method:s,payload:o,appError:c}=e;if(!n||!s)return this.logError(new Error("Missing arguments: 'endpoint' and 'method' should be provided and valid"),c),!1;const p=(0,h.PH)(n);let m;((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&p.searchParams.set(e.key,e.value)})),r&&r.forEach((e=>{e.value&&p.searchParams.set(e.key,e.value)}));try{JSON.parse(o),m=o}catch(e){m=JSON.stringify(o)}const g={method:s,body:m,headers:yield this.getOneserviceHeaders(t),credentials:"include"},f="GET"==s;try{return yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(p.href,g);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for payload: ${o}`;throw new Error(t)}return!f||(yield e.json())}))),"sendActions")}catch(e){return this.logError(e,c),!1}}))}getUserActions(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t=[{key:"actionType",value:e}],r=yield this.sendGenericActionRequest({additionalParams:t,endpoint:this.userActionServiceEndPoint,method:"GET"});return r&&r.value}))}setUserAction(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){return!!(yield this.sendGenericActionRequest({endpoint:this.userActionServiceEndPoint,method:"POST",payload:Object.assign({actionType:e},t)}))}))}deleteUserAction(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){const r=[{key:"actionType",value:e},{key:"targetId",value:t.targetId},{key:"definitionName",value:t.definitionName}];return!!(yield this.sendGenericActionRequest({additionalParams:r,endpoint:this.userActionServiceEndPoint,method:"DELETE"}))}))}updateUserPreference(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t=yield this.getRequestInit({method:"POST"});t.body=e;const r=(0,h.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)}));try{const i=yield this.fetchImpl(r.href,t);if(i.status>=400){const t=`OneService returned error response while updating user preference. Status: ${i.status}, payload: ${e}`;throw new Error(t)}}catch(e){return!1}return!0}))}setPdpTargetTypesForBulkLoad(e){e&&e.length&&!this.bulkGraphActionTargetTypes&&(this.bulkGraphActionTargetTypes=e)}readPdpWithTargetType(e,t=!1,r,n={},o=!0,a=[]){return(0,i.mG)(this,void 0,void 0,(function*(){if(o){const t=yield this.getFromWebWorker(e);if(t)return t}if(this.bulkGraphActionTargetTypes&&this.bulkGraphActionTargetTypes.length)if(this.bulkGraphActionTargetTypes.indexOf(e)>=0){this.bulkGraphActionResultCache=this.bulkGraphActionResultCache||(yield this.bulkGraphActionPromise||(this.bulkGraphActionPromise=this.fetchPdpWithTargetTypes(this.bulkGraphActionTargetTypes,t,r,n,a)));const i=this.bulkGraphActionResultCache.get(e);if(i)return{value:i}}else f.M0.sendAppErrorEvent(Object.assign(Object.assign({},s.srQ),{message:`Received an unknown target type "${e}" that was not in the bulk graph action target types list "${this.bulkGraphActionTargetTypes}". Falling back to new network call. Please update the EntryPoint config's "graphActionsToBulkLoad" property to include this type.`}));const i=(yield this.fetchPdpWithTargetTypes([e],t,r,n,a)).get(e);if(i)return{value:i}}))}deleteFromPdp(e,t,r,n={},s,o="Follow",c,p=[]){return(0,i.mG)(this,void 0,void 0,(function*(){const m={method:"DELETE",headers:yield this.getOneserviceHeaders(n),credentials:"include"},g=(0,h.PH)(this.pdpServiceEndpoint),v=(yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),b=`targetType eq '${e}'`,w=r.map((e=>`${t} eq '${e}'`)).join(" or ");let T=`actionType eq '${o}' and (${w}) and (${b})`;s&&(T+=` and (degree eq '${s}')`),g.searchParams.set("$filter",T),[...v,...p].forEach((e=>{e.value&&g.searchParams.set(e.key,e.value)}));try{yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const t=yield this.fetchImpl(g.href,m);if(t.status>=400){const r=`OneService returned error response. Status: ${t.status} for actionType: ${o}, targetType: ${e}`;throw new Error(r)}return t}))),"deleteFromPdp"),this.tryInvalidateBulkFetchedPdpTargetType(e)}catch(e){return c&&f.M0.sendAppErrorEvent(Object.assign(Object.assign({},c),{pb:Object.assign(Object.assign({},c.pb),{actionType:o,error:e.message})})),!1}return!0}))}tryInvalidateBulkFetchedPdpTargetType(e){this.bulkGraphActionResultCache&&this.bulkGraphActionResultCache.delete(e)}fetchPdpWithTargetTypes(e,t=!1,r,n={},s=[]){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e.length)return new Map;const o=e.map((e=>`targetType eq '${e}'`)).join(" or "),c=[{key:"$top",value:`${r=r||10*e.length*2}`},{key:"$filter",value:`actionType eq 'Follow' and (${o})`}],p=yield this.getRequestInit({method:"GET"},n);!0===t&&(p.cache="no-store");const m=(0,h.PH)(this.pdpServiceEndpoint);[...c,...(yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),...s].forEach((e=>{e.value&&m.searchParams.set(e.key,e.value)}));const g=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(m.href,p);if(!e.ok){if(e.status>=400&&e.status<500&&408!=e.status)return e;throw Error(e.statusText)}return e}))),"readPDPData");if(!g.ok)throw Error(`code=${g.status}, ${g.statusText}`);const f=new Map,v=yield g.json();if(!v)return f;if(v.value)for(const e of v.value){let t=f.get(e.targetType);t||f.set(e.targetType,t=[]),t.push(e)}for(const t of e)f.get(t)||f.set(t,[]);return f}))}updateMarketPreference(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t={method:"POST",credentials:"include",body:JSON.stringify({userSettings:{preferredMarket:e}})},r=(0,h.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(r.href,t);if(!e.ok)throw new Error(`Failed to update market preference: Status: ${e.status}`);return!0}catch(e){return n.k.logError(e.message),!1}}))}getFromWebWorker(e){return(0,i.mG)(this,void 0,void 0,(function*(){let t=null;if(c.yb){const r=this.maptoWebWorkerId(e);if(r&&r.trim()){const r=yield(0,c.ot)({id:this.maptoWebWorkerId(e)});r.fetched&&(t=r.payload)}}return t}))}maptoWebWorkerId(e){switch(e){case p.L.Location:return"weatherpdp";case p.L.League:return"sportsleaguepdp";case p.L.Player:return"sportsplayerpdp";case p.L.Team:return"sportsteampdp";case p.L.Finance:return"moneypdp";default:return""}}getRequestInit(e={method:"GET"},t={}){return(0,i.mG)(this,void 0,void 0,(function*(){const r=yield l.$.getOneServiceHeaders();return e.headers=Object.assign(Object.assign({},r),t),e.credentials="include",e}))}getOneserviceHeaders(e={}){return(0,i.mG)(this,void 0,void 0,(function*(){const t=yield l.$.getOneServiceHeaders();return Object.assign(Object.assign({},t),e)}))}getFollowedLists(){return(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.getRequestInit({method:"GET"}),t=(0,h.PH)(this.userUpdateEndpoint);[...(yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)].forEach((e=>{e.value&&t.searchParams.set(e.key,e.value)}));try{const r=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const r=yield this.fetchImpl(t.href,e);if(!r.ok){if(r.status>=400&&r.status<500&&408!=r.status)return r;(0,o.OO)(null,s.G9t,"Error get followed list")}return r}))),"getFollowedLists");return r.ok||(0,o.OO)(null,s.G9t,"Error get followed list"),yield r.json()}catch(e){return n.k.logError(e.message),null}}))}addToFollowedLists(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t=p.L.Finance,r={method:"POST",body:JSON.stringify({financeListIds:e}),headers:yield l.$.getOneServiceHeaders(),credentials:"include"},n=(0,h.PH)(this.userUpdateEndpoint);let s;((yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{s=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.href,r);if(e.status>=400){const r=`OneService returned error response. Status: ${e.status} for actionType: FollowList, targetType: ${t}`;throw new Error(r)}return e.json()}))),"addToFollowedLists")}catch(e){return!1}return!0}))}deleteFromFollowedLists(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t=p.L.Finance,r={method:"DELETE",body:null,headers:yield l.$.getOneServiceHeaders(),credentials:"include"},n=(0,h.PH)(this.userUpdateEndpoint);let s;[...(yield(0,y.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),...[{key:"financeListIds",value:e.toString()}]].forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{s=yield(0,u.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.href,r);if(e.status>=400){const r=`OneService returned error response. Status: ${e.status} for actionType: UnFollowList, targetType: ${t}`;throw new Error(r)}return e.json()}))),"deleteFromFollowedLists")}catch(e){return!1}return!0}))}logError(e,t){t?f.M0.sendAppErrorEvent(Object.assign(Object.assign({},t),{pb:Object.assign(Object.assign({},t.pb),{error:e.message})})):n.k.logError(e.message)}}{constructor(){super((0,v.N)()?window.fetch.bind(window):fetch),"windowsNewsPlus"===d.jG.AppType||"newsAndInterests"===d.jG.AppType||"winWidgets"===d.jG.AppType?(this.ocid="winp2",this.ocidOverride=!0):"sharedWidgets"===d.jG.AppType?(this.ocid="hpwidget",this.ocidOverride=!0):"windowsNewsbar"===d.jG.AppType?(this.ocid="winp0dash",this.ocidOverride=!0):"travel"===d.jG.AppType?(this.ocid="travel-verthp-feeds",this.ocidOverride=!0):"gaming"===d.jG.AppType&&(this.ocid="startgg-feeds",this.ocidOverride=!0)}}},53790:function(e,t,r){r.d(t,{q:function(){return n}});var i=r(55067);class n{}n.refreshRiver=new i.C("RiverRefresh"),n.repaintRiver=new i.C("RiverRepaint"),n.riverRefreshed=new i.C("RiverRefreshed"),n.riverQueryUpdated=new i.C("RiverQueryUpdated"),n.riverLocationUpdated=new i.C("RiverLocationUpdated")},66925:function(e,t,r){r.d(t,{h:function(){return o}});var i=r(65135),n=r(68364),s=r(26415);class o{static renderToast(e){this.renderToastCallback?this.renderToastCallback(e):i.M0.sendAppErrorEvent((0,n.Tr)(s.PMq,"Undefined toast render callback function"))}static setRenderToastCallback(e){this.renderToastCallback=e,this.readyResolveFn()}static expireToast(e){this.expireToastCallback?this.expireToastCallback(e):i.M0.sendAppErrorEvent((0,n.Tr)(s.hxo,"Undefined toast expire callback function"))}static setExpireToastCallback(e){this.expireToastCallback=e}static setCurrentToast(e,t){this.currentToastId!==e&&(this.currentToastId=e,this.renderToastCallback=t,this.currentToastIdChangeCallbacks.forEach((t=>t(e))),this.renderToast())}static addCurrentToastIdChangeCallback(e){e&&this.currentToastIdChangeCallbacks.push(e)}}o.ready=new Promise((e=>o.readyResolveFn=e)),o.currentToastIdChangeCallbacks=[]},85334:function(e,t,r){var i;r.d(t,{p:function(){return i}}),function(e){e.Save="Save",e.Unsave="Unsave",e.Mute="Mute",e.Follow="Follow",e.Unfollow="Unfollow",e.InterestFailure="InterestFailure",e.ShowMore="ShowMore",e.ShowFewer="ShowFewer",e.Hide="Hide",e.DisableNotification="DisableNotification",e.EnableNotification="EnableNotification",e.RecommendedInterestsFailure="RecommendedInterestsFailure",e.Refresh="Refresh",e.Pin="Pin",e.Unpin="Unpin",e.HideTopic="HideTopic",e.UnhideTopic="UnhideTopic",e.HideSource="HideSource",e.UnhideSource="UnhideSource",e.WindowsInformation="WindowsInformation",e.Error="Error",e.Default="Default",e.ConnectionError="ConnectionError",e.Fre="Fre",e.TuneYourFeed="TuneYourFeed"}(i||(i={}))},60164:function(e,t,r){var i;r.d(t,{u:function(){return i}}),function(e){e.SysTag="SysTag",e.UserQuery="UserQuery"}(i||(i={}))},4977:function(e,t,r){var i;r.d(t,{t:function(){return i}}),function(e){e.Followed="followed",e.Unfollowed="unfollowed",e.Locked="locked",e.None="none"}(i||(i={}))},53909:function(e,t,r){r.d(t,{D3:function(){return o},KL:function(){return l},mL:function(){return p},pG:function(){return d},q3:function(){return c},vc:function(){return a},zz:function(){return h}});var i=r(12697),n=r(80983);let s;var o,a;!function(e){e.JPG="jpg",e.PNG="png"}(o||(o={})),function(e){e[e.None=0]="None",e[e.Letterbox=1]="Letterbox",e[e.Scale=2]="Scale",e[e.Stretch=3]="Stretch",e[e.Crop=4]="Crop",e[e.FocalCrop=5]="FocalCrop",e[e.FacialCrop=6]="FacialCrop"}(a||(a={}));const d=90,c="www.bing.com/th",l=new RegExp(/bing\.(com|net)\/th/);function h(e,t){return p(((0,n.P)()?"//img-s.msn.cn/tenant/amp/entityid/":"//img-s-msn-com.akamaized.net/tenant/amp/entityid/")+e,t)}const u=Math.ceil(4*Math.random())||4;function p(e,t){if(e&&l.test(e))return function(e,t){try{return m(new URL(e),t).href}catch(r){const i=m(new URL(`https://${e}`),t);return`//${i.host}${i.pathname}${i.search}`}}(e,t);const{focalRegion:r,backgroundColor:n}=t;let{width:a=0,height:d=0,format:c=o.JPG}=t,h="";if(r){const e=f(r.x1,r.x2),t=f(r.y1,r.y2);null!=e&&null!=t&&(h+=`&x=${e}&y=${t}`)}n&&(h+=`&b=${n}`);const u=null==t.mode?6:t.mode;if(6===u&&(h+="&u=t"),t.enableDpiScaling){if(!t.devicePixelRatio)throw new Error("A valid devicePixelRatio value must be provided when DPI scaling is enabled");const e=function(e){if(g()&&s)return s;if(e<1)return null;let t=e;(0,i.Z)(4*t)||(t=Math.ceil(10*t)/10);t>3&&(t=3);g()&&(s=t);return t}(t.devicePixelRatio);e&&(a=Math.round(a*e),d=Math.round(d*e))}return`${e}?w=${a}&h=${d}&q=${t.quality||60}&m=${u}&f=${c}${h}`}function m(e,t){(0,n.P)()&&(e.hostname=`ts${u}.cn.mm.bing.net`);const{width:r=0,height:i=0}=t,s=t.quality||d,o=t.crop||1;return e.searchParams.set("w",`${r}`),e.searchParams.set("h",`${i}`),e.searchParams.set("qlt",`${s}`),e.searchParams.set("c",`${o}`),e.searchParams.set("rs","1"),t.enableDpiScaling&&(e.searchParams.set("dpr",`${t.devicePixelRatio}`),e.searchParams.set("p","0")),e}function g(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function f(e,t){if(null!=e&&null!=t)return Math.floor((e+t)/2)}},40810:function(e,t,r){r.d(t,{a:function(){return i},H:function(){return a}});var i,n=r(26415),s=r(65135);class o extends Map{constructor(e){super(),this.identifier=e,this.subscriptions=new Map}set(e,t){super.set(e,t);const r=this.subscriptions.get(e);return r&&r.size?(r.forEach((r=>{try{r&&r(t)}catch(t){s.M0.sendAppErrorEvent(Object.assign(Object.assign({},n.fG_),{message:"Failed to execute subscription callback",pb:Object.assign(Object.assign({},n.fG_.pb),{customMessage:`Error executing subscription callback for key [${e}]`,instanceId:this.identifier,errorMessage:t&&t.message})}))}})),this):this}subscribe(e,t){if(!t||"function"!=typeof t)return;let r=this.subscriptions.get(e);r||(this.subscriptions.set(e,new Set),r=this.subscriptions.get(e)),r.add(t),this.has(e)&&t(this.get(e))}unsubscribe(e,t){const r=this.subscriptions.get(e);r&&r.delete(t)}}!function(e){e[e.IsSignedIn=1]="IsSignedIn",e[e.CookieConsentStatus=2]="CookieConsentStatus",e[e.OnetrustActiveCookieGroups=3]="OnetrustActiveCookieGroups",e[e.IsDarkMode=4]="IsDarkMode",e[e.ColumnArrangement=5]="ColumnArrangement",e[e.CurrentRoute=6]="CurrentRoute",e[e.TopicData=7]="TopicData",e[e.IsDocumentVisible=8]="IsDocumentVisible",e[e.IsSingleColumn=9]="IsSingleColumn"}(i||(i={}));const a=new class extends o{subscribe(e,t){this.has(e)||(e===i.IsDarkMode&&this.initBrowserThemeListener(),e===i.IsDocumentVisible&&this.initBrowserVisibilityListener()),super.subscribe(e,t)}initBrowserThemeListener(){const e=matchMedia("(prefers-color-scheme:dark)");this.set(i.IsDarkMode,e.matches),e.onchange=e=>{this.set(i.IsDarkMode,e.matches)}}initBrowserVisibilityListener(){this.set(i.IsDocumentVisible,"visible"===document.visibilityState),document.addEventListener("visibilitychange",(()=>{this.set(i.IsDocumentVisible,"visible"===document.visibilityState)}))}}("AppState")},99478:function(e,t,r){function i(e,...t){return e.replace(/{(\d+)}/g,(function(e,r){if(r>=t.length)return e;const i=t[r];return"number"==typeof i||i?i:""}))}function n(e){return!e||!e.trim()}r.d(t,{TF:function(){return n},WU:function(){return i}})},35928:function(e,t,r){r.d(t,{Nd:function(){return h}});const i=Object.freeze(function(){const e=JSON.parse(document.head.dataset.clientSettings||"{}"),t={activityId:e.aid||"",appType:e.apptype,categoryKey:e.categoryKey,pageType:e.pagetype,verticalKey:e.verticalKey||e.vk,ocid:e.ocid};try{if(e.locale)t.market=`${e.locale.language}-${e.locale.market}`;else{const e=location.pathname.split("/");e&&e[1]&&(t.market=e[1].toLowerCase())}}catch(e){}return t}());var n,s=r(40810);!function(e){e[e.Router=0]="Router",e[e.ExternalLink=2]="ExternalLink",e[e.PrimeExternalLink=3]="PrimeExternalLink"}(n||(n={}));var o=r(38156),a=r(60483),d=r(16517);const c="spapage",l=["ocid","item","pcsonly","fdhead"];const h=new class{constructor(){this.contextualNavMap=new Map,this.hamburgerMenuMap=new Map,this.market=i.market,this.currentUrl=new URL(location.href.toLowerCase()),this.currentSearchParams=new URLSearchParams(location.search.toLowerCase()),this.refIds=[]}init(e){if(this.options||!e)return;this.options=e,this.config=e.config,this.options.localizedStrings=this.options.localizedStrings||{},"/"===location.pathname&&(location.pathname=`/${this.market}${e.basePath||""}`);const t=this.currentUrl.searchParams.get(c);this.currentPath=t?`/${this.market}${e.basePath}/${t}`:this.currentUrl.pathname,this.currentUrl.searchParams.delete(c),this.currentSearchParams.forEach(((e,t)=>{-1===l.indexOf(t)&&this.currentUrl.searchParams.delete(t)})),this.setRoutes(this.config),this.currentRoute&&(s.H.set(s.a.CurrentRoute,this.currentRoute),window.history.replaceState(this.currentRoute,"",t||location.port?this.currentRoute.destinationUrl:location.href)),window.addEventListener("popstate",(e=>{e.state&&e.state.disableCurrentRouteUpdate||s.H.set(s.a.CurrentRoute,e.state||this.contextualNavMap.get("myfeed"))}))}subscribe(e){(e||"function"==typeof e)&&s.H.subscribe(s.a.CurrentRoute,e)}getCurrentRoute(){return s.H.get(s.a.CurrentRoute)}navigate(e,t){const r=s.H.get(s.a.CurrentRoute);if(r&&r.id===e)return;const i=this.getRouteById(e),n=new URL(i.destinationUrl);if(n.hash&&(n.hash="",i.destinationUrl=decodeURIComponent(n.toString())),!i)return;const o=Object.assign(Object.assign({},i),{dynamicContext:t});history.pushState(o,i.display,i.destinationUrl),s.H.set(s.a.CurrentRoute,o),window.dispatchEvent(new CustomEvent("header-route-changed",{detail:{route:i}}))}getRouteById(e){return this.contextualNavMap.get(e)||this.hamburgerMenuMap.get(e)}preserveQueryParams(e){const t=e.searchParams;this.currentUrl.search&&this.currentUrl.searchParams.forEach(((r,i)=>{i=i.toLowerCase(),-1===t.getAll(i).indexOf(r)&&e.searchParams.append(i,r)})),!e.searchParams.get("ocid")&&this.options.ocid&&e.searchParams.set("ocid",this.options.ocid)}getUrlInfo(e){const{renderType:t,path:r,externalUrl:i}=e.renderInfo;if(t===n.Router){if(e.id===this.config.homeNavigationItem.id)return this.getHomePageUrl();const t=`${0===r.indexOf("personalize")?"":"/interest"}/${r}`;return{url:`${location.origin}/${this.market}/feed${t}${this.currentUrl.search}${location.hash}`,path:`/${this.market}/feed${t}`}}let s=new URL(i);return-1===s.hostname.indexOf(".msn.com")&&-1===s.hostname.indexOf(".msn.cn")||(s.hostname!==location.hostname&&(s=new URL(`${s.pathname}${s.search}`,location.origin)),this.preserveQueryParams(s)),{url:decodeURIComponent(s.toString()),path:s.pathname,searchParams:s.searchParams}}setRoutes(e){if(!e)return;const{contextualNavItems:t=[],hamburgerMenuItems:r=[],homeNavigationItem:i,interestsNavigationItem:n}=e;i&&r.length&&t.length&&(this.buildNavMap(this.contextualNavMap,i),this.mapChildItems(this.hamburgerMenuMap,r),this.mapChildItems(this.contextualNavMap,t),this.buildNavMap(this.contextualNavMap,n),this.refIds.length&&this.refIds.forEach((e=>{const t=`${e}-ref`;this.contextualNavMap.set(t,Object.assign(Object.assign({},this.getRouteById(e)),{id:t}))})))}processRoute(e,t){const{id:r,display:i,displayKey:n}=e,s=n?this.options.localizedStrings[n]:i,d=this.getUrlInfo(e),c=decodeURIComponent(d.url),l=Object.assign(Object.assign({},e),{display:s,destinationUrl:c,parentId:t,telemetryMetadata:new a.D({name:s,action:o.Aw.Click,behavior:o.wu.Navigate,content:{headline:s},destinationUrl:c,overrideDestinationUrl:c,feed:{id:r,name:s,type:"category filter"}}).getMetadata()});return this.detectCurrentRoute(l,d.path,d.searchParams),l}detectCurrentRoute(e,t="",r){if(t=t.toLowerCase(),this.currentPath===t||this.currentPath===`${t}/`){let t=!1;if(r&&r.toString()&&r.forEach(((e,r)=>{r=r.toLowerCase(),-1===this.currentSearchParams.getAll(r).indexOf(e.toLowerCase())&&(t=!0)})),t)return;this.currentRoute=e}}buildNavMap(e,t){if(!t)return;const{id:r,children:i=[],navRefId:n}=t;n?this.refIds.push(n):(e.set(r,this.processRoute(t)),this.mapChildItems(e,i,t.id))}mapChildItems(e,t=[],r){t.forEach((t=>{if(t.navRefId)return void this.refIds.push(t.navRefId);e.set(t.id,this.processRoute(t,r));const{children:i}=t;i&&i.length&&this.mapChildItems(e,i,t.id)}))}getHomePageUrl(){const e=this.currentSearchParams.get("ocid");return e||this.options.ocid?{url:`${location.origin}/${this.market}/feed${this.currentUrl.search}`,path:`/${this.market}/feed`}:["direct","mailsignout"].includes(e)||d.jG.isMobile?{url:`https://www.msn.${location.hostname.endsWith(".cn")?"cn":"com"}/${this.market}${this.currentUrl.search}`,path:this.market}:{url:`${location.origin}/${this.market}${this.currentUrl.search}`,path:this.market}}}},16859:function(e,t,r){r.d(t,{Y:function(){return d}});var i=r(32804),n=r(78125),s=r(97186),o=r(60279);const a=(0,r(9791).Z)((e=>{let t=(0,s.in)(e);if(null!==t)return t;if(t=(0,s.hg)(e),null!==t)return t;throw new Error(`${e} cannot be converted to a ColorRGBA64. Color strings must be one of the following formats: "#RGB", "#RRGGBB", or "rgb(r, g, b)"`)}));class d{constructor(e,t){this.cache=new WeakMap,this.light=e,this.dark=t}bind(e){this.attach(e)}unbind(e){const t=this.cache.get(e);t&&i.IfY.unsubscribe(t)}attach(e){const t=this.cache.get(e)||new c(this.light,this.dark,e),r=i.IfY.getValueFor(e);i.IfY.subscribe(t,e),t.attach(r),this.cache.set(e,t)}}class c{constructor(e,t,r){this.light=e,this.dark=t,this.source=r,this.attached=null}handleChange({target:e,token:t}){this.attach(t.getValueFor(e))}attach(e){const t=(r=e.toColorString(),(0,o.hM)(a(r))<=n.h.DarkMode?"dark":"light");var r;this.attached!==this[t]&&(null!==this.attached&&this.source.$fastController.removeStyles(this.attached),this.attached=this[t],null!==this.attached&&this.source.$fastController.addStyles(this.attached))}}},12697:function(e,t,r){var i=r(84708);t.Z=function(e){return"number"==typeof e&&e==(0,i.Z)(e)}}}]);A
Eo