{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/diagnostics/src/AppError/AppErrorTracker.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/render-cache/src/Constants.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-constants/src/SignedInStatus.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/utilities/SingletonResetManager.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/diagnostics/src/AppError/AppErrors.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/utilities/UrlUtility.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/telemetryconstants.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/dom.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-redux/src/constants/ConnectorConstants.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/visibility.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/trackInfo.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/mediator.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/isomorphic-util/src/requestData.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-constants/src/AppTypes.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/utilities/Parsing.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/utilities/WebStorage.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/extend.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/app/AppEnvironment.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/pageInstance.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/utilities/Utility.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/diagnostics/src/logging/Logger.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/node_modules/@msnews/ssr-server/dist/interop/RequestData.js","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/isomorphic-util/src/SSRInteropContract.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/request/RequestContext.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/render-cache/src/PersistRenderCache.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/isomorphic-util/src/DOMHelpers.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/telemetryReadyCallback.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-redux/src/reducers/DynamicReducer.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-redux/src/pages/PageHelper.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-redux/src/pages/PageBase.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/diagnostics/src/performance/PageTimings.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/app/Environment.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/constants/Constants.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/utilities/CookieUtility.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-redux/src/pages/index.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/telemetryDataTypes.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-redux/src/reducers/DataConnectorInjector.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/render-cache/src/Helper.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-constants/src/PageTypes.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/wpo-common/src/Constants.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/wpo-common/src/WpoHelper.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/app/HeadData.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/events.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/escape.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/navigation.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/trackingHelper.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/track.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/app/HostPage.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/core/src/app/Market.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/telemetry-transitional/src/msnews-telemetry-transitional/guidGen.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/experiences-constants/src/AuthCookieNames.ts","webpack:///./src/startup/Startup.ts","webpack:///C:/agents/peregrineAgent_selfhoste0001AI_a0/_work/1/s/libs/diagnostics/src/performance/PerfMarker.ts"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","322","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","Severity","locationHref","location","href","defaultExpirationTimeMs","defaultForceExpirationTimeMs","expirationPrefix","forceTimestampPrefix","jssMapSuffix","keysPrefix","renderCacheKeyOfNormalizedKeys","storagePrefix","riverRcClassName","SignedInStatus","AccountType","AadAccountType","resetCallbacks","registerResetCallback","callback","severity","Alert","pb","build","BUILD_NUMBER","updateAppErrorsPropertyBag","newPbInfo","assign","getAppErrorsPropertyBag","NoAlert","ServiceUiError","id","source","OneServiceCardProviderAppErrors","EmptyMyFeed","OneServiceResponseWasNullOrErroneous","ErrorFetchingOneServiceResponse","HighImpact","InvalidJsonInOneServiceResponse","InvalidFeedListInOneServiceResponse","RiverConfigurationIssue","QueryInterestContentFetchError","StaticContentLoaded","ContentPreviewAppErrors","ErrorWhileFetchingContentPreviewContent","InvalidResponseFromContentPreviewFetch","InvalidResponseFromContentPreviewResponseJson","ErrorWhileInitializingAsyncContentPreviewContent","InvalidOrMissingContentId","MissingDataForExternalContent","MissingPartnerLink","RiverSourceFile","RiverAppErrors","UnknownMetadataReceivedFromRiverCardProvider","RiverContentProviderFetchException","SkipPositionedCardsFallbackStrategyFailed","InvalidConfig","ChildLoadError","InitialDataLoadError","DuplicateInstanceIdWarning","FullHeightFallbackStrategyFailed","UserInitiatedPageRefreshErrors","Default","SportsCardError","SportsLeaguePdpFetchError","SportsLeaguePdpInvalidResponse","SportsPlayersPdpFetchError","SportsPlayersPdpInvalidResponse","SportsTeamsPdpFetchError","SportsTeamsPdpInvalidResponse","SportsCardConfigFetchError","SportsCardGetFavoriteTeamDataError","SportsCardGetPlayerBioError","SportsCardGetLeaguesGamesArrayError","SportsCardGetPdpDataFailure","SportsCardGetLeagueSeasonYearDataFailure","SportsCardGetLocalizedTeamNameDataFailure","SportsCardGetTeamDataFailure","SportsCardGetLeagueDataFailure","MoneyCardError","MoneyQuoteSummaryGetError","MoneyQuoteSummariesGetError","MoneyPdpDataGetErrorFromService","MoneyPdpInvalidResponseFromService","MoneyQuoteSummaryGetErrorFromService","MoneyQuoteSummaryInvalidResponseFromService","TrendingNewsErrors","DataFetchError","BackupDataFetchError","GridSectionAppErrors","GridSectionCardGenerationError","PageClickTrackerErrors","InvalidResponse","FetchFailure","CoachmarkAppErrors","GeneralError","NotPlaceable","NotFoundComponent","CoachmarkDataConnectorUndefined","InvalidCTAType","CTATypeNotDefined","ConfigDataUndefined","FailedToFetchConfigData","ExceptionFetchingConfigData","EventNotDefined","CoachmarkStateNotDefined","CoachmarkDataAppErrors","InvalidCoachmarkMessage","IrisDataConnectorUndefined","ErrorFoundForSurface","TelemetryInfoUndefined","EventTypeUndefined","IrisActionUndefined","SpotlightPreviewAppErrors","ErrorWhileFetchingSpotlightPreviewCardInfo","NoServiceContextMetadata","SpotlightErrors","UnknownError","ContentFetchError","PartnerFetchFail","CardActionErrors","CardActionBaseExperienceError","CardActionPostActionError","CardActionDeleteActionError","CardActionGetActionError","CookieRelatedErrors","SharedStateConnectorNull","OverlayErrors","LoadExperienceError","ViewsCommonAppErrors","InvalidIntraArticleDataError","InvalidDocumentContentError","ViewsPaddleDataLoadError","ViewsErrorPage","ProviderMapperError","ContentActionsToolbarAppErrors","ContentActionsSharingToolbarLoadError","ContentActionsArticleDatafetchError","ContentActionsBaseExperienceError","ContentActionsGetDocumentDataError","ContentActionsGetContentStatusActionError","ContentActionsDeleteActionError","ContentActionsPostActionError","ContentActionsExperienceLoadError","ContentActionsFlipToolbarError","ContentActionsContentStatusFetchError","ContentActionsContentPreviewFetchError","ContentSharingToolbarAppErrors","ContentSharingToolbarInitializationError","ContentProviderAppErrors","InvalidSourceIdError","ProviderDetailsFetchError","ProviderFeedFetchError","InvalidLayoutTemplate","ViewsGalleryAppErrors","InvalidGalleryIdError","GalleryDataLoadError","GalleryImagesLoadError","VideoListAppErrors","VideoListDataLoadError","ViewsArticleAppErrors","InvalidArticleIdError","ArticleDataLoadError","IntraArticleComponentLoadError","InlineGalleryInvokeError","InterestsSearchAppErrors","ErrorResponseFromOneService","ErrorResponseFromOneServiceIsInvalid","InvalidUrlFoundForElement","SelectedItemNotFoundInSuggestions","SelectedItemIsInvalid","InterestsAppErrors","InterestsRetrieveTopicsError","InterestsRetrieveFollowedTopicsError","InterestsRetrieveMutedPublishersError","InterestsUnMutePublisherError","InterestsFollowTopicError","InterestsUnfollowTopicError","InterestsTopicStateUndefined","InterestsShouldHaveRendered","InterestsRetrieveTopicError","InterestsRetrieveSavedStoriesError","InterestsSavedStoriesInvalidConfigError","InterestsSavedStoriesChildLoadError","InterestsSavedStoriesInvalidJsonError","InterestsSavedStoriesInvalidListError","InterestsRetrieveRecommendedTopicsError","UndefinedTopicDataConnector","InterestsRetrieveReadStoriesError","InterestsReadStoriesInvalidConfigError","InterestsReadStoriesChildLoadError","InterestsReadStoriesInvalidJsonError","InterestsReadStoriesInvalidListError","FailedRestoringDefaultTopicsError","TopicsFailedIndexedDBConnection","TopicsFailedGettingIndexedDB","TopicsFailedUpdatingIndexedDB","ComponentConnectorAppErrors","DuplicateChildInstanceFound","BundleLoadError","ChildConfigInfoListNull","ListStartPositionInvalid","ChildDelayLoadError","ExperienceDependencyTimeout","ExperienceLoaderAppErrors","InsufficientLoadArgs","SearchError","MissingFormCode","RecommendedSearchErrors","ResponseParsingFailed","InvalidJsonResponse","ServiceCallFailed","RenderFailed","Timeout","PollsCardAppErrors","PollsListFetchError","PollDataFetchError","PollsCardInvalidPoll","PollsCardInvalidQuizPoll","PollsCardVoteError","PollsCardMapStateToPropsError","PollsUnknownError","MonetizationAppErrors","PlacementManagerLoadError","ArrangementPositionLoadError","GetCMSContentError","GetSAMRTBResponseError","MediaNetEOABError","InvalidPromoModuleConfig","CookieSyncDownloadExternalScriptError","CookieSyncMissingExternalScriptUrl","CookieSyncTimeout","CookieSyncPartnerScriptError","CookieSyncPixelPartnerDownloadError","CMSOrBackfillNativeAdLoadError","MissingRequiredPropertyPlacementManagerConfig","NativeAdTargetScopeError","RiverVideoAdPartnerError","JsTrackerPartnerScriptLoadError","ViglinkError","MissingTopicId","TopicIdNotFound","GetSAMRTBResponseErrorNoAlert","DisplayAdsOathLoadError","DisplayAdsApnLoadError","DisplayAdsApnEmptyProvider","DisplayAdsAdsDetectionNotInit","DisplayAdsMoatLoadError","DisplayAdsNoAdObjects","DisplayAdsProviderIdEncode","TaboolaRiverAppErrors","TaboolaRiverFetchError","CoreLibAppErrors","DeprecatedCompositionLayoutUsed","InvalidColumnInGridConfig","ErrorLoadingBundle","GenericJSException","LocalStorageDoesntExist","SessionStorageDoesntExist","ResolverAppErrors","IndexedDbWriteFailed","IndexedDbReadFailed","CrsFetchFailed","ReceivedConfigFromCdnAsCrsFetchFailed","GetConfigException","IndexedDbBulkReadFailed","IndexedDbFailedToRemoveCachedConfig","IndexedDbFailedToClearAllCachedConfigs","RenderCachePurgedDueToChangesInConfig","FailedToPurgeRenderCache","RefreshConfigCacheFailed","IndexedDbInitFailed","DifferentCbid","BingCardsAppErrors","BingCardGetHotelAnswersError","BingCardGetHotelErrorFromService","BingCardGetAnswersError","BingCardInvalidEntityType","BingCardErrorOut","BingAnswersAppErrors","FailedToLoadData","NoCardsContentType","NoCardsRelated","BingShoppingLifestyleCardError","LifestyleShopCardServiceFetchError","LifestyleShopCardServiceFetchInvalidResponse","LifestyleShopCardServiceEmptyResponse","LifestyleShopCardServiceInvalidResponse","LifestyleShopCardCdnServiceFetchError","LifestyleShopCardCdnServiceFetchInvalidResponse","LifestyleShopCardCdnServiceInvalidResponse","LifestyleShopAutosuggestServiceFetchError","LifestyleShopAutosuggestServiceFetchInvalidResponse","LifestyleShopAutosuggestServiceEmptyResponse","LifestyleShopAutosuggestServiceInvalidResponse","LifestyleShopAutosuggestInvalidSuggestionUrl","OneServiceContentDataConnector","FailedToUpdateBypassValueConnectorNotInitialized","FailedToGetBypassValueConnectorNotInitialized","NotificationBellErrors","JsonParseError","NewsItemDataFetchError","MalformedNewsItemResponseError","ElectionResultMapConnectorErrors","ElectionResultMapInspectorErrors","EmptyResultSummaryError","ElectionResultMapErrors","FetchAndUpdateElectionDataError","ElectionDelegateCounterErrors","WebWorkerErrors","FileNotFound","RuntimeError","MessageTimeout","HandledError","AppError_InvalidQParams_35001","AppError_ArcResponseNotOk_35003","AppError_ArcResponseUnparsable_35004","AppError_MissingAppEnv_35005","AppError_UnknownIrisErrorFound_35006","AppError_TimeoutIrisErrorFound_35007","AppError_TemplateIrisErrorFound_35008","AppError_ClientErrorIrisErrorFound_35009","AppError_DSourceIrisErrorFound_35010","AppError_ActionResponseFailure_35013","AppError_UncaughtErrorDetected_35014","AppError_UnconvertableCreative_35015","AppError_InvalidResponseFormat_35016","AppError_TimeoutErrorDiscovered_35017","AppError_UnparsableSingleResponseJSON_35018","IrisDataConnectorErrors","SubscriberNotFound","CreativeCountNegativeOrZero","ErrorFetchingSurfaceInfo","SubscriberNotFoundInIrisPlacementDictionary","FailedToReadNurturingAcceptedFlag","EdgeChromiumAPIsNotAvailable","AcquireAccessTokenFailed","RenderCacheErrors","JssStyleMismatchWarning","JssStyleCriticalMismatchError","PreloadReportingMessages","TtvrMissing","TfprMissing","TtvrSearchBoxMissing","TtfSearchBoxMissing","PushNotificationsLibErrors","FetchKeyError","SubscribeUnsubscribeError","ContentTruncationErrors","OverTruncationError","EmptyFeedWithFeedId","EmptySearchedFeedWithFeedId","EmptySearchedFeedWithFeedQuery","EmptyKidsModeFeed","FallingBackToSkipStrategy","FallingBackToFullHeightStrategy","UrlUtility","primeForbiddenCharacters","getParamsFromUrl","url","decodeComponents","getParams","split","decodeURIComponentWithPlusSign","val","replace","decodeURIComponent","queryString","params","startsWith","substring","queryArray","ndx","parts","queryKey","queryValue","newParam","existingParam","entry","encodeURIComponentForPrime","uriComponent","encodeURIComponent","getParamsWithItems","toLowerCase","queryItems","findIndex","getQueryParameterByName","paramsObj","paramArray","forEach","keyValuePair","getParamsObj","undefined","isValidUrl","validateScheme","indexOf","keyValueArrayToQueryString","filter","kv","isKeyValuePair","map","join","joinSubpathToURL","subPath","trimmedEndSlashFromHref","trimmedStartSlashFromSubpath","URL","updateSearchParam","searchParams","set","appendSearchParam","fallback","append","search","getAbsoluteUrl","partialUrl","logSamplingRate","FireTelemetry","GET","POST","Ctag","Comscore","OTF","Exp","ResetIdx","doc","document","otherWhitespaceRegex","trimRegex","attr","elem","getAttribute","nodeName","text","textContent","innerText","children","parent","parentNode","getElementsByTagName","createElement","containsClass","element","className","getTarget","event","customTarget","target","srcElement","ConnectorConstants","connectorStateKey","renderAction","dataConnectorMergeInitAction","Deferred","callbacks","isResolved","resolvedArgs","flushCallbacks","errors","index","e","promise","then","always","this","arguments","resolve","visibilityDeferred","visibilityProperty","prefixes","hidden","prospectivePropertyName","getHiddenPropertyName","isUnloadEventInProgress","addEventListener","wasBrowserHidden","evtname","visibilityChanged","isHidden","notifyWhenPageVisible","isElementTrulyVisible","windowRight","windowLeft","windowHeight","contentArea","getElementById","contentRect","getBoundingClientRect","right","left","boxVisible","rec","elementHeightVisible","top","bottom","elementWidthVisible","height","width","wasBrowserHiddenAtLeastOnce","clientClientId","browserWidth","browserHeight","eventIndex","clientIdTypeValue","isFirstEventIndex","eventTransientCustomTags","baseUrl","userDefinedCustomTags","Module","visible","compress","moduleTelemetryData","JSON","parse","getBrowserSize","outerWidth","documentElement","clientWidth","outerHeight","clientHeight","joinTelemetryValuesForTmpl","separator","currentTmplValue","newTmplValue","combinedTelemetryVal","isDuplicateKeyExist","newTmplValueSplited","newKeyVal","currentTmplValueSplited","currentKeyVal","trackInfo","notrack","cmSeparator","defaultModule","defaultFormHeadline","piitxt","piiurl","wrapperId","MUIDCookie","gestureKey","gestureType","tap","rightclick","eventTypes","click","nonNavClckEvt","submit","contextmenu","mouseenter","imprUpdate","adPlay","contentPlay","videoClickNonNav","imprUpdateMechanisms","load","scroll","auto","resize","swipe","partial","view","sitePage","userStatic","overrideClientParams","persistOverriddenParams","customTags","defaultCustomTags","adsEnabled","adoni","getDefaultCustomTags","trackingDisabled","shouldFireTelemetry","appErrorEnabled","shouldFireAppError","getCurrentTime","Date","timeToInteract","eventTime","eventTiming","performance","timing","navigationStart","telemetryModuleTypes","Undefined","Header","Footer","topNavBar","navBar","dropDown","Section","Carousel","searchBox","inputBox","actionButton","Interaction","Headline","Navigation","Entity","structuredData","appStore","appLaunch","cmsPromotions","microsoftWebStore","xboxStore","officeStore","appInstall","PartnerLinks","SponsoredContent","contentPlacedBySource","Editorial","PersonalizationAlgo","BingAlgo","Taboola","Outbrain","telemetryDataAttribute","telemetryHLAttribute","client","clientId","requestId","clientIdType","gesture","dom","trackInfoEvent","originalEvent","ctrlKey","shiftKey","getMuid","getAnonCookieName","AnonCookieName","AuthCookieName","getSsoComplete","SsoComplete","getAadAuthentication","AadState","AadAccount","NonAadAccount","accountInfo","ResolvedAccountInfo","account_type","AAD","orientation","screen","OTFTelemetry","mechanism","telemetryData","body","querySelectorAll","innerHeight","innerWidth","infopane","querySelector","infopaneVisible","telemetryTracking","isVisible","visibles","context","formatModules","vc","sendImprUpdateEvent","pageTitle","title","pageUrl","ocid","msnocid","hasQueryString","referrer","referrerOverride","screenResolution","userAgent","navigator","visibility","userDynamic","timeStamp","slideType","firstEventIndex","currentEventIndex","pageInstance","getRequestId","resetEventIndex","custom","addCustomTags","combinedTags","extend","stringify","addCustomTagsForClickEvent","setupParameters","evt","trackInfoSitePage","anonckName","rid","di","domainId","clid","issso","aadState","afd","anoncknm","page_product","page_type","page_name","page_configuration","topLevelContainerType","parameters","winht","docht","Math","max","scrollHeight","offsetHeight","scrollOff","pageYOffset","scrollTop","wbh","tmpl","templ","mkt","localeCode","TTI","feedId","fid","fn","feedName","ft","feedType","flightid","tlcType","sendUpdate","formattedModules","mData","y","ct","telemetryDataTypes","getTelemetryContentType","telemetryReadyCallback","otfURL","idx","beaconData","requestType","eventType","impressionUpdate","trackingType","mediator","pub","updateTemplValue","templToAdd","updateSitePage","flightId","currentSitePage","currentFlightIds","leftTmplValue","rightTemplValue","updatePageName","pageName","overridePageType","doOverridePageType","telemetryPageName","getTelemetryPageInfo","PageName","PageType","updateFeedMetadata","updatePagePivot","pagePivot","TelemetryPagePivot","validateTelemetryDataType","updateReferrer","referrerType","TelemetryContentType","setCustomTagsForClickEvent","updatePageUserTypeAndUserId","userType","userId","pageUserId","pageUserType","TelemetryUserType","trackCustomProperty","updateExtendedFlightId","namespace","flightIds","TelemetryPartnerNamespace","extflightid","defaultPubSub","PublishSubscribe","channels","getChannel","channel","pubMap","sub","listeners","unsub","pubChannel","subChannel","unsubChannel","RequestData","devicePixelRatio","canUseCssGrid","global","_instance","resetRequestData","Error","resetInstance","getRequestData","getInstance","AppType","tryParseJson","jsonString","tryParseInt","defaultValue","parseInt","isNaN","WebStorage","storage","supported","getItem","parsedObj","setItem","removeItem","logError","matchingKeys","storageKey","includes","localStorage","ex","super","trackAppErrorEvent","storageTest","message","sessionStorage","args","obj","isRecursive","src","arr","Array","isArray","toString","AppEnvironment","_serviceUrl","_configServiceUrlBase","initializeAppEnvironment","activityId","environmentConfigUrl","process","env","WEBPACK_DEV_SERVER","URLSearchParams","searchParam","contentServiceUrlBase","currentRequestTargetScope","currentMarket","environment","assetsHost","hostPage","appType","authCookieName","useOneServiceAuthEndpoints","accountInfoPromise","resolvedAccountInfo","buildVersion","clarityEnabled","isAadAccount","isDebug","showMnsCreatorDashboard","currentContentLinkHost","serviceUrlBase","feedServiceUrlBase","isFrePage","rootTelemetryId","getUserMuid","disableCachingConfigs","enableConfigService","EnableCMSPPEConfigs","isMultiConfigRetrievalEnabled","disableContentPreviewCache","sendFeedCallActivityIdInHeader","queryParamOverride","disableContentCacheIDBRead","disableContentListCache","disableContentListCacheIDBRead","configServiceBaseUrl","featureFlags","configRootUrl","cacheBustingIdentifier","countryCode","ClientSettings","aid","latitude","longitude","serviceUrl","configServiceUrlBase","appEnvironment","environmentFromHeadData","clientSettings","tryReformatGuid","v","Locale","apps_locale","geo_country","geo_lat","geo_long","setAccountInfoPromise","apptype","getAuthCookieName","disableActivityIdInHeader","Edge","cbid","pcsInfo","pcsVersion","propertyBagPcsVersion","rootElement","locationOrigin","envQSOverwrite","prod","endsWith","defaultFeedBaseDomain","EdgeChromium","MicrosoftNews","feedBaseDomain","getHostPageFromUrl","Number","trackPageProd","trackPageTypeVal","createContentLinkHost","setTargetScope","useMultiConfigsRetrieval","getConfigServiceBaseUrl","1","true","setIsAadAccount","muid","muidCookie","relativePath","int","urlQuery","param","toLocaleLowerCase","FirstParty","Hub","Views","Weather","Anon","MMX","Office","AppAnon","AccountInfoPromise","Promise","chrome","authPrivate","getPrimaryAccountInfo","startTime","round","now","endTime","ZHCN","guid","matches","match","audienceMode","Kids","Adult","browser","deviceFormFactor","domain","locale","os","pagetype","platform","Web","pageType","stringHasData","language","market","CurrentFlights","pageExperiments","addWpoFlights","wpoData","getObject","flightsCached","concat","getAppEnvironment","updatePageInstance","form","refigInputs","setRequestId","newRequestId","eventName","Utility","isNotNullOrUndefined","isDefined","potentialKeyValuePair","isKey","isValue","isNonNullObject","isNotNull","isNullOrWhiteSpace","trim","toNumber","arrayHasData","constructor","objectToString","firstRun","attribute","Logger","setupBrowserEnvironment","isDebugEnabled","webpackRequire","setupNodeEnvironment","windowObj","logger","Info","Browser","setupLogLevel","NodeJs","info","console","log","error","getMessage","infoCallback","setLevel","setupAppenders","removeAllAppenders","addAppender","getLevel","nameRegEx","queryNameValueMatches","RegExp","exec","defaultInstance","spec","qspPrefix","memo","objectFromSpecification","values","requestDataValue","clientValue","keys","reduce","pv","cv","qsp","ver","qp","verParam","current","newValue","recurse","prefix","k","currentPrefix","sort","getURLSearchParams","SSRContract","CSS","supports","pixelRatio","lang","direction","dir","requestData","loadQueryParams","app","ActivityId","jssGeneratedClassesMap","jssCaptureCompleted","removeRenderCache","removeSubstringKeys","captureJssGeneratedClasses","renderCacheEnabled","canUseDOM","getLocationHref","getLocationHostname","hostname","getLocationHost","host","getLocationOrigin","origin","getLocationSearch","getLocationProtocol","protocol","getDocumentElementById","elementId","getDocumentElementsByTagName","tagName","getIndexedDB","indexedDB","getInnerWidth","getInnerHeight","getDevicePixelRatio","queuedCalls","locationSearch","isPreload","pageRevealed","trackValuesUpdated","checkAndFireQueuedCalls","item","visibilityState","onVisibilityChange","removeEventListener","_connectorMap","_globalConnectors","_allConnectors","_getDataConnectorPendingPromises","Map","dataConnector","connector","pendingPromise","resolveCallback","rejectCallback","reject","state","actionPayload","newState","stateChanged","typeIsString","type","statePropertyKey","connectorState","experienceFullNamespace","dataConnectorName","initializeExperience","isGlobal","merge","connectorReducerResult","computeNextStateForConnector","reportStateChange","fullNamespace","has","delete","store","dispatch","connectorPreviousState","nextStateForConnector","subReduce","reducer","connectorStateChanged","previousState","reducedState","designSystemMap","WeakMap","designSystemIndexMap","createGenerateClassName","designSystem","dsName","dsIndex","rulesMap","rule","sheet","initialState","enhancer","middlewares","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","trace","traceLimit","_rootReducer","needsHydrate","hasPreHydrateState","_store","rootReducer","connectors","onApplicationStart","connectedTopLevelElement","hostElement","updateJssManagerInstance","pageTimings","hydrate","SSR","startMark","render","jssInstance","plugins","jss","_pageTimings","getPageTimings","incrementCounter","counterName","existingCount","Environment","getEnvironmentFromString","int1","intpr","intpef","ariaLabelAttribute","rootElementId","htmlElementIds","html","head","applicationCacheConstants","manifestAttributeName","pagesRefreshData","storedHeadDataKey","storedLastUsedActivityIdKey","pagetypeSettings","js","telemetryId","trackPageProduct","trackPageType","minimumHostPagePathSegments","anonCookieName","appAnonCookieExistsCookieName","childCookieName","nurturingAcceptedStateKey","oneServiceHeaders","authorization","oneServiceQueryStringKeys","apiKey","complexInfoPaneEnabled","contentType","delta","disableTypeSerialization","infopaneCount","fdhead","feedLayoutRequestType","ids","parentContentId","parentNamespace","parentTitle","queryQ","query","queryType","qScope","responseSchema","select","session","signInCookieName","skip","timeOut","user","wrapOData","AriaRoles","DeviceOrientation","EnterpriseOneServiceApi","CoreLocalStorageKeys","pageVersions","defaultOneServiceApiKey","getCookie","cookie","getMuidCookie","setRequireFunctionalCookie","expiryDays","path","secure","expiryDate","builder","date","setTime","getTime","toUTCString","PageNamePageTypeMappingList","TelemetryTypeContentTypeMappingList","TelemetryTypeBehaviorTypeMappingList","TelemetryPageType","Unspecified","DHP","NTP","HomePage","VerticalHomePage","StructuredDataPage","SectionFront","SiteSearch","Article","Gallery","Video","SubjectSection","CustomColumn","TelemetryType","TopNavBar","NavBar","DropDown","SearchBox","InputBox","ActionButton","StructuredData","AppStore","AppLaunch","CmsPromotions","MicrosoftWebStore","XboxStore","OfficeStore","AppInstall","Follow","Unfollow","MoreFrom","Topic","Provider","Spotlight","ShareClose","Share","Like","Dislike","Unlike","Undislike","Mute","Unmute","MuteCancel","Manage","NewStories","AutoSuggest","BingCard","Tile","TrendingNews","AllCoverage","Report","AdChoice","Hide","Unhide","App","Feed","AppStorePromo","Settings","StructuredDataCard","Webview","Activity","Win32","OfficeDocument","LocalFile","CardAction","TelemetryBehaviorType","Navigate","ContextMenu","Pin","Unpin","Rearrange","Remove","Add","Open","View","More","Close","Cancel","Launch","Install","Show","Save","Customize","TelemetryPageName","StartPage","DefaultPage","EduPage","ChildModePage","Discover","MyInterests","CombinedInterests","ArticlePageNames","ArticleVNext","ArticleListicle","ArticleCollection","ArticleFullScreen","FlexibleArticle","FlexibleArticleMobile","ArticleGalleryFullScreen","GalleryPageNames","GalleryVNext","GalleryFullScreen","GalleryClassic","GalleryClassicFullScreen","GallerySearch","GallerySearchFullScreen","FlexibleGallery","FlexibleGalleryMobile","GalleryImmersive","GalleryImmersiveFullScreen","GallerySponsored","GallerySponsoredFullScreen","GalleryInline","VideoPageNames","ChannelPlayerPage","PartnerPlayerPage","VerticalHomePageNames","HomePageToday","StructuredDataPageNames","Gamecenter","Schedule","Scores","Stocksummary","Stocksummaryoneriver","Weatherxplatmaps","Standings","Markets","Watchlistpage","Data_modelpage","Immersivechartspage","Currencies","Indexdetailspage","Data_makepage","Weatherfullscreenmaps","Weatherthresholdmaps","Stockanalysisdetails","Data_yearoverview","Data_segmenthub","Weathermaps","Playerstats","Funddetailspage","Exercisedetails","Teams","Etfdetailspage","Binganswermaps","Workoutdetails","Competitionstats","Polls","Data_photos","Videocategorylistpage","Stockfinancialsdetails","Commoditydetailspage","Data_yearoverview_trim","Worldwidepage","Data_photos_trim","Stockcompanydetails","Retirementplanner","Livecoverage","Teamroster","Stockhistorydetails","Filterresultspage","Data_carcompare","Stockownershipdetails","Driverstandings","Timevalueofmoney","Savingscalculator","Iccmatches","Other_flightsearchresult","Stockrelateddetails","Data_specs_trim","Stockoptionsdetails","HomepageAlerts","HomepageRecordsandAverages","HomepageWeatherTraffic","Data_specs","Data_pricing","Mortgagecalculator","Data_performance_trim","Theatershowtimes","Data_pricing_trim","Data_photosInterior","Indexdetailsanalysispage","Data_photosInterior_trim","Data_photosColors","Data_carReviews_trim","Data_carReviews","Racecalendar","Teamstandings","Data_photosColors_trim","Stockdetails","Data_interiorFeatures_trim","Data_exteriorFeatures_trim","Calendar","TeamStats","Movieshowtimes","Drafts","Data_technologyFeatures_trim","Data_workoutdetails_collection","Data_photosExterior","Data_photosExterior_trim","Data_photos360Interior","Immersivechartsmarketspage","Returnoninvestment","Indexdetailsrelatedpage","Gonepage","Data_compare","Data_compare_trim","Data_options_trim","Entitiespage","Workoutdetailsprint","Data_photos360Exterior","HomepageDatacarfinder","Data_photos360Interior_trim","Data_skeleton","Mortgagerates","Brackets","Data_photos360Exterior_trim","Data_photocompare","HomepageWeather10day","Data_performance","HomepageWeatherextendedforecast","Savings","Data_exteriorFeatures","Data_interiorFeatures","Data_options","Travelgonepage","Recipe","Getportfoliodatapage","Brokercenterpage","Data_technologyFeatures","Tvlistings","Ownerstandings","Entitydetailspage","Creditcards","Cmssitemap","Externalnativeadpage","Autoloans","Externalcontent","Htmlsitemap","CustomColumnPageNames","TrendingTopics","GlobalSettingsPage","MyTopics","WeatherPlaces","MyFavorites","TopicResult","Collections","Rouxbe","ShoppingList","MyHealthReportsPage","Error404page","AppsPromotion","Error500page","DietTrackerPreSigninPage","ExerciseTrackerPreSigninPage","WebSlicePage","Error200Page","AboutUsPage","UnSupport","Disclaimer","TermsOfService","SevereWeather","SubjectSectionPageNames","TeamhomePage","PlayerPage","MarketMoversPage","CommoditiesPage","ChefPage","NutritionIndexPage","FinanceTechnologyPage","MedicalindexPage","SiteSearchPageNames","SearchResultsPage","VideoSearchResultsPage","PartnerVideolistPage","HomepageBingserpIframepage","SitesearchSitesearch","SearchResults","SerpPage","FindaMoviePage","SectionFrontPageNames","Competitionhub","Local","Stockscreener","Toolslandingpage","Showtimes","FinanceRealEstatepage","CookingSchool","Allcompetitions","Newspage","CocktailHub","Travelflightsearchhubpage","Hotelshubpage","WineHub","ChefHub","Travelflightstatushubpage","HomepageCompetitionhub","SecfrontHotel","SecfrontTNews","TelemetryProduct","Spartan","Prime","PrimeMobile","IEext","SpartanMobile","TabbedShell","ChromeExt","Downlevel","Xbox","ContentPlacedBySource","Editor","Bing","AutoCuration","User","AppNexus","OtherSponconProvider","TelemetryPageConfiguration","NoContent","OneBox","TopSites","Suggested","ContentFeed","WinFre","StripeLayout","TelemetryPageMode","Trial","Subscription","Apps","News","Timeline","StartMenu","Shell","Cortana","Aad","Msa","MsaKids","telemetryType","prop","getTelemetryBehavior","TelemetryActionType","Click","Hover","Submit","RightClick","telemetryPageNameObject","dataConnectorToExperienceKeyMap","createStatePropertyKey","dataConnectorInjector","registerInjection","experienceSet","Set","add","appState","experienceStatePropertyKey","initialDataConnectorState","dataConnectorNamespace","newDataConnectorState","experienceKeys","experienceKey","experiencePreviousState","renderCacheObject","batchCSS","batchCss","styles","dataset","innerHTML","scrapeDom","includeNewsFeed","root","rivers","getElementsByClassName","river","outerHTML","getStateFromRenderCache","renderCache","renderCacheKeys","renderCacheStoredKeys","keyn","expn","frcn","jssn","cacheExpirationTimestamp","parsedCacheExpirationTimestamp","renderCacheStorage","batch_css","getRenderCache","reduxStoreStringifyReviver","dataType","AudienceModeType","WpoConstant","isWpoEnabled","currentPageExperiments","getWpoStorageCacheKey","targetScope","getWpoFlights","treatments","HeadData","clientData","enableCMSPPEConfigs","initializeHeadData","marketDir","currentFlights","userIsSignedIn","isAppcache","isEnterprise","isOfficeDefaultPivot","isServiceWorkerCache","lastKnownAppVersion","ssoComplete","headData","initializeFromData","htmlElement","headElement","initializeFromDom","initializeFromStorage","serviceWorker","controller","updateStorageActivityId","setQueryItemProvidedValues","headDataJs","headJs","anonckname","signedin","setIsEnterprise","setIsOfficeDefaultPivot","storedActivities","storedActivityIds","setFlights","clientInfo","dataClientSettings","pageTypeFromSettings","storedVersions","currentDomVersion","setObject","responseFromStorage","parsedResponseFromStorage","currentPageStoredHeadData","storedClientSettings","storedFlights","domQueryParams","queryparams","currentPageVersion","existingLastUsedActivityIds","currentPageLastUsedActivityId","previouslyUsed","activityIdToStore","ts","flightString","IsEnterprise","Enterprise","cmsItem","find","setCurrentFlightsTestOverride","flights","IsOfficeDefaultPivot","getHeadData","handler","unbind","sequenceTokens","sequenceValues","\"","urlPart","ch","navigation","getUrl","relativeUrl","navigate","getHostName","parseUrl","isLocal","supportMultiple","mergeQueryStringParams","newParams","urlParts","decodeURIComponentAndPlusSign","anchor","hostName","port","pathname","hash","locationHost","domainParts","reverse","hostDomain","domainMatchPattern","ocidMatchPattern","ccidMatchPattern","msnOcid","storeOcid","storeocid","addCcidToStoreUrl","tHref","emsAdId","ccidMatch","ccidOnUrl","hashIndex","hashValue","storeUrl","ccidData","webig","addOcidToHref","endOfScheme","locationOfStore","isStoreUrl","ocidMatch","ocidOnUrl","emsOnUrl","initStoreUrl","emsMatch","domainMatch","hrefHostName","linkUrl","modifyValuesForTrackPage","preventComscore","personalization","props","attachTaglineClickHandler","getActionResult","action","isSuccessful","domName","getParent","getChildren","recipients","refreshPageLoad","lastClickedTarget","regExpEventName","impressionCache","trackAll","implementationMethod","implementation","defOpts","defaultOpts","disableOnAutoRefresh","names","isInList","AR","isGeneratedEarly","depthFirstChildAttribute","attributeName","skipElement","altValue","localName","countAllTrackableLinks","count","getChildByTargetElement","depth","dataLength","subChild","trackAppErrorEventInternal","errorParams","report","errId","errMsg","errSource","msg","isError","setAppErrorTrackInfo","trackFormSubmitEvent","destination","headline","campaign","getSearchTerm","trackEvent","contentAction","jquery","customHandled","elemHref","dataHlValue","headlineElement","findCMValue","curId","previousCM","getContentElementIndex","clsGT1","$1","moduleInfo","nameLineage","ordinalLineage","lineageDelimiter","actionType","behaviorType","moduleInfoJson","moduleInfoHeader","elementTelemetryLineage","nameLineageArray","ordinalLineageArray","telemetryObject","parseDomAttributeJson","getLineage","time","duHostname","track","filterUrlParams","destinationUrl","contentModule","contentElement","campaignId","sourceIndex","nLineage","oLineage","trackPageInternal","overrideParams","paramPageType","telemetryPageType","ar","trackingHelper","preventBeacon","errorObject","onContextMenu","trackClickEvents","onClick","button","trackAdEvent","adParams","adWidth","w","adHeight","h","dst","den","pg","status","anAd","seqid","sdk","fen","trackVideoEvent","isInline","defaultParams","at","bt","bh","bw","cvs","canvas","serverImpressionGuid","department","subDepartment","subcvs","vertical","isVideo","cleanParam","removeNullOrEmptyParams","eventSource","trackFeedbackEvent","feedbackParams","submitValue","otfPackage","getFeedbackTrackingParams","createEvent","createEvt","sendPageViewCandidate","pvUrl","sendSinglePageViewBeacon","beaconId","clearImpressionCache","blackList","splitedUrl","outputUrl","paramsString","contains","trackPartialImpression","visibilityCheck","trackPartialImpressionInternal","trackPage","trackThirdPartyUpdate","register","trackingImplementation","samplingRate","getCurrentPageRequestId","mapTelemetryParams","common","commonMap","paramsMap","groupKey","trackInfoGroupKey","groupValue","clientParams","formElem","events","trackPageRefresh","setTimeout","dataAttr","array","elements","domElement","telemetryChildren","findTelemetryElements","impressionContent","mech","getClickEventFromUrl","targetUrl","evtName","curUrl","getEventFromUrl","targetElem","initEvent","createEventObject","useMap","activeElement","ServiceWaffleAutomaticClickTrackingDisabled","appLauncherElement","hasAttribute","currentTarget","isClickedTwice","preventDefault","returnValue","preventEventDefault","isPropagationStopped","overrideClickTelemetry","scr","d_dgk","contentid","entityId","cu","isSignedIn","HostPage","pathnameSegments","topDomainName","originalUrl","categoryKey","verticalKey","topDomain","indexOffset","subcategoryKey","Market","guidGen","timestampSeed","seededRandom","random","floor","AuthCookieExistsCookieName","start","PerfMarker","endMarkSuffix","initialize","instance","singleMark","measureStartEnd","mark","getPromise","endMark","experienceName","perfMarkers","perfEntries","getEntriesByType","markerName","perfMarkerDetail","PerfMarkerDetail","processPerfEntry","isValid","measure","perfMarker","duration","perfEntry","firstStartTime"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EA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J,MAAMK,EAAmBJ,EAAYG,IAAe,IAAIE,EAAiBF,GACzEC,EAAiBE,iBAAiBL,EAAYngE,IAC1CsgE,EAAiBG,UACjBP,EAAYG,GAAcC,GAIlC,OAAOJ,EAOH,gBAAgBn+D,GACpB,MAAM2lB,EAAcnH,KAAKmH,YACzB,GAAIA,GAAeA,EAAYg5C,QAC3B,IACIh5C,EAAYg5C,QACR3+D,EACAA,EA3II,SA4IJA,EAAOwe,KAAKk/C,eAElB,MAAO7oC,GAIL,IAAOL,SAAS,mDAAmDx0B,cAAiB60B,OAM7F,MAAM+pC,EAAanB,EAAWhqC,cAYrC,MAAM+qC,EAaF,YAAYF,GALL,KAAAO,SAAW,EAMdrgD,KAAK8/C,WAAaA,EAOtB,cACI,OAAyB,MAAlB9/C,KAAKoe,UAMT,iBAAiBkiC,GAGhBA,EAAU9+D,KAAKw6B,SAnMH,WAsMPhc,KAAKugD,iBACNvgD,KAAKugD,eAAiBD,EAAUliC,WAIpCpe,KAAKoe,UAAYkiC,EAAUliC,WAEF,MAAlBpe,KAAKoe,YAKZpe,KAAKqgD,UAAYC,EAAUliC,UAAYpe,KAAKoe,UAG5Cpe,KAAKoe,UAAY","file":"startup.4dbc3cd617bd0e849ab0.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t322: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/bundles/v1/hybrid/20200710.136/\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([934,0]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * The app error object that contains the data of an app error\r\n */\r\nexport interface AppError {\r\n /** error id */\r\n id: number;\r\n\r\n /** source file */\r\n source?: string;\r\n\r\n /** Message or data */\r\n message?: string;\r\n\r\n /** severity */\r\n severity?: Severity;\r\n\r\n /** Property Bag */\r\n pb?: AppErrorPropertyBag;\r\n\r\n /** optional property: Bug meta data for auto bug creation from app error */\r\n bug?: any;\r\n}\r\n\r\n/**\r\n * The app error property bag that will be used for build number etc.\r\n */\r\nexport interface AppErrorPropertyBag {\r\n /** build number */\r\n build?: string;\r\n\r\n /** custom message */\r\n customMessage?: string;\r\n\r\n /** PCS build version */\r\n pcsVersion?: string;\r\n\r\n /** The error source. */\r\n source?: string;\r\n\r\n /** The line number of the error. */\r\n line?: number;\r\n\r\n /** The column number of the error. */\r\n column?: number;\r\n\r\n /** The stack trace for the error. */\r\n stack?: string;\r\n}\r\n\r\n/**\r\n * The interface that defines a generic app error tracker\r\n */\r\nexport interface AppErrorTracker {\r\n /**\r\n * Report an app error\r\n * @param {AppError} error - the app error to report\r\n */\r\n trackError(error: AppError): Promise;\r\n}\r\n\r\n/**\r\n * This will decide whether to create Alert for this app error or no alert. This can generate IcM ticket.\r\n * Alerts ones are tracked at http://aka.ms/AppErrors\r\n * NoAlerts will have separate tab just next to Errors aka Warnings. IcM ticket won't be generated when NoAlert is set.\r\n */\r\nexport enum Severity {\r\n /**\r\n * This is app error with default severity\r\n */\r\n Alert,\r\n\r\n /**\r\n * This is app warning\r\n */\r\n NoAlert,\r\n\r\n /**\r\n * This app error has high user impact\r\n */\r\n HighImpact,\r\n\r\n /**\r\n * This is fatal app error\r\n */\r\n Critical\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * locationHref of page\r\n */\r\nexport const locationHref = (typeof (window) !== \"undefined\" ? window.location.href : \"\");\r\n\r\n/**\r\n * Render-cache expiration time in ms\r\n * 86400000 = 24 hours in milliseconds\r\n */\r\nexport const defaultExpirationTimeMs = 86400000;\r\n\r\n/**\r\n * Render-cache force expiration time in ms\r\n * 129600000 = 36 hours in milliseconds\r\n */\r\nexport const defaultForceExpirationTimeMs = 129600000;\r\n\r\n/**\r\n * localStorage key prefix for render cache expiration timestamp\r\n * Stores the sliding window expiration\r\n */\r\nexport const expirationPrefix = \"timestamp_\";\r\n\r\n/**\r\n * Force timestamp prefix for render cache values\r\n * Stores the absolute window expiration\r\n */\r\nexport const forceTimestampPrefix = \"force_timestamp_\";\r\n\r\n/**\r\n * Jss map suffix for render cache values\r\n * Stores the jss class list map\r\n */\r\nexport const jssMapSuffix = \"_jssMap\";\r\n\r\n/**\r\n * Prefix for render cache keys\r\n * Stores the collection of all render cache keys\r\n */\r\nexport const keysPrefix = \"keys_\";\r\n\r\n/**\r\n * The key for storing all render cache normalized keys\r\n * Maintain a single entry for collection of all render cache keys\r\n * Example: for https://ntp.msn.com/edge/ntp?locale=en-us URL,\r\n * we have one key with all the following render cache keys values\r\n *\r\n * key: keys_https://ntp.msn.com/edge/ntp?locale=en-us&startpage=1\r\n * value: {\r\n * keyn: \"lastKnown_https://ntp.msn.com/edge/ntp?locale=en-us\", // render cache key\r\n * expn: \"timestamp_https://ntp.msn.com/edge/ntp?locale=en-us\", // expiration key\r\n * frcn: \"force_timestamp_https://ntp.msn.com/edge/ntp?locale=en-us\", // force timestamp key\r\n * jssn: \"lastKnown_https://ntp.msn.com/edge/ntp?locale=en-us_jssMap\" // jss map key\r\n * }\r\n */\r\nexport const renderCacheKeyOfNormalizedKeys = `${keysPrefix}${locationHref}`;\r\n\r\n/**\r\n * localStorage key prefix for render cache object\r\n * Stores the render cache snapshot\r\n */\r\nexport const storagePrefix = \"lastKnown_\";\r\n\r\n/**\r\n * River Render Cache ClassName\r\n */\r\nexport const riverRcClassName = \"river-rc\";","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * An enumeration indicating the MSA sign in status for the page.\r\n */\r\nexport enum SignedInStatus {\r\n Unknown,\r\n NotSignedIn,\r\n SignedIn\r\n}\r\n\r\n/**\r\n * The various account types that we support in Peregrine, this enum can be modified as new types are added\r\n * \"MSA\" - MSA\r\n * \"AAD\" - AAD\r\n */\r\nexport enum AccountType {\r\n MSA = \"MSA\",\r\n AAD = \"AAD\"\r\n}\r\n\r\n/**\r\n * Note: these values are used by the Telemetry team and must remain in the following order:\r\n * 0 - NonAadAccount\r\n * 1 - AadAccount\r\n * 2 - Unknown\r\n */\r\nexport enum AadAccountType {\r\n NonAadAccount = 0,\r\n AadAccount = 1,\r\n Unknown = 2\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * A callback to reset singleton data. Used for server side rendering.\r\n */\r\nexport type ResetCallback = () => void;\r\n\r\n/**\r\n * Global array of callbacks that are used for resetting singleton data.\r\n */\r\nconst resetCallbacks: ResetCallback[] = [];\r\n\r\n/**\r\n * Adds a callback to the global array of reset callbacks.\r\n * This should only be used to reset singleton data.\r\n * @param callback The function that resets the singleton data.\r\n */\r\nexport function registerResetCallback(callback: ResetCallback): void {\r\n resetCallbacks.push(callback);\r\n}\r\n\r\n/**\r\n * Calls all of the reset functions in resetCallbacks.\r\n * This gets called once on the server side at the beginning of each request.\r\n */\r\nexport function invokeResetCallbacks(): void {\r\n for (const resetCallback of resetCallbacks) {\r\n resetCallback();\r\n }\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { AppError, AppErrorPropertyBag, Severity } from \"./AppErrorTracker\";\r\n\r\n/**\r\n * This file contains the list of errors to log to the server for each feature.\r\n * We are centralizing errors here to make sure we do not have any dupes\\conflicts.\r\n * The idea is that each feature would have their own range of values.\r\n *\r\n * IMPORTANT: Please do not add strings to this file. Please map messages to send in your\r\n * code.\r\n */\r\n\r\n/**\r\n * All app errors are set to create IcM ticket by default unless specified in individual error code otherwise.\r\n */\r\nconst severity = Severity.Alert;\r\n\r\n// Webpack defines the BUILD_NUMBER of client code build number.\r\ndeclare let BUILD_NUMBER: string;\r\n\r\n/**\r\n * Get build number from web pack. If not present, return empty\r\n */\r\nconst pb: AppErrorPropertyBag = {\r\n build: typeof BUILD_NUMBER === \"undefined\"\r\n ? \"\"\r\n : BUILD_NUMBER\r\n};\r\n\r\nexport function updateAppErrorsPropertyBag(newPbInfo: Partial): void {\r\n Object.assign(pb, newPbInfo);\r\n}\r\n\r\nexport function getAppErrorsPropertyBag(): AppErrorPropertyBag {\r\n return pb;\r\n}\r\n\r\n/**\r\n * Error during app initialization for Edge page experience.\r\n * Need to mimic the prime one since telemetry cooking logic looks for this\r\n */\r\nexport const EstablishSignedInState: AppError = {\r\n id: 1405,\r\n source: \"EstablishSignInStateHelpers.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/** Represents a ServiceUI related error */\r\nexport const ServiceUiError: AppError = {\r\n id: 5100,\r\n source: \"ServiceUiComm.ts\",\r\n severity,\r\n pb\r\n};\r\n\r\n/** Represents a Top Sites related error */\r\nexport const TopSitesError: AppError = {\r\n id: 8010,\r\n source: \"TopSites.tsx\",\r\n severity,\r\n pb\r\n};\r\n\r\n/** Represents a Top Sites error when there are zero rendered top sites */\r\nexport const ZeroTopSitesError: AppError = {\r\n id: 8011,\r\n source: \"TopSites.connector.ts\",\r\n severity,\r\n pb\r\n};\r\n\r\n/** Curated sites list is empty */\r\nexport const CuratedSitesEmpty: AppError = {\r\n id: 8012,\r\n source: \"TopSites.connector.ts\",\r\n severity,\r\n pb\r\n};\r\n\r\nconst TopSitesEdgeConnectorFileName = \"TopSitesEdge.connector.tsx\";\r\nconst TopSitesEdgeStorageFileName = \"TopSitesStorage.ts\";\r\n\r\nexport const TopSitesEdgeAppErrors = {\r\n ZeroTopSitesError: {\r\n id: 8013,\r\n source: TopSitesEdgeConnectorFileName,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n CuratedSitesEmpty: {\r\n id: 8014,\r\n source: TopSitesEdgeStorageFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n ComponentMountFailed: {\r\n id: 8015,\r\n source: TopSitesEdgeConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n ErrorFetchingRichTopSitesDataCollectionFromCms: {\r\n id: 8016,\r\n source: TopSitesEdgeStorageFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst TopSitesEdgeNextConnectorFileName = \"TopSitesEdgeNext.connector.tsx\";\r\n\r\nexport const TopSitesEdgeNextAppErrors = {\r\n\r\n /** The React component failed to mount */\r\n ComponentMountFailed: {\r\n id: 8020,\r\n source: TopSitesEdgeNextConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Represents a Top Sites error when there are zero rendered top sites */\r\n ZeroTopSitesError: {\r\n id: 8021,\r\n source: TopSitesEdgeNextConnectorFileName,\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\nexport const TopSiteDialogAppErrors = {\r\n /** The React component failed to mount */\r\n TopSitesDialogFailedToMount: {\r\n id: 8025,\r\n source: \"TopSitesDialog.tsx\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst OneServiceCardProviderFileName = \"OneServiceCardProvider.ts\";\r\n\r\nexport const OneServiceCardProviderAppErrors = {\r\n EmptyMyFeed: {\r\n id: 8030,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n OneServiceResponseWasNullOrErroneous: {\r\n id: 8031,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n ErrorFetchingOneServiceResponse: {\r\n id: 8032,\r\n source: OneServiceCardProviderFileName,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n\r\n InvalidJsonInOneServiceResponse: {\r\n id: 8033,\r\n source: OneServiceCardProviderFileName,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n\r\n InvalidFeedListInOneServiceResponse: {\r\n id: 8034,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n RiverConfigurationIssue: {\r\n id: 8035,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load views river content based on current vertical/category. */\r\n QueryInterestContentFetchError: {\r\n id: 8036,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n StaticContentLoaded: {\r\n id: 8037,\r\n source: OneServiceCardProviderFileName,\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\nconst OneServiceDailyBriefApi = \"dailyBriefServiceClient.ts\";\r\n\r\nexport const DailyBriefServiceClientAppErrors = {\r\n OneServiceResponseWasNullOrErroneous: {\r\n id: 8038,\r\n source: OneServiceDailyBriefApi,\r\n severity,\r\n pb\r\n },\r\n\r\n OneServiceArticleListWasNullOrErroneous: {\r\n id: 8039,\r\n source: OneServiceDailyBriefApi,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst ContentPreviewSourceFile = \"ContentPreview.connector.ts\";\r\nconst ContentPreviewDataSourceFile = \"ContentPreviewData.ts\";\r\nconst ExternalContentMapperHelperFile = \"ExternalContentMapperHelper.ts\";\r\n\r\nexport const ContentPreviewAppErrors = {\r\n\r\n ErrorWhileFetchingContentPreviewContent: {\r\n id: 8041,\r\n source: ContentPreviewDataSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n InvalidResponseFromContentPreviewFetch: {\r\n id: 8042,\r\n source: ContentPreviewDataSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n InvalidResponseFromContentPreviewResponseJson: {\r\n id: 8043,\r\n source: ContentPreviewDataSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n ErrorWhileInitializingAsyncContentPreviewContent: {\r\n id: 8044,\r\n source: ContentPreviewSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n InvalidOrMissingContentId: {\r\n id: 8045,\r\n source: ContentPreviewDataSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n MissingDataForExternalContent: {\r\n id: 8046,\r\n source: ExternalContentMapperHelperFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\nexport const MissingPartnerLink: AppError = {\r\n id: 8047,\r\n source: ContentPreviewDataSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\nconst RiverSourceFile = \"River.connector.ts\";\r\n\r\nexport const RiverAppErrors = {\r\n UnknownMetadataReceivedFromRiverCardProvider: {\r\n id: 8051,\r\n source: RiverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n RiverContentProviderFetchException: {\r\n id: 8052,\r\n source: RiverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n SkipPositionedCardsFallbackStrategyFailed: {\r\n id: 8053,\r\n source: RiverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n InvalidConfig: {\r\n id: 8054,\r\n source: RiverSourceFile,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n\r\n ChildLoadError: {\r\n id: 8056,\r\n source: RiverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n InitialDataLoadError: {\r\n id: 8057,\r\n source: RiverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Warning for when the ordinal children we get from config contains a duplicate instance id. */\r\n DuplicateInstanceIdWarning: {\r\n id: 8058,\r\n source: RiverSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\nexport const FullHeightFallbackStrategyFailed: AppError = {\r\n id: 8059,\r\n source: RiverSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\nconst UserInitiatedPageRefreshSourceFile = \"UserInitiatedPageRefresh.ts\";\r\nexport const UserInitiatedPageRefreshErrors = {\r\n Default: {\r\n id: 8060,\r\n source: UserInitiatedPageRefreshSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst PivotContentSourceFile = \"PivotContent.connector.ts\";\r\nexport const PivotContentErrors = {\r\n LoadFailure: {\r\n id: 8070,\r\n source: PivotContentSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst PivotContentV2SourceFile = \"PivotContentV2.connector.ts\";\r\nexport const PivotContentV2Errors = {\r\n LoadFailure: {\r\n id: 8071,\r\n source: PivotContentV2SourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst PivotsNavSourceFile = \"PivotsNav.connector.ts\";\r\nexport const PivotsNavErrors = {\r\n TopicDataConnectorUnavailable: {\r\n id: 8075,\r\n source: PivotsNavSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n NavigationDataConnectorUnavailable: {\r\n id: 8076,\r\n source: PivotsNavSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n DynamicPivotsHelperLoaderFailed: {\r\n id: 8077,\r\n source: PivotsNavSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n LayoutPreferenceDataConnectorUnavailable: {\r\n id: 8078,\r\n source: PivotsNavSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst PivotsNavV2SourceFile = \"PivotsNavV2.connector.ts\";\r\nexport const PivotsNavV2Errors = {\r\n PivotHoverLoadFailure: {\r\n id: 8079,\r\n source: PivotsNavV2SourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Smart list is empty */\r\nexport const SmartListEmpty: AppError = {\r\n id: 8080,\r\n source: \"SmartList.connector.ts\",\r\n severity,\r\n pb\r\n};\r\n\r\n/** Represents BingWebSSO related App errors */\r\nconst BingWebSSOSourceFile = \"BingWebSSO.tsx\";\r\nexport const BingWebSSOAppErrors = {\r\n /** Failed to render bing websso iframe */\r\n BingWebSSORenderFailed: {\r\n id: 8090,\r\n source: BingWebSSOSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** User signed-in to MSA on page but bing SSO returned authentication failed response */\r\n BingWebSSOSignInFailed: {\r\n id: 8091,\r\n source: BingWebSSOSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Bing SSO process did not complete withing required time */\r\n BingWebSSOTimeout: {\r\n id: 8092,\r\n source: BingWebSSOSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst WeatherDataConnectorSourceFile = \"WeatherData.connector.ts\";\r\nconst WeatherCardConnectorSourceFile = \"WeatherCard.connector.ts\";\r\n/** Failed to fetch weather summary */\r\nexport const WeatherSummaryFetchError: AppError = {\r\n id: 8100,\r\n source: WeatherDataConnectorSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\n/** No valid Location set from User */\r\nexport const WeatherLocationEmpty: AppError = {\r\n id: 8101,\r\n source: WeatherDataConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/** Not able to read from PDP */\r\nexport const WeatherPDPReadFailed: AppError = {\r\n id: 8102,\r\n source: WeatherDataConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/** Not able to write home location to PDP */\r\nexport const WeatherPDPHomeLocationWriteFailed: AppError = {\r\n id: 8103,\r\n source: WeatherDataConnectorSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\n/** Not able to write display Unit to PDP */\r\nexport const WeatherPDPDisplayUnitWriteFailed: AppError = {\r\n id: 8104,\r\n source: WeatherDataConnectorSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\n/** Not able to localize Location */\r\nexport const WeatherLocalizeLocationFailed: AppError = {\r\n id: 8105,\r\n source: WeatherDataConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\nexport const WeatherCardAppErrors = {\r\n /** Failed to fetch local news */\r\n WeatherLocalNewsFetchError: {\r\n id: 8106,\r\n source: WeatherCardConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** Failed to fetch autosuggest for locations */\r\n WeatherAutoSuggestFetchError: {\r\n id: 8107,\r\n source: WeatherCardConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** No valid Location set from User */\r\n WeatherLocationEmpty: {\r\n id: 8108,\r\n source: WeatherCardConnectorSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Failed to fetch autosuggest for locations */\r\nexport const WeatherAutoSuggestFetchError: AppError = {\r\n id: 8109,\r\n source: WeatherDataConnectorSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\n/** for more error about Weather, use 295XX */\r\n\r\nconst SportsPdpServiceClientSourceFile = \"SportsPdpServiceClient.ts\";\r\nexport const SportsCardError = {\r\n /** Failed to fetch league sports pdp */\r\n SportsLeaguePdpFetchError: {\r\n id: 8110,\r\n source: SportsPdpServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch league sports pdp */\r\n SportsLeaguePdpInvalidResponse: {\r\n id: 8111,\r\n source: SportsPdpServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch players sports pdp */\r\n SportsPlayersPdpFetchError: {\r\n id: 8112,\r\n source: SportsPdpServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch players sports pdp */\r\n SportsPlayersPdpInvalidResponse: {\r\n id: 8113,\r\n source: SportsPdpServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch teams sports pdp */\r\n SportsTeamsPdpFetchError: {\r\n id: 8114,\r\n source: SportsPdpServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch teams sports pdp */\r\n SportsTeamsPdpInvalidResponse: {\r\n id: 8115,\r\n source: SportsPdpServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get sports card config */\r\n SportsCardConfigFetchError: {\r\n id: 8116,\r\n source: \"SportsCardConfigReader.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get Team Data */\r\n SportsCardGetFavoriteTeamDataError: {\r\n id: 8117,\r\n source: \"SportsCard.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get Team Data */\r\n SportsCardGetPlayerBioError: {\r\n id: 8118,\r\n source: \"SportsCard.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n SportsCardGetLeaguesGamesArrayError: {\r\n id: 8119,\r\n source: \"SportsCard.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n SportsCardGetPdpDataFailure: {\r\n id: 8120,\r\n source: \"SportsCard.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n SportsCardGetLeagueSeasonYearDataFailure: {\r\n id: 8121,\r\n source: \"SportsCardServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n SportsCardGetLocalizedTeamNameDataFailure: {\r\n id: 8122,\r\n source: \"SportsCardServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n SportsCardGetTeamDataFailure: {\r\n id: 8123,\r\n source: \"SportsCardServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n SportsCardGetLeagueDataFailure: {\r\n id: 8124,\r\n source: \"SportsCardServiceClient.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst MoneyCardConnectorFile = \"MoneyCard.connector.ts\";\r\nexport const MoneyCardError = {\r\n /** Failed to get quote summary for user */\r\n MoneyQuoteSummaryGetError: {\r\n id: 8130,\r\n source: MoneyCardConnectorFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get quote summaries */\r\n MoneyQuoteSummariesGetError: {\r\n id: 8131,\r\n source: MoneyCardConnectorFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get pdp data */\r\n MoneyPdpDataGetErrorFromService: {\r\n id: 8132,\r\n source: \"MoneyPdpServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get pdp data because of invalid response */\r\n MoneyPdpInvalidResponseFromService: {\r\n id: 8133,\r\n source: \"MoneyPdpServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get quote summary response for user from service client */\r\n MoneyQuoteSummaryGetErrorFromService: {\r\n id: 8134,\r\n source: \"MoneyQuotesServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get quote summary response for user from service client because of invalid response */\r\n MoneyQuoteSummaryInvalidResponseFromService: {\r\n id: 8135,\r\n source: \"MoneyQuotesServiceClient.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const TrendingNewsErrors = {\r\n /** Failed to fetch the trending news stories */\r\n DataFetchError: {\r\n id: 8140,\r\n source: \"TrendingNews.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n /** Failed to fetch the backup data for trending news stories */\r\n BackupDataFetchError: {\r\n id: 8141,\r\n source: \"TrendingNews.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst ComplexContentPreviewSourceFile = \"ComplexContentPreview.connector.ts\";\r\nexport const ComplexContentPreviewErrors = {\r\n InitError: {\r\n id: 8150,\r\n source: ComplexContentPreviewSourceFile,\r\n severity,\r\n pb\r\n },\r\n LoadError: {\r\n id: 8151,\r\n source: ComplexContentPreviewSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n ContentError: {\r\n id: 8152,\r\n source: ComplexContentPreviewSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const GridSectionAppErrors = {\r\n /** Unable to generate river section cards */\r\n GridSectionCardGenerationError: {\r\n id: 8160,\r\n source: \"GridSection.tsx\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst MmxEntryPointFileName = \"MMXPage.connector.ts\";\r\n\r\nexport const MmxEntryPointAppErrors = {\r\n /**\r\n * MMX river is not able to load Error Page.\r\n */\r\n MmxErrorPage: {\r\n id: 8170,\r\n source: MmxEntryPointFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Error fetching the APP_ANON cookie on MMX page load\r\n */\r\n ErrorFetchingAppAnonCookie: {\r\n id: 8171,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst irisImageHotspotsFile = \"ImageHotspots.manager.ts\";\r\nexport const BackgroundImageAppErrors = {\r\n /** The Bing Image of the Day failed to load properly */\r\n BingIOTDFailedToLoad: {\r\n id: 8180,\r\n source: \"BingImageOfTheDayProvider.ts\",\r\n severity,\r\n pb\r\n },\r\n /** Error when Iris fails to return Hotspots Data to the client. */\r\n FailedHotspotsDataDelivery: {\r\n id: 8181,\r\n source: irisImageHotspotsFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** Hotspots data that was returned failed to validate. */\r\n IncompleteHotspotsContract: {\r\n id: 8182,\r\n source: irisImageHotspotsFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** Hotspots data found for the off page navigation failed inspection. */\r\n InvalidOffPageNavCTA: {\r\n id: 8183,\r\n source: irisImageHotspotsFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const SettingsDialogAppErrors = {\r\n /** Failed to get the saved layout preferences */\r\n ReadPreferencesFailed: {\r\n id: 8190,\r\n source: \"SettingsDialogEdgeNext.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch the ConfigData object from the client API */\r\n FetchNtpConfigDataFailed: {\r\n id: 8191,\r\n source: \"SettingsDialogEdgeNextBase.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n ChromiumClientEmbededsearchAPIError: {\r\n id: 8192,\r\n source: \"SettingsDialogEdgeNext.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst MsnSettingMenuConnectorFileName = \"MsnSettingMenuConnector.connector.ts\";\r\n\r\nexport const MsnSettingsMenuAppErrors = {\r\n /** Failed to get feedback dialog connector */\r\n FailedToGetFeedbackDialogConnector: {\r\n id: 8193,\r\n source: MsnSettingMenuConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** Failed to get feedback data connector */\r\n FailedToGetFeedbackDataConnector: {\r\n id: 8194,\r\n source: MsnSettingMenuConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** The Msn settings menu failed to load valid config settings */\r\n MsnSettingsMenuFailedToFetchConfig: {\r\n id: 8195,\r\n source: MsnSettingMenuConnectorFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const EdgePageSettingsAppErrors = {\r\n ServiceUiError: {\r\n id: 8196,\r\n source: \"EdgeSettingsProvider.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst ShowFeedConnectorFileName = \"ShowFeed.connector.ts\";\r\n\r\nexport const ShowFeedAppErrors = {\r\n ExpectedDataMissing: {\r\n id: 8198,\r\n source: ShowFeedConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n MissingPageSettings: {\r\n id: 8199,\r\n source: ShowFeedConnectorFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst InfopaneSourceFile = \"Infopane.connector.ts\";\r\nexport const InfopaneErrors = {\r\n InitializeError: {\r\n id: 8201,\r\n source: InfopaneSourceFile,\r\n severity,\r\n pb\r\n },\r\n InvalidConfig: {\r\n id: 8202,\r\n source: InfopaneSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const FeedbackLinkAppErrors = {\r\n /** The Feedback link failed to load valid config settings */\r\n FeedbackLinkFailedToFetchConfig: {\r\n id: 8210,\r\n source: \"FeedbackLink.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n /** Failed to get feedback dialog connector */\r\n FailedToGetFeedbackDialogConnector: {\r\n id: 8211,\r\n source: \"FeedbackLink.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n /** Failed to get feedback data connector */\r\n FailedToGetFeedbackDataConnector: {\r\n id: 8212,\r\n source: \"FeedbackLink.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const FeedbackDialogAppErrors = {\r\n /** Failed to get feedback data connector */\r\n FailedToGetFeedbackDataConnector: {\r\n id: 8213,\r\n source: \"FeedbackDialog.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst OneFooterConnectorFileName = \"OneFooter.connector.ts\";\r\nexport const OneFooterErrors = {\r\n InvalidConfig: {\r\n id: 8220,\r\n source: OneFooterConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** Failed to get feedback data connector */\r\n FailedToGetFeedbackDataConnector: {\r\n id: 8221,\r\n source: OneFooterConnectorFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const PoweredByLegendAppErrors = {\r\n /** The PoweredBy legend failed to load expected config settings */\r\n PoweredByLegendInvalidConfig: {\r\n id: 8230,\r\n source: \"PoweredByLegend.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst EdgeHeaderConnectorFileName = \"EdgeHeader.connector.ts\";\r\n\r\nexport const EdgeHeaderAppErrors = {\r\n /** The BingImageData Connector was not loaded */\r\n BingImageDataConnectorNotLoaded: {\r\n id: 8240,\r\n source: EdgeHeaderConnectorFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst MicrosoftNewsPageConnectorFileName = \"MicrosoftNewsPage.connector.ts\";\r\n\r\nexport const MicrosoftNewsPageAppErrors = {\r\n /** The BingImageData Connector was not loaded */\r\n BingImageDataConnectorNotLoaded: {\r\n id: 8241,\r\n source: MicrosoftNewsPageConnectorFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst WindowsPageConnectorFileName = \"WindowsPage.connector.ts\";\r\n\r\nexport const WindowsPageAppErrors = {\r\n /** The BingImageData Connector was not loaded */\r\n BingImageDataConnectorNotLoaded: {\r\n id: 8242,\r\n source: WindowsPageConnectorFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst TabbedInfopaneSourceFile = \"TabbedInfopane.connector.ts\";\r\nexport const TabbedInfopaneErrors = {\r\n InitializeError: {\r\n id: 8250,\r\n source: TabbedInfopaneSourceFile,\r\n severity,\r\n pb\r\n },\r\n InvalidConfig: {\r\n id: 8251,\r\n source: TabbedInfopaneSourceFile,\r\n severity,\r\n pb\r\n },\r\n ChildLoadError: {\r\n id: 8252,\r\n source: TabbedInfopaneSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const MeControlAppErrors = {\r\n /** The SSO call failed to return valid SSO sign-in information. */\r\n SSOFailedError: {\r\n id: 8260,\r\n source: \"MeControl.tsx\",\r\n severity,\r\n pb\r\n },\r\n /** The Me Control failed to load */\r\n MeControlLoadFailedError: {\r\n id: 8261,\r\n source: \"MeControl.tsx\",\r\n severity: Severity.HighImpact,\r\n pb\r\n }\r\n};\r\n\r\nconst TabbedInfopaneTabPreviewSourceFile = \"TabbedInfopaneTabPreview.connector.ts\";\r\nexport const TabbedInfopaneTabPreviewErrors = {\r\n InitError: {\r\n id: 8270,\r\n source: TabbedInfopaneTabPreviewSourceFile,\r\n severity,\r\n pb\r\n },\r\n InvalidConfig: {\r\n id: 8271,\r\n source: TabbedInfopaneTabPreviewSourceFile,\r\n severity,\r\n pb\r\n },\r\n LoadError: {\r\n id: 8272,\r\n source: TabbedInfopaneTabPreviewSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const HeaderNavigationLogoAppErrors = {\r\n MegaMenuDataError: {\r\n id: 8280,\r\n source: \"HeaderNavigationLogoConnector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst pageClicksTrackerFileName = \"pageClicksTracker.ts\";\r\nexport const PageClickTrackerErrors = {\r\n InvalidResponse: {\r\n id: 8290,\r\n severity: Severity.NoAlert,\r\n source: pageClicksTrackerFileName,\r\n pb\r\n },\r\n FetchFailure: {\r\n id: 8291,\r\n severity: Severity.NoAlert,\r\n source: pageClicksTrackerFileName,\r\n pb\r\n }\r\n};\r\n\r\nconst TargetingSystemSourceFile = \"TargetingSystem.ts\";\r\nexport const TargetingSystemAppErrors = {\r\n GeneralError: {\r\n id: 8310,\r\n source: TargetingSystemSourceFile,\r\n severity,\r\n pb\r\n },\r\n TopLevelDataMissing: {\r\n id: 8311,\r\n source: TargetingSystemSourceFile,\r\n severity,\r\n pb\r\n },\r\n TrackingDataUPSMissing: {\r\n id: 8312,\r\n source: TargetingSystemSourceFile,\r\n severity,\r\n pb\r\n },\r\n AppEnvironmentValuesMissing: {\r\n id: 8313,\r\n source: TargetingSystemSourceFile,\r\n severity,\r\n pb\r\n },\r\n CallingOneServiceFailed: {\r\n id: 8314,\r\n source: TargetingSystemSourceFile,\r\n severity,\r\n pb\r\n },\r\n CallingUPSServiceFailed: {\r\n id: 8315,\r\n source: TargetingSystemSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst CoachmarkSourceFile = \"Coachmark.connector.ts\";\r\nconst CoachmarkTSX = \"Coachmark.tsx\";\r\nconst CoachmarkCTA = \"Coachmark.cta.ts\";\r\nexport const CoachmarkAppErrors = {\r\n GeneralError: {\r\n id: 8320,\r\n source: CoachmarkTSX,\r\n severity,\r\n pb\r\n },\r\n NotPlaceable: {\r\n id: 8321,\r\n source: CoachmarkTSX,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n NotFoundComponent: {\r\n id: 8322,\r\n source: CoachmarkSourceFile,\r\n severity,\r\n pb\r\n },\r\n CoachmarkDataConnectorUndefined: {\r\n id: 8323,\r\n source: CoachmarkSourceFile,\r\n severity,\r\n pb\r\n },\r\n InvalidCTAType: {\r\n id: 8324,\r\n source: CoachmarkCTA,\r\n severity,\r\n pb\r\n },\r\n CTATypeNotDefined: {\r\n id: 8325,\r\n source: CoachmarkCTA,\r\n severity,\r\n pb\r\n },\r\n ConfigDataUndefined: {\r\n id: 8326,\r\n source: CoachmarkSourceFile,\r\n severity,\r\n pb\r\n },\r\n FailedToFetchConfigData: {\r\n id: 8327,\r\n source: CoachmarkSourceFile,\r\n severity,\r\n pb\r\n },\r\n ExceptionFetchingConfigData: {\r\n id: 8328,\r\n source: CoachmarkSourceFile,\r\n severity,\r\n pb\r\n },\r\n EventNotDefined: {\r\n id: 8329,\r\n source: CoachmarkCTA,\r\n severity,\r\n pb\r\n },\r\n CoachmarkStateNotDefined: {\r\n id: 8330,\r\n source: CoachmarkCTA,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst CoachmarkDataConnectorSourceFile = \"CoachmarkData.connector.ts\";\r\nconst CoachmarkPayloadSourceFile = \"CoachmarkPayload.ts\";\r\nconst IrisHandlerSourceFile = \"IrisHandler.ts\";\r\nexport const CoachmarkDataAppErrors = {\r\n InvalidCoachmarkMessage: {\r\n id: 8331,\r\n source: CoachmarkPayloadSourceFile,\r\n severity,\r\n pb\r\n },\r\n IrisDataConnectorUndefined: {\r\n id: 8332,\r\n source: IrisHandlerSourceFile,\r\n severity,\r\n pb\r\n },\r\n ErrorFoundForSurface: {\r\n id: 8334,\r\n source: IrisHandlerSourceFile,\r\n severity,\r\n pb\r\n },\r\n TelemetryInfoUndefined: {\r\n id: 8335,\r\n source: CoachmarkDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n EventTypeUndefined: {\r\n id: 8336,\r\n source: CoachmarkDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n IrisActionUndefined: {\r\n id: 8337,\r\n source: CoachmarkDataConnectorSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst AppTraceFile = \"AppTrace\";\r\nexport const AppTraceErrors = {\r\n /** Error for when app trace upload fails */\r\n UploadError: {\r\n id: 8350,\r\n source: AppTraceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst SpotlightPreviewSourceFile = \"SpotlightPreview.connector.ts\";\r\n\r\nexport const SpotlightPreviewAppErrors = {\r\n ErrorWhileFetchingSpotlightPreviewCardInfo: {\r\n id: 8401,\r\n source: SpotlightPreviewSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n NoServiceContextMetadata: {\r\n id: 8402,\r\n source: SpotlightPreviewSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst SpotlightSourceFile = \"Spotlight.connector.ts\";\r\nexport const SpotlightErrors = {\r\n UnknownError: {\r\n id: 8500,\r\n source: SpotlightSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n ContentFetchError: {\r\n id: 8501,\r\n source: SpotlightSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n PartnerFetchFail: {\r\n id: 8502,\r\n source: \"PartnerService.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const CommentsErrors: { [key: string]: AppError } = {\r\n NoPost: {\r\n id: 8510,\r\n source: \"Comments.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const CardActionErrors = {\r\n /** Error catch in base CardAction experience container */\r\n CardActionBaseExperienceError: {\r\n id: 8600,\r\n source: \"CardAction.tsx\",\r\n severity,\r\n pb\r\n },\r\n /** Post action failed (Like/Dislike) */\r\n CardActionPostActionError: {\r\n id: 8601,\r\n source: \"CarActionServiceClient.tsx\",\r\n severity,\r\n pb\r\n },\r\n /** Delete action failed (Unlike/Undislike) */\r\n CardActionDeleteActionError: {\r\n id: 8602,\r\n source: \"CardActionServiceClient.tsx\",\r\n severity,\r\n pb\r\n },\r\n /** Get action failed (GetPublisherDetails) */\r\n CardActionGetActionError: {\r\n id: 8603,\r\n source: \"CardActionServiceClient.tsx\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst ContentRelatedSourceFile = \"ContentRelated.connector.ts\";\r\nexport const ContentRelatedErrors = {\r\n /**\r\n * Missing source Id error\r\n */\r\n MissingSourceIdError: {\r\n id: 8700,\r\n source: ContentRelatedSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Invalid sourceIdError\r\n */\r\n InvalidSourceIdError: {\r\n id: 8701,\r\n source: ContentRelatedSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Related contents feed fetch error\r\n */\r\n ContentRelatedFeedFetchError: {\r\n id: 8702,\r\n source: ContentRelatedSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst CookieConsentBannerHelper = \"MsccCookieConsentHelper.ts\";\r\nexport const CookieConsentBannerHelperErrors = {\r\n FailedToParseStaticsUrls: {\r\n id: 8810,\r\n source: CookieConsentBannerHelper,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n ScriptsNotFound: {\r\n id: 8811,\r\n source: CookieConsentBannerHelper,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n StyleSheetsNotFound: {\r\n id: 8812,\r\n source: CookieConsentBannerHelper,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n FailedToMountScript: {\r\n id: 8813,\r\n source: CookieConsentBannerHelper,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n FailedToMountStyleSheet: {\r\n id: 8814,\r\n source: CookieConsentBannerHelper,\r\n severity: Severity.HighImpact,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents IFrame related errors */\r\nconst IFrameSourceFile = \"IFrame.tsx\";\r\nexport const IFrameErrors = {\r\n /** Message recieved by event listener not from expected origin */\r\n IFrameUnallowedOriginMessage: {\r\n id: 8820,\r\n source: IFrameSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const RightRailCarouselAppErrors = {\r\n NoChildrenExperienceFoundError: {\r\n id: 8830,\r\n source: \"RightRailCarousel.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst Cookies = \"Cookies.ts\";\r\nexport const CookieRelatedErrors = {\r\n SharedStateConnectorNull: {\r\n id: 8840,\r\n source: Cookies,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const BreakingNewsErrors = {\r\n /** Error fetching Breaking News content */\r\n ContentFetchError: {\r\n id: 8901,\r\n source: \"BreakingNews.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n /** Error fetching Blowout content */\r\n BlowoutDocumentFetchError: {\r\n id: 8902,\r\n source: \"BreakingNews.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const BlowoutErrors = {\r\n /** Error fetching Blowout content */\r\n ContentFetchError: {\r\n id: 8921,\r\n source: \"Blowout.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const OverlayErrors: { [name: string]: AppError } = {\r\n /** Error loading experience */\r\n LoadExperienceError: {\r\n id: 8941,\r\n source: \"Overlay.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const ViewsCommonAppErrors = {\r\n /** Invalid intra article component metadata passed. */\r\n InvalidIntraArticleDataError: {\r\n id: 9001,\r\n source: \"IntraArticleHelper.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch from data api. */\r\n DataFetchError: {\r\n id: 9002,\r\n source: \"ViewsServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Invalid content markup encountered. */\r\n InvalidDocumentContentError: {\r\n id: 9003,\r\n source: \"ViewsUtility.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load views paddle data from data api. */\r\n ViewsPaddleDataLoadError: {\r\n id: 9004,\r\n source: \"ViewsPaddle.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Error during app initialization for views page experience. */\r\n ViewsErrorPage: {\r\n id: 9005,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Error during mapping provider data for views content header experience */\r\n ProviderMapperError: {\r\n id: 9006,\r\n source: \"ViewContentHeader.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const LegacySharingToolbarAppErrors = {\r\n /** Failed to invoke legacy sharing toolbar. */\r\n LegacySharingToolbarInvokeError: {\r\n id: 9100,\r\n source: \"SharingHelper.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load sharing toolbar. */\r\n SharingToolbarLoadError: {\r\n id: 9101,\r\n source: \"LegacySharingToolbar.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Invalid source content id passed in. */\r\n InvalidContentIdError: {\r\n id: 9102,\r\n source: \"LegacySharingToolbar.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents ContentActionsToolbar experience related errors */\r\nconst ContentActionsToolbarConnectorSourceFile = \"ContentActionToolbar.connector.ts\";\r\nconst ContentActionsToolbarSourceFile = \"ContentActionToolbar.tsx\";\r\nconst ContentActionsToolbarServiceClientSourceFile = \"ContentActionToolbarServiceClient.tsx\";\r\nexport const ContentActionsToolbarAppErrors = {\r\n /** Failed to load sharing toolbar - 9120 */\r\n ContentActionsSharingToolbarLoadError: {\r\n id: 9120,\r\n source: ContentActionsToolbarConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Error fetching article data - 9121 */\r\n ContentActionsArticleDatafetchError: {\r\n id: 9121,\r\n source: ContentActionsToolbarConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Base Experience error - 9122 */\r\n ContentActionsBaseExperienceError: {\r\n id: 9122,\r\n source: ContentActionsToolbarSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Get content views action failed (getContentViewsRequest) - 9123 */\r\n ContentActionsGetDocumentDataError: {\r\n id: 9123,\r\n source: ContentActionsToolbarServiceClientSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Get content status action failed (getContentStatusRequest) - 9124 */\r\n ContentActionsGetContentStatusActionError: {\r\n id: 9124,\r\n source: ContentActionsToolbarServiceClientSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Delete action failed (Unlike/Undislike) - 9125 */\r\n ContentActionsDeleteActionError: {\r\n id: 9125,\r\n source: ContentActionsToolbarServiceClientSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Post action failed (Like/Dislike) - 9126 */\r\n ContentActionsPostActionError: {\r\n id: 9126,\r\n source: ContentActionsToolbarServiceClientSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Prime hybrid error loading the experience - 9127 */\r\n ContentActionsExperienceLoadError: {\r\n id: 9127,\r\n source: ContentActionsToolbarSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Missing vert/horiz placeholder to flip toolbar - 9128 */\r\n ContentActionsFlipToolbarError: {\r\n id: 9128,\r\n source: ContentActionsToolbarSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Failed fetching contentStatus - 9129 */\r\n ContentActionsContentStatusFetchError: {\r\n id: 9129,\r\n source: ContentActionsToolbarServiceClientSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /** Failed fetching contentPreview - 9130 */\r\n ContentActionsContentPreviewFetchError: {\r\n id: 9130,\r\n source: ContentActionsToolbarServiceClientSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\nexport const ContentSharingToolbarAppErrors = {\r\n ContentSharingToolbarInitializationError: {\r\n id: 9150,\r\n source: \"ContentSharingToolbar.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const ContentProviderAppErrors = {\r\n /** Invalid source article/gallery id passed in. */\r\n InvalidSourceIdError: {\r\n id: 9200,\r\n source: \"ContentProvider.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch provider details. */\r\n ProviderDetailsFetchError: {\r\n id: 9201,\r\n source: \"ContentProvider.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch provider feed. */\r\n ProviderFeedFetchError: {\r\n id: 9202,\r\n source: \"ContentProvider.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Invalid layout template passed in. */\r\n InvalidLayoutTemplate: {\r\n id: 9203,\r\n source: \"ContentProvider.templates.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** ApplicationCache related messages */\r\nconst refreshHeadDataFile = \"Appcache/RefreshHeadData.ts\";\r\nconst edgeAppCacheHelperFile = \"Appcache/EdgeApplicationCacheHelper.ts\";\r\n\r\nexport const ApplicationCacheMessages = {\r\n FailedToFetchHeadData: {\r\n id: 9310,\r\n source: refreshHeadDataFile,\r\n severity,\r\n pb\r\n },\r\n CatastrophicFailedToFetchHeadData: {\r\n id: 9311,\r\n source: refreshHeadDataFile,\r\n severity,\r\n pb\r\n },\r\n StaleActivityIdEncountered: {\r\n id: 9312,\r\n source: refreshHeadDataFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /**\r\n * The current DOM that is in AppCache doesn't match what should be getting served\r\n * to the user due to the existence of the ntps cookie that defines what the locale should be.\r\n * In this case, we must bypass AppCache to get the proper DOM from PCS.\r\n */\r\n LocaleMismatch: {\r\n id: 9313,\r\n source: edgeAppCacheHelperFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n /**\r\n * Our checks determining we need to bypass appcache for the user are failing\r\n * to detect that the appcache refresh has succeeded. We've tried, for the current page view, to\r\n * bypass without any success.\r\n */\r\n RapidAppcacheForcedRefreshes: {\r\n id: 9314,\r\n source: edgeAppCacheHelperFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n FailedToReadFromStorage: {\r\n id: 9315,\r\n source: refreshHeadDataFile,\r\n severity,\r\n pb\r\n },\r\n FailedToWriteToStorage: {\r\n id: 9316,\r\n source: refreshHeadDataFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst MsRewardsConnectorSourceFile = \"MsRewards.connector.ts\";\r\nexport const MsRewardsAppErrors = {\r\n RewardsDataConnectorUndefined: {\r\n id: 9400,\r\n source: MsRewardsConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n CategoryKeyOrAppTypeUndefined: {\r\n id: 9401,\r\n source: MsRewardsConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n FailedToFetchCoachmarkUXConfig: {\r\n id: 9402,\r\n source: MsRewardsConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n ConfigDataUndefined: {\r\n id: 9403,\r\n source: MsRewardsConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n FailedToFetchConfigData: {\r\n id: 9404,\r\n source: MsRewardsConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n ExceptionFetchingConfigData: {\r\n id: 9405,\r\n source: MsRewardsConnectorSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst RewardsDataConnectorSourceFile = \"RewardsData.connector.ts\";\r\nconst RewardsPayloadSourceFile = \"RewardsPayload.ts\";\r\nconst RewardsServiceClientSourceFile = \"RewardsServiceClient.ts\";\r\nexport const RewardsDataAppErrors = {\r\n InvalidCreative: {\r\n id: 9420,\r\n source: RewardsPayloadSourceFile,\r\n severity,\r\n pb\r\n },\r\n IrisDataConnectorUndefined: {\r\n id: 9421,\r\n source: IrisHandlerSourceFile,\r\n severity,\r\n pb\r\n },\r\n ErrorFoundForSurface: {\r\n id: 9423,\r\n source: IrisHandlerSourceFile,\r\n severity,\r\n pb\r\n },\r\n CoachmarkDataConnectorUndefined: {\r\n id: 9424,\r\n source: RewardsDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n ErrorFetchingUserProfile: {\r\n id: 9425,\r\n source: RewardsServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ExceptionFetchingUserProfile: {\r\n id: 9426,\r\n source: RewardsServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ExceptionReportingRewardActivity: {\r\n id: 9427,\r\n source: RewardsServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n BadRequestReportingRewardActivity: {\r\n id: 9428,\r\n source: RewardsServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n OfferIdNotDefined: {\r\n id: 9429,\r\n source: RewardsDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n ActionNameNotDefined: {\r\n id: 9430,\r\n source: RewardsDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n InvalidParameters: {\r\n id: 9431,\r\n source: RewardsServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n UnknownErrorsReportingRewardActivity: {\r\n id: 9432,\r\n source: RewardsServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n UnknownErrorOccurred: {\r\n id: 9433,\r\n source: RewardsServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n MaxRetryReachedForUpdatingRewardsPoints: {\r\n id: 9434,\r\n source: RewardsDataConnectorSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst ViewsGallerySourceFile = \"ViewsGallery.connector.ts\";\r\nexport const ViewsGalleryAppErrors = {\r\n /** Invalid gallery id passed. */\r\n InvalidGalleryIdError: {\r\n id: 10001,\r\n source: ViewsGallerySourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load gallery data. */\r\n GalleryDataLoadError: {\r\n id: 10010,\r\n source: ViewsGallerySourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load images. */\r\n GalleryImagesLoadError: {\r\n id: 10020,\r\n source: ViewsGallerySourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst SlideShowConnectorFile = \"SlideShow.connector.ts\";\r\nconst SlideShowCarouselFile = \"SlideShowCarousel.tsx\";\r\nexport const SlideShowAppErrors = {\r\n /** Invalid slideshow id passed. */\r\n InvalidSlideShowIdError: {\r\n id: 10100,\r\n source: SlideShowConnectorFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load slideshow data. */\r\n SlideShowDataLoadError: {\r\n id: 10110,\r\n source: SlideShowConnectorFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load images. */\r\n SlideShowImagesLoadError: {\r\n id: 10120,\r\n source: SlideShowConnectorFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to ads refresh. */\r\n SlideShowAdsRefreshError: {\r\n id: 10130,\r\n source: SlideShowCarouselFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load image. */\r\n SlideShowImageLoadFailed: {\r\n id: 10135,\r\n source: SlideShowCarouselFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const VideoListAppErrors = {\r\n /** Failed to load the video list data. */\r\n VideoListDataLoadError: {\r\n id: 11001,\r\n source: \"VideoList.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst VideoContentSourceFile = \"VideoContent.connector.ts\";\r\nexport const VideoContentAppErrors = {\r\n /** Failed to load the video content data. */\r\n InvalidResponseFromVideoContentResponseJson: {\r\n id: 11101,\r\n source: VideoContentSourceFile,\r\n severity\r\n },\r\n /** Failed to fetch the video content data from server. */\r\n ErrorWhileFetchingContentPreviewContent: {\r\n id: 11102,\r\n source: VideoContentSourceFile,\r\n severity\r\n }\r\n};\r\n\r\nconst ViewsArticleSourceFile = \"ViewsArticle.connector.ts\";\r\nexport const ViewsArticleAppErrors = {\r\n /** Invalid article id passed. */\r\n InvalidArticleIdError: {\r\n id: 12001,\r\n source: ViewsArticleSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load article data. */\r\n ArticleDataLoadError: {\r\n id: 12002,\r\n source: ViewsArticleSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load intra-article component. */\r\n IntraArticleComponentLoadError: {\r\n id: 12003,\r\n source: ViewsArticleSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to invoke inline gallery experience. */\r\n InlineGalleryInvokeError: {\r\n id: 12004,\r\n source: ViewsArticleSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const InterestsSearchAppErrors = {\r\n /** Received non 200 from OneService */\r\n ErrorResponseFromOneService: {\r\n id: 13000,\r\n source: \"InterestsSearchServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n /** Received a response from 200 but didn't have expected structure */\r\n ErrorResponseFromOneServiceIsInvalid: {\r\n id: 13001,\r\n source: \"InterestsSearchServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n /**\r\n * When building the XFeed URL for one of the suggestion items,\r\n * we weren't able to build a valid URL\r\n */\r\n InvalidUrlFoundForElement: {\r\n id: 13002,\r\n source: \"InterestsSearch.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n /**\r\n * When building the XFeed URL for one of the suggestion items,\r\n * we weren't able to build a valid URL\r\n */\r\n SelectedItemNotFoundInSuggestions: {\r\n id: 13003,\r\n source: \"InterestsSearch.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n /**\r\n * When building the XFeed URL for one of the suggestion items,\r\n * we weren't able to build a valid URL\r\n */\r\n SelectedItemIsInvalid: {\r\n id: 13004,\r\n source: \"InterestsSearch.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst InterestsConnectorFileName = \"Interests.connector.ts\";\r\nconst TopicCacheFileName = \"TopicCache.ts\";\r\nconst XfeedConnectorFileName = \"Xfeed.connector.ts\";\r\nexport const InterestsAppErrors = {\r\n /** We could not retrieve the list of Topics from OneService */\r\n InterestsRetrieveTopicsError: {\r\n id: 13100,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not retrieve the user's list of Followed Topics from OneService */\r\n InterestsRetrieveFollowedTopicsError: {\r\n id: 13101,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not retrieve the user's list of Muted Publishers from OneService */\r\n InterestsRetrieveMutedPublishersError: {\r\n id: 13102,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not UnMute a Muted Publisher */\r\n InterestsUnMutePublisherError: {\r\n id: 13103,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not follow a new interests topic */\r\n InterestsFollowTopicError: {\r\n id: 13104,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not unfollow an interests topic */\r\n InterestsUnfollowTopicError: {\r\n id: 13105,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** TopicState should not be undefined */\r\n InterestsTopicStateUndefined: {\r\n id: 13106,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** Topics should have rendered */\r\n InterestsShouldHaveRendered: {\r\n id: 13107,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** Could not retrieve a specific topic */\r\n InterestsRetrieveTopicError: {\r\n id: 13108,\r\n source: XfeedConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not retrieve the user's list of Saved Stories from OneService */\r\n InterestsRetrieveSavedStoriesError: {\r\n id: 13109,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** Saved stories config is invalid */\r\n InterestsSavedStoriesInvalidConfigError: {\r\n id: 13110,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not load saved stories children */\r\n InterestsSavedStoriesChildLoadError: {\r\n id: 13111,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** OneService response for saved stories had invalid json */\r\n InterestsSavedStoriesInvalidJsonError: {\r\n id: 13112,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** OneService response for saved stories had invalid list of response */\r\n InterestsSavedStoriesInvalidListError: {\r\n id: 13113,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not retrieve the user's list of Recommended Topics from OneService */\r\n InterestsRetrieveRecommendedTopicsError: {\r\n id: 13114,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** Topic Data Connector is not defined */\r\n UndefinedTopicDataConnector: {\r\n id: 13115,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not retrieve the user's list of Read Stories from OneService */\r\n InterestsRetrieveReadStoriesError: {\r\n id: 13116,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** Read stories config is invalid */\r\n InterestsReadStoriesInvalidConfigError: {\r\n id: 13117,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** We could not load Read stories children */\r\n InterestsReadStoriesChildLoadError: {\r\n id: 13118,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** OneService response for Read stories had invalid json */\r\n InterestsReadStoriesInvalidJsonError: {\r\n id: 13119,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** OneService response for Read stories had invalid list of response */\r\n InterestsReadStoriesInvalidListError: {\r\n id: 13120,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** OneService failed resetting user default set of interests */\r\n FailedRestoringDefaultTopicsError: {\r\n id: 13121,\r\n source: InterestsConnectorFileName,\r\n severity,\r\n pb\r\n },\r\n /** Failed opening topics IndexedDB connection */\r\n TopicsFailedIndexedDBConnection: {\r\n id: 13122,\r\n source: TopicCacheFileName,\r\n severity,\r\n pb\r\n },\r\n /** Failed getting topics indexedDB */\r\n TopicsFailedGettingIndexedDB: {\r\n id: 13123,\r\n source: TopicCacheFileName,\r\n severity,\r\n pb\r\n },\r\n /** Failed updating topics indexedDB */\r\n TopicsFailedUpdatingIndexedDB: {\r\n id: 13124,\r\n source: TopicCacheFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** {ComponentConnector} base app errors */\r\nexport const ComponentConnectorAppErrors = {\r\n\r\n /** Duplicate child experience instance found */\r\n DuplicateChildInstanceFound: {\r\n id: 14000,\r\n source: \"ComponentConnector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load bundle */\r\n BundleLoadError: {\r\n id: 14001,\r\n source: \"ComponentConnector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** ChildConfigInfoList is null */\r\n ChildConfigInfoListNull: {\r\n id: 14002,\r\n source: \"ComponentConnector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Merge List start position must be greater than 0 */\r\n ListStartPositionInvalid: {\r\n id: 14003,\r\n source: \"ComponentConnector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to delay load child bundle */\r\n ChildDelayLoadError: {\r\n id: 14004,\r\n source: \"ComponentConnector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Milestone dependency failed to resolve and timeout triggered */\r\n ExperienceDependencyTimeout: {\r\n id: 14005,\r\n source: \"ComponentConnector.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\n/** App errors for {ExperienceLoader} */\r\nexport const ExperienceLoaderAppErrors = {\r\n /** Logged when neither the config type nor config HREF was provided to the loader */\r\n InsufficientLoadArgs: {\r\n id: 14100,\r\n source: \"ExperienceLoader.ts\",\r\n severity: Severity.HighImpact,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents SearchHistoryCommon related App errors */\r\nconst SearchHistoryCommonSourceFile = \"SearchHistoryCommon.tsx\";\r\nexport const SearchHistoryCommonAppErrors = {\r\n /** Failed to parse search history response */\r\n ResponseParsingFailed: {\r\n id: 15000,\r\n source: SearchHistoryCommonSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Search history service call failed */\r\n ServiceCallFailed: {\r\n id: 15001,\r\n source: SearchHistoryCommonSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to render search history */\r\n RenderFailed: {\r\n id: 15002,\r\n source: SearchHistoryCommonSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Search history api response not received within configured time */\r\n Timeout: {\r\n id: 15003,\r\n source: SearchHistoryCommonSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Search history api call unauthorized */\r\n Unauthorized: {\r\n id: 15004,\r\n source: SearchHistoryCommonSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Search history api call forbidden */\r\n Forbidden: {\r\n id: 15005,\r\n source: SearchHistoryCommonSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Search history api not able to find recent search associated with this request */\r\n NotFound: {\r\n id: 15006,\r\n source: SearchHistoryCommonSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Search history api response not received within configured time but wait for searchHistoryFetchPromise to be completed */\r\n TimeoutDetail: {\r\n id: 15007,\r\n source: SearchHistoryCommonSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents a Search related error */\r\nexport const SearchError: AppError = {\r\n id: 15100,\r\n source: \"SearchBox.tsx\",\r\n severity: Severity.HighImpact,\r\n pb\r\n};\r\n\r\n/** Represents missing form code/parameters related App errors */\r\nexport const MissingFormCode: AppError = {\r\n id: 15101,\r\n source: \"SearchBoxCommon.connector.ts\",\r\n severity,\r\n pb\r\n};\r\n\r\n/** Represents RecommendedSearch related App errors */\r\nconst RecommendedSearchSourceFile = \"RecommendedSearchDataService.ts\";\r\nexport const RecommendedSearchErrors = {\r\n /** Warning for failed to parse recommended search response */\r\n ResponseParsingFailed: {\r\n id: 15200,\r\n source: RecommendedSearchSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** warning for recommended search service returned invalid Json response */\r\n InvalidJsonResponse: {\r\n id: 15201,\r\n source: RecommendedSearchSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** Warning for recommended search service call failed */\r\n ServiceCallFailed: {\r\n id: 15202,\r\n source: RecommendedSearchSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** Failed to render recommended searches */\r\n RenderFailed: {\r\n id: 15203,\r\n source: RecommendedSearchSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Warning for recommended search api response not received within configured time */\r\n Timeout: {\r\n id: 15204,\r\n source: RecommendedSearchSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** recommended search back fill failed to fetch content from CMS */\r\n ContentFetchError: {\r\n id: 15205,\r\n source: RecommendedSearchSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Trending Now related app errors */\r\nconst TrendingNowSourceFile = \"TrendingNow.connector.ts\";\r\nexport const TrendingNowErrors = {\r\n /** Failed to fetch Trending now content from CMS */\r\n ContentFetchError: {\r\n id: 15250,\r\n source: TrendingNowSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to fetch child experience config */\r\n FailedToFetchConfig: {\r\n id: 15251,\r\n source: TrendingNowSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load child experience */\r\n FailedToLoadChildExperience: {\r\n id: 15252,\r\n source: TrendingNowSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst PollsCardConnectorSourceFile = \"PollsCard.connector.ts\";\r\nexport const PollsCardAppErrors = {\r\n /**\r\n * Failed to fetch polls list\r\n */\r\n PollsListFetchError: {\r\n id: 18000,\r\n source: PollsCardConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Failed to fetch poll data\r\n */\r\n PollDataFetchError: {\r\n id: 18001,\r\n source: PollsCardConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * No data{questions} for poll\r\n */\r\n PollsCardInvalidPoll: {\r\n id: 18002,\r\n source: PollsCardConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Invalid Poll Quiz\r\n */\r\n PollsCardInvalidQuizPoll: {\r\n id: 18003,\r\n source: PollsCardConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * PollsVoteError\r\n */\r\n PollsCardVoteError: {\r\n id: 18004,\r\n source: PollsCardConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * PollsMapStateToPropsError\r\n */\r\n PollsCardMapStateToPropsError: {\r\n id: 18005,\r\n source: PollsCardConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * PollsUnknownError\r\n */\r\n PollsUnknownError: {\r\n id: 18006,\r\n source: PollsCardConnectorSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const EdgeNextAppErrors = {\r\n /**\r\n * Error during app initialization for EdgeNext page experience.\r\n */\r\n EdgeNextErrorPage: {\r\n id: 19000,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Error fetching the APP_ANON cookie on EdgeNext page load */\r\n ErrorFetchingAppAnonCookie: {\r\n id: 19001,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Tracking errors where we ended up showing the local ntp page on bundle syntax errors.\r\n */\r\n EdgeNextLocalNTPPageShownSyntaxErrors: {\r\n id: 19002,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Tracking errors where we ended up showing the local ntp page on bundle failures.\r\n */\r\n EdgeNextLocalNTPPageShownBundleFailureErrors: {\r\n id: 19003,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Tracking errors where we ended up showing the local ntp page on page exception.\r\n */\r\n EdgeNextLocalNTPPageShownPageExceptionError: {\r\n id: 19004,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Tracking errors where we ended up showing the local ntp page on page exception.\r\n */\r\n EdgeNextLocalNTPPageShownJSSMismatchExceptionError: {\r\n id: 19005,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Tracking errors where we ended up reloading the NTP page on jss mismatch exception.\r\n */\r\n EdgeNextPageReloadedPageExceptionError: {\r\n id: 19010,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Tracking errors where we ended up reloading the NTP page on jss mismatch exception.\r\n */\r\n EdgeNextPageReloadedJSSMismatchExceptionError: {\r\n id: 19011,\r\n source: \"PersistRenderCache.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst AdRefreshSourceFile = \"AdsRefresh.ts\";\r\nconst ApnWrapperSourceFile = \"AppnexusWrapper.ts\";\r\nconst DisplayAdsAdsDetectionSourceFile = \"AdsDetection.ts\";\r\nconst DisplayAdsConnectorSourceFile = \"DisplayAds.connector.ts\";\r\nconst DisplayAdsManagerConnectorSourceFile = \"DisplayAdsManager.connector.ts\";\r\nconst NativeAdConnectorSourceFile = \"NativeAd.connector.ts\";\r\nconst OathWrapperSourceFile = \"OathAdsWrapper.ts\";\r\nconst PlacementManagerConnectorSourceFile = \"PlacementManager.connector.ts\";\r\nconst PlacementManagerCookieSyncSourceFile = \"PlacementManagerCookieSync.ts\";\r\nconst PlacementManagerCMSServiceSourceFile = \"PlacementManagerCMSService.ts\";\r\nconst NativeAdClientConnectorSourceFile = \"NativeAdClient.connector.ts\";\r\nconst PartnerScriptLoaderFile = \"PartnerScriptLoader.ts\";\r\nconst NativeAdBeaconSourceFile = \"Beacon.ts\";\r\n\r\nexport const MonetizationAppErrors = {\r\n /** Failed to load Placement Manager. */\r\n PlacementManagerLoadError: {\r\n id: 20000,\r\n source: NativeAdConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load arrangement position on native ad experience. */\r\n ArrangementPositionLoadError: {\r\n id: 20001,\r\n source: NativeAdConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get CMS Content. */\r\n GetCMSContentError: {\r\n id: 20002,\r\n source: PlacementManagerCMSServiceSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get SAM RTB Response. */\r\n GetSAMRTBResponseError: {\r\n id: 20003,\r\n source: PlacementManagerConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load MediaNet End Of Article Block. */\r\n MediaNetEOABError: {\r\n id: 20005,\r\n source: \"medianetNativeAdOnArticle.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** Invalid promo module config */\r\n InvalidPromoModuleConfig: {\r\n id: 20006,\r\n source: NativeAdConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to download cookie sync external script. */\r\n CookieSyncDownloadExternalScriptError: {\r\n id: 20007,\r\n source: PlacementManagerCookieSyncSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Missing cookie sync external script. */\r\n CookieSyncMissingExternalScriptUrl: {\r\n id: 20008,\r\n source: PlacementManagerCookieSyncSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Cookie sync timeout. */\r\n CookieSyncTimeout: {\r\n id: 20009,\r\n source: PlacementManagerCookieSyncSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Cookie sync partner script error */\r\n CookieSyncPartnerScriptError: {\r\n id: 20010,\r\n source: PlacementManagerCookieSyncSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Cookie pixel sync partner download error */\r\n CookieSyncPixelPartnerDownloadError: {\r\n id: 20011,\r\n source: PlacementManagerCookieSyncSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load cms or backfill native ad. */\r\n CMSOrBackfillNativeAdLoadError: {\r\n id: 20012,\r\n source: NativeAdConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Missing required property on placement manager config */\r\n MissingRequiredPropertyPlacementManagerConfig: {\r\n id: 20014,\r\n source: PlacementManagerConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Missing page type target scope. */\r\n NativeAdTargetScopeError: {\r\n id: 20016,\r\n source: NativeAdConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** River video ad partner error. */\r\n RiverVideoAdPartnerError: {\r\n id: 20017,\r\n source: PartnerScriptLoaderFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** JsTracker ad partner script load error. */\r\n JsTrackerPartnerScriptLoadError: {\r\n id: 20018,\r\n source: NativeAdBeaconSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Viglink load error. */\r\n ViglinkError: {\r\n id: 20019,\r\n source: PartnerScriptLoaderFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Missing topic id for stripe native ad */\r\n MissingTopicId: {\r\n id: 20020,\r\n source: NativeAdConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Topic id not found for stripe native ad */\r\n TopicIdNotFound: {\r\n id: 20021,\r\n source: NativeAdConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to get SAM RTB Response. This App error doesn't trigger alert */\r\n GetSAMRTBResponseErrorNoAlert: {\r\n id: 20022,\r\n source: PlacementManagerConnectorSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** Failed to load Oath JS */\r\n DisplayAdsOathLoadError: {\r\n id: 20050,\r\n source: OathWrapperSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Failed to load AppNexus JS */\r\n DisplayAdsApnLoadError: {\r\n id: 20051,\r\n source: ApnWrapperSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** AppNexus Provider was empty */\r\n DisplayAdsApnEmptyProvider: {\r\n id: 20052,\r\n source: ApnWrapperSourceFile,\r\n severity: Severity.Alert\r\n },\r\n\r\n /** Ads Detection no initialized properly Provider was empty */\r\n DisplayAdsAdsDetectionNotInit: {\r\n id: 20053,\r\n source: DisplayAdsAdsDetectionSourceFile,\r\n severity: Severity.Alert,\r\n pb\r\n },\r\n\r\n /** Failed to load Moat JS */\r\n DisplayAdsMoatLoadError: {\r\n id: 20054,\r\n source: DisplayAdsManagerConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Display ad objects were not available for refresh */\r\n DisplayAdsNoAdObjects: {\r\n id: 20055,\r\n source: AdRefreshSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** There was a problem in encoding CMS provider ID from base 62 to 32 */\r\n DisplayAdsProviderIdEncode: {\r\n id: 20056,\r\n source: DisplayAdsConnectorSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const TaboolaRiverAppErrors = {\r\n /** Failed to fetch taboola river data. */\r\n TaboolaRiverFetchError: {\r\n id: 20100,\r\n source: \"TaboolaRiver.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst PCSPageHTMLFile = \"PCS-Page.cshtml\";\r\nexport const CoreLibAppErrors = {\r\n /** Deprecated composition layout config in use */\r\n DeprecatedCompositionLayoutUsed: {\r\n id: 20200,\r\n source: \"LayoutBase.inspector.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** Deprecated composition layout config in use */\r\n InvalidColumnInGridConfig: {\r\n id: 20201,\r\n source: \"GridBase.inspector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Error during loading of page bundles.\r\n */\r\n ErrorLoadingBundle: {\r\n id: 20202,\r\n source: PCSPageHTMLFile,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n\r\n /**\r\n * Generic JS exceptions.\r\n */\r\n GenericJSException: {\r\n id: 20203,\r\n source: PCSPageHTMLFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Missing localStorage exception\r\n */\r\n LocalStorageDoesntExist: {\r\n id: 20204,\r\n source: \"WebStorage.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /**\r\n * Missing sessionStorage exception\r\n */\r\n SessionStorageDoesntExist: {\r\n id: 20205,\r\n source: \"WebStorage.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Authenticatedfetch related App errors */\r\nconst AuthenticatedFetchSourceFile = \"AuthenticatedFetch.ts\";\r\nexport const AuthenticatedFetchErrors = {\r\n ErrorCodeReceived: {\r\n id: 20302,\r\n source: AuthenticatedFetchSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n CallFailed: {\r\n id: 20303,\r\n source: AuthenticatedFetchSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst resolverSourceFile = \"resolver.ts\";\r\nexport const ResolverAppErrors = {\r\n /**\r\n * IndexedDb write failed in resolver.\r\n */\r\n IndexedDbWriteFailed: {\r\n id: 22010,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * IndexedDb read failed in resolver.\r\n */\r\n IndexedDbReadFailed: {\r\n id: 22011,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Config Service Resolver fetch failed.\r\n */\r\n CrsFetchFailed: {\r\n id: 22012,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Config Service Resolver was enabled but we still went to Assets to getConfig and merge configs at client (classic resolver).\r\n */\r\n ReceivedConfigFromCdnAsCrsFetchFailed: {\r\n id: 22013,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Exception In GetConfig function.\r\n */\r\n GetConfigException: {\r\n id: 22014,\r\n source: resolverSourceFile,\r\n severity: Severity.HighImpact,\r\n pb\r\n },\r\n\r\n /**\r\n * IndexedDb bulk read failed in resolver.\r\n */\r\n IndexedDbBulkReadFailed: {\r\n id: 22015,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * IndexedDb failed to remove cached config\r\n */\r\n IndexedDbFailedToRemoveCachedConfig: {\r\n id: 22016,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * IndexedDb failed to clear all configs\r\n */\r\n IndexedDbFailedToClearAllCachedConfigs: {\r\n id: 22017,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Render cache is purged due to changes in config\r\n */\r\n RenderCachePurgedDueToChangesInConfig: {\r\n id: 22018,\r\n source: resolverSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /**\r\n * Render cache failed purge even though config changes were detected.\r\n */\r\n FailedToPurgeRenderCache: {\r\n id: 22019,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Failed to refresh config cache\r\n */\r\n RefreshConfigCacheFailed: {\r\n id: 22020,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Failed to initialize indexedDb\r\n */\r\n IndexedDbInitFailed: {\r\n id: 22021,\r\n source: resolverSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Different cache busting identifier\r\n */\r\n DifferentCbid: {\r\n id: 22022,\r\n source: resolverSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\nexport const HubAppErrors = {\r\n /**\r\n * Error during app initialization for hub page experience.\r\n */\r\n HubErrorPage: {\r\n id: 22100,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst EdgePageFileName = \"Edge/page.ts\";\r\n\r\n/** Edge App Type errors. */\r\nexport const EdgeAppErrors = {\r\n ErrorFetchingChildCookie: {\r\n id: 23000,\r\n source: EdgePageFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Error during app initialization for Edge page experience.\r\n */\r\n EdgeErrorPage: {\r\n id: 23001,\r\n source: EdgePageFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Error fetching the APP_ANON cookie on Edge page load\r\n */\r\n ErrorFetchingAppAnonCookie: {\r\n id: 23002,\r\n source: EdgePageFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const BingCardsAppErrors = {\r\n BingCardGetHotelAnswersError: {\r\n id: 24001,\r\n source: \"BingCardsServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n BingCardGetHotelErrorFromService: {\r\n id: 24002,\r\n source: \"BingCardsServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n BingCardGetAnswersError: {\r\n id: 24003,\r\n source: \"BingCardsExperience.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n BingCardInvalidEntityType: {\r\n id: 24004,\r\n source: \"BingCardsExperience.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n BingCardErrorOut: {\r\n id: 24005,\r\n source: \"BingCardsExperience.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const BingAnswersAppErrors = {\r\n UnknownError: {\r\n id: 24101,\r\n source: \"BingAnswers.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n FailedToLoadData: {\r\n id: 24102,\r\n source: \"BingAnswers.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n NoCardsContentType: {\r\n id: 24103,\r\n source: \"BingAnswers.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n NoCardsRelated: {\r\n id: 24104,\r\n source: \"BingAnswers.connector.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\nconst BingShoppingShopCardServiceClientSourceFile =\r\n \"bing-shopping/ShopCardServiceClient.ts\";\r\n\r\nexport const BingShoppingShopCardError = {\r\n ShopCardServiceFetchError: {\r\n id: 24200,\r\n source: BingShoppingShopCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShopCardServiceFetchInvalidResponse: {\r\n id: 24201,\r\n source: BingShoppingShopCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShopCardServiceEmptyPersonalizedResponse: {\r\n id: 24202,\r\n source: BingShoppingShopCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShopCardServiceInvalidPersonalizedResponse: {\r\n id: 24203,\r\n source: BingShoppingShopCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShopCardServiceEmptyTrendingResponse: {\r\n id: 24204,\r\n source: BingShoppingShopCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShopCardServiceInvalidTrendingResponse: {\r\n id: 24205,\r\n source: BingShoppingShopCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst BingShoppingLifestyleCardServiceClientSourceFile =\r\n \"bing-shopping-lifestyle-card/BingShoppingLifestyleCardServiceClient.ts\";\r\n\r\nconst BingShoppingLifestyleCardCdnServiceClientSourceFile =\r\n \"bing-shopping-lifestyle-card/BingShoppingLifestyleCardCdnServiceClient.ts\";\r\n\r\nconst BingShoppingLifestyleAutosuggestServiceClientSourceFile =\r\n \"bing-shopping-lifestyle-card/BingShoppingLifestyleAutosuggestServiceClient.ts\";\r\n\r\nconst BingShoppingLifestyleConnectorSourceFile =\r\n \"bing-shopping-lifestyle-card/BingShoppingLifestyleCard.connector.ts\";\r\nexport const BingShoppingLifestyleCardError = {\r\n // Lifestyle Shopcard service Errors\r\n LifestyleShopCardServiceFetchError: {\r\n id: 24300,\r\n source: BingShoppingLifestyleCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopCardServiceFetchInvalidResponse: {\r\n id: 24301,\r\n source: BingShoppingLifestyleCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopCardServiceEmptyResponse: {\r\n id: 24302,\r\n source: BingShoppingLifestyleCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopCardServiceInvalidResponse: {\r\n id: 24303,\r\n source: BingShoppingLifestyleCardServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n // Lifestyle Shopcard Cdn service Errors\r\n LifestyleShopCardCdnServiceFetchError: {\r\n id: 24304,\r\n source: BingShoppingLifestyleCardCdnServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopCardCdnServiceFetchInvalidResponse: {\r\n id: 24305,\r\n source: BingShoppingLifestyleCardCdnServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopCardCdnServiceInvalidResponse: {\r\n id: 24306,\r\n source: BingShoppingLifestyleCardCdnServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n // Lifestyle Autosuggest service Errors\r\n LifestyleShopAutosuggestServiceFetchError: {\r\n id: 24310,\r\n source: BingShoppingLifestyleAutosuggestServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopAutosuggestServiceFetchInvalidResponse: {\r\n id: 24311,\r\n source: BingShoppingLifestyleAutosuggestServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopAutosuggestServiceEmptyResponse: {\r\n id: 24312,\r\n source: BingShoppingLifestyleAutosuggestServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopAutosuggestServiceInvalidResponse: {\r\n id: 24313,\r\n source: BingShoppingLifestyleAutosuggestServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n LifestyleShopAutosuggestInvalidSuggestionUrl: {\r\n id: 24314,\r\n source: BingShoppingLifestyleConnectorSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst ShoppingSmartListServiceClientSourceFile =\r\n \"shopping-smart-list/ShoppingSmartListServiceClient.ts\";\r\n\r\nconst ShoppingSmartListConnectorSourceFile =\r\n \"shopping-smart-list/ShoppingSmartList.connector.ts\";\r\n\r\nexport const ShoppingSmartListError = {\r\n ShoppingSmartListServiceEmptyResponse: {\r\n id: 24400,\r\n source: ShoppingSmartListServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShoppingSmartListServiceFetchError: {\r\n id: 24401,\r\n source: ShoppingSmartListServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShoppingSmartListServiceInvalidResponse: {\r\n id: 24402,\r\n source: ShoppingSmartListServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShoppingSmartListServiceMissingRequiredFields: {\r\n id: 24403,\r\n source: ShoppingSmartListServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n ShoppingSmartListChromiumApiConfigDataFetchFailure: {\r\n id: 24404,\r\n source: ShoppingSmartListConnectorSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst BingMiniShoppingServiceClientSourceFile =\r\n \"bing-mini-shopping/BingMiniShoppingServiceClient.ts\";\r\n\r\nexport const BingMiniShoppingError = {\r\n // Bing-MiniShopping service Errors\r\n BingMiniShoppingServiceFetchError: {\r\n id: 24500,\r\n source: BingMiniShoppingServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n BingMiniShoppingServiceEmptyResponse: {\r\n id: 24501,\r\n source: BingMiniShoppingServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n BingMiniShoppingServiceInvalidResponse: {\r\n id: 24502,\r\n source: BingMiniShoppingServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n BingMiniShoppingServiceInsufficientDealsItems: {\r\n id: 24503,\r\n source: BingMiniShoppingServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n BingMiniShoppingServiceInsufficientActiveDealsItems: {\r\n id: 24504,\r\n source: BingMiniShoppingServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n BingMiniShoppingServiceInsufficientTrendingItems: {\r\n id: 24505,\r\n source: BingMiniShoppingServiceClientSourceFile,\r\n severity,\r\n pb\r\n },\r\n BingMiniShoppingServiceInsufficientTrendingCategories: {\r\n id: 24506,\r\n source: BingMiniShoppingServiceClientSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const PageSettingsDataConnectorAppErrors = {\r\n PageSettingsGetInitialState: {\r\n id: 26001,\r\n source: \"PageSettingsData.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst MicrosoftNewsEntryPointFileName = \"MicrosoftNews.connector.ts\";\r\nexport const MicrosoftNewsEntryPointAppErrors = {\r\n /**\r\n * Error during app initialization for MicrosoftNews page experience.\r\n */\r\n MicrosoftNewsErrorPage: {\r\n id: 27000,\r\n source: MicrosoftNewsEntryPointFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const NavigationDataConnectorAppErrors = {\r\n /**\r\n * Error while trying to fetch the Navigation Items\r\n */\r\n NavigationDataGetNavigationItems: {\r\n id: 28000,\r\n source: \"NavigationData.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n NavigationDataIndexedDbInitializationFailed: {\r\n id: 28001,\r\n source: \"NavigationData.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n NavigationDataIndexedDbWriteFailed: {\r\n id: 28002,\r\n source: \"NavigationData.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n NavigationDataIndexedDbBulkReadFailed: {\r\n id: 28003,\r\n source: \"NavigationData.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const CategoryDataConnectorAppErrors = {\r\n /**\r\n * Error while to get the category details\r\n */\r\n CategoryDataGetCategoryDetail: {\r\n id: 28100,\r\n source: \"CategoryData.connector.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n CategoryDataIndexedDbInitializationFailed: {\r\n id: 28101,\r\n source: \"CategoryData.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n CategoryDataIndexedDbWriteFailed: {\r\n id: 28102,\r\n source: \"CategoryData.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n CategoryDataIndexedDbBulkReadFailed: {\r\n id: 28103,\r\n source: \"CategoryData.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/**\r\n * App reporting messages related to OneService Content Data Connector\r\n */\r\nexport const OneServiceContentDataConnector = {\r\n /**\r\n * Message sent when a feature tries to update\r\n * the cache bypass value but the connector was not initialized\r\n * for the page\r\n */\r\n FailedToUpdateBypassValueConnectorNotInitialized: {\r\n id: 28200,\r\n source: \"OneServiceContentHelper.ts\",\r\n severity,\r\n pb\r\n },\r\n /**\r\n * Message sent when a feature tries to update\r\n * the cache bypass value but the connector was not initialized\r\n * for the page\r\n */\r\n FailedToGetBypassValueConnectorNotInitialized: {\r\n id: 28201,\r\n source: \"OneServiceContentHelper.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/**\r\n * App reporting messages related to Stripe Experience\r\n */\r\nexport const StripeAppErrors = {\r\n InvalidConfig: {\r\n id: 28300,\r\n source: \"Stripe.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const NotificationBellErrors = {\r\n /** Failed to fetch the notification bell data content */\r\n DataFetchError: {\r\n id: 28400,\r\n source: \"NotificationBell.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n JsonParseError: {\r\n id: 28401,\r\n source: \"LocalStorageSettings.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n NewsItemDataFetchError: {\r\n id: 28402,\r\n source: \"NotificationBellServiceClient.ts\",\r\n severity,\r\n pb\r\n },\r\n MalformedNewsItemResponseError: {\r\n id: 28403,\r\n source: \"NotificationBellServiceClient.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Layout Preference Data Connector related App errors */\r\nconst LayoutPreferenceDataSourceFile = \"LayoutPreferenceData.connector.ts\";\r\nexport const LayoutPreferenceDataErrors = {\r\n /** Failed to retrieve Layout Preference Data */\r\n LayoutPreferenceDataGetFailed: {\r\n id: 28500,\r\n source: LayoutPreferenceDataSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/**\r\n * App reporting messages related to StripeView Experience\r\n */\r\nexport const StripeViewAppErrors = {\r\n InvalidConfig: {\r\n id: 28600,\r\n source: \"StripeView.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n ChildLoadError: {\r\n id: 28601,\r\n source: \"StripeView.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Sentiment Line Chart Connector related app errors */\r\nconst SentimentLineChartSourceFile = \"SentimentLineChart.connector.ts\";\r\nexport const SentimentLineChartErrors = {\r\n ContentFetchError: {\r\n id: 28700,\r\n source: SentimentLineChartSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Sentiment Result Card Connector related app errors */\r\nconst SentimentResultCardSourceFile = \"SentimentResultCard.connector.ts\";\r\nexport const SentimentResultCardErrors = {\r\n ContentFetchError: {\r\n id: 28710,\r\n source: SentimentResultCardSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Sentiment Map Connector related app errors */\r\nconst SentimentMapSourceFile = \"SentimentMap.connector.ts\";\r\nexport const SentimentMapErrors = {\r\n ContentFetchError: {\r\n id: 28720,\r\n source: SentimentMapSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Election Results Card Connector related app errors */\r\nconst ElectionResultsCardFile = \"ElectionResultsCard.connector.ts\";\r\nexport const ElectionResultsCardErrors = {\r\n ContentFetchError: {\r\n id: 28730,\r\n source: ElectionResultsCardFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Sentiment Bar chart Connector related app errors */\r\nconst SentimentBarChartSourceFile = \"SentimentBarChart.connector.ts\";\r\nexport const SentimentBarChartErrors = {\r\n ContentFetchError: {\r\n id: 28740,\r\n source: SentimentBarChartSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Elction Result Map connector App errors */\r\nconst ElectionResultMapConnectorSourceFile = \"ElectionResultMap.connector.ts\";\r\nexport const ElectionResultMapConnectorErrors = {\r\n UnknownError: {\r\n id: 28750,\r\n source: ElectionResultMapConnectorSourceFile,\r\n severity\r\n },\r\n\r\n ContentFetchError: {\r\n id: 28751,\r\n source: ElectionResultMapConnectorSourceFile,\r\n severity\r\n }\r\n};\r\n\r\n/** Elction Result Map Inspector App errors */\r\nconst ElectionResultMapInspectorSourceFile = \"ElectionResultMap.inspector.ts\";\r\nexport const ElectionResultMapInspectorErrors = {\r\n EmptyResultSummaryError: {\r\n id: 28752,\r\n source: ElectionResultMapInspectorSourceFile,\r\n severity\r\n }\r\n};\r\n/** Elction Result Map App errors */\r\nconst ElectionResultMapSourceFile = \"ElectionResultMap.tsx\";\r\nexport const ElectionResultMapErrors = {\r\n FetchAndUpdateElectionDataError: {\r\n id: 28753,\r\n source: ElectionResultMapSourceFile,\r\n severity\r\n }\r\n};\r\n\r\n/** Election Editor's Note App errors */\r\nexport const ElectionEditorsNoteErrors = {\r\n\r\n ContentFetchError: {\r\n id: 28760,\r\n source: \"ElectionEditorsNote.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents Election Delegate Counter related app errors */\r\nexport const ElectionDelegateCounterErrors = {\r\n ContentFetchError: {\r\n id: 28770,\r\n source: \"ElectionDelegateCounter.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/**\r\n * @deprecated ElectionRegionNews experience is deprecated, replaced by TopicsHub experience for this scenario.\r\n */\r\nexport const ElectionRegionNewsAppErrors = {\r\n TopicByNameFetchFailed: {\r\n id: 28780,\r\n source: \"ElectionRegionNews.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/**\r\n * Topics hub - failed to fetch topic by name\r\n */\r\nexport const TopicByNameFetchFailed: AppError = {\r\n id: 28790,\r\n source: \"TopicsHub.connector.ts\",\r\n severity,\r\n pb\r\n};\r\n\r\n/**\r\n * App reporting messages related to Partner Widget Experience\r\n */\r\nexport const PartnerWidgetAppErrors = {\r\n /** default breakpoint settings missing */\r\n DefaultBreakpointSettingsMissing: {\r\n id: 28801,\r\n source: \"PartnerWidget.connector.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n /** non whitelisted source url */\r\n NonWhitelistedSourceUrl: {\r\n id: 28802,\r\n source: \"PartnerWidget.connector.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents RecommendedSearch related App errors */\r\nconst RecommendedTopicsSourceFile = \"RecommendedTopics.connector.ts\";\r\nexport const RecommendedTopicsErrors = {\r\n /** Failed to connect to the Topics Data Connector */\r\n TopicsDataConnectorFailed: {\r\n id: 28901,\r\n source: RecommendedTopicsSourceFile,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Topic Clicked was null */\r\n InvalidTopicClick: {\r\n id: 28902,\r\n source: RecommendedTopicsSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst webWorkerSource = \"Web worker\";\r\nconst webWorkerUtility = \"WebWorkerUtility.ts\";\r\nexport const WebWorkerErrors = {\r\n /** Web worker script load error (404 response) */\r\n FileNotFound: {\r\n id: 29000,\r\n source: webWorkerUtility,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Web worker runtime error, fired by web worker on unhandled exceptions */\r\n RuntimeError: {\r\n id: 29001,\r\n source: webWorkerSource,\r\n severity,\r\n pb\r\n },\r\n\r\n /** Web worker message timeout */\r\n MessageTimeout: {\r\n id: 29002,\r\n source: webWorkerUtility,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /** Web worker handled errors. These are the errors received as messages from web worker */\r\n HandledError: {\r\n id: 29003,\r\n source: webWorkerSource,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst EntryPointConnector = \"EntryPointConnector\";\r\nexport const EntryPointConnectorEvents = {\r\n /**\r\n * Indicates that for some reason the page never received all the perf markers it was waiting for\r\n * resulting in the timeout logic kicking in.\r\n */\r\n WaitForAllPerfMarkersTimeoutInvoked: {\r\n id: 29100,\r\n source: EntryPointConnector,\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\nconst FirstPartyEntryPointFileName = \"FirstParty.connector.ts\";\r\nconst FirstPartyPageFileName = \"page.ts\";\r\nexport const FirstPartyEntryPointAppErrors = {\r\n /**\r\n * Error during app initialization for FirstParty page experience.\r\n */\r\n FirstPartyErrorPage: {\r\n id: 29200,\r\n source: FirstPartyEntryPointFileName,\r\n severity,\r\n pb\r\n },\r\n /** Error during initial SSO call, either the call failed of the user was not signed in */\r\n SSOFailedError: {\r\n id: 29250,\r\n source: FirstPartyPageFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst HomePageEntryPointFileName = \"HomePage.connector.ts\";\r\nconst HomePageFileName = \"page.ts\";\r\nexport const HomePageEntryPointAppErrors = {\r\n /**\r\n * Error during app initialization for Home page experience.\r\n */\r\n HomePageErrorPage: {\r\n id: 29300,\r\n source: HomePageEntryPointFileName,\r\n severity,\r\n pb\r\n },\r\n /** Error during initial SSO call, either the call failed of the user was not signed in */\r\n SSOFailedError: {\r\n id: 29301,\r\n source: HomePageFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst WindowsEntryPointFileName = \"Windows.connector.ts\";\r\nconst WindowsPageFileName = \"page.ts\";\r\n\r\nexport const WindowsEntryPointAppErrors = {\r\n /**\r\n * Error during app initialization for Windows page experience.\r\n */\r\n WindowsErrorPage: {\r\n id: 29400,\r\n source: WindowsEntryPointFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Tracking errors where we ended up showing the local ntp page on page exception.\r\n */\r\n WindowsPageShownPageExceptionError: {\r\n id: 29401,\r\n source: WindowsPageFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Tracking errors where we ended up reloading the NTP page on jss mismatch exception.\r\n */\r\n WindowsPageReloadedPageExceptionError: {\r\n id: 29402,\r\n source: WindowsPageFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Error fetching the APP_ANON cookie on Windows page load\r\n */\r\n ErrorFetchingAppAnonCookie: {\r\n id: 29403,\r\n source: WindowsPageFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst WeatherAppEntrySourceFile = \"Weather.connector.ts\";\r\n/** Error during 'weather' app initialization. */\r\nexport const WeatherEntryPointAppError: AppError = {\r\n id: 29500,\r\n source: WeatherAppEntrySourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\n/** Fetch no data when search for locations from msn api */\r\nexport const WeatherLocationSearchNullError: AppError = {\r\n id: 29501,\r\n source: WeatherDataConnectorSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\n/** Exception to fetch search for locations from msn api */\r\nexport const WeatherLocationSearchFetchError: AppError = {\r\n id: 29502,\r\n source: WeatherDataConnectorSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\nconst WindowsShellPage = \"page.ts\";\r\n/**\r\n * Windows Shell Page level exception was thrown\r\n */\r\nexport const WindowsShellPageError: AppError = {\r\n\r\n id: 29600,\r\n source: WindowsShellPage,\r\n severity,\r\n pb\r\n};\r\n\r\n/**\r\n * Windows Shell Page Error fetching the APP_ANON cookie\r\n */\r\nexport const WindowsShellPageErrorFetchingAppAnonCookie: AppError = {\r\n id: 29601,\r\n source: WindowsShellPage,\r\n severity,\r\n pb\r\n};\r\n\r\n/** Auth related app messages (errors|warnings) */\r\nexport const AuthenticationAppMessages = {\r\n AuthRefreshBlockedError: {\r\n id: 33000,\r\n source: \"\",\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n /**\r\n * Error fetching the APP_ANON cookie\r\n */\r\n ErrorFetchingAppAnonCookie: {\r\n id: 33001,\r\n source: \"\",\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Error during app initialization for migration consent\r\n */\r\n EstablishMigrationConsent: {\r\n id: 33010,\r\n source: \"EstablishMigrationConsent.ts\",\r\n severity,\r\n pb\r\n },\r\n\r\n MigrationConsentServiceClient: {\r\n id: 33011,\r\n source: \"MigrationConsentServiceClient.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Server side rendering error */\r\nexport const RenderServerError: AppError = {\r\n id: 34000,\r\n source: \"service-render-app.ts\",\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\nconst irisArcCallerFileName = \"Iris.arcCaller.ts\";\r\nconst irisArcParserFileName = \"Iris.arcParser.ts\";\r\nconst irisMasterFileName = \"Iris.master.ts\";\r\n\r\n/** Generic Unknown related to the Iris system. Investigate. */\r\nexport const AppError_IrisUnknown_35000: AppError = {\r\n id: 35000,\r\n source: \"Iris\",\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n/** The query parameters presented to the arc caller were found to be invalid. */\r\nexport const AppError_InvalidQParams_35001: AppError = {\r\n id: 35001,\r\n source: irisArcCallerFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_ArcCallFailed_35002: AppError = {\r\n id: 35002,\r\n source: irisArcCallerFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_ArcResponseNotOk_35003: AppError = {\r\n id: 35003,\r\n source: irisArcCallerFileName,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\nexport const AppError_ArcResponseUnparsable_35004: AppError = {\r\n id: 35004,\r\n source: irisArcCallerFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_MissingAppEnv_35005: AppError = {\r\n id: 35005,\r\n source: irisArcCallerFileName,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\nexport const AppError_UnknownIrisErrorFound_35006: AppError = {\r\n id: 35006,\r\n source: irisArcParserFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_TimeoutIrisErrorFound_35007: AppError = {\r\n id: 35007,\r\n source: irisArcParserFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_TemplateIrisErrorFound_35008: AppError = {\r\n id: 35008,\r\n source: irisArcParserFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_ClientErrorIrisErrorFound_35009: AppError = {\r\n id: 35009,\r\n source: irisArcParserFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_DSourceIrisErrorFound_35010: AppError = {\r\n id: 35010,\r\n source: irisArcParserFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_ActionCallFailure_35011: AppError = {\r\n id: 35011,\r\n source: irisArcCallerFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_ActionFetchFailure_35012: AppError = {\r\n id: 35012,\r\n source: irisArcCallerFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_ActionResponseFailure_35013: AppError = {\r\n id: 35013,\r\n source: irisArcCallerFileName,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\nexport const AppError_UncaughtErrorDetected_35014: AppError = {\r\n id: 35014,\r\n source: irisMasterFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_UnconvertableCreative_35015: AppError = {\r\n id: 35015,\r\n source: irisMasterFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_InvalidResponseFormat_35016: AppError = {\r\n id: 35016,\r\n source: irisMasterFileName,\r\n severity,\r\n pb\r\n};\r\nexport const AppError_TimeoutErrorDiscovered_35017: AppError = {\r\n id: 35017,\r\n source: irisMasterFileName,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\nexport const AppError_UnparsableSingleResponseJSON_35018: AppError = {\r\n id: 35018,\r\n source: irisMasterFileName,\r\n severity,\r\n pb\r\n};\r\n\r\n/** Represents Iris data connector related App errors */\r\nconst IrisDataConnectorSourceFile = \"IrisData.connector.ts\";\r\nconst SubscriberValidatorSourceFile = \"SubscriberValidator.ts\";\r\nconst IrisPersistentStorageUtilityFile = \"IrisPersistentStorageUtility.ts\";\r\n\r\nexport const IrisDataConnectorErrors = {\r\n SubscriberNotFound: {\r\n id: 35117,\r\n source: SubscriberValidatorSourceFile,\r\n severity,\r\n pb\r\n },\r\n CreativeCountNegativeOrZero: {\r\n id: 35118,\r\n source: IrisDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n ErrorFetchingSurfaceInfo: {\r\n id: 35119,\r\n source: IrisDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n ErrorFoundForSurface: {\r\n id: 35120,\r\n source: IrisDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n SubscriberNotFoundInIrisPlacementDictionary: {\r\n id: 35121,\r\n source: IrisDataConnectorSourceFile,\r\n severity,\r\n pb\r\n },\r\n ConfigDataUndefined: {\r\n id: 35122,\r\n source: IrisPersistentStorageUtilityFile,\r\n severity,\r\n pb\r\n },\r\n FailedToFetchConfigData: {\r\n id: 35123,\r\n source: IrisPersistentStorageUtilityFile,\r\n severity,\r\n pb\r\n },\r\n ExceptionFetchingConfigData: {\r\n id: 35124,\r\n source: IrisPersistentStorageUtilityFile,\r\n severity,\r\n pb\r\n },\r\n FailedToReadNurturingAcceptedFlag: {\r\n id: 35125,\r\n source: IrisPersistentStorageUtilityFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents AccessTokens related App errors */\r\nconst AccessTokensSourceFile = \"AadAuthHelper.ts\";\r\nconst PivotContentErrorPlaceholderFile = \"AadErrorPlaceholder.tsx\";\r\nexport const EdgeChromiumAPIsNotAvailable: AppError = {\r\n id: 35200,\r\n source: AccessTokensSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\nexport const AcquireAccessTokenFailed: AppError = {\r\n id: 35201,\r\n source: AccessTokensSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\nexport const AcquireAccessTokenFailedForPivotContent: AppError = {\r\n id: 35202,\r\n source: PivotContentErrorPlaceholderFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/** Represents Render Cache errors*/\r\nconst PersistRenderCacheFile = \"PersistRenderCache.ts\";\r\nexport const RenderCacheErrors = {\r\n JssStyleMismatchWarning: {\r\n id: 35300,\r\n source: PersistRenderCacheFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n\r\n JssStyleCriticalMismatchError: {\r\n id: 35301,\r\n source: PersistRenderCacheFile,\r\n severity: Severity.Alert,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents OcvFeedbackData related App errors */\r\nconst OcvFeedbackDataSourceFile = \"OcvFeedbackData.ts\";\r\nexport const OcvFeedbackDataErrors = {\r\n UndefinedDataNotAvailable: {\r\n id: 35400,\r\n source: OcvFeedbackDataSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nexport const PivotHoverErrors = {\r\n /** Failed to fetch feed summary data for the Pivot Hover list. */\r\n FeedSummaryFetchError: {\r\n id: 35500,\r\n source: \"FeedSummaryFetcher.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst PreloadActionHelpers = \"PreloadActionHelpers.ts\";\r\nexport const PreloadReportingMessages = {\r\n TtvrMissing: {\r\n id: 35600,\r\n source: PreloadActionHelpers,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n TfprMissing: {\r\n id: 35601,\r\n source: PreloadActionHelpers,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n TtvrSearchBoxMissing: {\r\n id: 35602,\r\n source: PreloadActionHelpers,\r\n severity: Severity.NoAlert,\r\n pb\r\n },\r\n TtfSearchBoxMissing: {\r\n id: 35603,\r\n source: PreloadActionHelpers,\r\n severity: Severity.NoAlert,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents push notifications lib App errors */\r\nconst PushNotificationsLibFile = \"PushNotifications.ts\";\r\nexport const PushNotificationsLibErrors = {\r\n FetchKeyError: {\r\n id: 35700,\r\n source: PushNotificationsLibFile,\r\n severity,\r\n pb\r\n },\r\n SubscribeUnsubscribeError: {\r\n id: 35701,\r\n source: PushNotificationsLibFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents content truncation lib App errors */\r\nconst ContentTruncationSourceFile = \"ContentTruncation.ts\";\r\nexport const ContentTruncationErrors = {\r\n OverTruncationError: {\r\n id: 35800,\r\n source: ContentTruncationSourceFile,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\nconst SuperAppEntryPointFileName = \"SuperAppPage.connector.ts\";\r\n\r\nexport const SuperAppEntryPointAppErrors = {\r\n /**\r\n * Super app river is not able to load Error Page.\r\n */\r\n SuperAppErrorPage: {\r\n id: 35901,\r\n source: SuperAppEntryPointFileName,\r\n severity,\r\n pb\r\n },\r\n\r\n /**\r\n * Error fetching the APP_ANON cookie on super app page load\r\n */\r\n ErrorFetchingAppAnonCookie: {\r\n id: 35902,\r\n source: \"page.ts\",\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Error fetching feed with location in Local News experience */\r\nconst LocalNewsFileName = \"LocalNews.connector.ts\";\r\nexport const LocalNewsInterestByLocationFetchFailed: AppError = {\r\n id: 36001,\r\n source: LocalNewsFileName,\r\n severity,\r\n pb\r\n};\r\n\r\nconst OfficeFallbackHandlerFileName = \"OfficeFallbackHandler.ts\";\r\n\r\nexport const OfficeFallbackHandlerAppErrors = {\r\n /**\r\n * Tracking errors where we ended up reloading the office content on jss mismatch exception.\r\n */\r\n OfficeContentReloadedJSSMismatchExceptionError: {\r\n id: 36101,\r\n source: OfficeFallbackHandlerFileName,\r\n severity,\r\n pb\r\n }\r\n};\r\n\r\n/** Represents autos experiences App errors */\r\nconst AutosExperienceConnectorFile = \"AutosCard.connector.ts\";\r\nconst AutosExperienceServiceClientFile = \"AutosServiceClient.ts\";\r\n\r\n/**\r\n * Error while fetching research make models\r\n */\r\nexport const FetchResearchMakeModelDocumentError: AppError = {\r\n id: 36200,\r\n source: AutosExperienceServiceClientFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/**\r\n * Error while fetching Film Strip Document Error\r\n */\r\nexport const FetchFilmStripDocumentError: AppError = {\r\n id: 36201,\r\n source: AutosExperienceServiceClientFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/**\r\n * Error while fetching lead classified cms documents\r\n */\r\nexport const FetchClassifiedLeadCMSDocumentsError: AppError = {\r\n id: 36202,\r\n source: AutosExperienceServiceClientFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/**\r\n * Error while fetching lead classified make models\r\n */\r\nexport const FetchLeadClassifiedMakeModelDocumentError: AppError = {\r\n id: 36203,\r\n source: AutosExperienceServiceClientFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/**\r\n * Error for incorrect tab configuration\r\n */\r\nexport const TabsIncorrectConfiguration: AppError = {\r\n id: 36204,\r\n source: AutosExperienceConnectorFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};\r\n\r\n/** Whole Page Optimization(WPO) App errors */\r\n\r\nconst WpoServiceFileName = \"WpoServiceClient.ts\";\r\n\r\n/**\r\n * WPO service call failure.\r\n */\r\nexport const WpoServiceCallFailure: AppError = {\r\n id: 36301,\r\n source: WpoServiceFileName,\r\n severity,\r\n pb\r\n};\r\n\r\n/**\r\n * Error updating local storage with wpo service call response.\r\n */\r\nexport const WpoFailedToStoreToLocalStorage: AppError = {\r\n id: 36302,\r\n source: WpoServiceFileName,\r\n severity,\r\n pb\r\n};\r\n\r\n/** FlyoutCard App errors */\r\n\r\nconst FlyoutCardFileName = \"FlyoutCard.connector.ts\";\r\n\r\n/**\r\n * Error when fetching feed in FlyoutCard experience\r\n */\r\nexport const FlyoutCardFailedToLoadOneServiceData: AppError = {\r\n id: 36410,\r\n source: FlyoutCardFileName,\r\n severity,\r\n pb\r\n};\r\n\r\n/** Represents a Microsoft Logo related error */\r\nexport const MicrosoftLogoErrors: AppError = {\r\n id: 36420,\r\n source: \"MicrosoftLogo.tsx\",\r\n severity: Severity.HighImpact,\r\n pb\r\n};\r\n\r\n/**\r\n * Clarity Script App Errors\r\n */\r\nconst ClarityScriptLoaderFile = \"ScriptLoader.ts\";\r\n\r\n/**\r\n * Error loading clarity script.\r\n */\r\nexport const LoadScriptError: AppError = {\r\n id: 36500,\r\n source: ClarityScriptLoaderFile,\r\n severity,\r\n pb\r\n};\r\n\r\n/**\r\n * Error starting clarity script.\r\n */\r\nexport const ScriptStartError: AppError = {\r\n id: 36501,\r\n source: ClarityScriptLoaderFile,\r\n severity,\r\n pb\r\n};\r\n\r\n/** 366XX are River OneService App Errors */\r\nexport const EmptyFeedWithFeedId: AppError = {\r\n id: 36600,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n};\r\n\r\nexport const EmptySearchedFeedWithFeedId: AppError = {\r\n id: 36601,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n};\r\n\r\nexport const EmptySearchedFeedWithFeedQuery: AppError = {\r\n id: 36602,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n};\r\n\r\nexport const EmptyKidsModeFeed: AppError = {\r\n id: 36603,\r\n source: OneServiceCardProviderFileName,\r\n severity,\r\n pb\r\n};\r\n\r\n/** 367XX are River App Errors */\r\nexport const FallingBackToSkipStrategy: AppError = {\r\n id: 36700,\r\n source: RiverSourceFile,\r\n severity,\r\n pb\r\n};\r\n\r\nexport const FallingBackToFullHeightStrategy: AppError = {\r\n id: 36701,\r\n source: RiverSourceFile,\r\n severity: Severity.NoAlert,\r\n pb\r\n};","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { KeyValueArray, KeyValuePair, Utility } from \"./Utility\";\r\nimport { findIndex, isArray, isEmpty, isString, trimEnd, trimStart } from \"lodash-es\";\r\n\r\nimport { StringMap } from \"../types\";\r\nimport { getLocationOrigin } from \"@msnews/isomorphic-util\";\r\n\r\nexport namespace UrlUtility {\r\n\r\n /**\r\n * Characters that, if present on a url, will make prime routing misbehave\r\n *\r\n * These are the characters we know cause problems:\r\n * - spaces\r\n * - slashes\r\n * - punctuation: !?.:\r\n * - ampersands\r\n *\r\n * As we don't know all the offending characters, we are just removing every character that is not alphanumeric\r\n */\r\n const primeForbiddenCharacters = /[^A-Za-z0-9]+/g;\r\n\r\n /**\r\n * Parse parameters from the given URL\r\n * @param {string} url - the URL to parse for parameters\r\n * @param {boolean} decodeComponents - flag to indicate whether the query param key and value should be URL decoded\r\n * @returns {KeyValueArray} - the parsed query key/value collection\r\n */\r\n export function getParamsFromUrl(url: string, decodeComponents = false): KeyValueArray {\r\n if (!isString(url)) {\r\n return null;\r\n }\r\n\r\n const queryString: string = (url || \"\").split(\"?\")[1];\r\n return getParams(queryString, decodeComponents);\r\n }\r\n\r\n /**\r\n * Decode the given URL encoded string that may contain plus signs\r\n * @param {string} val - The value to decode.\r\n * @returns {string} - the decoded value\r\n */\r\n function decodeURIComponentWithPlusSign(val: string): string {\r\n val = val.replace(/\\+/g, \" \");\r\n val = decodeURIComponent(val);\r\n return val;\r\n }\r\n\r\n /**\r\n * Encode uri components in a way that won't break prime routing system\r\n * @param uriComponent the uriComponent to be encoded\r\n */\r\n export function encodeURIComponentForPrime(uriComponent: string): string {\r\n return encodeURIComponent(uriComponent.replace(primeForbiddenCharacters, \"-\"));\r\n }\r\n\r\n /**\r\n * Parse parameters from the given query string\r\n * @param {string} queryString - the query string to parse for parameters\r\n * @param {boolean} decodeComponents - flag to indicate whether the query param key and value should be URL decoded\r\n * @returns {KeyValueArray} - the parsed query key/value collection\r\n */\r\n export function getParams(queryString: string, decodeComponents = false): KeyValueArray {\r\n const params: KeyValueArray = [];\r\n // Remove the leading ? if it is present\r\n if (queryString && queryString.startsWith(\"?\")) {\r\n queryString = queryString.substring(1);\r\n }\r\n\r\n if (queryString) {\r\n // remove hash part.\r\n queryString = queryString.split(\"#\")[0];\r\n const queryArray = queryString.split(\"&\");\r\n for (let ndx = 0; ndx < queryArray.length; ndx++) {\r\n const parts = queryArray[ndx].split(\"=\");\r\n let queryKey = parts[0];\r\n let queryValue = parts[1];\r\n\r\n if (decodeComponents) {\r\n queryKey = decodeURIComponentWithPlusSign(queryKey);\r\n if (queryValue) {\r\n queryValue = decodeURIComponentWithPlusSign(queryValue);\r\n }\r\n }\r\n\r\n // Don't allow for duplicate query string parameter keys. Take the last one\r\n const newParam: KeyValuePair = { key: queryKey, value: queryValue };\r\n const existingParam = findIndex(params, (entry) => entry.key === newParam.key);\r\n if (existingParam === -1) {\r\n params.push(newParam);\r\n } else {\r\n params[existingParam] = newParam;\r\n }\r\n }\r\n }\r\n return params;\r\n }\r\n\r\n /**\r\n * Parse specific parameters from the given query string, allowing for multiple item=key:value.\r\n * This function ONLY parses qsp item=[key]:[value]\r\n * Note: Use first given rule for duplicate key!\r\n * @param {string} queryString - the query string to parse for parameters\r\n * @returns {KeyValueArray} - the parsed query key/value collection\r\n */\r\n export function getParamsWithItems(queryString: string): KeyValueArray {\r\n const params: KeyValueArray = [];\r\n\r\n const inputKey = \"item\";\r\n\r\n if (queryString) {\r\n // Remove the leading ? if it is present\r\n if (queryString.startsWith(\"?\")) {\r\n queryString = queryString.substring(1);\r\n }\r\n\r\n // split on the hashes.\r\n queryString = queryString.split(\"#\")[0];\r\n const queryArray = queryString.split(\"&\");\r\n for (let ndx = 0; ndx < queryArray.length; ndx++) {\r\n const parts = queryArray[ndx].split(\"=\");\r\n let queryKey = parts[0];\r\n let queryValue = parts[1];\r\n\r\n // If the query key is inputKey (default: \"item\"), and the query values is key:value, then convert the\r\n // value into the actual key/value\r\n if (queryKey.toLowerCase() === inputKey) {\r\n const queryItems = queryValue.split(\":\");\r\n // Ignore value not in \"key:value\" format\r\n if (queryItems.length === 2) {\r\n queryKey = queryItems[0];\r\n queryValue = queryItems[1];\r\n\r\n // Don't allow for duplicate query string parameter keys. Use first given rule for duplicate key!\r\n const newParam: KeyValuePair = { key: queryKey, value: queryValue };\r\n const existingParam = params.findIndex((entry) => entry.key === newParam.key);\r\n if (existingParam === -1) {\r\n params.push(newParam);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return params;\r\n }\r\n\r\n /**\r\n * Utility method to extract query string param in url.\r\n *\r\n * @export\r\n * @param {string} name - query param name\r\n * @returns {string} - query param value\r\n */\r\n export function getQueryParameterByName(name: string, href: string): string {\r\n\r\n // TODO: exposing this method for accessing a single parameter can be used\r\n // extremely inefficiently (for example if invoked multiple times to get parameters\r\n // from a single URL). Instead we should deprecate this and export getParamsObj\r\n // and use that throughout.\r\n\r\n const value = getParamsObj(href)[name];\r\n return (value !== undefined)\r\n ? value\r\n : null;\r\n }\r\n\r\n /**\r\n * Check if given url string is a valid url.\r\n * Returns true when url string is a valid url, otherwise false.\r\n *\r\n * @export\r\n * @param url {string} - Url string value to check\r\n * @param validateScheme {boolean} - Should scheme validation be forced\r\n * @return {boolean}\r\n */\r\n export function isValidUrl(url: string, validateScheme: boolean): boolean {\r\n return (isString(url) &&\r\n (url.length > 0) &&\r\n (!validateScheme ||\r\n validateScheme && url.indexOf(\"http\") === 0));\r\n }\r\n\r\n /**\r\n * Converts a keyValueArray into a set of query string parameters\r\n *\r\n * @export\r\n * @param {any} - params to be converted\r\n * @return {string}\r\n */\r\n export function keyValueArrayToQueryString(params: KeyValueArray): string {\r\n // Validate we have a nonempty array\r\n if (!isArray(params) || isEmpty(params)) {\r\n return \"\";\r\n }\r\n\r\n // Filter for valid keyValue entries, and then map them into key==value strings\r\n // joined with an &\r\n const queryString: string = params.filter(kv =>\r\n Utility.isKeyValuePair(\r\n kv,\r\n (key) => typeof (key) === \"string\",\r\n (value) => typeof (value) === \"string\"))\r\n .map(kv => kv.key + \"=\" + kv.value)\r\n .join(\"&\");\r\n\r\n return queryString;\r\n }\r\n\r\n /**\r\n * Helper method to parse the given URLs query parameters to a lookup dictionary\r\n * @param url - the URL string with the query params to parse\r\n * @returns The {StringMap} containing the key/value pairs, or empty object.\r\n */\r\n function getParamsObj(url: string): StringMap {\r\n const paramsObj = {};\r\n const paramArray = getParamsFromUrl(url, true);\r\n if (paramArray && paramArray.length) {\r\n paramArray.forEach(keyValuePair =>\r\n paramsObj[keyValuePair.key] = keyValuePair.value);\r\n }\r\n return paramsObj;\r\n }\r\n\r\n /**\r\n * For the given `url`, it appends the `subPath` to it.\r\n * It takes propers care to forward slashes characters\r\n * at the end of `url` and at the start of `subPath` parameters\r\n * @param url a valid url\r\n * @param subPath the path which is appended to `url`\r\n * @returns an URL object which is the `url` appended by `subPath`\r\n */\r\n export function joinSubpathToURL(url: URL, subPath: string): URL {\r\n const href = url.href;\r\n const trimmedEndSlashFromHref = trimEnd(href, \"/\");\r\n const trimmedStartSlashFromSubpath = trimStart(subPath, \"/\");\r\n return new URL(`${trimmedEndSlashFromHref}/${trimmedStartSlashFromSubpath}`);\r\n }\r\n\r\n /**\r\n * Updates a search parameter in the given url to map to a new value\r\n * Does not modify the url if the given search param doesn't exist\r\n * @param url the url to update\r\n * @param key the name of the search param to be updated\r\n * @param value the new value for the given search param\r\n * @returns {URL} the updated URL\r\n */\r\n export function updateSearchParam(url: URL, key: string, value: string): URL {\r\n // Note that the searchParams data member may not be compatible with older browser versions\r\n // see https://caniuse.com/#search=searchparams\r\n if (url && url.searchParams && url.searchParams.get(key)) {\r\n url.searchParams.set(key, value);\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /**\r\n * Appends a search parameter to the given url\r\n * @param url the url to modify\r\n * @param key the name of the search param to be appended\r\n * @param value the new value for the given search param\r\n * @returns {URL} the modified URL\r\n */\r\n export function appendSearchParam(url: URL, key: string, value: string, fallback?: boolean): URL {\r\n if (url) {\r\n if (url.searchParams || fallback) {\r\n url.searchParams.append(key, value);\r\n } else {\r\n // TODO Bug 22390312: [Peregrine] UrlUtility appendSearchParam needs more robust polyfill\r\n url = new URL(url.href + (url.search.indexOf(\"?\") >= 0 ? \"&\" : \"?\") + key + \"=\" + value);\r\n }\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /**\r\n * Returns an absolute URL if a relative on is passed in, or returns the passed in URL if already absolute\r\n * @param partialUrl The relative or absolute URL\r\n * @returns {string} the absolute URL\r\n */\r\n export function getAbsoluteUrl(partialUrl: string): string {\r\n if (partialUrl.indexOf(\"://\") > 0 || partialUrl.indexOf(\"//\") === 0) {\r\n return partialUrl;\r\n } else {\r\n return getLocationOrigin() + partialUrl;\r\n }\r\n }\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\n// Defines constants used in telemetry beacons\r\n\r\nexport default {\r\n // logSamplingRate was configured via %app_error_log_sampling_rate% in Prime. Hardcoding \"0\" here.\r\n logSamplingRate: \"0\",\r\n FireTelemetry: \"fireTelemetryBeacon\",\r\n GET: \"GET\",\r\n POST: \"POST\",\r\n Ctag: \"ctag\",\r\n Comscore: \"scorecard\",\r\n OTF: \"udc\",\r\n Exp: \"EX:\",\r\n ResetIdx: \"resetTelemetryEventIndex\"\r\n};\r\n","// © Microsoft Corporation. All rights reserved.\r\n/// Adds basic dom manipulation functions to an object defined as \"dom\"\r\n\r\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\r\n\r\nconst doc = canUseDOM() ? document : null;\r\nconst otherWhitespaceRegex = /[\\n\\t]/g;\r\nconst trimRegex = /(^\\s+)|(\\s+$)/mg;\r\n\r\n// curly brace needs to be on the return line otherwise build with throw an error\r\nexport default {\r\n attr: function (elem, attr) {\r\n // getAttribute(attr, 2) causes IE to only report correct values for href.\r\n // IE reports href values for IMG tags without an href property\r\n // see http://reference.sitepoint.com/javascript/Element/getAttribute\r\n // see bug #1131443\r\n return elem && (elem.getAttribute ? elem.getAttribute(attr, 2) : elem[attr]) || \"\";\r\n },\r\n name: function (elem) {\r\n return elem && elem.nodeName || \"\";\r\n },\r\n text: function (elem) {\r\n return (elem && (elem.textContent || elem.innerText) || \"\").replace(trimRegex, \"\");\r\n },\r\n children: function (elem) {\r\n return elem && elem.children || [];\r\n },\r\n parent: function (elem) {\r\n return elem && elem.parentNode;\r\n },\r\n getElementsByTagName: function (name) {\r\n return doc ? doc.getElementsByTagName(name) : [];\r\n },\r\n create: function (name) {\r\n return doc ? doc.createElement(name) : null;\r\n },\r\n containsClass: function (element, className) {\r\n /// \r\n /// Looks for the className in element and returns true/false based on result.\r\n /// \r\n /// element - Element where className to be searched for.\r\n /// className - Class name to be looked for.\r\n /// \r\n /// \r\n return element && ((\" \" + (element.className || element.getAttribute(\"class\")) + \" \")\r\n .replace(otherWhitespaceRegex, \" \").indexOf(\" \" + className + \" \") > -1);\r\n },\r\n getTarget: function (event) {\r\n return event && (event.customTarget || event.target || event.srcElement) || doc;\r\n }\r\n};\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * Constants that are used throughout the library\r\n */\r\nexport namespace ConnectorConstants {\r\n /**\r\n * The key within a state JSON document used to store a connectors individual state\r\n */\r\n export const connectorStateKey = \"_@STATE@_\";\r\n\r\n export const renderAction = \"@@connector-view/RENDER\";\r\n\r\n export const dataConnectorMergeInitAction = \"@@data-connector/MERGE-INIT\";\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { canUseDOM, getInnerHeight, getInnerWidth } from \"@msnews/isomorphic-util\";\r\n\r\n// Wraps modern visibility api, as well as defines visibility for elements based on viewbox.\r\n\r\n// a simple deferred promise object that delays execution of callbacks until the owner resolves. (see $.Deferred for jQuery's implementation, this is a subset)\r\nfunction Deferred() {\r\n // the callbacks to execute when resolved\r\n let callbacks = [];\r\n\r\n // the state of the promise. If we have already resolved we execute the delegates immediately.\r\n let isResolved = false;\r\n\r\n // the arguments used to resolve the promise.\r\n let resolvedArgs = null;\r\n\r\n // executes all the callbacks that need to be notified, giving them a ref to the arguments supplied.\r\n function flushCallbacks() {\r\n // we only flush if we are resolved\r\n if (isResolved) {\r\n const errors = [];\r\n\r\n // loop through the callbacks and execute.\r\n for (let index = 0; index < callbacks.length; index++) {\r\n try {\r\n callbacks[index](resolvedArgs);\r\n } catch (e) {\r\n // delay propagation of errors until all callbacks have been notified\r\n errors.push(e);\r\n }\r\n }\r\n\r\n // clear the callbacks array\r\n callbacks = [];\r\n\r\n // throw the error collection if we received any.\r\n if (errors.length) {\r\n throw errors;\r\n }\r\n }\r\n }\r\n\r\n // resolves the promise\r\n function resolve() {\r\n isResolved = true;\r\n resolvedArgs = arguments;\r\n flushCallbacks();\r\n }\r\n\r\n // the promise function\r\n function promise() {\r\n return {\r\n\r\n // the happy path for callbacks\r\n then:\r\n function (callback) {\r\n callbacks.push(callback);\r\n flushCallbacks();\r\n },\r\n\r\n // subscribers listen here for when the promise was denied or resolved.\r\n always:\r\n function () {\r\n return this.then(arguments);\r\n }\r\n };\r\n }\r\n\r\n // lets return our deferred object that.\r\n return {\r\n // the promise object\r\n promise: promise,\r\n // the resolve method.\r\n resolve: resolve\r\n };\r\n}\r\n\r\n// create our visibility deferred\r\n// @ts-ignore\r\nlet visibilityDeferred = new Deferred();\r\n\r\n// initialize the visibility property name\r\nconst visibilityProperty = getHiddenPropertyName();\r\n\r\n// Flag to check if unload event has been triggered\r\n// Page Visibility API removed 'unloaded' visbility state and now reports 'hidden' when browser is being unloaded.This breaks the wasBrowserHiddenAtLeastOnce logic.\r\n// Flag is used to detect & ignore state change if unload event caused the 'hidden' visibilityState.\r\n// Chrome 56 (as of 2/21/2017) has implemented the spec change and would probably land in Edge in the future releases.\r\n// Link to spec - https://w3c.github.io/page-visibility/\r\n\r\nlet isUnloadEventInProgress = false;\r\n\r\nif (canUseDOM() && window.addEventListener) {\r\n window.addEventListener(\"beforeunload\", function () {\r\n isUnloadEventInProgress = true;\r\n });\r\n}\r\n\r\n// flag to indicate if Browser was hidden even once in a page impression\r\nlet wasBrowserHidden = false;\r\n\r\nif (canUseDOM() && visibilityProperty) {\r\n // this preserves our vendor prefix\r\n const evtname = visibilityProperty.replace(/[H|h]idden/, \"\") + \"visibilitychange\";\r\n document.addEventListener(evtname, visibilityChanged);\r\n}\r\n\r\n// call it immediately to prime the deferred if we are already visibile.\r\nvisibilityChanged();\r\n\r\n// returns the property name for document.hidden, which can contain the browser specific prefix, or null if not defined.\r\n// hidden is part of modern browsers visibility api.\r\nfunction getHiddenPropertyName() {\r\n if (!canUseDOM()) {\r\n return null;\r\n }\r\n\r\n const prefixes = [\"webkit\", \"moz\", \"ms\", \"o\"];\r\n\r\n // if 'hidden' is natively supported just return it\r\n if (typeof document.hidden !== \"undefined\") {\r\n return \"hidden\";\r\n }\r\n\r\n // otherwise loop over all the known prefixes until we find one\r\n for (let index = 0; index < prefixes.length; index++) {\r\n const prospectivePropertyName = prefixes[index] + \"Hidden\";\r\n if ((prospectivePropertyName) in document) {\r\n return prospectivePropertyName;\r\n }\r\n }\r\n}\r\n\r\n// determines if the page is hidden.\r\nfunction isHidden() {\r\n if (!canUseDOM() || !visibilityProperty) {\r\n return false;\r\n }\r\n\r\n return document[visibilityProperty];\r\n}\r\n\r\n// handler for visibility changes. Determines if we should resolve the promise.\r\nfunction visibilityChanged() {\r\n if (!isHidden()) {\r\n visibilityDeferred.resolve();\r\n } else {\r\n // create a new one so we can fire when we are back.\r\n // @ts-ignore\r\n visibilityDeferred = new Deferred();\r\n // flag indicates that browser was minimised or hidden during the page impression\r\n\r\n if (!isUnloadEventInProgress) {\r\n wasBrowserHidden = true;\r\n }\r\n }\r\n}\r\n\r\n// returns if the browser was hidden at least once\r\nfunction wasBrowserHiddenAtLeastOnce() {\r\n return (wasBrowserHidden ? 1 : 0);\r\n}\r\n\r\n// determines if an element is currently visible to the user\r\nfunction isElementTrulyVisible(element, windowRight, windowLeft, windowHeight) {\r\n if (isHidden() || !element) {\r\n return false;\r\n }\r\n\r\n windowHeight = windowHeight || getInnerHeight();\r\n windowRight = windowRight || getInnerWidth();\r\n\r\n if (!windowLeft && windowLeft !== 0) {\r\n windowLeft = 0;\r\n const contentArea = document.getElementById(\"content\");\r\n\r\n if (contentArea) {\r\n const contentRect = contentArea.getBoundingClientRect();\r\n windowRight = contentRect.right;\r\n windowLeft = contentRect.left;\r\n }\r\n }\r\n\r\n let boxVisible = false;\r\n\r\n const rec = element.getBoundingClientRect();\r\n\r\n const elementHeightVisible = (rec.top >= 0 || rec.bottom >= 0) && (rec.top < windowHeight || rec.bottom < windowHeight);\r\n const elementWidthVisible = (rec.left >= windowLeft || rec.right > windowLeft) && (rec.left < windowRight || rec.right <= windowRight);\r\n\r\n boxVisible = rec.height !== 0 || rec.width !== 0;\r\n\r\n return boxVisible && (elementHeightVisible && elementWidthVisible);\r\n}\r\n\r\n/// Notifies the callee when we return to visibile state. Returns immediately if we are currently visible\r\n/// A JQuery Promise that resolves when visible\r\nfunction notifyWhenPageVisible() {\r\n // return our current promise.\r\n return visibilityDeferred.promise();\r\n}\r\n\r\n// return the visibility object being returned\r\nexport default {\r\n // returns true if the document is hidden\r\n isHidden: isHidden,\r\n // returns a jquery promise that resolves the next time (or immediately) the page becomes visible\r\n notifyWhenPageVisible: notifyWhenPageVisible,\r\n // returns true if the page is visible && element within viewport\r\n isElementTrulyVisible: isElementTrulyVisible,\r\n // returns true if page was hidden even once\r\n wasBrowserHiddenAtLeastOnce: wasBrowserHiddenAtLeastOnce\r\n};\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n// Tracking information aggregate object.\r\n// used by all the tracking systems to get common info sent via tracking\r\n\r\nimport dom from \"./dom\";\r\nimport extend from \"./extend\";\r\nimport { headData, getCookie, appEnvironment } from \"@msnews/core\";\r\nimport mediator from \"./mediator\";\r\nimport pageInstance from \"./pageInstance\";\r\nimport telemetryConstants from \"./telemetryconstants\";\r\nimport { telemetryDataTypes } from \"./telemetryDataTypes\";\r\nimport { telemetryReadyCallback } from \"./telemetryReadyCallback\";\r\nimport visibilityService from \"./visibility\";\r\nimport { AadAccountType, AccountType } from \"@msnews/experiences-constants\";\r\nimport { canUseDOM, getLocationHref } from \"@msnews/isomorphic-util\";\r\n\r\nlet clientClientId;\r\nlet browserWidth;\r\nlet browserHeight;\r\n// eventIndex[0] is for the first rid and eventIndex[1] is for the current rid\r\nconst eventIndex = [0, 0];\r\nlet isFirstEventIndex = true;\r\nlet eventTransientCustomTags = {}; // eventTransientCustomTags is applied to each specific events.\r\n\r\nlet modules = [];\r\nlet baseUrl = \"\";\r\nlet clientIdTypeValue;\r\n\r\nlet userDefinedCustomTags = {};\r\n\r\nfunction Module(element, visible) {\r\n this.element = element;\r\n this.visible = visible;\r\n\r\n if (this.visible) {\r\n this.compress = function () {\r\n const moduleTelemetryData = this.element.getAttribute(\"data-m\");\r\n try {\r\n return JSON.parse(moduleTelemetryData);\r\n } catch (e) {\r\n return moduleTelemetryData;\r\n }\r\n };\r\n }\r\n}\r\n\r\nfunction getBrowserSize() {\r\n /// \r\n /// Helper function used to get the browser height and width\r\n /// \r\n\r\n browserWidth = (canUseDOM()) ? (window.outerWidth || document.documentElement.clientWidth) : 0;\r\n browserHeight = (canUseDOM()) ? (window.outerHeight || document.documentElement.clientHeight) : 0;\r\n\r\n}\r\n\r\nfunction getWindowHeight() {\r\n /// \r\n /// Get current browser viewpane height\r\n /// \r\n\r\n if (!canUseDOM()) {\r\n return 0;\r\n }\r\n\r\n return window.innerHeight ||\r\n document.documentElement.clientHeight ||\r\n document.body.clientHeight || 0;\r\n}\r\n\r\nfunction getWindowYscroll() {\r\n /// \r\n /// Get current absolute window scroll position\r\n /// \r\n\r\n if (!canUseDOM()) {\r\n return 0;\r\n }\r\n\r\n return window.pageYOffset ||\r\n document.body.scrollTop ||\r\n document.documentElement.scrollTop || 0;\r\n}\r\n\r\nfunction getDocHeight() {\r\n /// \r\n /// Get current absolute document height\r\n /// \r\n\r\n if (!canUseDOM()) {\r\n return 0;\r\n }\r\n\r\n return Math.max(\r\n document.body.scrollHeight || 0,\r\n document.documentElement.scrollHeight || 0,\r\n document.body.offsetHeight || 0,\r\n document.documentElement.offsetHeight || 0,\r\n document.body.clientHeight || 0,\r\n document.documentElement.clientHeight || 0\r\n );\r\n}\r\n\r\nfunction getDefaultCustomTags() {\r\n /// \r\n /// Get the default custom tags.\r\n /// \r\n const defaultCustomTags = {};\r\n\r\n if (!canUseDOM()) {\r\n return defaultCustomTags;\r\n }\r\n\r\n // @ts-ignore\r\n if (window && window.adsEnabled != null) {\r\n // @ts-ignore\r\n defaultCustomTags.adoni = +window.adsEnabled;\r\n }\r\n\r\n return defaultCustomTags;\r\n}\r\n\r\nfunction joinTelemetryValues(separator, leftTmplValue, rightTemplValue) {\r\n /// Composes a new template value from an exisiting one and a new one.\r\n /// The separator.\r\n /// The left tmpl value string, may be null or empty.\r\n /// The right tmpl value string, may be null or empty.\r\n /// \r\n /// A new string composed of the right and left values with a semi-colon separator if both values are non-null and not empty.\r\n /// If the right templ value is null or empty (or otherwise falsey), the left templ value is returned.\r\n /// If only the left templ value is falsey, only the right templ value is returned.\r\n /// \r\n\r\n return rightTemplValue\r\n ? leftTmplValue\r\n ? [leftTmplValue, rightTemplValue].join(separator)\r\n : rightTemplValue\r\n : leftTmplValue;\r\n}\r\n\r\nfunction joinTelemetryValuesForTmpl(separator, currentTmplValue, newTmplValue) {\r\n /// Composes a new template value from an exisiting one and a new one.\r\n /// The separator.\r\n /// The currentTmplValue, may be null or empty.\r\n /// The newTmplValue, may be null or empty.\r\n /// \r\n /// A new string composed of the newTmplValue and currentTmplValue with a semi-colon separator if both values are non-null and not empty.\r\n /// If the newTmplValue is null or empty (or otherwise falsey), the currentTmplValue is returned.\r\n /// If only the currentTmplValue is falsey, only the newTmplValue is returned.\r\n /// Duplicate key will override the value even if the value is empty string.\r\n /// Value without any key will be ignored.\r\n /// \r\n\r\n if (!newTmplValue) {\r\n return currentTmplValue ? currentTmplValue : \"\";\r\n }\r\n if (!currentTmplValue) {\r\n return newTmplValue ? newTmplValue : \"\";\r\n }\r\n const combinedTelemetryVal = {};\r\n const array = [];\r\n let isDuplicateKeyExist = false;\r\n const newTmplValueSplited = newTmplValue.split(separator);\r\n for (let i = 0; i < newTmplValueSplited.length; i++) {\r\n const newKeyVal = newTmplValueSplited[i].split(\":\");\r\n if (newKeyVal[0]) {\r\n if (!isDuplicateKeyExist) {\r\n // 'currentTmplValue' will be split out only if 'newTmplValue' contains any key which is exist in 'currentTmplValue'\r\n if (newKeyVal[0] && (currentTmplValue.indexOf(newKeyVal[0]) != -1)) {\r\n const currentTmplValueSplited = currentTmplValue.split(separator);\r\n for (let j = 0; j < currentTmplValueSplited.length; j++) {\r\n if (currentTmplValueSplited[j]) {\r\n const currentKeyVal = currentTmplValueSplited[j].split(\":\");\r\n combinedTelemetryVal[currentKeyVal[0]] = currentKeyVal[1];\r\n }\r\n }\r\n isDuplicateKeyExist = true;\r\n }\r\n }\r\n combinedTelemetryVal[newKeyVal[0]] = newKeyVal[1];\r\n }\r\n }\r\n\r\n let val = \"\";\r\n for (const key in combinedTelemetryVal) {\r\n if (key) {\r\n if (val !== \"\") {\r\n val += separator;\r\n }\r\n\r\n val += key;\r\n if (combinedTelemetryVal[key]) {\r\n val += \":\" + combinedTelemetryVal[key];\r\n }\r\n }\r\n }\r\n\r\n if (!isDuplicateKeyExist && currentTmplValue) {\r\n val = val ? val + separator + currentTmplValue : currentTmplValue;\r\n }\r\n\r\n return val;\r\n}\r\n\r\nexport const trackInfo = {\r\n notrack: \"notrack\",\r\n cmSeparator: \">\",\r\n // TODO: (nubenja) To be removed. Make sure all dependecies get removed\r\n defaultModule: \"body\",\r\n defaultFormHeadline: \"[form submit]\",\r\n piitxt: \"data-piitxt\",\r\n piiurl: \"piiurl\",\r\n wrapperId: \"wrapper\",\r\n MUIDCookie: \"MUID\", // This is used for client id. If MUID exists, then we will use MUID as client id otherwise use request id.\r\n gestureKey: \"touch_gesture\",\r\n gestureType:\r\n {\r\n tap: \"tap\",\r\n rightclick: \"rightclick\"\r\n },\r\n eventTypes:\r\n {\r\n click: \"click\",\r\n nonNavClckEvt: \"click_nonnav\",\r\n submit: \"submit\",\r\n contextmenu: \"contextmenu\",\r\n mouseenter: \"mouseenter\",\r\n imprUpdate: \"impr_update\",\r\n adPlay: \"AdPlay\",\r\n contentPlay: \"ContentPlay\",\r\n videoClickNonNav: \"Click_Non-nav\"\r\n },\r\n imprUpdateMechanisms:\r\n {\r\n load: \"load\",\r\n scroll: \"scroll\",\r\n auto: \"auto\",\r\n tap: \"tap\",\r\n resize: \"resize\",\r\n swipe: \"swipe\",\r\n partial: \"partial\",\r\n view: \"view\"\r\n },\r\n event: {},\r\n sitePage: {},\r\n userStatic: {},\r\n overrideClientParams: {},\r\n persistOverriddenParams: false,\r\n customTags: getDefaultCustomTags() || {}, // customTags is applied to all events.\r\n trackingDisabled: false, // used by NTP/DHP to disable tracking in \"enterprise mode\",\r\n shouldFireTelemetry: function () {\r\n /// \r\n /// Return whether telemetry beacons should get fired or not.\r\n /// \r\n\r\n return !this.trackingDisabled;\r\n },\r\n appErrorEnabled: true, // should not send app error when user is navigating away from page.\r\n shouldFireAppError: function () {\r\n /// \r\n /// Return whether app error beacons should get fired or not.\r\n /// \r\n\r\n return this.appErrorEnabled;\r\n },\r\n getCurrentTime: function () {\r\n /// \r\n /// gets the current timestamp\r\n /// \r\n /// \r\n /// \r\n return +new Date();\r\n },\r\n timeToInteract: function (eventTime?) {\r\n /// \r\n /// gets the time to interact for the event by substracting it from navigationStart.\r\n /// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceTiming/navigationStart\r\n /// \r\n /// \r\n /// \r\n if (!canUseDOM()) {\r\n return 0;\r\n }\r\n\r\n let eventTiming;\r\n if (eventTime) {\r\n eventTiming = eventTime;\r\n } else {\r\n eventTiming = trackInfo.getCurrentTime();\r\n }\r\n if (eventTiming && window.performance && window.performance.timing && window.performance.timing.navigationStart) {\r\n return (eventTiming - window.performance.timing.navigationStart);\r\n }\r\n },\r\n // This will be deprecated in upcoming iterations, so please use telemetryDataTypes.TelemetryType. Please follow these new definitions: https://microsoft.sharepoint.com/:x:/t/IDXTelemetryandDatafabric/EbMw_1_6OCtNtyXkbb2YcjoBxY2iFtWOW-kfQZLJmnErEw\r\n telemetryModuleTypes:\r\n {\r\n Undefined: 0,\r\n Header: 1,\r\n Footer: 2,\r\n topNavBar: 3,\r\n navBar: 4,\r\n dropDown: 5,\r\n Section: 6,\r\n Carousel: 7,\r\n Module: 8,\r\n searchBox: 9,\r\n inputBox: 10,\r\n actionButton: 11,\r\n Interaction: 12,\r\n Headline: 13,\r\n Navigation: 14,\r\n Entity: 15,\r\n structuredData: 16,\r\n appStore: 17,\r\n appLaunch: 18,\r\n cmsPromotions: 19,\r\n microsoftWebStore: 20,\r\n xboxStore: 21,\r\n officeStore: 22,\r\n appInstall: 23,\r\n PartnerLinks: 24,\r\n SponsoredContent: 25\r\n },\r\n contentPlacedBySource:\r\n {\r\n Editorial: 0,\r\n PersonalizationAlgo: 1,\r\n BingAlgo: 2,\r\n Taboola: 3,\r\n Outbrain: 4\r\n },\r\n telemetryDataAttribute: \"data-m\",\r\n telemetryHLAttribute: \"data-hl\",\r\n client:\r\n {\r\n // client id\r\n clientId: function () {\r\n if (!clientClientId && clientClientId !== \"\") {\r\n // @ts-ignore\r\n clientClientId = getCookie(trackInfo.MUIDCookie) || trackInfo.sitePage.requestId || \"\";\r\n }\r\n\r\n return clientClientId;\r\n },\r\n clientIdType: function () {\r\n // @ts-ignore\r\n if (clientClientId === trackInfo.sitePage.requestId) {\r\n clientIdTypeValue = \"activityId\";\r\n } else if (clientClientId !== \"\") {\r\n clientIdTypeValue = \"muid\";\r\n }\r\n\r\n return clientIdTypeValue;\r\n },\r\n gesture: function () {\r\n const element = dom.getTarget(trackInfo.event);\r\n if (element && element[trackInfo.gestureKey]) {\r\n return element[trackInfo.gestureKey];\r\n }\r\n const trackInfoEvent: any = trackInfo.event;\r\n if (trackInfoEvent) {\r\n if ((trackInfoEvent.originalEvent && trackInfoEvent.originalEvent == \"contextmenu\") || trackInfoEvent.ctrlKey || trackInfoEvent.shiftKey) {\r\n return trackInfo.gestureType.rightclick;\r\n }\r\n }\r\n return \"\";\r\n },\r\n\r\n getMuid: function () {\r\n return getCookie(trackInfo.MUIDCookie);\r\n },\r\n\r\n getAnonCookieName: function () {\r\n /// \r\n /// Gets the anonCookieName from the headData (hybrid) or the appEnvironment. ANON for Pages with manual sign in, else APP_ANON.\r\n /// \r\n /// \r\n /// \r\n return headData.AnonCookieName || appEnvironment.AuthCookieName;\r\n },\r\n\r\n getSsoComplete: function () {\r\n /// \r\n /// Gets the SsoComplete state from the headData. true if sso completes otherwise false.\r\n /// Used only for prime. DHP/NTP does not have anon.\r\n /// \r\n /// \r\n /// \r\n\r\n if (headData.SsoComplete && (headData.SsoComplete + \"\").toLowerCase() === \"true\") {\r\n return 1;\r\n }\r\n\r\n return 0;\r\n },\r\n\r\n /**\r\n * Gets the Aad state from the headData or appEnvironment\r\n * @returns {number} The AAD authenticated state.\r\n */\r\n getAadAuthentication: function (): AadAccountType {\r\n // Check the head data for the hybrid page\r\n if (headData.AadState === true) {\r\n // AAD AuthenticatedState\r\n return AadAccountType.AadAccount;\r\n } else if (headData.AadState === false) {\r\n // AAD UnauthenticatedState\r\n return AadAccountType.NonAadAccount;\r\n }\r\n\r\n // Check the headData first for the Hybrid page, else use appEnvironment\r\n const accountInfo = appEnvironment.ResolvedAccountInfo;\r\n const isAadAccount: boolean = (accountInfo && accountInfo.account_type && accountInfo.account_type === AccountType.AAD);\r\n return isAadAccount ? AadAccountType.AadAccount : AadAccountType.NonAadAccount;\r\n },\r\n\r\n /**\r\n * Gets the device orientation\r\n */\r\n orientation: function () {\r\n if (!canUseDOM()) {\r\n return \"\";\r\n }\r\n return screen.width > screen.height ? \"landscape\" : \"portrait\";\r\n },\r\n\r\n OTFTelemetry: function (mechanism?: string): void {\r\n {\r\n if (!canUseDOM()) {\r\n return;\r\n }\r\n\r\n if (typeof mechanism === \"undefined\") {\r\n // mechanism is only undefined on page load.\r\n // Peregrine already sends an impression update on page load through\r\n // EntryPoint.connector#onVisuallyReady, so this one can be skipped.\r\n return;\r\n }\r\n\r\n if (mechanism == null) {\r\n mechanism = \"\";\r\n }\r\n\r\n modules = [];\r\n const telemetryData = document.body.querySelectorAll(\"[data-m]\");\r\n\r\n // calculate windowRight, windowLeft, and windowHeight upfront to avoid multiple calls to getBoundingClientRect() and\r\n // reduce performance impact\r\n let windowRight;\r\n\r\n const windowHeight = window.innerHeight;\r\n windowRight = window.innerWidth;\r\n\r\n let windowLeft = 0;\r\n const contentArea = document.getElementById(\"content\");\r\n\r\n if (contentArea) {\r\n const contentRect = contentArea.getBoundingClientRect();\r\n windowRight = contentRect.right;\r\n windowLeft = contentRect.left;\r\n }\r\n\r\n // Everything inside infopane is considered visible as long as infopane itself is visible due to auto rotation\r\n // First get infopane itself (\"mip\" is for infopane in mid-level, \"sip\" is for spartan infopane).\r\n const infopane = document.body.querySelector(\".ip\") || document.body.querySelector(\".mip\") || document.body.querySelector(\".sip\");\r\n const infopaneVisible = infopane && trackInfo.telemetryTracking.isVisible(infopane, windowRight, windowLeft, windowHeight);\r\n\r\n // cache result of IsVisible() to reduce performance impact caused by getBoundingClientRect()\r\n const visibles = [];\r\n for (let i = 0; i < telemetryData.length; i++) {\r\n // if otfUseViewportForVisibility is true, we will use the whole viewport to determine the visibility of the element\r\n if (telemetryData[i].getAttribute(\"data-otfUseViewportForVisibility\") === \"true\") {\r\n // @ts-ignore window.width\r\n visibles.push(trackInfo.telemetryTracking.isVisible(telemetryData[i], window.width, 0, windowHeight, infopaneVisible));\r\n } else {\r\n visibles.push(trackInfo.telemetryTracking.isVisible(telemetryData[i], windowRight, windowLeft, windowHeight, infopaneVisible));\r\n }\r\n }\r\n\r\n for (let j = 0; j < telemetryData.length; j++) {\r\n modules.push(new Module(telemetryData[j], visibles[j]));\r\n }\r\n const context = trackInfo.telemetryTracking.formatModules();\r\n // @ts-ignore\r\n if (context && ((context.e && context.e.length > 0) || (context.vc && context.vc.length > 0))) {\r\n trackInfo.telemetryTracking.sendImprUpdateEvent(mechanism, context);\r\n }\r\n }\r\n },\r\n\r\n // browser height\r\n height: function () {\r\n if (!browserHeight) {\r\n getBrowserSize();\r\n }\r\n return browserHeight;\r\n },\r\n\r\n pageTitle: function () {\r\n /**\r\n * returns the page title\r\n */\r\n if (!canUseDOM()) {\r\n return \"\";\r\n }\r\n\r\n return document.title;\r\n },\r\n\r\n // entire url of the current page\r\n // use a function because we may virtually change the page by manipulating the history stack\r\n // (for example, in a gallery when changing slides).\r\n pageUrl: function () {\r\n let pageUrl = getLocationHref();\r\n // @ts-ignore\r\n const ocid = trackInfo.sitePage.msnocid;\r\n if (ocid) {\r\n // This is the DHP or NTP page - need to add the OCID to pageUrl.\r\n const hasQueryString = pageUrl.indexOf(\"?\") >= 0;\r\n pageUrl = hasQueryString ? pageUrl + \"&\" : pageUrl + \"?\";\r\n pageUrl = pageUrl + \"ocid=\" + ocid;\r\n }\r\n\r\n return pageUrl;\r\n },\r\n\r\n // URL of the document that loaded the current document\r\n // first check for an override property that we may set during virtual page changes, and if\r\n // that's not set, use the real referrer.\r\n // @ts-ignore\r\n referrer: function () {\r\n if (!canUseDOM()) {\r\n return \"\";\r\n }\r\n\r\n // @ts-ignore\r\n return document.referrerOverride || document.referrer;\r\n },\r\n // screen resolution\r\n screenResolution: function () {\r\n if (!canUseDOM()) {\r\n return \"\";\r\n }\r\n\r\n const screenResolution = [screen.width, screen.height].join(\"x\");\r\n\r\n return screenResolution;\r\n },\r\n\r\n userAgent: function () {\r\n /**\r\n * gets the user agent\r\n */\r\n if (!canUseDOM()) {\r\n return \"\";\r\n }\r\n\r\n return navigator.userAgent;\r\n },\r\n\r\n // browser width\r\n width: function () {\r\n if (!browserWidth) {\r\n getBrowserSize();\r\n }\r\n return browserWidth;\r\n },\r\n // sends the Browser Hidden Field on window\r\n wasBrowserHiddenAtLeastOnce: function () {\r\n return visibilityService.wasBrowserHiddenAtLeastOnce();\r\n }\r\n },\r\n userDynamic:\r\n {\r\n timeStamp: function () {\r\n /// \r\n /// generates the timestamp for the url\r\n /// \r\n /// \r\n /// \r\n return trackInfo.getCurrentTime();\r\n },\r\n slideType: function () {\r\n /// \r\n /// Finds the slide type if any (and if a slide)\r\n /// \r\n /// \"halfpane\" or null\r\n if (!canUseDOM()) {\r\n return null;\r\n }\r\n\r\n // @ts-ignore\r\n let elem = trackInfo.event.target;\r\n const halfpaneClass = \"halfpane\";\r\n while (elem && dom.name(elem) != \"SECTION\") {\r\n if (dom.name(elem) == \"LI\" && dom.containsClass(elem, halfpaneClass)) {\r\n return halfpaneClass;\r\n }\r\n elem = dom.parent(elem);\r\n }\r\n return null;\r\n },\r\n firstEventIndex: function () {\r\n /// \r\n /// The first rid event index.\r\n /// This value gets incremented for each event of the first rid that is triggered\r\n /// \r\n /// \r\n /// Sequential number of the current event\r\n /// \r\n\r\n return ++eventIndex[0];\r\n },\r\n currentEventIndex: function () {\r\n /// \r\n /// The current event index.\r\n /// This value gets incremented for each event that is triggered\r\n /// \r\n /// \r\n /// Sequential number of the current event\r\n /// \r\n if (isFirstEventIndex) {\r\n return ++eventIndex[0];\r\n } else {\r\n return ++eventIndex[1];\r\n }\r\n },\r\n requestId: function () {\r\n /// \r\n /// return the requestId\r\n /// \r\n return pageInstance.getRequestId() || (trackInfo.sitePage).requestId;\r\n },\r\n resetEventIndex: function () {\r\n /// \r\n /// reset the event index\r\n /// \r\n eventIndex[1] = 0;\r\n isFirstEventIndex = false;\r\n }\r\n },\r\n custom:\r\n {\r\n addCustomTags: function () {\r\n /// \r\n /// Adds the custom tags inside the otf beacon url.\r\n /// \r\n /// \r\n /// \r\n\r\n let combinedTags = trackInfo.customTags;\r\n combinedTags = extend({}, trackInfo.customTags, eventTransientCustomTags);\r\n // reset so the next events gets its own transient custom tags\r\n eventTransientCustomTags = {};\r\n return JSON.stringify(combinedTags);\r\n },\r\n addCustomTagsForClickEvent: function () {\r\n /// \r\n /// Adds the custom tags for click event inside the otf beacon url.\r\n /// \r\n /// \r\n /// \r\n\r\n let customTags = \"\";\r\n if (typeof userDefinedCustomTags === \"object\") {\r\n for (const key in userDefinedCustomTags) {\r\n customTags = JSON.stringify(userDefinedCustomTags);\r\n break;\r\n }\r\n }\r\n // reset so the next events gets its own custom tags\r\n userDefinedCustomTags = {};\r\n return customTags;\r\n }\r\n },\r\n telemetryTracking:\r\n {\r\n setupParameters: function (evt) {\r\n const trackInfoSitePage = trackInfo.sitePage;\r\n const anonckName: string = appEnvironment.AuthCookieName as string;\r\n\r\n const result = {\r\n evt: evt,\r\n // @ts-ignore\r\n rid: pageInstance.getRequestId() || trackInfoSitePage.requestId,\r\n // @ts-ignore\r\n di: trackInfoSitePage.domainId,\r\n clid: trackInfo.client.clientId(),\r\n issso: trackInfo.client.getSsoComplete(),\r\n aadState: trackInfo.client.getAadAuthentication()\r\n };\r\n\r\n // @ts-ignore\r\n if (trackInfoSitePage.afd) {\r\n // @ts-ignore\r\n result.afd = trackInfoSitePage.afd;\r\n }\r\n\r\n if (anonckName) {\r\n // @ts-ignore\r\n result.anoncknm = anonckName;\r\n }\r\n\r\n // Set the new page parameters for all post events\r\n // @ts-ignore\r\n result[\"pg.p\"] = trackInfo.sitePage.page_product;\r\n // @ts-ignore\r\n result[\"pg.t\"] = trackInfo.sitePage.page_type;\r\n // @ts-ignore\r\n result[\"pg.n\"] = trackInfo.sitePage.page_name;\r\n // @ts-ignore\r\n result[\"pg.c\"] = trackInfo.sitePage.page_configuration;\r\n\r\n return result;\r\n },\r\n sendImprUpdateEvent: function (mechanism, modules, topLevelContainerType?) {\r\n // Prevent empty impr_update\r\n if (!canUseDOM() || modules == undefined || ((modules.e == undefined || modules.e.length <= 0) && (modules.vc == undefined || modules.vc.length <= 0))) {\r\n return;\r\n }\r\n\r\n const parameters = this.setupParameters(trackInfo.eventTypes.imprUpdate);\r\n if (parameters) {\r\n // mechanism to trigger the viewability event. ex: load, swipe, click, tap, scroll, and resize\r\n parameters[\"mech\"] = mechanism;\r\n\r\n parameters.winht = getWindowHeight();\r\n parameters.docht = getDocHeight();\r\n parameters.scrollOff = getWindowYscroll();\r\n\r\n parameters.wbh = visibilityService.wasBrowserHiddenAtLeastOnce();\r\n parameters[\"e1\"] = modules;\r\n // @ts-ignore\r\n parameters.tmpl = trackInfo.sitePage.templ;\r\n // @ts-ignore\r\n parameters.mkt = trackInfo.sitePage.localeCode;\r\n if (mechanism === trackInfo.imprUpdateMechanisms.scroll) {\r\n parameters.TTI = trackInfo.timeToInteract();\r\n }\r\n\r\n // @ts-ignore\r\n if (window && window.adsEnabled != null) {\r\n // @ts-ignore\r\n parameters.adoni = +window.adsEnabled;\r\n }\r\n\r\n // Feed parameters\r\n // @ts-ignore\r\n if (trackInfo.sitePage.feedId) {\r\n // @ts-ignore\r\n parameters.fid = trackInfo.sitePage.feedId;\r\n // @ts-ignore\r\n parameters.fn = trackInfo.sitePage.feedName;\r\n // @ts-ignore\r\n parameters.ft = trackInfo.sitePage.feedType;\r\n }\r\n\r\n // @ts-ignore\r\n if (trackInfo.sitePage.flightid) {\r\n // @ts-ignore\r\n parameters.flightid = trackInfo.sitePage.flightid;\r\n }\r\n\r\n // If toplevel container is passed to impression update then create a new parameter which will eventually be replaced by tlc.\r\n if (topLevelContainerType) {\r\n parameters.tlcType = topLevelContainerType;\r\n }\r\n\r\n this.sendUpdate(parameters);\r\n }\r\n },\r\n isVisible: function (element, windowRight?, windowLeft?, windowHeight?, infopaneVisible?) {\r\n if (!element) {\r\n return false;\r\n }\r\n\r\n return visibilityService.isElementTrulyVisible(element, windowRight, windowLeft, windowHeight);\r\n },\r\n formatModules: function () {\r\n const formattedModules = [];\r\n\r\n for (const index in modules) {\r\n const module = modules[index];\r\n if (module && module.compress) {\r\n const mData = module.compress();\r\n\r\n // TODO: (nubenja) Remove this once data-m.y is deprecated\r\n // Convertion from telemetryType (data-m.y) to telemetryContentType and telemetryContentAction (data-m.ct/ca)\r\n if (mData && mData.y && !mData.ct) {\r\n const ct = telemetryDataTypes.getTelemetryContentType(mData.y);\r\n\r\n if (ct) {\r\n mData.ct = ct;\r\n }\r\n }\r\n\r\n formattedModules.push(mData);\r\n }\r\n\r\n }\r\n\r\n const context = {};\r\n if (formattedModules && formattedModules.length > 0) {\r\n // @ts-ignore\r\n context.e = formattedModules;\r\n }\r\n\r\n return context;\r\n },\r\n sendUpdate: function (parameters) {\r\n // For the preloaded pages, the code inside requestPageRevealAsync is called when page is revealed,\r\n // otherwise it is called right away.\r\n telemetryReadyCallback((): void => {\r\n if (!trackInfo.shouldFireTelemetry()) {\r\n return;\r\n }\r\n\r\n // An ad call may send this without setting up the baseUrl correctly.\r\n // @ts-ignore\r\n baseUrl = baseUrl || (trackInfo.sitePage || {}).otfURL;\r\n if (!baseUrl) {\r\n // The value of sitePage.otfURL was empty!\r\n return;\r\n }\r\n\r\n if (!parameters) {\r\n return;\r\n }\r\n\r\n // increment the event index and set the idx parameter\r\n parameters.idx = trackInfo.userDynamic.currentEventIndex();\r\n\r\n // An ad call may send this without setting up the baseUrl correctly.\r\n const beaconData = {\r\n url: baseUrl,\r\n requestType: telemetryConstants.POST,\r\n // @ts-ignore\r\n eventType: parameters.evt || trackInfo.eventTypes.impressionUpdate,\r\n params: parameters,\r\n trackingType: telemetryConstants.OTF\r\n };\r\n\r\n mediator.pub(telemetryConstants.FireTelemetry, beaconData);\r\n });\r\n }\r\n },\r\n updateTemplValue: function (templToAdd) {\r\n /// Updates the templ value with the specified value\r\n /// The templ value to add\r\n\r\n trackInfo.updateSitePage(templToAdd);\r\n },\r\n updateSitePage: function (templ, flightId?, requestId?) {\r\n /// Updates the trackInfo.sitePage values with the specified values\r\n /// The new templ value to add\r\n /// The new flightId to add\r\n /// The new trackInfo object\r\n\r\n let currentSitePage = trackInfo.sitePage;\r\n if (!currentSitePage) {\r\n currentSitePage = trackInfo.sitePage = {};\r\n }\r\n\r\n // @ts-ignore\r\n const currentFlightIds = currentSitePage.flightid;\r\n if (flightId && (!currentFlightIds || (currentFlightIds.indexOf(flightId) < 0))) {\r\n // @ts-ignore\r\n currentSitePage.flightid = joinTelemetryValues(\",\", currentFlightIds, flightId);\r\n }\r\n // @ts-ignore\r\n currentSitePage.templ = joinTelemetryValuesForTmpl(\";\", currentSitePage.templ, templ);\r\n\r\n if (requestId) {\r\n // @ts-ignore\r\n currentSitePage.requestId = requestId;\r\n }\r\n },\r\n updatePageName: function (pageName, overridePageType) {\r\n /// Updates the pageName and pageType in the trackInfo.SitePage for the given pageName\r\n /// The pageName to update\r\n /// Boolean flag to determine to override pagetype or not. Default is true\r\n let doOverridePageType = overridePageType;\r\n if (overridePageType === undefined) {\r\n doOverridePageType = true;\r\n }\r\n\r\n const telemetryPageName = telemetryDataTypes.getTelemetryPageInfo(pageName);\r\n if (telemetryPageName && trackInfo.sitePage) {\r\n // @ts-ignore\r\n trackInfo.sitePage.page_name = telemetryPageName.PageName;\r\n if (doOverridePageType) {\r\n // @ts-ignore\r\n trackInfo.sitePage.page_type = telemetryPageName.PageType;\r\n }\r\n }\r\n },\r\n updateFeedMetadata: function (feedId, feedName, feedType) {\r\n /// Updates the feedid, feedname and feedType in the trackInfo.SitePage for the given feed\r\n /// The feedId to update\r\n /// The feedName to update\r\n /// The feedType to update\r\n if (feedId) {\r\n // @ts-ignore\r\n trackInfo.sitePage.feedId = feedId;\r\n if (feedName) {\r\n // @ts-ignore\r\n trackInfo.sitePage.feedName = feedName;\r\n }\r\n\r\n if (feedType) {\r\n // @ts-ignore\r\n trackInfo.sitePage.feedType = feedType;\r\n }\r\n }\r\n },\r\n updatePagePivot: function (pagePivot) {\r\n /// Updates the pagePivot in the trackInfo.SitePage\r\n /// The pagePivot to update\r\n if (pagePivot === telemetryDataTypes.TelemetryPagePivot.Undefined) {\r\n // @ts-ignore\r\n trackInfo.sitePage.pagePivot = null;\r\n } else if (telemetryDataTypes.validateTelemetryDataType(telemetryDataTypes.TelemetryPagePivot, pagePivot)) {\r\n // @ts-ignore\r\n trackInfo.sitePage.pagePivot = pagePivot;\r\n }\r\n },\r\n updateReferrer: function (referrer, referrerType) {\r\n /// Updates referrer and referrerType\r\n /// referrer\r\n /// TelemetryContentType of the referrer\r\n if (canUseDOM() && referrer) {\r\n // @ts-ignore\r\n document.referrerOverride = referrer;\r\n\r\n if (referrerType && telemetryDataTypes.validateTelemetryDataType(telemetryDataTypes.TelemetryContentType, referrerType) &&\r\n referrerType != telemetryDataTypes.TelemetryContentType.Undefined) {\r\n // @ts-ignore\r\n trackInfo.sitePage.referrerType = referrerType;\r\n }\r\n }\r\n },\r\n setCustomTagsForClickEvent: function (key, value) {\r\n /// \r\n /// Set user defined custom tags.\r\n /// \r\n /// The key\r\n /// The value\r\n if (key && value && value != undefined) {\r\n userDefinedCustomTags[key] = value;\r\n }\r\n },\r\n updatePageUserTypeAndUserId: function (userType, userId) {\r\n /// \r\n /// Set user id and user id type.\r\n /// \r\n /// The user id type\r\n /// The user id\r\n\r\n // @ts-ignore\r\n trackInfo.sitePage.pageUserId = null;\r\n // @ts-ignore\r\n trackInfo.sitePage.pageUserType = null;\r\n\r\n if (telemetryDataTypes.validateTelemetryDataType(telemetryDataTypes.TelemetryUserType, userType)) {\r\n // @ts-ignore\r\n trackInfo.sitePage.pageUserType = userType;\r\n\r\n if (userId) {\r\n // @ts-ignore\r\n trackInfo.sitePage.pageUserId = userId;\r\n }\r\n }\r\n },\r\n trackCustomProperty: function (key, value) {\r\n /// Adds or updates the transient per event custom tags properties\r\n /// key to add\r\n /// value to add\r\n if (key && value != undefined) {\r\n key = key.toLowerCase();\r\n eventTransientCustomTags[key] = value;\r\n }\r\n },\r\n updateExtendedFlightId: function (namespace, flightIds) {\r\n /// Adds or updates extended flightId\r\n /// Partner namespace enum\r\n /// flightIds to add\r\n\r\n const currentSitePage = trackInfo.sitePage;\r\n\r\n if (currentSitePage && flightIds && namespace &&\r\n telemetryDataTypes.validateTelemetryDataType(telemetryDataTypes.TelemetryPartnerNamespace, namespace)) {\r\n // @ts-ignore\r\n currentSitePage.extflightid = joinTelemetryValuesForTmpl(\"|\", currentSitePage.extflightid, namespace + \":\" + flightIds);\r\n }\r\n }\r\n};\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n// Usage:\r\n// pass data to any callback that has subscribed to the event\r\n// mediator.pub(event, data);\r\n//\r\n// call the callback whenever this event is published\r\n// mediator.sub(event, callback)\r\n//\r\n// pass data to any callback that has subscribed to this event and channel\r\n// mediator.pubChannel(event, channel, data);\r\n//\r\n// call the callback whenever this event is published to this channel\r\n// mediator.subChannel(event, channel, callback)\r\n//\r\n// Think of pub/sub as using their own channel, useful for 1 ofs or app communication.\r\n// Channels are useful when multiple copies of the same widget want to communicate.\r\n\r\n/// Constructor for mediator object\r\n/// Mediator object\r\n\r\n/// Default publish subscribe where all non-channel-specific events are managed\r\n// @ts-ignore\r\nconst defaultPubSub = new PublishSubscribe();\r\nconst channels = {};\r\nexport default {\r\n pub: defaultPubSub.pub,\r\n sub: defaultPubSub.sub,\r\n unsub: defaultPubSub.unsub,\r\n pubChannel: function (event, channel, data) {\r\n /// Publishes event to channel subscribers only\r\n /// Event to subscribe to\r\n /// Name of the channel\r\n /// Data to pass to the callback\r\n getChannel(channel).pub(event, data);\r\n },\r\n subChannel: function (event, channel, callback) {\r\n /// Subscribes to event published on a specific channel\r\n /// Event to subscribe to\r\n /// Name of the channel\r\n /// Function to call when the event is fired\r\n getChannel(channel).sub(event, callback);\r\n },\r\n unsubChannel: function (event, channel, callback) {\r\n /// Unsubscribe from an event published on a specific channel\r\n /// Event to subscribe to\r\n /// Name of the channel\r\n /// Function to call when the event is fired\r\n getChannel(channel).unsub(event, callback);\r\n }\r\n};\r\n\r\nfunction getChannel(channel) {\r\n /// Gets a channel from the collection of mediator channels\r\n /// ID of the channel\r\n /// Channel requested or new channel if not exist\r\n if (!channels[channel]) {\r\n // @ts-ignore\r\n channels[channel] = new PublishSubscribe();\r\n }\r\n return channels[channel];\r\n}\r\n\r\nfunction PublishSubscribe() {\r\n /// PublishSubscribe factory\r\n /// PubSub Object\r\n const pubMap = {};\r\n return {\r\n pub: function (event, data) {\r\n /// Passes data to any callback that has subscribed to the event\r\n /// Event being published\r\n /// Data to pass to the callback\r\n const callbacks = pubMap[event];\r\n\r\n if (callbacks) {\r\n for (let ndx = 0; ndx < callbacks.length; ndx++) {\r\n callbacks[ndx](data);\r\n }\r\n }\r\n },\r\n sub: function (event, callback) {\r\n /// Subscribes the callback to this event\r\n /// Event to subscribe to\r\n /// Function to call when the event is fired\r\n if (typeof callback == \"function\") {\r\n let listeners = pubMap[event];\r\n\r\n if (!listeners) {\r\n listeners = [];\r\n pubMap[event] = listeners;\r\n }\r\n listeners.push(callback);\r\n }\r\n },\r\n unsub: function (event, callback) {\r\n /// Unsubscribes a callback from an event\r\n /// Event to unsubscribe from\r\n /// Function to unsubscribe from the event\r\n const listeners = pubMap[event];\r\n\r\n if (listeners) {\r\n for (let ndx = 0; ndx < listeners.length; ndx++) {\r\n if (listeners[ndx] === callback) {\r\n listeners.splice(ndx--, 1);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * Client side properties that Render Service sends to initialize RequestData.\r\n * These properties are typically passed via query param to the render service.\r\n * On the client side these are available and populated through the DOM.\r\n */\r\nexport interface RequestProps {\r\n\r\n /**\r\n * URL for the original client request.\r\n */\r\n href: string;\r\n\r\n /**\r\n * Width of client browser window.\r\n */\r\n innerWidth: number;\r\n\r\n /**\r\n * Height of client browser window.\r\n */\r\n innerHeight: number;\r\n\r\n /**\r\n * Device pixel ratio of client.\r\n */\r\n devicePixelRatio: number;\r\n\r\n /**\r\n * CSS Grid support of the client browser.\r\n */\r\n canUseCssGrid: boolean;\r\n\r\n /**\r\n * Request Id.\r\n */\r\n requestId: number;\r\n}\r\n\r\n/**\r\n * Singleton class to store client browser data sent through query param to Render Service.\r\n * This is only used under server environment.\r\n */\r\nclass RequestData {\r\n /**\r\n * The single instance of the RequestData class.\r\n * @type {RequestData}\r\n */\r\n private static _instance: RequestData = null;\r\n\r\n /**\r\n * URL object to be used to store original request url.\r\n */\r\n public readonly url: URL;\r\n\r\n /**\r\n * Inner width of browser from the original request.\r\n */\r\n public readonly innerWidth: number;\r\n\r\n /**\r\n * Inner height of browser from the original request.\r\n */\r\n public readonly innerHeight: number;\r\n\r\n /**\r\n * Device pixel ratio from the original request.\r\n */\r\n public readonly devicePixelRatio: number;\r\n\r\n /**\r\n * Boolean flag that represents if CSS Grid is supported by the browser from the original request.\r\n */\r\n public readonly canUseCssGrid: boolean;\r\n\r\n /**\r\n * Request Id.\r\n */\r\n public readonly requestId: number;\r\n\r\n /**\r\n * Initialize the request data instance with passed in client properties\r\n */\r\n private constructor(data: RequestProps) {\r\n this.url = new URL(data.href);\r\n this.innerWidth = data.innerWidth;\r\n this.innerHeight = data.innerHeight;\r\n this.devicePixelRatio = data.devicePixelRatio;\r\n this.canUseCssGrid = data.canUseCssGrid;\r\n this.requestId = data.requestId;\r\n }\r\n\r\n /**\r\n * Returns singleton class instance.\r\n * @returns RequestData\r\n */\r\n public static getInstance(): RequestData {\r\n if (global[\"TEST_ENV\"] && !RequestData._instance) {\r\n resetRequestData({\r\n href: \"http://localhost:8080/\",\r\n innerWidth: 1024,\r\n innerHeight: 768,\r\n devicePixelRatio: 1,\r\n canUseCssGrid: false,\r\n requestId: 0\r\n });\r\n }\r\n\r\n if (!RequestData._instance) {\r\n // Throw error if the request data has not been set as this should never be the case.\r\n // This likely highlights that the request data was not initialized when handling a\r\n // request when server side rendering.\r\n throw new Error(\"Request data is not initialized yet through ResetInstance.\");\r\n }\r\n return RequestData._instance;\r\n }\r\n\r\n /**\r\n * Reset singleton class instance with passed in info and client settings\r\n * @returns RequestData\r\n */\r\n public static resetInstance(data: RequestProps): RequestData {\r\n RequestData._instance = new RequestData(data);\r\n return RequestData._instance;\r\n }\r\n}\r\n\r\n/**\r\n * Export function to reset the request data singleton.\r\n * This must be used to set the request data.\r\n */\r\nexport const resetRequestData = RequestData.resetInstance;\r\n\r\n/**\r\n * Export get instance function for testing\r\n */\r\nexport const getRequestData = () => (RequestData.getInstance());","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * Enum for different app types\r\n * @enum\r\n */\r\nexport enum AppType {\r\n Edge = \"edge\",\r\n EdgeChromium = \"edgeChromium\",\r\n FirstParty = \"firstParty\",\r\n Hub = \"hub\",\r\n MicrosoftNews = \"microsoftNews\",\r\n MMX = \"mmx\",\r\n Office = \"office\",\r\n Views = \"views\",\r\n Weather = \"weather\",\r\n Windows = \"windows\",\r\n WindowsShell = \"windowsShell\"\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * Attempts to parse a given string to a JSON object\r\n * @param {string} jsonString - The string to parse.\r\n * @returns {any} - the parsed object if successful, or null otherwise.\r\n */\r\nexport function tryParseJson(jsonString: string): any {\r\n try {\r\n return JSON.parse(jsonString);\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\n/** Attempts to parse the given value as a integer and if failed will return the defaultValue.\r\n * @param {string} value - The value to parse.\r\n * @param {number} defaultValue - The default value to return if parsing fails\r\n * @returns {number} the parsed value if it was a valid number or otherwise the default value if specified.\r\n */\r\nexport function tryParseInt(value: string, defaultValue: number): number {\r\n const n = parseInt(value);\r\n return isNaN(n) ? defaultValue : n;\r\n}\r\n","// © Microsoft Corporation. All rights reserved.\r\n// Provides utility functions to get and set data from browser webStorage.\r\n\r\nimport { tryParseJson } from \"../utilities/Parsing\";\r\nimport { AppError, CoreLibAppErrors, logger } from \"@msnews/diagnostics\";\r\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\r\n\r\n/**\r\n * Base class for localeStorage and sessionStorage abstractions\r\n */\r\nexport class WebStorage {\r\n /**\r\n * Local storage object for persistent storage\r\n */\r\n constructor(private readonly storage: Storage) {\r\n }\r\n\r\n /**\r\n * Check if the web storage is supported\r\n * @returns {boolean} true if supported\r\n */\r\n public get supported(): boolean {\r\n return !!this.storage;\r\n }\r\n\r\n /**\r\n * Get given key's value from web storage\r\n * @param {string} key - Key name\r\n * @returns {string} Key value\r\n */\r\n public getItem(key: string): string {\r\n if (this.supported) {\r\n return this.storage.getItem(key);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the value from local storage using the key.\r\n * @param {string} key - the storage key to store under\r\n * @param {T} defaultValue - the default value to return if parsing fails\r\n * @returns {T} The parsed JSON value\r\n */\r\n public getObject(key: string, defaultValue?: T): T {\r\n const value = this.getItem(key);\r\n if (value != null) {\r\n const parsedObj = tryParseJson(value);\r\n if (parsedObj != null) {\r\n return parsedObj;\r\n }\r\n }\r\n\r\n return defaultValue;\r\n }\r\n\r\n /**\r\n * Gets given index location key from web storage\r\n * @param {string} key - Key name\r\n * @returns {string} Key value\r\n */\r\n public key(index: number): string {\r\n if (this.supported && index >= 0) {\r\n return this.storage.key(index);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the given value after stringifying as JSON\r\n * @param {string} key - the storage key to store under\r\n * @param {T} value - the value to serialize and store\r\n */\r\n public setObject(key: string, value: T): void {\r\n (value !== undefined)\r\n ? this.setItem(key, JSON.stringify(value))\r\n : this.removeItem(key);\r\n }\r\n\r\n /**\r\n * Removes the given key from storage and returns the existing value parsed\r\n * @param {string} key - the key to remove.\r\n */\r\n public removeObject(key: string): T {\r\n const value = this.removeItem(key);\r\n if (value != null) {\r\n return tryParseJson(value);\r\n }\r\n }\r\n\r\n /**\r\n * Set given key's value to local storage\r\n * @param {string} key - Key name\r\n * @param {string} value - Key value\r\n */\r\n public setItem(key: string, value: string): void {\r\n if (this.supported) {\r\n // Catch quota exceeded exception\r\n try {\r\n this.storage.setItem(key, value);\r\n } catch (e) {\r\n logger.logError(e);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Remove key item from local storage\r\n * @param {string} key - Key name\r\n * @returns {string} Key value\r\n */\r\n public removeItem(key: string): string {\r\n if (this.supported) {\r\n const value = this.getItem(key);\r\n this.storage.removeItem(key);\r\n return value;\r\n }\r\n }\r\n\r\n /**\r\n * Removes all keys containing the given substring in the storage key\r\n * @param {string} substring The substring to check\r\n */\r\n public removeSubstringKeys(substring: string): void {\r\n if (!this.supported || !substring) {\r\n return;\r\n }\r\n\r\n const matchingKeys = [];\r\n for (let index = 0; index < this.storage.length; index++) {\r\n const storageKey = this.key(index);\r\n if (storageKey && storageKey.includes(substring)) {\r\n matchingKeys.push(storageKey);\r\n }\r\n }\r\n\r\n for (let index = 0; index < matchingKeys.length; index++) {\r\n this.removeItem(matchingKeys[index]);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Local storage class for persistent storage\r\n */\r\nexport class LocalStorage extends WebStorage {\r\n constructor() {\r\n let storage: Storage;\r\n\r\n try {\r\n storage = \"localStorage\" in window && window.localStorage;\r\n } catch (ex) {\r\n // Getting local storage failed. Can happen in Chrome when user has disabled cookies.\r\n }\r\n\r\n super(storage);\r\n }\r\n\r\n /**\r\n * Checks whether localStorage is available or not.\r\n * Need to aggressively check because iOS5 & Safari Private Browsing mode will throw error.\r\n * This is how the library Modernizr does localStorage check. (MIT License)\r\n * For more details:\r\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js\r\n */\r\n public localStorageExists(trackAppErrorEvent: (data: AppError) => void): boolean {\r\n if (canUseDOM()) {\r\n const storageTest = \"storageTest\";\r\n try {\r\n window.localStorage.setItem(storageTest, storageTest);\r\n window.localStorage.removeItem(storageTest);\r\n return true;\r\n } catch (e) {\r\n if (trackAppErrorEvent || typeof trackAppErrorEvent === \"function\") {\r\n trackAppErrorEvent({\r\n ...CoreLibAppErrors.LocalStorageDoesntExist,\r\n message: `Local Storage is not defined ${e}`\r\n });\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * Session storage class for persistent storage\r\n */\r\nexport class SessionStorage extends WebStorage {\r\n constructor() {\r\n let storage: Storage;\r\n\r\n try {\r\n storage = \"sessionStorage\" in window && window.sessionStorage;\r\n } catch (ex) {\r\n // Getting session storage failed. Can happen in Chrome when user has disabled cookies.\r\n }\r\n\r\n super(storage);\r\n }\r\n\r\n /**\r\n * Checks whether sessionStorage is available or not.\r\n * Need to aggressively check because iOS5 & Safari Private Browsing mode will throw error.\r\n * This is how the library Modernizr does sessionStorage check. (MIT License)\r\n * For more details:\r\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/sessionstorage.js\r\n */\r\n public sessionStorageExists(trackAppErrorEvent: (data: AppError) => void): boolean {\r\n if (canUseDOM()) {\r\n const storageTest = \"storageTest\";\r\n try {\r\n window.sessionStorage.setItem(storageTest, storageTest);\r\n window.sessionStorage.removeItem(storageTest);\r\n return true;\r\n } catch (e) {\r\n if (trackAppErrorEvent || typeof trackAppErrorEvent === \"function\") {\r\n trackAppErrorEvent({\r\n ...CoreLibAppErrors.SessionStorageDoesntExist,\r\n message: `Session Storage is not defined: ${e}`\r\n });\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\n\r\nexport const localStorage = new LocalStorage();\r\nexport const sessionStorage = new SessionStorage();","// © Microsoft Corporation. All rights reserved.\r\n\r\n/// Creates a function defined as \"extend\" that functions similiar to jQuery's extend function.\r\n\r\nfunction isArray(arr) {\r\n // Check support for isArray\r\n if (Array.isArray) {\r\n return Array.isArray(arr);\r\n } else {\r\n return Object.prototype.toString.call(arr).toLowerCase() === \"[object array]\";\r\n }\r\n}\r\n\r\nfunction extend(...args: any[]) {\r\n let target = args[0] || {};\r\n let ndx = 1;\r\n let key;\r\n let obj;\r\n let isRecursive;\r\n let src;\r\n\r\n if (typeof target == \"boolean\" || typeof target == \"number\") {\r\n isRecursive = !!target;\r\n target = args[1];\r\n ndx = 2;\r\n }\r\n for (; ndx < args.length; ndx++) {\r\n obj = args[ndx];\r\n for (key in obj) {\r\n if (obj[key] !== undefined && obj[key] !== null) {\r\n if (isRecursive && typeof obj[key] == \"object\") {\r\n src = target[key];\r\n if (typeof src != \"object\") {\r\n if (isArray(obj[key])) {\r\n src = [];\r\n } else {\r\n src = {};\r\n }\r\n }\r\n\r\n extend(true, src, obj[key]);\r\n target[key] = src;\r\n } else {\r\n target[key] = obj[key];\r\n }\r\n }\r\n }\r\n }\r\n return target;\r\n}\r\n\r\nexport default extend;\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { AadAccountType, AccountType, AppType, AudienceModeType, AuthCookieName } from \"@msnews/experiences-constants\";\r\nimport { AppErrorPropertyBag, getAppErrorsPropertyBag, getPageTimings, updateAppErrorsPropertyBag } from \"@msnews/diagnostics\";\r\nimport { EnterpriseOneServiceApi, appAnonCookieExistsCookieName, childCookieName, rootElementId, serviceUrl, telemetryId, trackPageProduct, trackPageType } from \"../constants\";\r\nimport { Environment, getEnvironmentFromString } from \"./Environment\";\r\nimport { HostPage, IHostPage } from \"./HostPage\";\r\nimport { WpoModel, getWpoFlights, getWpoStorageCacheKey, isWpoEnabled } from \"@msnews/wpo-common\";\r\nimport { canUseDOM, getDocumentElementById, getLocationHostname, getLocationHref, getLocationOrigin, getLocationSearch } from \"@msnews/isomorphic-util\";\r\nimport { getCookie, getMuidCookie } from \"../utilities/CookieUtility\";\r\n\r\nimport { AccountInfo } from \"./Enterprise\";\r\nimport { Market } from \"./Market\";\r\nimport { PageRequestTargetScope } from \"./PageRequestTargetScope\";\r\nimport { PlatformType } from \"cms-models-msn/configuration/types/PlatformType\";\r\nimport { UrlUtility } from \"../utilities/UrlUtility\";\r\nimport { Utility } from \"../utilities/Utility\";\r\nimport { headData } from \"./HeadData\";\r\nimport { isNullOrUndefined } from \"util\";\r\nimport { isString } from \"lodash-es\";\r\nimport { localStorage } from \"../utilities/WebStorage\";\r\n\r\n/**\r\n * chrome\r\n * The chrome API is not defined in Typescript\r\n */\r\ndeclare global {\r\n interface Window { chrome: any; }\r\n}\r\n\r\n/**\r\n * Page level experience tracking info\r\n */\r\nexport interface ITrackInfo {\r\n sitePage: {\r\n page_product: string,\r\n page_type: string\r\n }\r\n}\r\n\r\nexport class AppEnvironment {\r\n /**\r\n * The single instance of the AppEnvironment class.\r\n * @type {AppEnvironment}\r\n */\r\n private static _instance: AppEnvironment;\r\n\r\n /**\r\n * the activity id for the current page view\r\n */\r\n private activityId: string;\r\n\r\n /**\r\n * Base url for the content service, endpoints/queries are appended for specific content calls.\r\n * This is an akamai url for highly cacheable content.\r\n * Possible values are enumerated on ContentServiceConfig.ts\r\n *\r\n * @private\r\n * @type {string}\r\n * @memberof AppEnvironment\r\n */\r\n private contentServiceUrlBase: URL;\r\n\r\n private currentRequestTargetScope: PageRequestTargetScope;\r\n\r\n private currentMarket: Market;\r\n private hostPage: IHostPage;\r\n\r\n /** The hostname to use for content links. */\r\n private currentContentLinkHost: string;\r\n\r\n /**\r\n * Indicates that the page is running as an FRE page (i.e. the url contains fre=1)\r\n * Does not indicate that the FRE itself is currently displayed over the page.\r\n */\r\n private isFrePage: boolean;\r\n\r\n /**\r\n * Base for the service url, endpoints/queries are appended for specific service calls.\r\n * This is the OneService url used for personalized content.\r\n * Possible values are enumerated on OneServiceConfig.ts\r\n *\r\n * @private\r\n * @type {string}\r\n * @memberof AppEnvironment\r\n */\r\n private serviceUrlBase: URL;\r\n\r\n /**\r\n * Base URL for the feed service\r\n */\r\n private feedServiceUrlBase: URL;\r\n\r\n /**\r\n * The account info for the current page user wrapped in a promise\r\n */\r\n private accountInfoPromise: Promise;\r\n\r\n /**\r\n * The resolved account info. This is only set when the account info promise is resolved.\r\n */\r\n private resolvedAccountInfo: AccountInfo;\r\n\r\n private appType: string;\r\n private authCookieName: AuthCookieName;\r\n private buildVersion: string;\r\n\r\n private environmentConfigUrl: URL;\r\n\r\n private rootTelemetryId: number;\r\n private trackInfo: ITrackInfo;\r\n private userId: string;\r\n private countryCode: string;\r\n private latitude: string;\r\n private longitude: string;\r\n private environment: Environment;\r\n private assetsHost: string;\r\n private featureFlags: any;\r\n private disableCachingConfigs: boolean;\r\n private enableConfigService: boolean;\r\n private isMultiConfigRetrievalEnabled: boolean;\r\n private configServiceBaseUrl: URL;\r\n private disableContentPreviewCache: boolean;\r\n private disableContentCacheIDBRead: boolean;\r\n private disableContentListCache: boolean;\r\n private disableContentListCacheIDBRead: boolean;\r\n private sendFeedCallActivityIdInHeader: boolean;\r\n private useOneServiceAuthEndpoints: boolean;\r\n private clarityEnabled: boolean;\r\n\r\n /** True if query string has appropriate debug flag */\r\n private isDebug: boolean;\r\n\r\n /** True if query string has appropriate flag to show msnCreatorDashboard (msnDash=) */\r\n private showMnsCreatorDashboard: boolean;\r\n\r\n /** Config Root Url */\r\n private configRootUrl: URL;\r\n\r\n /** Cache busting identifier received from pcs */\r\n private cacheBustingIdentifier: string;\r\n\r\n /** True if account is AAD otherwise false */\r\n private isAadAccount: boolean;\r\n\r\n /**\r\n * ActivityId value from initial server response, use telemetry's requestId instead for associating with current page client navigation\r\n */\r\n public get ActivityId(): string { return this.activityId; }\r\n\r\n /**\r\n * Getter for the base url for the content service, endpoints/queries are appended for specific content calls.\r\n * This is an akamai url for highly cacheable content.\r\n * Possible values are enumerated on ContentServiceConfig.ts\r\n *\r\n * @readonly\r\n * @type {URL}\r\n * @memberof AppEnvironment\r\n */\r\n public get EnvironmentConfigUrl(): URL {\r\n // If I mutate the same object, I will need to revert to the original state somewhere.\r\n // For safety reason, it is better to use a new Object\r\n const url = new URL(\"\", this.environmentConfigUrl);\r\n\r\n if (process.env.WEBPACK_DEV_SERVER || new URLSearchParams(getLocationSearch()).get(\"env\") === \"dev\") {\r\n url.searchParams.set(\"env.config\", \"dev\");\r\n }\r\n\r\n const searchParam = new URLSearchParams(getLocationSearch()).get(\"env.config\");\r\n if (searchParam) {\r\n url.searchParams.set(\"env.config\", searchParam);\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /**\r\n * Getter for the base url for the content service, endpoints/queries are appended for specific content calls.\r\n * This is an akamai url for highly cacheable content.\r\n * Possible values are enumerated on ContentServiceConfig.ts\r\n *\r\n * @readonly\r\n * @type {URL}\r\n * @memberof AppEnvironment\r\n */\r\n public get ContentServiceUrlBase(): URL {\r\n // If I mutate the same object, I will need to revert to the original state somewhere.\r\n // For safety reason, it is better to use a new Object\r\n const url = new URL(\"\", this.contentServiceUrlBase);\r\n\r\n if (process.env.WEBPACK_DEV_SERVER || new URLSearchParams(getLocationSearch()).get(\"env\") === \"dev\") {\r\n url.searchParams.set(\"env.content\", \"dev\");\r\n }\r\n\r\n const searchParam = new URLSearchParams(getLocationSearch()).get(\"env.content\");\r\n if (searchParam) {\r\n url.searchParams.set(\"env.content\", searchParam);\r\n }\r\n\r\n return url;\r\n }\r\n\r\n public get CurrentRequestTargetScope(): PageRequestTargetScope { return this.currentRequestTargetScope; }\r\n public get CurrentMarket(): Market { return this.currentMarket; }\r\n public get Environment(): Environment { return this.environment; }\r\n public get AssetsHost(): string { return this.assetsHost; }\r\n public get HostPage(): IHostPage { return this.hostPage; }\r\n public get AppType(): string { return this.appType; }\r\n public get AuthCookieName(): AuthCookieName { return this.authCookieName; }\r\n public get UseOneServiceAuthEndpoints(): boolean { return this.useOneServiceAuthEndpoints; }\r\n public get AccountInfoPromise(): Promise { return this.accountInfoPromise; }\r\n public get ResolvedAccountInfo(): AccountInfo { return this.resolvedAccountInfo; }\r\n public get BuildVersion(): string { return this.buildVersion; }\r\n public get ClarityEnabled(): boolean { return this.clarityEnabled; }\r\n public get IsAadAccount(): boolean { return this.isAadAccount; }\r\n\r\n /** True if query string has appropriate debug flag */\r\n public get IsDebug(): boolean { return this.isDebug; }\r\n\r\n /** True if query string has appropriate flag to show msnCreatorDashboard (msnDash=) */\r\n public get ShowMnsCreatorDashboard(): boolean { return this.showMnsCreatorDashboard; }\r\n\r\n /**\r\n * Gets the host to use when linking to content.\r\n */\r\n public get contentLinkHost(): string { return this.currentContentLinkHost; }\r\n\r\n /**\r\n * Getter for the base for the service url, endpoints/queries are appended for specific service calls.\r\n * This is the oneservice url used for personalized content.\r\n * Possible values are enumerated on OneServiceConfig.ts\r\n *\r\n * @type {URL}\r\n * @memberof AppEnvironment\r\n */\r\n public get ServiceUrlBase(): URL {\r\n const url = new URL(\"\", this.serviceUrlBase);\r\n\r\n if (process.env.WEBPACK_DEV_SERVER || new URLSearchParams(getLocationSearch()).get(\"env\") === \"dev\") {\r\n url.searchParams.set(\"env.service\", \"dev\");\r\n }\r\n\r\n const searchParam = new URLSearchParams(getLocationSearch()).get(\"env.service\");\r\n if (searchParam) {\r\n url.searchParams.set(\"env.service\", searchParam);\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /**\r\n * Base URL for the feed service\r\n */\r\n public get FeedServiceUrlBase(): URL {\r\n if (!this.feedServiceUrlBase) {\r\n return null;\r\n }\r\n\r\n const url = new URL(\"\", this.feedServiceUrlBase);\r\n\r\n if (process.env.WEBPACK_DEV_SERVER || new URLSearchParams(getLocationSearch()).get(\"env\") === \"dev\") {\r\n url.searchParams.set(\"env.service\", \"dev\");\r\n }\r\n\r\n const searchParam = new URLSearchParams(getLocationSearch()).get(\"env.service\");\r\n if (searchParam) {\r\n url.searchParams.set(\"env.service\", searchParam);\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /**\r\n * Base URL for the enterprise service\r\n */\r\n public get EnterpriseServiceUrlBase(): URL {\r\n const url = new URL(\"\", EnterpriseOneServiceApi);\r\n\r\n if (process.env.WEBPACK_DEV_SERVER || new URLSearchParams(getLocationSearch()).get(\"env\") === \"dev\") {\r\n url.searchParams.set(\"env.service\", \"dev\");\r\n }\r\n\r\n const searchParam = new URLSearchParams(getLocationSearch()).get(\"env.service\");\r\n if (searchParam) {\r\n url.searchParams.set(\"env.service\", searchParam);\r\n }\r\n\r\n return url;\r\n }\r\n\r\n public get IsFrePage(): boolean { return this.isFrePage; }\r\n\r\n public get RootTelemetryId(): number { return this.rootTelemetryId; }\r\n public get TrackInfo(): ITrackInfo { return this.trackInfo; }\r\n public get UserId(): string { return this.getUserMuid() || this.userId; }\r\n\r\n /**\r\n * This is the switch to turn on/off indexed db operation used as a caching layer in config resolver (Resolver.ts)\r\n */\r\n public get DisableCachingConfigs(): boolean { return this.disableCachingConfigs; }\r\n\r\n /**\r\n * This is the switch to turn on/off config service operation in Resolver.ts\r\n */\r\n public get EnableConfigService(): boolean { return this.enableConfigService; }\r\n\r\n /**\r\n * This indicates whether we will use CMS PPE configs or not\r\n */\r\n public get EnableCMSPPEConfigs(): boolean { return headData && headData.EnableCMSPPEConfigs; }\r\n\r\n /**\r\n * Check whether multi config retrieval is supported.\r\n */\r\n public get IsMultiConfigRetrievalEnabled(): boolean { return this.isMultiConfigRetrievalEnabled; }\r\n\r\n /**\r\n * This is the switch to turn on/off content preview caching in core/cache/ContentPreview.ts\r\n */\r\n public get DisableContentPreviewCache(): boolean {\r\n return this.disableContentPreviewCache;\r\n }\r\n\r\n /**\r\n * Returns a flag indicating whether the one service feed fetch call should send activityID\r\n * in the request header or as a QSP in the URL (current behavior is via QSP).\r\n */\r\n public get SendFeedCallActivityIdInHeader(): boolean {\r\n return this.sendFeedCallActivityIdInHeader;\r\n }\r\n\r\n /**\r\n * This is the switch to turn off hydrating content preview cache from IndexedDB.\r\n * Default is false\r\n */\r\n public get DisableContentCacheIDBRead(): boolean {\r\n const queryParamOverride = UrlUtility.getQueryParameterByName(\"disableContentCacheIDBRead\", getLocationSearch());\r\n\r\n if (queryParamOverride) {\r\n return queryParamOverride === \"true\";\r\n }\r\n\r\n return this.disableContentCacheIDBRead;\r\n }\r\n\r\n /**\r\n * This is the switch to turn on/off content list caching in core/cache/ContentPreview.ts\r\n */\r\n public get DisableContentListCache(): boolean {\r\n return this.disableContentListCache;\r\n }\r\n\r\n /**\r\n * This is the switch to turn off hydrating content list cache from IndexedDB.\r\n * Default is false\r\n */\r\n public get DisableContentListCacheIDBRead(): boolean {\r\n const queryParamOverride = UrlUtility.getQueryParameterByName(\"disableContentListCacheIDBRead\", getLocationSearch());\r\n\r\n if (queryParamOverride) {\r\n return queryParamOverride === \"true\";\r\n }\r\n\r\n return this.disableContentListCacheIDBRead;\r\n }\r\n\r\n /**\r\n * Get base url of Config Service.\r\n */\r\n public get ConfigServiceBaseUrl(): URL { return this.configServiceBaseUrl; }\r\n\r\n /**\r\n * This returns feature flags client settings stamped by PCS.\r\n */\r\n public get FeatureFlags(): any { return this.featureFlags; }\r\n\r\n /**\r\n * This returns config root url\r\n */\r\n public get ConfigRootUrl(): URL {\r\n if (!this.configRootUrl) {\r\n return null;\r\n }\r\n\r\n const url = new URL(\"\", this.configRootUrl);\r\n\r\n if (process.env.WEBPACK_DEV_SERVER || new URLSearchParams(getLocationSearch()).get(\"env\") === \"dev\") {\r\n url.searchParams.set(\"env.config\", \"dev\");\r\n }\r\n\r\n const searchParam = new URLSearchParams(getLocationSearch()).get(\"env.config\");\r\n if (searchParam) {\r\n url.searchParams.set(\"env.config\", searchParam);\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /**\r\n * Returns cache busting identifier from PCS.\r\n */\r\n public get CacheBustingIdentifier(): string { return this.cacheBustingIdentifier; }\r\n\r\n /**\r\n * Returns the country code. For example \"br\"\r\n */\r\n public get CountryCode(): string { return this.countryCode; }\r\n\r\n /// / FIXME: hyphen has a second 'h'\r\n /// / Bug 24228723: [Peregrine] ActivityIdLowerCaseNoHypens misspells \"Hyphen\"\r\n /**\r\n * Gets the Activity ID in lower case and without any hyphens. This helper method should be where parity with Prime is required.\r\n * Use telemetry's requestId instead for associating with current page client navigation\r\n */\r\n public get ActivityIdLowerCaseNoHypens(): string { return ((headData && headData.ClientSettings && headData.ClientSettings.aid) || \"\").toLowerCase(); }\r\n\r\n /**\r\n * Returns the latitude. For example \"42.361145\"\r\n */\r\n public get Latitude(): string { return this.latitude; }\r\n\r\n /**\r\n * Returns the longitude. For example \"-71.057083\"\r\n */\r\n public get Longitude(): string { return this.longitude; }\r\n\r\n public set ActivityId(value: string) { this.activityId = value; }\r\n public set CountryCode(value: string) { this.countryCode = value; }\r\n public set CurrentMarket(value: Market) { this.currentMarket = value; }\r\n public set CurrentRequestTargetScope(value: PageRequestTargetScope) { this.currentRequestTargetScope = value; }\r\n public set Environment(value: Environment) { this.environment = value; }\r\n public set HostPage(value: IHostPage) { this.hostPage = value; }\r\n public set RootTelemetryId(value: number) { this.rootTelemetryId = value; }\r\n public set TrackInfo(value: ITrackInfo) { this.trackInfo = value; }\r\n public set UserId(value: string) { this.userId = value; }\r\n public set AuthCookieName(value: AuthCookieName) { this.authCookieName = value; }\r\n public set ResolvedAccountInfo(value: AccountInfo) { this.resolvedAccountInfo = value; }\r\n public set AccountInfoPromise(value: Promise) { this.accountInfoPromise = value; }\r\n public set UseOneServiceAuthEndpoints(value: boolean) { this.useOneServiceAuthEndpoints = value; }\r\n public set ClarityEnabled(value: boolean) { this.clarityEnabled = value; }\r\n public set IsAadAccount(value: boolean) { this.isAadAccount = value; }\r\n\r\n /**\r\n * Initialize the AppEnvironment singleton instance.\r\n * @param _serviceUrl Optional URL to initialize the ServiceUrlBase.\r\n * @param _configServiceUrlBase ConfigServiceUrlBase provided during server side rendering this is the ServiceFabric ClusterRegionUrl.\r\n */\r\n private constructor(_serviceUrl: URL, _configServiceUrlBase: string) {\r\n this.initializeAppEnvironment(_serviceUrl, _configServiceUrlBase);\r\n }\r\n\r\n /**\r\n * Returns singleton class instance.\r\n * @returns {AppEnvironment}\r\n */\r\n public static getInstance(serviceUrl: URL = null, configServiceUrlBase: string = null): AppEnvironment {\r\n return AppEnvironment._instance || (AppEnvironment._instance = new AppEnvironment(serviceUrl, configServiceUrlBase));\r\n }\r\n\r\n /**\r\n * Reinitialize the singleton class instance.\r\n * @param serviceUrl OneService service url to initialize to.\r\n * @param configServiceUrlBase Config service url to initialize to.\r\n * @returns {AppEnvironment}\r\n */\r\n public static resetInstance(serviceUrl: URL = null, configServiceUrlBase: string = null): AppEnvironment {\r\n AppEnvironment._instance = new AppEnvironment(serviceUrl, configServiceUrlBase);\r\n appEnvironment = AppEnvironment._instance;\r\n return AppEnvironment._instance;\r\n }\r\n\r\n /**\r\n * Initializes App environment. This is normally only called by the constructor (singleton pattern)\r\n * It is made public so that it can be also called by test code.\r\n */\r\n public initializeAppEnvironment(_serviceUrl?: URL, configServiceUrlBase?: string): void {\r\n\r\n let environmentFromHeadData: Environment = null;\r\n const clientSettings = headData && headData.ClientSettings;\r\n\r\n if (clientSettings) {\r\n this.activityId = this.tryReformatGuid(clientSettings.aid);\r\n this.buildVersion = clientSettings.v;\r\n this.currentMarket = (headData.Locale || clientSettings.apps_locale) as Market;\r\n this.countryCode = clientSettings.geo_country;\r\n this.latitude = clientSettings.geo_lat;\r\n this.longitude = clientSettings.geo_long;\r\n this.configRootUrl = clientSettings.configRootUrl ? new URL(\"\", clientSettings.configRootUrl) : null;\r\n environmentFromHeadData = getEnvironmentFromString(clientSettings.env);\r\n\r\n this.setAccountInfoPromise();\r\n this.appType = clientSettings.apptype || \"\";\r\n this.authCookieName = this.getAuthCookieName();\r\n this.useOneServiceAuthEndpoints = false;\r\n\r\n this.featureFlags = clientSettings.featureFlags;\r\n\r\n this.disableCachingConfigs =\r\n this.featureFlags && this.featureFlags.disableCachingConfigs\r\n ? this.featureFlags.disableCachingConfigs === \"true\"\r\n : false;\r\n\r\n this.enableConfigService =\r\n this.featureFlags && this.featureFlags.enableConfigService\r\n ? this.featureFlags.enableConfigService === \"true\"\r\n : true;\r\n\r\n this.disableContentPreviewCache =\r\n this.featureFlags && this.featureFlags.disableContentPreviewCache\r\n ? this.featureFlags.disableContentPreviewCache === \"true\"\r\n : false;\r\n\r\n this.disableContentCacheIDBRead = this.featureFlags && this.featureFlags.disableContentCacheIDBRead\r\n ? this.featureFlags.disableContentCacheIDBRead === \"true\"\r\n : false;\r\n\r\n this.disableContentListCache =\r\n this.featureFlags && this.featureFlags.disableContentListCache\r\n ? this.featureFlags.disableContentListCache === \"true\"\r\n : false;\r\n\r\n this.disableContentListCacheIDBRead = this.featureFlags && this.featureFlags.disableContentListCacheIDBRead\r\n ? this.featureFlags.disableContentListCacheIDBRead === \"true\"\r\n : false;\r\n\r\n // Hardcode flight details for experimentation sake\r\n // Use feature flag as a switch to disable the feature, since we may not be able to stop the flight itself (will need a PCS deployment)\r\n this.sendFeedCallActivityIdInHeader = this.featureFlags && this.featureFlags.disableActivityIdInHeader && this.featureFlags.disableActivityIdInHeader === \"true\"\r\n ? false\r\n : this.appType === AppType.Edge;\r\n\r\n this.cacheBustingIdentifier = clientSettings.cbid;\r\n\r\n if (clientSettings.pcsInfo && !getAppErrorsPropertyBag().pcsVersion) {\r\n const propertyBagPcsVersion: AppErrorPropertyBag = {\r\n pcsVersion: clientSettings.pcsInfo.v\r\n };\r\n\r\n updateAppErrorsPropertyBag(propertyBagPcsVersion);\r\n }\r\n }\r\n\r\n const rootElement = canUseDOM() ? getDocumentElementById(rootElementId) : null;\r\n const locationHref = getLocationHref();\r\n const locationOrigin = getLocationOrigin();\r\n\r\n // env is read from\r\n // - query string param env, if present\r\n // - headData.ClientSettings.env\r\n // - defaults to prod otherwise\r\n const envQSOverwrite = getEnvironmentFromString(UrlUtility.getQueryParameterByName(\"env\", locationHref));\r\n this.environment =\r\n envQSOverwrite\r\n || environmentFromHeadData\r\n || Environment.prod;\r\n\r\n this.serviceUrlBase = _serviceUrl || (rootElement && rootElement.getAttribute(serviceUrl) && new URL(\"\", rootElement.getAttribute(serviceUrl))) || new URL(\"\", \"https://assets.msn.com/service/\");\r\n\r\n // Find the host for the Akamai assets store.\r\n this.assetsHost = getLocationHostname().endsWith(\".cn\") ? \"assets.msn.cn\" : \"assets.msn.com\";\r\n\r\n // Dependency (revert back when complete):\r\n // Deliverable 27138476: [PCS] China pages should point to assets via assets.msn.cn for all endpoints send from PCS.\r\n // This is also applied to WW Environment.\r\n // Only default to assets.msn.com if anaheim, msftnews or edge.\r\n // Should never be applied to MMX due to additional handshake overhead\r\n const defaultFeedBaseDomain = this.appType === AppType.EdgeChromium || this.appType === AppType.MicrosoftNews || this.appType === AppType.Edge ? `https://${this.assetsHost}` : locationOrigin;\r\n\r\n // If PCS sent the feed base domain, use it for the feed URL base\r\n // or else default to host page rooted URL.\r\n this.feedServiceUrlBase = new URL(\"./service/\", clientSettings && clientSettings.feedBaseDomain ? clientSettings.feedBaseDomain : defaultFeedBaseDomain);\r\n\r\n // Get the hostPage from the request url\r\n this.hostPage = HostPage.getHostPageFromUrl(locationHref);\r\n\r\n // Determine if the page is running as an FRE page\r\n this.isFrePage = (UrlUtility.getQueryParameterByName(\"fre\", locationHref) === \"1\");\r\n\r\n this.userId = this.getUserMuid();\r\n\r\n // Get attributes from the head (full page Peregrine experience) or from the spa \"root\" element (PrimeHybrid case)\r\n // TODO, determine where in the element attributes these values should be set\r\n this.rootTelemetryId = rootElement ? Number(rootElement.getAttribute(telemetryId)) : 0;\r\n const trackPageProd = rootElement && rootElement.getAttribute(trackPageProduct);\r\n const trackPageTypeVal = rootElement && rootElement.getAttribute(trackPageType);\r\n this.trackInfo = { sitePage: { page_product: trackPageProd, page_type: trackPageTypeVal } };\r\n\r\n this.contentServiceUrlBase = new URL(\"\", \"https://assets.msn.com/content/\");\r\n\r\n this.currentContentLinkHost = this.createContentLinkHost();\r\n\r\n this.setTargetScope();\r\n\r\n this.isMultiConfigRetrievalEnabled = this.useMultiConfigsRetrieval();\r\n\r\n const baseUrl = this.getConfigServiceBaseUrl(this.isMultiConfigRetrievalEnabled, configServiceUrlBase);\r\n this.configServiceBaseUrl = baseUrl ? new URL(\"\", baseUrl) : null;\r\n\r\n this.environmentConfigUrl = new URL(\"\", \"https://assets.msn.com/config/v1/\");\r\n\r\n this.isDebug = ((UrlUtility.getQueryParameterByName(\"debug\", locationHref) || \"\").toLowerCase() in { 1: 1, true: 1 })\r\n || (UrlUtility.getQueryParameterByName(\"item\", locationHref) || \"\").toLowerCase().indexOf(\"/debug\") > 0;\r\n\r\n this.showMnsCreatorDashboard = UrlUtility.getQueryParameterByName(\"mnsDash\", locationHref) != null;\r\n\r\n this.setIsAadAccount();\r\n }\r\n\r\n /** Sets 'isAadAccount' flag to true if user account type is AAD otherwise false */\r\n private setIsAadAccount(): void {\r\n this.isAadAccount = isNullOrUndefined(headData.AadState)\r\n ? AccountType.AAD === (this.ResolvedAccountInfo && this.ResolvedAccountInfo.account_type)\r\n : headData.AadState;\r\n }\r\n\r\n /**\r\n * Get the UserMuid from the muid cookie\r\n */\r\n private getUserMuid(): string {\r\n let muid: string;\r\n const muidCookie: string = getMuidCookie();\r\n if (isString(muidCookie)) {\r\n muid = \"m-\" + muidCookie;\r\n }\r\n return muid;\r\n }\r\n\r\n /**\r\n * Get config service base url\r\n * @param isMultiConfigRetrievalEnabled if multiple config retrieval is supported.\r\n * @param configServiceUrlBase externally configured config service url (from SSR environment)\r\n * @returns {string} - config service base url.\r\n */\r\n private getConfigServiceBaseUrl(isMultiConfigRetrievalEnabled = true, configServiceUrlBase?: string): string {\r\n const relativePath = `/resolver/api/resolve/${isMultiConfigRetrievalEnabled ? \"v2/\" : \"\"}configindex/`;\r\n\r\n if (configServiceUrlBase) {\r\n // When doing server side rendering the ClusterRegionUrl env variable should be set, use this to avoid calls to CRS going outside of the cluster.\r\n return configServiceUrlBase + relativePath;\r\n } else if (process.env.WEBPACK_DEV_SERVER || this.environment === Environment.int) {\r\n // int and localhost to use int.msn.com for config service.\r\n return \"https://int.msn.com\" + relativePath;\r\n } else {\r\n return getLocationOrigin() ? getLocationOrigin() + relativePath : null;\r\n }\r\n }\r\n\r\n /**\r\n * Function checks if ConfigService should return multiple configs\r\n * @returns true if supported else false.\r\n */\r\n private useMultiConfigsRetrieval(): boolean {\r\n const urlQuery = getLocationSearch();\r\n if (urlQuery) {\r\n const param = UrlUtility.getQueryParameterByName(\"isMultiConfigRetrievalEnabled\", urlQuery);\r\n if (param) {\r\n return param.toLocaleLowerCase() === \"true\";\r\n }\r\n }\r\n\r\n // PCS flag to turn on/off multi config retrieval.\r\n if (this.featureFlags\r\n && this.featureFlags.isMultiConfigRetrievalEnabled) {\r\n return this.featureFlags.isMultiConfigRetrievalEnabled === \"true\";\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Get the auth cookie name based on the app type of the page\r\n * @returns {AuthCookieName} - the name of the auth cookie to use\r\n */\r\n private getAuthCookieName(): AuthCookieName {\r\n const clientSettings = headData && headData.ClientSettings;\r\n const appType: AppType = (clientSettings.apptype || \"\") as AppType;\r\n let authCookieName: AuthCookieName;\r\n switch (appType) {\r\n case AppType.FirstParty:\r\n case AppType.Hub:\r\n case AppType.MicrosoftNews:\r\n case AppType.Views:\r\n case AppType.Weather:\r\n authCookieName = AuthCookieName.Anon;\r\n break;\r\n case AppType.Edge:\r\n case AppType.EdgeChromium:\r\n case AppType.MMX:\r\n case AppType.Office:\r\n default:\r\n authCookieName = AuthCookieName.AppAnon;\r\n }\r\n\r\n return authCookieName;\r\n }\r\n\r\n /**\r\n * Sets the AccountInfoPromise for the current user.\r\n * If unable to await, ResolvedAccountInfo is also set when the promise is resolved.\r\n */\r\n private setAccountInfoPromise(): void {\r\n this.ResolvedAccountInfo = null;\r\n this.AccountInfoPromise = new Promise((resolve) => {\r\n if (!canUseDOM() || !window.chrome || !window.chrome.authPrivate || !window.chrome.authPrivate.getPrimaryAccountInfo) {\r\n return resolve(null);\r\n }\r\n\r\n const markerName = \"Auth.GetPrimaryAccountInfo\";\r\n const startTime = Math.round(performance.now());\r\n\r\n window.chrome.authPrivate.getPrimaryAccountInfo((accountInfo) => {\r\n const endTime = Math.round(performance.now());\r\n const pageTimings = getPageTimings();\r\n pageTimings[markerName] = endTime - startTime;\r\n\r\n this.ResolvedAccountInfo = accountInfo;\r\n return resolve(accountInfo);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Determines the content link host to use.\r\n * @returns The content link host.\r\n */\r\n private createContentLinkHost(): string {\r\n const topLevelDomain = this.currentMarket === Market.ZHCN ? \"cn\" : \"com\";\r\n return \"www.msn.\" + topLevelDomain;\r\n }\r\n\r\n /**\r\n * Reformats the given guid without dashes to a guid string with dashes.\r\n * @param {string} guid - The guid without dashes.\r\n * @returns {string} - The reformatted GUI with dashes.\r\n */\r\n private tryReformatGuid(guid: string): string {\r\n if (guid && guid.length === 32) {\r\n // use a regex to extract the specific substrings to reformat the guid\r\n const matches = guid.match(/(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})/i);\r\n if (matches) {\r\n // join all the captured groups from 1-5 to format the final guid string\r\n guid = matches.slice(1).join(\"-\");\r\n }\r\n }\r\n\r\n return guid;\r\n }\r\n\r\n /**\r\n * Sets target scope for current request.\r\n */\r\n private setTargetScope(): void {\r\n if (!headData || !headData.ClientSettings) {\r\n return;\r\n }\r\n\r\n // If user is signed in and \"child\" Cookie exists - set Kids audience mode, otherwise use PCS provided Audience mode.\r\n let audienceMode: AudienceModeType;\r\n if (getCookie(appAnonCookieExistsCookieName) && getCookie(childCookieName)) {\r\n audienceMode = AudienceModeType.Kids;\r\n } else {\r\n audienceMode = headData.ClientSettings.audienceMode || AudienceModeType.Adult;\r\n }\r\n\r\n const { browser, deviceFormFactor, domain, locale, os, pagetype } = headData.ClientSettings;\r\n\r\n this.currentRequestTargetScope = {\r\n audienceMode: audienceMode,\r\n browser: browser,\r\n deviceFormFactor: deviceFormFactor,\r\n domain: domain,\r\n locale: locale,\r\n os: os,\r\n platform: PlatformType.Web,\r\n pageType: pagetype\r\n };\r\n\r\n // if locale is not defined in client settings, try reading it from headData for backward compatibility\r\n if (!this.currentRequestTargetScope.locale && Utility.stringHasData(headData.Locale)) {\r\n const locale = headData.Locale.split(\"-\");\r\n if (locale.length > 1) {\r\n this.currentRequestTargetScope.locale = {\r\n language: locale[0],\r\n // Some spartan locale are in format \"ha-latn-ng\". Here the market is \"ng\" and language is \"ha\"\r\n market: locale[locale.length - 1]\r\n };\r\n }\r\n }\r\n\r\n if (Utility.stringHasData(headData.CurrentFlights)) {\r\n this.currentRequestTargetScope.pageExperiments = headData.CurrentFlights.split(\",\");\r\n }\r\n\r\n this.addWpoFlights();\r\n }\r\n\r\n /**\r\n * Adds WPO flights to the current request target scope pageExperiments.\r\n */\r\n private addWpoFlights(): void {\r\n\r\n if (!isWpoEnabled(this.currentRequestTargetScope.pageExperiments)) {\r\n return;\r\n }\r\n\r\n const key: string = getWpoStorageCacheKey(this.appType, this.currentRequestTargetScope);\r\n const wpoData: WpoModel = localStorage.getObject(key);\r\n const flightsCached: string[] = getWpoFlights(wpoData);\r\n\r\n if (!flightsCached) {\r\n return;\r\n }\r\n\r\n this.currentRequestTargetScope.pageExperiments = this.currentRequestTargetScope.pageExperiments.concat(flightsCached);\r\n }\r\n}\r\n\r\nexport const getAppEnvironment = AppEnvironment.getInstance;\r\n\r\n// appEnvironment can be reinitialized for server side rendering through resetAppEnvironment.\r\nexport let appEnvironment = AppEnvironment.getInstance();\r\n\r\nexport const resetAppEnvironment = AppEnvironment.resetInstance;","// © Microsoft Corporation. All rights reserved.\r\n\r\n// Front Door issues an activityID (which we refer to as a RID) per page view and we use this ID in tracking and ad calls,\r\n// There are specific circumstances where we need a unique GUID for every event, for example when navigating between slideshow images or refreshing ads withoug a page refresh\r\n// example usage:\r\n// mediator.pub(\"updatePageInstance\");\r\n// var trackInfoRequestId = pageInstance.getRequestId() || trackInfo.sitePage.requestId;\r\n\r\nimport guidGen from \"./guidGen\";\r\nimport mediator from \"./mediator\";\r\nimport telemetryConstants from \"./telemetryconstants\";\r\n\r\nlet rid;\r\nconst pageInstanceEventName = \"updatePageInstance\";\r\nconst updatePageInstance = function () {\r\n rid = guidGen().replace(/-/g, \"\");\r\n\r\n mediator.pub(telemetryConstants.ResetIdx);\r\n\r\n // replace the impression guid for bing search box\r\n const form = document.body.querySelector(\"#srchfrm\");\r\n if (form) {\r\n const refigInputs = form.querySelectorAll(\"input[name='refig']\");\r\n const length = refigInputs.length;\r\n for (let i = 0; i < length; i++) {\r\n // @ts-ignore\r\n refigInputs[i].value = rid;\r\n }\r\n }\r\n};\r\n\r\nmediator.sub(pageInstanceEventName, updatePageInstance);\r\n\r\nexport default {\r\n getRequestId: function() { return rid; },\r\n setRequestId: function (newRequestId) {\r\n rid = newRequestId;\r\n\r\n // Reset eventIndex (telemetry related params) everytime requestId gets set\r\n mediator.pub(telemetryConstants.ResetIdx);\r\n },\r\n eventName: pageInstanceEventName,\r\n\r\n // exposing direct call to updatePageInstance to eliminate delay rid update\r\n // when executed via mediator.pub\r\n updatePageInstance: updatePageInstance\r\n };\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { toNumber as _toNumber, isString } from \"lodash-es\";\r\n\r\nexport type KeyValuePair = { key: K, value: V };\r\nexport type KeyValueArray = KeyValuePair[];\r\n\r\nexport namespace Utility {\r\n /**\r\n * Check if given value is not null. Returns true when not null, otherwise false.\r\n *\r\n * @export\r\n * @param {any} value - Value to check for not null\r\n * @return {boolean}\r\n */\r\n export function isNotNullOrUndefined(value: any): boolean {\r\n return typeof value !== \"undefined\" && value !== null;\r\n }\r\n\r\n export interface IHashable {\r\n /**\r\n * This function will return the string representation of the complex object\r\n * @type {function}\r\n */\r\n toString(): string;\r\n }\r\n\r\n /**\r\n * Check if given value is defined. Returns true when defined, otherwise false.\r\n *\r\n * @export\r\n * @param {any} value - Value to check for defined\r\n * @return {boolean}\r\n */\r\n export function isDefined(value: any): boolean {\r\n return (typeof value !== \"undefined\");\r\n }\r\n\r\n /**\r\n * Check if a given value is a valid key value pair\r\n *\r\n * @export\r\n * @param potentialKeyValuePair\r\n * @return {boolean}\r\n */\r\n export function isKeyValuePair(potentialKeyValuePair: { key: K, value: V },\r\n isKey: (key: K) => boolean,\r\n isValue: (value: V) => boolean): boolean {\r\n return Utility.isNonNullObject(potentialKeyValuePair)\r\n && isKey(potentialKeyValuePair.key)\r\n && isValue(potentialKeyValuePair.value);\r\n }\r\n\r\n /**\r\n * Check if given value is a non null object. Returns true when value is non null , otherwise false.\r\n *\r\n * @export\r\n * @param {any} value - Value to check for non null\r\n * @return {boolean}\r\n */\r\n export function isNonNullObject(value: any): boolean {\r\n return value && typeof value === \"object\";\r\n }\r\n\r\n /**\r\n * Check if given value is not null. Returns true when not null, otherwise false.\r\n *\r\n * @export\r\n * @param {any} value - Value to check for not null\r\n * @return {boolean}\r\n */\r\n export function isNotNull(value: any): boolean {\r\n return value !== null;\r\n }\r\n\r\n /**\r\n * Check if given value is a a non-null or non-empty string. Returns true when it is, otherwise false.\r\n *\r\n * @export\r\n * @param {string} value - Value to check for string\r\n * @return {boolean}\r\n */\r\n export function isNullOrWhiteSpace(value: string): boolean {\r\n return !isString(value) || value.trim() === \"\";\r\n }\r\n\r\n /**\r\n * Converts string to number\r\n *\r\n * @export\r\n * @param {string} value - string to convert to a number\r\n * @param {number} defaultValue - number to return if there is an error\r\n * @return {number}\r\n */\r\n export function toNumber(value: string, defaultValue = -1): number {\r\n if (!value) {\r\n return defaultValue;\r\n }\r\n\r\n const result = _toNumber(value);\r\n if (!isNaN(result)) {\r\n return result;\r\n } else {\r\n return defaultValue;\r\n }\r\n }\r\n\r\n /**\r\n * Check if given value is an array with content in it.\r\n * Returns true when value is an array with content, otherwise false.\r\n *\r\n * @export\r\n * @param {any[]} value - Value to check for array with content\r\n * @return {boolean}\r\n */\r\n export function arrayHasData(value: any[]): boolean {\r\n if (isNotNullOrUndefined(value)) {\r\n return ((value.constructor === Array) && (value.length > 0));\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if given value is a string with content in it.\r\n * Returns true when value is a string with content, otherwise false.\r\n *\r\n * @export\r\n * @param {string} value - Value to check for string with content\r\n * @return {boolean}\r\n */\r\n export function stringHasData(value: string): boolean {\r\n return (isString(value) && (value.trim().length > 0));\r\n }\r\n\r\n /**\r\n * Convert object to string representation for it's values.\r\n * @param {object} object - The object to convert\r\n * @returns {string}\r\n */\r\n export function objectToString(object: object): string {\r\n let value = \"\";\r\n let firstRun = true;\r\n\r\n if (typeof object !== \"object\") {\r\n return value;\r\n }\r\n\r\n for (const attribute in object) {\r\n if (typeof object[attribute] === \"object\") {\r\n value += firstRun ? `${objectToString(object[attribute])}` : `-${objectToString(object[attribute])}`;\r\n } else {\r\n value += firstRun ? `${object[attribute]}` : `-${object[attribute]}`;\r\n }\r\n\r\n firstRun = false;\r\n }\r\n\r\n return value;\r\n }\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { BrowserConsoleAppender } from \"clientcore-infrastructure-analytics/appenders/BrowserConsoleAppender\";\r\nimport { ILoggingService } from \"clientcore-infrastructure-analytics/ILoggingService\";\r\nimport { LogLevel } from \"clientcore-infrastructure-analytics/models/LogLevel\";\r\nimport { LoggingService } from \"clientcore-infrastructure-analytics/LoggingService\";\r\nimport { NodeConsoleAppender } from \"clientcore-infrastructure-analytics/appenders/NodeConsoleAppender\";\r\nimport { RuntimeEnvironment } from \"clientcore-infrastructure-analytics/RuntimeEnvironment\";\r\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\r\n\r\n/** The Logger class */\r\nexport class Logger {\r\n /** A default instance of the Logger class. */\r\n public static readonly defaultInstance: Logger = new Logger();\r\n\r\n /** Backing field for the isDebug function */\r\n private isDebugEnabled: boolean;\r\n\r\n /** The common logger for the application. The logging level for this is updated in initialize */\r\n private logger: ILoggingService;\r\n\r\n /** Backing field to hold reference to the window object */\r\n private windowObj?: Window;\r\n\r\n /**\r\n * The constructor\r\n */\r\n private constructor() {\r\n if (canUseDOM()) {\r\n this.setupBrowserEnvironment(window);\r\n\r\n if (this.isDebugEnabled) {\r\n // @ts-ignore\r\n window.webpackRequire = __webpack_require__;\r\n }\r\n } else {\r\n this.setupNodeEnvironment();\r\n }\r\n }\r\n\r\n /**\r\n * Setup client side logging environment - this sets / overrides the Window obj\r\n * @param windowObj - The Window obj to use\r\n */\r\n public setupBrowserEnvironment(windowObj: Window): void {\r\n this.logger = LoggingService.getInstance(\"ExperienceLogger\", LogLevel.Info, RuntimeEnvironment.Browser);\r\n\r\n this.windowObj = windowObj;\r\n\r\n // Once we have a WindowObj, we can determine if debug mode is enabled\r\n this.isDebugEnabled = ((this.getQueryParameterByName(windowObj.location.href, \"debug\") || \"\").toLowerCase() in { 1: 1, true: 1 });\r\n\r\n this.setupLogLevel();\r\n }\r\n\r\n /**\r\n * Setup server side logging environment\r\n */\r\n public setupNodeEnvironment(): void {\r\n this.logger = LoggingService.getInstance(\"ExperienceLogger\", LogLevel.Info, RuntimeEnvironment.NodeJs);\r\n this.isDebugEnabled = false; // isDebugEnabled should be set explictly using the setDebug method\r\n this.setupLogLevel();\r\n }\r\n\r\n /**\r\n * Returns the logging service\r\n * @returns {ILoggingService}\r\n */\r\n public getLoggingService(): ILoggingService {\r\n return this.logger;\r\n }\r\n\r\n /**\r\n * Checks whether we're running in debug mode.\r\n * @returns True when either debug=1 or debug=true is present as a query param, otherwise false.\r\n */\r\n public isDebug(): boolean {\r\n return this.isDebugEnabled;\r\n }\r\n\r\n /**\r\n * Override the isDebug setting. Useful when server side rendering.\r\n */\r\n public setDebug(isDebug: boolean): void {\r\n this.isDebugEnabled = isDebug;\r\n this.setupLogLevel();\r\n }\r\n\r\n /**\r\n * Log console message.\r\n * Note that these are not output to the console unless you're in debug mode.\r\n * @param message - Message to log.\r\n */\r\n public log(message: string): void {\r\n if (this.isDebug()) {\r\n if (!canUseDOM()) {\r\n // currently the logger is incredibly verbose when printing on the server side.\r\n // For now just directly print to console.\r\n // Work Item to address this: http://osgvsowi/24861651\r\n console.log(\"logger.info:\", message);\r\n } else {\r\n this.logger.info(message);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Log error message.\r\n * @param message - Message to log\r\n */\r\n public logError(message: string): void {\r\n this.logger.error(message);\r\n }\r\n\r\n /**\r\n * Lazy log console message. Use this when the message being constructed is complex or expensive so that it's only evaluated if needed.\r\n * Note that the callback is not invoked and the message is not output unless you're in debug mode.\r\n * @param getMessage - The function to call to get message to log\r\n */\r\n public logCallback(getMessage: () => string): void {\r\n this.logger.infoCallback(getMessage);\r\n }\r\n\r\n /**\r\n * Log the object to the console.\r\n * Note that these are not output to the console unless you're in debug mode.\r\n * @param message - Array of messages to log\r\n */\r\n public logObjects(...message: any[]): void {\r\n if (this.isDebug()) {\r\n if (canUseDOM() && this.windowObj) {\r\n this.windowObj.console.log(...message);\r\n } else {\r\n console.log(\"logger.logObjects:\", ...message);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Set logger log level.\r\n */\r\n private setupLogLevel(): void {\r\n // Note that we need to set the level at the root logger level or else the callback versions of the logging\r\n // methods will still be invoked to disseminate the message to the appenders.\r\n this.logger.setLevel(this.isDebug() ? LogLevel.Info : LogLevel.Error);\r\n this.setupAppenders();\r\n }\r\n\r\n /**\r\n * Add relevant appenders to the logger depending.\r\n */\r\n private setupAppenders(): void {\r\n this.logger.removeAllAppenders();\r\n if (canUseDOM()) {\r\n this.logger.addAppender(new BrowserConsoleAppender(this.logger.getLevel()));\r\n } else {\r\n this.logger.addAppender(new NodeConsoleAppender(this.logger.getLevel()));\r\n }\r\n }\r\n\r\n /**\r\n * Utility method to extract query string param in url.\r\n * @param name - Query param name\r\n * @returns Query param value\r\n */\r\n private getQueryParameterByName(locationHref: string, name: string): string {\r\n\r\n const nameRegEx = name.replace(/[[\\]]/g, \"\\\\$&\");\r\n const regex: any = new RegExp(\"[?&]\" + nameRegEx + \"(=([^&#]*)|&|#|$)\");\r\n\r\n const queryNameValueMatches: any = regex.exec(locationHref);\r\n if (!queryNameValueMatches) {\r\n return null;\r\n }\r\n\r\n // the second group would contain the value of the param\r\n const queryValue = queryNameValueMatches[2];\r\n\r\n return decodeURIComponent(queryValue.replace(/\\+/g, \" \")) || \"\";\r\n }\r\n}\r\n\r\nexport const logger = Logger.defaultInstance;","// © Microsoft Corporation. All rights reserved.\r\n/**\r\n * Default query param prefix used if none specified\r\n */\r\nexport const DefaultQueryParamPrefix = \"rd\";\r\n/**\r\n * Generates a plain JavaScript object with the client values.\r\n * @param values The values to convert.\r\n */\r\nfunction objectFromSpecification(values) {\r\n const requestDataValue = values;\r\n if (requestDataValue.clientValue !== undefined) {\r\n // If it's a IRequestDataValueSpecification, return the actual getter\r\n return requestDataValue.clientValue;\r\n }\r\n // Otherwise recurse for each key until we find a plain value type\r\n return Object\r\n .keys(values)\r\n .reduce((pv, cv) => (Object.assign(Object.assign({}, pv), { [cv]: objectFromSpecification(values[cv]) })), {});\r\n}\r\n/**\r\n * Allows you to pass data about a request between client and server.\r\n * This interface can be used isomorphically.\r\n *\r\n * The \"spec\" contains \"getters\" to receive the data when called client side.\r\n * To operate server-side you must first serialize the client-side data and pass it via\r\n * query string parameters to the server. You then \"load\" the query string parameters using\r\n * \"loadQueryParams\". Once loaded you can request the data server-side with the same\r\n * interface as the client.\r\n *\r\n * NOTE: The use of URLSearchParams makes this not IE11 compatible without polyfill.\r\n *\r\n * @example\r\n * interface IRequestContext extends IRequestDataObject {\r\n * window: {\r\n * innerWidth: IRequestDataValue\r\n * }\r\n * }\r\n *\r\n * // On client and server\r\n * const rd = new RequestData(\r\n * {\r\n * window: {\r\n * innerWidth: {\r\n * clientValue: window.innerWidth\r\n * }\r\n * }\r\n * });\r\n *\r\n * // Client-side\r\n * const innerWidth = rd.data.window.innerWidth();\r\n *\r\n * const serialized = rd.getSerializedData();\r\n * // Make-call to server\r\n * fetch(`https://assets.msn.com/render?${serialized}`);\r\n *\r\n * // Server-side (in default module)\r\n * requestData.loadQueryParams(req.query)\r\n * const innerWidth = rd.data.window.innerWidth();\r\n */\r\nexport class RequestData {\r\n /**\r\n * @param spec Spec contains serialization metadata as well as client and server value getters\r\n * @param qspPrefix Prefix to append to serialized query string parameters\r\n */\r\n constructor(spec, qspPrefix) {\r\n this.spec = spec;\r\n this.qspPrefix = qspPrefix || DefaultQueryParamPrefix;\r\n }\r\n get verParam() {\r\n return `${this.qspPrefix}.ver`;\r\n }\r\n /**\r\n * Will return memoized values in the same structure as IRequestDataSpecification,\r\n * or the data loaded into\r\n */\r\n get data() {\r\n if (this.memo === undefined) {\r\n // Assume we're client-side if we haven't memoized query string params\r\n this.memo = objectFromSpecification(this.spec.spec);\r\n }\r\n return this.memo;\r\n }\r\n /**\r\n * Loads all query string parameters prefixed with qspPrefix into request data.\r\n * @param qsp The query string params to parse. It is safe to pass in the entire query--not just data prefixed by qspPrefix.\r\n */\r\n loadQueryParams(qsp) {\r\n if (this.memo !== undefined) {\r\n throw \"overwriting existing query string parameters.\";\r\n }\r\n const ver = qsp.get([this.qspPrefix, \"ver\"].join(\".\"));\r\n if (ver !== this.spec.ver) {\r\n throw `unmatched spec version: expected \"${this.spec.ver}\" but got ${ver}.`;\r\n }\r\n this.memo = {};\r\n // Load each query string parameter one at a time\r\n qsp.forEach((value, qp) => {\r\n if (!qp.startsWith(this.qspPrefix)) {\r\n // We don't belong in this set (we don't have the right prefix)--ignore.\r\n return;\r\n }\r\n if (qp === this.verParam) {\r\n // Skip version\r\n return;\r\n }\r\n // Split key by dots and remove prefix\r\n const split = qp.split(\".\").slice(1);\r\n let current = this.memo;\r\n split.forEach((key, i) => {\r\n let newValue = {}; // assume object unless last in list\r\n if (i === split.length - 1) {\r\n try {\r\n newValue = () => JSON.parse(value);\r\n }\r\n catch (ex) {\r\n // Reset memo to undefined and re-throw\r\n this.memo = undefined;\r\n throw ex;\r\n }\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(current, key)) {\r\n current[key] = newValue;\r\n }\r\n if (typeof newValue === \"object\") {\r\n // Already exists--don't overwrite\r\n current = current[key];\r\n return;\r\n }\r\n });\r\n });\r\n }\r\n /**\r\n * Gets the stored values serialized as strings\r\n */\r\n getURLSearchParams() {\r\n const params = new URLSearchParams();\r\n /**\r\n * recurse traverses the data object to build dotted prefixes.\r\n * e.g.\r\n * { a: { b: { c: 5 } } } becomes a.b.c=5\r\n */\r\n const recurse = (obj, prefix) => {\r\n Object.keys(obj).forEach(k => {\r\n const current = obj[k];\r\n const currentPrefix = [...prefix, k];\r\n if (typeof current === \"object\") {\r\n recurse(current, currentPrefix);\r\n return;\r\n }\r\n // This will put explicit quotes (%22) around strings in the query, which is intentional\r\n // so JSON.parse is able to determine the correct type for the value.\r\n params.append(currentPrefix.join(\".\"), JSON.stringify(current()));\r\n });\r\n };\r\n recurse(this.data, [this.qspPrefix]);\r\n params.sort();\r\n // Version is always at the end\r\n params.append(this.verParam, this.spec.ver);\r\n return params;\r\n }\r\n /**\r\n * Sort the search params and serialize them to string.\r\n */\r\n getSerializedData() {\r\n return this.getURLSearchParams().toString();\r\n }\r\n}\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * The param-name prefix used when serializing params onto the query string.\r\n */\r\nexport const SSRRequestDataPrefix = \"rd\";\r\n\r\n/**\r\n * Defines the \"interop\" contract between client and server-side renderer.\r\n * All of these values will be serialized into request parameters to be passed\r\n * on the HTTP request to the SSR server.\r\n */\r\nexport const SSRContract = {\r\n ver: \"0.1.0\",\r\n spec: {\r\n // IWindow\r\n innerWidth: {\r\n clientValue: () => window.innerWidth\r\n },\r\n innerHeight: {\r\n clientValue: () => window.innerHeight\r\n },\r\n // IBrowser\r\n canUseCssGrid: {\r\n clientValue: () => ((window.CSS && window.CSS.supports && CSS.supports(\"display\", \"grid\")) || false)\r\n },\r\n // IDevice\r\n pixelRatio: {\r\n clientValue: () => window.devicePixelRatio\r\n },\r\n // ILocale\r\n language: {\r\n clientValue: () => document.documentElement.lang\r\n },\r\n direction: {\r\n clientValue: () => document.documentElement.dir\r\n }\r\n }\r\n};\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { AppEnvironment, appEnvironment } from \"..\";\r\nimport { IRequestContext, IRequestData } from \"./IRequestContext\";\r\nimport { IRequestDataSpecification, RequestData } from \"@msnews/ssr-server\";\r\nimport { SSRContract, SSRRequestDataPrefix } from \"@msnews/isomorphic-util\";\r\n\r\n/**\r\n * Defines the parameters used to create a request contract.\r\n * Destructured from an object due to the combinations of parameters that are valid.\r\n */\r\nexport interface IRequestContextContract {\r\n /**\r\n * URL Search params that contain request data (client-side values sent to the server).\r\n * Only required when called server-side\r\n */\r\n params?: URLSearchParams;\r\n\r\n /**\r\n * The prefix to use to pull query params related to request data.\r\n */\r\n qspPrefix?: string;\r\n\r\n /**\r\n * The specification defining what request data should be passed between client and server.\r\n */\r\n spec?: IRequestDataSpecification;\r\n}\r\n\r\n/**\r\n * Used to propagate client-only data (like window.innerWidth) and singletons (like AppEnvironment)\r\n * in a non-global way to assist in making all libs/components/experiences isomorphic.\r\n */\r\nexport class RequestContext implements IRequestContext {\r\n private requestData: RequestData;\r\n\r\n /**\r\n * Create a new request context.\r\n *\r\n * If spec or qspPrefix is not provided it will use the defaults specified in \"@msnews/isomorphic-util\"\r\n *\r\n * @param IRequestContextContract parameters used to initialize the request context\r\n */\r\n constructor({ params, qspPrefix, spec }: IRequestContextContract = {}) {\r\n this.requestData = new RequestData(spec || SSRContract, qspPrefix || SSRRequestDataPrefix);\r\n if (params) {\r\n this.requestData.loadQueryParams(params);\r\n }\r\n }\r\n\r\n /**\r\n * The request ID is used to distinguish requests server-side.\r\n * This method passes through the app environment ActivityId\r\n */\r\n public get requestId(): string {\r\n return this.app.ActivityId;\r\n }\r\n\r\n /**\r\n * The current app environment.\r\n */\r\n public get app(): AppEnvironment {\r\n // TODO: Remove global reference and add to the constructor parameters.\r\n // The constructor should create a new app environment or accept an optional override.\r\n return appEnvironment;\r\n }\r\n\r\n /**\r\n * The current request data. i.e. client-side data that is passed\r\n * between client and server.\r\n */\r\n public get data(): IRequestData {\r\n return this.requestData.data;\r\n }\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { IsForceTimestampExpired, RenderCacheConfig, getRenderCacheKeys } from \".\";\r\nimport { RenderCache, RenderCacheKeys } from \"./RenderCache\";\r\nimport { RenderCacheErrors, logger } from \"@msnews/diagnostics\";\r\nimport { appEnvironment, localStorage } from \"@msnews/core\";\r\nimport { batchCSS, scrapeDom } from \"./Helper\";\r\nimport { defaultExpirationTimeMs, expirationPrefix, forceTimestampPrefix, jssMapSuffix, keysPrefix, locationHref, renderCacheKeyOfNormalizedKeys, storagePrefix } from \"./Constants\";\r\n\r\nimport { local } from \"d3-selection\";\r\nimport { track } from \"@msnews/telemetry-transitional\";\r\nimport { userInteractionHappened } from \"./UserInteractionWatcher\";\r\n\r\nconst jssGeneratedClassesMap: { [instanceId: string]: Array } = {};\r\nlet jssCaptureCompleted = false;\r\n\r\n/**\r\n * Persist the complete render state (DOM and Styles) necessary to restore the rendered Peregrine SPA page, without needing to\r\n * first load all of the Peregrine experience bundles.\r\n * This is the equivalent of using Server Side Rendering to generate the initial DOM, though in this case the initial DOM elements and styles\r\n * are persisted and loaded locally on the client.\r\n * @param config Render cache configuration.\r\n * @param stateJson The state to persist in JSON form.\r\n * @param markers List of performance markers, which will be fired upon cache restore.\r\n * @param invokeFallback Canvas specific fallback function to be executed on jss exception.\r\n */\r\nexport function persistRenderCache(config: RenderCacheConfig, stateJson?: string, markers?: string[], invokeFallback?: (message: string) => void): void {\r\n jssCaptureCompleted = true;\r\n\r\n if (!config || !localStorage.supported || !window.renderCacheEnabled) {\r\n return;\r\n }\r\n\r\n // Get normalized render cache keys\r\n const renderCacheKeys: RenderCacheKeys = getRenderCacheKeys(config && config.normalizeKeyParamsList);\r\n\r\n // Check if we need to refresh cache by force. Used as Failsafe if user stuck in broken render cache loop.\r\n if (IsForceTimestampExpired(config && config.forceExpirationTime)) {\r\n removeRenderCache();\r\n logger.log(\"[RC Info] Force timestamp expired: removing render cache\");\r\n return;\r\n }\r\n\r\n // Found an issue with User interaction check. Its inconsistent and as we are not deleting RC on this,\r\n // users may get stuck in this state.\r\n if (userInteractionHappened()) {\r\n return;\r\n }\r\n\r\n // When critical jss mismatch is detected - do not persist and based on config decide to purge and fallback\r\n if (criticalJssMismatchDetected(config, invokeFallback)) {\r\n return;\r\n }\r\n\r\n let { includeNewsFeed, expirationTime, newsFeedExpirationTime } = config;\r\n\r\n // Persist build version recorded for the page being render cached\r\n const buildVersion = appEnvironment.BuildVersion || \"\";\r\n\r\n // Form Cache Object\r\n const renderCacheStorageObj: RenderCache = {\r\n dom: scrapeDom(includeNewsFeed),\r\n batch_css: batchCSS(),\r\n build_version: buildVersion,\r\n markers,\r\n state: stateJson\r\n };\r\n\r\n expirationTime = (includeNewsFeed ? newsFeedExpirationTime : expirationTime)\r\n || defaultExpirationTimeMs;\r\n\r\n // Try to persist Render Cache and Timestamp\r\n const expiresOn: number = new Date().getTime() + expirationTime;\r\n\r\n localStorage.setObject(renderCacheKeys.expn, expiresOn);\r\n localStorage.setObject(renderCacheKeys.keyn, renderCacheStorageObj);\r\n}\r\n\r\n/**\r\n * Deletes render cache local storage for all domains\r\n */\r\nexport function removeRenderCache(): void {\r\n if (!localStorage.supported) {\r\n return;\r\n }\r\n\r\n // The render cache Urls are currently not normalized, so we have different render\r\n // cache saved for DHP and NTP page. But, some of the properties (example: market)\r\n // is shared between those pages. To ensure a purge on render cache on one page,\r\n // does purge the other render cache as well, and avoid breaking the page layout,\r\n // we remove all render cache keys on removeRenderCache\r\n localStorage.removeSubstringKeys(storagePrefix);\r\n localStorage.removeSubstringKeys(expirationPrefix);\r\n localStorage.removeSubstringKeys(forceTimestampPrefix);\r\n localStorage.removeSubstringKeys(keysPrefix);\r\n localStorage.removeSubstringKeys(jssMapSuffix);\r\n}\r\n\r\n/**\r\n * Deletes render cache local storage only for current href\r\n */\r\nexport function removeCurrentRenderCache(): void {\r\n if (!localStorage.supported) {\r\n return;\r\n }\r\n\r\n const renderCacheKeys: RenderCacheKeys = getRenderCacheKeys();\r\n localStorage.removeObject(renderCacheKeys.keyn);\r\n localStorage.removeObject(renderCacheKeys.frcn);\r\n localStorage.removeObject(renderCacheKeys.expn);\r\n localStorage.removeObject(renderCacheKeys.jssn);\r\n localStorage.removeObject(renderCacheKeyOfNormalizedKeys);\r\n}\r\n\r\n/**\r\n * Capture class names generated by JSS and maintain inside a dictionary.\r\n * @param key key for class name\r\n * @param val JSS val for class name\r\n */\r\nexport function captureJssGeneratedClasses(key: string, val: string): void {\r\n if (jssCaptureCompleted || !(window && window.renderCacheEnabled)) {\r\n return;\r\n }\r\n\r\n if (jssGeneratedClassesMap[key]) {\r\n jssGeneratedClassesMap[key].push(val);\r\n } else {\r\n jssGeneratedClassesMap[key] = [val];\r\n }\r\n}\r\n\r\n/**\r\n * Compares stored JSS Map with current JSS Map and log corresponding app errors\r\n * @param config Render cache configuration.\r\n * @param invokeFallback Canvas specific fallback function to be executed on jss exception.\r\n * @returns boolean - returns true when there is critical jss mismatch, otherwise false\r\n */\r\nexport function criticalJssMismatchDetected(config: RenderCacheConfig, invokeFallback?: (message: string) => void): boolean {\r\n // if we haven't captured any generated classes log an app error and return\r\n if (Object.keys(jssGeneratedClassesMap).length === 0) {\r\n logJssMismatchAppError(RenderCacheErrors.JssStyleMismatchWarning, \"Generated classes map is empty. \");\r\n return false;\r\n }\r\n\r\n const { isJssIdentical, isCriticalJssIdentical, jssWarningMessage, jssErrorMessage } = compareJssMap(config);\r\n\r\n // in case of non critical JSS mismatch we just log an app warning\r\n if (!isJssIdentical) {\r\n logJssMismatchAppError(RenderCacheErrors.JssStyleMismatchWarning, jssWarningMessage);\r\n } else {\r\n // in case there are no mismatches - write back the newly generated class map back to localstorage\r\n Object.keys(jssGeneratedClassesMap).length && localStorage.setObject(getRenderCacheKeys().jssn, jssGeneratedClassesMap);\r\n logger.log(\"[RC Info] No style mismatch found\");\r\n }\r\n\r\n // in case of critical JSS mismatch, log an app error and based on config\r\n // decide to purge and invoke canvas specific fallback\r\n if (!isCriticalJssIdentical) {\r\n logJssMismatchAppError(RenderCacheErrors.JssStyleCriticalMismatchError, jssErrorMessage);\r\n\r\n if (config && config.enablePurgeOnJssMismatch) {\r\n removeRenderCache();\r\n\r\n if (config && config.enableFallbackOnJssMismatch && invokeFallback && typeof invokeFallback === \"function\") {\r\n invokeFallback(jssErrorMessage);\r\n }\r\n }\r\n }\r\n\r\n return !isCriticalJssIdentical;\r\n}\r\n\r\n/**\r\n * Compares stored JSS Map with current JSS Map and identifies if those are critical vs non critical error message with corresponding error message\r\n * @param config Render cache configuration.\r\n * @returns object - returns mismatch and error information\r\n */\r\nfunction compareJssMap(config: RenderCacheConfig): { isJssIdentical: boolean, isCriticalJssIdentical: boolean, jssWarningMessage: string, jssErrorMessage: string } {\r\n let jssErrorMessage = \"\";\r\n let jssWarningMessage = \"\";\r\n let isCriticalJssIdentical = true;\r\n let isJssIdentical = true;\r\n\r\n const jssCriticalClassListMap: { [className: string]: boolean } = getJssCriticalClassListMap(config && config.jssCriticalClassList || []);\r\n\r\n const storedMap = localStorage.getObject(getRenderCacheKeys().jssn);\r\n if (storedMap && typeof storedMap === \"object\" && Object.keys(storedMap).length) {\r\n // this for loop compares every item in stored Map of Css class names to the current page instance map\r\n for (const key in storedMap) {\r\n const storedClasses = storedMap[key];\r\n\r\n // if stored class isn't correctly set, log a non critical app app warning and return\r\n if (!Array.isArray(storedClasses)) {\r\n return { isJssIdentical: false, isCriticalJssIdentical: true, jssWarningMessage: `Stored classes expected to be an array, but received something else. stored val: ${storedClasses}. `, jssErrorMessage: \"\" };\r\n }\r\n\r\n /*\r\n We only care about extra classes being present in the stored classes. If the current page\r\n instance has new class names not present in the stored map, we do not consider this a mismatch\r\n since the render cache snapshot won't be broken due to this scenario. Also if there are no\r\n classes corresponding to a key in the current map, detect that as a mismatch as well.\r\n\r\n --- Scenario 1: (detect as a mismatch) ---\r\n storedClasses : k1: { [c1, c2, c3] }\r\n currentClasses: k1: { [c1, c2] }\r\n\r\n --- Scenario 2: (do not detect as a mismatch) ---\r\n storedClasses : k1: { [c1, c2] }\r\n currentClasses: k1: { [c1, c2, c3] }\r\n\r\n --- Scenario 3: (detect as a mismatch) ---\r\n storedClasses : k1: { [c1, c2] }\r\n currentClasses: k2: { [c3, c4, c5] }\r\n */\r\n const currentClasses = jssGeneratedClassesMap[key];\r\n if (currentClasses) {\r\n if (storedClasses.some(className => currentClasses.indexOf(className) === -1)) {\r\n const errorMessage = `JSSError: val mismatch for key: ${key}, val stored: ${storedClasses}, new val: ${currentClasses}. `;\r\n if (jssCriticalClassListMap[key]) {\r\n jssErrorMessage += errorMessage;\r\n isCriticalJssIdentical = false;\r\n }\r\n\r\n jssWarningMessage += errorMessage;\r\n isJssIdentical = false;\r\n }\r\n } else {\r\n const errorMessage = `JSSError: val mismatch for key: ${key}, val stored: ${storedClasses}, new val: '' (empty). `;\r\n if (jssCriticalClassListMap[key]) {\r\n jssErrorMessage += errorMessage;\r\n isCriticalJssIdentical = false;\r\n }\r\n\r\n jssWarningMessage += errorMessage;\r\n isJssIdentical = false;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n isJssIdentical: isJssIdentical,\r\n isCriticalJssIdentical: isCriticalJssIdentical,\r\n jssWarningMessage: jssWarningMessage,\r\n jssErrorMessage: jssErrorMessage\r\n };\r\n}\r\n\r\n/**\r\n * Helper function to log render cache jss mismatch app errors\r\n * @param errorParams The error params.\r\n * @param customMessage The custom message to be logged.\r\n */\r\nfunction logJssMismatchAppError(errorParams: any, customMessage: string): void {\r\n track.trackAppErrorEvent({\r\n ...errorParams,\r\n message: \"RC JSS mismatch issue\",\r\n pb: {\r\n ...errorParams.pb,\r\n customMessage: customMessage\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Helper function to generate critical class list map\r\n * @param jssCriticalClassList The critical class list array\r\n * @returns jssCriticalClassListMap The map of critical class list\r\n */\r\nfunction getJssCriticalClassListMap(jssCriticalClassList: [string?]) {\r\n const jssCriticalClassListMap: { [className: string]: boolean } = {};\r\n jssCriticalClassList.forEach((key) => {\r\n jssCriticalClassListMap[key] = true;\r\n jssCriticalClassListMap[key + \" - jssStyleSheet\"] = true;\r\n });\r\n\r\n return jssCriticalClassListMap;\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { getRequestData } from \"./requestData\";\r\n\r\n/**\r\n * Checks if the DOM is available to access and use.\r\n * @returns {boolean} - true if DOM is available, or false if it is not. This is typically true for\r\n * client side rendering and false for server side rendering.\r\n */\r\nexport function canUseDOM(): boolean {\r\n return !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\r\n}\r\n\r\n/**\r\n * Get window.location.href in an isomorphic manner.\r\n */\r\nexport function getLocationHref(): string {\r\n return canUseDOM() ? window.location.href : getRequestData().url.href;\r\n}\r\n\r\n/**\r\n * Get window.location.hostname in an isomorphic manner.\r\n */\r\nexport function getLocationHostname(): string {\r\n return canUseDOM() ? window.location.hostname : getRequestData().url.hostname;\r\n}\r\n\r\n/**\r\n * Get window.location.host in an isomorphic manner.\r\n */\r\nexport function getLocationHost(): string {\r\n return canUseDOM() ? window.location.host : getRequestData().url.host;\r\n}\r\n\r\n/**\r\n * Get window.location.origin in an isomorphic manner.\r\n */\r\nexport function getLocationOrigin(): string {\r\n return canUseDOM() ? window.location.origin : getRequestData().url.origin;\r\n}\r\n\r\n/**\r\n * Get window.location.search in an isomorphic manner.\r\n */\r\nexport function getLocationSearch(): string {\r\n return canUseDOM() ? window.location.search : getRequestData().url.search;\r\n}\r\n\r\n/**\r\n * Get window.location.pathname in an isomorphic manner.\r\n */\r\nexport function getLocationPathname(): string {\r\n return canUseDOM() ? window.location.pathname : getRequestData().url.pathname;\r\n}\r\n\r\n/**\r\n * Get window.location.protocol in an isomorphic manner.\r\n */\r\nexport function getLocationProtocol(): string {\r\n return canUseDOM() ? window.location.protocol : getRequestData().url.protocol;\r\n}\r\n\r\n/**\r\n * Get window.location.hash in an isomorphic manner.\r\n */\r\nexport function getLocationHash(): string {\r\n return canUseDOM() ? window.location.hash : getRequestData().url.hash;\r\n}\r\n\r\n/**\r\n * Get window.document.getElementById(elementId).\r\n */\r\nexport function getDocumentElementById(elementId: string): HTMLElement {\r\n if (!canUseDOM()) {\r\n throw new Error(\"getDocumentElementById is unsupported server side. This call should be wrapped in canUseDOM().\");\r\n }\r\n\r\n return window.document.getElementById(elementId);\r\n}\r\n\r\n/**\r\n * Get window.document.getDocumentElementsByTagName(elementId).\r\n */\r\nexport function getDocumentElementsByTagName(tagName: string): HTMLCollectionOf {\r\n if (!canUseDOM()) {\r\n throw new Error(\"getDocumentElementsByTagName is unsupported server side. This call should be wrapped in canUseDOM().\");\r\n }\r\n\r\n return window.document.getElementsByTagName(tagName);\r\n}\r\n\r\n/**\r\n * Get localStorage in an isomorphic manner.\r\n * Todo (http://osgvsowi/23753462), provide actual functionality for localStorage on the server side.\r\n */\r\nexport function getLocalStorage(): Storage {\r\n return canUseDOM() ? window.localStorage : null;\r\n}\r\n\r\n/**\r\n * Get indexedDB in an isomorphic manner.\r\n * Todo (http://osgvsowi/23753462), provide actual functionality for indexedDB on the server side.\r\n */\r\nexport function getIndexedDB(): IDBFactory {\r\n return canUseDOM() ? window.indexedDB : null;\r\n}\r\n\r\n/**\r\n * Get window.innerWidth in an isomorphic manner.\r\n * Todo (http://osgvsowi/23876778), remove the need for server to know about innerWidth by limiting layout options or use CSS based solution.\r\n */\r\nexport function getInnerWidth(): number {\r\n return canUseDOM() ? window.innerWidth : getRequestData().innerWidth;\r\n}\r\n\r\n/**\r\n * Get window.innerWidth in an isomorphic manner.\r\n * Todo (http://osgvsowi/23876778), remove the need for server to know about innerWidth by limiting layout options or use CSS based solution.\r\n */\r\nexport function getInnerHeight(): number {\r\n return canUseDOM() ? window.innerHeight : getRequestData().innerHeight;\r\n}\r\n\r\n/**\r\n * Get window.devicePixelRatio in an isomorphic manner.\r\n */\r\nexport function getDevicePixelRatio(): number {\r\n return canUseDOM() ? window.devicePixelRatio : getRequestData().devicePixelRatio;\r\n}\r\n\r\n/**\r\n * Get CSS Grid support in an isomorphic manner\r\n */\r\nexport function getCssGridSupport(): boolean {\r\n return !!(canUseDOM() ? (window.CSS && window.CSS.supports && CSS.supports(\"display\", \"grid\")) : getRequestData().canUseCssGrid);\r\n}\r\n\r\n/**\r\n * Get variable font support in an isomorphic manner\r\n * TODO: SSR currently does not support custom fonts.\r\n */\r\nexport function getVariableFontSupport(): boolean {\r\n if (!canUseDOM()) {\r\n throw new Error(\"SSR currently does not support custom fonts.\");\r\n }\r\n\r\n return !!(window.CSS && window.CSS.supports && CSS.supports(\"(font-variation-settings: normal)\"));\r\n}\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { canUseDOM, getLocationSearch } from \"@msnews/isomorphic-util/\";\r\n\r\n/**\r\n * Defines telemetryReadyCallback() which queues a function to be called after the page is revealed.\r\n * This is specific for telemetry package and should not be used for preload dependent features.\r\n * Telemetry can't have a reference to preload since preload references experiences-redux which\r\n * then references telemetry which causes a problem.\r\n * This helper is specific to queuing telemetry calls when needed and invoking the queued calls once\r\n * the preload page is revealed.\r\n */\r\n\r\nconst queuedCalls: Function[] = [];\r\nconst locationSearch = getLocationSearch();\r\nconst isPreload = locationSearch && (locationSearch.match(/backgroundpreload/) || locationSearch.match(/prerender/));\r\nlet pageRevealed = false;\r\nlet trackValuesUpdated = true;\r\n\r\n// Check and add an event listener if page has been pre-loaded but not yet revealed.\r\nif (canUseDOM() && isPreload && document.visibilityState !== \"visible\") {\r\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\r\n} else {\r\n pageRevealed = true;\r\n}\r\n\r\n/** Event handler for page visibility change */\r\nfunction onVisibilityChange(): void {\r\n if (canUseDOM()) {\r\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\r\n }\r\n pageRevealed = true;\r\n checkAndFireQueuedCalls();\r\n}\r\n\r\n/** Event handler to run once track values have been updated by respective entities */\r\nfunction onTrackValuesUpdated(): void {\r\n if (canUseDOM()) {\r\n document.removeEventListener(\"trackvaluesupdated\", onTrackValuesUpdated);\r\n }\r\n trackValuesUpdated = true;\r\n checkAndFireQueuedCalls();\r\n}\r\n\r\n/** Helper method to check if all conditions have been satisfied and then fire queued up telemetry beacons */\r\nfunction checkAndFireQueuedCalls(): void {\r\n if (trackValuesUpdated && pageRevealed) {\r\n while (queuedCalls.length) {\r\n const item = queuedCalls.shift();\r\n if (typeof item === \"function\") {\r\n item();\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** If config dictates to wait for page settings to update track values, set trackValuesUpdated to false and add an event listener for trackvaluesupdated. */\r\nexport function waitForPageSettingsTrackUpdate(waitForPageSettingsToUpdateTrack: boolean): void {\r\n if (!waitForPageSettingsToUpdateTrack) {\r\n return;\r\n }\r\n\r\n trackValuesUpdated = false;\r\n\r\n if (canUseDOM()) {\r\n // Add an event listener to listen for a signal indicating track values have been updated.\r\n document.addEventListener(\"trackvaluesupdated\", onTrackValuesUpdated);\r\n }\r\n}\r\n\r\n/**\r\n * If the page is revealed then just call the callback, if not then queue it up\r\n *\r\n * @param {function(object): void} callback - The callback function.\r\n * @returns {void}\r\n */\r\nexport function telemetryReadyCallback(callback: Function): void {\r\n\r\n if (pageRevealed && trackValuesUpdated) {\r\n callback();\r\n } else {\r\n queuedCalls.push(callback);\r\n }\r\n}\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { assign, get, merge, set } from \"lodash-es\";\r\n\r\nimport { ConnectorConstants } from \"../constants/ConnectorConstants\";\r\nimport { ConnectorNamespaces } from \"@msnews/experiences-constants\";\r\nimport { IActionPayload } from \"./IActionPayload\";\r\nimport { IDataConnector } from \"../connectors/IDataConnector\";\r\nimport { IReducer } from \"./IReducer\";\r\nimport { dataConnectorInjector } from \"./DataConnectorInjector\";\r\nimport { isNullOrUndefined } from \"util\";\r\n\r\n/** Resolve & Reject Function Signature */\r\ntype ResolveConnectorSignature = (connector: IDataConnector) => void;\r\ntype RejectConnectorSignature = (error: Error) => void;\r\n\r\n/**\r\n * Pending getDataConnector Promise\r\n */\r\ninterface PendingConnectorPromise {\r\n /** Promise */\r\n promise: Promise>;\r\n /** callback to resolve the promise */\r\n resolve: ResolveConnectorSignature;\r\n /** callback to reject the promise */\r\n reject: RejectConnectorSignature;\r\n}\r\n\r\n/** Result from running a reducer. */\r\ninterface ReducerResult {\r\n /** The new state calculated by the reducer */\r\n newState: any;\r\n\r\n /** True if the state changed. */\r\n stateChanged: boolean;\r\n}\r\n\r\n/**\r\n * A reducer that can dynamically add and remove individual sub-reducers\r\n * @class\r\n */\r\nexport class DynamicReducer {\r\n\r\n /**\r\n * A map of connectors, which maintain the sub-spaced state. Reducers and connectors are keyed by namespace\r\n */\r\n private readonly _connectorMap: {[key: string]: IDataConnector} = {};\r\n\r\n /**\r\n * The list of global connectors. Used for fast lookup instead of iterating through _connectorMap keys and toArray methods.\r\n */\r\n private readonly _globalConnectors: IDataConnector[] = [];\r\n\r\n /**\r\n * The list of all connectors. Used for fast lookup instead of iterating through _connectorMap keys and toArray methods.\r\n */\r\n private readonly _allConnectors: IDataConnector[] = [];\r\n\r\n /**\r\n * The list of all pending promises for the get data connector call. Used to resolve the promise when data connector is instantiated.\r\n */\r\n private readonly _getDataConnectorPendingPromises: Map = new Map();\r\n\r\n /**\r\n * Creates an instance of the `DynamicReducer` class.\r\n * @constructor\r\n * @param {string} type The action type.\r\n */\r\n constructor() {\r\n // bind the reduce method to this instance\r\n this.reduce = this.reduce.bind(this);\r\n }\r\n\r\n /**\r\n * Returns an array of connectors that have their reducers registered with this instance\r\n * @method\r\n * @returns {IDataConnector} A simple arry of all connectors\r\n */\r\n public connectors(): IDataConnector[] {\r\n return this._allConnectors;\r\n }\r\n\r\n /**\r\n * Returns an array of connectors that have their reducers registered with this instance\r\n * @method\r\n * @param {string} namespace The namespace of the connector to return, if it is in the map\r\n * @returns {IDataConnector | undefined} A simple arry of all connectors\r\n */\r\n public connector(namespace: string): IDataConnector | undefined {\r\n return (this._connectorMap[namespace]);\r\n }\r\n\r\n /**\r\n * Returns an array of connectors that have state that is global\r\n * @method\r\n * @returns {IDataConnector} A simple arry of connectors that have global state\r\n */\r\n public globalConnectors(): IDataConnector[] {\r\n return this._globalConnectors;\r\n }\r\n\r\n /**\r\n * Returns a promise which resolves immediately if the data connector is already present on the page,\r\n * otherwise resolves when the data connector is instantiated on the Page later in the lifecycle.\r\n * @method\r\n * @param namespace The namespace of data connector to return\r\n */\r\n public getDataConnector(namespace: ConnectorNamespaces): Promise> {\r\n // Check for data connector, if it is already present resolve immediately\r\n const dataConnector = this.connector(namespace);\r\n if (dataConnector) {\r\n return Promise.resolve(dataConnector);\r\n }\r\n\r\n // Check if we have an entry for the namespace in pending promise map, if present return the same promise\r\n const pendingPromise = this._getDataConnectorPendingPromises.get(namespace);\r\n if (pendingPromise) {\r\n return pendingPromise.promise;\r\n }\r\n\r\n // If the data connector is not on the page and has no entry in the pending promise map, create a new promise\r\n let resolveCallback: ResolveConnectorSignature;\r\n let rejectCallback: RejectConnectorSignature;\r\n const promise = new Promise>((resolve, reject) => {\r\n // Get the reference to the resolve & reject which can be called later when the data connector is instantiated on the Page\r\n resolveCallback = resolve;\r\n rejectCallback = reject;\r\n });\r\n\r\n // Add the promise to the pending promise map\r\n this._getDataConnectorPendingPromises.set(namespace, { promise: promise, resolve: resolveCallback, reject: rejectCallback });\r\n\r\n // Return the promise\r\n return promise;\r\n }\r\n\r\n /**\r\n * Produces the next state based on the given action. The state to be reduced is an aggregate of the reducers for all of the connectors\r\n * that have been added.\r\n * The overall state looks something like:\r\n * This will be the state for the redux-subspace for the connector. It is of the form:\r\n * {\r\n * FOO: {\r\n * _@STATE@_: {\r\n * \r\n * },\r\n * BAR: {\r\n * _@STATE@_: {\r\n * \r\n * },\r\n * },\r\n * }\r\n * }\r\n * @function\r\n * @param state {any} The previous state of the application. The application state, will contain one or more sub-states, which will be individually reduced\r\n * @param actionPayload {IActionPayload} The action detail to update the state with.\r\n * @returns {any} The next state for the application, containing the next state for each connector (a.k.a subspace)\r\n */\r\n public reduce(state: any, actionPayload: IActionPayload): any {\r\n // If the initial state is undefined, then create an empty object to start with\r\n if (isNullOrUndefined(state)) {\r\n state = {};\r\n }\r\n\r\n let newState = { ...state };\r\n let stateChanged = false;\r\n\r\n // See if we need to reduce for a specific connector. This is the common case.\r\n if (actionPayload !== undefined && actionPayload.key !== undefined) {\r\n // If this is a special action, used to force a re-render, then we need to set stateChanged to true, and create a clone of the existing scoped state\r\n const typeIsString: boolean = typeof actionPayload.type === \"string\";\r\n if (typeIsString && actionPayload.type.endsWith(ConnectorConstants.renderAction)) {\r\n const statePropertyKey = actionPayload.key + \".\" + ConnectorConstants.connectorStateKey;\r\n const connectorState = assign({}, get(state, statePropertyKey, undefined));\r\n set(newState, statePropertyKey, connectorState);\r\n stateChanged = true;\r\n } else if (typeIsString && actionPayload.type.endsWith(ConnectorConstants.dataConnectorMergeInitAction)) {\r\n const experienceFullNamespace: string = actionPayload.key;\r\n const dataConnectorName: ConnectorNamespaces = actionPayload.params[0];\r\n\r\n if (dataConnectorName) {\r\n dataConnectorInjector.initializeExperience(newState, experienceFullNamespace, dataConnectorName);\r\n stateChanged = true;\r\n }\r\n } else {\r\n // If the connector doing the reducing is global, then create a deep copy of state, so that all the connected\r\n // components think the state is new, and run their mappers. Connected components are subscribed to, and only see\r\n // changed in their subspace portion of the state tree. The redux connect implementation uses strict equal comparison,\r\n // meaning it consider the state change if it is a new object reference, even if all the properties are still the same\r\n if (this._connectorMap[actionPayload.key].isGlobal) {\r\n newState = merge({}, newState);\r\n }\r\n\r\n const connectorReducerResult = this.computeNextStateForConnector(newState, actionPayload.key, actionPayload);\r\n stateChanged = connectorReducerResult.stateChanged;\r\n\r\n if (stateChanged) {\r\n // Check to see if any experiences are including this data connector state. If so, update those too.\r\n dataConnectorInjector.reportStateChange(newState, actionPayload.key, connectorReducerResult.newState);\r\n }\r\n }\r\n } else {\r\n // Iterate over the full list of connectors calling each reducer. This is not the common case, and is typically done\r\n // for actions that come from Redux, during initialization\r\n Object.keys(this._connectorMap).forEach(key => {\r\n if (this.computeNextStateForConnector(newState, key, actionPayload).stateChanged) {\r\n stateChanged = true;\r\n }\r\n });\r\n }\r\n\r\n // Return the newState, as modified by the reducer(s) if it was changed, otherwise return the original state\r\n if (stateChanged) {\r\n return newState;\r\n } else {\r\n return state;\r\n }\r\n }\r\n\r\n /**\r\n * Adds a sub reducer for a connector to the sub-reducer collection.\r\n * @method\r\n * @param {IDataConnector} connector The connector to add.\r\n */\r\n public addSubReducerForConnector(connector: IDataConnector): void {\r\n if (!connector) {\r\n throw new Error(\"The parameter 'connector' cannot be null.\");\r\n }\r\n\r\n // Add the sub-reducer and connector into their maps, based on the connector's namespace\r\n const key = connector.fullNamespace;\r\n this._connectorMap[key] = connector;\r\n\r\n // update the all and global connector fast lookup lists\r\n this._allConnectors.push(connector);\r\n\r\n if (connector.isGlobal) {\r\n this._globalConnectors.push(connector);\r\n }\r\n\r\n // Check if there is a pending promise for the data connector\r\n // DO NOT CHANGE namespace to fullnamespace, data connectors are supposed to be queried using just the namespace by design.\r\n if (this._getDataConnectorPendingPromises.has(connector.namespace)) {\r\n // Get the resolve callback for the pending promise and resolve it\r\n const pendingPromise = this._getDataConnectorPendingPromises.get(connector.namespace);\r\n\r\n try {\r\n pendingPromise.resolve(connector);\r\n } catch (error) {\r\n pendingPromise.reject(error);\r\n }\r\n\r\n // Delete the entry from the pending promise map\r\n this._getDataConnectorPendingPromises.delete(connector.namespace);\r\n }\r\n\r\n connector.store.dispatch({ key: key, type: \"@@connector-view/INIT\" });\r\n }\r\n\r\n /**\r\n * Helper method to compute the next state for a given connector. This method will get the connector's actual state\r\n * from the state tree, call the reducer, and then state the state in the passed in object that is to receive the new state\r\n * @param {any} state The current subspace (or root) state object, which will be updated\r\n * @param {string} key The key to the connector in the connector map\r\n * @param {IActionPayload} actionPayload The action to apply\r\n * @returns Information on how the connector state was changed\r\n */\r\n private computeNextStateForConnector(state: any, key: string, actionPayload: IActionPayload): ReducerResult {\r\n // Get the connector, so that we can call the reducer\r\n const connector = this._connectorMap[key];\r\n\r\n // Setup the key and get the actual state property for the connector. lodash uses dotted notation\r\n // so the key will be something like: namespace._@STATE@_\r\n const statePropertyKey = key + \".\" + ConnectorConstants.connectorStateKey;\r\n const connectorPreviousState = get(state, statePropertyKey, undefined);\r\n\r\n // Call the reducer for the connector, and validate that we received a state object back.\r\n const nextStateForConnector = this.subReduce(connector.reducer, connectorPreviousState, actionPayload);\r\n if (typeof nextStateForConnector === \"undefined\") {\r\n throw new Error(\"Reducer for: \" + key + \" must not return undefined.\");\r\n }\r\n\r\n // If the state changed, then set the new connector state in the overall state object\r\n const connectorStateChanged: boolean = nextStateForConnector !== connectorPreviousState;\r\n if (connectorStateChanged) {\r\n set(state, statePropertyKey, nextStateForConnector);\r\n }\r\n\r\n return { newState: nextStateForConnector, stateChanged: connectorStateChanged };\r\n }\r\n\r\n /**\r\n * Calls the reducer that has been registered to handle the state associated with a specific subspace\r\n * @param {Reducer} reducer The reducer to call\r\n * @param {TSubReducerState} state The state object for the subreducer\r\n * @param {IActionPayload} actionPayload The action to apply\r\n */\r\n private subReduce(reducer: IReducer, previousState: TSubReducerState, actionPayload: IActionPayload): TSubReducerState {\r\n const reducedState: TSubReducerState = reducer.reduce(previousState, actionPayload);\r\n if (reducedState !== previousState) {\r\n return reducedState;\r\n } else {\r\n return previousState;\r\n }\r\n }\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { captureJssGeneratedClasses } from \"@msnews/render-cache\";\r\nimport { registerResetCallback } from \"@msnews/core\";\r\n\r\n/**\r\n * Weak map which is used to store DesignSystem to GenerateClassName Callback.\r\n */\r\nlet designSystemMap = new WeakMap();\r\n\r\n/**\r\n * Map which will store number of DesignSystem appearances with same name.\r\n */\r\nlet designSystemIndexMap = new Map();\r\n\r\n/**\r\n * Register a callback to reset the designSystem globals.\r\n * The callback is registered once when the module is loaded and invoked once on the server side at the beginning of each request.\r\n */\r\nregisterResetCallback(() => {\r\n designSystemMap = new WeakMap();\r\n designSystemIndexMap = new Map();\r\n});\r\n\r\n/**\r\n * JSS callback function that defines the class name generation logic\r\n * The default jss manager class name generation logic increments counter based on order\r\n * of how the experiences are rendered. We cannot guarantee the order due to async nature\r\n * of experiences which potentially causes different class names on every reload/refresh.\r\n * Instead here with this callback, we start the counter from 1 per rule to ensure class\r\n * names stays consistent irrespective of when they are rendered.\r\n *\r\n * Design system is taken into account since a change in it can result in potential different\r\n * styling being needed even if that rule was already used in a previous design system.\r\n *\r\n * For example:\r\n * For TopSites, with this override the class name would be generated as \"topSites-DS-default1-1\"\r\n * (jss manager by default would have generated it something like \"topSites-0-1-305\")\r\n * If the design system were to be updated and the same rule would be passed then you would\r\n * get topsites-DS-default2-1.\r\n */\r\nexport function createGenerateClassName(designSystem: any): (rule: any, sheet: any) => string {\r\n if (!designSystem) {\r\n return;\r\n }\r\n\r\n let callback = designSystemMap.get(designSystem);\r\n\r\n if (!callback) {\r\n const dsName = designSystem.name || \"unknown\";\r\n const dsIndex = designSystemIndexMap.get(dsName) + 1 || 1;\r\n const rulesMap: any = {};\r\n callback = (rule: any, sheet: any) => {\r\n const key = rule.key;\r\n\r\n if (!rulesMap[key]) {\r\n rulesMap[key] = 1;\r\n } else {\r\n rulesMap[key]++;\r\n }\r\n\r\n const name = `DS-${dsName}${dsIndex}-${rulesMap[key]}`;\r\n captureJssGeneratedClasses(key, name);\r\n\r\n return `${key}-${name}`;\r\n };\r\n\r\n designSystemMap.set(designSystem, callback);\r\n designSystemIndexMap.set(dsName, dsIndex);\r\n }\r\n\r\n return callback;\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { Provider, connect } from \"react-redux\";\r\nimport { Store, StoreEnhancer, compose, createStore } from \"redux\";\r\nimport { getPageTimings, logger, perfMarker } from \"@msnews/diagnostics\";\r\n\r\nimport { DynamicReducer } from \"../reducers\";\r\nimport { IDataConnector } from \"../connectors/IDataConnector\";\r\nimport { JSSManager } from \"@microsoft/fast-jss-manager-react\";\r\nimport React from \"react\";\r\nimport ReactDom from \"react-dom\";\r\nimport { applyMiddleware } from \"redux-subspace\";\r\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\r\nimport { create } from \"jss\";\r\nimport { createGenerateClassName } from \"./PageHelper\";\r\nimport { getStateFromRenderCache } from \"@msnews/render-cache\";\r\nimport jssGlobal from \"jss-global\";\r\nimport jssNested from \"jss-nested\";\r\n\r\ndeclare global {\r\n interface Window {\r\n /**\r\n * Boolean flag to indicate if this is an SSR page or not\r\n */\r\n SSR: boolean;\r\n\r\n /**\r\n * Enable redux devtools extension debugging\r\n */\r\n __REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: any;\r\n\r\n /**\r\n * Boolean flag to indicate if render cache hydration is happening\r\n */\r\n needsHydrate?: boolean;\r\n\r\n /**\r\n * Boolean flag to indicate if state is stored in render cache along with DOM\r\n */\r\n hasPreHydrateState?: boolean;\r\n }\r\n}\r\n\r\n/**\r\n * Page Base.\r\n * Each page or hybrid page/experience must have an instance of the PageBase, which contains the the store, and dynamic reducer\r\n * for the experience/app.\r\n * PageBase is setup as a singleton, so the proper usage in consumers is:\r\n * var pageBase = PageBase.getInstance();\r\n * @export\r\n * @class\r\n */\r\nclass PageBase {\r\n /**\r\n * The singleton instance of this class\r\n * @type: {PageBase}\r\n */\r\n private static _instance: PageBase;\r\n\r\n /**\r\n * The Dynamic reducer for this app/experience\r\n * @type: {DynamicReducer}\r\n */\r\n private _rootReducer: DynamicReducer;\r\n\r\n /**\r\n * The Redux store containing the top level application state. All component and data connectors will manage namespaced subspaces within\r\n * this store\r\n * @type {Store}\r\n */\r\n private _store: Store;\r\n\r\n /**\r\n * Constructor for PageBase class\r\n * @constructor\r\n * @param {any} initialState Optional initial redux state provided as part of SSR response during hydration\r\n */\r\n private constructor(initialState?: any) {\r\n /**\r\n * In debug build, add the option to turn on redux-devtools-extension debugging.\r\n * More info here https://github.com/zalmoxisus/redux-devtools-extension\r\n */\r\n let enhancer: StoreEnhancer;\r\n const middlewares: any = [];\r\n if ((canUseDOM() && logger) ? logger.isDebug() : false) {\r\n const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ trace: true, traceLimit: 25 }) || compose;\r\n enhancer = composeEnhancers(applyMiddleware(...middlewares)\r\n );\r\n } else {\r\n enhancer = applyMiddleware(...middlewares);\r\n }\r\n\r\n // Create the root reducer\r\n this._rootReducer = new DynamicReducer();\r\n\r\n // Check to see if this app instance was bootstrapped with a render-cache\r\n initialState = initialState || (canUseDOM() && window.needsHydrate && getStateFromRenderCache()) || {};\r\n if (canUseDOM()) {\r\n window.hasPreHydrateState = !!(initialState && Object.keys(initialState).length !== 0);\r\n }\r\n\r\n // create the store with a basic root reducer\r\n this._store = createStore(this.rootReducer.reduce, initialState, enhancer);\r\n\r\n }\r\n\r\n /**\r\n * Reset PageBase. Useful when handling multiple requests when server side rendering.\r\n */\r\n public static resetPageBaseInstance(initialState?: any): void {\r\n this._instance = new PageBase(initialState);\r\n }\r\n\r\n /**\r\n * Gets the Redux store for this app/experience\r\n * @method\r\n * @returns {Store} The overall state for the App, which contains sub-states for each connector\r\n */\r\n public get store(): Store {\r\n return this._store;\r\n }\r\n\r\n /**\r\n * Gets the root reducer for this app/experience\r\n * @returns {DynamicReducer} The reducer for the app/experience\r\n */\r\n public get rootReducer(): DynamicReducer {\r\n return this._rootReducer;\r\n }\r\n\r\n /**\r\n * Gets the singleton instance of this class for the app/experience\r\n * @returns {PageBase} The instance of PageBase for the page/hybrid experience\r\n */\r\n public static getInstance(initialState?: any): PageBase {\r\n return this._instance || (this._instance = new this(initialState));\r\n }\r\n\r\n /**\r\n * Starts the application by calling the onApplicationStart method for each connector that has been added to the app.\r\n * @function\r\n * @method\r\n */\r\n public start(): void {\r\n // Iterate over all of the connector's and call their OnApplicationStart method\r\n const allConnectors: IDataConnector[] = this.rootReducer.connectors();\r\n allConnectors.forEach(connector => connector.onApplicationStart());\r\n }\r\n\r\n /**\r\n * Creates and renders a root element, that is connected to the store.\r\n * The root element will created with the passed in connected element as a child.\r\n * @function\r\n * @param {React.ReactElement} connectedTopLevelElement The top level rendering element for the page/application.\r\n * @param {HTMLElement} hostElement The host element (usually a
) to contain the msnews-experiences-redux application\r\n * @param {Function} callback An optional callback to be fired after hydration is complete, used when hydrating server side rendered content.\r\n * @method\r\n */\r\n public renderRootElement(connectedTopLevelElement: React.ReactElement, hostElement: HTMLElement, callback?: Function): void {\r\n // Update the base JSS manager instance\r\n this.updateJssManagerInstance();\r\n\r\n // Create a ReactElement, that contains the Redux provider with the store, passing the incoming top level element in as a child, so that\r\n // the pageElement wraps the top level element with the redux store\r\n const rootElement = React.createElement(Provider, { store: this._store }, connectedTopLevelElement);\r\n\r\n // Capture Render cache state in page timings\r\n const pageTimings = getPageTimings();\r\n\r\n if (window.needsHydrate) {\r\n ReactDom.hydrate(rootElement, hostElement);\r\n pageTimings[\"isRenderCachePresent\"] = 1;\r\n window.needsHydrate = false;\r\n } else if (window.SSR) {\r\n pageTimings[\"isRenderCachePresent\"] = 0;\r\n perfMarker.startMark(\"SSR.Hydrate\");\r\n ReactDom.hydrate(rootElement, hostElement, callback);\r\n } else {\r\n pageTimings[\"isRenderCachePresent\"] = 0;\r\n ReactDom.render(rootElement, hostElement);\r\n }\r\n }\r\n\r\n /**\r\n * Updates the base JSSManager instance with the correct default plugins\r\n */\r\n public updateJssManagerInstance(): void {\r\n const jssInstance: ReturnType = create({\r\n plugins: [jssNested(), jssGlobal()]\r\n });\r\n\r\n JSSManager.createGenerateClassName = createGenerateClassName;\r\n JSSManager.jss = jssInstance;\r\n }\r\n}\r\n\r\nexport default PageBase;","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\r\n\r\nconst pageTimings = canUseDOM() ? (window._pageTimings || (window._pageTimings = {})) : null;\r\n\r\n/**\r\n * Gets current window._pageTimings object\r\n */\r\nexport function getPageTimings(): object {\r\n return pageTimings;\r\n}\r\n\r\n/**\r\n * Creates or updates a new counter under the page timings\r\n * @param counterName - the name of the counter to increment.\r\n */\r\nexport function incrementCounter(counterName: string): void {\r\n if (counterName && pageTimings) {\r\n const existingCount = pageTimings[counterName] || (pageTimings[counterName] = 0);\r\n pageTimings[counterName] = existingCount + 1;\r\n }\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nexport enum Environment {\r\n prod = \"prod\",\r\n int1 = \"int1\",\r\n int = \"int\",\r\n intpr = \"intPR\",\r\n intpef = \"intPef\"\r\n}\r\n\r\n/**\r\n * Parses from string to Environment enum.\r\n * Defaults to null\r\n *\r\n * @export\r\n * @param {(string | null | undefined)} environment - string being parsed\r\n * @returns {(Environment | null)} - the parsed Environment enum, or null.\r\n */\r\nexport function getEnvironmentFromString(environment: string | null | undefined): Environment | null {\r\n switch (environment) {\r\n case Environment.prod:\r\n return Environment.prod;\r\n case Environment.int1:\r\n return Environment.int1;\r\n case Environment.int:\r\n case Environment.intpr:\r\n case Environment.intpef:\r\n return Environment.int;\r\n default:\r\n return null;\r\n }\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * The aria-label html attribute\r\n * @type {string}\r\n */\r\nexport const ariaLabelAttribute = \"aria-label\";\r\n\r\n/**\r\n * The id attribute on the
element that is the root element for Peregrine Pages / Experiences.\r\n * There is only ever 1 root element on a page\r\n * @type {string}\r\n */\r\nexport const rootElementId = \"msnewsroot\";\r\n\r\n/**\r\n * Element names that are commonly used in Peregrine pages and experiences\r\n * @type {object}\r\n */\r\nexport const htmlElementIds: any = {\r\n html: \"html\",\r\n head: \"head\",\r\n body: \"body\"\r\n};\r\n\r\n/**\r\n * Constants used by application cache related scenarios\r\n */\r\nexport const applicationCacheConstants = {\r\n /**\r\n * Attribute name on html tag that is set when appcache is being used on the page\r\n */\r\n manifestAttributeName: \"manifest\",\r\n\r\n /**\r\n * Local storage key that holds the appcache info used to determine page refresh needs\r\n * for different page types.\r\n */\r\n pagesRefreshData: \"ac_prd\",\r\n\r\n /**\r\n * Local storage key that holds the appcache stored head data entries\r\n */\r\n storedHeadDataKey: \"ac_shd\",\r\n\r\n /**\r\n * Local storage key that holds the appcache stored activity IDs\r\n */\r\n storedLastUsedActivityIdKey: \"ac_sai\"\r\n\r\n};\r\n\r\n/**\r\n * The attributes that are part of markup elements that we care about\r\n */\r\nexport const clientSettings = \"data-client-settings\";\r\nexport const pagetypeSettings = \"data-pagetype\";\r\nexport const id = \"data-id\";\r\nexport const info = \"data-info\";\r\nexport const js = \"data-js\";\r\nexport const m = \"data-m\";\r\nexport const lang = \"lang\";\r\nexport const dir = \"dir\";\r\nexport const serviceUrl = \"data-service-url\";\r\nexport const telemetryId = \"data-telemetry-id\";\r\nexport const trackPageProduct = \"data-page-product\";\r\nexport const trackPageType = \"data-page-type\";\r\n\r\n/**\r\n * The number of characters that our Service Request Ids must have. This is currently defined by OneService\r\n * @type {number}\r\n */\r\nexport const numberOfCharactersNeededForUniqueRequestId = 32;\r\n\r\n/**\r\n * The minimum number of path segments that will be in the URL which hosts MS News Experience pages.\r\n * The first path segment should be the vertical key, e.g. spartan and the second path segment\r\n * should be the the category key, e.g. ntp\r\n * @type {number}\r\n */\r\nexport const minimumHostPagePathSegments = 2;\r\n\r\n/**\r\n * Default value we use for the name of the cookie that holds the ANID\r\n */\r\nexport const anonCookieName = \"APP_ANON\";\r\n\r\n/**\r\n * App Anon Cookie Exists Cookie Name. This cookie is a marker if APP_ANON exist or not.\r\n * This is necessary because APP_ANON is HTTP cookie and not accessible by JS.\r\n */\r\nexport const appAnonCookieExistsCookieName = \"aace\";\r\n\r\n/**\r\n * Child cookie name, used to signal if rpsUser is child account.\r\n */\r\nexport const childCookieName = \"child\";\r\n\r\n/**\r\n * Migration consent state cookie, indicates user has already granted or denied migration consent\r\n */\r\nexport const migrationConsentStateKey = \"migration-state\";\r\n\r\n/**\r\n * Id of MSCC cookie banner container element.\r\n */\r\nexport const msccCookieBannerElementId = \"consent-banner-container\";\r\n\r\n/**\r\n * Nurturing accepted state key is intended to be used in local storage, indicates user has opted in or out of Iris targeted content.\r\n */\r\nexport const nurturingAcceptedStateKey = \"nurturingAccepted\";\r\n\r\n/**\r\n * Headers used for one service requests\r\n */\r\nexport const oneServiceHeaders = {\r\n activityId: \"x-client-activityid\",\r\n authorization: \"Authorization\"\r\n};\r\n\r\n/**\r\n * used query string params in OneService requests\r\n */\r\nexport const oneServiceQueryStringKeys = {\r\n activityId: \"activityId\",\r\n apiKey: \"apikey\",\r\n complexInfoPaneEnabled: \"cipenabled\",\r\n contentType: \"contentType\",\r\n delta: \"delta\",\r\n disableTypeSerialization: \"DisableTypeSerialization\",\r\n infopaneCount: \"infopaneCount\",\r\n fdhead: \"fdhead\",\r\n feedLayoutRequestType: \"t\",\r\n filter: \"$filter\",\r\n ids: \"ids\",\r\n location: \"location\",\r\n market: \"market\",\r\n ocid: \"ocid\",\r\n parentContentId: \"parent-content-id\",\r\n parentNamespace: \"parent-ns\",\r\n parentTitle: \"parent-title\",\r\n queryQ: \"q\",\r\n query: \"query\",\r\n queryType: \"queryType\",\r\n qScope: \"qscope\",\r\n responseSchema: \"responseschema\",\r\n select: \"$select\",\r\n session: \"session\",\r\n signInCookieName: \"scn\",\r\n skip: \"$skip\",\r\n source: \"source\",\r\n timeOut: \"timeOut\",\r\n top: \"$top\",\r\n type: \"type\",\r\n user: \"user\",\r\n wrapOData: \"wrapodata\"\r\n};\r\n\r\n/**\r\n * Constants to use as role attribute value for elements\r\n */\r\nexport enum AriaRoles {\r\n /**\r\n * Presentation role is used to remove semantic meaning from an element and any of its related child elements.\r\n */\r\n Presentation = \"presentation\"\r\n}\r\n\r\n/**\r\n * Basic enum values for mobile device orientation\r\n */\r\nexport enum DeviceOrientation {\r\n Unknown = \"Unknown\",\r\n Portrait = \"Portrait\",\r\n Landscape = \"Landscape\"\r\n}\r\n\r\n/**\r\n * Enterprise compliant domain for One Service api\r\n */\r\nexport const EnterpriseOneServiceApi = \"https://ent-api.msn.com/\";\r\n\r\n/**\r\n * Common local storage keys\r\n */\r\nexport const CoreLocalStorageKeys = {\r\n /**\r\n * This key is used to store a dictionary of app versions per app type based on the current page version from the DOM.\r\n * Note that the version value will represent the current **loaded page** version and **not the new version** in scenarios\r\n * where the page is cached and require a new version to be loaded upon version detection (i.e., appcache, or service worker).\r\n * In these cached/refresh scenarios, we still want to store the version that the page was actually loaded from.\r\n */\r\n pageVersions: \"pageVersions\"\r\n};\r\n\r\n/**\r\n * The default APIKey for OneService requests\r\n */\r\nexport const defaultOneServiceApiKey = \"0QfOX3Vn51YCzitbLaRkTTBadtWpgTN8NZLW0C1SEM\";\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\r\n\r\n/**\r\n * Returns the cookie content given a name\r\n *\r\n * @param name {string} - cookie name\r\n * @returns the value of the cookie or `null`, if the key is not found.\r\n */\r\nexport function getCookie(name: string): string {\r\n if (canUseDOM() && document && document.cookie) {\r\n const re = new RegExp(\"\\\\b\" + name + \"\\\\s*=\\\\s*([^;]*)\", \"i\");\r\n const match = re.exec(document.cookie);\r\n return (match && match.length > 1 ? match[1] : null);\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Helper function that retrieves the MUID from the document.cookie\r\n * or uses the saved value if the cookie was retrieved for the current page instance\r\n */\r\nexport function getMuidCookie(): string {\r\n return getCookie(\"MUID\");\r\n}\r\n\r\n/**\r\n * Helper function used to set a cookie\r\n * NOTE: THIS BYPASSES ANY GDPR CHECK AND HENCE ONLY REQUIRED FUNCTIONAL COOKIES SHOULD BE SET USING THIS\r\n * IF YOU DO NOT KNOW IF YOUR COOKIE IS ONE THEN PLEASE USE Cookies.ts setCookie THAT MAKES USE OF GDPR LOGIC CHECKS\r\n * When expiryDays is equal to -1 it will unset the cookie\r\n * * @param {string} name Cookie name\r\n * * @param {string} value Cookie value\r\n * * @param {number} expiryDays Cookie expiry days\r\n * * @param {string} domain Cookie domain\r\n * * @param {string} path Cookie path\r\n * * @param {boolean} secure Is it a https only cookie\r\n */\r\nexport function setRequireFunctionalCookie(name: string, value: string, expiryDays?: number, domain?: string, path?: string, secure?: boolean): void {\r\n let expiryDate;\r\n const builder = [name, \"=\", value];\r\n if (-1 === expiryDays) {\r\n // Expires date format is supposed to be in GMT.\r\n expiryDate = \"Fri, 31 Dec 1999 23:59:59 GMT\";\r\n } else if (expiryDays) {\r\n const date = new Date();\r\n date.setTime(date.getTime() + (expiryDays * 86400000)); // 86400000 == 24*60*60*1000 (ms/day)\r\n expiryDate = date.toUTCString();\r\n }\r\n\r\n if (expiryDate) { builder.push(\";expires=\", expiryDate); }\r\n if (domain) { builder.push(\";domain=\", domain); }\r\n if (path) { builder.push(\";path=\", path); }\r\n if (secure) { builder.push(\";secure\"); }\r\n\r\n if (canUseDOM() && document) {\r\n document.cookie = builder.join(\"\");\r\n }\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport PageBase from \"./PageBase\";\r\n\r\nexport default PageBase;\r\nexport * from \"./PageBase\";\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n// Defines constants used in telemetry beacons\r\n// \r\n// This is a auto-generated file using MSNTelemetryCodeGen (https://microsoft.visualstudio.com/DefaultCollection/Universal%20Store/_git/MSN.Tool.Telemetry?path=%2FMSNTelemetryDimensionsCodeGen/)\r\n// \r\n\r\n// \r\n// This is a auto-generated file using MSNTelemetryDimensionsCodeGen (https://microsoft.visualstudio.com/DefaultCollection/Universal%20Store/_git/MSN.Tool.Telemetry?path=%2FMSNTelemetryDimensionsCodeGen/)\r\n// \r\nconst PageNamePageTypeMappingList = {};\r\nconst TelemetryTypeContentTypeMappingList = {};\r\nconst TelemetryTypeBehaviorTypeMappingList = {};\r\n\r\n/// Telemetry Product \r\nconst TelemetryProduct = {\r\n Spartan: \"spartan\",\r\n Prime: \"prime\",\r\n PrimeMobile: \"prime_mobile\",\r\n IEext: \"ieext\",\r\n SpartanMobile: \"spartan_mobile\",\r\n TabbedShell: \"tabbedshell\",\r\n ChromeExt: \"chromeext\",\r\n Downlevel: \"downlevel\",\r\n Xbox: \"xbox\"\r\n};\r\n\r\n/// Telemetry PageType \r\nconst TelemetryPageType = {\r\n Unspecified: \"unspecified\",\r\n DHP: \"dhp\",\r\n NTP: \"ntp\",\r\n HomePage: \"hp\",\r\n VerticalHomePage: \"verthp\",\r\n StructuredDataPage: \"data\",\r\n SectionFront: \"secfront\",\r\n SiteSearch: \"sitesearch\",\r\n Article: \"article\",\r\n Gallery: \"gallery\",\r\n Video: \"video\",\r\n SubjectSection: \"subjectsec\",\r\n CustomColumn: \"custcol\"\r\n};\r\n\r\n// TODO: (nubenja) Remove this once all partners moves from TelemetryType to ContentType and ContentAction\r\n/// Telemetry Type \r\nconst TelemetryType = {\r\n Undefined: 0,\r\n Header: 1,\r\n Footer: 2,\r\n TopNavBar: 3,\r\n NavBar: 4,\r\n DropDown: 5,\r\n Section: 6,\r\n Carousel: 7,\r\n Module: 8,\r\n SearchBox: 9,\r\n InputBox: 10,\r\n ActionButton: 11,\r\n Interaction: 12,\r\n Headline: 13,\r\n Navigation: 14,\r\n Entity: 15,\r\n StructuredData: 16,\r\n AppStore: 17,\r\n AppLaunch: 18,\r\n CmsPromotions: 19,\r\n MicrosoftWebStore: 20,\r\n XboxStore: 21,\r\n OfficeStore: 22,\r\n AppInstall: 23,\r\n PartnerLinks: 24,\r\n SponsoredContent: 25,\r\n Follow: 26,\r\n Unfollow: 27,\r\n MoreFrom: 28,\r\n Topic: 29,\r\n Provider: 30,\r\n Spotlight: 33,\r\n ShareClose: 36,\r\n Share: 37,\r\n Like: 38,\r\n Dislike: 39,\r\n Unlike: 40,\r\n Undislike: 41,\r\n Mute: 42,\r\n Unmute: 43,\r\n MuteCancel: 44,\r\n Manage: 45,\r\n NewStories: 46,\r\n AutoSuggest: 47,\r\n BingCard: 48,\r\n Tile: 49,\r\n TrendingNews: 50,\r\n AllCoverage: 51,\r\n Report: 52,\r\n AdChoice: 53,\r\n Hide: 55,\r\n Unhide: 56\r\n};\r\n\r\n/// Telemetry Content Type \r\nconst TelemetryContentType = {\r\n Undefined: 0,\r\n App: 1,\r\n Article: 2,\r\n Feed: 3,\r\n Gallery: 4,\r\n AppStorePromo: 5,\r\n Settings: 6,\r\n SponsoredContent: 7,\r\n StructuredDataCard: 8,\r\n Video: 9,\r\n Webview: 10,\r\n Activity: 11,\r\n Win32: 12,\r\n OfficeDocument: 13,\r\n LocalFile: 14,\r\n CardAction: 15\r\n};\r\n\r\n/// Telemetry Behavior Type \r\nconst TelemetryBehaviorType = {\r\n Undefined: 0,\r\n Navigate: 1,\r\n ContextMenu: 2,\r\n Pin: 3,\r\n Unpin: 4,\r\n Rearrange: 5,\r\n Remove: 6,\r\n Add: 7,\r\n Open: 8,\r\n View: 9,\r\n Follow: 10,\r\n Unfollow: 11,\r\n More: 12,\r\n Close: 13,\r\n Share: 14,\r\n Like: 15,\r\n Dislike: 16,\r\n Unlike: 17,\r\n Undislike: 18,\r\n Mute: 19,\r\n Unmute: 20,\r\n Cancel: 21,\r\n Launch: 22,\r\n Install: 23,\r\n Manage: 24,\r\n Show: 25,\r\n MuteCancel: 26,\r\n Save: 27,\r\n Hide: 28,\r\n Unhide: 29,\r\n Customize: 30\r\n};\r\n\r\n/// Telemetry ContentPlacedBySource \r\nconst ContentPlacedBySource = {\r\n Editor: 0,\r\n PersonalizationAlgo: 1,\r\n Bing: 2,\r\n Taboola: 3,\r\n Outbrain: 4,\r\n AutoCuration: 5,\r\n User: 6,\r\n AppNexus: 7,\r\n OtherSponconProvider: 8\r\n};\r\n\r\n/// Telemetry Page Configuration \r\nconst TelemetryPageConfiguration = {\r\n NoContent: 0,\r\n OneBox: 1,\r\n TopSites: 2,\r\n Suggested: 4,\r\n ContentFeed: 8,\r\n WinFre: 16,\r\n StripeLayout: 1024\r\n};\r\n\r\n/// Telemetry Partner Namespace \r\nconst TelemetryPartnerNamespace = {\r\n MMX: \"m\",\r\n Shell: \"s\",\r\n Edge: \"e\",\r\n Office: \"o\",\r\n Activity: \"a\",\r\n Cortana: \"c\"\r\n};\r\n\r\n/// Telemetry PageName \r\nconst TelemetryPageName = {\r\n StartPage: telemetryPageName(\"startpage\", TelemetryPageType.HomePage),\r\n // @ts-ignore\r\n DefaultPage: telemetryPageName(\"default\"),\r\n // @ts-ignore\r\n EduPage: telemetryPageName(\"edu\"),\r\n // @ts-ignore\r\n ChildModePage: telemetryPageName(\"child\"),\r\n // @ts-ignore\r\n Office: telemetryPageName(\"office\"),\r\n // @ts-ignore\r\n Feed: telemetryPageName(\"xfeed\"),\r\n // @ts-ignore\r\n Discover: telemetryPageName(\"discover\"),\r\n // @ts-ignore\r\n MyInterests: telemetryPageName(\"myinterests\"),\r\n // @ts-ignore\r\n CombinedInterests: telemetryPageName(\"cinterests\"),\r\n ArticlePageNames:\r\n {\r\n Article: telemetryPageName(\"article\", TelemetryPageType.Article),\r\n ArticleVNext: telemetryPageName(\"articlevnext\", TelemetryPageType.Article),\r\n ArticleListicle: telemetryPageName(\"article_listicle\", TelemetryPageType.Article),\r\n ArticleCollection: telemetryPageName(\"articlecollection\", TelemetryPageType.Article),\r\n ArticleFullScreen: telemetryPageName(\"articlefullscreen\", TelemetryPageType.Article),\r\n FlexibleArticle: telemetryPageName(\"articleflex\", TelemetryPageType.Article),\r\n FlexibleArticleMobile: telemetryPageName(\"articleflexmobile\", TelemetryPageType.Article),\r\n ArticleGalleryFullScreen: telemetryPageName(\"article_galleryfs\", TelemetryPageType.Article)\r\n },\r\n GalleryPageNames:\r\n {\r\n Gallery: telemetryPageName(\"gallery\", TelemetryPageType.Gallery),\r\n GalleryVNext: telemetryPageName(\"galleryvnext\", TelemetryPageType.Gallery),\r\n GalleryFullScreen: telemetryPageName(\"gallery_fullscreen\", TelemetryPageType.Gallery),\r\n GalleryClassic: telemetryPageName(\"gallery_classic\", TelemetryPageType.Gallery),\r\n GalleryClassicFullScreen: telemetryPageName(\"gallery_classicfs\", TelemetryPageType.Gallery),\r\n GallerySearch: telemetryPageName(\"gallery_search\", TelemetryPageType.Gallery),\r\n GallerySearchFullScreen: telemetryPageName(\"gallery_searchfs\", TelemetryPageType.Gallery),\r\n FlexibleGallery: telemetryPageName(\"galleryflex\", TelemetryPageType.Gallery),\r\n FlexibleGalleryMobile: telemetryPageName(\"galleryflexmobile\", TelemetryPageType.Gallery),\r\n GalleryImmersive: telemetryPageName(\"gallery_immersive\", TelemetryPageType.Gallery),\r\n GalleryImmersiveFullScreen: telemetryPageName(\"gallery_immersivefs\", TelemetryPageType.Gallery),\r\n GallerySponsored: telemetryPageName(\"gallery_sponsor\", TelemetryPageType.Gallery),\r\n GallerySponsoredFullScreen: telemetryPageName(\"gallery_sponsorfs\", TelemetryPageType.Gallery),\r\n GalleryInline: telemetryPageName(\"gallery_inline\", TelemetryPageType.Gallery)\r\n },\r\n VideoPageNames:\r\n {\r\n ChannelPlayerPage: telemetryPageName(\"channelplayerpage\", TelemetryPageType.Video),\r\n PartnerPlayerPage: telemetryPageName(\"partnerplayerpage\", TelemetryPageType.Video)\r\n },\r\n VerticalHomePageNames:\r\n {\r\n HomePage: telemetryPageName(\"homepage\", TelemetryPageType.VerticalHomePage),\r\n HomePageToday: telemetryPageName(\"homepage-today\", TelemetryPageType.VerticalHomePage)\r\n },\r\n StructuredDataPageNames:\r\n {\r\n Gamecenter: telemetryPageName(\"gamecenter\", TelemetryPageType.StructuredDataPage),\r\n Schedule: telemetryPageName(\"schedule\", TelemetryPageType.StructuredDataPage),\r\n Scores: telemetryPageName(\"scores\", TelemetryPageType.StructuredDataPage),\r\n Stocksummary: telemetryPageName(\"stocksummary\", TelemetryPageType.StructuredDataPage),\r\n Stocksummaryoneriver: telemetryPageName(\"stocksummaryoneriver\", TelemetryPageType.StructuredDataPage),\r\n Weatherxplatmaps: telemetryPageName(\"weatherxplatmaps\", TelemetryPageType.StructuredDataPage),\r\n Standings: telemetryPageName(\"standings\", TelemetryPageType.StructuredDataPage),\r\n Markets: telemetryPageName(\"markets\", TelemetryPageType.StructuredDataPage),\r\n Watchlistpage: telemetryPageName(\"watchlistpage\", TelemetryPageType.StructuredDataPage),\r\n Data_modelpage: telemetryPageName(\"data_modelpage\", TelemetryPageType.StructuredDataPage),\r\n Immersivechartspage: telemetryPageName(\"immersivechartspage\", TelemetryPageType.StructuredDataPage),\r\n Currencies: telemetryPageName(\"currencies\", TelemetryPageType.StructuredDataPage),\r\n Indexdetailspage: telemetryPageName(\"indexdetailspage\", TelemetryPageType.StructuredDataPage),\r\n Data_makepage: telemetryPageName(\"data_makepage\", TelemetryPageType.StructuredDataPage),\r\n Weatherfullscreenmaps: telemetryPageName(\"weatherfullscreenmaps\", TelemetryPageType.StructuredDataPage),\r\n Weatherthresholdmaps: telemetryPageName(\"weatherthresholdmaps\", TelemetryPageType.StructuredDataPage),\r\n Stockanalysisdetails: telemetryPageName(\"stockanalysisdetails\", TelemetryPageType.StructuredDataPage),\r\n Data_yearoverview: telemetryPageName(\"data_yearoverview\", TelemetryPageType.StructuredDataPage),\r\n Data_segmenthub: telemetryPageName(\"data_segmenthub\", TelemetryPageType.StructuredDataPage),\r\n Weathermaps: telemetryPageName(\"weathermaps\", TelemetryPageType.StructuredDataPage),\r\n Playerstats: telemetryPageName(\"playerstats\", TelemetryPageType.StructuredDataPage),\r\n Funddetailspage: telemetryPageName(\"funddetailspage\", TelemetryPageType.StructuredDataPage),\r\n Exercisedetails: telemetryPageName(\"exercisedetails\", TelemetryPageType.StructuredDataPage),\r\n Teams: telemetryPageName(\"teams\", TelemetryPageType.StructuredDataPage),\r\n Etfdetailspage: telemetryPageName(\"etfdetailspage\", TelemetryPageType.StructuredDataPage),\r\n Binganswermaps: telemetryPageName(\"binganswermaps\", TelemetryPageType.StructuredDataPage),\r\n Workoutdetails: telemetryPageName(\"workoutdetails\", TelemetryPageType.StructuredDataPage),\r\n Competitionstats: telemetryPageName(\"competitionstats\", TelemetryPageType.StructuredDataPage),\r\n Polls: telemetryPageName(\"polls\", TelemetryPageType.StructuredDataPage),\r\n Data_photos: telemetryPageName(\"data_photos\", TelemetryPageType.StructuredDataPage),\r\n Videocategorylistpage: telemetryPageName(\"videocategorylistpage\", TelemetryPageType.StructuredDataPage),\r\n Stockfinancialsdetails: telemetryPageName(\"stockfinancialsdetails\", TelemetryPageType.StructuredDataPage),\r\n Commoditydetailspage: telemetryPageName(\"commoditydetailspage\", TelemetryPageType.StructuredDataPage),\r\n Data_yearoverview_trim: telemetryPageName(\"data_yearoverview_trim\", TelemetryPageType.StructuredDataPage),\r\n Worldwidepage: telemetryPageName(\"worldwidepage\", TelemetryPageType.StructuredDataPage),\r\n Data_photos_trim: telemetryPageName(\"data_photos_trim\", TelemetryPageType.StructuredDataPage),\r\n Stockcompanydetails: telemetryPageName(\"stockcompanydetails\", TelemetryPageType.StructuredDataPage),\r\n Retirementplanner: telemetryPageName(\"retirementplanner\", TelemetryPageType.StructuredDataPage),\r\n Livecoverage: telemetryPageName(\"livecoverage\", TelemetryPageType.StructuredDataPage),\r\n Teamroster: telemetryPageName(\"teamroster\", TelemetryPageType.StructuredDataPage),\r\n Stockhistorydetails: telemetryPageName(\"stockhistorydetails\", TelemetryPageType.StructuredDataPage),\r\n Filterresultspage: telemetryPageName(\"filterresultspage\", TelemetryPageType.StructuredDataPage),\r\n Data_carcompare: telemetryPageName(\"data_carcompare\", TelemetryPageType.StructuredDataPage),\r\n Stockownershipdetails: telemetryPageName(\"stockownershipdetails\", TelemetryPageType.StructuredDataPage),\r\n Driverstandings: telemetryPageName(\"driverstandings\", TelemetryPageType.StructuredDataPage),\r\n Timevalueofmoney: telemetryPageName(\"timevalueofmoney\", TelemetryPageType.StructuredDataPage),\r\n Savingscalculator: telemetryPageName(\"savingscalculator\", TelemetryPageType.StructuredDataPage),\r\n Iccmatches: telemetryPageName(\"iccmatches\", TelemetryPageType.StructuredDataPage),\r\n Other_flightsearchresult: telemetryPageName(\"other_flightsearchresult\", TelemetryPageType.StructuredDataPage),\r\n Stockrelateddetails: telemetryPageName(\"stockrelateddetails\", TelemetryPageType.StructuredDataPage),\r\n Data_specs_trim: telemetryPageName(\"data_specs_trim\", TelemetryPageType.StructuredDataPage),\r\n Stockoptionsdetails: telemetryPageName(\"stockoptionsdetails\", TelemetryPageType.StructuredDataPage),\r\n HomepageAlerts: telemetryPageName(\"homepage-alerts\", TelemetryPageType.StructuredDataPage),\r\n HomepageRecordsandAverages: telemetryPageName(\"homepage-recordsandaverages\", TelemetryPageType.StructuredDataPage),\r\n HomepageWeatherTraffic: telemetryPageName(\"homepage-weathertraffic\", TelemetryPageType.StructuredDataPage),\r\n Data_specs: telemetryPageName(\"data_specs\", TelemetryPageType.StructuredDataPage),\r\n Data_pricing: telemetryPageName(\"data_pricing\", TelemetryPageType.StructuredDataPage),\r\n Mortgagecalculator: telemetryPageName(\"mortgagecalculator\", TelemetryPageType.StructuredDataPage),\r\n Data_performance_trim: telemetryPageName(\"data_performance_trim\", TelemetryPageType.StructuredDataPage),\r\n Theatershowtimes: telemetryPageName(\"theatershowtimes\", TelemetryPageType.StructuredDataPage),\r\n Data_pricing_trim: telemetryPageName(\"data_pricing_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_photosInterior: telemetryPageName(\"data_photos-interior\", TelemetryPageType.StructuredDataPage),\r\n Indexdetailsanalysispage: telemetryPageName(\"indexdetailsanalysispage\", TelemetryPageType.StructuredDataPage),\r\n Data_photosInterior_trim: telemetryPageName(\"data_photos-interior_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_photosColors: telemetryPageName(\"data_photos-colors\", TelemetryPageType.StructuredDataPage),\r\n Data_carReviews_trim: telemetryPageName(\"data_car-reviews_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_carReviews: telemetryPageName(\"data_car-reviews\", TelemetryPageType.StructuredDataPage),\r\n Racecalendar: telemetryPageName(\"racecalendar\", TelemetryPageType.StructuredDataPage),\r\n Teamstandings: telemetryPageName(\"teamstandings\", TelemetryPageType.StructuredDataPage),\r\n Data_photosColors_trim: telemetryPageName(\"data_photos-colors_trim\", TelemetryPageType.StructuredDataPage),\r\n Stockdetails: telemetryPageName(\"stockdetails\", TelemetryPageType.StructuredDataPage),\r\n Data_interiorFeatures_trim: telemetryPageName(\"data_interior-features_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_exteriorFeatures_trim: telemetryPageName(\"data_exterior-features_trim\", TelemetryPageType.StructuredDataPage),\r\n Calendar: telemetryPageName(\"calendar\", TelemetryPageType.StructuredDataPage),\r\n TeamStats: telemetryPageName(\"teamstats\", TelemetryPageType.StructuredDataPage),\r\n Movieshowtimes: telemetryPageName(\"movieshowtimes\", TelemetryPageType.StructuredDataPage),\r\n Drafts: telemetryPageName(\"drafts\", TelemetryPageType.StructuredDataPage),\r\n Data_technologyFeatures_trim: telemetryPageName(\"data_technology-features_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_workoutdetails_collection: telemetryPageName(\"data_workoutdetails_collection\", TelemetryPageType.StructuredDataPage),\r\n Data_photosExterior: telemetryPageName(\"data_photos-exterior\", TelemetryPageType.StructuredDataPage),\r\n Data_photosExterior_trim: telemetryPageName(\"data_photos-exterior_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_photos360Interior: telemetryPageName(\"data_photos-360-interior\", TelemetryPageType.StructuredDataPage),\r\n Immersivechartsmarketspage: telemetryPageName(\"immersivechartsmarketspage\", TelemetryPageType.StructuredDataPage),\r\n Returnoninvestment: telemetryPageName(\"returnoninvestment\", TelemetryPageType.StructuredDataPage),\r\n Indexdetailsrelatedpage: telemetryPageName(\"indexdetailsrelatedpage\", TelemetryPageType.StructuredDataPage),\r\n Gonepage: telemetryPageName(\"gonepage\", TelemetryPageType.StructuredDataPage),\r\n Data_compare: telemetryPageName(\"data_compare\", TelemetryPageType.StructuredDataPage),\r\n Data_compare_trim: telemetryPageName(\"data_compare_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_options_trim: telemetryPageName(\"data_options_trim\", TelemetryPageType.StructuredDataPage),\r\n Entitiespage: telemetryPageName(\"entitiespage\", TelemetryPageType.StructuredDataPage),\r\n Workoutdetailsprint: telemetryPageName(\"workoutdetailsprint\", TelemetryPageType.StructuredDataPage),\r\n Data_photos360Exterior: telemetryPageName(\"data_photos-360-exterior\", TelemetryPageType.StructuredDataPage),\r\n HomepageDatacarfinder: telemetryPageName(\"homepage-datacarfinder\", TelemetryPageType.StructuredDataPage),\r\n Data_photos360Interior_trim: telemetryPageName(\"data_photos-360-interior_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_skeleton: telemetryPageName(\"data_skeleton\", TelemetryPageType.StructuredDataPage),\r\n Mortgagerates: telemetryPageName(\"mortgagerates\", TelemetryPageType.StructuredDataPage),\r\n Brackets: telemetryPageName(\"brackets\", TelemetryPageType.StructuredDataPage),\r\n Data_photos360Exterior_trim: telemetryPageName(\"data_photos-360-exterior_trim\", TelemetryPageType.StructuredDataPage),\r\n Data_photocompare: telemetryPageName(\"data_photocompare\", TelemetryPageType.StructuredDataPage),\r\n HomepageWeather10day: telemetryPageName(\"homepage-weather10day\", TelemetryPageType.StructuredDataPage),\r\n Data_performance: telemetryPageName(\"data_performance\", TelemetryPageType.StructuredDataPage),\r\n HomepageWeatherextendedforecast: telemetryPageName(\"homepage-weatherextendedforecast\", TelemetryPageType.StructuredDataPage),\r\n Savings: telemetryPageName(\"savings\", TelemetryPageType.StructuredDataPage),\r\n Data_exteriorFeatures: telemetryPageName(\"data_exterior-features\", TelemetryPageType.StructuredDataPage),\r\n Data_interiorFeatures: telemetryPageName(\"data_interior-features\", TelemetryPageType.StructuredDataPage),\r\n Data_options: telemetryPageName(\"data_options\", TelemetryPageType.StructuredDataPage),\r\n Travelgonepage: telemetryPageName(\"travelgonepage\", TelemetryPageType.StructuredDataPage),\r\n Recipe: telemetryPageName(\"recipe\", TelemetryPageType.StructuredDataPage),\r\n Getportfoliodatapage: telemetryPageName(\"getportfoliodatapage\", TelemetryPageType.StructuredDataPage),\r\n Brokercenterpage: telemetryPageName(\"brokercenterpage\", TelemetryPageType.StructuredDataPage),\r\n Data_technologyFeatures: telemetryPageName(\"data_technology-features\", TelemetryPageType.StructuredDataPage),\r\n Tvlistings: telemetryPageName(\"tvlistings\", TelemetryPageType.StructuredDataPage),\r\n Ownerstandings: telemetryPageName(\"ownerstandings\", TelemetryPageType.StructuredDataPage),\r\n Entitydetailspage: telemetryPageName(\"entitydetailspage\", TelemetryPageType.StructuredDataPage),\r\n Creditcards: telemetryPageName(\"creditcards\", TelemetryPageType.StructuredDataPage),\r\n Cmssitemap: telemetryPageName(\"cmssitemap\", TelemetryPageType.StructuredDataPage),\r\n Externalnativeadpage: telemetryPageName(\"externalnativeadpage\", TelemetryPageType.StructuredDataPage),\r\n Autoloans: telemetryPageName(\"autoloans\", TelemetryPageType.StructuredDataPage),\r\n Externalcontent: telemetryPageName(\"externalcontent\", TelemetryPageType.StructuredDataPage),\r\n Htmlsitemap: telemetryPageName(\"htmlsitemap\", TelemetryPageType.StructuredDataPage)\r\n },\r\n CustomColumnPageNames:\r\n {\r\n TrendingTopics: telemetryPageName(\"topic_tt\", TelemetryPageType.CustomColumn),\r\n GlobalSettingsPage: telemetryPageName(\"globalsettingspage\", TelemetryPageType.CustomColumn),\r\n MyTopics: telemetryPageName(\"mytopics\", TelemetryPageType.CustomColumn),\r\n WeatherPlaces: telemetryPageName(\"weatherplaces\", TelemetryPageType.CustomColumn),\r\n MyFavorites: telemetryPageName(\"myfavorites\", TelemetryPageType.CustomColumn),\r\n TopicResult: telemetryPageName(\"topicresult\", TelemetryPageType.CustomColumn),\r\n Collections: telemetryPageName(\"collections\", TelemetryPageType.CustomColumn),\r\n Rouxbe: telemetryPageName(\"rouxbe\", TelemetryPageType.CustomColumn),\r\n ShoppingList: telemetryPageName(\"shopping list\", TelemetryPageType.CustomColumn),\r\n MyHealthReportsPage: telemetryPageName(\"myhealthreportspage\", TelemetryPageType.CustomColumn),\r\n Error404page: telemetryPageName(\"error404page\", TelemetryPageType.CustomColumn),\r\n AppsPromotion: telemetryPageName(\"appspromotion\", TelemetryPageType.CustomColumn),\r\n Error500page: telemetryPageName(\"error500page\", TelemetryPageType.CustomColumn),\r\n DietTrackerPreSigninPage: telemetryPageName(\"diettrackerpresigninpage\", TelemetryPageType.CustomColumn),\r\n ExerciseTrackerPreSigninPage: telemetryPageName(\"exercisetrackerpresigninpage\", TelemetryPageType.CustomColumn),\r\n WebSlicePage: telemetryPageName(\"other_webslice\", TelemetryPageType.CustomColumn),\r\n Error200Page: telemetryPageName(\"error200page\", TelemetryPageType.CustomColumn),\r\n AboutUsPage: telemetryPageName(\"aboutus\", TelemetryPageType.CustomColumn),\r\n UnSupport: telemetryPageName(\"unsupport\", TelemetryPageType.CustomColumn),\r\n Disclaimer: telemetryPageName(\"disclaimer\", TelemetryPageType.CustomColumn),\r\n TermsOfService: telemetryPageName(\"termsofservice\", TelemetryPageType.CustomColumn),\r\n SevereWeather: telemetryPageName(\"severeweather\", TelemetryPageType.CustomColumn)\r\n },\r\n SubjectSectionPageNames:\r\n {\r\n TeamhomePage: telemetryPageName(\"teamhome\", TelemetryPageType.SubjectSection),\r\n PlayerPage: telemetryPageName(\"player\", TelemetryPageType.SubjectSection),\r\n MarketMoversPage: telemetryPageName(\"marketmovers\", TelemetryPageType.SubjectSection),\r\n CommoditiesPage: telemetryPageName(\"commoditiespage\", TelemetryPageType.SubjectSection),\r\n ChefPage: telemetryPageName(\"chef\", TelemetryPageType.SubjectSection),\r\n NutritionIndexPage: telemetryPageName(\"nutritionindex\", TelemetryPageType.SubjectSection),\r\n FinanceTechnologyPage: telemetryPageName(\"finance-technologypage\", TelemetryPageType.SubjectSection),\r\n MedicalindexPage: telemetryPageName(\"medicalindex\", TelemetryPageType.SubjectSection)\r\n },\r\n SiteSearchPageNames:\r\n {\r\n SearchResultsPage: telemetryPageName(\"searchresultspage\", TelemetryPageType.SiteSearch),\r\n VideoSearchResultsPage: telemetryPageName(\"videosearchresultspage\", TelemetryPageType.SiteSearch),\r\n PartnerVideolistPage: telemetryPageName(\"partnervideolistpage\", TelemetryPageType.SiteSearch),\r\n HomepageBingserpIframepage: telemetryPageName(\"homepage-bingserpiframepage\", TelemetryPageType.SiteSearch),\r\n SitesearchSitesearch: telemetryPageName(\"sitesearch_sitesearch\", TelemetryPageType.SiteSearch),\r\n SearchResults: telemetryPageName(\"search results\", TelemetryPageType.SiteSearch),\r\n SerpPage: telemetryPageName(\"serppage\", TelemetryPageType.SiteSearch),\r\n FindaMoviePage: telemetryPageName(\"findamoviepage\", TelemetryPageType.SiteSearch)\r\n },\r\n SectionFrontPageNames:\r\n {\r\n Competitionhub: telemetryPageName(\"competitionhub\", TelemetryPageType.SectionFront),\r\n Local: telemetryPageName(\"local\", TelemetryPageType.SectionFront),\r\n Stockscreener: telemetryPageName(\"stockscreener\", TelemetryPageType.SectionFront),\r\n Toolslandingpage: telemetryPageName(\"toolslandingpage\", TelemetryPageType.SectionFront),\r\n Showtimes: telemetryPageName(\"showtimes\", TelemetryPageType.SectionFront),\r\n FinanceRealEstatepage: telemetryPageName(\"finance-real-estatepage\", TelemetryPageType.SectionFront),\r\n CookingSchool: telemetryPageName(\"cooking school\", TelemetryPageType.SectionFront),\r\n Allcompetitions: telemetryPageName(\"allcompetitions\", TelemetryPageType.SectionFront),\r\n Newspage: telemetryPageName(\"newspage\", TelemetryPageType.SectionFront),\r\n CocktailHub: telemetryPageName(\"cocktail hub\", TelemetryPageType.SectionFront),\r\n Travelflightsearchhubpage: telemetryPageName(\"travelflightsearchhubpage\", TelemetryPageType.SectionFront),\r\n Hotelshubpage: telemetryPageName(\"hotelshubpage\", TelemetryPageType.SectionFront),\r\n WineHub: telemetryPageName(\"wine hub\", TelemetryPageType.SectionFront),\r\n ChefHub: telemetryPageName(\"chef hub\", TelemetryPageType.SectionFront),\r\n Travelflightstatushubpage: telemetryPageName(\"travelflightstatushubpage\", TelemetryPageType.SectionFront),\r\n HomepageCompetitionhub: telemetryPageName(\"homepage-competitionhub\", TelemetryPageType.SectionFront),\r\n Editorial: telemetryPageName(\"editorial\", TelemetryPageType.SectionFront),\r\n SecfrontHotel: telemetryPageName(\"secfront_hotel\", TelemetryPageType.SectionFront),\r\n SecfrontTNews: telemetryPageName(\"secfront_tnews\", TelemetryPageType.SectionFront)\r\n }\r\n};\r\n\r\n/// Telemetry PageMode \r\nconst TelemetryPageMode = {\r\n Default: 0,\r\n Trial: 1,\r\n Subscription: 2\r\n};\r\n\r\n/// Telemetry Page Pivot \r\nconst TelemetryPagePivot = {\r\n Undefined: \"undefined\",\r\n Office: \"office\",\r\n Apps: \"apps\",\r\n News: \"news\",\r\n Timeline: \"timeline\",\r\n StartMenu: \"startmenu\"\r\n};\r\n\r\n/// Telemetry User Id Type \r\nconst TelemetryUserType = {\r\n Aad: \"aad\",\r\n Msa: \"msa\",\r\n MsaKids: \"msa-kids\",\r\n Local: \"local\"\r\n};\r\n\r\nconst TelemetryActionType = {\r\n Click: \"click\",\r\n Hover: \"mouseenter\",\r\n Submit: \"submit\",\r\n View: \"view\",\r\n RightClick: \"rightclick\"\r\n};\r\n\r\nexport const telemetryDataTypes = {\r\n TelemetryProduct: TelemetryProduct,\r\n TelemetryPageType: TelemetryPageType,\r\n TelemetryType: TelemetryType,\r\n TelemetryContentType: TelemetryContentType,\r\n TelemetryBehaviorType: TelemetryBehaviorType,\r\n ContentPlacedBySource: ContentPlacedBySource,\r\n TelemetryPageConfiguration: TelemetryPageConfiguration,\r\n TelemetryPageName: TelemetryPageName,\r\n TelemetryPageMode: TelemetryPageMode,\r\n TelemetryPagePivot: TelemetryPagePivot,\r\n TelemetryPartnerNamespace: TelemetryPartnerNamespace,\r\n TelemetryUserType: TelemetryUserType,\r\n getTelemetryContentType: getTelemetryContentType,\r\n getTelemetryPageInfo: getTelemetryPageInfo,\r\n validateTelemetryDataType: validateTelemetryDataType,\r\n getTelemetryBehavior: getTelemetryBehavior,\r\n TelemetryActionType: TelemetryActionType\r\n};\r\n\r\n/// \r\n/// This function gets the telemetry page info object from the given pageName string.\r\n/// \r\n/// PageName string\r\n/// The Telemetry Page Name object\r\nfunction getTelemetryPageInfo(pageName) {\r\n if (pageName && PageNamePageTypeMappingList) {\r\n pageName = pageName.toLowerCase();\r\n if (PageNamePageTypeMappingList[pageName] !== undefined) {\r\n return PageNamePageTypeMappingList[pageName];\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/// \r\n/// This function validates and returns the telemetry data type from the given string of the data type.\r\n/// \r\n/// DataType enum e.g. telemetryDataType.TelemetryPageType\r\n/// value of the type to validate\r\n/// The Telemetry Page type\r\nfunction validateTelemetryDataType(type, value) {\r\n if (type && value) {\r\n for (const prop of Object.keys(type)) {\r\n if ((typeof value == \"string\" && type[prop] === value.toLowerCase()) || type[prop] === value) {\r\n return type[prop];\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/// \r\n/// Private class to define the telemetry Page Name. This class is purposefully not exposed to public.\r\n/// Public should use getTelemetryPageName to get the telemetrypagename object from the given pagename string.\r\n/// All the telemetry page names should be defined as part of this javascript file.\r\n/// \r\n/// PageName string\r\n/// PageType should be of type TelemetryPageType\r\n/// The Telemetry Page Name object\r\nfunction telemetryPageName(pageName, pageType) {\r\n if (pageName) {\r\n const name = pageName.toLowerCase();\r\n const pType = pageType || TelemetryPageType.Unspecified;\r\n const telemetryPageNameObject = { PageName: name, PageType: pType };\r\n PageNamePageTypeMappingList[name] = telemetryPageNameObject;\r\n\r\n return telemetryPageNameObject;\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/// \r\n/// This function gets the telemetry contentType from the given telemetryType.\r\n/// \r\n/// TelemetryType enum value\r\n/// ContentType enum.\r\nfunction getTelemetryContentType(telemetryType) {\r\n if (TelemetryTypeContentTypeMappingList[telemetryType]) {\r\n return TelemetryTypeContentTypeMappingList[telemetryType];\r\n }\r\n}\r\n\r\n/// \r\n/// This function gets the telemetry contentAction from the given telemetryType.\r\n/// \r\n/// TelemetryType enum value\r\n/// ContentAction enum.\r\nfunction getTelemetryBehavior(telemetryType) {\r\n if (TelemetryTypeBehaviorTypeMappingList[telemetryType]) {\r\n return TelemetryTypeBehaviorTypeMappingList[telemetryType];\r\n } else {\r\n return TelemetryBehaviorType.Undefined;\r\n }\r\n}\r\n\r\n/// \r\n/// Private function for initializing mapping between telemetryType and telemetryContentType.\r\n/// This will be removed after telemetryType deprecated.\r\n/// \r\nfunction initTelemetryTypeContentTypeMappingList() {\r\n TelemetryTypeContentTypeMappingList[TelemetryType.AppInstall] = TelemetryContentType.App;\r\n TelemetryTypeContentTypeMappingList[TelemetryType.AppLaunch] = TelemetryContentType.App;\r\n TelemetryTypeContentTypeMappingList[TelemetryType.SponsoredContent] = TelemetryContentType.SponsoredContent;\r\n TelemetryTypeContentTypeMappingList[TelemetryType.StructuredData] = TelemetryContentType.StructuredDataCard;\r\n TelemetryTypeContentTypeMappingList[TelemetryType.AppStore] = TelemetryContentType.AppStorePromo;\r\n}\r\n\r\n/// \r\n/// Private function for initializing mapping between telemetryType and TelemetryBehaviorType.\r\n/// This will be removed after telemetryType deprecated.\r\n/// \r\nfunction initTelemetryTypeBehaviorTypeMappingList() {\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.AppInstall] = TelemetryBehaviorType.Install;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.AppLaunch] = TelemetryBehaviorType.Launch;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Follow] = TelemetryBehaviorType.Follow;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Unfollow] = TelemetryBehaviorType.Unfollow;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Like] = TelemetryBehaviorType.Like;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Dislike] = TelemetryBehaviorType.Dislike;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Unlike] = TelemetryBehaviorType.Unlike;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Undislike] = TelemetryBehaviorType.Undislike;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Mute] = TelemetryBehaviorType.Mute;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Unmute] = TelemetryBehaviorType.Unmute;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.MuteCancel] = TelemetryBehaviorType.MuteCancel;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Manage] = TelemetryBehaviorType.Manage;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Hide] = TelemetryBehaviorType.Hide;\r\n TelemetryTypeBehaviorTypeMappingList[TelemetryType.Unhide] = TelemetryBehaviorType.Unhide;\r\n}\r\n\r\n// Init telemetryType mapping\r\ninitTelemetryTypeContentTypeMappingList();\r\ninitTelemetryTypeBehaviorTypeMappingList();","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { get, set } from \"lodash-es\";\r\n\r\nimport { ConnectorConstants } from \"../constants/ConnectorConstants\";\r\nimport { ConnectorNamespaces } from \"@msnews/experiences-constants\";\r\n\r\n/**\r\n * Maps the data connector name to the set of experience keys it is injected into.\r\n * The values include the \"._@STATE@_\" portion needed to pull experience state out of the app state object.\r\n */\r\nconst dataConnectorToExperienceKeyMap: Map> = new Map>();\r\n\r\n/**\r\n * Register a data connector to inject into an experience.\r\n * @param experienceFullNamespace The full namespace of the experience to inject into.\r\n * @param dataConnectorName The name for the data connector to inject.\r\n */\r\nfunction registerInjection(\r\n experienceFullNamespace: string,\r\n dataConnectorName: ConnectorNamespaces): void {\r\n let experienceSet: Set = dataConnectorToExperienceKeyMap.get(dataConnectorName);\r\n if (!experienceSet) {\r\n experienceSet = new Set();\r\n dataConnectorToExperienceKeyMap.set(dataConnectorName, experienceSet);\r\n }\r\n\r\n experienceSet.add(createStatePropertyKey(experienceFullNamespace));\r\n}\r\n\r\n/**\r\n * Initializes the shared data connector state for the given experience.\r\n * @param appState The global app state to modify.\r\n * @param experienceFullNamespace The full namespace of the experience to host the data connector state.\r\n * @param dataConnectorName The name of the data connector to use.\r\n */\r\nfunction initializeExperience(\r\n appState: any,\r\n experienceFullNamespace: string,\r\n dataConnectorName: ConnectorNamespaces): void {\r\n\r\n // Setup the key and get the actual state property for the connector. lodash uses dotted notation\r\n // so the key will be something like: namespace._@STATE@_\r\n const experienceStatePropertyKey = createStatePropertyKey(experienceFullNamespace);\r\n const connectorPreviousState = get(appState, experienceStatePropertyKey, undefined);\r\n\r\n // Find the initial data connector state\r\n const initialDataConnectorState = get(appState, createStatePropertyKey(dataConnectorName), undefined);\r\n\r\n // Create the new experience connector state\r\n const nextStateForConnector = { ...connectorPreviousState, [dataConnectorName]: initialDataConnectorState };\r\n set(appState, experienceStatePropertyKey, nextStateForConnector);\r\n}\r\n\r\n/**\r\n * Updates the data connector state on all experiences that include it.\r\n * @param appState The global app state object.\r\n * @param dataConnectorNamespace The namespace of the data connector that's been updated.\r\n * @param newDataConnectorState The new data connector state object.\r\n */\r\nfunction reportStateChange(\r\n appState: any,\r\n dataConnectorNamespace: string,\r\n newDataConnectorState: any): void {\r\n\r\n const experienceKeys: Set = dataConnectorToExperienceKeyMap.get(dataConnectorNamespace);\r\n if (experienceKeys) {\r\n for (const experienceKey of experienceKeys) {\r\n const experiencePreviousState: any = get(appState, experienceKey, undefined);\r\n\r\n if (experiencePreviousState) {\r\n set(appState, experienceKey, { ...experiencePreviousState, [dataConnectorNamespace]: newDataConnectorState });\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Creates the lodash property key to get or set the experience or data connector state.\r\n * @param fullNamespace The full namespace of the experience or data connector.\r\n */\r\nfunction createStatePropertyKey(fullNamespace: string): string {\r\n return fullNamespace + \".\" + ConnectorConstants.connectorStateKey;\r\n}\r\n\r\n/** Methods to support injecting data connector state into experiences */\r\nexport const dataConnectorInjector = {\r\n registerInjection,\r\n initializeExperience,\r\n reportStateChange\r\n};\r\n","\r\n// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { RenderCache, RenderCacheKeys } from \"./RenderCache\";\r\nimport { renderCacheKeyOfNormalizedKeys, riverRcClassName } from \"./Constants\";\r\n\r\nlet renderCacheObject: RenderCache;\r\n\r\n/**\r\n * Function to get render cache if it's valid.\r\n * @returns Render cache object if it exists and is valid otherwise null.\r\n */\r\nexport function getRenderCache(): RenderCache {\r\n if (renderCacheObject) {\r\n return renderCacheObject;\r\n }\r\n\r\n if (!(window && window.localStorage)) {\r\n return null;\r\n }\r\n\r\n // get all normalized render cache keys from local storage\r\n let renderCacheKeys: RenderCacheKeys;\r\n const renderCacheStoredKeys = window.localStorage.getItem(renderCacheKeyOfNormalizedKeys);\r\n try {\r\n renderCacheKeys = renderCacheStoredKeys && JSON.parse(renderCacheStoredKeys);\r\n } catch (error) {\r\n return null; // keys not parsable.\r\n }\r\n\r\n if (!renderCacheKeys || !renderCacheKeys.keyn || !renderCacheKeys.expn || !renderCacheKeys.frcn || !renderCacheKeys.jssn) {\r\n return null;\r\n }\r\n\r\n const cacheExpirationTimestamp = window.localStorage.getItem(renderCacheKeys.expn);\r\n if (!cacheExpirationTimestamp) {\r\n return null; // Cache Expiration Timestamp not exist\r\n }\r\n\r\n const parsedCacheExpirationTimestamp = parseInt(cacheExpirationTimestamp);\r\n if (!parsedCacheExpirationTimestamp) {\r\n return null; // Cache Expiration Timestamp broken.\r\n }\r\n\r\n const currentTimestamp: number = new Date().getTime();\r\n if (currentTimestamp >= parsedCacheExpirationTimestamp) {\r\n return null; // cache expired.\r\n }\r\n\r\n const renderCacheStorage = window.localStorage.getItem(renderCacheKeys.keyn);\r\n if (!renderCacheStorage) {\r\n return null; // Cache object is missing.\r\n }\r\n\r\n try {\r\n renderCacheObject = JSON.parse(renderCacheStorage);\r\n } catch (error) {\r\n return null; // Cache object not parsable.\r\n }\r\n\r\n if (!renderCacheObject || !renderCacheObject.dom || !renderCacheObject.batch_css) {\r\n renderCacheObject = null; // Cache object is broken\r\n }\r\n\r\n return renderCacheObject;\r\n}\r\n\r\n/**\r\n * Batch All styles into one object.\r\n */\r\nexport function batchCSS(): string {\r\n let batchCss = \"\";\r\n\r\n // Enumerate and write out all of the JSS styles\r\n const styles = document.getElementsByTagName(\"style\");\r\n const length = styles.length;\r\n\r\n for (let i = 0; i < length; i++) {\r\n // Skip any styles that do not have a data-jss attribute to always pick newer styles added by jss\r\n if (styles[i].dataset.jss != null) {\r\n batchCss += styles[i].innerHTML;\r\n }\r\n }\r\n\r\n return batchCss;\r\n}\r\n\r\n/**\r\n * Scrapes Dom and remove River.\r\n */\r\nexport function scrapeDom(includeNewsFeed: boolean): string {\r\n const root = document.getElementById(\"root\");\r\n\r\n if (!root || !root.innerHTML) {\r\n return \"\";\r\n }\r\n\r\n /* Currently we don't have functionality to include experiences separately,\r\n because of that we do return whole dom if river included in render cache and exclude river otherwise */\r\n if (includeNewsFeed) {\r\n return root.innerHTML;\r\n }\r\n\r\n const rivers = document.getElementsByClassName(riverRcClassName);\r\n\r\n if (!rivers || !rivers.length) {\r\n return root.innerHTML;\r\n }\r\n\r\n const river = rivers[0] as HTMLElement;\r\n\r\n return root.innerHTML.replace(river.outerHTML, \"\");\r\n}\r\n\r\n/**\r\n * Gets the state object from render cache.\r\n * @returns The redux state object.\r\n */\r\nexport function getStateFromRenderCache(): any {\r\n // Check to see if this app instance was bootstrapped with a render-cache\r\n const renderCache = getRenderCache();\r\n\r\n if (!renderCache || !renderCache.state) {\r\n return null; // Render Cache missing or it does not include State.\r\n }\r\n\r\n let initialState;\r\n\r\n try {\r\n initialState = JSON.parse(renderCache.state, reduxStoreStringifyReviver);\r\n } catch (error) {\r\n // Cache state object is not parsable.\r\n }\r\n\r\n return initialState;\r\n}\r\n\r\n/**\r\n * Redux Store Stringify replacer HOF, generates store stringify.\r\n * @param storeExceptions list of store namespaces which will not be included in result.\r\n */\r\nexport function reduxStoreStringifyReplacer(key: string, value: any): any {\r\n const originalObject = this[key];\r\n if (originalObject instanceof Map) {\r\n return {\r\n dataType: \"Map\",\r\n value: [...originalObject]\r\n };\r\n } else {\r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * Custom JSON.stringify reviver that will create Map objects from a string/JSON representation\r\n * @param key not used\r\n * @param value The value being converted from a string\r\n */\r\nfunction reduxStoreStringifyReviver(key: any, value: any): any {\r\n // If the value being restored is a object, check it it was a map\r\n if (typeof value === \"object\" && value !== null) {\r\n // If the object value being restored was a map, that was custom written, then revive it by creating a map\r\n if (value.dataType === \"Map\") {\r\n return new Map(value.value);\r\n }\r\n }\r\n\r\n // Return the original value being restored\r\n return value;\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * Enum for different page types\r\n * @enum\r\n */\r\nexport enum PageType {\r\n Article = \"article\",\r\n ArticleFullScreen = \"articlefullscreen\",\r\n DHP = \"dhp\",\r\n Gallery = \"gallery\",\r\n GalleryFullScreen = \"galleryfullscreen\",\r\n MMX = \"mmx\",\r\n NTP = \"ntp\",\r\n Video = \"video\",\r\n Windows = \"windowshp\",\r\n WindowsShell = \"shellhp\"\r\n}\r\n\r\n/** The AudienceMode enum */\r\nexport enum AudienceModeType {\r\n Adult = \"adult\",\r\n Enterprise = \"enterprise\",\r\n Kids = \"kids\"\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\n/**\r\n * Constants used by WPO\r\n */\r\nexport const WpoConstant = {\r\n /**\r\n * WPO flight identifier that will be used to enabled/disable WPO. As WPO runs before any config fetch we cannot rely on\r\n * config params to enable/disable WPO. This unique flight in the head-data is used to make decision.\r\n * We will also use an explicit PCS flag to enable/disable WPO that will override this flag for DRI use cases.\r\n */\r\n wpoFlightIdentifier: \"prg-wpo-enabled\"\r\n\r\n};","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { WpoConstant, WpoModel } from \".\";\r\nimport { ITargetScope } from \"cms-models-msn/configuration/ITargetScope\";\r\n\r\n/**\r\n * Returns a boolean value indicating whether WPO feature is enabled or not.\r\n * @param string[] currentPageExperiments - Array of flight ids present in current request.\r\n * @returns Boolean - true if WPO feature is enabled, else false.\r\n */\r\nexport function isWpoEnabled(currentPageExperiments: string[]): boolean {\r\n if (!currentPageExperiments || !currentPageExperiments.length) {\r\n return false;\r\n }\r\n\r\n return (currentPageExperiments.indexOf(WpoConstant.wpoFlightIdentifier)) > -1;\r\n}\r\n\r\n/**\r\n * Get storage cache key used to store WPO service response.\r\n * @param {string} appType - The appType value.\r\n * @param {ITargetScope} targetScope - The current page request target scope.\r\n * @returns string - Cache key string.\r\n */\r\nexport function getWpoStorageCacheKey(appType: string, targetScope: ITargetScope): string {\r\n const { audienceMode = \"\", locale = {}, pageType = \"\" } = targetScope || {};\r\n const { language, market } = locale;\r\n\r\n return `wpo_data_ ${audienceMode}_${language}_${market}_${pageType}_${appType}`;\r\n}\r\n\r\n/**\r\n * Extracts the WPO flight ids from the WPOModel object.\r\n * @param {WpoModel} wpoData - The WPOModel object.\r\n * @returns string[] - Array of WPO recommended flight ids\r\n */\r\nexport function getWpoFlights(wpoData: WpoModel): string[] | null {\r\n if (!wpoData || !wpoData.treatments) {\r\n return null;\r\n }\r\n\r\n return wpoData.treatments.map(item => item.id);\r\n}","// © Microsoft Corporation. All rights reserved.\r\n\r\nimport { canUseDOM, getDocumentElementsByTagName, getLocationSearch, getLocationHostname } from \"@msnews/isomorphic-util\";\r\nimport { applicationCacheConstants, clientSettings, dir, htmlElementIds, info, js, lang, pagetypeSettings, CoreLocalStorageKeys } from \"../constants\";\r\n\r\nimport { AudienceModeType } from \"@msnews/experiences-constants\";\r\nimport { DeviceFormFactorType } from \"cms-models-msn/configuration/types/DeviceFormFactorType\";\r\nimport { Environment } from \"./Environment\";\r\nimport { ILocale } from \"cms-models-msn/configuration/ILocale\";\r\nimport { IPcsBrowserScope } from \"../types/PcsBrowsersType\";\r\nimport { IPcsInformation } from \"../types/PcsInformation\";\r\nimport { IBundleInformation } from \"../types/BundleInformation\";\r\nimport { MarketProperties } from \"./MarketProperties\";\r\nimport { WebClientData } from \"./WebClientData\";\r\nimport { OperatingSystemType } from \"cms-models-msn/configuration/types/OperatingSystemType\";\r\nimport { UrlUtility } from \"../utilities/UrlUtility\";\r\nimport { localStorage } from \"../utilities/WebStorage\";\r\nimport { tryParseJson } from \"../utilities/Parsing\";\r\nimport { KeyValueArray } from \"../utilities\";\r\n\r\n/**\r\n * Format used for activity ID stored in storage\r\n */\r\nexport type StoredActivityId = {\r\n /**\r\n * ID value\r\n */\r\n id: string,\r\n\r\n /**\r\n * Timestamp of when value was stored\r\n */\r\n ts: number,\r\n\r\n /**\r\n * Flag inidicating if the ID was used in a previous page (stale)\r\n */\r\n previouslyUsed?: boolean\r\n};\r\n\r\n/**\r\n * JSON data contract / interface for settings in the element that are part of the data-client-settings attribute.\r\n */\r\nexport interface IClientSettings {\r\n aid: string,\r\n apptype: string,\r\n apps_locale: string,\r\n audienceMode?: AudienceModeType,\r\n browser?: IPcsBrowserScope,\r\n configRootUrl?: string,\r\n deviceFormFactor?: DeviceFormFactorType,\r\n domain?: string,\r\n env: Environment, // will be removed after transition with pcsInfo\r\n featureFlags?: any,\r\n contentId?: string,\r\n\r\n /** The schema://domain to be used for the main feed URL */\r\n feedBaseDomain?: string,\r\n\r\n categoryKey?: string,\r\n functionalonly_cookie_experience: boolean,\r\n functional_cookie_patterns: string,\r\n functional_cookies: string,\r\n geo_city?: string,\r\n geo_country?: string,\r\n geo_countryname?: string;\r\n geo_lat: string,\r\n geo_long: string,\r\n geo_subdivision?: string,\r\n geo_zip?: string,\r\n locale?: ILocale,\r\n market?: MarketProperties,\r\n os?: OperatingSystemType,\r\n pagetype?: string,\r\n\r\n /** Query params in the format \"?key=value&...\" as observed from the PCS origin server */\r\n queryparams?: string,\r\n\r\n static_page?: string,\r\n verticalKey?: string,\r\n\r\n /** cache busting identifier sent by pcs */\r\n cbid?: string\r\n\r\n /** Peregrine Build version sent by PCS - will be removed after transition with bundleInfo */\r\n v?: string,\r\n\r\n /** PCS information */\r\n pcsInfo?: IPcsInformation,\r\n\r\n /** Bundle information */\r\n bundleInfo?: IBundleInformation,\r\n}\r\n\r\nexport const EnterpiseFlightId = \"prg-enterpriseblended-t\";\r\nexport const OfficeDefaultPivotFlightId = \"prg-officedefault-t\";\r\n\r\n/** Type for storing app versions for different page types */\r\nexport type PageAppVersions = { [pageType: string]: string };\r\n\r\n/**\r\n * Class for getting the head data information.\r\n */\r\nclass HeadData {\r\n /**\r\n * The single instance of the HeadData class.\r\n * @type {HeadData}\r\n */\r\n private static _instance: HeadData;\r\n\r\n private anonCookieName: string;\r\n private locale: string;\r\n private marketDir: string;\r\n private currentFlights: string;\r\n private clientSettings: IClientSettings;\r\n private enableCMSPPEConfigs = false;\r\n private userIsSignedIn: boolean; // Always signed out on server side: https://dev.azure.com/microsoft/OS/_workitems/edit/25344027\r\n private isPreload: boolean;\r\n private headElement: any;\r\n private htmlElement: any;\r\n private isAppcache: boolean;\r\n private isEnterprise: boolean;\r\n private isOfficeDefaultPivot: boolean;\r\n private isServiceWorkerCache: boolean;\r\n private ssoComplete: boolean;\r\n private aadState: boolean;\r\n private locationSearch: string;\r\n private lastKnownAppVersion: string;\r\n\r\n // TODO: Task 24890741: refactor this class to use the current singleton pattern with ES6 modules\r\n // This will also clean up these getters/setters\r\n public get Locale(): string { return this.locale; }\r\n public get MarketDir(): string { return this.marketDir; }\r\n public get CurrentFlights(): string { return this.currentFlights || \"\"; }\r\n public get ClientSettings(): IClientSettings { return this.clientSettings; }\r\n public get EnableCMSPPEConfigs(): boolean { return this.enableCMSPPEConfigs; }\r\n public get UserIsSignedIn(): boolean { return this.userIsSignedIn; }\r\n public get IsPreload(): boolean { return this.isPreload; }\r\n public get IsAppCache(): boolean { return this.isAppcache; }\r\n public get IsEnterprise(): boolean { return this.isEnterprise; }\r\n public get IsOfficeDefaultPivot(): boolean { return this.isOfficeDefaultPivot; }\r\n public get IsServiceWorkerCache(): boolean { return this.isServiceWorkerCache; }\r\n\r\n /**\r\n * The last known app version for the currently loaded page type.\r\n * To get the current page version, use clientSetings.v value.\r\n */\r\n public get LastKnownAppVersion(): string { return this.lastKnownAppVersion; }\r\n\r\n // TODO: Dependencies that some client side code expects headData to specify but doesn't due to PCS\r\n public get AnonCookieName(): string { return this.anonCookieName; }\r\n public get SsoComplete(): boolean { return this.ssoComplete; }\r\n public get AadState(): boolean { return this.aadState; }\r\n\r\n // For testing purposes add setters\r\n public set AnonCookieName(value: string) { this.anonCookieName = value; }\r\n public set LocaleName(value: string) { this.locale = value; }\r\n public set MarketDir(value: string) { this.marketDir = value; }\r\n public set CurrentFlights(value: string) { this.currentFlights = value; }\r\n public set ClientSettings(value: IClientSettings) { this.clientSettings = value; }\r\n public set IsEnterprise(value: boolean) { this.isEnterprise = value; }\r\n public set IsOfficeDefaultPivot(value: boolean) { this.isOfficeDefaultPivot = value; }\r\n public set IsPreload(value: boolean) { this.isPreload = value; }\r\n public set UserIsSignedIn(value: boolean) { this.userIsSignedIn = value; }\r\n public set AadState(value: boolean) { this.aadState = value; }\r\n\r\n /**\r\n * Initialize the head data instance, on server side provide the client info & client settings\r\n * @param {WebClientData} clientData Data object containing both client info and settings\r\n */\r\n private constructor(clientData?: WebClientData) {\r\n this.initializeHeadData(clientData);\r\n }\r\n\r\n /**\r\n * Returns singleton class instance.\r\n * @returns {HeadData}\r\n */\r\n public static getInstance(): HeadData { return HeadData._instance || (HeadData._instance = new HeadData()); }\r\n\r\n /**\r\n * Reset singleton class instance with passed in info and client settings. Used on server side to reset HeadData for each request.\r\n * @param {WebClientData} clientData Data object containing both client info and settings\r\n * @returns {HeadData}\r\n */\r\n public static resetInstance(clientData?: WebClientData): HeadData {\r\n HeadData._instance = new HeadData(clientData);\r\n headData = HeadData._instance;\r\n return HeadData._instance;\r\n }\r\n\r\n /**\r\n * Initializes head data. If WebClientData is provided use that, otherwise do client side initialization.\r\n * @param {WebClientData} clientData - Data object containing both client info and settings\r\n */\r\n public initializeHeadData(clientData?: WebClientData): void {\r\n\r\n if (clientData) {\r\n // Data is passed in only from Render Service under Node.JS environment since there is no DOM.\r\n this.initializeFromData(clientData);\r\n return;\r\n }\r\n\r\n this.locationSearch = getLocationSearch();\r\n this.htmlElement = canUseDOM() ? getDocumentElementsByTagName(htmlElementIds.html)[0] : null;\r\n this.headElement = canUseDOM() ? getDocumentElementsByTagName(htmlElementIds.head)[0] : null;\r\n\r\n if (!this.htmlElement || !this.headElement) {\r\n return;\r\n }\r\n\r\n // We always initialize from DOM first because\r\n // even if we are in an appcache/service worker case, we still need some data from the DOM\r\n // and we will fallback to DOM if there are no items found in storage\r\n this.initializeFromDom();\r\n\r\n // Attempt to override with local storage item when in appcache scenario\r\n // In service worker scenario, just update the storage activity id\r\n if (this.htmlElement.getAttribute(applicationCacheConstants.manifestAttributeName)) {\r\n this.isAppcache = true;\r\n this.initializeFromStorage();\r\n } else if (window && window.navigator && window.navigator.serviceWorker && window.navigator.serviceWorker.controller) {\r\n this.isServiceWorkerCache = true;\r\n this.updateStorageActivityId();\r\n }\r\n\r\n // Below items are common for both scenarios\r\n const language = this.htmlElement.getAttribute(lang);\r\n this.locale = language && language.toLowerCase() || \"\";\r\n\r\n const marketDir = this.htmlElement.getAttribute(dir);\r\n this.marketDir = marketDir && marketDir.toLocaleLowerCase() || \"\";\r\n\r\n this.setQueryItemProvidedValues();\r\n\r\n // Note: This isn't currently being stamped by PCS\r\n const headDataJs = this.headElement.getAttribute(js);\r\n if (headDataJs) {\r\n const headJs = <{ anonckname: string, signedin: number }>tryParseJson(headDataJs);\r\n this.anonCookieName = headJs.anonckname;\r\n this.userIsSignedIn = headJs.signedin === 1;\r\n }\r\n\r\n // Checks if current request is background preload or prerender request\r\n if (UrlUtility.getQueryParameterByName(\"backgroundpreload\", this.locationSearch) ||\r\n UrlUtility.getQueryParameterByName(\"prerender\", this.locationSearch)) {\r\n this.isPreload = true;\r\n }\r\n\r\n // Determine if we are in Enterprise version or not\r\n this.setIsEnterprise();\r\n\r\n // Determine if Office is the default pivot\r\n this.setIsOfficeDefaultPivot();\r\n }\r\n\r\n /**\r\n * Helper that gets the current's page stored last used activityID (if there is one)\r\n */\r\n public getCurrentPageTypeStoredActivityId(): StoredActivityId {\r\n const storedActivities = localStorage.getItem(applicationCacheConstants.storedLastUsedActivityIdKey) || \"\";\r\n const storedActivityIds = tryParseJson(storedActivities);\r\n\r\n return (storedActivityIds && storedActivityIds[headData.ClientSettings.pagetype]) || null;\r\n }\r\n\r\n /**\r\n * Initializes the client settings and info from client data passed in externally (render service query param)\r\n * @param {WebClientData} clientData Data object containing both client info and settings\r\n */\r\n private initializeFromData(clientData: WebClientData): void {\r\n this.clientSettings = tryParseJson(clientData.clientSettings);\r\n\r\n this.setFlights(clientData.clientInfo);\r\n\r\n this.setQueryItemProvidedValues();\r\n\r\n this.locale = clientData.language && clientData.language.toLowerCase() || \"\";\r\n this.marketDir = clientData.marketDir && clientData.marketDir.toLocaleLowerCase() || \"\";\r\n\r\n // Determine if we are in Enterprise version or not\r\n this.setIsEnterprise();\r\n\r\n // Determine if Office is the default pivot\r\n this.setIsOfficeDefaultPivot();\r\n }\r\n\r\n /**\r\n * Initializes the client settings and info from DOM element\r\n */\r\n private initializeFromDom(): void {\r\n\r\n this.setFlights(this.headElement.getAttribute(info));\r\n\r\n const dataClientSettings = this.headElement.getAttribute(clientSettings);\r\n if (!dataClientSettings) {\r\n return;\r\n }\r\n\r\n this.clientSettings = tryParseJson(dataClientSettings);\r\n if (!this.clientSettings) {\r\n return;\r\n }\r\n\r\n const { pagetype } = this.clientSettings;\r\n\r\n // If clientSettings.pagetype does not exist, try getting from data-pagetype.\r\n // For Peregrine full spa page: pagetype is part of data-client-settings. There is no data-pagetype.\r\n // For Prime/Hybrid, pagetype is outside of data-client-settings and it belongs to data-pagetype\r\n if (!pagetype) {\r\n const pageTypeFromSettings = this.headElement.getAttribute(pagetypeSettings);\r\n this.clientSettings.pagetype = pageTypeFromSettings == null ? undefined : pageTypeFromSettings;\r\n }\r\n\r\n // try to get the previously store page version from local storage for this page type,\r\n // and store back the current version\r\n if (pagetype) {\r\n const storedVersions = localStorage.getObject(CoreLocalStorageKeys.pageVersions) || {};\r\n this.lastKnownAppVersion = storedVersions[pagetype];\r\n\r\n // update the dictionary with the new value if different, and store it back to local storage\r\n const { v: currentDomVersion } = this.clientSettings;\r\n if (this.lastKnownAppVersion !== currentDomVersion) {\r\n storedVersions[pagetype] = currentDomVersion;\r\n localStorage.setObject(CoreLocalStorageKeys.pageVersions, storedVersions);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Initializes headData client settings and info from the value found in storage\r\n * and if none is found, fallbacks to using the DOM element\r\n */\r\n private initializeFromStorage(): void {\r\n const responseFromStorage = localStorage.getItem(applicationCacheConstants.storedHeadDataKey);\r\n const parsedResponseFromStorage = tryParseJson(responseFromStorage);\r\n\r\n // If there is nothing store, then fallback to the DOM\r\n if (!parsedResponseFromStorage) {\r\n return;\r\n }\r\n\r\n const currentPageStoredHeadData = parsedResponseFromStorage[this.clientSettings.pagetype];\r\n\r\n // We don't have an entry for the current page\r\n if (!currentPageStoredHeadData) {\r\n return;\r\n }\r\n\r\n const storedClientSettings = currentPageStoredHeadData[\"clientSettings\"];\r\n const storedFlights = currentPageStoredHeadData[\"info\"];\r\n\r\n // The stored head data is corrupt so we fallback to DOM\r\n if (!storedClientSettings || !storedFlights) {\r\n return;\r\n }\r\n\r\n // Hold on to the current DOM queryparams as we will need to override\r\n // what we get from what is in storage\r\n const domQueryParams = this.clientSettings.queryparams;\r\n\r\n // save the current version if available in a temp variable so we can\r\n // restore it back after updating the clientSettings object with the one from\r\n // storage (which came from head data API, which does not contain the version info\r\n // by design, because version is tied with the static bundles, which should represent the currently\r\n // loaded page.\r\n const currentPageVersion = this.clientSettings && this.clientSettings.v;\r\n this.clientSettings = storedClientSettings;\r\n\r\n // restore the version after the object update\r\n this.clientSettings.v = currentPageVersion;\r\n\r\n // restore the queryParams base on what is found in DOM\r\n // as we want the DOM value to be what is used\r\n // and not what is found in storage for this field\r\n // We want these to stay true to what PCS generated for the page\r\n // and avoid desync when reading what comes from future headData API calls.\r\n this.clientSettings.queryparams = domQueryParams;\r\n\r\n this.setFlights(storedFlights);\r\n this.updateStorageActivityId();\r\n }\r\n\r\n /**\r\n * Update the last used activity ID in storage\r\n */\r\n private updateStorageActivityId(): void {\r\n if (!this.clientSettings.aid) {\r\n return;\r\n }\r\n\r\n const existingLastUsedActivityIds = tryParseJson(localStorage.getItem(applicationCacheConstants.storedLastUsedActivityIdKey)) || {};\r\n const currentPageLastUsedActivityId: StoredActivityId = existingLastUsedActivityIds[this.clientSettings.pagetype];\r\n\r\n // If the current pages last used activity ID matches the one for the current page head data\r\n // then we have re-used this. Mark it as such but don't override the timestamp\r\n if (currentPageLastUsedActivityId && (currentPageLastUsedActivityId.id === this.clientSettings.aid)) {\r\n currentPageLastUsedActivityId.previouslyUsed = true;\r\n existingLastUsedActivityIds[this.clientSettings.pagetype] = currentPageLastUsedActivityId;\r\n } else {\r\n // If they don't match then that means we haven't used this so store the new value.\r\n const activityIdToStore: StoredActivityId = { id: this.clientSettings.aid, ts: (new Date()).getTime() };\r\n existingLastUsedActivityIds[this.clientSettings.pagetype] = activityIdToStore;\r\n }\r\n\r\n // Update the last used activity ID in storage\r\n localStorage.setItem(applicationCacheConstants.storedLastUsedActivityIdKey, JSON.stringify(existingLastUsedActivityIds));\r\n }\r\n\r\n /**\r\n * Parses flights from provided string (if in proper format of f:{flights})\r\n * and sets it to the headData object\r\n */\r\n private setFlights(flightString: string): void {\r\n // The comma separated list of flights enabled in current request\r\n this.currentFlights = ((/f:\\s*([^;]+)/i.exec(flightString) || {})[1] || \"\").toLowerCase();\r\n }\r\n\r\n /**\r\n * Determines if we are in Enterprise version based on clientSettings and currentFlights\r\n */\r\n private setIsEnterprise(): void {\r\n // We know we are in the Enterpise version of the page when both the audience mode is set to Enterprise\r\n // and the correct flight id is set.\r\n this.IsEnterprise = this.clientSettings &&\r\n this.currentFlights &&\r\n this.currentFlights.includes(EnterpiseFlightId) &&\r\n this.clientSettings.audienceMode === AudienceModeType.Enterprise;\r\n }\r\n\r\n /**\r\n * Read query items to determine the headdata variable values.\r\n */\r\n private setQueryItemProvidedValues(): void {\r\n // This only finds multiples of item=key:value qsp. If keys are the same, first given will be used (similar to UrlSearchParamsHelper).\r\n const queryItems = UrlUtility.getParamsWithItems(getLocationSearch());\r\n const cmsItem = queryItems.find(item => item.key === \"cms\");\r\n this.enableCMSPPEConfigs = (cmsItem && cmsItem.value === \"ppe\");\r\n\r\n // Test override to add flights for scope purposes\r\n this.setCurrentFlightsTestOverride(queryItems);\r\n }\r\n\r\n /**\r\n * Overrides currentFlights when hostname is localhost. Used for testing.\r\n */\r\n private setCurrentFlightsTestOverride(queryItems: KeyValueArray): void {\r\n if (getLocationHostname().toLowerCase().includes(\"localhost\") && queryItems) {\r\n const flights = queryItems.find(item => item.key === \"flights\");\r\n if (flights) {\r\n this.currentFlights = flights.value;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Determines if Office is the default pivot based on flight id.\r\n */\r\n private setIsOfficeDefaultPivot(): void {\r\n // There is work scheduled to have \"sticky\" pivots stored in some form of local storage which will\r\n // replace this check. Until then, the only way to know if Office is the default pivot is to check\r\n // for this flight id\r\n this.IsOfficeDefaultPivot = this.currentFlights && this.currentFlights.includes(OfficeDefaultPivotFlightId);\r\n }\r\n}\r\n\r\nexport const getHeadData = HeadData.getInstance;\r\n\r\n// headData can be reinitialized through resetHeadData.\r\nexport let headData = HeadData.getInstance();\r\n\r\n/**\r\n * Export function to reset headData based on WebClientData\r\n */\r\nexport const resetHeadData = HeadData.resetInstance;","// © Microsoft Corporation. All rights reserved.\r\n\r\n/// Adds functions events.bind and events.unbind that bind and unbind events\r\n\r\nexport default {\r\n bind: bindEvent,\r\n unbind: unbindEvent\r\n};\r\n\r\nfunction bindEvent(element, type, handler) {\r\n if (element.addEventListener) {\r\n element.addEventListener(type, handler, false);\r\n }\r\n}\r\n\r\nfunction unbindEvent(element, type, handler) {\r\n if (element.removeEventListener) {\r\n element.removeEventListener(type, handler, false);\r\n }\r\n}\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n// /**\r\n// * Provides common XSS escaping implementations.\r\n// * @returns {Escape}\r\n// */\r\n// regex that looks for all the various dangerous HTML characters that we want to escape.\r\n// every character in this match MUST have a corresponding map entry in sequenceValues,\r\n// or it will be removed from the string we are escaping.\r\nconst sequenceTokens = /[\"&'/<>]/g;\r\n\r\n// mapping object from the character we want to replace to the escape sequence for it.\r\n// make sure that every character in the above regex is represented with an escape\r\n// sequence in this object.\r\nconst sequenceValues = {\r\n \"\\\"\": \""\",\r\n \"&\": \"&\",\r\n \"'\": \"'\",\r\n \"/\": \"/\",\r\n \"<\": \"<\",\r\n \">\": \">\"\r\n};\r\n\r\nexport default {\r\n url: encodeURI,\r\n urlPart: encodeURIComponent,\r\n html: escapeHtml\r\n};\r\n\r\n/**\r\n * Encodes a text string as a valid Uniform Resource Identifier (URI)\r\n * @param {string} text - A value representing an encoded URI.\r\n * @return {string}\r\n */\r\nfunction encodeURI(text) {\r\n // be sure to use a NON-STRICT comparison here so we get both null AND undefined.\r\n // will ALWAYS return a string; empty string if passed null or undefined.\r\n return (text != null && encodeURI(text)) || \"\";\r\n}\r\n\r\n/**\r\n * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\r\n * @param {string} text - A value representing an encoded URI component.\r\n * @returns {string}\r\n */\r\nfunction encodeURIComponent(text) {\r\n // be sure to use a NON-STRICT comparison here so we get both null AND undefined.\r\n // will ALWAYS return a string; empty string if passed null or undefined.\r\n // @ts-ignore\r\n return (text != null && window.encodeURIComponent(text)) || \"\";\r\n}\r\n\r\n/**\r\n * Encodes a text string as a valid html, by mapping object from the character we want to replace to the escape sequence for it.\r\n * @param {string} text - The text\r\n * @returns {string}\r\n */\r\nfunction escapeHtml(text) {\r\n // make sure text is a string (string concate with an empty string forces the type),\r\n // and then run a regex that finds all the characters we want to escape, and passes\r\n // each character to a function expression that looks up the appropriate replacement\r\n // sequence from an object map (key = character to replace, value = escaped sequence).\r\n // be sure to use a NON-STRICT comparison here so we get both null AND undefined.\r\n // will ALWAYS return a string; empty string if passed null or undefined.\r\n return (text != null && (\"\" + text).replace(sequenceTokens, function (ch) {\r\n return sequenceValues[ch] || \"\";\r\n })) || \"\";\r\n}\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n// /**\r\n// * The navigatio module\r\n// * @param {Escape} escape - The escape.\r\n// * @param {Document} document - The document.\r\n// * @returns {Navigation}\r\n// */\r\nimport escape from \"./escape\";\r\n\r\n/** @type {Navigation} - The navigation object. */\r\nconst navigation = {\r\n getUrl: function(relativeUrl) {\r\n if (navigation.filter) {\r\n // @ts-ignore\r\n return navigation.filter(relativeUrl);\r\n }\r\n\r\n return relativeUrl;\r\n },\r\n navigate: function (url, replace) {\r\n if (navigation.filter) {\r\n // @ts-ignore\r\n url = navigation.filter(url);\r\n }\r\n if (replace) {\r\n location.replace(url);\r\n } else {\r\n location.href = url;\r\n }\r\n },\r\n getHostName: getHostName,\r\n parseUrl: parseUrl,\r\n isLocal: function (url) {\r\n const hostname = getHostName(url);\r\n return !hostname || (location.hostname == hostname);\r\n },\r\n getParams: getParams,\r\n getParamsFromUrl: function (url, supportMultiple?, decodeComponents?) {\r\n const queryString = url.split(\"?\")[1];\r\n return getParams(queryString, supportMultiple, decodeComponents);\r\n },\r\n // merge query string parameters with a set of new parameters. This does not support duplicate keys\r\n mergeQueryStringParams: function (url, newParams) {\r\n if (newParams) {\r\n const urlParts = url.split(\"?\");\r\n let params;\r\n if (urlParts[1]) {\r\n // get the existing parameters, then merge in the\r\n // new ones, overwriting any values that previously existed.\r\n params = getParams(urlParts[1], false, true);\r\n for (const param in newParams) {\r\n params[param] = newParams[param];\r\n }\r\n } else {\r\n // no existing parameters, so just use the new ones directly\r\n params = newParams;\r\n }\r\n\r\n // now rebuild the url from the parameters\r\n url = urlParts[0];\r\n let separator = \"?\";\r\n for (const param in params) {\r\n if (params[param]) {\r\n url += separator + escape.urlPart(param) + \"=\" + escape.urlPart(params[param]);\r\n } else {\r\n url += separator + escape.urlPart(param);\r\n }\r\n separator = \"&\";\r\n }\r\n }\r\n\r\n return url;\r\n },\r\n filter: null\r\n};\r\n\r\nexport default navigation;\r\n\r\nfunction getParams(queryString, supportMultiple?, decodeComponents?) {\r\n const decodeURIComponentAndPlusSign = function (val) {\r\n val = val.replace(/\\+/g, \" \");\r\n val = decodeURIComponent(val);\r\n return val;\r\n };\r\n\r\n const params = {};\r\n if (queryString) {\r\n // remove hash part.\r\n queryString = queryString.split(\"#\")[0];\r\n const queryArray = queryString.split(\"&\");\r\n for (let ndx = 0; ndx < queryArray.length; ndx++) {\r\n const parts = queryArray[ndx].split(\"=\");\r\n let key = parts[0];\r\n let value = parts[1];\r\n\r\n if (decodeComponents) {\r\n key = decodeURIComponentAndPlusSign(key);\r\n if (value) {\r\n value = decodeURIComponentAndPlusSign(value);\r\n }\r\n }\r\n\r\n if (supportMultiple) {\r\n if (!params[key]) {\r\n params[key] = [];\r\n }\r\n\r\n params[key].push(value);\r\n } else {\r\n params[key] = value;\r\n }\r\n }\r\n }\r\n\r\n return params;\r\n}\r\n\r\n/**\r\n * Parse the given URL.\r\n * For example, \"http://example.com:3000/pathname/?search=test#hash\" returns:\r\n * {\r\n * protocol: \"http:\",\r\n * host: \"example.com:3000\",\r\n * hostName: \"example.com\",\r\n * port: \"3000\",\r\n * path: \"/pathname/\",\r\n * hash: \"#hash\",\r\n * query: \"?search=test\",\r\n * origin: \"http://example.com:3000\"\r\n * }\r\n * @param {string} url\r\n * @returns {{ protocol: string, host: string, hostName: string, port: string, path: string, hash: string, query: string, origin: string }}\r\n */\r\nfunction parseUrl(url) {\r\n const anchor = document.createElement(\"a\");\r\n anchor.href = url;\r\n\r\n return {\r\n protocol: anchor.protocol,\r\n host: anchor.host,\r\n hostName: anchor.hostname,\r\n port: anchor.port,\r\n path: anchor.pathname,\r\n hash: anchor.hash,\r\n query: anchor.search,\r\n origin: anchor.origin\r\n };\r\n}\r\n\r\nfunction getHostName(url) {\r\n return parseUrl(url).hostName;\r\n}\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n// Provides Tracking helper methods unique to the NTP and DHP pages.\r\n//\r\n// Need to add OCID to all links that go to the MSN page.\r\n// Also need to add the OCID, CCID and TDUID values to all links that launch the store.\r\n//\r\n// Provide method to modify trackInfo data prior to TrackPage call usage.\r\n\r\nimport { getLocationHost } from \"@msnews/isomorphic-util\";\r\nimport pageInstance from \"./pageInstance\";\r\nimport { trackInfo } from \"./trackInfo\";\r\n\r\nconst displayOptionsHelper = {};\r\nconst browserAccess = {};\r\n\r\nconst locationHost = getLocationHost();\r\nconst domainParts = locationHost ? locationHost.split(\".\").reverse() : [];\r\nconst hostDomain = domainParts.length > 1 ? domainParts[1] + \".\" + domainParts[0] : locationHost; // handle an internal address\r\nconst windowsStoreHost = \"ms-windows-store\";\r\nconst domainMatchPattern = /[a-z][a-z0-9+\\-.]*:\\/\\/([a-z0-9\\-._~%!$&'()*+,;=]+@)?([a-z0-9\\-._~%]+|\\[[a-z0-9\\-._~%!$&'()*+,;=:]+\\])/i;\r\nconst ocidMatchPattern = /[&?]ocid=([^&]+)/i;\r\nconst ccidMatchPattern = /[&?]ccid=([^&]+)/i;\r\nconst classIdentifierForHlTrackingInApps = \".hltxt\";\r\n\r\n// The following values will not change during the life of the page.\r\n// @ts-ignore\r\nlet msnOcid = trackInfo.sitePage.msnocid || \"\";\r\n// @ts-ignore\r\nlet storeOcid = trackInfo.sitePage.storeocid || \"\";\r\n\r\nfunction addOcidToHref(tHref, target, event) {\r\n /// Adds OCID value to MSN URLs and to Store URLs\r\n /// The href found in track.js\r\n /// The DOM element being tracked.\r\n /// The event.\r\n\r\n // MSN OCID is only applied on NTP and DHP pages.\r\n if (!tHref || !target) {\r\n return;\r\n }\r\n\r\n // in case sitePage was not filled when this resolved, get and save the msnocid and storeocid values.\r\n if (!msnOcid) {\r\n // @ts-ignore\r\n msnOcid = trackInfo.sitePage.msnocid;\r\n }\r\n\r\n if (!storeOcid) {\r\n // @ts-ignore\r\n storeOcid = trackInfo.sitePage.storeocid;\r\n }\r\n\r\n // For the store (Prime and ServiceUI), we need to test the scheme - URL portion before \"://\".\r\n const endOfScheme = tHref.indexOf(\"://\");\r\n const locationOfStore = tHref.indexOf(windowsStoreHost);\r\n const isStoreUrl = endOfScheme > 0 && locationOfStore >= 0 && locationOfStore < endOfScheme;\r\n\r\n // Need to account for ocid and ccid being of mixed case. e.g. parameters.ocid returns null if the\r\n // param is \"Ocid\".\r\n const ocidMatch = tHref.match(ocidMatchPattern);\r\n const ccidMatch = tHref.match(ccidMatchPattern);\r\n\r\n // Fix 1764836. Ad links (e.g. EMS Ads) already contain their own ocid (not ours) on the URL. We need to make sure to keep their ocid value\r\n // and add the ccid value. Some Ads use uppercase OCID parameter.\r\n // NOTE: JS doesn't have negative lookback so selecting values directly doesn't work. Using [1]\r\n // to read the second match which will be the value.\r\n const ocidOnUrl = ocidMatch && ocidMatch[1];\r\n const ccidOnUrl = ccidMatch && ccidMatch[1];\r\n let emsOnUrl;\r\n\r\n if (ocidOnUrl && ccidOnUrl) {\r\n // If this is an EMS Ad it will already have the ocid and ccid values. We need to add our other values.\r\n let initStoreUrl = tHref;\r\n const emsMatch = tHref.match(/[&?]ocid=(ems\\.)/i);\r\n emsOnUrl = emsMatch && emsMatch[1];\r\n\r\n // See if we are an EMS link and do not have emsadid on the URL. If already have one do not add another.\r\n if (emsOnUrl && !initStoreUrl.match(/[=_]emsadid\\./i)) {\r\n initStoreUrl = addCcidToStoreUrl(initStoreUrl.replace(ccidMatchPattern, \"\"), ccidMatch[1]);\r\n }\r\n\r\n // This has already been modified.\r\n return;\r\n }\r\n\r\n const hashIndex = tHref.indexOf(\"#\");\r\n let hashValue = \"\";\r\n\r\n // Do not modify Prime page URLs - maintain this as only DHP/NTP code.\r\n // If we do not have an ocid on the url.\r\n if (!ocidOnUrl) {\r\n // TopSites uses an href of \"#\" to indicate it should not be a navigation, but it gets changed to the NTP Url with # at the end.\r\n // Some Prime websites also use the # character and we should not affect them, so make this check within the ServiceUI IFDEF.\r\n if (hashIndex === tHref.length - 1) {\r\n return;\r\n }\r\n\r\n // We need the msnocid value if this is the NTP/DHP page.\r\n if (msnOcid) {\r\n const domainMatch = domainMatchPattern.exec(tHref);\r\n const hrefHostName = domainMatch && domainMatch[2];\r\n let linkUrl = tHref;\r\n if (hrefHostName) {\r\n const isMsnDomain = hrefHostName.indexOf(hostDomain) >= 0;\r\n if (isMsnDomain) {\r\n if (hashIndex >= 0) {\r\n hashValue = tHref.substring(hashIndex, tHref.length);\r\n linkUrl = tHref.substring(0, hashIndex);\r\n }\r\n\r\n linkUrl += linkUrl.indexOf(\"?\") > 0 ? \"&\" : \"?\";\r\n linkUrl = linkUrl + \"ocid=\" + msnOcid;\r\n target.href = linkUrl + (hashValue || \"\");\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // If we don't have the store OCID value, just return. We can't add the ocid if we don't have the correct value.\r\n if (!ocidOnUrl && !storeOcid) {\r\n return;\r\n }\r\n\r\n if (isStoreUrl) {\r\n // Bug 1763626 - clicking Top Sites Open App link multiple times added OCID/CCID multiple times.\r\n // If there was a hash at the end of the URL, we used to add the parameters after the hash, and it was\r\n // not recognized as parameters by navigation.getParamsFromUrl(tHref).\r\n // If there is a hash value, save it, and re-add it at the end.\r\n if (hashIndex >= 0) {\r\n hashValue = tHref.substring(hashIndex, tHref.length);\r\n tHref = tHref.substring(0, hashIndex);\r\n }\r\n\r\n // We know that the store URL will have a query string parameter (the ID or PFN).\r\n // If the url already has an ocid on it, don't add another.\r\n let storeUrl = tHref;\r\n if (!ocidOnUrl) {\r\n storeUrl += \"&ocid=\" + storeOcid;\r\n }\r\n\r\n storeUrl = addCcidToStoreUrl(storeUrl, emsOnUrl);\r\n target.href = storeUrl + hashValue;\r\n }\r\n}\r\n\r\nfunction addCcidToStoreUrl(tHref, emsAdId) {\r\n /// Adds Ccid to the Store url.\r\n /// The href found in track.js\r\n /// The optional value for the emsid ccid value\r\n /// Returns Store Url with ccid.\r\n\r\n const ccidMatch = tHref.match(ccidMatchPattern);\r\n const ccidOnUrl = ccidMatch && ccidMatch[1];\r\n const hashIndex = tHref.indexOf(\"#\");\r\n let hashValue = \"\";\r\n\r\n // If the url already has an ccid on it, don't add another, but make sure it has MUID and RID. EMS Ads already have a ocid and ccid values.\r\n if (!ccidOnUrl) {\r\n // TODO: refactor this code , so we don't have to calculate index at different places\r\n if (hashIndex >= 0) {\r\n hashValue = tHref.substring(hashIndex, tHref.length);\r\n tHref = tHref.substring(0, hashIndex);\r\n }\r\n\r\n // We know that the store URL will have a query string parameter (the ID or PFN).\r\n // If the url already has an ocid on it, don't add another.\r\n let storeUrl = tHref;\r\n storeUrl += \"&ccid=\";\r\n\r\n const ccidData = [];\r\n\r\n // If sent an emsAdId value add it first.\r\n if (emsAdId) {\r\n ccidData.push(\"emsadid.\" + emsAdId);\r\n }\r\n\r\n // @ts-ignore\r\n const webig = pageInstance.getRequestId() || trackInfo.sitePage.requestId;\r\n if (webig) {\r\n ccidData.push(\"webig.\" + webig);\r\n }\r\n\r\n const muid = trackInfo.client.clientId();\r\n if (muid) {\r\n ccidData.push(\"muid.\" + muid);\r\n }\r\n\r\n return storeUrl + ccidData.join(\"_\") + hashValue;\r\n }\r\n\r\n return tHref;\r\n}\r\n\r\nfunction modifyValuesForTrackPage() {\r\n /// Modifies specific trackInfo values for TrackPage, to identify user settings.\r\n /// Returns whether we need to prevent the ComScore beacon from firing.\r\n const noContent = \"_NoContent\";\r\n const topSites = \"-topsites\";\r\n const oneBox = \"-onebox\";\r\n\r\n // If we need to prevent sending a beacon, return true.\r\n let preventComscore = false;\r\n\r\n if (trackInfo.sitePage) {\r\n const hasContent = true;\r\n // when there is rive content\r\n\r\n if (!hasContent) {\r\n // We cannot send a ComScore beacon if we have no content.\r\n preventComscore = true;\r\n }\r\n }\r\n\r\n // add personalization specific properties if they haven't been created before.\r\n if (trackInfo.client\r\n // @ts-ignore\r\n && !trackInfo.client.personalization) {\r\n // add any Spartan DHP/NTP specific personalization related properties to this object\r\n let props;\r\n\r\n // write out the value only if we have any properties set in the property bag\r\n if (props) {\r\n // @ts-ignore\r\n trackInfo.client.personalization = JSON.stringify(props);\r\n }\r\n }\r\n\r\n return { preventComscore: preventComscore };\r\n}\r\n\r\nfunction attachTaglineClickHandler(element) {\r\n /// Modify \"hl\" before the trackEvent.\r\n /// The element (or jquery collection) to process.\r\n /// We do not want to require jquery.\r\n\r\n // If this code becomes needed for Prime, change the IFDEF. Also using a switch if this is a perf issue.\r\n}\r\n\r\nfunction getActionResult(action, isSuccessful) {\r\n /// \r\n /// Gets the action result name based on the action and the fact whether it was successfully executed or not\r\n /// \r\n /// \r\n /// The name of the action (e.g. sethome, addfavorite,...)\r\n /// \r\n /// \r\n /// Flag to indicate whether the action was successfully executed or not\r\n /// \r\n return isSuccessful ? action + \"_succeeded\" : action + \"_failed\";\r\n}\r\n\r\nexport default {\r\n addOcidToHref: addOcidToHref,\r\n modifyValuesForTrackPage: modifyValuesForTrackPage,\r\n attachTaglineClickHandler: attachTaglineClickHandler,\r\n addCcidToStoreUrl: addCcidToStoreUrl,\r\n getActionResult: getActionResult\r\n};\r\n","// © Microsoft Corporation. All rights reserved.\r\n\r\n// Implements multiple parallel tracking engine which gets its tracking\r\n// url from the specific implementation using defined functions.\r\n//\r\n// if called multiple times during page interaction (representing significant content\r\n// update), the trackPage method will also publish a \"pageView\" mediator event that third-party\r\n// tracking code can hook to register their refresh page-view beacons.\r\n\r\n/// \r\n/// This function implements multiple parallel tracking engine which gets its tracking\r\n/// url from the specific implementation using defined functions.\r\n/// \r\n/// The tracking info JS library\r\n/// The JS library that provides functionality similar to jQuery's extend function\r\n/// The dom manipulation JS library\r\n/// The JS library for getting cookies\r\n/// The JS library for setting cookies\r\n/// The events object\r\n/// The window object\r\n/// The document object.\r\n/// The mediator JS library\r\n/// Provides access to current navigation URL and helpers\r\n/// Collection of data passed from the server\r\n/// The page instance object\r\n/// Cross browser support for json parse\r\n/// The tracking helper object\r\n/// The storage object\r\n/// The performance marker object\r\n/// The telemetry constant object\r\n/// The JS library that provides functionality for callback when page is revealed. Used for preload scenarios.\r\n/// The datatypes for telemetry library\r\n/// The webStorage object\r\n/// The track object\r\n\r\nimport { Severity, logger } from \"@msnews/diagnostics\";\r\nimport { canUseDOM, getLocationHost, getLocationHref, getLocationProtocol } from \"@msnews/isomorphic-util\";\r\n\r\nimport dom from \"./dom\";\r\nimport events from \"./events\";\r\nimport extend from \"./extend\";\r\nimport mediator from \"./mediator\";\r\nimport navigation from \"./navigation\";\r\nimport pageInstance from \"./pageInstance\";\r\nimport { sessionStorage } from \"@msnews/core\";\r\nimport telemetryConstants from \"./telemetryconstants\";\r\nimport { telemetryDataTypes } from \"./telemetryDataTypes\";\r\nimport { telemetryReadyCallback } from \"./telemetryReadyCallback\";\r\nimport { trackInfo } from \"./trackInfo\";\r\nimport trackingHelper from \"./trackingHelper\";\r\n\r\n// shortcuts to dom functions\r\nconst attr = dom.attr;\r\nconst domName = dom.name;\r\nconst getParent = dom.parent;\r\nconst getChildren = dom.children;\r\nconst recipients = [];\r\nlet refreshPageLoad;\r\nconst doc = canUseDOM() ? document : null;\r\nconst errorLogInterval = 5 * 60 * 1000;\r\n\r\nlet lastClickedTarget = null;\r\n\r\n// After 500 ms, lastClickedTarget will be set as null.\r\nconst clickTargetResetTimeoutInMs = 500;\r\n\r\n// Token to find the custom event token passed on the url. the format would be like this - http://www.msn.com/#tevt=click_nonnav;tobjid=....;...\r\nconst tEvtTag = \"tevt=\";\r\n\r\n// If there are more than one tags(name value pair), then the name value pair should be separated with ;\r\nconst regExpEventName = /#tevt=([A-Za-z0-9]+_[A-Za-z0-9]+)(;*)/g;\r\n\r\n// an array of ids that represent what we've already sent to the service as updates\r\n// TODO (rohjain): Remove this cache as we don't need two caches one in trackInfo and another here to maintain for impression updates cache.\r\nlet impressionCache = [];\r\n\r\n// error report interval in milliseconds (5 min = 5 * 60 * 1000)\r\nconst errorReportInterval = telemetryConstants.logSamplingRate || 5 * 60 * 1000;\r\n\r\nmediator.sub(\"logerror\", logErrorEvent);\r\n\r\nfunction trackAll(implementationMethod) {\r\n /// After createReport returns a report, this method fires tracking call for each registered tracking system\r\n\r\n let implementation;\r\n\r\n const parameters = canUseDOM() ? navigation.getParamsFromUrl(getLocationHref()) : {};\r\n\r\n // loop through each implementation\r\n for (let ndx = 0; ndx < recipients.length; ndx++) {\r\n implementation = recipients[ndx];\r\n const defOpts = implementation.defaultOpts;\r\n if (defOpts.disableOnAutoRefresh) {\r\n const names = defOpts.disableOnAutoRefresh.split(\";\");\r\n let isInList = false;\r\n for (let i = 0; i < names.length; i++) {\r\n if (names[i] == defOpts.id) {\r\n isInList = true;\r\n break;\r\n }\r\n }\r\n\r\n // @ts-ignore\r\n if (isInList && parameters.AR) {\r\n // In case this was generated early, reset to false so the next pageTrack() call will generate the beacon.\r\n defOpts.isGeneratedEarly = false;\r\n continue;\r\n }\r\n }\r\n\r\n if (defOpts.isGeneratedEarly) {\r\n // Don't generate this time, but reset to false so the next pageTrack() call will generate the beacon.\r\n defOpts.isGeneratedEarly = false;\r\n } else if (implementation) {\r\n // TODO: (nubenja) Remove samplingRate everywhere (implementation.samplingRate)\r\n const result = implementation[implementationMethod]();\r\n }\r\n }\r\n\r\n}\r\n\r\nfunction logErrorEvent(errorObject) {\r\n // /// Track error event\r\n // ///\r\n // /// errorObject- defined in errorCategory\r\n // ///\r\n // if (!errorObject)\r\n // {\r\n // return;\r\n // }\r\n // var cacheKey = errorObject.errId + errorObject.errSource;\r\n\r\n // var lastErrorTime = storage.getItem(cacheKey, true);\r\n // var currentTime = new Date().getTime();\r\n // if (lastErrorTime && (currentTime - lastErrorTime) <= errorLogInterval)\r\n // {\r\n // return;\r\n // }\r\n\r\n // trackInfo.event = {\r\n // type: \"app_error\"\r\n // };\r\n // trackInfo.report = errorObject;\r\n // logDiag(JSON.stringify(errorObject), true);\r\n\r\n // trackAll(\"getEventTrackingUrl\");\r\n // storage.setItem(cacheKey, currentTime, true);\r\n}\r\n\r\nfunction depthFirstChildAttribute(element, attributeName, skipElement?) {\r\n /// \r\n /// find the first attribute from the element in the depthFirst manner\r\n /// skips the element if it is specified in elementName\r\n /// \r\n const children = getChildren(element) || [];\r\n let ndx = 0;\r\n let altValue;\r\n\r\n attributeName = attributeName || \"alt\";\r\n\r\n for (; ndx < children.length; ndx++) {\r\n altValue = attr(children[ndx], attributeName)\r\n || depthFirstChildAttribute(children[ndx], attributeName, skipElement);\r\n\r\n if (altValue && !(skipElement == children[ndx].localName)) {\r\n return altValue;\r\n }\r\n }\r\n}\r\n\r\nfunction findCMValue(element) {\r\n /// \r\n /// create a list of id values separated with '>'\r\n /// walking from generic to specific\r\n /// ending at (not including) wrapper on the generic side\r\n /// \r\n if (element) {\r\n const parent = getParent(element);\r\n const curId = attr(parent, \"id\");\r\n if (trackInfo.wrapperId == curId) {\r\n return;\r\n }\r\n const previousCM = findCMValue(parent);\r\n if (previousCM && curId) {\r\n return [previousCM, curId].join(trackInfo.cmSeparator);\r\n }\r\n return curId || previousCM;\r\n }\r\n}\r\n\r\nfunction getContentElementIndex(element) {\r\n /// \r\n /// count number of trackable elements upto and including the\r\n /// element passed into the function\r\n /// stop at the first parent with an id\r\n /// do not use anything with a new id\r\n /// indexing all elements with the same CM value\r\n /// indexing starts at 1\r\n /// 0 means there is no parent with an id\r\n /// \r\n\r\n if (!element) {\r\n return;\r\n }\r\n\r\n const parent = getParent(element);\r\n let count = 0;\r\n let ndx = 0;\r\n\r\n // go up first, incase there is no parent id so we don't have to waste a lot of work\r\n if (!attr(parent, \"id\")) {\r\n count = getContentElementIndex(parent);\r\n if (count) {\r\n // by default getContentElementIndex will count the element passed in\r\n // subtract 1 to offset this\r\n count--;\r\n } else {\r\n // only stays 0 if there is no parent or no parent with an id\r\n // bubble up the expected 0 value\r\n return 0;\r\n }\r\n }\r\n\r\n const children = getChildren(parent) || [];\r\n for (; ndx < children.length; ndx++) {\r\n if (children[ndx] == element) {\r\n count++;\r\n break;\r\n }\r\n count += countAllTrackableLinks(children[ndx]);\r\n }\r\n\r\n return count;\r\n}\r\n\r\nfunction countAllTrackableLinks(element) {\r\n /// \r\n /// returns count of all trackable elements[contains href and notrack]\r\n /// \r\n let count = 0;\r\n let ndx = 0;\r\n let children;\r\n if (element && !attr(element, \"id\")) {\r\n children = getChildren(element) || [];\r\n if (attr(element, \"href\") && !attr(element, trackInfo.notrack)) {\r\n count++;\r\n }\r\n for (; ndx < children.length; ndx++) {\r\n count += countAllTrackableLinks(children[ndx]);\r\n }\r\n }\r\n return count;\r\n}\r\n\r\nfunction getChildByTargetElement(element, tagName, depth) {\r\n /// \r\n /// Finds the first child element within the provided element with the desired tagName.\r\n /// Goes through all the children/grandchildren to the provided depth (1 = children, 2 = first grandchildren)\r\n /// \r\n /// Element with tagName if found, null if not\r\n if (depth && element && tagName) {\r\n if (element.tagName == tagName) {\r\n // They passed in an element with the correct tagName value.\r\n return element;\r\n }\r\n\r\n const children = getChildren(element) || [];\r\n for (let ndx = 0, dataLength = children.length; ndx < dataLength; ndx++) {\r\n if (children[ndx].tagName == tagName) {\r\n return children[ndx];\r\n } else {\r\n const subChild = getChildByTargetElement(children[ndx], tagName, depth - 1);\r\n if (subChild) {\r\n return subChild;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nfunction sendSinglePageViewBeacon(beaconId) {\r\n /// \r\n /// This method generates a single beacon without firing any other beacons.\r\n /// Do NOT call track.trackPage() if this is used, or you will generate two of these beacons.\r\n /// \r\n /// \r\n /// The single beacon to generate.\r\n /// \r\n\r\n if (beaconId) {\r\n // loop through each implementation\r\n let implementation;\r\n const implementationMethod = \"getPageViewTrackingUrl\";\r\n let ndx = 0;\r\n\r\n for (; ndx < recipients.length; ndx++) {\r\n implementation = recipients[ndx];\r\n if (implementation.defaultOpts.id === beaconId) {\r\n const result = implementation[implementationMethod]();\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction sendPageViewCandidate() {\r\n /// \r\n /// This fires a request for a page view candidate file required by ComScore.\r\n /// Call this directly, if you are generating new page views which include ComScore and\r\n /// need to identify it as a page view candidate.\r\n /// \r\n\r\n const pvUrl = getLocationProtocol() + \"//\" + getLocationHost(); + \"/pv.xml\";\r\n if (!trackInfo.shouldFireTelemetry()) {\r\n return;\r\n }\r\n\r\n const beaconData = {\r\n url: pvUrl,\r\n requestType: telemetryConstants.GET,\r\n trackingType: telemetryConstants.Comscore\r\n };\r\n\r\n mediator.pub(telemetryConstants.FireTelemetry, beaconData);\r\n}\r\n\r\nfunction trackAdEvent(adParams) {\r\n /// \r\n /// This method tracks the adimpr_update event.\r\n /// Call getEventTrackingUrl to fire the tracking call.\r\n /// \r\n /// \r\n /// adParams- defined as follows\r\n /// adParams = {\r\n /// dst: dapStartTime,\r\n /// den: dapEndTime,\r\n /// id: placementId,\r\n /// pg: pageGroup\r\n /// w: width,\r\n /// h: height,\r\n /// status: status,\r\n /// anAd: appNexusId\r\n /// seqid: sequenceId\r\n /// sdk: sdk\r\n /// fen: finalEndTime\r\n /// };\r\n /// \r\n\r\n trackInfo.event = { type: \"adimpr_update\" };\r\n const adWidth = parseInt(adParams.w);\r\n const adHeight = parseInt(adParams.h);\r\n\r\n // @ts-ignore\r\n trackInfo.report =\r\n {\r\n /// \r\n /// This creates a tracking report.\r\n /// It does NOT send the report, nor does it perform any navigation.\r\n /// \r\n /// \r\n /// Report object that is structured as follows:\r\n /// report = {\r\n /// dst: dapStartTime,\r\n /// den: dapEndTime,\r\n /// id: placementId,\r\n /// pg: pageGroup\r\n /// w: width,\r\n /// h: height,\r\n /// status: status,\r\n /// anAd: appNexusId\r\n /// seqid: sequenceId\r\n /// sdk: sdk\r\n /// fen: finalEndTime\r\n /// };\r\n /// \r\n\r\n dst: adParams.dst,\r\n den: adParams.den,\r\n id: adParams.id,\r\n pg: adParams.pg,\r\n w: isNaN(adWidth) ? 0 : adWidth,\r\n h: isNaN(adHeight) ? 0 : adHeight,\r\n status: adParams.status,\r\n anAd: adParams.anAd,\r\n seqid: adParams.seqid,\r\n sdk: adParams.sdk,\r\n fen: adParams.fen\r\n };\r\n\r\n trackAll(\"getEventTrackingUrl\");\r\n}\r\n\r\nfunction trackAppErrorEventInternal(errorParams) {\r\n /// \r\n /// This method tracks the app_error event.\r\n /// Call getEventTrackingUrl to fire\r\n /// the tracking call.\r\n /// \r\n /// \r\n /// errorParams- defined in errorCategory\r\n /// \r\n\r\n if (!errorParams) {\r\n return;\r\n }\r\n\r\n // Check if it should fire app error.\r\n if (!trackInfo.shouldFireAppError()) {\r\n return;\r\n }\r\n\r\n if (!errorParams.severity) {\r\n errorParams.severity = Severity.Alert;\r\n }\r\n\r\n setAppErrorTrackInfo(errorParams);\r\n trackAll(\"getEventTrackingUrl\");\r\n}\r\n\r\nfunction setAppErrorTrackInfo(errorParams) {\r\n /// Sets the track information object\r\n\r\n const errEventObj = { type: \"app_error\" };\r\n trackInfo.event = errEventObj;\r\n\r\n // @ts-ignore\r\n const report = trackInfo.report =\r\n {\r\n /// \r\n /// This creates a tracking report.\r\n /// It does NOT send the report, nor does it perform any navigation.\r\n ///\r\n /// \r\n /// \r\n /// Error Id - defined in errorCategory\r\n /// \r\n /// \r\n /// Error Message - defined in errorCategory\r\n /// \r\n /// \r\n /// Error Source - defined in errorCategory\r\n /// \r\n // \r\n /// severity - defined in AppErrorTracker.ts\r\n /// \r\n /// \r\n /// Pb (property bag) - defined in AppErrorTracker.ts\r\n /// \r\n /// \r\n /// Report object that is structured as follows:\r\n /// report = {\r\n /// errId: ErrorId,\r\n /// errMsg: ErrorMsg,\r\n /// errMsg: ErrorSource,\r\n /// severity: severity,\r\n /// pb: pb\r\n /// };\r\n /// \r\n errId: errorParams.id,\r\n errMsg: errorParams.message,\r\n errSource: errorParams.source,\r\n severity: errorParams.severity,\r\n pb: errorParams.pb\r\n };\r\n\r\n logDiag(JSON.stringify(report), true);\r\n}\r\n\r\nfunction trackFormSubmitEvent(event, element, destination, headline, module, index, campaign) {\r\n /// \r\n /// This method tracks form events.\r\n /// This methods try to gets the search term.\r\n /// Call trackEvent\r\n /// \r\n /// \r\n /// Event object\r\n /// \r\n /// \r\n /// element that was clicked or target of the event. Passed to createReport.\r\n /// \r\n /// \r\n /// destination url to use instead of computing. Passed to createReport.\r\n /// \r\n /// \r\n /// headline to use instead of computing. Passed to createReport.\r\n ///\t\r\n ///\t\r\n /// content module string to be used instead of computing. Passed to createReport.\r\n /// \r\n /// \r\n /// content index string to be used instead of computing. Passed to createReport.\r\n /// \r\n /// \r\n /// campaign id to be used instead of computing. Passed to createReport.\r\n /// \r\n\r\n /// Helper functions.\r\n function isSearchForm() {\r\n const searchFormId = \"srchfrm\";\r\n if (!element && event) {\r\n element = event.target;\r\n }\r\n\r\n // if element not does not exist or is non trackable\r\n if (!element || attr(element, trackInfo.notrack)) {\r\n return false;\r\n }\r\n return element.id === searchFormId;\r\n }\r\n\r\n function getSearchTerm() {\r\n const searchBox = document.getElementById(\"q\");\r\n if (searchBox) {\r\n // @ts-ignore\r\n return searchBox.value;\r\n }\r\n }\r\n // End of helper functions\r\n\r\n if (isSearchForm()) {\r\n headline = getSearchTerm();\r\n }\r\n\r\n trackEvent(event, element, destination, headline, module, index, campaign);\r\n}\r\n\r\nfunction trackEvent(event, element?, destination?, headline?, module?, index?, campaign?, contentAction?) {\r\n /// \r\n /// This method tracks events.\r\n /// This methods loops through each implementation,\r\n /// Call getEventTrackingUrl and call that url to fire\r\n /// the tracking call.\r\n /// \r\n /// \r\n /// Event object\r\n /// \r\n /// \r\n /// element that was clicked or target of the event. Passed to createReport.\r\n /// \r\n /// \r\n /// destination url to use instead of computing. Passed to createReport.\r\n /// \r\n /// \r\n /// headline to use instead of computing. Passed to createReport.\r\n /// \r\n /// \r\n /// content module string to be used instead of computing. Passed to createReport.\r\n /// \r\n /// \r\n /// content index string to be used instead of computing. Passed to createReport.\r\n /// \r\n /// \r\n /// campaign id to be used instead of computing. Passed to createReport.\r\n /// \r\n /// contentAction enum of the event. Please see list of enum values under telemetryDatatypes.js\r\n /// \r\n\r\n // if element is not passed in, try to get it from event\r\n if (!element && event) {\r\n element = event.target;\r\n }\r\n\r\n // if element not does not exist or is non trackable\r\n if (!element || attr(element, trackInfo.notrack)) {\r\n return;\r\n }\r\n\r\n // for bug 1114449\r\n // element is a jQuery object, not an element\r\n // break out element from jQuery wrapper\r\n if (element.jquery) {\r\n element = element[0];\r\n }\r\n\r\n // Make sure that the trackInfo event does not have a jQuery object for target, or AOP will fail to find a parent.\r\n event = event || {};\r\n // Mark the event that it is already custom handled.\r\n event.customHandled = true;\r\n\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Read-only\r\n // event.target = element;\r\n trackInfo.event = event;\r\n let elemHref = element.href || attr(element, \"href\");\r\n\r\n // Temp. Fix: element.getAttribute(attr, 2) returns # only for non-navigational url. Need to get destination with full domain path.\r\n if (elemHref == \"#\") {\r\n elemHref = element[\"href\"];\r\n }\r\n\r\n // find destination value if needed\r\n destination = destination || attr(element, trackInfo.piiurl) ||\r\n elemHref || attr(element, \"action\") || \"\";\r\n\r\n // TODO: clean up how we find a headline. Depending on the markup of the page leads to bugs when we update it.\r\n // find headline value if needed, one may have been passed in through a data-hl attribute.\r\n const dataHlValue = attr(element, \"data-hl\") || \"\";\r\n if (!headline && !dataHlValue) {\r\n // See if there is an h4 or h3 element, no more than 2 deep.\r\n const headlineElement = getChildByTargetElement(element, \"H4\", 2) || getChildByTargetElement(element, \"H3\", 2);\r\n if (headlineElement) {\r\n headline = dom.text(headlineElement);\r\n }\r\n }\r\n\r\n if (typeof headline !== \"string\") {\r\n headline = dataHlValue || attr(element, trackInfo.piitxt) ||\r\n (\"FORM\" == domName(element)\r\n ? trackInfo.defaultFormHeadline\r\n : attr(element, \"title\") || depthFirstChildAttribute(element, \"title\", \"img\") || dom.text(element) || attr(element, \"alt\") || depthFirstChildAttribute(element, \"alt\") || \"\");\r\n }\r\n\r\n // Added condition to call trim function only if it is defined, it fails for browsers <=IE8\r\n if (headline.trim != undefined) {\r\n headline = headline.trim();\r\n }\r\n\r\n // find module value if needed\r\n module = module || findCMValue(element) || trackInfo.defaultModule;\r\n\r\n // find index value if needed\r\n index = index || (attr(element, \"id\") ? 1 : getContentElementIndex(element));\r\n\r\n // find campaign value if needed\r\n // Added backward compatibility for Old GT1 implementation. If \"GT1-xxxx\" not defined in class, look it into href attribute.\r\n // Example when GT1 defined in a class: class=\"GT1-12345\"\r\n // Example when GT1 is a part of href attribute: href=\"www.msn.com?GT1=12345\"\r\n const clsGT1 = element.className || attr(element, \"class\");\r\n campaign = campaign || (/GT1-(\\d+)\\b/i.exec(clsGT1) ? RegExp.$1 : \"\") ||\r\n (/[?&]GT1=(\\d+)\\b/i.exec(elemHref) ? RegExp.$1 : \"\");\r\n\r\n let moduleInfo = \"\";\r\n let nameLineage = \"\";\r\n let ordinalLineage = \"\";\r\n const lineageDelimiter = trackInfo.cmSeparator;\r\n let eventTime;\r\n let actionType;\r\n let behaviorType;\r\n let moduleInfoJson;\r\n\r\n if (event && (event.type == trackInfo.eventTypes.click || event.type == trackInfo.eventTypes.nonNavClckEvt || event.type == trackInfo.eventTypes.submit || event.type == trackInfo.eventTypes.contextmenu || event.type == trackInfo.eventTypes.mouseenter)) {\r\n const moduleInfoHeader = \"data-m\";\r\n moduleInfo = attr(element, moduleInfoHeader);\r\n if (!moduleInfo) {\r\n const parent = getParent(element);\r\n moduleInfo = parent ? attr(parent, moduleInfoHeader) : \"\";\r\n }\r\n\r\n try {\r\n // TODO: (nubenja) Remove this once data-m.y is deprecated\r\n // Convertion from telemetryType (e1.y) to telemetryContentType (e1.ct) and telemetryContentAction (ca)\r\n moduleInfoJson = JSON.parse(moduleInfo);\r\n if (moduleInfoJson && moduleInfoJson.y && !moduleInfoJson.ct) {\r\n const ct = telemetryDataTypes.getTelemetryContentType(moduleInfoJson.y);\r\n\r\n if (ct) {\r\n moduleInfoJson.ct = ct;\r\n }\r\n }\r\n\r\n // Map behavior\r\n if (moduleInfoJson && moduleInfoJson.y) {\r\n behaviorType = telemetryDataTypes.getTelemetryBehavior(moduleInfoJson.y);\r\n }\r\n\r\n // Map action type\r\n if (event.originalEvent === trackInfo.eventTypes.contextmenu) {\r\n actionType = telemetryDataTypes.TelemetryActionType.RightClick;\r\n behaviorType = telemetryDataTypes.TelemetryBehaviorType.ContextMenu;\r\n } else if (event.type === trackInfo.eventTypes.click) {\r\n actionType = telemetryDataTypes.TelemetryActionType.Click;\r\n behaviorType = telemetryDataTypes.TelemetryBehaviorType.Navigate;\r\n } else if (event.type === trackInfo.eventTypes.nonNavClckEvt) {\r\n actionType = telemetryDataTypes.TelemetryActionType.Click;\r\n } else if (event.type === trackInfo.eventTypes.submit) {\r\n actionType = telemetryDataTypes.TelemetryActionType.Submit;\r\n }\r\n } catch (e) {\r\n moduleInfoJson = {};\r\n }\r\n\r\n const elementTelemetryLineage = getLineage(element);\r\n if (elementTelemetryLineage) {\r\n nameLineage = elementTelemetryLineage.nameLineage.reverse().join(lineageDelimiter);\r\n ordinalLineage = elementTelemetryLineage.ordinalLineage.reverse().join(lineageDelimiter);\r\n }\r\n\r\n // assign the time if event already has time field. (added from trackClickEvents)\r\n eventTime = event.time;\r\n }\r\n\r\n // check if destination url is bing or not. if it is, remove all telemetry sensitive data\r\n const duHostname = navigation.getHostName(destination);\r\n if (duHostname && duHostname.toLowerCase().indexOf(\"bing.com\") > -1) {\r\n // filter out privacy sensitive params\r\n destination = track.filterUrlParams(destination, [\"q\", \"pq\"]);\r\n\r\n // remove headline\r\n headline = \"\";\r\n }\r\n\r\n // @ts-ignore\r\n trackInfo.report =\r\n {\r\n /// \r\n /// This method creates a tracking report.\r\n /// It does NOT send the report, nor does it perform any navigation.\r\n ///\r\n /// \r\n /// \r\n /// element that was clicked or target of the event.\r\n /// \r\n /// \r\n /// destination url to use instead of computing.\r\n /// \r\n /// \r\n /// headline to use instead of computing.\r\n /// \r\n /// \r\n /// content module string to be used instead of computing.\r\n /// \r\n /// \r\n /// content index string to be used instead of computing.\r\n /// \r\n /// \r\n /// campaign id to be used instead of computing.\r\n /// \r\n /// \r\n /// data-m section to be used instead of computing.\r\n /// \r\n /// \r\n /// Report object that is structured as follows:\r\n /// report = {\r\n /// destinationUrl: destination,\r\n /// campaignId: '',\r\n /// contentElement: index,\r\n /// contentModule: module,\r\n /// headline: headline,\r\n /// sourceIndex,\r\n /// nodeName,\r\n /// module: moduleInfo,\r\n /// nLineage: nameLineage,\r\n /// oLineage: ordinalLineage,\r\n /// timeToInteract: trackInfo.timeToInteract()\r\n /// };\r\n /// \r\n destinationUrl: destination,\r\n headline: headline,\r\n contentModule: module,\r\n contentElement: index,\r\n campaignId: campaign,\r\n module: moduleInfoJson,\r\n sourceIndex: element.sourceIndex || \"\",\r\n nodeName: element.nodeName || \"\",\r\n nLineage: nameLineage,\r\n oLineage: ordinalLineage,\r\n timeToInteract: trackInfo.timeToInteract(eventTime),\r\n actionType: actionType,\r\n behaviorType: behaviorType\r\n };\r\n\r\n trackAll(\"getEventTrackingUrl\");\r\n}\r\n\r\nfunction trackPageInternal(overrideParams, persistOverriddenParams) {\r\n /// \r\n /// Fires page view call for each registered tracking system at the top of tag\r\n /// \r\n /// override client side params\r\n /// if true overridden params are persisted for other events otherwise false. Default is false\r\n\r\n const perfMarkerTrackingPageViewStart = \"TimeToTrackingPageViewStart\";\r\n const perfMarkerTrackingPageViewEnd = \"TimeToTrackingPageViewEnd\";\r\n\r\n // initialize params and assign default as false.\r\n persistOverriddenParams = !!persistOverriddenParams;\r\n\r\n // clear event in case trackPage is called more than once on a page\r\n delete trackInfo.event;\r\n\r\n // Clear the request id to generate the new request id\r\n // @ts-ignore\r\n delete trackInfo.userStatic.requestId;\r\n\r\n // Clear the override Client Params for every track page request and reassign the parameter.\r\n delete trackInfo.overrideClientParams;\r\n\r\n const paramPageName = \"pg.n\";\r\n const pageName = overrideParams && overrideParams[paramPageName];\r\n if (pageName) {\r\n const paramPageType = \"pg.t\";\r\n const telemetryPageName = telemetryDataTypes.getTelemetryPageInfo(pageName);\r\n if (telemetryPageName) {\r\n overrideParams[paramPageName] = telemetryPageName.PageName;\r\n\r\n const pageType = overrideParams[paramPageType];\r\n const telemetryPageType = telemetryDataTypes.validateTelemetryDataType(telemetryDataTypes.TelemetryPageType, pageType);\r\n if (telemetryPageType) {\r\n overrideParams[paramPageType] = telemetryPageType;\r\n } else if (telemetryPageName.PageType === telemetryDataTypes.TelemetryPageType.Unspecified) {\r\n // @ts-ignore\r\n overrideParams[paramPageType] = trackInfo.sitePage.page_type;\r\n } else {\r\n overrideParams[paramPageType] = telemetryPageName.PageType;\r\n }\r\n }\r\n }\r\n\r\n // This is needed since in prime we include this so that\r\n // telemetry team knows that the page should be ignored due to\r\n // automatic refresh\r\n const signInRefreshedPageKey = \"sign-in-refreshed-page\";\r\n if (sessionStorage.getItem(signInRefreshedPageKey)) {\r\n sessionStorage.removeItem(signInRefreshedPageKey);\r\n (overrideParams = overrideParams || {}).ar = 1;\r\n }\r\n\r\n trackInfo.overrideClientParams = overrideParams;\r\n trackInfo.persistOverriddenParams = persistOverriddenParams;\r\n\r\n const result = trackingHelper.modifyValuesForTrackPage();\r\n if (result && result.preventComscore) {\r\n track.preventBeacon(telemetryConstants.Comscore);\r\n }\r\n\r\n trackAll(\"getPageViewTrackingUrl\");\r\n\r\n // the refreshPageLoad value is undefined (false) at first page load request, and\r\n // we then set it to one (true).\r\n // subsequent calls to trackPage will then publish the mediator pageView event\r\n // that code can listen for to know when the page is generating a \"page view\"\r\n // due to significant content change.\r\n if (refreshPageLoad) {\r\n mediator.pub(\"pageView\");\r\n } else {\r\n refreshPageLoad = 1;\r\n mediator.pub(\"pageViewOnLoad\");\r\n }\r\n\r\n // Clear the override Client Params once the trackPage is fired so that other events don't use the overridden params from memory.\r\n delete trackInfo.overrideClientParams;\r\n}\r\n\r\nexport const track =\r\n{\r\n onContextMenu: onContextMenu,\r\n onClick: onClick,\r\n\r\n trackEvent: trackEvent,\r\n trackFormSubmitEvent: trackFormSubmitEvent,\r\n trackAdEvent: trackAdEvent,\r\n trackVideoEvent: trackVideoEvent,\r\n trackFeedbackEvent: trackFeedbackEvent,\r\n\r\n createEvent: createEvt,\r\n sendPageViewCandidate: sendPageViewCandidate,\r\n sendSinglePageViewBeacon: sendSinglePageViewBeacon,\r\n\r\n clearImpressionCache: clearImpressionCache,\r\n\r\n getFeedbackTrackingParams: getFeedbackTrackingParams,\r\n filterUrlParams: filterUrlParams,\r\n\r\n trackAppErrorEvent: function (errorParams) {\r\n /// \r\n /// This method tracks the app_error event.\r\n /// Call getEventTrackingUrl to fire the tracking call\r\n /// \r\n /// \r\n /// errorParams- defined in errorCategory\r\n /// \r\n\r\n telemetryReadyCallback((): void => {\r\n trackAppErrorEventInternal(errorParams);\r\n });\r\n },\r\n\r\n trackPartialImpression: function (elem, visibilityCheck, mechanism, topLevelContainerType) {\r\n /// The track partial impression will fire an impression update for the element graph.\r\n /// The element graph that contains the data-m attributes\r\n /// Conduct the visibility checking. By default is false\r\n /// Mechanism to capture for impression update. By Default is load. Mechanism load is used whenever the module is loaded and rendered to the user.\r\n /// TopLevelContainer type for impression update\r\n\r\n telemetryReadyCallback((): void => {\r\n trackPartialImpressionInternal(elem, visibilityCheck, mechanism, topLevelContainerType);\r\n });\r\n },\r\n\r\n trackPage: function (overrideParams?, persistOverriddenParams?) {\r\n /// \r\n /// Fires page view call for each registered tracking system at the top of tag\r\n /// \r\n /// override client side params\r\n /// if true overridden params are persisted for other events otherwise false. Default is false\r\n\r\n telemetryReadyCallback((): void => {\r\n trackPageInternal(overrideParams, persistOverriddenParams);\r\n });\r\n },\r\n\r\n trackThirdPartyUpdate: function () {\r\n /// \r\n /// Fires the third party tracking call for Ajax page refresh scenarios like slide refresh.\r\n /// \r\n\r\n mediator.pub(\"thirdPartyTrackingUpdate\");\r\n },\r\n\r\n register: function (...args: any[]) {\r\n /// \r\n /// Registers an implementation with the main Tracking function\r\n /// \r\n /// \r\n /// Implementation of tracking,\r\n /// must implement the following functions\r\n /// GetEventTrackingUrl(trackInfo) - generates url for tracking\r\n /// \r\n /// \r\n /// Implementation of tracking\r\n /// \r\n /// \r\n /// Returns the current object to enable cascading calls\r\n /// \r\n let ndx = 0;\r\n let trackingImplementation;\r\n\r\n // use double-parens to tell the validator that yes, we INTEND this to be an assignment (=)\r\n // and not a mistyped equals (==) conditional test.\r\n while ((trackingImplementation = arguments[ndx++])) {\r\n if (isNaN(trackingImplementation.samplingRate)) {\r\n trackingImplementation.samplingRate = 99;\r\n }\r\n recipients.push(trackingImplementation);\r\n }\r\n },\r\n\r\n getCurrentPageRequestId: function () {\r\n /// \r\n /// Utility function to return the current page request Id. Empty value will be returned if this method is called before\r\n /// telemetry initialization.\r\n /// \r\n /// the current page request Id\r\n /// \r\n\r\n // @ts-ignore\r\n return pageInstance.getRequestId() || trackInfo.sitePage.requestId || \"\";\r\n },\r\n\r\n mapTelemetryParams: function (common, commonMap, params, paramsMap) {\r\n /// \r\n /// Utility function to gather all the telemetry Params.\r\n /// \r\n /// \r\n /// Object contains common parameters.\r\n /// \r\n /// \r\n /// Object contains common param to property mapping\r\n /// E.g. map.sitePage:{ a1: \"page_name\"}\r\n /// this will create a querystring a1=\"value of trackInfo.sitePage.page_name\"\r\n /// \r\n /// \r\n /// Object contains custom parameters.\r\n /// \r\n /// \r\n /// Object contains param to property mapping\r\n /// E.g. map.sitePage:{ a1: \"page_name\"}\r\n /// this will create a querystring a1=\"value of trackInfo.sitePage.page_name\"\r\n /// \r\n /// \r\n /// url that will be called to do the tracking\r\n /// \r\n\r\n params = extend({}, common, params);\r\n // Get params from commonMap\r\n paramsMap = extend(true, {}, commonMap, paramsMap);\r\n for (const groupKey in paramsMap) {\r\n const trackInfoGroupKey = trackInfo[groupKey];\r\n if (trackInfoGroupKey) {\r\n const groupValue = paramsMap[groupKey];\r\n for (const key in groupValue) {\r\n // check the override client params first\r\n const clientParams = trackInfo.overrideClientParams;\r\n let value;\r\n if (key && clientParams && clientParams[key] !== undefined) {\r\n value = clientParams[key];\r\n // if persisting overridden params then override trackInfo group key with value from overridden client params.\r\n if (trackInfo.persistOverriddenParams) {\r\n trackInfoGroupKey[groupValue[key]] = value;\r\n }\r\n } else {\r\n value = trackInfoGroupKey[groupValue[key]];\r\n\r\n if (typeof value == \"function\") {\r\n value = value();\r\n }\r\n }\r\n\r\n // allow for empty strings but use null or undefined to ignore the parameter entirely\r\n if (value != null) {\r\n params[key] = value;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return params;\r\n },\r\n\r\n extend: function (obj) {\r\n extend(true, trackInfo, obj);\r\n },\r\n\r\n form: function (elem) {\r\n /// \r\n /// Helper function to bind Form elements that are part of element for tracking\r\n /// \r\n\r\n if (!elem || !elem.length) {\r\n elem = [elem];\r\n }\r\n let formElem;\r\n let ndx = 0;\r\n\r\n // use double-parens to tell the validator that yes, we INTEND this to be an assignment (=)\r\n // and not a mistyped equals (==) conditional test.\r\n while ((formElem = elem[ndx++])) {\r\n // if element is a form element and has not attr \"data-customformtrack\", bind the submit to it.\r\n // if the attr \"data-customformtrack\" is included, it is entirely reponsible for firing its own\r\n // tracking beacons\r\n if (\"FORM\" == domName(formElem) && !attr(formElem, \"data-customformtrack\")) {\r\n events.bind(formElem, \"submit\", trackFormSubmitEvent);\r\n }\r\n }\r\n },\r\n\r\n preventBeacon: function (beaconId) {\r\n /// Set the value isGeneratedEarly to prevent the sending of a beacon.\r\n /// The name of the beacon as listed in the markets.config file.\r\n if (beaconId) {\r\n beaconId = beaconId.toLowerCase();\r\n\r\n // loop through each implementation\r\n for (let ndx = 0; ndx < recipients.length; ndx++) {\r\n const defOpts = recipients[ndx].defaultOpts;\r\n if (beaconId === defOpts.id.toLowerCase()) {\r\n defOpts.isGeneratedEarly = true;\r\n break;\r\n }\r\n }\r\n }\r\n },\r\n\r\n trackPageRefresh: function (overrideParams?, persistOverriddenParams?) {\r\n /// \r\n /// Fires page view call for each registered tracking system at the top of tag and resets activity Id.\r\n /// \r\n /// override client side params\r\n /// if true overridden params are persisted for other events otherwise false. Default is false\r\n\r\n // calling pageInstance.updatePageInstance() instead of using mediator\r\n // to eliminate delay rid update when executed via mediator.pub\r\n pageInstance.updatePageInstance();\r\n clearImpressionCache();\r\n trackPageInternal(overrideParams, persistOverriddenParams);\r\n\r\n setTimeout(\r\n () => {\r\n trackPartialImpressionInternal(document.getElementById(\"root\"), true, \"load\", null);\r\n },\r\n 1000);\r\n }\r\n};\r\n\r\n// find's all the children dom elements that have the 'data-m' attribute defined.\r\n// also returns the current element if it meets the criteria.\r\nfunction findTelemetryElements(domElement) {\r\n const elements = [];\r\n\r\n // for modern browsers I can use querySelectorAll to find the child elements.\r\n if (domElement && domElement.querySelectorAll) {\r\n const telemetryChildren = domElement.querySelectorAll(\"[data-m]\");\r\n\r\n // include the root if applicable\r\n if (attr(domElement, \"data-m\")) {\r\n elements.push(domElement);\r\n }\r\n\r\n // do the children\r\n for (let index = 0; index < telemetryChildren.length; index++) {\r\n elements.push(telemetryChildren[index]);\r\n }\r\n }\r\n\r\n // return the elements\r\n return elements;\r\n}\r\n\r\n// a helper function that will parse json contained within attributes\r\nfunction parseDomAttributeJson(element, attributeName) {\r\n const dataAttr = attr(element, attributeName);\r\n if (dataAttr) {\r\n try {\r\n return JSON.parse(dataAttr);\r\n } catch (e) {\r\n return null;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\n// a helper function to check if an array contains an element.\r\nfunction contains(item, array) {\r\n if (array.indexOf) {\r\n return array.indexOf(item) !== -1;\r\n } else {\r\n // for IE8\r\n for (let i = 0; i < array.length; i++) {\r\n if (array[i] === item) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction trackPartialImpressionInternal(elem, visibilityCheck, mechanism, topLevelContainerType) {\r\n /// The track partial impression will fire an OTF impression update for the element graph.\r\n /// The element graph that contains the data-m attributes\r\n /// Conduct the visibility checking. By default is false\r\n /// Mechanism to capture for impression update. By Default is load\r\n /// TopLevelContainer type for impression update. By Default is load\r\n\r\n const perfMarkerTrackingPartialImprUpdateStart = \"TimeToTrackingPartialImprUpdateStart\";\r\n const perfMarkerTrackingPartialImprUpdateEnd = \"TimeToTrackingPartialImprUpdateEnd\";\r\n\r\n if (elem) {\r\n if (elem.jquery) {\r\n elem = elem[0];\r\n }\r\n\r\n // retrieve the telemetry elements.\r\n const elements = findTelemetryElements(elem);\r\n const formattedModules = [];\r\n\r\n for (let index = 0; index < elements.length; index++) {\r\n const element = elements[index];\r\n if (visibilityCheck && !trackInfo.telemetryTracking.isVisible(element)) {\r\n continue;\r\n }\r\n\r\n const impressionContent = parseDomAttributeJson(element, \"data-m\");\r\n const id = impressionContent ? impressionContent.i : undefined;\r\n\r\n // ensure we haven't already sent the payload\r\n if (id !== undefined && !contains(id, impressionCache)) {\r\n // add it to our cache\r\n impressionCache.push(id);\r\n formattedModules.push(impressionContent);\r\n\r\n // TODO: (nubenja) Remove this once data-m.y is deprecated\r\n // Convertion from telemetryType (data-m.y) to telemetryContentType and telemetryContentAction (data-m.ct/ca)\r\n if (impressionContent.y && !impressionContent.ct) {\r\n const ct = telemetryDataTypes.getTelemetryContentType(impressionContent.y);\r\n\r\n if (ct) {\r\n impressionContent.ct = ct;\r\n }\r\n }\r\n }\r\n }\r\n\r\n const context = {};\r\n if (formattedModules && formattedModules.length > 0) {\r\n // @ts-ignore\r\n context.e = formattedModules;\r\n }\r\n\r\n // fire the telemetry event if we were able to get any impression data.\r\n // @ts-ignore\r\n if (context && context.e && context.e.length > 0) {\r\n const mech = (mechanism) ? mechanism : trackInfo.imprUpdateMechanisms.partial;\r\n trackInfo.telemetryTracking.sendImprUpdateEvent(mech, context, topLevelContainerType);\r\n }\r\n }\r\n}\r\n\r\nfunction clearImpressionCache() {\r\n impressionCache = [];\r\n}\r\n\r\nfunction getEventFromUrl(targetUrl) {\r\n /// \r\n /// Check the Current Url and get the event name from the targetUrl.\r\n /// The URL format for the specifying the event name is - url#tevt=EVENTNAME;OTHER_NAME_VALUE_PAIRS\r\n /// \r\n /// \r\n /// The target Url for the event.\r\n /// \r\n /// event name, if it is specified, else null. \r\n\r\n /*\r\n For input value : \"http://www.bing.com/videos/search?q=&mkt=en-GB#tevt=click_nonnav;\"\r\n The result will be like this-\r\n [#tevt=click_nonnav;,click_nonnav,;]\r\n [0] : \"#tevt=click_nonnav;\",\r\n [1] : \"click_nonnav\",\r\n [2] : \";\",\r\n\r\n The 1st element contains the event name.\r\n */\r\n\r\n // If event name is not found, return null, the original event name will be kept.\r\n const result = new RegExp(regExpEventName).exec(targetUrl);\r\n return (result && result.length && result[1]) || null;\r\n}\r\n\r\nfunction getClickEventFromUrl(targetUrl) {\r\n /// \r\n /// Check the Current Url -\r\n /// Case 1- if the Url format is - baseurl/#, then treat it as nonNav event.\r\n /// Match Domain name.\r\n /// If the Url of current page and target page is same and only # is at the end, then it is not navigating away from the page.\r\n ///\r\n /// Case 2 - the Url format is url#tevt=EVENTNAME;OTHER_NAME_VALUE_PAIRS,\r\n /// extract the event name from the Url. the event name is terminated with ;\r\n /// \r\n /// \r\n /// The target Url for the event.\r\n /// \r\n /// \r\n /// event name; if it is a non nav url and no event name is specified then return the default non nav click event name,\r\n /// otherwise, return the event name specified in the url.\r\n /// \r\n\r\n let evtName = null;\r\n if (targetUrl) {\r\n // if the target url contains tevt=, then this url contains the event name. We will extract the event name from url.\r\n if (targetUrl.indexOf(tEvtTag) == -1) {\r\n // If the Url format is - http://www.msn.com/#, then categorize it as nonnav click.\r\n // Convert the baseurl and currentUrl in lowercase for comparison.\r\n const baseUrl = targetUrl.substring(0, targetUrl.indexOf(\"#\")).toLowerCase();\r\n const curUrl = getLocationHref().toLowerCase();\r\n if (curUrl == baseUrl || curUrl.substring(0, curUrl.indexOf(\"#\")) == baseUrl) {\r\n evtName = trackInfo.eventTypes.nonNavClckEvt;\r\n }\r\n } else {\r\n // extract the event name from url.\r\n evtName = getEventFromUrl(targetUrl);\r\n }\r\n }\r\n // Return null, so that the original event is kept.\r\n return evtName;\r\n}\r\n\r\nfunction createEvt(event, eventName, targetElem) {\r\n /// \r\n /// Creates an event based upon the properties of the base event.\r\n /// \r\n /// \r\n /// This is a an input event parameter. Some basic properties are copied from this param to the the event created.\r\n /// \r\n /// \r\n /// Name of the event to be created.\r\n /// \r\n /// \r\n /// Target element that need to be attached to the event being created in this method.\r\n /// \r\n /// An object is created with base properties from the event passed as param. This object is then returned. \r\n\r\n let evt = null;\r\n\r\n if (doc && doc.createEvent) { // Supported by non-IE based browsers.\r\n evt = doc.createEvent(\"Events\");\r\n evt.initEvent(eventName, false, true, targetElem || window,\r\n 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n // @ts-ignore\r\n } else if (doc && doc.createEventObject) { // Supported by IE based browsers.\r\n // @ts-ignore\r\n evt = doc.createEventObject(event);\r\n evt.type = eventName;\r\n }\r\n\r\n if (evt) {\r\n evt.customTarget = targetElem;\r\n\r\n // Store the original event type in a field\r\n evt.originalEvent = event && event.type;\r\n }\r\n\r\n return evt;\r\n}\r\n\r\nfunction preventEventDefault(event) {\r\n /// \r\n /// Cancels the event and prevents from being passed further.\r\n /// \r\n /// \r\n /// Input event parameter that need to be canceled.\r\n /// \r\n if (event.preventDefault) { // For Non IE\r\n event.preventDefault();\r\n } else { // For IE\r\n event.returnValue = false;\r\n }\r\n}\r\n\r\nfunction onContextMenu(event) {\r\n /// \r\n /// onContextMenu Handler\r\n /// we'll only track context menu events if the target is a link (A or AREA)\r\n /// This event is used to keep track of when the context menu opens....\r\n /// Right click does not generate onClick events, so we are tracking context menu on all the form factors.\r\n /// \r\n trackClickEvents(event);\r\n}\r\n\r\nfunction onClick(event) {\r\n /// \r\n /// OnClick Handler\r\n /// we'll only track clicks if the target is a link (A or AREA)\r\n /// AND the mouse button isn't the RIGHT button.\r\n /// MOST browsers think the mouse button value is 2. For those that don't, this\r\n /// might have to be revisited.\r\n /// \r\n if (2 == event.button) {\r\n return;\r\n }\r\n\r\n trackClickEvents(event);\r\n}\r\n\r\n/// \r\n/// Computes the lineage of a particular element, passing back the object containing array of 'n's and array of 'o's on the dom tree.\r\n/// \r\n/// An object containing the array of 'n's and array of 'o's on the dom tree starting with the current element, or an empty array if none are found.\r\nfunction getLineage(element) {\r\n const result: any = {};\r\n const nameLineageArray = [];\r\n const ordinalLineageArray = [];\r\n\r\n while (element) {\r\n const telemetryObject = parseDomAttributeJson(element, \"data-m\");\r\n if (telemetryObject) {\r\n if (telemetryObject.n) {\r\n nameLineageArray.push(telemetryObject.n);\r\n }\r\n\r\n if (telemetryObject.o) {\r\n ordinalLineageArray.push(telemetryObject.o);\r\n }\r\n }\r\n element = getParent(element);\r\n }\r\n\r\n result.nameLineage = nameLineageArray;\r\n result.ordinalLineage = ordinalLineageArray;\r\n return result;\r\n}\r\n\r\nfunction isClickedTwice(currentTarget) {\r\n /// \r\n /// isClickedTwice method\r\n /// Identify if more than one click event happened on the same element in short span of time.\r\n /// \r\n /// Return true if the user click on the same element twice in short span of time, otherwise false.\r\n\r\n // if lastClickedTarget is same as currentTarget means user clicked on same elements twice to be considered as double click.\r\n try {\r\n if (currentTarget && lastClickedTarget && lastClickedTarget === currentTarget) {\r\n return true;\r\n }\r\n lastClickedTarget = currentTarget;\r\n setTimeout(function () {\r\n // Reset 'lastClickedTarget' after a ceratin time period to avoid any kind of unexpected situation.\r\n lastClickedTarget = null;\r\n }, clickTargetResetTimeoutInMs);\r\n } catch (ex) {\r\n lastClickedTarget = null;\r\n return false;\r\n }\r\n return false;\r\n}\r\n\r\nfunction trackClickEvents(event) {\r\n /// \r\n /// trackClickEvents method\r\n /// Tracks all the click events on links.\r\n /// \r\n\r\n // handle error scenarios.\r\n if (!event) {\r\n return;\r\n }\r\n\r\n // If the event or in the originalEvent the developer has set customHandled=true, which means its been already explicitly fired.\r\n // In those cases, don't fire the implicit event.\r\n if (event.customHandled || (event.originalEvent && event.originalEvent.customHandled)) {\r\n return;\r\n }\r\n\r\n // Temp. Hack for Image Map: In IE9, srcElement associated with window.event is not returning correct element.\r\n // Instead of returning a element, it is returning element. element has no href attribute, neither it's parents do have.\r\n // For this reason, Tracking calls are not fired in IE9.\r\n // This hack will check if the event belongs to ImageMap. If so, it will pick activeElement from document and assign it as target/customTarget.\r\n try {\r\n // Passing the time parameter inside event object with timestamp as a value.\r\n event.time = trackInfo.getCurrentTime();\r\n if (event.customTarget && event.customTarget.useMap) {\r\n event.customTarget = event.customTarget.document.activeElement;\r\n event.target = event.customTarget;\r\n }\r\n } catch (ex) { }\r\n\r\n // we assume that an element with an href (and or an ) is the click-tracking element.\r\n // we also want to target