ainer">
        <div>
            <label class="read-more-label">${(e,t)=>t.parent.strings.readMoreLinkText}</label>
            ${ce}
        </div>
    </div>
`,me=e=>te.d`
    ${(0,ne.g)((e=>{var t;return null===(t=e.publisher)||void 0===t?void 0:t.logoUrl}),te.d`
        <img
            slot="image"
            src="${e=>{var t;return null===(t=e.publisher)||void 0===t?void 0:t.logoUrl}}"
        />
    `)}
    ${(0,ne.g)((t=>e),te.d`<span>${e=>{var t;return null===(t=e.publisher)||void 0===t?void 0:t.name}}</span>`)}
    ${(0,ne.g)((t=>!e),te.d`<span>${(e,t)=>{var n;return B(null===(n=e.publisher)||void 0===n?void 0:n.name,e.publishedDateTime&&(0,oe.fh)(new Date(e.publishedDateTime),e.locale,t.parent.strings,1))}}</span>`)}
`,ge=e=>te.d`
    <fluent-card class="publisher-card">
        ${()=>{var t,n;return(null===(t=G[e])||void 0===t?void 0:t.card)&&te.d`
            <style> ${null===(n=G[e])||void 0===n?void 0:n.card.styles.toString()} </style>
        `}}
        <msft-content-card
            href="${e=>e.clickUrl}"
            target="_blank"
            :anchorTelemetryTag=${e=>{var t,n;return null===(n=null===(t=e.telemetry)||void 0===t?void 0:t.destination)||void 0===n?void 0:n.getMetadataTag()}}
            ht-id=${e=>{var t;return w(null===(t=e.telemetry)||void 0===t?void 0:t.destination,!0,{anchorParent:!0,isNavigate:!0})}}
        >
            ${e=>{return e.contentIndicator&&(t=e.contentIndicator,te.d`
    <msft-content-indicator slot="content-indicator" style="--control-corner-radius: 4">
        ${t}
    </msft-content-indicator>
`);var t}}

            ${(0,ne.g)(((e,t)=>{var n;return null===(n=t.parent)||void 0===n?void 0:n.showProviderAttribution}),te.d`
                <msft-attribution slot="attribution">
                    ${me(!1)}
                </msft-attribution>
            `)}

            ${()=>{var t;return((e,t="media")=>te.d`
    ${(0,ne.g)((e=>{var t;return null===(t=e.imageInfo)||void 0===t?void 0:t.sourceImageUrl}),te.d`
        <img
            slot="${t}"
            height="${e.height}"
            width="${e.width}"
            src="${e=>{var t;return null===(t=e.imageInfo)||void 0===t?void 0:t.sourceImageUrl}}"
            alt="${e=>{var t;return null===(t=e.imageInfo)||void 0===t?void 0:t.altText}}"
        />
    `)}
    ${(0,ne.g)((e=>{var t;return!(null===(t=e.imageInfo)||void 0===t?void 0:t.sourceImageUrl)}),te.d`
        <div
            slot="${t}"
            style="height: ${e.height}px; width: ${e.width}px"
        >
        </div>
    `)}
`)(null===(t=G[e])||void 0===t?void 0:t.imageSize)}}
            ${(0,ne.g)(((e,t)=>{var n;return!(null===(n=t.parent)||void 0===n?void 0:n.showProviderAttribution)&&e.isPremium}),((e,t)=>{var n,r;return r=null===(n=t.parent)||void 0===n?void 0:n.strings,te.d`
    <div slot="attribution" class="subscription-badge-container">
        <label class="subscription-badge${e=>e.publisher.isSubscribed?" subscribed":""}">
        ${e=>e.publisher.isSubscribed?null==r?void 0:r.badgeLabelSubscribed:null==r?void 0:r.badgeLabelNotSubscribed}
        </label>
    </div>
`}))}
            ${e=>e.title}
            ${(0,ne.g)(((e,t)=>t.parent.theme==l.socialComment),fe)}
            ${(0,ne.g)(((e,t)=>t.parent.theme==l.channelPage),he)}
        </msft-content-card>
    </fluent-card>
`,ve=te.d`
    ${(0,ne.g)((e=>{var t,n;return(null===(n=null===(t=e.carouselData)||void 0===t?void 0:t.cards)||void 0===n?void 0:n.length)>0}),te.d`
    ${(0,ne.g)((e=>!e.backgroundSheetDisabled),te.d`<div class="background-sheet"></div>`)}
    <msft-stripe
        ${(0,re.i)("stripeRef")}
        speed="4000"
        data-t="${e=>{var t,n;return null===(n=null===(t=e.telemetryContext)||void 0===t?void 0:t.carousel)||void 0===n?void 0:n.getMetadataTag()}}"
        ht-id=${e=>{var t;return w(null===(t=e.telemetryContext)||void 0===t?void 0:t.carousel,!1)}}
    >
        ${e=>{var t,n;return(null===(t=G[e.theme])||void 0===t?void 0:t.carousel)&&te.d`
            <style> ${null===(n=G[e.theme])||void 0===n?void 0:n.carousel.styles.toString()} </style>
        `}}
        <div slot="heading">
            ${(0,ne.g)((e=>!e.headerDisabled),de)}
        </div>
        <div slot="previous-flipper">
            <fluent-flipper title=${e=>e.strings.previous} direction="previous" data-t="${e=>{var t,n;return null===(n=null===(t=e.telemetryContext)||void 0===t?void 0:t.previousSlideArrow)||void 0===n?void 0:n.getMetadataTag()}}" ht-id=${e=>{var t;return w(null===(t=e.telemetryContext)||void 0===t?void 0:t.previousSlideArrow,!0)}}></fluent-flipper>
        </div>
        <div slot="next-flipper" @click="${e=>e.nextFlipperClick()}">
            <fluent-flipper
                title=${e=>e.strings.next}
                direction="next"
                data-t="${e=>{var t,n;return null===(n=null===(t=e.telemetryContext)||void 0===t?void 0:t.nextSlideArrow)||void 0===n?void 0:n.getMetadataTag()}}"
                ht-id=${e=>{var t;return w(null===(t=e.telemetryContext)||void 0===t?void 0:t.nextSlideArrow,!0)}}
            ></fluent-flipper>
        </div>
        ${(0,ne.g)((e=>{var t;return!e.headerDisabled&&!e.hideSeeAllLink&&(null===(t=e.carouselData)||void 0===t?void 0:t.seeAllLinkUrl)}),pe)}
        ${(0,ie.rx)((e=>{var t;return null===(t=e.carouselData)||void 0===t?void 0:t.cards}),(e=>ge(e.theme)))}
    </msft-stripe>
`)}
`,ye={experienceConfigSchema:a,mockConfig:s}},21858:function(e,t,n){"use strict";n.d(t,{Go:function(){return a},TR:function(){return l},Y6:function(){return u},Yw:function(){return c}});var r=n(94516);const i=new RegExp("\\:([\\d]{2})");function o(){return new Date}function a(e){return(o().getTime()-e.getTime())/1e3}function s(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function l(e,t){return new Date(e.valueOf()+60*t*60*1e3)}function u(e,t){const n=parseInt(t),r=parseInt(i.exec(t)[1]),o=n<0?-1:1,a=new Date(e.getTime()+60*(60*n+o*r)*1e3),s=`0${Math.abs(n)}`.substr(-2)+":"+`0${Math.abs(r)}`.substr(-2);return a.toISOString().replace("Z",(o<0?"-":"+")+s)}function c(e){const t=a(e),n=function(){const e=o();return e.setHours(0,0,0,0),e}(),i=s(n,-1),l=s(n,-6),u=function(){const e=o();return new Date(e.getFullYear(),0,0,0,0,0,0)}();return t>=-3300&&t<-60?r.i.InMinutes:t<0?r.i.None:t<120?r.i.JustNow:t<3600?r.i.LessThanOneHour:e>=n?r.i.Today:e>=i?r.i.Yesterday:e>=l?r.i.ThisWeek:e>=u?r.i.ThisYear:r.i.FullDate}},79703:function(e,t,n){"use strict";n.d(t,{$:function(){return o}});var r,i=n(19628);!function(e){e[e.Default=0]="Default",e[e.Medium=1]="Medium",e[e.MonthDate=2]="MonthDate",e[e.Weekday=3]="Weekday",e[e.Time=4]="Time"}(r||(r={}));class o{constructor(){this.dateFormatOptionsMap=new Map,this.setSupportsLocaleSpecifiers(),this.dateFormatOptionsMap.set(r.Medium,{year:"numeric",month:"short",day:"numeric"}),this.dateFormatOptionsMap.set(r.MonthDate,{month:"short",day:"numeric"}),this.dateFormatOptionsMap.set(r.Weekday,{weekday:"short"}),this.dateFormatOptionsMap.set(r.Time,{hour:"numeric",minute:"numeric"})}overrideDateFormat(e,t){e&&t&&this.dateFormatOptionsMap.set(e,t)}localizedDateString(e,t){return this.formatDate(e,r.Default,t)}localizedDateStringMedium(e,t){return this.formatDate(e,r.Medium,t)}localizedMonthDate(e,t){return this.formatDate(e,r.MonthDate,t)}localizedWeekday(e,t){return this.formatDate(e,r.Weekday,t)}formatTimeFromDate(e,t){return this.supportsLocaleSpecifiers&&this.dateFormatOptionsMap?e.toLocaleTimeString(t,this.dateFormatOptionsMap.get(r.Time)):e.toTimeString()}format(e,...t){return e?i.Ld.Format(e,...t):""}localizedNumberString(e,t){return this.supportsLocaleSpecifiers?e.toLocaleString(t):e.toString()}formatDate(e,t,n){let i=null;if(this.supportsLocaleSpecifiers)if(t===r.Default)i=e.toLocaleDateString(n);else if(this.dateFormatOptionsMap){const r=this.dateFormatOptionsMap.get(t);i=e.toLocaleDateString(n,r)}return null===i&&(i=e.toDateString()),null!==i?i.replace(/\u200E/g,"").replace(/\u200F/g,""):i}setSupportsLocaleSpecifiers(){this.supportsLocaleSpecifiers=(()=>{try{(0).toLocaleString("i")}catch(e){return"RangeError"===e.name}return!1})()}}},94516:function(e,t,n){"use strict";var r;n.d(t,{i:function(){return r}}),function(e){e[e.None=0]="None",e[e.JustNow=1]="JustNow",e[e.LessThanOneHour=2]="LessThanOneHour",e[e.Today=3]="Today",e[e.Yesterday=4]="Yesterday",e[e.ThisWeek=5]="ThisWeek",e[e.ThisYear=6]="ThisYear",e[e.FullDate=7]="FullDate",e[e.InMinutes=8]="InMinutes"}(r||(r={}))},11363:function(e,t,n){"use strict";n.d(t,{fh:function(){return c},Xk:function(){return d}});var r=n(79703),i=n(94516),o=n(21858);class a{constructor(e,t,n){this.timeLocStrings=e,this.locale=t,this.locUtility=n}transform(e,t,n){const r=3600,a=86400;if(!e)return"";if(!this.locUtility.supportsLocaleSpecifiers)return t;const s=(0,o.Go)(e);switch((0,o.Yw)(e)){case i.i.None:return"";case i.i.JustNow:return this.timeLocStrings.JustNow;case i.i.LessThanOneHour:return this.timespanString(s,s<120?this.timeLocStrings.NumberMinuteAgo:this.timeLocStrings.NumberMinutesAgo,60);case i.i.Today:return this.timespanString(s,s<7200?this.timeLocStrings.NumberHourAgo:this.timeLocStrings.NumberHoursAgo,r);case i.i.Yesterday:if(0===n){const t=this.timeLocStrings.TimeYesterday;return this.locUtility.format(t,this.locUtility.formatTimeFromDate(e,this.locale))}return s<a?this.timespanString(s,s<7200?this.timeLocStrings.NumberHourAgo:this.timeLocStrings.NumberHoursAgo,r):this.timespanString(s,s<172800?this.timeLocStrings.NumberDayAgo:this.timeLocStrings.NumberDaysAgo,a);case i.i.ThisWeek:return 0===n?this.locUtility.format(this.timeLocStrings.TimeDayOfWeek,this.locUtility.localizedWeekday(e,this.locale),this.locUtility.formatTimeFromDate(e,this.locale)):this.timespanString(s,s<172800?this.timeLocStrings.NumberDayAgo:this.timeLocStrings.NumberDaysAgo,a);case i.i.ThisYear:return this.locUtility.localizedMonthDate(e,this.locale);default:return this.locUtility.localizedDateStringMedium(e,this.locale)}}timespanString(e,t,n){const r=Math.floor(e/n);return this.locUtility.format(t,this.locUtility.localizedNumberString(r,this.locale))}}const s={JustNow:"Just Now",NumberMinuteAgo:"{0} minute ago",NumberMinutesAgo:"{0} minutes ago",NumberHourAgo:"{0} hour ago",NumberHoursAgo:"{0} hours ago",NumberDayAgo:"{0} day ago",NumberDaysAgo:"{0} days ago",NumberWeekAgo:"{0} week",NumberWeeksAgo:"{0} weeks",NumberMonthAgo:"{0} month",NumberMonthsAgo:"{0} months",NumberYearAgo:"{0} year",NumberYearsAgo:"{0} years",TimeYesterday:"Yesterday at {0}",TimeDayOfWeek:"{0} at {1}"},l={Minute:{one:"{0} دقيقة",two:"دقيقتان",threeToTen:"{0} دقائق",elevenPlus:"{0} دقيقة"},Hour:{one:"{0} ساعة",two:"ساعتان",threeToTen:"{0} ساعات",elevenPlus:"{0} ساعة"},Day:{one:"{0} يوم",two:"يومان",threeToTen:"{0} أيام",elevenPlus:"{0} يوما"},Week:{one:"{0} أسبوع",two:"{0} أسبوع",threeToTen:"{0} أسابيع",elevenPlus:"{0} أسبوعا"},Month:{one:"{0} شهر",two:"{0} شهر",threeToTen:"{0} أشهر",elevenPlus:"{0} شهرا"},Year:{one:"{0} عام",two:"{0} عام",threeToTen:"{0} أعوام",elevenPlus:"{0} عاما"}},u={Week:{one:"{0} שבוע",two:"{0} שבועיים",three:"{0} שבועות"},Month:{one:"{0} חודש",two:"{0} חודשיים",three:"{0} חודשים"},Year:{one:"{0} שנה",two:"{0} שנתיים",three:"{0} שנים"}};function c(e,t,n,i,o,c){const d=t&&t.toLowerCase();if(!(e instanceof Date)||isNaN(e.valueOf()))return"";if(c&&n)return function(e,t,n,r){if(!(e instanceof Date)||isNaN(e.valueOf()))return"";const i=p.MsPerMinute,o=p.MsPerHour,a=p.MsPerDay,s=p.MsPerWeek,c=p.MsPerMonth,d=p.MsPerYear,f=t.getTime()-e.getTime();if(f<i)return n.JustNow||"";let h=d,m="Year";f<o?(h=i,m="Minute"):f<a?(h=o,m="Hour"):f<s?(h=a,m="Day"):f<c?(h=s,m="Week"):f<d&&(h=c,m="Month");const g=/^[Aa][Rr]-/.test(r),v=/^[Hh][Ee]-/.test(r),y=Math.floor(f/h);let b=null;b=g?function(e,t){if(e<2)return l[t].one;if(e<3)return l[t].two;if(e<11)return l[t].threeToTen;return l[t].elevenPlus}(y,m):v?function(e,t,n){if("Minute"==n||"Hour"==n||"Day"==n)return e[`Number${n}${t>1?"s":""}Ago`];if(t<2)return u[n].one;if(t<3)return u[n].two;return u[n].three}(n,y,m):n[`Number${m}${y>1?"s":""}Ago`];return b?b.replace("{0}",y):""}(e,new Date,n,d);if(!n&&"zh-cn"===d)return"";n||(n=s);const f=(o=o||new r.$).localizedDateString(e,d);i||(i=0);return new a(n,d,o).transform(e,f,i)}function d(e){return e.toLocaleString("ja-JP",{hour12:!1,hour:"2-digit",minute:"2-digit",day:"2-digit",month:"2-digit",timeZone:"Asia/Tokyo"}).replace("午後","").replace("午前","")}const p={MsPerMinute:6e4,MsPerHour:36e5,MsPerDay:864e5,MsPerWeek:6048e5,MsPerMonth:2592e6,MsPerYear:31104e6}},30113:function(e,t,n){"use strict";var r;n.d(t,{m:function(){return r}}),function(e){e.small="OneByOne",e.medium="OneByTwo",e.large="OneByThree"}(r||(r={}))},11708:function(e,t,n){"use strict";var r;n.d(t,{f:function(){return r}}),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"}(r||(r={}))},83152:function(e,t,n){"use strict";var r;n.d(t,{L:function(){return r}}),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"}(r||(r={}))},791:function(e,t,n){"use strict";n.d(t,{N:function(){return b}});var r=n(33940),i=n(33954),o=n(26415),a=n(68364),s=n(33799),l=n(16517),u=n(94788),c=n(67267),d=n(63535),p=n(87298),f=n(83152),h=n(11708),m=n(30113),g=n(65135),v=n(33379),y=n(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,r.mG)(this,void 0,void 0,(function*(){const t={method:"GET",headers:yield c.$.getOneServiceHeaders(),credentials:"include"},n=(0,d.PH)(this.locationsServiceEndPoint);let i;[...c.$.getCommonParams2(this.ocid,!this.ocidOverride),{key:"autodetect",value:e&&`${e}`}].forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{i=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.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 i}return i}))}addToFavoriteLocation(e,t){return(0,r.mG)(this,void 0,void 0,(function*(){const n="Location",i="Follow",o={method:"POST",body:JSON.stringify({actionType:i,targetType:n,definitionName:t,degree:"FavoriteLocation",metaData:e}),headers:yield c.$.getOneServiceHeaders(),credentials:"include"},a=(0,d.PH)(this.pdpServiceEndpoint);let u;((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&a.searchParams.set(e.key,e.value)}));try{u=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(a.href,o);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,r.mG)(this,void 0,void 0,(function*(){return yield this.deleteFromPdp(f.L.Location,"definitionName",[e])}))}removeLocation(e){return(0,r.mG)(this,void 0,void 0,(function*(){return yield this.deleteFromPdp(f.L.Location,"definitionName",[e])}))}updatePdpHomeLocation(e,t,n={},i){return(0,r.mG)(this,void 0,void 0,(function*(){const o=f.L.Location,a="Follow",u=yield this.getRequestInit({method:"POST"},n);u.body=JSON.stringify({actionType:a,targetType:o,definitionName:t,degree:"DefaultLocation",metaData:e});const h=(0,d.PH)(this.pdpServiceEndpoint);return((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(null!=i?i:(0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(null!=i?i:(0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&h.searchParams.set(e.key,e.value)})),yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(h.href,u);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${o}`;throw new Error(t)}return e}))),"setPdpHomeLocation"),this.tryInvalidateBulkFetchedPdpTargetType(o),!0}))}updateTrafficMyRoutes(e,t,n,o,a,s){return(0,r.mG)(this,void 0,void 0,(function*(){const l=n.replace(/[^a-zA-Z0-9\-.,_]/g,""),u=f.L.Traffic,d="Follow",h={method:"POST",body:JSON.stringify({actionType:d,targetType:u,targetId:l,degree:e,definitionName:t,metadata:o,createdDateTime:s}),headers:yield c.$.getOneServiceHeaders(),credentials:"include"},m=yield this.getTrafficPdpUrl(null,null,a);try{yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(m.href,h);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${u}`;throw new Error(t)}return e.json()}))),"updateTrafficMyRoutes");this.tryInvalidateBulkFetchedPdpTargetType(u)}catch(e){return i.k.logError(e.message),!1}return!0}))}deleteTrafficMyRoutes(e,t,n){return(0,r.mG)(this,void 0,void 0,(function*(){const i={method:"DELETE",headers:yield this.getOneserviceHeaders(),credentials:"include"},o=yield this.getTrafficPdpUrl(e,t,n);try{yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,i);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${f.L.Traffic}`;throw new Error(t)}return e}))),"deleteTrafficFromPdp"),this.tryInvalidateBulkFetchedPdpTargetType(f.L.Traffic)}catch(e){return!1}return!0}))}getTrafficMyRoutes(e,t){var n;return(0,r.mG)(this,void 0,void 0,(function*(){const i={method:"GET",headers:yield this.getOneserviceHeaders(),credentials:"include"},o=yield this.getTrafficPdpUrl(e,null,t);try{const e=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,i);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${f.L.Traffic}`;throw new Error(t)}return e}))),"getTrafficFromPdp");return null===(n=yield e.json())||void 0===n?void 0:n.value}catch(e){return null}}))}getTrafficPdpUrl(e,t,n){return(0,r.mG)(this,void 0,void 0,(function*(){const r=(0,d.PH)(this.pdpServiceEndpoint),i=(yield(0,y.XJ)())===s.Hy.SignedIn,o=(0,l.Yq)().UserId,a=i?c.$.getOneServiceParamsWithAuth(o,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(o,this.ocid,!this.ocidOverride);if(e||t){const n=`targetType eq '${f.L.Traffic}'`,i=e?`degree eq '${e}'`:"",o=t?`definitionName eq '${t}'`:"";r.searchParams.set("$filter",`actionType eq 'Follow' and (${n})${i?` and (${i})`:""}${o?` and (${o})`:""}`)}return[...a,...n||[]].forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)})),r}))}addToWatchList(e,t=0,n={},i={}){return(0,r.mG)(this,void 0,void 0,(function*(){const o=f.L.Finance,a="Follow",u={method:"POST",body:JSON.stringify({actionType:a,targetType:o,targetId:e,metadata:Object.assign({securityType:t,tickerId:this.generateUUID()},i)}),headers:yield this.getOneserviceHeaders(n),credentials:"include"},h=(0,d.PH)(this.pdpServiceEndpoint),m="zh-cn"!==(0,l.Yq)().CurrentMarket;let g;((yield(0,y.XJ)())===s.Hy.SignedIn&&m?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&h.searchParams.set(e.key,e.value)}));try{g=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(h.href,u);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${o}`;throw new Error(t)}return e.json()}))),"addToWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(o)}catch(e){return!1}return!0}))}addListToWatchList(e,t={},n={}){return(0,r.mG)(this,void 0,void 0,(function*(){const i=f.L.Finance,o="Follow",a={method:"POST",body:JSON.stringify(e.map((e=>({actionType:o,targetType:i,targetId:e.key,metadata:Object.assign({securityType:e.value,tickerId:this.generateUUID()},n)})))),headers:yield this.getOneserviceHeaders(t),credentials:"include"},u=(0,d.PH)(this.pdpServiceEndpoint),h="zh-cn"!==(0,l.Yq)().CurrentMarket;let m;((yield(0,y.XJ)())===s.Hy.SignedIn&&h?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&u.searchParams.set(e.key,e.value)}));try{m=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(u.href,a);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${i}`;throw new Error(t)}return e.json()}))),"addToWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(i)}catch(e){return!1}return!0}))}generateUUID(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}sortWatchList(e,t={}){var n;return(0,r.mG)(this,void 0,void 0,(function*(){const i=f.L.Finance,o="Follow",a=yield b.readPdpWithTargetType(f.L.Finance,!0,200,t),u=a&&(null===(n=a.value)||void 0===n?void 0:n.filter((e=>e.actionType===o&&e.targetId)));if(!u||u.length<e.length)return!1;const h={};let m=e.length;u.forEach((t=>{let n=e.findIndex((e=>e===t.targetId));n<0&&(n=m,m++),h[t.targetId]=JSON.stringify({actionType:o,targetId:t.targetId,targetType:i,rank:n,metadata:t.metadata})}));const g={method:"PUT",body:JSON.stringify(h),headers:yield this.getOneserviceHeaders(t),credentials:"include"},v=(0,d.PH)(this.pdpServiceEndpoint);((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&v.searchParams.set(e.key,e.value)}));try{yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(v.href,g);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${i}`;throw new Error(t)}return e.json()}))),"sortWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(f.L.Finance)}catch(e){return!1}return!0}))}updateWeatherInterests(e,t,n,o={},a){return(0,r.mG)(this,void 0,void 0,(function*(){const t=f.L.Weather,r={method:"POST",body:JSON.stringify({actionType:"Follow",targetType:t,targetId:e,metadata:{UserAction:{0:{UpdateTime:new Date,Location:n}}}}),headers:yield this.getOneserviceHeaders(o),credentials:"include"},u=(0,d.PH)(this.pdpServiceEndpoint);((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(null!=a?a:(0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(null!=a?a:(0,l.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,r);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 i.k.logError(e.message),!1}return!0}))}updateWeatherSettings(e,t,n={},i){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e&&!t)return!0;let r="";r=e&&!t?'{"weatherDisplayUnit":"'+e+'"}':!e&&t?'{"userSettings":{"weatherLocationSettingMode":"'+t+'"}}':'{"weatherDisplayUnit":"'+e+'","userSettings":{"weatherLocationSettingMode":"'+t+'"}}';const o=yield this.getRequestInit({method:"POST"},n);o.body=r;const a=(0,d.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(null!=i?i:(0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(null!=i?i:(0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&a.searchParams.set(e.key,e.value)}));const u=yield this.fetchImpl(a.href,o);if(u.status>=400){const e=`OneService returned error response. Status: ${u.status} for update weather setting call`;throw new Error(e)}return!0}))}updateFinanceInterests(e){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const t={financeInterests:e},n=JSON.stringify(t),r=yield this.getRequestInit({method:"POST"});r.body=n;const i=(0,d.PH)(this.userUpdateEndpoint),o="zh-cn"!==(0,l.Yq)().CurrentMarket;((yield(0,y.XJ)())===s.Hy.SignedIn&&o?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)}));const a=yield this.fetchImpl(i.href,r);if(a.status>=400){const e=`OneService returned error response. Status: ${a.status} for update finance interests call`;throw new Error(e)}return!0}))}updateUserSettings(e,t={},n){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e)return!0;const r=[];let o;for(o in e)null!=e[o]&&r.push('"'+o+'": '+JSON.stringify(e[o]));const a='{"userSettings":{'+r.join(", ")+"}}",u=yield this.getRequestInit({method:"POST"},t);u.body=a;const p=(0,d.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(null!=n?n:(0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(null!=n?n:(0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&p.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(p.href,u);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 i.k.logError(e.message),!1}return!0}))}getPdpUserPreference(e,t={},n){return(0,r.mG)(this,void 0,void 0,(function*(){const o=yield this.getRequestInit({method:"GET"},t),a=(0,d.PH)(this.userUpdateEndpoint);[...(yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth(n||(0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth(n||(0,l.Yq)().UserId,this.ocid,!this.ocidOverride)].forEach((e=>{e.value&&a.searchParams.set(e.key,e.value)}));try{const e=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(a.href,o);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(i.k.logError(t.message),e)throw Error(t.message);return null}}))}updatePdpLayoutPreference(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t={method:"PUT",credentials:"include",body:JSON.stringify({dummyid:{userLayoutPreference:e}})},n=(0,d.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(n.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 i.k.logError(e.message),!1}return!0}))}updateSegmentCardsEnableStatus(e,t=null){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const n=[];if(t){let e;for(e in t)null!=t[e]&&n.push('"'+e+'": '+JSON.stringify(t[e]))}const r=e.map((e=>e.cardType!=h.f.TopStoriesCard?`\\"${e.cardType}\\":${e.enabled?'\\"1\\"':'\\"0\\"'}`:"")).join(","),i=n.length>0?'{"segmentCardSettings":"{'+r+'}","userSettings":{'+n.join(", ")+"}}":'{"segmentCardSettings":"{'+r+'}"}';return this.updateUserPreference(i)}))}updateProductivityCardsEnableStatus(e){return(0,r.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,r.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,r.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 n={communitySettings:t};return this.updateUserPreference(JSON.stringify(n))}))}updateWidgetSettings(e,t={},n){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const r=e.map((e=>({actionType:"Follow",targetId:e.cardType,targetType:f.L.Widget,metadata:{prongsv2:{region:e.region,size:m.m[e.size],position:e.position}}})));return this.sendGenericActionRequest({additionalHeaders:t,endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(r),appError:n})}))}muteWidget(e,t={},n){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e||!e.length)return!1;const r=e.map((e=>({actionType:"Mute",targetId:e,targetType:f.L.Widget})));return this.sendGenericActionRequest({additionalHeaders:t,endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(r),appError:n})}))}disableSpotlightCard(e,t){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const n={actionType:"Disabled",definitionName:e,targetType:f.L.TopicFeed};return this.sendGenericActionRequest({endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(n),appError:t})}))}enableSpotlightCard(e,t){return(0,r.mG)(this,void 0,void 0,(function*(){return!!e&&(yield this.deleteFromPdp(f.L.TopicFeed,"definitionName",[e],{},void 0,"Disabled",t))}))}sendGenericActionRequest(e){return(0,r.mG)(this,void 0,void 0,(function*(){const{additionalHeaders:t,additionalParams:n,endpoint:i,method:o,payload:a,appError:u}=e;if(!i||!o)return this.logError(new Error("Missing arguments: 'endpoint' and 'method' should be provided and valid"),u),!1;const f=(0,d.PH)(i);let h;((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&f.searchParams.set(e.key,e.value)})),n&&n.forEach((e=>{e.value&&f.searchParams.set(e.key,e.value)}));try{JSON.parse(a),h=a}catch(e){h=JSON.stringify(a)}const m={method:o,body:h,headers:yield this.getOneserviceHeaders(t),credentials:"include"},g="GET"==o;try{return yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(f.href,m);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for payload: ${a}`;throw new Error(t)}return!g||(yield e.json())}))),"sendActions")}catch(e){return this.logError(e,u),!1}}))}getUserActions(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t=[{key:"actionType",value:e}],n=yield this.sendGenericActionRequest({additionalParams:t,endpoint:this.userActionServiceEndPoint,method:"GET"});return n&&n.value}))}setUserAction(e,t){return(0,r.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,r.mG)(this,void 0,void 0,(function*(){const n=[{key:"actionType",value:e},{key:"targetId",value:t.targetId},{key:"definitionName",value:t.definitionName}];return!!(yield this.sendGenericActionRequest({additionalParams:n,endpoint:this.userActionServiceEndPoint,method:"DELETE"}))}))}updateUserPreference(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t=yield this.getRequestInit({method:"POST"});t.body=e;const n=(0,d.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{const r=yield this.fetchImpl(n.href,t);if(r.status>=400){const t=`OneService returned error response while updating user preference. Status: ${r.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,n,i={},a=!0,s=[]){return(0,r.mG)(this,void 0,void 0,(function*(){if(a){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,n,i,s)));const r=this.bulkGraphActionResultCache.get(e);if(r)return{value:r}}else g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.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 r=(yield this.fetchPdpWithTargetTypes([e],t,n,i,s)).get(e);if(r)return{value:r}}))}deleteFromPdp(e,t,n,i={},o,a="Follow",u,f=[]){return(0,r.mG)(this,void 0,void 0,(function*(){const h={method:"DELETE",headers:yield this.getOneserviceHeaders(i),credentials:"include"},m=(0,d.PH)(this.pdpServiceEndpoint),v=(yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride),b=`targetType eq '${e}'`,w=n.map((e=>`${t} eq '${e}'`)).join(" or ");let k=`actionType eq '${a}' and (${w}) and (${b})`;o&&(k+=` and (degree eq '${o}')`),m.searchParams.set("$filter",k),[...v,...f].forEach((e=>{e.value&&m.searchParams.set(e.key,e.value)}));try{yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const t=yield this.fetchImpl(m.href,h);if(t.status>=400){const n=`OneService returned error response. Status: ${t.status} for actionType: ${a}, targetType: ${e}`;throw new Error(n)}return t}))),"deleteFromPdp"),this.tryInvalidateBulkFetchedPdpTargetType(e)}catch(e){return u&&g.M0.sendAppErrorEvent(Object.assign(Object.assign({},u),{pb:Object.assign(Object.assign({},u.pb),{actionType:a,error:e.message})})),!1}return!0}))}tryInvalidateBulkFetchedPdpTargetType(e){this.bulkGraphActionResultCache&&this.bulkGraphActionResultCache.delete(e)}fetchPdpWithTargetTypes(e,t=!1,n,i={},o=[]){return(0,r.mG)(this,void 0,void 0,(function*(){if(!e.length)return new Map;const a=e.map((e=>`targetType eq '${e}'`)).join(" or "),u=[{key:"$top",value:`${n=n||10*e.length*2}`},{key:"$filter",value:`actionType eq 'Follow' and (${a})`}],f=yield this.getRequestInit({method:"GET"},i);!0===t&&(f.cache="no-store");const h=(0,d.PH)(this.pdpServiceEndpoint);[...u,...(yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride),...o].forEach((e=>{e.value&&h.searchParams.set(e.key,e.value)}));const m=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(h.href,f);if(!e.ok){if(e.status>=400&&e.status<500&&408!=e.status)return e;throw Error(e.statusText)}return e}))),"readPDPData");if(!m.ok)throw Error(`code=${m.status}, ${m.statusText}`);const g=new Map,v=yield m.json();if(!v)return g;if(v.value)for(const e of v.value){let t=g.get(e.targetType);t||g.set(e.targetType,t=[]),t.push(e)}for(const t of e)g.get(t)||g.set(t,[]);return g}))}updateMarketPreference(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t={method:"POST",credentials:"include",body:JSON.stringify({userSettings:{preferredMarket:e}})},n=(0,d.PH)(this.userUpdateEndpoint);((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(n.href,t);if(!e.ok)throw new Error(`Failed to update market preference: Status: ${e.status}`);return!0}catch(e){return i.k.logError(e.message),!1}}))}getFromWebWorker(e){return(0,r.mG)(this,void 0,void 0,(function*(){let t=null;if(u.yb){const n=this.maptoWebWorkerId(e);if(n&&n.trim()){const n=yield(0,u.ot)({id:this.maptoWebWorkerId(e)});n.fetched&&(t=n.payload)}}return t}))}maptoWebWorkerId(e){switch(e){case f.L.Location:return"weatherpdp";case f.L.League:return"sportsleaguepdp";case f.L.Player:return"sportsplayerpdp";case f.L.Team:return"sportsteampdp";case f.L.Finance:return"moneypdp";default:return""}}getRequestInit(e={method:"GET"},t={}){return(0,r.mG)(this,void 0,void 0,(function*(){const n=yield c.$.getOneServiceHeaders();return e.headers=Object.assign(Object.assign({},n),t),e.credentials="include",e}))}getOneserviceHeaders(e={}){return(0,r.mG)(this,void 0,void 0,(function*(){const t=yield c.$.getOneServiceHeaders();return Object.assign(Object.assign({},t),e)}))}getFollowedLists(){return(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.getRequestInit({method:"GET"}),t=(0,d.PH)(this.userUpdateEndpoint);[...(yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)].forEach((e=>{e.value&&t.searchParams.set(e.key,e.value)}));try{const n=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const n=yield this.fetchImpl(t.href,e);if(!n.ok){if(n.status>=400&&n.status<500&&408!=n.status)return n;(0,a.OO)(null,o.G9t,"Error get followed list")}return n}))),"getFollowedLists");return n.ok||(0,a.OO)(null,o.G9t,"Error get followed list"),yield n.json()}catch(e){return i.k.logError(e.message),null}}))}addToFollowedLists(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t=f.L.Finance,n={method:"POST",body:JSON.stringify({financeListIds:e}),headers:yield c.$.getOneServiceHeaders(),credentials:"include"},i=(0,d.PH)(this.userUpdateEndpoint);let o;((yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)}));try{o=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(i.href,n);if(e.status>=400){const n=`OneService returned error response. Status: ${e.status} for actionType: FollowList, targetType: ${t}`;throw new Error(n)}return e.json()}))),"addToFollowedLists")}catch(e){return!1}return!0}))}deleteFromFollowedLists(e){return(0,r.mG)(this,void 0,void 0,(function*(){const t=f.L.Finance,n={method:"DELETE",body:null,headers:yield c.$.getOneServiceHeaders(),credentials:"include"},i=(0,d.PH)(this.userUpdateEndpoint);let o;[...(yield(0,y.XJ)())===s.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride):c.$.getOneServiceParamsWithoutAuth((0,l.Yq)().UserId,this.ocid,!this.ocidOverride),...[{key:"financeListIds",value:e.toString()}]].forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)}));try{o=yield(0,p.w)((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(i.href,n);if(e.status>=400){const n=`OneService returned error response. Status: ${e.status} for actionType: UnFollowList, targetType: ${t}`;throw new Error(n)}return e.json()}))),"deleteFromFollowedLists")}catch(e){return!1}return!0}))}logError(e,t){t?g.M0.sendAppErrorEvent(Object.assign(Object.assign({},t),{pb:Object.assign(Object.assign({},t.pb),{error:e.message})})):i.k.logError(e.message)}}{constructor(){super((0,v.N)()?window.fetch.bind(window):fetch),"windowsNewsPlus"===l.jG.AppType||"newsAndInterests"===l.jG.AppType||"winWidgets"===l.jG.AppType?(this.ocid="winp2",this.ocidOverride=!0):"sharedWidgets"===l.jG.AppType?(this.ocid="hpwidget",this.ocidOverride=!0):"windowsNewsbar"===l.jG.AppType?(this.ocid="winp0dash",this.ocidOverride=!0):"travel"===l.jG.AppType?(this.ocid="travel-verthp-feeds",this.ocidOverride=!0):"gaming"===l.jG.AppType&&(this.ocid="startgg-feeds",this.ocidOverride=!0)}}},55128:function(e,t,n){"use strict";var r;n.d(t,{S:function(){return r},b:function(){return y}}),function(e){e.More="More",e.Mute="Mute"}(r||(r={}));var i=n(33940),o=n(16517),a=n(54804),s=n(63535),l=n(67267),u=n(87298),c=n(17157),d=n(59207),p=n(28687),f=n(96345),h=n(51125),m=n(33799),g=n(82855),v=n(51671);class y{constructor(e,t=!0){this.fetchImpl=e,this.addPageInfoToOcid=t,this.followedPublishersEndpoint="v1/News/Users/Me/PreferredProviders",this.followedSourcesEndpoint="msn/sources",this.publishersServiceEndpoint="Msn/Providers",this.actionsServiceEndpoint="Graph/Actions",this.followActionSourceEndpoint="community/follows",this.ocid="feeds"}getUserMutedPublishers(){return(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.getUserActions(r.Mute);if(!e||!e.value)return null;if(!e.value.length)return[];const t=e.value.reduce(((e,t)=>(e[t.targetId]=t,e)),{}),n=yield this.getPublisherDetails(Object.keys(t));if(!n||!n.value||!n.value.length)return null;return n.value.map((e=>{const n={createdDateTime:t[e.id].createdDateTime};return Object.assign(Object.assign({},e),n)}))}))}getUserFollowedPublishers(e=100){return(0,i.mG)(this,void 0,void 0,(function*(){const t=yield this.getRequestInit(),n=[...yield this.getCommonParams(),{key:"$top",value:`${e}`}],r=(0,s.PH)(this.followedPublishersEndpoint);this.appendQs(n,r),(0,c.wq)()||(0,h.s6)(r);const i=yield this.sendRequest(decodeURIComponent(r.href),t,"getFollowedPublishers");return null==i?void 0:i.value}))}getUserFollowedSources(e=100){var t,n;return(0,i.mG)(this,void 0,void 0,(function*(){const r=yield this.getRequestInit(),i=[...yield this.getCommonParams(),{key:"$top",value:`${e}`},{key:"queryType",value:"MyFeed"}];this.isUserSignedIn()&&i.push({key:"scn",value:"MSNRPSAuth"});const o=(0,s.PH)(this.followedSourcesEndpoint);this.appendQs(i,o),(0,c.wq)()||(0,h.s6)(o);const a=yield this.sendRequest(decodeURIComponent(o.href),r,"getFollowedSources");return(null===(t=null==a?void 0:a.value)||void 0===t?void 0:t.length)>0?null===(n=null==a?void 0:a.value[0])||void 0===n?void 0:n.subCards.map((e=>{var t;const n=e.intAttributes&&1==e.intAttributes.disableProfile;return Object.assign(Object.assign({},e),{profileId:n?null:e.profileId,displayName:e.name,logos:[{imageLink:{href:null===(t=e.image)||void 0===t?void 0:t.url}}]})})):[]}))}publisherUserAction(e,t,n){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e||!t)return null;const r=yield this.getRequestInit();r.method=n;let i=yield this.getCommonParams();"POST"===n?r.body=JSON.stringify({actionType:t,targetId:e,targetType:"SourceProvider"}):"DELETE"===n&&(i=[...i,{key:"$filter",value:`actionType eq '${t}' and targetId eq '${e}'`}]);const o=(0,s.PH)(this.actionsServiceEndpoint);this.appendQs(i,o);const a=yield this.sendRequest(decodeURIComponent(o.href),r,`deleteUserAction ${t}`,!0,!0);if(a.status>=400){const n=`OneService returned error response. Status: ${a.status} for actionType: ${t}, targetId: ${e}`;throw new Error(n)}return a}))}updateSourceFollowState(e,t){return(0,i.mG