Bug 1523381 - Update max items for Pocket API endpoint 0.7. r=k88hudson, a=RyanVM
authorNan Jiang <njiang028@gmail.com>
Thu, 07 Feb 2019 15:00:14 +0000
changeset 512933 9fc3e1479c32ea16c88de1669252a5478a2b40e2
parent 512932 07c9daedce5a370520949e2c23ba9db40e569396
child 512934 e31b4c03e372ed023b78c8e9662d768c53bfb0aa
push id10646
push userryanvm@gmail.com
push dateThu, 07 Feb 2019 16:13:57 +0000
treeherdermozilla-beta@a9f6e3381fb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersk88hudson, RyanVM
bugs1523381
milestone66.0
Bug 1523381 - Update max items for Pocket API endpoint 0.7. r=k88hudson, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D18988
browser/components/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx
browser/components/newtab/data/content/activity-stream.bundle.js
browser/components/newtab/data/content/activity-stream.bundle.js.map
--- a/browser/components/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx
@@ -6,24 +6,24 @@ import {ImpressionStats} from "content-s
 import {List} from "content-src/components/DiscoveryStreamComponents/List/List";
 import {Navigation} from "content-src/components/DiscoveryStreamComponents/Navigation/Navigation";
 import React from "react";
 import {SectionTitle} from "content-src/components/DiscoveryStreamComponents/SectionTitle/SectionTitle";
 import {selectLayoutRender} from "content-src/lib/selectLayoutRender";
 import {TopSites} from "content-src/components/DiscoveryStreamComponents/TopSites/TopSites";
 
 // According to the Pocket API endpoint specs, `component.properties.items` is a required property with following values:
-//   - List 1-6 items
+//   - List 1-12 items
 //   - Hero 1-5 items
-//   - CardGrid 1-8 items
+//   - CardGrid 1-16 items
 // To enforce that, we define various maximium items for individual components as an extra check.
 // Note that these values are subject to the future changes of the specs.
 const MAX_ROWS_HERO = 5;
-const MAX_ROWS_LIST = 6;
-const MAX_ROWS_CARDGRID = 8;
+const MAX_ROWS_LIST = 12;
+const MAX_ROWS_CARDGRID = 16;
 
 const ALLOWED_CSS_URL_PREFIXES = ["chrome://", "resource://", "https://img-getpocket.cdn.mozilla.net/"];
 const DUMMY_CSS_SELECTOR = "DUMMY#CSS.SELECTOR";
 
 /**
  * Validate a CSS declaration. The values are assumed to be normalized by CSSOM.
  */
 export function isAllowedCSS(property, value) {
--- a/browser/components/newtab/data/content/activity-stream.bundle.js
+++ b/browser/components/newtab/data/content/activity-stream.bundle.js
@@ -7684,24 +7684,24 @@ const TopSites_TopSites_TopSites = Objec
 
 
 
 
 
 
 
 // According to the Pocket API endpoint specs, `component.properties.items` is a required property with following values:
-//   - List 1-6 items
+//   - List 1-12 items
 //   - Hero 1-5 items
-//   - CardGrid 1-8 items
+//   - CardGrid 1-16 items
 // To enforce that, we define various maximium items for individual components as an extra check.
 // Note that these values are subject to the future changes of the specs.
 const MAX_ROWS_HERO = 5;
-const MAX_ROWS_LIST = 6;
-const MAX_ROWS_CARDGRID = 8;
+const MAX_ROWS_LIST = 12;
+const MAX_ROWS_CARDGRID = 16;
 
 const ALLOWED_CSS_URL_PREFIXES = ["chrome://", "resource://", "https://img-getpocket.cdn.mozilla.net/"];
 const DUMMY_CSS_SELECTOR = "DUMMY#CSS.SELECTOR";
 
 /**
  * Validate a CSS declaration. The values are assumed to be normalized by CSSOM.
  */
 function isAllowedCSS(property, value) {
--- a/browser/components/newtab/data/content/activity-stream.bundle.js.map
+++ b/browser/components/newtab/data/content/activity-stream.bundle.js.map
@@ -1,1 +1,1 @@
-{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./content-src/activity-stream.jsx","webpack:///(webpack)/buildin/global.js","webpack:///./common/Actions.jsm","webpack:///./content-src/lib/snippets.js","webpack:///./content-src/asrouter/asrouter-content.jsx","webpack:///external \"ReactIntl\"","webpack:///./content-src/lib/init-store.js","webpack:///external \"Redux\"","webpack:///./content-src/asrouter/rich-text-strings.js","webpack:///./content-src/asrouter/components/ImpressionsWrapper/ImpressionsWrapper.jsx","webpack:///external \"React\"","webpack:///external \"PropTypes\"","webpack:///./content-src/asrouter/templates/OnboardingMessage/OnboardingMessage.jsx","webpack:///./content-src/asrouter/components/ModalOverlay/ModalOverlay.jsx","webpack:///external \"ReactDOM\"","webpack:///./content-src/asrouter/templates/ReturnToAMO/ReturnToAMO.jsx","webpack:///./content-src/asrouter/components/RichText/RichText.jsx","webpack:///./content-src/asrouter/template-utils.js","webpack:///./content-src/asrouter/templates/StartupOverlay/StartupOverlay.jsx","webpack:///external \"ReactRedux\"","webpack:///./content-src/components/Base/Base.jsx","webpack:///./content-src/components/ASRouterAdmin/ASRouterAdmin.jsx","webpack:///./content-src/components/ASRouterAdmin/SimpleHashRouter.jsx","webpack:///./content-src/components/ConfirmDialog/ConfirmDialog.jsx","webpack:///./content-src/components/DiscoveryStreamImpressionStats/ImpressionStats.jsx","webpack:///./content-src/components/TopSites/TopSites.jsx","webpack:///./content-src/components/TopSites/TopSitesConstants.js","webpack:///./content-src/components/CollapsibleSection/CollapsibleSection.jsx","webpack:///./content-src/components/ErrorBoundary/ErrorBoundary.jsx","webpack:///./content-src/components/SectionMenu/SectionMenu.jsx","webpack:///./content-src/components/ContextMenu/ContextMenu.jsx","webpack:///./content-src/lib/section-menu-options.js","webpack:///./content-src/components/ComponentPerfTimer/ComponentPerfTimer.jsx","webpack:///./common/PerfService.jsm","webpack:///./content-src/components/TopSites/SearchShortcutsForm.jsx","webpack:///./content-src/components/TopSites/TopSite.jsx","webpack:///./content-src/components/LinkMenu/LinkMenu.jsx","webpack:///./content-src/lib/link-menu-options.js","webpack:///./content-src/lib/screenshot-utils.js","webpack:///./content-src/components/ManualMigration/ManualMigration.jsx","webpack:///./common/PrerenderData.jsm","webpack:///./content-src/components/Search/Search.jsx","webpack:///./content-src/lib/constants.js","webpack:///./content-src/components/Sections/Sections.jsx","webpack:///./content-src/components/MoreRecommendations/MoreRecommendations.jsx","webpack:///./content-src/components/PocketLoggedInCta/PocketLoggedInCta.jsx","webpack:///./content-src/components/Topics/Topics.jsx","webpack:///./content-src/lib/detect-user-session-start.js","webpack:///./content-src/lib/asroutercontent.js","webpack:///./content-src/components/DiscoveryStreamComponents/DSCard/DSCard.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/CardGrid/CardGrid.jsx","webpack:///./content-src/lib/truncate-text.js","webpack:///./content-src/components/DiscoveryStreamComponents/List/List.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/Hero/Hero.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/HorizontalRule/HorizontalRule.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/Navigation/Navigation.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/SectionTitle/SectionTitle.jsx","webpack:///./node_modules/reselect/es/index.js","webpack:///./content-src/lib/selectLayoutRender.js","webpack:///./content-src/components/DiscoveryStreamComponents/TopSites/TopSites.jsx","webpack:///./content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx","webpack:///./content-src/asrouter/components/Button/Button.jsx","webpack:///./content-src/asrouter/components/ConditionalWrapper/ConditionalWrapper.jsx","webpack:///./content-src/asrouter/components/SnippetBase/SnippetBase.jsx","webpack:///./content-src/asrouter/templates/SimpleSnippet/SimpleSnippet.jsx","webpack:///./content-src/asrouter/templates/EOYSnippet/EOYSnippet.jsx","webpack:///./content-src/asrouter/templates/SubmitFormSnippet/SubmitFormSnippet.jsx","webpack:///./content-src/asrouter/templates/FXASignupSnippet/FXASignupSnippet.jsx","webpack:///./content-src/asrouter/templates/NewsletterSnippet/NewsletterSnippet.jsx","webpack:///./content-src/asrouter/templates/SendToDeviceSnippet/isEmailOrPhoneNumber.js","webpack:///./content-src/asrouter/templates/SendToDeviceSnippet/SendToDeviceSnippet.jsx","webpack:///./content-src/asrouter/templates/template-manifest.jsx","webpack:///./node_modules/fluent/src/parser.js","webpack:///./node_modules/fluent/src/types.js","webpack:///./node_modules/fluent/src/builtins.js","webpack:///./node_modules/fluent/src/resolver.js","webpack:///./node_modules/fluent/src/context.js","webpack:///./node_modules/fluent/src/cached_iterable.js","webpack:///./node_modules/fluent/src/fallback.js","webpack:///./node_modules/fluent/src/util.js","webpack:///./node_modules/fluent/src/index.js","webpack:///./node_modules/fluent-react/src/localization.js","webpack:///./node_modules/fluent-react/src/provider.js","webpack:///./node_modules/fluent-react/src/with_localization.js","webpack:///./node_modules/fluent-react/src/markup.js","webpack:///./node_modules/fluent-react/vendor/omittedCloseTags.js","webpack:///./node_modules/fluent-react/vendor/voidElementTags.js","webpack:///./node_modules/fluent-react/src/localized.js","webpack:///./node_modules/fluent-react/src/index.js","webpack:///./common/Dedupe.jsm","webpack:///./common/Reducers.jsm","webpack:///./content-src/components/Card/types.js","webpack:///./content-src/components/Card/Card.jsx","webpack:///./content-src/components/TopSites/TopSiteFormInput.jsx","webpack:///./content-src/components/TopSites/TopSiteForm.jsx"],"names":["store","initStore","reducers","global","gActivityStreamPrerenderedState","asrouterContent","ASRouterContent","DetectUserSessionStart","sendEventOrAddListener","dispatch","ac","AlsoToMain","type","at","NEW_TAB_STATE_REQUEST","enableASRouterContent","ReactDOM","hydrate","document","location","href","documentElement","lang","gActivityStreamStrings","getElementById","addSnippetsSubscriber","globalImportContext","Window","BACKGROUND_PROCESS","UI_CODE","actionTypes","ASRouterActions","_RouteMessage","action","options","meta","from","to","Error","forEach","o","fromTarget","skipLocal","CONTENT_MESSAGE_TYPE","MAIN_MESSAGE_TYPE","OnlyToMain","BroadcastToContent","AlsoToOneContent","target","skipMain","toTarget","OnlyToOneContent","AlsoToPreloaded","PRELOAD_MESSAGE_TYPE","UserEvent","data","TELEMETRY_USER_EVENT","ASRouterUserEvent","AS_ROUTER_TELEMETRY_USER_EVENT","UndesiredEvent","importContext","TELEMETRY_UNDESIRED_EVENT","PerfEvent","TELEMETRY_PERFORMANCE_EVENT","ImpressionStats","TELEMETRY_IMPRESSION_STATS","SetPref","name","value","SET_PREF","WebExtEvent","source","isSendToMain","isBroadcastToContent","isSendToOneContent","isSendToPreloaded","isFromMain","getPortIdOfSender","DATABASE_NAME","DATABASE_VERSION","SNIPPETS_OBJECTSTORE_NAME","SNIPPETS_UPDATE_INTERVAL_MS","SNIPPETS_ENABLED_EVENT","SNIPPETS_DISABLED_EVENT","SnippetsMap","Map","constructor","_db","_dispatch","set","key","_dbTransaction","db","put","delete","clear","SNIPPETS_BLOCKLIST_CLEARED","blockList","get","blockSnippetById","id","includes","push","SNIPPETS_BLOCKLIST_UPDATED","disableOnboarding","showFirefoxAccounts","SHOW_FIREFOX_ACCOUNTS","getTotalBookmarksCount","Promise","resolve","TOTAL_BOOKMARKS_REQUEST","RPMAddMessageListener","onMessage","TOTAL_BOOKMARKS_RESPONSE","RPMRemoveMessageListener","getAddonsInfo","ADDONS_INFO_REQUEST","ADDONS_INFO_RESPONSE","connect","_openDB","_restoreFromDb","modifier","reject","transaction","objectStore","onsuccess","event","onerror","error","openRequest","indexedDB","open","deleteDatabase","onupgradeneeded","result","objectStoreNames","contains","createObjectStore","err","console","onversionchange","versionChangeEvent","close","cursorRequest","openCursor","cursor","continue","SnippetsProvider","gSnippetsMap","_onAction","bind","snippetsMap","_refreshSnippets","cachedVersion","appData","version","lastUpdate","needsUpdate","Date","now","snippetsURL","response","fetch","status","payload","text","e","_showRemoteSnippets","snippetsEl","elementId","innerHTML","_logIfDevtools","scriptEl","getElementsByTagName","relocatedScript","createElement","parentNode","replaceChild","msg","SNIPPET_BLOCKED","concat","style","display","devtoolsEnabled","log","init","Object","assign","keys","window","dispatchEvent","Event","initialized","uninit","snippets","initializing","subscribe","state","getState","Prefs","values","ASRouter","allowLegacySnippets","disableSnippets","Snippets","hash","INCOMING_MESSAGE_NAME","OUTGOING_MESSAGE_NAME","ASR_CONTAINER_ID","ASRouterUtils","addListener","listener","removeListener","sendMessage","RPMSendAsyncMessage","blockById","dismissById","dismissBundle","bundle","executeAction","button_action","unblockById","unblockBundle","overrideMessage","sendTelemetry","ping","AS_GENERAL_OUTGOING_MESSAGE_NAME","getPreviewEndpoint","params","URLSearchParams","slice","indexOf","endpoint","URL","url","snippetId","shouldSendImpressionOnUpdate","nextProps","prevProps","message","ASRouterUISurface","React","PureComponent","props","onMessageFromParent","sendClick","sendImpression","sendUserActionTelemetry","extraProps","message_id","eventType","provider","metric","dataset","args","content","do_not_autoblock","onBlockById","onDismissById","triggerOnboarding","trigger","setState","body","classList","remove","componentWillMount","addLocaleData","componentWillUnmount","renderSnippets","template","SnippetComponent","SnippetsTemplates","generateMessages","renderOnboarding","renderFirstRunOverlay","add","activityStreamStore","renderPreviewBanner","render","defaultProps","containerElement","_mount","zIndex","appendChild","_activityStreamStore","_unmount","unmountComponentAtNode","MERGE_STORE_ACTION","EARLY_QUEUED_ACTIONS","SAVE_SESSION_PERF_DATA","PAGE_PRERENDERED","mergeStateReducer","mainReducer","prevState","messageMiddleware","next","au","rehydrationMiddleware","_didRehydrate","isMergeStoreAction","isRehydrationRequest","_didRequestInitialState","INIT","queueEarlyMessageMiddleware","_receivedFromMain","_earlyActionQueue","initialState","createStore","combineReducers","applyMiddleware","ex","dump","JSON","stringify","stack","RICH_TEXT_CONFIG","RICH_TEXT_KEYS","cx","MessageContext","attrs","attrsToTry","Array","isArray","string","length","attr","pop","addMessages","VISIBLE","VISIBILITY_CHANGE_EVENT","ImpressionsWrapper","sendImpressionOrAddListener","visibilityState","_onVisibilityChange","removeEventListener","addEventListener","componentDidMount","sendOnMount","componentDidUpdate","children","OnboardingCard","onClick","UISurface","onAction","primary_button","icon","title","label","OnboardingMessage","button_label","header","extraTemplateStrings","map","ModalOverlay","active","onDoneButton","ReturnToAMO","onClickAddExtension","onBlockButton","onReady","onBlock","renderText","customElement","addon_icon","secondary_button","ALLOWED_TAGS","b","i","u","strong","em","br","convertLinks","links","doNotAutoBlock","openNewWindow","reduce","acc","linkTag","safeURI","RichText","localization_id","customElements","protocol","isAllowed","warn","_StartupOverlay","onInputChange","onSubmit","clickSkip","initScene","removeOverlay","onInputInvalid","emailInput","overlayRemoved","flowId","flowBeginTime","didFetch","componentWillUpdate","fxa_endpoint","fxaParams","credentials","json","setTimeout","show","previousSibling","_getFormInfo","has_flow_params","preventDefault","focus","termsLink","privacyLink","intl","formatMessage","terms","privacy","StartupOverlay","injectIntl","didLogDevtoolsHelpText","PrefsButton","addLocaleDataForReactIntl","locale","parentLocale","debounce","func","wait","timer","wakeUp","apply","_Base","isFirstrun","isPrerendered","updateTheme","bodyClassName","filter","v","join","className","App","strings","prefs","startsWith","BaseContent","openPreferences","onWindowScroll","fixedSearch","SCROLL_THRESHOLD","scrollY","SETTINGS_OPEN","disableDarkTheme","bodyClassNames","shouldBeFixedToTop","PrerenderData","arePrefsValid","noSectionsEnabled","Sections","section","enabled","isDiscoveryStream","DiscoveryStream","config","searchHandoffEnabled","outerClassName","showSearch","Search","migrationExpired","Base","Row","relativeTime","timestamp","seconds","Math","floor","minutes","toLocaleString","DiscoveryStreamAdmin","onEnableToggle","setConfigValue","DISCOVERY_STREAM_CONFIG_SET_VALUE","checked","renderComponent","width","component","feed","renderFeed","feeds","lastUpdated","layout","opacity","layout_endpoint","row","rowIndex","components","componentIndex","ASRouterAdminInner","handleEnabledToggle","handleUserPrefToggle","onChangeMessageFilter","findOtherBundledMessagesOfSameTemplate","handleExpressionEval","onChangeTargetingParameters","onChangeAttributionParameters","setAttribution","onCopyTargetingParams","onPasteTargetingParams","onNewTargetingParams","messageFilter","evaluationStatus","stringTargetingParameters","newStringTargetingParameters","copiedToClipboard","pasteFromClipboard","attributionParameters","campaign","param","targetingParameters","messages","bundled","handleBlock","blockBundle","handleUnblock","handleOverride","expireCache","resetPref","context","parse","expression","refs","expressionInput","targetingParametersError","updatedParameters","providerPrefs","find","p","userPrefInfo","userPrefs","isUserEnabled","isSystemEnabled","isEnabling","undefined","setClipboardData","clipboardData","setData","execCommand","targetingParamsEval","innerText","renderMessageItem","isCurrent","lastMessageId","isBlocked","messageBlockList","impressions","messageImpressions","itemClassName","renderMessages","messagesToShow","renderMessageFilter","providers","renderTableHead","renderProviders","providersConfig","providerInfo","isTestProvider","info","bucket","reasonsDisabled","cohort","whiteSpace","renderPasteModal","errors","renderTargetingParameters","success","errorState","inputComp","renderPocketStory","story","guid","renderPocketStories","rows","Section","renderDiscoveryStream","renderAttributionParamers","getSection","routes","_ASRouterAdmin","ASRouterAdmin","SimpleHashRouter","onHashChange","replace","split","cloneElement","_ConfirmDialog","_handleCancelBtn","_handleConfirmBtn","DIALOG_CANCEL","eventSource","onConfirm","_renderModalMessage","message_body","body_string_id","visible","cancel_button_string_id","confirm_button_string_id","ConfirmDialog","Dialog","_needsImpressionStats","cards","impressionCardGuids","_dispatchImpressionStats","toUpperCase","tiles","link","sendImpressionStatsOrAddListener","topSiteIconType","customScreenshotURL","tippyTopIcon","faviconRef","faviconSize","MIN_RICH_FAVICON_SIZE","screenshot","MIN_CORNER_FAVICON_SIZE","countTopSitesIconsTypes","topSites","countTopSitesTypes","_TopSites","onEditFormClose","onSearchShortcutsFormClose","_dispatchTopSitesStats","_getVisibleTopSites","topSitesIconsStats","topSitesPinned","site","isPinned","searchShortcuts","searchTopSite","topsites_icon_stats","topsites_pinned","topsites_search_shortcuts","sitesPerRow","TOP_SITES_MAX_SITES_PER_ROW","matchMedia","matches","TopSites","TopSitesRows","TOP_SITES_SOURCE","TOP_SITES_CANCEL_EDIT","TOP_SITES_CLOSE_SEARCH_SHORTCUTS_MODAL","editForm","showSearchShortcutsForm","extraMenuOptions","pref","collapsed","isFirst","isLast","index","topSitesRows","TOP_SITES_CONTEXT_MENU_OPTIONS","TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS","getFormattedMessage","_CollapsibleSection","onBodyMount","onHeaderClick","onTransitionEnd","enableOrDisableAnimation","onMenuButtonClick","onMenuButtonMouseEnter","onMenuButtonMouseLeave","onMenuUpdate","enableAnimation","isAnimating","menuButtonHover","showContextMenu","setContextMenuButtonRef","sectionBody","scrollHeight","element","contextMenuButtonRef","node","maxHeight","_getSectionBodyHeight","userEvent","SectionMenuOptions","CheckCollapsed","div","currentTarget","renderIcon","backgroundImage","isCollapsible","learnMore","showPrefName","privacyNoticeURL","isWebExtension","bodyStyle","CollapsibleSection","ErrorBoundaryFallback","windowObj","reload","defaultClass","ErrorBoundary","hasError","componentDidCatch","FallbackComponent","DEFAULT_SECTION_MENU_OPTIONS","WEBEXT_SECTION_MENU_OPTIONS","_SectionMenu","getOptions","propOptions","extraOptions","splice","option","first","last","onUpdate","SectionMenu","ContextMenu","hideContext","stopPropagation","ContextMenuItem","onKeyDown","shiftKey","disabled","Separator","MoveUp","SECTION_MOVE","direction","MoveDown","RemoveSection","CollapseSection","UPDATE_SECTION_PREFS","ExpandSection","ManageSection","ManageWebExtension","OPEN_WEBEXT_SETTINGS","AddTopSite","TOP_SITES_EDIT","AddSearchShortcut","TOP_SITES_OPEN_SEARCH_SHORTCUTS_MODAL","PrivacyNotice","OPEN_LINK","RECORDED_SECTIONS","ComponentPerfTimer","Component","perfSvc","_sendBadStateEvent","_sendPaintedEvent","_reportMissingData","_timestampHandled","_recordedFirstRender","_maybeSendPaintedEvent","_afterFramePaint","callback","requestAnimationFrame","_maybeSendBadStateEvent","_ensureFirstRenderTsRecorded","mark","dataReadyKey","firstRenderKey","parseInt","getMostRecentAbsMarkStartByName","ChromeUtils","import","usablePerfObj","Services","appShell","hiddenDOMWindow","performance","_PerfService","performanceObj","_perf","prototype","str","getEntriesByName","timeOrigin","absNow","entries","mostRecentEntry","startTime","SelectableSearchShortcut","shortcut","selected","imageStyle","keyword","onChange","SearchShortcutsForm","handleChange","onCancelButtonClick","onSaveButtonClick","shortcuts","isSelected","ev","onClose","pinQueue","unpinQueue","alreadyPinned","_searchTopSite","searchVendor","shortURL","UPDATE_PINNED_SEARCH_SHORTCUTS","addedShortcuts","deletedShortcuts","search_vendor","TopSiteLink","screenshotImage","onDragEvent","onKeyPress","_allowDrop","dataTransfer","types","dragged","effectAllowed","blur","button","getNextStateFromProps","imageInState","ScreenshotUtils","isRemoteImageLocal","maybeRevokeBlobObjectURL","createLocalImageObject","nextState","componentWillReceiveProps","defaultStyle","isDraggable","topSiteOuterClassName","isDragged","letterFallback","imageClassName","showSmallFavicon","smallFaviconStyle","smallFaviconFallback","hasScreenshotImage","backgroundColor","favicon","draggableProps","onDragEnd","onDragStart","onMouseDown","TopSite","onLinkClick","_getTelemetryInfo","icon_type","iconType","card_type","hostname","action_position","altKey","ctrlKey","metaKey","FILL_SEARCH_TERM","onActivate","isContextMenuOpen","activeIndex","TopSitePlaceholder","onEditButtonClick","_TopSiteList","DEFAULT_STATE","draggedIndex","draggedSite","draggedTitle","topSitesPreview","prevTopSites","newTopSites","dropped","_makeTopSitesPreview","TOP_SITES_INSERT","draggedFromIndex","_getTopSites","pinnedOnly","unpinned","siteToInsert","holeIndex","indexStep","shiftingStep","nextIndex","preview","shift","topSitesUI","commonProps","maxNarrowVisibleIndex","l","slotProps","TopSiteList","DEFAULT_SITE_MENU_OPTIONS","_LinkMenu","isPrivateBrowsingEnabled","siteInfo","platform","isDefault","LinkMenuOptions","impression","string_id","userEventData","shouldSendImpressionStats","LinkMenu","_OpenInPrivateWindow","OPEN_PRIVATE_WINDOW","referrer","GetPlatformString","EmptyItem","RemoveBookmark","DELETE_BOOKMARK_BY_ID","bookmarkGuid","AddBookmark","BOOKMARK_URL","OpenInNewWindow","OPEN_NEW_WINDOW","typedBonus","BlockUrl","BLOCK_URL","open_url","pocket_id","block","pos","WebExtDismiss","WEBEXT_DISMISS","DeleteUrl","isEnabled","DIALOG_OPEN","DELETE_HISTORY_URL","forceBlock","ShowFile","SHOW_DOWNLOAD_FILE","OpenFile","OPEN_DOWNLOAD_FILE","CopyDownloadLink","COPY_DOWNLOAD_LINK","GoToDownloadPage","RemoveDownload","REMOVE_DOWNLOAD_FILE","PinTopSite","TOP_SITES_PIN","UnpinTopSite","TOP_SITES_UNPIN","SaveToPocket","SAVE_TO_POCKET","pocket","DeleteFromPocket","DELETE_FROM_POCKET","ArchiveFromPocket","ARCHIVE_FROM_POCKET","EditTopSite","CheckBookmark","CheckPinTopSite","CheckSavedToPocket","CheckBookmarkOrArchive","OpenInPrivateWindow","isBlob","isLocal","image","path","remoteImage","createObjectURL","localImage","revokeObjectURL","_ManualMigration","onLaunchTour","onCancelTour","MIGRATION_START","MIGRATION_CANCEL","ManualMigration","_PrerenderData","initialPrefs","initialSections","_setValidation","validation","_validation","invalidatingPrefs","_invalidatingPrefs","oneOf","jsonPrefs","_isPrefEnabled","prefObj","getPref","indexedDBPrefs","some","anyModifiedPrefs","prefName","isPrefModified","order","_Search","onSearchClick","onSearchHandoffClick","onSearchHandoffPaste","onSearchHandoffDrop","onInputMount","onSearchHandoffButtonMount","handleEvent","detail","gContentSearchController","search","doSearchHandoff","HANDOFF_SEARCH_TO_AWESOMEBAR","FAKE_FOCUS_SEARCH","HIDE_SEARCH","getData","input","healthReportKey","IS_NEWTAB","searchSource","ContentSearchUIController","_searchHandoffButton","wrapperClassName","hide","fakeFocus","showLogo","handoffEnabled","documentURI","CARDS_PER_ROW_DEFAULT","CARDS_PER_ROW_COMPACT_WIDE","numRows","rowsPref","maxRows","cardsPerRow","compactCards","maxCards","needsImpressionStats","sendNewTabRehydrated","isCollapsed","wasCollapsed","renderNotified","NEW_TAB_REHYDRATED","Pocket","topics","emptyState","read_more_endpoint","contextMenuOptions","waitingForSpoc","maxCardsPerRow","maxCardsOnNarrow","pocketCta","isUserLoggedIn","useCta","isPocketLoggedInDefined","hasTopics","shouldShowPocketCta","shouldShowTopics","shouldShowReadMore","realRows","shouldShowEmptyState","usePlaceholder","sectionClassName","padding","SectionIntl","_Sections","renderSections","sections","enabledSections","sectionOrder","showTopSites","expectedCount","sectionId","s","MoreRecommendations","_PocketLoggedInCta","ctaUrl","ctaButton","ctaText","PocketLoggedInCta","Topic","Topics","t","_store","_perfService","perfService","_sendEvent","visibility_event_rcvd_ts","DSCard","click","image_src","excerpt","CardGrid","recommendations","items","rec","domain","divisibility","border","truncateText","cap","substring","trim","ListItem","_List","recs","recMarkup","recStartingPoint","listStyles","fullWidth","hasBorders","hasImages","hasNumbers","List","Hero","heroRec","otherRecs","list","subComponentType","HorizontalRule","Navigation","alignment","SectionTitle","subtitle","selectLayoutRender","createSelector","spocs","layoutRender","spocIndex","maybeInjectSpocs","spocsConfig","positions","position","rickRoll","random","probability","MAX_ROWS_HERO","MAX_ROWS_LIST","MAX_ROWS_CARDGRID","ALLOWED_CSS_URL_PREFIXES","DUMMY_CSS_SELECTOR","isAllowedCSS","property","urls","match","every","prefix","_DiscoveryStreamBase","onStyleMount","extractRows","limit","min","properties","sheet","styles","selectors","declarations","insertRule","rule","cssRules","removeProperty","selectorText","selector","embedWidth","loaded","full_width","has_images","has_numbers","renderStyles","transform","DiscoveryStreamBase","ALLOWED_STYLE_TAGS","Button","tag","ConditionalWrapper","condition","wrap","SnippetBase","onBlockClicked","onDismissClicked","onDismiss","renderDismissButton","footerDismiss","scene2_dismiss_button_text","defaultTitle","schema","block_button_text","default","containerClassName","textStyle","DEFAULT_ICON_PATH","SimpleSnippet","onButtonClick","button_url","button_action_args","_shouldRenderButton","renderTitle","renderTitleIcon","titleIcon","title_icon","renderButton","button_color","button_background_color","wrapSectionHeader","wrapSnippetContent","renderSectionHeader","section_title_icon","section_title_text","sectionTitleIcon","sectionTitleURL","section_title_url","sectionHeader","tall","extraContent","EOYSnippetBase","handleSubmit","setFrequencyValue","frequencyCheckbox","form","querySelector","submit","renderDonations","fieldNames","numberFormat","Intl","NumberFormat","navigator","language","currency","currency_code","minimumFractionDigits","selected_button","btnStyle","color","donationURLParams","paramsStartIndex","donation_form_url","entry","form_method","idx","field","button_name","amount","format","monthly_checkbox_label_text","text_color","background_color","highlight_color","test","EOYSnippet","extendedContent","SubmitFormSnippet","expandSnippet","handleSubmitAttempt","expanded","submitAttempted","signupSubmitted","signupSuccess","disableForm","preventDismiss","formData","processFormData","mainInput","FormData","fetchRequest","Request","method","renderHiddenFormInputs","hidden_inputs","renderDisclaimer","scene2_disclaimer_html","renderFormPrivacyNotice","scene2_privacy_html","renderSignupSubmitted","isSuccess","successTitle","success_title","bodyText","success_text","error_text","retryButtonText","scene1_button_label","validateInput","setCustomValidity","renderInput","placholder","scene2_email_placeholder_text","scene2_input_placeholder","inputType","renderSignupView","containerClass","scene2_icon","scene2_title","scene2_text","form_action","scene2_button_label","getFirstSceneContent","substr","FXASignupSnippet","userAgent","firefox_version","entrypoint","service","utm_source","utm_content","utm_campaign","utm_term","NewsletterSnippet","scene2_newsletter","newsletters","fmt","source_url","isEmailOrPhoneNumber","val","email_re","check_email","check_phone","isNaN","include_sms","append","message_id_sms","country","message_id_email","encodeURIComponent","addDefaultValues","SendToDeviceSnippet","propsWithDefaults","simple_snippet","newsletter_snippet","fxa_signup_snippet","send_to_device_snippet","eoy_snippet","MAX_PLACEABLES","entryIdentifierRe","identifierRe","functionIdentifierRe","RuntimeParser","getResource","_source","_index","_length","skipWS","getEntry","SyntaxError","skipToNextEntryStart","ch","skipComment","skipSection","getMessage","skipInlineWS","getVariantName","getEntryIdentifier","getPattern","lineStart","getAttributes","skipBlankLines","ptr","getIdentifier","re","lastIndex","exec","toString","start","cc","charCodeAt","getString","eol","firstLineContent","getComplexPattern","buffer","placeables","blankLinesStart","blankLinesEnd","ch2","getPlaceable","variants","getVariants","exp","vars","def","getSelectorExpression","literal","getLiteral","getVariantKey","getCallArgs","fun","lastIndexOf","getNumber","num","defaultIndex","cc0","cc1","parser","FluentType","opts","valueOf","FluentNone","FluentNumber","parseFloat","ctx","nf","_memoizeIntlObject","other","FluentDateTime","dtf","DateTimeFormat","FluentSymbol","pr","PluralRules","select","arg","merge","argopts","unwrapped","opt","MAX_PLACEABLE_LENGTH","FSI","PDI","DefaultMember","env","members","RangeError","MessageReference","_terms","_messages","ReferenceError","VariantExpression","Type","isVariantList","variant","variantKey","AttributeExpression","attrName","SelectExpression","keyCanMatch","expr","Pattern","ExternalArgument","FunctionReference","CallExpression","member","hasOwnProperty","TypeError","_functions","builtins","callee","posargs","keyargs","ptn","dirty","has","useIsolating","_useIsolating","elem","part","WeakSet","locales","functions","_intls","WeakMap","Symbol","iterator","hasMessage","ctor","cache","CachedIterable","iterable","asyncIterator","seen","cur","touchNext","done","mapContextSync","ids","getContextForId","remainingCount","foundContexts","fill","mapContextAsync","nonBlank","line","countIndent","indent","ftl","code","lines","indents","common","RegExp","ReactLocalization","contexts","subs","Set","comp","unsubscribe","setMessages","relocalize","getMessageContext","formatCompound","mcx","fallback","isReactLocalization","propName","prop","LocalizationProvider","l10n","getChildContext","Children","only","childContextTypes","propTypes","PropTypes","isRequired","isIterable","componentName","withLocalization","Inner","WithLocalization","forceUpdate","displayName","contextTypes","TEMPLATE","parseMarkup","omittedCloseTags","area","base","col","embed","hr","img","keygen","track","wbr","voidElementTags","menuitem","reMarkup","toArguments","elems","propname","propval","isValidElement","toLowerCase","Localized","messageValue","messageAttrs","localizedProps","VOID_ELEMENTS","translationNodes","childNodes","translatedChildren","childNode","nodeType","TEXT_NODE","textContent","localName","sourceChild","Dedupe","createKey","defaultCreateKey","item","group","groups","globalKeys","valueMap","m","TOP_SITES_DEFAULT_ROWS","dedupe","INITIAL_STATE","spocs_endpoint","AS_ROUTER_INITIALIZED","AS_ROUTER_PREF_CHANGED","insertPinned","pinned","pinnedUrls","newLinks","pinIndex","hasMatch","newRows","TOP_SITES_UPDATED","TOP_SITES_PREFS_UPDATED","previewResponse","PREVIEW_RESPONSE","previewUrl","PREVIEW_REQUEST","PREVIEW_REQUEST_CANCEL","SCREENSHOT_UPDATED","PLACES_BOOKMARK_ADDED","bookmarkTitle","dateAdded","bookmarkDateCreated","PLACES_BOOKMARK_REMOVED","newSite","PLACES_LINK_DELETED","UPDATE_SEARCH_SHORTCUTS","SNIPPETS_PREVIEW_MODE","newValues","PREFS_INITIAL_VALUES","PREF_CHANGED","newState","SECTION_DEREGISTER","SECTION_REGISTER","SECTION_UPDATE","card","dedupeConfigurations","dedupeConf","dedupedRows","dedupeFrom","dedupeSectionId","dedupeSection","SECTION_UPDATE_CARD","PLACES_SAVED_TO_POCKET","PLACES_LINK_BLOCKED","SNIPPETS_DATA","SNIPPETS_RESET","POCKET_WAITING_FOR_SPOC","POCKET_LOGGED_IN","POCKET_CTA","cta_button","cta_text","cta_url","use_cta","DISCOVERY_STREAM_CONFIG_CHANGE","DISCOVERY_STREAM_CONFIG_SETUP","DISCOVERY_STREAM_LAYOUT_UPDATE","DISCOVERY_STREAM_LAYOUT_RESET","DISCOVERY_STREAM_FEEDS_UPDATE","DISCOVERY_STREAM_SPOCS_ENDPOINT","DISCOVERY_STREAM_SPOCS_UPDATE","SHOW_SEARCH","cardContextTypes","history","intlID","bookmark","trending","download","gImageLoading","_Card","activeCard","imageLoaded","cardImage","maybeLoadImage","imageUrl","loaderPromise","loader","Image","src","catch","then","WEBEXT_CLICK","hasImage","placeholder","description","Card","PlaceholderCard","TopSiteFormInput","validationError","onMount","shouldFocus","showClearButton","onClear","typeUrl","titleId","loading","placeholderId","errorMessageId","TopSiteForm","customScreenshotUrl","showCustomScreenshotForm","onClearScreenshotInput","onLabelChange","onUrlChange","onClearUrlClick","onDoneButtonClick","onCustomScreenshotUrlChange","onPreviewButtonClick","onEnableScreenshotUrlForm","validateUrl","_updateCustomScreenshotInput","validateForm","cleanUrl","_tryParseUrl","validProtocols","urlObj","validateCustomScreenshotUrl","validate","_renderCustomScreenshotInput","requestFailed","isLoading","showAsAdd","previous","changed","previewMode","previewLink"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,w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nBF;AAJF,OADF;AA6BE;AAAA;AAAA,UAAS,WAAU,SAAnB;AACE;AAAA;AAAA,YAAQ,WAAU,QAAlB,EAA2B,MAAK,QAAhC,EAAyC,SAAS,KAAKsb,mBAAvD;AACE,iDAAC,uCAAD,IAAkB,IAAG,6BAArB;AADF,SADF;AAIGm3B,sBACC;AAAA;AAAA,YAAQ,WAAU,cAAlB,EAAiC,MAAK,QAAtC,EAA+C,SAAS,KAAKjB,oBAA7D;AACE,iDAAC,uCAAD,IAAkB,IAAG,8BAArB;AADF,SADD,GAIC;AAAA;AAAA,YAAQ,WAAU,MAAlB,EAAyB,MAAK,QAA9B,EAAuC,SAAS,KAAKF,iBAArD;AACE,iDAAC,uCAAD,IAAkB,IAAIgB,YAAY,0BAAZ,GAAyC,2BAA/D;AADF;AARJ;AA7BF,KADF;AA4CD;AA7OkD;;AAgPrDvB,uBAAWA,CAACn1C,YAAZ,GAA2B;AACzBgW,QAAM,IADmB;AAEzBuB,SAAO,CAAC;AAFiB,CAA3B,C","file":"activity-stream.bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\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 = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {addSnippetsSubscriber} from \"content-src/lib/snippets\";\nimport {ASRouterContent} from \"content-src/asrouter/asrouter-content\";\nimport {Base} from \"content-src/components/Base/Base\";\nimport {DetectUserSessionStart} from \"content-src/lib/detect-user-session-start\";\nimport {enableASRouterContent} from \"content-src/lib/asroutercontent\";\nimport {initStore} from \"content-src/lib/init-store\";\nimport {Provider} from \"react-redux\";\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {reducers} from \"common/Reducers.jsm\";\n\nconst store = initStore(reducers, global.gActivityStreamPrerenderedState);\nconst asrouterContent = new ASRouterContent();\n\nnew DetectUserSessionStart(store).sendEventOrAddListener();\n\n// If we are starting in a prerendered state, we must wait until the first render\n// to request state rehydration (see Base.jsx). If we are NOT in a prerendered state,\n// we can request it immedately.\nif (!global.gActivityStreamPrerenderedState) {\n  store.dispatch(ac.AlsoToMain({type: at.NEW_TAB_STATE_REQUEST}));\n}\nenableASRouterContent(store, asrouterContent);\n\nReactDOM.hydrate(<Provider store={store}>\n  <Base\n    isFirstrun={global.document.location.href === \"about:welcome\"}\n    isPrerendered={!!global.gActivityStreamPrerenderedState}\n    locale={global.document.documentElement.lang}\n    strings={global.gActivityStreamStrings} />\n</Provider>, document.getElementById(\"root\"));\n\naddSnippetsSubscriber(store);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\"use strict\";\n\nthis.MAIN_MESSAGE_TYPE = \"ActivityStream:Main\";\nthis.CONTENT_MESSAGE_TYPE = \"ActivityStream:Content\";\nthis.PRELOAD_MESSAGE_TYPE = \"ActivityStream:PreloadedBrowser\";\nthis.UI_CODE = 1;\nthis.BACKGROUND_PROCESS = 2;\n\n/**\n * globalImportContext - Are we in UI code (i.e. react, a dom) or some kind of background process?\n *                       Use this in action creators if you need different logic\n *                       for ui/background processes.\n */\nconst globalImportContext = typeof Window === \"undefined\" ? BACKGROUND_PROCESS : UI_CODE;\n// Export for tests\nthis.globalImportContext = globalImportContext;\n\n// Create an object that avoids accidental differing key/value pairs:\n// {\n//   INIT: \"INIT\",\n//   UNINIT: \"UNINIT\"\n// }\nconst actionTypes = {};\nfor (const type of [\n  \"ADDONS_INFO_REQUEST\",\n  \"ADDONS_INFO_RESPONSE\",\n  \"ARCHIVE_FROM_POCKET\",\n  \"AS_ROUTER_INITIALIZED\",\n  \"AS_ROUTER_PREF_CHANGED\",\n  \"AS_ROUTER_TELEMETRY_USER_EVENT\",\n  \"BLOCK_URL\",\n  \"BOOKMARK_URL\",\n  \"COPY_DOWNLOAD_LINK\",\n  \"DELETE_BOOKMARK_BY_ID\",\n  \"DELETE_FROM_POCKET\",\n  \"DELETE_HISTORY_URL\",\n  \"DIALOG_CANCEL\",\n  \"DIALOG_OPEN\",\n  \"DISCOVERY_STREAM_CONFIG_CHANGE\",\n  \"DISCOVERY_STREAM_CONFIG_SETUP\",\n  \"DISCOVERY_STREAM_CONFIG_SET_VALUE\",\n  \"DISCOVERY_STREAM_FEEDS_UPDATE\",\n  \"DISCOVERY_STREAM_LAYOUT_RESET\",\n  \"DISCOVERY_STREAM_LAYOUT_UPDATE\",\n  \"DISCOVERY_STREAM_SPOCS_ENDPOINT\",\n  \"DISCOVERY_STREAM_SPOCS_UPDATE\",\n  \"DOWNLOAD_CHANGED\",\n  \"FAKE_FOCUS_SEARCH\",\n  \"FILL_SEARCH_TERM\",\n  \"HANDOFF_SEARCH_TO_AWESOMEBAR\",\n  \"HIDE_SEARCH\",\n  \"INIT\",\n  \"MIGRATION_CANCEL\",\n  \"MIGRATION_COMPLETED\",\n  \"MIGRATION_START\",\n  \"NEW_TAB_INIT\",\n  \"NEW_TAB_INITIAL_STATE\",\n  \"NEW_TAB_LOAD\",\n  \"NEW_TAB_REHYDRATED\",\n  \"NEW_TAB_STATE_REQUEST\",\n  \"NEW_TAB_UNLOAD\",\n  \"OPEN_DOWNLOAD_FILE\",\n  \"OPEN_LINK\",\n  \"OPEN_NEW_WINDOW\",\n  \"OPEN_PRIVATE_WINDOW\",\n  \"OPEN_WEBEXT_SETTINGS\",\n  \"PAGE_PRERENDERED\",\n  \"PLACES_BOOKMARK_ADDED\",\n  \"PLACES_BOOKMARK_REMOVED\",\n  \"PLACES_HISTORY_CLEARED\",\n  \"PLACES_LINKS_CHANGED\",\n  \"PLACES_LINK_BLOCKED\",\n  \"PLACES_LINK_DELETED\",\n  \"PLACES_SAVED_TO_POCKET\",\n  \"POCKET_CTA\",\n  \"POCKET_LOGGED_IN\",\n  \"POCKET_WAITING_FOR_SPOC\",\n  \"PREFS_INITIAL_VALUES\",\n  \"PREF_CHANGED\",\n  \"PREVIEW_REQUEST\",\n  \"PREVIEW_REQUEST_CANCEL\",\n  \"PREVIEW_RESPONSE\",\n  \"REMOVE_DOWNLOAD_FILE\",\n  \"RICH_ICON_MISSING\",\n  \"SAVE_SESSION_PERF_DATA\",\n  \"SAVE_TO_POCKET\",\n  \"SCREENSHOT_UPDATED\",\n  \"SECTION_DEREGISTER\",\n  \"SECTION_DISABLE\",\n  \"SECTION_ENABLE\",\n  \"SECTION_MOVE\",\n  \"SECTION_OPTIONS_CHANGED\",\n  \"SECTION_REGISTER\",\n  \"SECTION_UPDATE\",\n  \"SECTION_UPDATE_CARD\",\n  \"SETTINGS_CLOSE\",\n  \"SETTINGS_OPEN\",\n  \"SET_PREF\",\n  \"SHOW_DOWNLOAD_FILE\",\n  \"SHOW_FIREFOX_ACCOUNTS\",\n  \"SHOW_SEARCH\",\n  \"SKIPPED_SIGNIN\",\n  \"SNIPPETS_BLOCKLIST_CLEARED\",\n  \"SNIPPETS_BLOCKLIST_UPDATED\",\n  \"SNIPPETS_DATA\",\n  \"SNIPPETS_PREVIEW_MODE\",\n  \"SNIPPETS_RESET\",\n  \"SNIPPET_BLOCKED\",\n  \"SUBMIT_EMAIL\",\n  \"SYSTEM_TICK\",\n  \"TELEMETRY_IMPRESSION_STATS\",\n  \"TELEMETRY_PERFORMANCE_EVENT\",\n  \"TELEMETRY_UNDESIRED_EVENT\",\n  \"TELEMETRY_USER_EVENT\",\n  \"TOP_SITES_CANCEL_EDIT\",\n  \"TOP_SITES_CLOSE_SEARCH_SHORTCUTS_MODAL\",\n  \"TOP_SITES_EDIT\",\n  \"TOP_SITES_INSERT\",\n  \"TOP_SITES_OPEN_SEARCH_SHORTCUTS_MODAL\",\n  \"TOP_SITES_PIN\",\n  \"TOP_SITES_PREFS_UPDATED\",\n  \"TOP_SITES_UNPIN\",\n  \"TOP_SITES_UPDATED\",\n  \"TOTAL_BOOKMARKS_REQUEST\",\n  \"TOTAL_BOOKMARKS_RESPONSE\",\n  \"UNINIT\",\n  \"UPDATE_PINNED_SEARCH_SHORTCUTS\",\n  \"UPDATE_SEARCH_SHORTCUTS\",\n  \"UPDATE_SECTION_PREFS\",\n  \"WEBEXT_CLICK\",\n  \"WEBEXT_DISMISS\",\n]) {\n  actionTypes[type] = type;\n}\n\n// These are acceptable actions for AS Router messages to have. They can show up\n// as call-to-action buttons in snippets, onboarding tour, etc.\nconst ASRouterActions = {};\nfor (const type of [\n  \"INSTALL_ADDON_FROM_URL\",\n  \"OPEN_APPLICATIONS_MENU\",\n  \"OPEN_PRIVATE_BROWSER_WINDOW\",\n  \"OPEN_URL\",\n  \"OPEN_ABOUT_PAGE\",\n  \"OPEN_PREFERENCES_PAGE\",\n  \"SHOW_FIREFOX_ACCOUNTS\",\n]) {\n  ASRouterActions[type] = type;\n}\n\n// Helper function for creating routed actions between content and main\n// Not intended to be used by consumers\nfunction _RouteMessage(action, options) {\n  const meta = action.meta ? {...action.meta} : {};\n  if (!options || !options.from || !options.to) {\n    throw new Error(\"Routed Messages must have options as the second parameter, and must at least include a .from and .to property.\");\n  }\n  // For each of these fields, if they are passed as an option,\n  // add them to the action. If they are not defined, remove them.\n  [\"from\", \"to\", \"toTarget\", \"fromTarget\", \"skipMain\", \"skipLocal\"].forEach(o => {\n    if (typeof options[o] !== \"undefined\") {\n      meta[o] = options[o];\n    } else if (meta[o]) {\n      delete meta[o];\n    }\n  });\n  return {...action, meta};\n}\n\n/**\n * AlsoToMain - Creates a message that will be dispatched locally and also sent to the Main process.\n *\n * @param  {object} action Any redux action (required)\n * @param  {object} options\n * @param  {bool}   skipLocal Used by OnlyToMain to skip the main reducer\n * @param  {string} fromTarget The id of the content port from which the action originated. (optional)\n * @return {object} An action with added .meta properties\n */\nfunction AlsoToMain(action, fromTarget, skipLocal) {\n  return _RouteMessage(action, {\n    from: CONTENT_MESSAGE_TYPE,\n    to: MAIN_MESSAGE_TYPE,\n    fromTarget,\n    skipLocal,\n  });\n}\n\n/**\n * OnlyToMain - Creates a message that will be sent to the Main process and skip the local reducer.\n *\n * @param  {object} action Any redux action (required)\n * @param  {object} options\n * @param  {string} fromTarget The id of the content port from which the action originated. (optional)\n * @return {object} An action with added .meta properties\n */\nfunction OnlyToMain(action, fromTarget) {\n  return AlsoToMain(action, fromTarget, true);\n}\n\n/**\n * BroadcastToContent - Creates a message that will be dispatched to main and sent to ALL content processes.\n *\n * @param  {object} action Any redux action (required)\n * @return {object} An action with added .meta properties\n */\nfunction BroadcastToContent(action) {\n  return _RouteMessage(action, {\n    from: MAIN_MESSAGE_TYPE,\n    to: CONTENT_MESSAGE_TYPE,\n  });\n}\n\n/**\n * AlsoToOneContent - Creates a message that will be will be dispatched to the main store\n *                    and also sent to a particular Content process.\n *\n * @param  {object} action Any redux action (required)\n * @param  {string} target The id of a content port\n * @param  {bool} skipMain Used by OnlyToOneContent to skip the main process\n * @return {object} An action with added .meta properties\n */\nfunction AlsoToOneContent(action, target, skipMain) {\n  if (!target) {\n    throw new Error(\"You must provide a target ID as the second parameter of AlsoToOneContent. If you want to send to all content processes, use BroadcastToContent\");\n  }\n  return _RouteMessage(action, {\n    from: MAIN_MESSAGE_TYPE,\n    to: CONTENT_MESSAGE_TYPE,\n    toTarget: target,\n    skipMain,\n  });\n}\n\n/**\n * OnlyToOneContent - Creates a message that will be sent to a particular Content process\n *                    and skip the main reducer.\n *\n * @param  {object} action Any redux action (required)\n * @param  {string} target The id of a content port\n * @return {object} An action with added .meta properties\n */\nfunction OnlyToOneContent(action, target) {\n  return AlsoToOneContent(action, target, true);\n}\n\n/**\n * AlsoToPreloaded - Creates a message that dispatched to the main reducer and also sent to the preloaded tab.\n *\n * @param  {object} action Any redux action (required)\n * @return {object} An action with added .meta properties\n */\nfunction AlsoToPreloaded(action) {\n  return _RouteMessage(action, {\n    from: MAIN_MESSAGE_TYPE,\n    to: PRELOAD_MESSAGE_TYPE,\n  });\n}\n\n/**\n * UserEvent - A telemetry ping indicating a user action. This should only\n *                   be sent from the UI during a user session.\n *\n * @param  {object} data Fields to include in the ping (source, etc.)\n * @return {object} An AlsoToMain action\n */\nfunction UserEvent(data) {\n  return AlsoToMain({\n    type: actionTypes.TELEMETRY_USER_EVENT,\n    data,\n  });\n}\n\n/**\n * ASRouterUserEvent - A telemetry ping indicating a user action from AS router. This should only\n *                     be sent from the UI during a user session.\n *\n * @param  {object} data Fields to include in the ping (source, etc.)\n * @return {object} An AlsoToMain action\n */\nfunction ASRouterUserEvent(data) {\n  return AlsoToMain({\n    type: actionTypes.AS_ROUTER_TELEMETRY_USER_EVENT,\n    data,\n  });\n}\n\n/**\n * UndesiredEvent - A telemetry ping indicating an undesired state.\n *\n * @param  {object} data Fields to include in the ping (value, etc.)\n * @param  {int} importContext (For testing) Override the import context for testing.\n * @return {object} An action. For UI code, a AlsoToMain action.\n */\nfunction UndesiredEvent(data, importContext = globalImportContext) {\n  const action = {\n    type: actionTypes.TELEMETRY_UNDESIRED_EVENT,\n    data,\n  };\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\n/**\n * PerfEvent - A telemetry ping indicating a performance-related event.\n *\n * @param  {object} data Fields to include in the ping (value, etc.)\n * @param  {int} importContext (For testing) Override the import context for testing.\n * @return {object} An action. For UI code, a AlsoToMain action.\n */\nfunction PerfEvent(data, importContext = globalImportContext) {\n  const action = {\n    type: actionTypes.TELEMETRY_PERFORMANCE_EVENT,\n    data,\n  };\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\n/**\n * ImpressionStats - A telemetry ping indicating an impression stats.\n *\n * @param  {object} data Fields to include in the ping\n * @param  {int} importContext (For testing) Override the import context for testing.\n * #return {object} An action. For UI code, a AlsoToMain action.\n */\nfunction ImpressionStats(data, importContext = globalImportContext) {\n  const action = {\n    type: actionTypes.TELEMETRY_IMPRESSION_STATS,\n    data,\n  };\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\nfunction SetPref(name, value, importContext = globalImportContext) {\n  const action = {type: actionTypes.SET_PREF, data: {name, value}};\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\nfunction WebExtEvent(type, data, importContext = globalImportContext) {\n  if (!data || !data.source) {\n    throw new Error(\"WebExtEvent actions should include a property \\\"source\\\", the id of the webextension that should receive the event.\");\n  }\n  const action = {type, data};\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\nthis.actionTypes = actionTypes;\nthis.ASRouterActions = ASRouterActions;\n\nthis.actionCreators = {\n  BroadcastToContent,\n  UserEvent,\n  ASRouterUserEvent,\n  UndesiredEvent,\n  PerfEvent,\n  ImpressionStats,\n  AlsoToOneContent,\n  OnlyToOneContent,\n  AlsoToMain,\n  OnlyToMain,\n  AlsoToPreloaded,\n  SetPref,\n  WebExtEvent,\n};\n\n// These are helpers to test for certain kinds of actions\nthis.actionUtils = {\n  isSendToMain(action) {\n    if (!action.meta) {\n      return false;\n    }\n    return action.meta.to === MAIN_MESSAGE_TYPE && action.meta.from === CONTENT_MESSAGE_TYPE;\n  },\n  isBroadcastToContent(action) {\n    if (!action.meta) {\n      return false;\n    }\n    if (action.meta.to === CONTENT_MESSAGE_TYPE && !action.meta.toTarget) {\n      return true;\n    }\n    return false;\n  },\n  isSendToOneContent(action) {\n    if (!action.meta) {\n      return false;\n    }\n    if (action.meta.to === CONTENT_MESSAGE_TYPE && action.meta.toTarget) {\n      return true;\n    }\n    return false;\n  },\n  isSendToPreloaded(action) {\n    if (!action.meta) {\n      return false;\n    }\n    return action.meta.to === PRELOAD_MESSAGE_TYPE &&\n      action.meta.from === MAIN_MESSAGE_TYPE;\n  },\n  isFromMain(action) {\n    if (!action.meta) {\n      return false;\n    }\n    return action.meta.from === MAIN_MESSAGE_TYPE &&\n      action.meta.to === CONTENT_MESSAGE_TYPE;\n  },\n  getPortIdOfSender(action) {\n    return (action.meta && action.meta.fromTarget) || null;\n  },\n  _RouteMessage,\n};\n\nconst EXPORTED_SYMBOLS = [\n  \"actionTypes\",\n  \"actionCreators\",\n  \"actionUtils\",\n  \"ASRouterActions\",\n  \"globalImportContext\",\n  \"UI_CODE\",\n  \"BACKGROUND_PROCESS\",\n  \"MAIN_MESSAGE_TYPE\",\n  \"CONTENT_MESSAGE_TYPE\",\n  \"PRELOAD_MESSAGE_TYPE\",\n];\n","const DATABASE_NAME = \"snippets_db\";\nconst DATABASE_VERSION = 1;\nconst SNIPPETS_OBJECTSTORE_NAME = \"snippets\";\nexport const SNIPPETS_UPDATE_INTERVAL_MS = 14400000; // 4 hours.\n\nconst SNIPPETS_ENABLED_EVENT = \"Snippets:Enabled\";\nconst SNIPPETS_DISABLED_EVENT = \"Snippets:Disabled\";\n\nimport {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\n\n/**\n * SnippetsMap - A utility for cacheing values related to the snippet. It has\n *               the same interface as a Map, but is optionally backed by\n *               indexedDB for persistent storage.\n *               Call .connect() to open a database connection and restore any\n *               previously cached data, if necessary.\n *\n */\nexport class SnippetsMap extends Map {\n  constructor(dispatch) {\n    super();\n    this._db = null;\n    this._dispatch = dispatch;\n  }\n\n  set(key, value) {\n    super.set(key, value);\n    return this._dbTransaction(db => db.put(value, key));\n  }\n\n  delete(key) {\n    super.delete(key);\n    return this._dbTransaction(db => db.delete(key));\n  }\n\n  clear() {\n    super.clear();\n    this._dispatch(ac.OnlyToMain({type: at.SNIPPETS_BLOCKLIST_CLEARED}));\n    return this._dbTransaction(db => db.clear());\n  }\n\n  get blockList() {\n    return this.get(\"blockList\") || [];\n  }\n\n  /**\n   * blockSnippetById - Blocks a snippet given an id\n   *\n   * @param  {str|int} id   The id of the snippet\n   * @return {Promise}      Resolves when the id has been written to indexedDB,\n   *                        or immediately if the snippetMap is not connected\n   */\n  async blockSnippetById(id) {\n    if (!id) {\n      return;\n    }\n    const {blockList} = this;\n    if (!blockList.includes(id)) {\n      blockList.push(id);\n      this._dispatch(ac.AlsoToMain({type: at.SNIPPETS_BLOCKLIST_UPDATED, data: id}));\n      await this.set(\"blockList\", blockList);\n    }\n  }\n\n  disableOnboarding() {}\n\n  showFirefoxAccounts() {\n    this._dispatch(ac.AlsoToMain({type: at.SHOW_FIREFOX_ACCOUNTS}));\n  }\n\n  getTotalBookmarksCount() {\n    return new Promise(resolve => {\n      this._dispatch(ac.OnlyToMain({type: at.TOTAL_BOOKMARKS_REQUEST}));\n      global.RPMAddMessageListener(\"ActivityStream:MainToContent\", function onMessage({data: action}) {\n        if (action.type === at.TOTAL_BOOKMARKS_RESPONSE) {\n          resolve(action.data);\n          global.RPMRemoveMessageListener(\"ActivityStream:MainToContent\", onMessage);\n        }\n      });\n    });\n  }\n\n  getAddonsInfo() {\n    return new Promise(resolve => {\n      this._dispatch(ac.OnlyToMain({type: at.ADDONS_INFO_REQUEST}));\n      global.RPMAddMessageListener(\"ActivityStream:MainToContent\", function onMessage({data: action}) {\n        if (action.type === at.ADDONS_INFO_RESPONSE) {\n          resolve(action.data);\n          global.RPMRemoveMessageListener(\"ActivityStream:MainToContent\", onMessage);\n        }\n      });\n    });\n  }\n\n  /**\n   * connect - Attaches an indexedDB back-end to the Map so that any set values\n   *           are also cached in a store. It also restores any existing values\n   *           that are already stored in the indexedDB store.\n   *\n   * @return {type}  description\n   */\n  async connect() {\n    // Open the connection\n    const db = await this._openDB();\n\n    // Restore any existing values\n    await this._restoreFromDb(db);\n\n    // Attach a reference to the db\n    this._db = db;\n  }\n\n  /**\n   * _dbTransaction - Returns a db transaction wrapped with the given modifier\n   *                  function as a Promise. If the db has not been connected,\n   *                  it resolves immediately.\n   *\n   * @param  {func} modifier A function to call with the transaction\n   * @return {obj}           A Promise that resolves when the transaction has\n   *                         completed or errored\n   */\n  _dbTransaction(modifier) {\n    if (!this._db) {\n      return Promise.resolve();\n    }\n    return new Promise((resolve, reject) => {\n      const transaction = modifier(\n        this._db\n          .transaction(SNIPPETS_OBJECTSTORE_NAME, \"readwrite\")\n          .objectStore(SNIPPETS_OBJECTSTORE_NAME)\n      );\n      transaction.onsuccess = event => resolve();\n\n      /* istanbul ignore next */\n      transaction.onerror = event => reject(transaction.error);\n    });\n  }\n\n  _openDB() {\n    return new Promise((resolve, reject) => {\n      const openRequest = indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n\n      /* istanbul ignore next */\n      openRequest.onerror = event => {\n        // Try to delete the old database so that we can start this process over\n        // next time.\n        indexedDB.deleteDatabase(DATABASE_NAME);\n        reject(event);\n      };\n\n      openRequest.onupgradeneeded = event => {\n        const db = event.target.result;\n        if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) {\n          db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME);\n        }\n      };\n\n      openRequest.onsuccess = event => {\n        let db = event.target.result;\n\n        /* istanbul ignore next */\n        db.onerror = err => console.error(err); // eslint-disable-line no-console\n        /* istanbul ignore next */\n        db.onversionchange = versionChangeEvent => versionChangeEvent.target.close();\n\n        resolve(db);\n      };\n    });\n  }\n\n  _restoreFromDb(db) {\n    return new Promise((resolve, reject) => {\n      let cursorRequest;\n      try {\n        cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME)\n          .objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor();\n      } catch (err) {\n        // istanbul ignore next\n        reject(err);\n        // istanbul ignore next\n        return;\n      }\n\n      /* istanbul ignore next */\n      cursorRequest.onerror = event => reject(event);\n\n      cursorRequest.onsuccess = event => {\n        let cursor = event.target.result;\n        // Populate the cache from the persistent storage.\n        if (cursor) {\n          if (cursor.value !== \"blockList\") {\n            this.set(cursor.key, cursor.value);\n          }\n          cursor.continue();\n        } else {\n          // We are done.\n          resolve();\n        }\n      };\n    });\n  }\n}\n\n/**\n * SnippetsProvider - Initializes a SnippetsMap and loads snippets from a\n *                    remote location, or else default snippets if the remote\n *                    snippets cannot be retrieved.\n */\nexport class SnippetsProvider {\n  constructor(dispatch) {\n    // Initialize the Snippets Map and attaches it to a global so that\n    // the snippet payload can interact with it.\n    global.gSnippetsMap = new SnippetsMap(dispatch);\n    this._onAction = this._onAction.bind(this);\n  }\n\n  get snippetsMap() {\n    return global.gSnippetsMap;\n  }\n\n  async _refreshSnippets() {\n    // Check if the cached version of of the snippets in snippetsMap. If it's too\n    // old, blow away the entire snippetsMap.\n    const cachedVersion = this.snippetsMap.get(\"snippets-cached-version\");\n\n    if (cachedVersion !== this.appData.version) {\n      this.snippetsMap.clear();\n    }\n\n    // Has enough time passed for us to require an update?\n    const lastUpdate = this.snippetsMap.get(\"snippets-last-update\");\n    const needsUpdate = !(lastUpdate >= 0) || Date.now() - lastUpdate > SNIPPETS_UPDATE_INTERVAL_MS;\n\n    if (needsUpdate && this.appData.snippetsURL) {\n      this.snippetsMap.set(\"snippets-last-update\", Date.now());\n      try {\n        const response = await fetch(this.appData.snippetsURL);\n        if (response.status === 200) {\n          const payload = await response.text();\n\n          this.snippetsMap.set(\"snippets\", payload);\n          this.snippetsMap.set(\"snippets-cached-version\", this.appData.version);\n        }\n      } catch (e) {\n        console.error(e); // eslint-disable-line no-console\n      }\n    }\n  }\n\n  _showRemoteSnippets() {\n    const snippetsEl = document.getElementById(this.elementId);\n    const payload = this.snippetsMap.get(\"snippets\");\n\n    if (!snippetsEl) {\n      throw new Error(`No element was found with id '${this.elementId}'.`);\n    }\n\n    // This could happen if fetching failed\n    if (!payload) {\n      throw new Error(\"No remote snippets were found in gSnippetsMap.\");\n    }\n\n    if (typeof payload !== \"string\") {\n      throw new Error(\"Snippet payload was incorrectly formatted\");\n    }\n\n    // Note that injecting snippets can throw if they're invalid XML.\n    // eslint-disable-next-line no-unsanitized/property\n    snippetsEl.innerHTML = payload;\n\n    this._logIfDevtools(\"Successfully added snippets.\");\n\n    // Scripts injected by innerHTML are inactive, so we have to relocate them\n    // through DOM manipulation to activate their contents.\n    for (const scriptEl of snippetsEl.getElementsByTagName(\"script\")) {\n      const relocatedScript = document.createElement(\"script\");\n      relocatedScript.text = scriptEl.text;\n      scriptEl.parentNode.replaceChild(relocatedScript, scriptEl);\n    }\n  }\n\n  _onAction(msg) {\n    if (msg.data.type === at.SNIPPET_BLOCKED) {\n      if (!this.snippetsMap.blockList.includes(msg.data.data)) {\n        this.snippetsMap.set(\"blockList\", this.snippetsMap.blockList.concat(msg.data.data));\n        document.getElementById(\"snippets-container\").style.display = \"none\";\n      }\n    }\n  }\n\n  // istanbul ignore next\n  _logIfDevtools(text) {\n    if (this.devtoolsEnabled) {\n      console.log(\"Legacy snippets:\", text); // eslint-disable-line no-console\n    }\n  }\n\n  /**\n   * init - Fetch the snippet payload and show snippets\n   *\n   * @param  {obj} options\n   * @param  {str} options.appData.snippetsURL  The URL from which we fetch snippets\n   * @param  {int} options.appData.version  The current snippets version\n   * @param  {str} options.elementId  The id of the element in which to inject snippets\n   * @param  {bool} options.connect  Should gSnippetsMap connect to indexedDB?\n   */\n  async init(options) {\n    Object.assign(this, {\n      appData: {},\n      elementId: \"snippets\",\n      connect: true,\n      devtoolsEnabled: false,\n    }, options);\n\n    this._logIfDevtools(\"Initializing...\");\n\n    // Add listener so we know when snippets are blocked on other pages\n    if (global.RPMAddMessageListener) {\n      global.RPMAddMessageListener(\"ActivityStream:MainToContent\", this._onAction);\n    }\n\n    // TODO: Requires enabling indexedDB on newtab\n    // Restore the snippets map from indexedDB\n    if (this.connect) {\n      try {\n        await this.snippetsMap.connect();\n      } catch (e) {\n        console.error(e); // eslint-disable-line no-console\n      }\n    }\n\n    // Cache app data values so they can be accessible from gSnippetsMap\n    for (const key of Object.keys(this.appData)) {\n      if (key === \"blockList\") {\n        this.snippetsMap.set(\"blockList\", this.appData[key]);\n      } else {\n        this.snippetsMap.set(`appData.${key}`, this.appData[key]);\n      }\n    }\n\n    // Refresh snippets, if enough time has passed.\n    await this._refreshSnippets();\n\n    // Try showing remote snippets, falling back to defaults if necessary.\n    try {\n      this._showRemoteSnippets();\n    } catch (e) {\n      this._logIfDevtools(\"Problem inserting remote snippets!\");\n      console.error(e); // eslint-disable-line no-console\n    }\n\n    window.dispatchEvent(new Event(SNIPPETS_ENABLED_EVENT));\n\n    this.initialized = true;\n    this._logIfDevtools(\"Finished initializing.\");\n  }\n\n  uninit() {\n    window.dispatchEvent(new Event(SNIPPETS_DISABLED_EVENT));\n    if (global.RPMRemoveMessageListener) {\n      global.RPMRemoveMessageListener(\"ActivityStream:MainToContent\", this._onAction);\n    }\n    this.initialized = false;\n  }\n}\n\n/**\n * addSnippetsSubscriber - Creates a SnippetsProvider that Initializes\n *                         when the store has received the appropriate\n *                         Snippet data.\n *\n * @param  {obj} store   The redux store\n * @return {obj}         Returns the snippets instance, asrouterContent instance and unsubscribe function\n */\nexport function addSnippetsSubscriber(store) {\n  const snippets = new SnippetsProvider(store.dispatch);\n\n  let initializing = false;\n\n  store.subscribe(async () => {\n    const state = store.getState();\n\n    /**\n     * Sorry this code is so complicated. It will be removed soon.\n     * This is what the different values actually mean:\n     *\n     * ASRouter.initialized                   Is ASRouter.jsm initialised?\n     * ASRouter.allowLegacySnippets           Are ASRouter snippets turned OFF (i.e. legacy snippets are allowed)\n     * state.Prefs.values[\"feeds.snippets\"]   User preference for snippets\n     * state.Snippets.initialized             Is SnippetsFeed.jsm initialised?\n     * snippets.initialized                   Is in-content snippets currently initialised?\n     * state.Prefs.values.disableSnippets     This pref is used to disable legacy snippets in an emergency\n     *                                        in a way that is not user-editable (true = disabled)\n     */\n\n    /** If we should initialize snippets... */\n    if (\n      state.Prefs.values[\"feeds.snippets\"] &&\n      state.ASRouter.initialized &&\n      state.ASRouter.allowLegacySnippets &&\n      !state.Prefs.values.disableSnippets &&\n      state.Snippets.initialized &&\n      !snippets.initialized &&\n      // Don't call init multiple times\n      !initializing &&\n      location.href !== \"about:welcome\" &&\n      location.hash !== \"#asrouter\"\n    ) {\n      initializing = true;\n      await snippets.init({appData: state.Snippets, devtoolsEnabled: state.Prefs.values[\"asrouter.devtoolsEnabled\"]});\n      initializing = false;\n\n    /** If we should remove snippets... */\n    } else if (\n      (\n        state.Prefs.values[\"feeds.snippets\"] === false ||\n        state.Prefs.values.disableSnippets === true ||\n        (state.ASRouter.initialized && !state.ASRouter.allowLegacySnippets)\n      ) &&\n      snippets.initialized\n    ) {\n      // Remove snippets\n      snippets.uninit();\n      // istanbul ignore if\n      if (state.Prefs.values[\"asrouter.devtoolsEnabled\"]) {\n        console.log(\"Legacy snippets removed\"); // eslint-disable-line no-console\n      }\n    }\n  });\n\n  // Returned for testing purposes\n  return {snippets};\n}\n","import {addLocaleData, IntlProvider} from \"react-intl\";\nimport {actionCreators as ac} from \"common/Actions.jsm\";\nimport {OUTGOING_MESSAGE_NAME as AS_GENERAL_OUTGOING_MESSAGE_NAME} from \"content-src/lib/init-store\";\nimport {generateMessages} from \"./rich-text-strings\";\nimport {ImpressionsWrapper} from \"./components/ImpressionsWrapper/ImpressionsWrapper\";\nimport {LocalizationProvider} from \"fluent-react\";\nimport {OnboardingMessage} from \"./templates/OnboardingMessage/OnboardingMessage\";\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {ReturnToAMO} from \"./templates/ReturnToAMO/ReturnToAMO\";\nimport {SnippetsTemplates} from \"./templates/template-manifest\";\nimport {StartupOverlay} from \"./templates/StartupOverlay/StartupOverlay\";\n\nconst INCOMING_MESSAGE_NAME = \"ASRouter:parent-to-child\";\nconst OUTGOING_MESSAGE_NAME = \"ASRouter:child-to-parent\";\nconst ASR_CONTAINER_ID = \"asr-newtab-container\";\n\nexport const ASRouterUtils = {\n  addListener(listener) {\n    global.RPMAddMessageListener(INCOMING_MESSAGE_NAME, listener);\n  },\n  removeListener(listener) {\n    global.RPMRemoveMessageListener(INCOMING_MESSAGE_NAME, listener);\n  },\n  sendMessage(action) {\n    global.RPMSendAsyncMessage(OUTGOING_MESSAGE_NAME, action);\n  },\n  blockById(id, options) {\n    ASRouterUtils.sendMessage({type: \"BLOCK_MESSAGE_BY_ID\", data: {id, ...options}});\n  },\n  dismissById(id) {\n    ASRouterUtils.sendMessage({type: \"DISMISS_MESSAGE_BY_ID\", data: {id}});\n  },\n  dismissBundle(bundle) {\n    ASRouterUtils.sendMessage({type: \"DISMISS_BUNDLE\", data: {bundle}});\n  },\n  executeAction(button_action) {\n    ASRouterUtils.sendMessage({\n      type: \"USER_ACTION\",\n      data: button_action,\n    });\n  },\n  unblockById(id) {\n    ASRouterUtils.sendMessage({type: \"UNBLOCK_MESSAGE_BY_ID\", data: {id}});\n  },\n  unblockBundle(bundle) {\n    ASRouterUtils.sendMessage({type: \"UNBLOCK_BUNDLE\", data: {bundle}});\n  },\n  overrideMessage(id) {\n    ASRouterUtils.sendMessage({type: \"OVERRIDE_MESSAGE\", data: {id}});\n  },\n  sendTelemetry(ping) {\n    const payload = ac.ASRouterUserEvent(ping);\n    global.RPMSendAsyncMessage(AS_GENERAL_OUTGOING_MESSAGE_NAME, payload);\n  },\n  getPreviewEndpoint() {\n    if (window.location.href.includes(\"endpoint\")) {\n      const params = new URLSearchParams(window.location.href.slice(window.location.href.indexOf(\"endpoint\")));\n      try {\n        const endpoint = new URL(params.get(\"endpoint\"));\n        return {\n          url: endpoint.href,\n          snippetId: params.get(\"snippetId\"),\n        };\n      } catch (e) {}\n    }\n\n    return null;\n  },\n};\n\n// Note: nextProps/prevProps refer to props passed to <ImpressionsWrapper />, not <ASRouterUISurface />\nfunction shouldSendImpressionOnUpdate(nextProps, prevProps) {\n  return (nextProps.message.id && (!prevProps.message || prevProps.message.id !== nextProps.message.id));\n}\n\nexport class ASRouterUISurface extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onMessageFromParent = this.onMessageFromParent.bind(this);\n    this.sendClick = this.sendClick.bind(this);\n    this.sendImpression = this.sendImpression.bind(this);\n    this.sendUserActionTelemetry = this.sendUserActionTelemetry.bind(this);\n    this.state = {message: {}, bundle: {}};\n  }\n\n  sendUserActionTelemetry(extraProps = {}) {\n    const {message, bundle} = this.state;\n    if (!message && !extraProps.message_id) {\n      throw new Error(`You must provide a message_id for bundled messages`);\n    }\n    const eventType = `${message.provider || bundle.provider}_user_event`;\n    ASRouterUtils.sendTelemetry({\n      message_id: message.id || extraProps.message_id,\n      source: extraProps.id,\n      action: eventType,\n      ...extraProps,\n    });\n  }\n\n  sendImpression(extraProps) {\n    if (this.state.message.provider === \"preview\") {\n      return;\n    }\n\n    ASRouterUtils.sendMessage({type: \"IMPRESSION\", data: this.state.message});\n    this.sendUserActionTelemetry({event: \"IMPRESSION\", ...extraProps});\n  }\n\n  // If link has a `metric` data attribute send it as part of the `value`\n  // telemetry field which can have arbitrary values.\n  // Used for router messages with links as part of the content.\n  sendClick(event) {\n    const metric = {\n      value: event.target.dataset.metric,\n      // Used for the `source` of the event. Needed to differentiate\n      // from other snippet or onboarding events that may occur.\n      id: \"NEWTAB_FOOTER_BAR_CONTENT\",\n    };\n    const action = {\n      type: event.target.dataset.action,\n      data: {args: event.target.dataset.args},\n    };\n    if (action.type) {\n      ASRouterUtils.executeAction(action);\n    }\n    if (!this.state.message.content.do_not_autoblock && !event.target.dataset.do_not_autoblock) {\n      ASRouterUtils.blockById(this.state.message.id);\n    }\n    if (this.state.message.provider !== \"preview\") {\n      this.sendUserActionTelemetry({event: \"CLICK_BUTTON\", ...metric});\n    }\n  }\n\n  onBlockById(id) {\n    return options => ASRouterUtils.blockById(id, options);\n  }\n\n  onDismissById(id) {\n    return () => ASRouterUtils.dismissById(id);\n  }\n\n  dismissBundle(bundle) {\n    return () => ASRouterUtils.dismissBundle(bundle);\n  }\n\n  triggerOnboarding() {\n    ASRouterUtils.sendMessage({type: \"TRIGGER\", data: {trigger: {id: \"showOnboarding\"}}});\n  }\n\n  onMessageFromParent({data: action}) {\n    switch (action.type) {\n      case \"SET_MESSAGE\":\n        this.setState({message: action.data});\n        break;\n      case \"SET_BUNDLED_MESSAGES\":\n        this.setState({bundle: action.data});\n        break;\n      case \"CLEAR_MESSAGE\":\n        if (action.data.id === this.state.message.id) {\n          this.setState({message: {}});\n          // Remove any styles related to the RTAMO message\n          document.body.classList.remove(\"welcome\", \"hide-main\", \"amo\");\n        }\n        break;\n      case \"CLEAR_PROVIDER\":\n        if (action.data.id === this.state.message.provider) {\n          this.setState({message: {}});\n        }\n        break;\n      case \"CLEAR_BUNDLE\":\n        if (this.state.bundle.bundle) {\n          this.setState({bundle: {}});\n        }\n        break;\n      case \"CLEAR_ALL\":\n        this.setState({message: {}, bundle: {}});\n    }\n  }\n\n  componentWillMount() {\n    // Add locale data for StartupOverlay because it uses react-intl\n    addLocaleData(global.document.documentElement.lang);\n\n    const endpoint = ASRouterUtils.getPreviewEndpoint();\n    ASRouterUtils.addListener(this.onMessageFromParent);\n\n    // If we are loading about:welcome we want to trigger the onboarding messages\n    if (this.props.document.location.href === \"about:welcome\") {\n      ASRouterUtils.sendMessage({type: \"TRIGGER\", data: {trigger: {id: \"firstRun\"}}});\n    } else {\n      ASRouterUtils.sendMessage({type: \"SNIPPETS_REQUEST\", data: {endpoint}});\n    }\n  }\n\n  componentWillUnmount() {\n    ASRouterUtils.removeListener(this.onMessageFromParent);\n  }\n\n  renderSnippets() {\n    if (this.state.bundle.template === \"onboarding\" ||\n        this.state.message.template === \"fxa_overlay\" ||\n        this.state.message.template === \"return_to_amo_overlay\") {\n      return null;\n    }\n    const SnippetComponent = SnippetsTemplates[this.state.message.template];\n    const {content} = this.state.message;\n\n    return (\n      <ImpressionsWrapper\n        id=\"NEWTAB_FOOTER_BAR\"\n        message={this.state.message}\n        sendImpression={this.sendImpression}\n        shouldSendImpressionOnUpdate={shouldSendImpressionOnUpdate}\n        // This helps with testing\n        document={this.props.document}>\n          <LocalizationProvider messages={generateMessages(content)}>\n            <SnippetComponent\n              {...this.state.message}\n              UISurface=\"NEWTAB_FOOTER_BAR\"\n              onBlock={this.onBlockById(this.state.message.id)}\n              onDismiss={this.onDismissById(this.state.message.id)}\n              onAction={ASRouterUtils.executeAction}\n              sendClick={this.sendClick}\n              sendUserActionTelemetry={this.sendUserActionTelemetry} />\n          </LocalizationProvider>\n      </ImpressionsWrapper>);\n  }\n\n  renderOnboarding() {\n    if (this.state.bundle.template === \"onboarding\") {\n      return (\n        <OnboardingMessage\n          {...this.state.bundle}\n          UISurface=\"NEWTAB_OVERLAY\"\n          onAction={ASRouterUtils.executeAction}\n          onDoneButton={this.dismissBundle(this.state.bundle.bundle)}\n          sendUserActionTelemetry={this.sendUserActionTelemetry} />);\n    }\n    return null;\n  }\n\n  renderFirstRunOverlay() {\n    const {message} = this.state;\n    if (message.template === \"fxa_overlay\") {\n      global.document.body.classList.add(\"fxa\");\n      return (\n        <IntlProvider locale={global.document.documentElement.lang} messages={global.gActivityStreamStrings}>\n          <StartupOverlay\n            onReady={this.triggerOnboarding}\n            onBlock={this.onDismissById(message.id)}\n            dispatch={this.props.activityStreamStore.dispatch}\n            store={this.props.activityStreamStore} />\n        </IntlProvider>\n      );\n    } else if (message.template === \"return_to_amo_overlay\") {\n      global.document.body.classList.add(\"amo\");\n      return (\n        <LocalizationProvider messages={generateMessages({\"amo_html\": message.content.text})}>\n          <ReturnToAMO\n            {...message}\n            onReady={this.triggerOnboarding}\n            onBlock={this.onDismissById(message.id)}\n            onAction={ASRouterUtils.executeAction} />\n        </LocalizationProvider>\n      );\n    }\n    return null;\n  }\n\n  renderPreviewBanner() {\n    if (this.state.message.provider !== \"preview\") {\n      return null;\n    }\n\n    return (\n      <div className=\"snippets-preview-banner\">\n        <span className=\"icon icon-small-spacer icon-info\" />\n        <span>Preview Purposes Only</span>\n      </div>\n    );\n  }\n\n  render() {\n    const {message, bundle} = this.state;\n    if (!message.id && !bundle.template) { return null; }\n    return (\n      <React.Fragment>\n        {this.renderPreviewBanner()}\n        {this.renderFirstRunOverlay()}\n        {this.renderOnboarding()}\n        {this.renderSnippets()}\n      </React.Fragment>\n    );\n  }\n}\n\nASRouterUISurface.defaultProps = {document: global.document};\n\nexport class ASRouterContent {\n  constructor() {\n    this.initialized = false;\n    this.containerElement = null;\n  }\n\n  _mount() {\n    this.containerElement = global.document.getElementById(ASR_CONTAINER_ID);\n    if (!this.containerElement) {\n      this.containerElement = global.document.createElement(\"div\");\n      this.containerElement.id = ASR_CONTAINER_ID;\n      this.containerElement.style.zIndex = 1;\n      global.document.body.appendChild(this.containerElement);\n    }\n\n    ReactDOM.render(<ASRouterUISurface activityStreamStore={this._activityStreamStore} />, this.containerElement);\n  }\n\n  _unmount() {\n    ReactDOM.unmountComponentAtNode(this.containerElement);\n  }\n\n  init(store) {\n    this._activityStreamStore = store;\n    this._mount();\n    this.initialized = true;\n  }\n\n  uninit() {\n    if (this.initialized) {\n      this._unmount();\n      this.initialized = false;\n    }\n  }\n}\n","module.exports = ReactIntl;","/* eslint-env mozilla/frame-script */\n\nimport {actionCreators as ac, actionTypes as at, actionUtils as au} from \"common/Actions.jsm\";\nimport {applyMiddleware, combineReducers, createStore} from \"redux\";\n\nexport const MERGE_STORE_ACTION = \"NEW_TAB_INITIAL_STATE\";\nexport const OUTGOING_MESSAGE_NAME = \"ActivityStream:ContentToMain\";\nexport const INCOMING_MESSAGE_NAME = \"ActivityStream:MainToContent\";\nexport const EARLY_QUEUED_ACTIONS = [at.SAVE_SESSION_PERF_DATA, at.PAGE_PRERENDERED];\n\n/**\n * A higher-order function which returns a reducer that, on MERGE_STORE action,\n * will return the action.data object merged into the previous state.\n *\n * For all other actions, it merely calls mainReducer.\n *\n * Because we want this to merge the entire state object, it's written as a\n * higher order function which takes the main reducer (itself often a call to\n * combineReducers) as a parameter.\n *\n * @param  {function} mainReducer reducer to call if action != MERGE_STORE_ACTION\n * @return {function}             a reducer that, on MERGE_STORE_ACTION action,\n *                                will return the action.data object merged\n *                                into the previous state, and the result\n *                                of calling mainReducer otherwise.\n */\nfunction mergeStateReducer(mainReducer) {\n  return (prevState, action) => {\n    if (action.type === MERGE_STORE_ACTION) {\n      return {...prevState, ...action.data};\n    }\n\n    return mainReducer(prevState, action);\n  };\n}\n\n/**\n * messageMiddleware - Middleware that looks for SentToMain type actions, and sends them if necessary\n */\nconst messageMiddleware = store => next => action => {\n  const skipLocal = action.meta && action.meta.skipLocal;\n  if (au.isSendToMain(action)) {\n    RPMSendAsyncMessage(OUTGOING_MESSAGE_NAME, action);\n  }\n  if (!skipLocal) {\n    next(action);\n  }\n};\n\nexport const rehydrationMiddleware = store => next => action => {\n  if (store._didRehydrate) {\n    return next(action);\n  }\n\n  const isMergeStoreAction = action.type === MERGE_STORE_ACTION;\n  const isRehydrationRequest = action.type === at.NEW_TAB_STATE_REQUEST;\n\n  if (isRehydrationRequest) {\n    store._didRequestInitialState = true;\n    return next(action);\n  }\n\n  if (isMergeStoreAction) {\n    store._didRehydrate = true;\n    return next(action);\n  }\n\n  // If init happened after our request was made, we need to re-request\n  if (store._didRequestInitialState && action.type === at.INIT) {\n    return next(ac.AlsoToMain({type: at.NEW_TAB_STATE_REQUEST}));\n  }\n\n  if (au.isBroadcastToContent(action) || au.isSendToOneContent(action) || au.isSendToPreloaded(action)) {\n    // Note that actions received before didRehydrate will not be dispatched\n    // because this could negatively affect preloading and the the state\n    // will be replaced by rehydration anyway.\n    return null;\n  }\n\n  return next(action);\n};\n\n/**\n * This middleware queues up all the EARLY_QUEUED_ACTIONS until it receives\n * the first action from main. This is useful for those actions for main which\n * require higher reliability, i.e. the action will not be lost in the case\n * that it gets sent before the main is ready to receive it. Conversely, any\n * actions allowed early are accepted to be ignorable or re-sendable.\n */\nexport const queueEarlyMessageMiddleware = store => next => action => {\n  if (store._receivedFromMain) {\n    next(action);\n  } else if (au.isFromMain(action)) {\n    next(action);\n    store._receivedFromMain = true;\n    // Sending out all the early actions as main is ready now\n    if (store._earlyActionQueue) {\n      store._earlyActionQueue.forEach(next);\n      store._earlyActionQueue = [];\n    }\n  } else if (EARLY_QUEUED_ACTIONS.includes(action.type)) {\n    store._earlyActionQueue = store._earlyActionQueue || [];\n    store._earlyActionQueue.push(action);\n  } else {\n    // Let any other type of action go through\n    next(action);\n  }\n};\n\n/**\n * initStore - Create a store and listen for incoming actions\n *\n * @param  {object} reducers An object containing Redux reducers\n * @param  {object} intialState (optional) The initial state of the store, if desired\n * @return {object}          A redux store\n */\nexport function initStore(reducers, initialState) {\n  const store = createStore(\n    mergeStateReducer(combineReducers(reducers)),\n    initialState,\n    global.RPMAddMessageListener && applyMiddleware(rehydrationMiddleware, queueEarlyMessageMiddleware, messageMiddleware)\n  );\n\n  store._didRehydrate = false;\n  store._didRequestInitialState = false;\n\n  if (global.RPMAddMessageListener) {\n    global.RPMAddMessageListener(INCOMING_MESSAGE_NAME, msg => {\n      try {\n        store.dispatch(msg.data);\n      } catch (ex) {\n        console.error(\"Content msg:\", msg, \"Dispatch error: \", ex); // eslint-disable-line no-console\n        dump(`Content msg: ${JSON.stringify(msg)}\\nDispatch error: ${ex}\\n${ex.stack}`);\n      }\n    });\n  }\n\n  return store;\n}\n","module.exports = Redux;","import {MessageContext} from \"fluent\";\n\n/**\n * Properties that allow rich text MUST be added to this list.\n *   key: the localization_id that should be used\n *   value: a property or array of properties on the message.content object\n */\nconst RICH_TEXT_CONFIG = {\n  \"text\": [\"text\", \"scene1_text\"],\n  \"success_text\": \"success_text\",\n  \"error_text\": \"error_text\",\n  \"scene2_text\": \"scene2_text\",\n  \"amo_html\": \"amo_html\",\n  \"privacy_html\": \"scene2_privacy_html\",\n  \"disclaimer_html\": \"scene2_disclaimer_html\",\n};\n\nexport const RICH_TEXT_KEYS = Object.keys(RICH_TEXT_CONFIG);\n\n/**\n * Generates an array of messages suitable for fluent's localization provider\n * including all needed strings for rich text.\n * @param {object} content A .content object from an ASR message (i.e. message.content)\n * @returns {MessageContext[]} A array containing the fluent message context\n */\nexport function generateMessages(content) {\n  const cx = new MessageContext(\"en-US\");\n\n  RICH_TEXT_KEYS.forEach(key => {\n    const attrs = RICH_TEXT_CONFIG[key];\n    const attrsToTry = Array.isArray(attrs) ? [...attrs] : [attrs];\n    let string = \"\";\n    while (!string && attrsToTry.length) {\n      const attr = attrsToTry.pop();\n      string = content[attr];\n    }\n    cx.addMessages(`${key} = ${string}`);\n  });\n  return [cx];\n}\n","import React from \"react\";\n\nexport const VISIBLE = \"visible\";\nexport const VISIBILITY_CHANGE_EVENT = \"visibilitychange\";\n\n/**\n * Component wrapper used to send telemetry pings on every impression.\n */\nexport class ImpressionsWrapper extends React.PureComponent {\n  // This sends an event when a user sees a set of new content. If content\n  // changes while the page is hidden (i.e. preloaded or on a hidden tab),\n  // only send the event if the page becomes visible again.\n  sendImpressionOrAddListener() {\n    if (this.props.document.visibilityState === VISIBLE) {\n      this.props.sendImpression({id: this.props.id});\n    } else {\n      // We should only ever send the latest impression stats ping, so remove any\n      // older listeners.\n      if (this._onVisibilityChange) {\n        this.props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n      }\n\n      // When the page becomes visible, send the impression stats ping if the section isn't collapsed.\n      this._onVisibilityChange = () => {\n        if (this.props.document.visibilityState === VISIBLE) {\n          this.props.sendImpression({id: this.props.id});\n          this.props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n        }\n      };\n      this.props.document.addEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n    }\n  }\n\n  componentWillUnmount() {\n    if (this._onVisibilityChange) {\n      this.props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n    }\n  }\n\n  componentDidMount() {\n    if (this.props.sendOnMount) {\n      this.sendImpressionOrAddListener();\n    }\n  }\n\n  componentDidUpdate(prevProps) {\n    if (this.props.shouldSendImpressionOnUpdate(this.props, prevProps)) {\n      this.sendImpressionOrAddListener();\n    }\n  }\n\n  render() {\n    return this.props.children;\n  }\n}\n\nImpressionsWrapper.defaultProps = {\n  document: global.document,\n  sendOnMount: true,\n};\n","module.exports = React;","module.exports = PropTypes;","import {ModalOverlay} from \"../../components/ModalOverlay/ModalOverlay\";\nimport React from \"react\";\n\nclass OnboardingCard extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onClick = this.onClick.bind(this);\n  }\n\n  onClick() {\n    const {props} = this;\n    const ping = {\n      event: \"CLICK_BUTTON\",\n      message_id: props.id,\n      id: props.UISurface,\n    };\n    props.sendUserActionTelemetry(ping);\n    props.onAction(props.content.primary_button.action);\n  }\n\n  render() {\n    const {content} = this.props;\n    return (\n      <div className=\"onboardingMessage\">\n        <div className={`onboardingMessageImage ${content.icon}`} />\n        <div className=\"onboardingContent\">\n          <span>\n            <h3> {content.title} </h3>\n            <p> {content.text} </p>\n          </span>\n          <span>\n            <button tabIndex=\"1\" className=\"button onboardingButton\" onClick={this.onClick}> {content.primary_button.label} </button>\n          </span>\n        </div>\n      </div>\n    );\n  }\n}\n\nexport class OnboardingMessage extends React.PureComponent {\n  render() {\n    const {props} = this;\n    const {button_label, header} = props.extraTemplateStrings;\n    return (\n      <ModalOverlay {...props} button_label={button_label} title={header}>\n        <div className=\"onboardingMessageContainer\">\n          {props.bundle.map(message => (\n            <OnboardingCard key={message.id}\n              sendUserActionTelemetry={props.sendUserActionTelemetry}\n              onAction={props.onAction}\n              UISurface={props.UISurface}\n              {...message} />\n          ))}\n        </div>\n      </ModalOverlay>\n    );\n  }\n}\n","import React from \"react\";\n\nexport class ModalOverlay extends React.PureComponent {\n  componentWillMount() {\n    this.setState({active: true});\n    document.body.classList.add(\"modal-open\");\n  }\n\n  componentWillUnmount() {\n    document.body.classList.remove(\"modal-open\");\n    this.setState({active: false});\n  }\n\n  render() {\n    const {active} = this.state;\n    const {title, button_label} = this.props;\n    return (\n      <div>\n        <div className={`modalOverlayOuter ${active ? \"active\" : \"\"}`} />\n        <div className={`modalOverlayInner ${active ? \"active\" : \"\"}`}>\n          <h2> {title} </h2>\n          {this.props.children}\n          <div className=\"footer\">\n            <button tabIndex=\"2\" onClick={this.props.onDoneButton} className=\"button primary modalButton\"> {button_label} </button>\n          </div>\n        </div>\n      </div>\n    );\n  }\n}\n","module.exports = ReactDOM;","import React from \"react\";\nimport {RichText} from \"../../components/RichText/RichText\";\n\nexport class ReturnToAMO extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onClickAddExtension = this.onClickAddExtension.bind(this);\n    this.onBlockButton = this.onBlockButton.bind(this);\n  }\n\n  componentDidMount() {\n    this.props.onReady();\n  }\n\n  onClickAddExtension() {\n    this.props.onAction(this.props.content.primary_button.action);\n  }\n\n  onBlockButton() {\n    this.props.onBlock();\n    document.body.classList.remove(\"welcome\", \"hide-main\", \"amo\");\n  }\n\n  renderText() {\n    const customElement = <img src={this.props.content.addon_icon} width=\"20px\" height=\"20px\" />;\n    return (<RichText\n      customElements={{icon: customElement}}\n      amo_html={this.props.content.text}\n      localization_id=\"amo_html\" />);\n  }\n\n  render() {\n    const {content} = this.props;\n    return (\n      <div className=\"ReturnToAMOOverlay\" >\n        <div>\n          <h2> {content.header} </h2>\n          <div className=\"ReturnToAMOContainer\" >\n            <div className=\"ReturnToAMOAddonContents\">\n              <p> {content.title} </p>\n              <div className=\"ReturnToAMOText\">\n                <span> {this.renderText()} </span>\n              </div>\n              <button onClick={this.onClickAddExtension} className=\"puffy blue ReturnToAMOAddExtension\"> <span className=\"icon icon-add\" /> {content.primary_button.label} </button>\n            </div>\n            <div className=\"ReturnToAMOIcon\" />\n          </div>\n          <button onClick={this.onBlockButton} className=\"default grey ReturnToAMOGetStarted\"> {content.secondary_button.label} </button>\n        </div>\n      </div>);\n  }\n}\n","import {Localized} from \"fluent-react\";\nimport React from \"react\";\nimport {RICH_TEXT_KEYS} from \"../../rich-text-strings\";\nimport {safeURI} from \"../../template-utils\";\n\n// Elements allowed in snippet content\nconst ALLOWED_TAGS = {\n  b: <b />,\n  i: <i />,\n  u: <u />,\n  strong: <strong />,\n  em: <em />,\n  br: <br />,\n};\n\n/**\n * Transform an object (tag name: {url}) into (tag name: anchor) where the url\n * is used as href, in order to render links inside a Fluent.Localized component.\n */\nexport function convertLinks(links, sendClick, doNotAutoBlock, openNewWindow = false) {\n  if (links) {\n    return Object.keys(links).reduce((acc, linkTag) => {\n      const {action} = links[linkTag];\n      // Setting the value to false will not include the attribute in the anchor\n      const url = action ? false : safeURI(links[linkTag].url);\n\n      acc[linkTag] = (<a href={url}\n        target={openNewWindow ? \"_blank\" : \"\"}\n        data-metric={links[linkTag].metric}\n        data-action={action}\n        data-args={links[linkTag].args}\n        data-do_not_autoblock={doNotAutoBlock}\n        onClick={sendClick} />);\n      return acc;\n    }, {});\n  }\n\n  return null;\n}\n\n/**\n * Message wrapper used to sanitize markup and render HTML.\n */\nexport function RichText(props) {\n  if (!RICH_TEXT_KEYS.includes(props.localization_id)) {\n    throw new Error(`ASRouter: ${props.localization_id} is not a valid rich text property. If you want it to be processed, you need to add it to asrouter/rich-text-strings.js`);\n  }\n  return (\n    <Localized id={props.localization_id} {...ALLOWED_TAGS} {...props.customElements} {...convertLinks(props.links, props.sendClick, props.doNotAutoBlock, props.openNewWindow)}>\n      <span>{props.text}</span>\n    </Localized>\n  );\n}\n","export function safeURI(url) {\n  if (!url) {\n    return \"\";\n  }\n  const {protocol} = new URL(url);\n  const isAllowed = [\n    \"http:\",\n    \"https:\",\n    \"data:\",\n    \"resource:\",\n    \"chrome:\",\n  ].includes(protocol);\n  if (!isAllowed) {\n    console.warn(`The protocol ${protocol} is not allowed for template URLs.`); // eslint-disable-line no-console\n  }\n  return isAllowed ? url : \"\";\n}\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {FormattedMessage, injectIntl} from \"react-intl\";\nimport {connect} from \"react-redux\";\nimport React from \"react\";\n\nexport class _StartupOverlay extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onInputChange = this.onInputChange.bind(this);\n    this.onSubmit = this.onSubmit.bind(this);\n    this.clickSkip = this.clickSkip.bind(this);\n    this.initScene = this.initScene.bind(this);\n    this.removeOverlay = this.removeOverlay.bind(this);\n    this.onInputInvalid = this.onInputInvalid.bind(this);\n\n    this.state = {\n      emailInput: \"\",\n      overlayRemoved: false,\n      flowId: \"\",\n      flowBeginTime: 0,\n    };\n    this.didFetch = false;\n  }\n\n  async componentWillUpdate() {\n    if (this.props.fxa_endpoint && !this.didFetch) {\n      try {\n        this.didFetch = true;\n        const fxaParams = \"entrypoint=activity-stream-firstrun&utm_source=activity-stream&utm_campaign=firstrun&form_type=email\";\n        const response = await fetch(`${this.props.fxa_endpoint}/metrics-flow?${fxaParams}`, {credentials: \"omit\"});\n        if (response.status === 200) {\n          const {flowId, flowBeginTime} = await response.json();\n          this.setState({flowId, flowBeginTime});\n        } else {\n          this.props.dispatch(ac.OnlyToMain({type: at.TELEMETRY_UNDESIRED_EVENT, data: {event: \"FXA_METRICS_FETCH_ERROR\", value: response.status}}));\n        }\n      } catch (error) {\n        this.props.dispatch(ac.OnlyToMain({type: at.TELEMETRY_UNDESIRED_EVENT, data: {event: \"FXA_METRICS_ERROR\"}}));\n      }\n    }\n  }\n\n  componentDidMount() {\n    this.initScene();\n  }\n\n  initScene() {\n    // Timeout to allow the scene to render once before attaching the attribute\n    // to trigger the animation.\n    setTimeout(() => {\n      this.setState({show: true});\n      this.props.onReady();\n    }, 10);\n  }\n\n  removeOverlay() {\n    window.removeEventListener(\"visibilitychange\", this.removeOverlay);\n    document.body.classList.remove(\"hide-main\", \"fxa\");\n    this.setState({show: false});\n    this.props.onBlock();\n    setTimeout(() => {\n      // Allow scrolling and fully remove overlay after animation finishes.\n      document.body.classList.remove(\"welcome\");\n      this.setState({overlayRemoved: true});\n    }, 400);\n  }\n\n  onInputChange(e) {\n    let error = e.target.previousSibling;\n    this.setState({emailInput: e.target.value});\n    error.classList.remove(\"active\");\n    e.target.classList.remove(\"invalid\");\n  }\n\n  onSubmit() {\n    this.props.dispatch(ac.UserEvent({event: \"SUBMIT_EMAIL\", ...this._getFormInfo()}));\n\n    window.addEventListener(\"visibilitychange\", this.removeOverlay);\n  }\n\n  clickSkip() {\n    this.props.dispatch(ac.UserEvent({event: \"SKIPPED_SIGNIN\", ...this._getFormInfo()}));\n    this.removeOverlay();\n  }\n\n  /**\n   * Report to telemetry additional information about the form submission.\n   */\n  _getFormInfo() {\n    const value = {has_flow_params: this.state.flowId.length > 0};\n    return {value};\n  }\n\n  onInputInvalid(e) {\n    let error = e.target.previousSibling;\n    error.classList.add(\"active\");\n    e.target.classList.add(\"invalid\");\n    e.preventDefault(); // Override built-in form validation popup\n    e.target.focus();\n  }\n\n  render() {\n    // When skipping the onboarding tour we show AS but we are still on\n    // about:welcome, prop.isFirstrun is true and StartupOverlay is rendered\n    if (this.state.overlayRemoved) {\n      return null;\n    }\n\n    let termsLink = (<a href={`${this.props.fxa_endpoint}/legal/terms`} target=\"_blank\" rel=\"noopener noreferrer\"><FormattedMessage id=\"firstrun_terms_of_service\" /></a>);\n    let privacyLink = (<a href={`${this.props.fxa_endpoint}/legal/privacy`} target=\"_blank\" rel=\"noopener noreferrer\"><FormattedMessage id=\"firstrun_privacy_notice\" /></a>);\n\n    return (\n      <div className={`overlay-wrapper ${this.state.show ? \"show\" : \"\"}`}>\n        <div className=\"background\" />\n        <div className=\"firstrun-scene\">\n          <div className=\"fxaccounts-container\">\n            <div className=\"firstrun-left-divider\">\n              <h1 className=\"firstrun-title\"><FormattedMessage id=\"firstrun_title\" /></h1>\n              <p className=\"firstrun-content\"><FormattedMessage id=\"firstrun_content\" /></p>\n              <a className=\"firstrun-link\" href=\"https://www.mozilla.org/firefox/features/sync/\" target=\"_blank\" rel=\"noopener noreferrer\"><FormattedMessage id=\"firstrun_learn_more_link\" /></a>\n            </div>\n            <div className=\"firstrun-sign-in\">\n              <p className=\"form-header\"><FormattedMessage id=\"firstrun_form_header\" /><span className=\"sub-header\"><FormattedMessage id=\"firstrun_form_sub_header\" /></span></p>\n              <form method=\"get\" action={this.props.fxa_endpoint} target=\"_blank\" rel=\"noopener noreferrer\" onSubmit={this.onSubmit}>\n                <input name=\"service\" type=\"hidden\" value=\"sync\" />\n                <input name=\"action\" type=\"hidden\" value=\"email\" />\n                <input name=\"context\" type=\"hidden\" value=\"fx_desktop_v3\" />\n                <input name=\"entrypoint\" type=\"hidden\" value=\"activity-stream-firstrun\" />\n                <input name=\"utm_source\" type=\"hidden\" value=\"activity-stream\" />\n                <input name=\"utm_campaign\" type=\"hidden\" value=\"firstrun\" />\n                <input name=\"flow_id\" type=\"hidden\" value={this.state.flowId} />\n                <input name=\"flow_begin_time\" type=\"hidden\" value={this.state.flowBeginTime} />\n                <span className=\"error\">{this.props.intl.formatMessage({id: \"firstrun_invalid_input\"})}</span>\n                <input className=\"email-input\" name=\"email\" type=\"email\" required=\"true\" onInvalid={this.onInputInvalid} placeholder={this.props.intl.formatMessage({id: \"firstrun_email_input_placeholder\"})} onChange={this.onInputChange} />\n                <div className=\"extra-links\">\n                  <FormattedMessage\n                    id=\"firstrun_extra_legal_links\"\n                    values={{\n                      terms: termsLink,\n                      privacy: privacyLink,\n                    }} />\n                </div>\n                <button className=\"continue-button\" type=\"submit\"><FormattedMessage id=\"firstrun_continue_to_login\" /></button>\n              </form>\n              <button className=\"skip-button\" disabled={!!this.state.emailInput} onClick={this.clickSkip}><FormattedMessage id=\"firstrun_skip_login\" /></button>\n            </div>\n          </div>\n        </div>\n      </div>\n    );\n  }\n}\n\nconst getState = state => ({fxa_endpoint: state.Prefs.values.fxa_endpoint});\nexport const StartupOverlay = connect(getState)(injectIntl(_StartupOverlay));\n","module.exports = ReactRedux;","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {addLocaleData, injectIntl, IntlProvider} from \"react-intl\";\nimport {ASRouterAdmin} from \"content-src/components/ASRouterAdmin/ASRouterAdmin\";\nimport {ConfirmDialog} from \"content-src/components/ConfirmDialog/ConfirmDialog\";\nimport {connect} from \"react-redux\";\nimport {DiscoveryStreamBase} from \"content-src/components/DiscoveryStreamBase/DiscoveryStreamBase\";\nimport {ErrorBoundary} from \"content-src/components/ErrorBoundary/ErrorBoundary\";\nimport {ManualMigration} from \"content-src/components/ManualMigration/ManualMigration\";\nimport {PrerenderData} from \"common/PrerenderData.jsm\";\nimport React from \"react\";\nimport {Search} from \"content-src/components/Search/Search\";\nimport {Sections} from \"content-src/components/Sections/Sections\";\n\nlet didLogDevtoolsHelpText = false;\n\nconst PrefsButton = injectIntl(props => (\n  <div className=\"prefs-button\">\n    <button className=\"icon icon-settings\" onClick={props.onClick} title={props.intl.formatMessage({id: \"settings_pane_button_label\"})} />\n  </div>\n));\n\n// Add the locale data for pluralization and relative-time formatting for now,\n// this just uses english locale data. We can make this more sophisticated if\n// more features are needed.\nfunction addLocaleDataForReactIntl(locale) {\n  addLocaleData([{locale, parentLocale: \"en\"}]);\n}\n\n// Returns a function will not be continuously triggered when called. The\n// function will be triggered if called again after `wait` milliseconds.\nfunction debounce(func, wait) {\n  let timer;\n  return (...args) => {\n    if (timer) { return; }\n\n    let wakeUp = () => { timer = null; };\n\n    timer = setTimeout(wakeUp, wait);\n    func.apply(this, args);\n  };\n}\n\nexport class _Base extends React.PureComponent {\n  componentWillMount() {\n    const {locale} = this.props;\n    addLocaleDataForReactIntl(locale);\n    if (this.props.isFirstrun) {\n      global.document.body.classList.add(\"welcome\", \"hide-main\");\n    }\n  }\n\n  componentDidMount() {\n    // Request state AFTER the first render to ensure we don't cause the\n    // prerendered DOM to be unmounted. Otherwise, NEW_TAB_STATE_REQUEST is\n    // dispatched right after the store is ready.\n    if (this.props.isPrerendered) {\n      this.props.dispatch(ac.AlsoToMain({type: at.NEW_TAB_STATE_REQUEST}));\n      this.props.dispatch(ac.AlsoToMain({type: at.PAGE_PRERENDERED}));\n    }\n  }\n\n  componentWillUnmount() {\n    this.updateTheme();\n  }\n\n  componentWillUpdate() {\n    this.updateTheme();\n  }\n\n  updateTheme() {\n    const bodyClassName = [\n      \"activity-stream\",\n      // If we skipped the about:welcome overlay and removed the CSS classes\n      // we don't want to add them back to the Activity Stream view\n      document.body.classList.contains(\"welcome\") ? \"welcome\" : \"\",\n      document.body.classList.contains(\"hide-main\") ? \"hide-main\" : \"\",\n    ].filter(v => v).join(\" \");\n    global.document.body.className = bodyClassName;\n  }\n\n  render() {\n    const {props} = this;\n    const {App, locale, strings} = props;\n    const {initialized} = App;\n\n    const prefs = props.Prefs.values;\n    if (prefs[\"asrouter.devtoolsEnabled\"]) {\n      if (window.location.hash.startsWith(\"#asrouter\") ||\n          window.location.hash.startsWith(\"#devtools\")) {\n        return (<ASRouterAdmin />);\n      } else if (!didLogDevtoolsHelpText) {\n        console.log(\"Activity Stream devtools enabled. To access visit %cabout:newtab#devtools\", \"font-weight: bold\"); // eslint-disable-line no-console\n        didLogDevtoolsHelpText = true;\n      }\n    }\n\n    if (!props.isPrerendered && !initialized) {\n      return null;\n    }\n\n    return (<IntlProvider locale={locale} messages={strings}>\n        <ErrorBoundary className=\"base-content-fallback\">\n          <BaseContent {...this.props} />\n        </ErrorBoundary>\n      </IntlProvider>);\n  }\n}\n\nexport class BaseContent extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.openPreferences = this.openPreferences.bind(this);\n    this.onWindowScroll = debounce(this.onWindowScroll.bind(this), 5);\n    this.state = {fixedSearch: false};\n  }\n\n  componentDidMount() {\n    global.addEventListener(\"scroll\", this.onWindowScroll);\n  }\n\n  componentWillUnmount() {\n    global.removeEventListener(\"scroll\", this.onWindowScroll);\n  }\n\n  onWindowScroll() {\n    const SCROLL_THRESHOLD = 34;\n    if (global.scrollY > SCROLL_THRESHOLD && !this.state.fixedSearch) {\n      this.setState({fixedSearch: true});\n    } else if (global.scrollY <= SCROLL_THRESHOLD && this.state.fixedSearch) {\n      this.setState({fixedSearch: false});\n    }\n  }\n\n  openPreferences() {\n    this.props.dispatch(ac.OnlyToMain({type: at.SETTINGS_OPEN}));\n    this.props.dispatch(ac.UserEvent({event: \"OPEN_NEWTAB_PREFS\"}));\n  }\n\n  disableDarkTheme() {\n    // Dark themes are not supported in discovery stream view\n    // Add force-light-theme class to body tag to disable dark mode. See Bug 1519764\n    const bodyClassNames = global.document.body.classList;\n    if (!bodyClassNames.contains(\"force-light-theme\")) {\n      bodyClassNames.add(\"force-light-theme\");\n    }\n  }\n\n  render() {\n    const {props} = this;\n    const {App} = props;\n    const {initialized} = App;\n    const prefs = props.Prefs.values;\n\n    const shouldBeFixedToTop = PrerenderData.arePrefsValid(name => prefs[name]);\n    const noSectionsEnabled = !prefs[\"feeds.topsites\"] && props.Sections.filter(section => section.enabled).length === 0;\n    const isDiscoveryStream = props.DiscoveryStream.config && props.DiscoveryStream.config.enabled;\n    const searchHandoffEnabled = prefs[\"improvesearch.handoffToAwesomebar\"];\n\n    if (isDiscoveryStream) {\n      this.disableDarkTheme();\n    }\n\n    const outerClassName = [\n      \"outer-wrapper\",\n      shouldBeFixedToTop && \"fixed-to-top\",\n      prefs.showSearch && this.state.fixedSearch && !noSectionsEnabled && \"fixed-search\",\n      prefs.showSearch && noSectionsEnabled && \"only-search\",\n    ].filter(v => v).join(\" \");\n\n    return (\n      <div>\n        <div className={outerClassName}>\n          <main>\n            {prefs.showSearch &&\n              <div className=\"non-collapsible-section\">\n                <ErrorBoundary>\n                  <Search showLogo={noSectionsEnabled} handoffEnabled={searchHandoffEnabled} {...props.Search} />\n                </ErrorBoundary>\n              </div>\n            }\n            <div className={`body-wrapper${(initialized ? \" on\" : \"\")}`}>\n              {!isDiscoveryStream && !prefs.migrationExpired &&\n                <div className=\"non-collapsible-section\">\n                  <ManualMigration />\n                </div>\n                }\n              {isDiscoveryStream ? (\n                <ErrorBoundary className=\"borderless-error\">\n                  <DiscoveryStreamBase />\n                </ErrorBoundary>) : <Sections />}\n              <PrefsButton onClick={this.openPreferences} />\n            </div>\n            <ConfirmDialog />\n          </main>\n        </div>\n      </div>);\n  }\n}\n\nexport const Base = connect(state => ({\n  App: state.App,\n  Prefs: state.Prefs,\n  Sections: state.Sections,\n  DiscoveryStream: state.DiscoveryStream,\n  Search: state.Search,\n}))(_Base);\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {ASRouterUtils} from \"../../asrouter/asrouter-content\";\nimport {connect} from \"react-redux\";\nimport {ModalOverlay} from \"../../asrouter/components/ModalOverlay/ModalOverlay\";\nimport React from \"react\";\nimport {SimpleHashRouter} from \"./SimpleHashRouter\";\n\nconst Row = props => (<tr className=\"message-item\" {...props}>{props.children}</tr>);\n\nfunction relativeTime(timestamp) {\n  if (!timestamp) {\n    return \"\";\n  }\n  const seconds = Math.floor((Date.now() - timestamp) / 1000);\n  const minutes = Math.floor((Date.now() - timestamp) / 60000);\n  if (seconds < 2) {\n    return \"just now\";\n  } else if (seconds < 60) {\n    return `${seconds} seconds ago`;\n  } else if (minutes === 1) {\n    return \"1 minute ago\";\n  } else if (minutes < 600) {\n    return `${minutes} minutes ago`;\n  }\n  return new Date(timestamp).toLocaleString();\n}\n\nclass DiscoveryStreamAdmin extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onEnableToggle = this.onEnableToggle.bind(this);\n  }\n\n  setConfigValue(name, value) {\n    this.props.dispatch(ac.OnlyToMain({type: at.DISCOVERY_STREAM_CONFIG_SET_VALUE, data: {name, value}}));\n  }\n\n  onEnableToggle(event) {\n    this.setConfigValue(\"enabled\", event.target.checked);\n  }\n\n  renderComponent(width, component) {\n    return (\n      <table><tbody>\n        <Row>\n          <td className=\"min\">Type</td>\n          <td>{component.type}</td>\n        </Row>\n        <Row>\n          <td className=\"min\">Width</td>\n          <td>{width}</td>\n        </Row>\n        {component.feed && this.renderFeed(component.feed)}\n      </tbody></table>\n    );\n  }\n\n  renderFeed(feed) {\n    const {feeds} = this.props.state;\n    if (!feed.url) {\n      return null;\n    }\n    return (\n      <React.Fragment>\n        <Row>\n          <td className=\"min\">Feed url</td>\n          <td>{feed.url}</td>\n        </Row>\n        <Row>\n          <td className=\"min\">Data last fetched</td>\n          <td>{relativeTime(feeds[feed.url] ? feeds[feed.url].lastUpdated : null) || \"(no data)\"}</td>\n        </Row>\n      </React.Fragment>\n    );\n  }\n\n  render() {\n    const {config, lastUpdated, layout} = this.props.state;\n    return (<div>\n      <div className=\"dsEnabled\"><input type=\"checkbox\" checked={config.enabled} onChange={this.onEnableToggle} /> enabled</div>\n\n      <table style={config.enabled ? null : {opacity: 0.5}}><tbody>\n        <Row><td className=\"min\">Data last fetched</td><td>{relativeTime(lastUpdated) || \"(no data)\"}</td></Row>\n        <Row><td className=\"min\">Endpoint</td><td>{config.layout_endpoint || \"(empty)\"}</td></Row>\n      </tbody></table>\n\n      <h3>Layout</h3>\n\n      {layout.map((row, rowIndex) => (\n        <div key={`row-${rowIndex}`}>\n          {row.components.map((component, componentIndex) => (\n            <div key={`component-${componentIndex}`} className=\"ds-component\">\n              {this.renderComponent(row.width, component)}\n            </div>\n          ))}\n        </div>\n      ))}\n    </div>);\n  }\n}\n\nexport class ASRouterAdminInner extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onMessage = this.onMessage.bind(this);\n    this.handleEnabledToggle = this.handleEnabledToggle.bind(this);\n    this.handleUserPrefToggle = this.handleUserPrefToggle.bind(this);\n    this.onChangeMessageFilter = this.onChangeMessageFilter.bind(this);\n    this.findOtherBundledMessagesOfSameTemplate = this.findOtherBundledMessagesOfSameTemplate.bind(this);\n    this.handleExpressionEval = this.handleExpressionEval.bind(this);\n    this.onChangeTargetingParameters = this.onChangeTargetingParameters.bind(this);\n    this.onChangeAttributionParameters = this.onChangeAttributionParameters.bind(this);\n    this.setAttribution = this.setAttribution.bind(this);\n    this.onCopyTargetingParams = this.onCopyTargetingParams.bind(this);\n    this.onPasteTargetingParams = this.onPasteTargetingParams.bind(this);\n    this.onNewTargetingParams = this.onNewTargetingParams.bind(this);\n    this.state = {\n      messageFilter: \"all\",\n      evaluationStatus: {},\n      stringTargetingParameters: null,\n      newStringTargetingParameters: null,\n      copiedToClipboard: false,\n      pasteFromClipboard: false,\n      attributionParameters: {\n        source: \"addons.mozilla.org\",\n        campaign: \"non-fx-button\",\n        content: \"iridium@particlecore.github.io\",\n      },\n    };\n  }\n\n  onMessage({data: action}) {\n    if (action.type === \"ADMIN_SET_STATE\") {\n      this.setState(action.data);\n      if (!this.state.stringTargetingParameters) {\n        const stringTargetingParameters = {};\n        for (const param of Object.keys(action.data.targetingParameters)) {\n          stringTargetingParameters[param] = JSON.stringify(action.data.targetingParameters[param], null, 2);\n        }\n        this.setState({stringTargetingParameters});\n      }\n    }\n  }\n\n  componentWillMount() {\n    const endpoint = ASRouterUtils.getPreviewEndpoint();\n    ASRouterUtils.sendMessage({type: \"ADMIN_CONNECT_STATE\", data: {endpoint}});\n    ASRouterUtils.addListener(this.onMessage);\n  }\n\n  componentWillUnmount() {\n    ASRouterUtils.removeListener(this.onMessage);\n  }\n\n  findOtherBundledMessagesOfSameTemplate(template) {\n    return this.state.messages.filter(msg => msg.template === template && msg.bundled);\n  }\n\n  handleBlock(msg) {\n    if (msg.bundled) {\n      // If we are blocking a message that belongs to a bundle, block all other messages that are bundled of that same template\n      let bundle = this.findOtherBundledMessagesOfSameTemplate(msg.template);\n      return () => ASRouterUtils.blockBundle(bundle);\n    }\n    return () => ASRouterUtils.blockById(msg.id);\n  }\n\n  handleUnblock(msg) {\n    if (msg.bundled) {\n      // If we are unblocking a message that belongs to a bundle, unblock all other messages that are bundled of that same template\n      let bundle = this.findOtherBundledMessagesOfSameTemplate(msg.template);\n      return () => ASRouterUtils.unblockBundle(bundle);\n    }\n    return () => ASRouterUtils.unblockById(msg.id);\n  }\n\n  handleOverride(id) {\n    return () => ASRouterUtils.overrideMessage(id);\n  }\n\n  expireCache() {\n    ASRouterUtils.sendMessage({type: \"EXPIRE_QUERY_CACHE\"});\n  }\n\n  resetPref() {\n    ASRouterUtils.sendMessage({type: \"RESET_PROVIDER_PREF\"});\n  }\n\n  handleExpressionEval() {\n    const context = {};\n    for (const param of Object.keys(this.state.stringTargetingParameters)) {\n      const value = this.state.stringTargetingParameters[param];\n      context[param] = value ? JSON.parse(value) : null;\n    }\n    ASRouterUtils.sendMessage({\n      type: \"EVALUATE_JEXL_EXPRESSION\",\n      data: {\n        expression: this.refs.expressionInput.value,\n        context,\n      },\n    });\n  }\n\n  onChangeTargetingParameters(event) {\n    const {name} = event.target;\n    const {value} = event.target;\n\n    this.setState(({stringTargetingParameters}) => {\n      let targetingParametersError = null;\n      const updatedParameters = {...stringTargetingParameters};\n      updatedParameters[name] = value;\n      try {\n        JSON.parse(value);\n      } catch (e) {\n        console.log(`Error parsing value of parameter ${name}`); // eslint-disable-line no-console\n        targetingParametersError = {id: name};\n      }\n\n      return {\n        copiedToClipboard: false,\n        evaluationStatus: {},\n        stringTargetingParameters: updatedParameters,\n        targetingParametersError,\n      };\n    });\n  }\n\n  handleEnabledToggle(event) {\n    const provider = this.state.providerPrefs.find(p => p.id === event.target.dataset.provider);\n    const userPrefInfo = this.state.userPrefs;\n\n    const isUserEnabled = provider.id in userPrefInfo ? userPrefInfo[provider.id] : true;\n    const isSystemEnabled = provider.enabled;\n    const isEnabling = event.target.checked;\n\n    if (isEnabling) {\n      if (!isUserEnabled) {\n        ASRouterUtils.sendMessage({type: \"SET_PROVIDER_USER_PREF\", data: {id: provider.id, value: true}});\n      }\n      if (!isSystemEnabled) {\n        ASRouterUtils.sendMessage({type: \"ENABLE_PROVIDER\", data: provider.id});\n      }\n    } else {\n      ASRouterUtils.sendMessage({type: \"DISABLE_PROVIDER\", data: provider.id});\n    }\n\n    this.setState({messageFilter: \"all\"});\n  }\n\n  handleUserPrefToggle(event) {\n    const action = {type: \"SET_PROVIDER_USER_PREF\", data: {id: event.target.dataset.provider, value: event.target.checked}};\n    ASRouterUtils.sendMessage(action);\n    this.setState({messageFilter: \"all\"});\n  }\n\n  onChangeMessageFilter(event) {\n    this.setState({messageFilter: event.target.value});\n  }\n\n  // Simulate a copy event that sets to clipboard all targeting paramters and values\n  onCopyTargetingParams(event) {\n    const stringTargetingParameters = {...this.state.stringTargetingParameters};\n    for (const key of Object.keys(stringTargetingParameters)) {\n      // If the value is not set the parameter will be lost when we stringify\n      if (stringTargetingParameters[key] === undefined) {\n        stringTargetingParameters[key] = null;\n      }\n    }\n    const setClipboardData = e => {\n      e.preventDefault();\n      e.clipboardData.setData(\"text\", JSON.stringify(stringTargetingParameters, null, 2));\n      document.removeEventListener(\"copy\", setClipboardData);\n      this.setState({copiedToClipboard: true});\n    };\n\n    document.addEventListener(\"copy\", setClipboardData);\n\n    document.execCommand(\"copy\");\n  }\n\n  // Copy all clipboard data to targeting parameters\n  onPasteTargetingParams(event) {\n    this.setState(({pasteFromClipboard}) => ({\n      pasteFromClipboard: !pasteFromClipboard,\n      newStringTargetingParameters: \"\",\n    }));\n  }\n\n  onNewTargetingParams(event) {\n    this.setState({newStringTargetingParameters: event.target.value});\n    event.target.classList.remove(\"errorState\");\n    this.refs.targetingParamsEval.innerText = \"\";\n\n    try {\n      const stringTargetingParameters = JSON.parse(event.target.value);\n      this.setState({stringTargetingParameters});\n    } catch (e) {\n      event.target.classList.add(\"errorState\");\n      this.refs.targetingParamsEval.innerText = e.message;\n    }\n  }\n\n  renderMessageItem(msg) {\n    const isCurrent = msg.id === this.state.lastMessageId;\n    const isBlocked = this.state.messageBlockList.includes(msg.id) || this.state.messageBlockList.includes(msg.campaign);\n    const impressions = this.state.messageImpressions[msg.id] ? this.state.messageImpressions[msg.id].length : 0;\n\n    let itemClassName = \"message-item\";\n    if (isCurrent) { itemClassName += \" current\"; }\n    if (isBlocked) { itemClassName += \" blocked\"; }\n\n    return (<tr className={itemClassName} key={msg.id}>\n      <td className=\"message-id\"><span>{msg.id} <br /></span></td>\n      <td>\n        <button className={`button ${(isBlocked ? \"\" : \" primary\")}`} onClick={isBlocked ? this.handleUnblock(msg) : this.handleBlock(msg)}>{isBlocked ? \"Unblock\" : \"Block\"}</button>\n       {isBlocked ? null : <button className=\"button\" onClick={this.handleOverride(msg.id)}>Show</button>}\n       <br />({impressions} impressions)\n      </td>\n      <td className=\"message-summary\">\n        <pre>{JSON.stringify(msg, null, 2)}</pre>\n      </td>\n    </tr>);\n  }\n\n  renderMessages() {\n    if (!this.state.messages) {\n      return null;\n    }\n    const messagesToShow = this.state.messageFilter === \"all\" ? this.state.messages : this.state.messages.filter(message => message.provider === this.state.messageFilter);\n    return (<table><tbody>\n      {messagesToShow.map(msg => this.renderMessageItem(msg))}\n    </tbody></table>);\n  }\n\n  renderMessageFilter() {\n    if (!this.state.providers) {\n      return null;\n    }\n    return (<p>Show messages from <select value={this.state.messageFilter} onChange={this.onChangeMessageFilter}>\n      <option value=\"all\">all providers</option>\n      {this.state.providers.map(provider => (<option key={provider.id} value={provider.id}>{provider.id}</option>))}\n    </select></p>);\n  }\n\n  renderTableHead() {\n    return (<thead>\n      <tr className=\"message-item\">\n        <td className=\"min\" />\n        <td className=\"min\">Provider ID</td>\n        <td>Source</td>\n        <td className=\"min\">Cohort</td>\n        <td className=\"min\">Last Updated</td>\n      </tr>\n    </thead>);\n  }\n\n  renderProviders() {\n    const providersConfig = this.state.providerPrefs;\n    const providerInfo = this.state.providers;\n    const userPrefInfo = this.state.userPrefs;\n\n    return (<table>{this.renderTableHead()}<tbody>\n      {providersConfig.map((provider, i) => {\n        const isTestProvider = provider.id === \"snippets_local_testing\";\n        const info = providerInfo.find(p => p.id === provider.id) || {};\n        const isUserEnabled = provider.id in userPrefInfo ? userPrefInfo[provider.id] : true;\n        const isSystemEnabled = (isTestProvider || provider.enabled);\n\n        let label = \"local\";\n        if (provider.type === \"remote\") {\n          label = (<span>endpoint (<a className=\"providerUrl\" target=\"_blank\" href={info.url} rel=\"noopener noreferrer\">{info.url}</a>)</span>);\n        } else if (provider.type === \"remote-settings\") {\n          label = `remote settings (${provider.bucket})`;\n        }\n\n        let reasonsDisabled = [];\n        if (!isSystemEnabled) {\n          reasonsDisabled.push(\"system pref\");\n        }\n        if (!isUserEnabled) {\n          reasonsDisabled.push(\"user pref\");\n        }\n        if (reasonsDisabled.length) {\n          label = `disabled via ${reasonsDisabled.join(\", \")}`;\n        }\n\n        return (<tr className=\"message-item\" key={i}>\n\n          <td>{isTestProvider ? <input type=\"checkbox\" disabled={true} readOnly={true} checked={true} /> : <input type=\"checkbox\" data-provider={provider.id} checked={isUserEnabled && isSystemEnabled} onChange={this.handleEnabledToggle} />}</td>\n          <td>{provider.id}</td>\n          <td><span className={`sourceLabel${(isUserEnabled && isSystemEnabled) ? \"\" : \" isDisabled\"}`}>{label}</span></td>\n          <td>{provider.cohort}</td>\n          <td style={{whiteSpace: \"nowrap\"}}>{info.lastUpdated ? new Date(info.lastUpdated).toLocaleString() : \"\"}</td>\n        </tr>);\n      })}\n    </tbody></table>);\n  }\n\n  renderPasteModal() {\n    if (!this.state.pasteFromClipboard) {\n      return null;\n    }\n    const errors = this.refs.targetingParamsEval && this.refs.targetingParamsEval.innerText.length;\n    return (\n      <ModalOverlay title=\"New targeting parameters\" button_label={errors ? \"Cancel\" : \"Done\"} onDoneButton={this.onPasteTargetingParams}>\n        <div className=\"onboardingMessage\">\n          <p>\n            <textarea onChange={this.onNewTargetingParams} value={this.state.newStringTargetingParameters} autoFocus={true} rows=\"20\" cols=\"60\" />\n          </p>\n          <p ref=\"targetingParamsEval\" />\n        </div>\n      </ModalOverlay>\n    );\n  }\n\n  renderTargetingParameters() {\n    // There was no error and the result is truthy\n    const success = this.state.evaluationStatus.success && !!this.state.evaluationStatus.result;\n    const result = JSON.stringify(this.state.evaluationStatus.result, null, 2) || \"(Empty result)\";\n\n    return (<table><tbody>\n      <tr><td><h2>Evaluate JEXL expression</h2></td></tr>\n      <tr>\n        <td>\n          <p><textarea ref=\"expressionInput\" rows=\"10\" cols=\"60\" placeholder=\"Evaluate JEXL expressions and mock parameters by changing their values below\" /></p>\n          <p>Status: <span ref=\"evaluationStatus\">{success ? \"✅\" : \"❌\"}, Result: {result}</span></p>\n        </td>\n        <td>\n           <button className=\"ASRouterButton secondary\" onClick={this.handleExpressionEval}>Evaluate</button>\n        </td>\n      </tr>\n      <tr><td><h2>Modify targeting parameters</h2></td></tr>\n      <tr>\n        <td>\n          <button className=\"ASRouterButton secondary\" onClick={this.onCopyTargetingParams} disabled={this.state.copiedToClipboard}>\n            {this.state.copiedToClipboard ? \"Parameters copied!\" : \"Copy parameters\"}\n          </button>\n          <button className=\"ASRouterButton secondary\" onClick={this.onPasteTargetingParams} disabled={this.state.pasteFromClipboard}>\n            Paste parameters\n          </button>\n        </td>\n      </tr>\n      {this.state.stringTargetingParameters && Object.keys(this.state.stringTargetingParameters).map((param, i) => {\n        const value = this.state.stringTargetingParameters[param];\n        const errorState = this.state.targetingParametersError && this.state.targetingParametersError.id === param;\n        const className = errorState ? \"errorState\" : \"\";\n        const inputComp = (value && value.length) > 30 ?\n          <textarea name={param} className={className} value={value} rows=\"10\" cols=\"60\" onChange={this.onChangeTargetingParameters} /> :\n          <input name={param} className={className} value={value} onChange={this.onChangeTargetingParameters} />;\n\n        return (<tr key={i}>\n          <td>{param}</td>\n          <td>{inputComp}</td>\n          </tr>);\n      })}\n      </tbody></table>);\n  }\n\n  onChangeAttributionParameters(event) {\n    const {name, value} = event.target;\n\n    this.setState(({attributionParameters}) => {\n      const updatedParameters = {...attributionParameters};\n      updatedParameters[name] = value;\n\n      return {attributionParameters: updatedParameters};\n    });\n  }\n\n  setAttribution(e) {\n    ASRouterUtils.sendMessage({type: \"FORCE_ATTRIBUTION\", data: this.state.attributionParameters});\n  }\n\n  renderPocketStory(story) {\n    return (<tr className=\"message-item\" key={story.guid}>\n      <td className=\"message-id\"><span>{story.guid} <br /></span></td>\n      <td className=\"message-summary\">\n        <pre>{JSON.stringify(story, null, 2)}</pre>\n      </td>\n    </tr>);\n  }\n\n  renderPocketStories() {\n    const {rows} = this.props.Sections.find(Section => Section.id === \"topstories\") || {};\n\n    return (<table><tbody>\n      {rows && rows.map(story => this.renderPocketStory(story))}\n    </tbody></table>);\n  }\n\n  renderDiscoveryStream() {\n    const {config} = this.props.DiscoveryStream;\n\n    return (<div>\n      <table><tbody>\n        <tr className=\"message-item\"><td className=\"min\">Enabled</td><td>{config.enabled ? \"yes\" : \"no\"}</td></tr>\n        <tr className=\"message-item\"><td className=\"min\">Endpoint</td><td>{config.endpoint || \"(empty)\"}</td></tr>\n      </tbody></table>\n    </div>);\n  }\n\n  renderAttributionParamers() {\n    return (\n      <div>\n        <h2> Attribution Parameters </h2>\n        <p> This forces the browser to set some attribution parameters, useful for testing the Return To AMO feature. Clicking on 'Force Attribution', with the default values in each field, will demo the Return To AMO flow with the addon called 'Iridium for Youtube'. If you wish to try different attribution parameters, enter them in the text boxes. If you wish to try a different addon with the Return To AMO flow, make sure the 'content' text box has the addon GUID, then click 'Force Attribution'.</p>\n        <table>\n          <tr>\n            <td><b> Source </b></td>\n            <td> <input type=\"text\" name=\"source\" placeholder=\"addons.mozilla.org\" value={this.state.attributionParameters.source} onChange={this.onChangeAttributionParameters} /> </td>\n          </tr>\n          <tr>\n            <td><b> Campaign </b></td>\n            <td> <input type=\"text\" name=\"campaign\" placeholder=\"non-fx-button\" value={this.state.attributionParameters.campaign} onChange={this.onChangeAttributionParameters} /> </td>\n          </tr>\n          <tr>\n            <td><b> Content </b></td>\n            <td> <input type=\"text\" name=\"content\" placeholder=\"iridium@particlecore.github.io\" value={this.state.attributionParameters.content} onChange={this.onChangeAttributionParameters} /> </td>\n          </tr>\n          <tr>\n            <td> <button className=\"ASRouterButton primary button\" onClick={this.setAttribution} > Force Attribution </button> </td>\n          </tr>\n        </table>\n      </div>);\n  }\n\n  getSection() {\n    const [section] = this.props.location.routes;\n    switch (section) {\n      case \"targeting\":\n        return (<React.Fragment>\n          <h2>Targeting Utilities</h2>\n          <button className=\"button\" onClick={this.expireCache}>Expire Cache</button> (This expires the cache in ASR Targeting for bookmarks and top sites)\n          {this.renderTargetingParameters()}\n          {this.renderAttributionParamers()}\n        </React.Fragment>);\n      case \"pocket\":\n        return (<React.Fragment>\n          <h2>Pocket</h2>\n          {this.renderPocketStories()}\n        </React.Fragment>);\n      case \"ds\":\n        return (<React.Fragment>\n          <h2>Discovery Stream</h2>\n          <DiscoveryStreamAdmin state={this.props.DiscoveryStream} dispatch={this.props.dispatch} />\n        </React.Fragment>);\n      default:\n        return (<React.Fragment>\n          <h2>Message Providers <button title=\"Restore all provider settings that ship with Firefox\" className=\"button\" onClick={this.resetPref}>Restore default prefs</button></h2>\n          {this.state.providers ? this.renderProviders() : null}\n          <h2>Messages</h2>\n          {this.renderMessageFilter()}\n          {this.renderMessages()}\n          {this.renderPasteModal()}\n        </React.Fragment>);\n    }\n  }\n\n  render() {\n    return (<div className=\"asrouter-admin\">\n      <aside className=\"sidebar\">\n        <ul>\n          <li><a href=\"#devtools\">General</a></li>\n          <li><a href=\"#devtools-targeting\">Targeting</a></li>\n          <li><a href=\"#devtools-pocket\">Pocket</a></li>\n          <li><a href=\"#devtools-ds\">Discovery Stream</a></li>\n        </ul>\n      </aside>\n      <main className=\"main-panel\">\n      <h1>AS Router Admin</h1>\n\n      <p className=\"helpLink\">\n        <span className=\"icon icon-small-spacer icon-info\" />\n        {\" \"}\n        <span>\n          Need help using these tools? Check out our <a target=\"blank\" href=\"https://github.com/mozilla/activity-stream/blob/master/content-src/asrouter/docs/debugging-docs.md\">documentation</a>\n        </span>\n      </p>\n\n      {this.getSection()}\n      </main>\n    </div>);\n  }\n}\n\nexport const _ASRouterAdmin = props => (<SimpleHashRouter><ASRouterAdminInner {...props} /></SimpleHashRouter>);\nexport const ASRouterAdmin = connect(state => ({Sections: state.Sections, DiscoveryStream: state.DiscoveryStream}))(_ASRouterAdmin);\n","import React from \"react\";\n\nexport class SimpleHashRouter extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onHashChange = this.onHashChange.bind(this);\n    this.state = {hash: global.location.hash};\n  }\n\n  onHashChange() {\n    this.setState({hash: global.location.hash});\n  }\n\n  componentWillMount() {\n    global.addEventListener(\"hashchange\", this.onHashChange);\n  }\n\n  componentWillUnmount() {\n    global.removeEventListener(\"hashchange\", this.onHashChange);\n  }\n\n  render() {\n    const [, ...routes] = this.state.hash.replace(\"#asrouter\", \"\").split(\"-\");\n    return React.cloneElement(this.props.children, {\n      location: {\n        hash: this.state.hash,\n        routes,\n      },\n    });\n  }\n}\n","import {actionCreators as ac, actionTypes} from \"common/Actions.jsm\";\nimport {connect} from \"react-redux\";\nimport {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\n\n/**\n * ConfirmDialog component.\n * One primary action button, one cancel button.\n *\n * Content displayed is controlled by `data` prop the component receives.\n * Example:\n * data: {\n *   // Any sort of data needed to be passed around by actions.\n *   payload: site.url,\n *   // Primary button AlsoToMain action.\n *   action: \"DELETE_HISTORY_URL\",\n *   // Primary button USerEvent action.\n *   userEvent: \"DELETE\",\n *   // Array of locale ids to display.\n *   message_body: [\"confirm_history_delete_p1\", \"confirm_history_delete_notice_p2\"],\n *   // Text for primary button.\n *   confirm_button_string_id: \"menu_action_delete\"\n * },\n */\nexport class _ConfirmDialog extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this._handleCancelBtn = this._handleCancelBtn.bind(this);\n    this._handleConfirmBtn = this._handleConfirmBtn.bind(this);\n  }\n\n  _handleCancelBtn() {\n    this.props.dispatch({type: actionTypes.DIALOG_CANCEL});\n    this.props.dispatch(ac.UserEvent({event: actionTypes.DIALOG_CANCEL, source: this.props.data.eventSource}));\n  }\n\n  _handleConfirmBtn() {\n    this.props.data.onConfirm.forEach(this.props.dispatch);\n  }\n\n  _renderModalMessage() {\n    const message_body = this.props.data.body_string_id;\n\n    if (!message_body) {\n      return null;\n    }\n\n    return (<span>\n      {message_body.map(msg => <p key={msg}><FormattedMessage id={msg} /></p>)}\n    </span>);\n  }\n\n  render() {\n    if (!this.props.visible) {\n      return null;\n    }\n\n    return (<div className=\"confirmation-dialog\">\n      <div className=\"modal-overlay\" onClick={this._handleCancelBtn} />\n      <div className=\"modal\">\n        <section className=\"modal-message\">\n          {this.props.data.icon && <span className={`icon icon-spacer icon-${this.props.data.icon}`} />}\n          {this._renderModalMessage()}\n        </section>\n        <section className=\"actions\">\n          <button onClick={this._handleCancelBtn}>\n            <FormattedMessage id={this.props.data.cancel_button_string_id} />\n          </button>\n          <button className=\"done\" onClick={this._handleConfirmBtn}>\n            <FormattedMessage id={this.props.data.confirm_button_string_id} />\n          </button>\n        </section>\n      </div>\n    </div>);\n  }\n}\n\nexport const ConfirmDialog = connect(state => state.Dialog)(_ConfirmDialog);\n","import {actionCreators as ac} from \"common/Actions.jsm\";\nimport React from \"react\";\n\nconst VISIBLE = \"visible\";\nconst VISIBILITY_CHANGE_EVENT = \"visibilitychange\";\n\nexport class ImpressionStats extends React.PureComponent {\n  // This checks if the given cards are the same as those in the last impression ping.\n  // If so, it should not send the same impression ping again.\n  _needsImpressionStats(cards) {\n    if (!this.impressionCardGuids || (this.impressionCardGuids.length !== cards.length)) {\n      return true;\n    }\n\n    for (let i = 0; i < cards.length; i++) {\n      if (cards[i].id !== this.impressionCardGuids[i]) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  _dispatchImpressionStats() {\n    const {props} = this;\n    const cards = props.rows;\n\n    if (this._needsImpressionStats(cards)) {\n      props.dispatch(ac.ImpressionStats({\n        source: props.source.toUpperCase(),\n        tiles: cards.map(link => ({id: link.id})),\n      }));\n      this.impressionCardGuids = cards.map(link => link.id);\n    }\n  }\n\n  // This sends an event when a user sees a set of new content. If content\n  // changes while the page is hidden (i.e. preloaded or on a hidden tab),\n  // only send the event if the page becomes visible again.\n  sendImpressionStatsOrAddListener() {\n    const {props} = this;\n\n    if (!props.dispatch) {\n      return;\n    }\n\n    if (props.document.visibilityState === VISIBLE) {\n      this._dispatchImpressionStats();\n    } else {\n      // We should only ever send the latest impression stats ping, so remove any\n      // older listeners.\n      if (this._onVisibilityChange) {\n        props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n      }\n\n      this._onVisibilityChange = () => {\n        if (props.document.visibilityState === VISIBLE) {\n          this._dispatchImpressionStats();\n          props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n        }\n      };\n      props.document.addEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n    }\n  }\n\n  componentDidMount() {\n    if (this.props.rows.length) {\n      this.sendImpressionStatsOrAddListener();\n    }\n  }\n\n  componentDidUpdate(prevProps) {\n    if (this.props.rows.length && this.props.rows !== prevProps.rows) {\n      this.sendImpressionStatsOrAddListener();\n    }\n  }\n\n  componentWillUnmount() {\n    if (this._onVisibilityChange) {\n      this.props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n    }\n  }\n\n  render() {\n    return this.props.children;\n  }\n}\n\nImpressionStats.defaultProps = {\n  document: global.document,\n  rows: [],\n  source: \"\",\n};\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {MIN_CORNER_FAVICON_SIZE, MIN_RICH_FAVICON_SIZE, TOP_SITES_SOURCE} from \"./TopSitesConstants\";\nimport {CollapsibleSection} from \"content-src/components/CollapsibleSection/CollapsibleSection\";\nimport {ComponentPerfTimer} from \"content-src/components/ComponentPerfTimer/ComponentPerfTimer\";\nimport {connect} from \"react-redux\";\nimport {injectIntl} from \"react-intl\";\nimport React from \"react\";\nimport {SearchShortcutsForm} from \"./SearchShortcutsForm\";\nimport {TOP_SITES_MAX_SITES_PER_ROW} from \"common/Reducers.jsm\";\nimport {TopSiteForm} from \"./TopSiteForm\";\nimport {TopSiteList} from \"./TopSite\";\n\nfunction topSiteIconType(link) {\n  if (link.customScreenshotURL) {\n    return \"custom_screenshot\";\n  }\n  if (link.tippyTopIcon || link.faviconRef === \"tippytop\") {\n    return \"tippytop\";\n  }\n  if (link.faviconSize >= MIN_RICH_FAVICON_SIZE) {\n    return \"rich_icon\";\n  }\n  if (link.screenshot && link.faviconSize >= MIN_CORNER_FAVICON_SIZE) {\n    return \"screenshot_with_icon\";\n  }\n  if (link.screenshot) {\n    return \"screenshot\";\n  }\n  return \"no_image\";\n}\n\n/**\n * Iterates through TopSites and counts types of images.\n * @param acc Accumulator for reducer.\n * @param topsite Entry in TopSites.\n */\nfunction countTopSitesIconsTypes(topSites) {\n  const countTopSitesTypes = (acc, link) => {\n    acc[topSiteIconType(link)]++;\n    return acc;\n  };\n\n  return topSites.reduce(countTopSitesTypes, {\n    \"custom_screenshot\": 0,\n    \"screenshot_with_icon\": 0,\n    \"screenshot\": 0,\n    \"tippytop\": 0,\n    \"rich_icon\": 0,\n    \"no_image\": 0,\n  });\n}\n\nexport class _TopSites extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onEditFormClose = this.onEditFormClose.bind(this);\n    this.onSearchShortcutsFormClose = this.onSearchShortcutsFormClose.bind(this);\n  }\n\n  /**\n   * Dispatch session statistics about the quality of TopSites icons and pinned count.\n   */\n  _dispatchTopSitesStats() {\n    const topSites = this._getVisibleTopSites();\n    const topSitesIconsStats = countTopSitesIconsTypes(topSites);\n    const topSitesPinned = topSites.filter(site => !!site.isPinned).length;\n    const searchShortcuts = topSites.filter(site => !!site.searchTopSite).length;\n    // Dispatch telemetry event with the count of TopSites images types.\n    this.props.dispatch(ac.AlsoToMain({\n      type: at.SAVE_SESSION_PERF_DATA,\n      data: {\n        topsites_icon_stats: topSitesIconsStats,\n        topsites_pinned: topSitesPinned,\n        topsites_search_shortcuts: searchShortcuts,\n      },\n    }));\n  }\n\n  /**\n   * Return the TopSites that are visible based on prefs and window width.\n   */\n  _getVisibleTopSites() {\n    // We hide 2 sites per row when not in the wide layout.\n    let sitesPerRow = TOP_SITES_MAX_SITES_PER_ROW;\n    // $break-point-widest = 1072px (from _variables.scss)\n    if (!global.matchMedia(`(min-width: 1072px)`).matches) {\n      sitesPerRow -= 2;\n    }\n    return this.props.TopSites.rows.slice(0, this.props.TopSitesRows * sitesPerRow);\n  }\n\n  componentDidUpdate() {\n    this._dispatchTopSitesStats();\n  }\n\n  componentDidMount() {\n    this._dispatchTopSitesStats();\n  }\n\n  onEditFormClose() {\n    this.props.dispatch(ac.UserEvent({\n      source: TOP_SITES_SOURCE,\n      event: \"TOP_SITES_EDIT_CLOSE\",\n    }));\n    this.props.dispatch({type: at.TOP_SITES_CANCEL_EDIT});\n  }\n\n  onSearchShortcutsFormClose() {\n    this.props.dispatch(ac.UserEvent({\n      source: TOP_SITES_SOURCE,\n      event: \"SEARCH_EDIT_CLOSE\",\n    }));\n    this.props.dispatch({type: at.TOP_SITES_CLOSE_SEARCH_SHORTCUTS_MODAL});\n  }\n\n  render() {\n    const {props} = this;\n    const {editForm, showSearchShortcutsForm} = props.TopSites;\n    const extraMenuOptions = [\"AddTopSite\"];\n    if (props.Prefs.values[\"improvesearch.topSiteSearchShortcuts\"]) {\n      extraMenuOptions.push(\"AddSearchShortcut\");\n    }\n\n    return (<ComponentPerfTimer id=\"topsites\" initialized={props.TopSites.initialized} dispatch={props.dispatch}>\n      <CollapsibleSection\n        className=\"top-sites\"\n        icon=\"topsites\"\n        id=\"topsites\"\n        title={{id: \"header_top_sites\"}}\n        extraMenuOptions={extraMenuOptions}\n        showPrefName=\"feeds.topsites\"\n        eventSource={TOP_SITES_SOURCE}\n        collapsed={props.TopSites.pref ? props.TopSites.pref.collapsed : undefined}\n        isFirst={props.isFirst}\n        isLast={props.isLast}\n        dispatch={props.dispatch}>\n        <TopSiteList TopSites={props.TopSites} TopSitesRows={props.TopSitesRows} dispatch={props.dispatch} intl={props.intl} topSiteIconType={topSiteIconType} />\n        <div className=\"edit-topsites-wrapper\">\n          {editForm &&\n            <div className=\"edit-topsites\">\n              <div className=\"modal-overlay\" onClick={this.onEditFormClose} />\n              <div className=\"modal\">\n                <TopSiteForm\n                  site={props.TopSites.rows[editForm.index]}\n                  onClose={this.onEditFormClose}\n                  dispatch={this.props.dispatch}\n                  intl={this.props.intl}\n                  {...editForm} />\n              </div>\n            </div>\n          }\n          {showSearchShortcutsForm &&\n            <div className=\"edit-search-shortcuts\">\n              <div className=\"modal-overlay\" onClick={this.onSearchShortcutsFormClose} />\n              <div className=\"modal\">\n                <SearchShortcutsForm\n                  TopSites={props.TopSites}\n                  onClose={this.onSearchShortcutsFormClose}\n                  dispatch={this.props.dispatch} />\n              </div>\n            </div>\n          }\n        </div>\n      </CollapsibleSection>\n    </ComponentPerfTimer>);\n  }\n}\n\nexport const TopSites = connect(state => ({\n  TopSites: state.TopSites,\n  Prefs: state.Prefs,\n  TopSitesRows: state.Prefs.values.topSitesRows,\n}))(injectIntl(_TopSites));\n","export const TOP_SITES_SOURCE = \"TOP_SITES\";\nexport const TOP_SITES_CONTEXT_MENU_OPTIONS = [\"CheckPinTopSite\", \"EditTopSite\", \"Separator\",\n  \"OpenInNewWindow\", \"OpenInPrivateWindow\", \"Separator\", \"BlockUrl\", \"DeleteUrl\"];\n// the special top site for search shortcut experiment can only have the option to unpin (which removes) the topsite\nexport const TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS = [\"CheckPinTopSite\", \"Separator\", \"BlockUrl\"];\n// minimum size necessary to show a rich icon instead of a screenshot\nexport const MIN_RICH_FAVICON_SIZE = 96;\n// minimum size necessary to show any icon in the top left corner with a screenshot\nexport const MIN_CORNER_FAVICON_SIZE = 16;\n","import {FormattedMessage, injectIntl} from \"react-intl\";\nimport {actionCreators as ac} from \"common/Actions.jsm\";\nimport {ErrorBoundary} from \"content-src/components/ErrorBoundary/ErrorBoundary\";\nimport React from \"react\";\nimport {SectionMenu} from \"content-src/components/SectionMenu/SectionMenu\";\nimport {SectionMenuOptions} from \"content-src/lib/section-menu-options\";\n\nconst VISIBLE = \"visible\";\nconst VISIBILITY_CHANGE_EVENT = \"visibilitychange\";\n\nfunction getFormattedMessage(message) {\n  return typeof message === \"string\" ? <span>{message}</span> : <FormattedMessage {...message} />;\n}\n\nexport class _CollapsibleSection extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onBodyMount = this.onBodyMount.bind(this);\n    this.onHeaderClick = this.onHeaderClick.bind(this);\n    this.onTransitionEnd = this.onTransitionEnd.bind(this);\n    this.enableOrDisableAnimation = this.enableOrDisableAnimation.bind(this);\n    this.onMenuButtonClick = this.onMenuButtonClick.bind(this);\n    this.onMenuButtonMouseEnter = this.onMenuButtonMouseEnter.bind(this);\n    this.onMenuButtonMouseLeave = this.onMenuButtonMouseLeave.bind(this);\n    this.onMenuUpdate = this.onMenuUpdate.bind(this);\n    this.state = {enableAnimation: true, isAnimating: false, menuButtonHover: false, showContextMenu: false};\n    this.setContextMenuButtonRef = this.setContextMenuButtonRef.bind(this);\n  }\n\n  componentWillMount() {\n    this.props.document.addEventListener(VISIBILITY_CHANGE_EVENT, this.enableOrDisableAnimation);\n  }\n\n  componentWillUpdate(nextProps) {\n    // Check if we're about to go from expanded to collapsed\n    if (!this.props.collapsed && nextProps.collapsed) {\n      // This next line forces a layout flush of the section body, which has a\n      // max-height style set, so that the upcoming collapse animation can\n      // animate from that height to the collapsed height. Without this, the\n      // update is coalesced and there's no animation from no-max-height to 0.\n      this.sectionBody.scrollHeight; // eslint-disable-line no-unused-expressions\n    }\n  }\n\n  setContextMenuButtonRef(element) {\n    this.contextMenuButtonRef = element;\n  }\n\n  componentDidMount() {\n    this.contextMenuButtonRef.addEventListener(\"mouseenter\", this.onMenuButtonMouseEnter);\n    this.contextMenuButtonRef.addEventListener(\"mouseleave\", this.onMenuButtonMouseLeave);\n  }\n\n  componentWillUnmount() {\n    this.props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this.enableOrDisableAnimation);\n    this.contextMenuButtonRef.removeEventListener(\"mouseenter\", this.onMenuButtonMouseEnter);\n    this.contextMenuButtonRef.removeEventListener(\"mouseleave\", this.onMenuButtonMouseLeave);\n  }\n\n  enableOrDisableAnimation() {\n    // Only animate the collapse/expand for visible tabs.\n    const visible = this.props.document.visibilityState === VISIBLE;\n    if (this.state.enableAnimation !== visible) {\n      this.setState({enableAnimation: visible});\n    }\n  }\n\n  onBodyMount(node) {\n    this.sectionBody = node;\n  }\n\n  onHeaderClick() {\n    // If this.sectionBody is unset, it means that we're in some sort of error\n    // state, probably displaying the error fallback, so we won't be able to\n    // compute the height, and we don't want to persist the preference.\n    // If props.collapsed is undefined handler shouldn't do anything.\n    if (!this.sectionBody || this.props.collapsed === undefined) {\n      return;\n    }\n\n    // Get the current height of the body so max-height transitions can work\n    this.setState({\n      isAnimating: true,\n      maxHeight: `${this._getSectionBodyHeight()}px`,\n    });\n    const {action, userEvent} = SectionMenuOptions.CheckCollapsed(this.props);\n    this.props.dispatch(action);\n    this.props.dispatch(ac.UserEvent({\n      event: userEvent,\n      source: this.props.source,\n    }));\n  }\n\n  _getSectionBodyHeight() {\n    const div = this.sectionBody;\n    if (div.style.display === \"none\") {\n      // If the div isn't displayed, we can't get it's height. So we display it\n      // to get the height (it doesn't show up because max-height is set to 0px\n      // in CSS). We don't undo this because we are about to expand the section.\n      div.style.display = \"block\";\n    }\n    return div.scrollHeight;\n  }\n\n  onTransitionEnd(event) {\n    // Only update the animating state for our own transition (not a child's)\n    if (event.target === event.currentTarget) {\n      this.setState({isAnimating: false});\n    }\n  }\n\n  renderIcon() {\n    const {icon} = this.props;\n    if (icon && icon.startsWith(\"moz-extension://\")) {\n      return <span className=\"icon icon-small-spacer\" style={{backgroundImage: `url('${icon}')`}} />;\n    }\n    return <span className={`icon icon-small-spacer icon-${icon || \"webextension\"}`} />;\n  }\n\n  onMenuButtonClick(event) {\n    event.preventDefault();\n    this.setState({showContextMenu: true});\n  }\n\n  onMenuButtonMouseEnter() {\n    this.setState({menuButtonHover: true});\n  }\n\n  onMenuButtonMouseLeave() {\n    this.setState({menuButtonHover: false});\n  }\n\n  onMenuUpdate(showContextMenu) {\n    this.setState({showContextMenu});\n  }\n\n  render() {\n    const isCollapsible = this.props.collapsed !== undefined;\n    const {enableAnimation, isAnimating, maxHeight, menuButtonHover, showContextMenu} = this.state;\n    const {id, eventSource, collapsed, learnMore, title, extraMenuOptions, showPrefName, privacyNoticeURL, dispatch, isFirst, isLast, isWebExtension} = this.props;\n    const active = menuButtonHover || showContextMenu;\n    let bodyStyle;\n    if (isAnimating && !collapsed) {\n      bodyStyle = {maxHeight};\n    } else if (!isAnimating && collapsed) {\n      bodyStyle = {display: \"none\"};\n    }\n    return (\n      <section\n        className={`collapsible-section ${this.props.className}${enableAnimation ? \" animation-enabled\" : \"\"}${collapsed ? \" collapsed\" : \"\"}${active ? \" active\" : \"\"}`}\n        // Note: data-section-id is used for web extension api tests in mozilla central\n        data-section-id={id}>\n        <div className=\"section-top-bar\">\n          <h3 className=\"section-title\">\n            <span className=\"click-target-container\">\n              <span className=\"click-target\" onClick={this.onHeaderClick}>\n                {this.renderIcon()}\n                {getFormattedMessage(title)}\n              </span>\n              <span className=\"click-target\" onClick={this.onHeaderClick}>\n                {isCollapsible && <span className={`collapsible-arrow icon ${collapsed ? \"icon-arrowhead-forward-small\" : \"icon-arrowhead-down-small\"}`} />}\n              </span>\n              <span className=\"learn-more-link-wrapper\">\n                {learnMore &&\n                  <span className=\"learn-more-link\">\n                    <a href={learnMore.link.href}>\n                      <FormattedMessage id={learnMore.link.id} />\n                    </a>\n                  </span>\n                }\n              </span>\n            </span>\n          </h3>\n          <div>\n            <button\n              className=\"context-menu-button icon\"\n              title={this.props.intl.formatMessage({id: \"context_menu_title\"})}\n              onClick={this.onMenuButtonClick}\n              ref={this.setContextMenuButtonRef}>\n              <span className=\"sr-only\">\n                <FormattedMessage id=\"section_context_menu_button_sr\" />\n              </span>\n            </button>\n            {showContextMenu &&\n              <SectionMenu\n                id={id}\n                extraOptions={extraMenuOptions}\n                eventSource={eventSource}\n                showPrefName={showPrefName}\n                privacyNoticeURL={privacyNoticeURL}\n                collapsed={collapsed}\n                onUpdate={this.onMenuUpdate}\n                isFirst={isFirst}\n                isLast={isLast}\n                dispatch={dispatch}\n                isWebExtension={isWebExtension} />\n            }\n          </div>\n        </div>\n        <ErrorBoundary className=\"section-body-fallback\">\n          <div\n            className={`section-body${isAnimating ? \" animating\" : \"\"}`}\n            onTransitionEnd={this.onTransitionEnd}\n            ref={this.onBodyMount}\n            style={bodyStyle}>\n            {this.props.children}\n          </div>\n        </ErrorBoundary>\n      </section>\n    );\n  }\n}\n\n_CollapsibleSection.defaultProps = {\n  document: global.document || {\n    addEventListener: () => {},\n    removeEventListener: () => {},\n    visibilityState: \"hidden\",\n  },\n  Prefs: {values: {}},\n};\n\nexport const CollapsibleSection = injectIntl(_CollapsibleSection);\n","import {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\n\nexport class ErrorBoundaryFallback extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.windowObj = this.props.windowObj || window;\n    this.onClick = this.onClick.bind(this);\n  }\n\n  /**\n   * Since we only get here if part of the page has crashed, do a\n   * forced reload to give us the best chance at recovering.\n   */\n  onClick() {\n    this.windowObj.location.reload(true);\n  }\n\n  render() {\n    const defaultClass = \"as-error-fallback\";\n    let className;\n    if (\"className\" in this.props) {\n      className = `${this.props.className} ${defaultClass}`;\n    } else {\n      className = defaultClass;\n    }\n\n    // href=\"#\" to force normal link styling stuff (eg cursor on hover)\n    return (\n      <div className={className}>\n        <div>\n          <FormattedMessage\n            defaultMessage=\"Oops, something went wrong loading this content.\"\n            id=\"error_fallback_default_info\" />\n        </div>\n        <span>\n          <a href=\"#\" className=\"reload-button\" onClick={this.onClick}>\n            <FormattedMessage\n              defaultMessage=\"Refresh page to try again.\"\n              id=\"error_fallback_default_refresh_suggestion\" />\n          </a>\n        </span>\n      </div>\n    );\n  }\n}\nErrorBoundaryFallback.defaultProps = {className: \"as-error-fallback\"};\n\nexport class ErrorBoundary extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.state = {hasError: false};\n  }\n\n  componentDidCatch(error, info) {\n    this.setState({hasError: true});\n  }\n\n  render() {\n    if (!this.state.hasError) {\n      return (this.props.children);\n    }\n\n    return <this.props.FallbackComponent className={this.props.className} />;\n  }\n}\n\nErrorBoundary.defaultProps = {FallbackComponent: ErrorBoundaryFallback};\n","import {actionCreators as ac} from \"common/Actions.jsm\";\nimport {ContextMenu} from \"content-src/components/ContextMenu/ContextMenu\";\nimport {injectIntl} from \"react-intl\";\nimport React from \"react\";\nimport {SectionMenuOptions} from \"content-src/lib/section-menu-options\";\n\nconst DEFAULT_SECTION_MENU_OPTIONS = [\"MoveUp\", \"MoveDown\", \"Separator\", \"RemoveSection\", \"CheckCollapsed\", \"Separator\", \"ManageSection\"];\nconst WEBEXT_SECTION_MENU_OPTIONS = [\"MoveUp\", \"MoveDown\", \"Separator\", \"CheckCollapsed\", \"Separator\", \"ManageWebExtension\"];\n\nexport class _SectionMenu extends React.PureComponent {\n  getOptions() {\n    const {props} = this;\n\n    const propOptions = props.isWebExtension ? [...WEBEXT_SECTION_MENU_OPTIONS] : [...DEFAULT_SECTION_MENU_OPTIONS];\n    // Prepend custom options and a separator\n    if (props.extraOptions) {\n      propOptions.splice(0, 0, ...props.extraOptions, \"Separator\");\n    }\n    // Insert privacy notice before the last option (\"ManageSection\")\n    if (props.privacyNoticeURL) {\n      propOptions.splice(-1, 0, \"PrivacyNotice\");\n    }\n\n    const options = propOptions.map(o => SectionMenuOptions[o](props)).map(option => {\n      const {action, id, type, userEvent} = option;\n      if (!type && id) {\n        option.label = props.intl.formatMessage({id});\n        option.onClick = () => {\n          props.dispatch(action);\n          if (userEvent) {\n            props.dispatch(ac.UserEvent({\n              event: userEvent,\n              source: props.source,\n            }));\n          }\n        };\n      }\n      return option;\n    });\n\n    // This is for accessibility to support making each item tabbable.\n    // We want to know which item is the first and which item\n    // is the last, so we can close the context menu accordingly.\n    options[0].first = true;\n    options[options.length - 1].last = true;\n    return options;\n  }\n\n  render() {\n    return (<ContextMenu\n      onUpdate={this.props.onUpdate}\n      options={this.getOptions()} />);\n  }\n}\n\nexport const SectionMenu = injectIntl(_SectionMenu);\n","import React from \"react\";\n\nexport class ContextMenu extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.hideContext = this.hideContext.bind(this);\n    this.onClick = this.onClick.bind(this);\n  }\n\n  hideContext() {\n    this.props.onUpdate(false);\n  }\n\n  componentDidMount() {\n    setTimeout(() => {\n      global.addEventListener(\"click\", this.hideContext);\n    }, 0);\n  }\n\n  componentWillUnmount() {\n    global.removeEventListener(\"click\", this.hideContext);\n  }\n\n  onClick(event) {\n    // Eat all clicks on the context menu so they don't bubble up to window.\n    // This prevents the context menu from closing when clicking disabled items\n    // or the separators.\n    event.stopPropagation();\n  }\n\n  render() {\n    return (<span className=\"context-menu\" onClick={this.onClick}>\n      <ul role=\"menu\" className=\"context-menu-list\">\n        {this.props.options.map((option, i) => (option.type === \"separator\" ?\n          (<li key={i} className=\"separator\" />) :\n          (option.type !== \"empty\" && <ContextMenuItem key={i} option={option} hideContext={this.hideContext} />)\n        ))}\n      </ul>\n    </span>);\n  }\n}\n\nexport class ContextMenuItem extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onClick = this.onClick.bind(this);\n    this.onKeyDown = this.onKeyDown.bind(this);\n  }\n\n  onClick() {\n    this.props.hideContext();\n    this.props.option.onClick();\n  }\n\n  onKeyDown(event) {\n    const {option} = this.props;\n    switch (event.key) {\n      case \"Tab\":\n        // tab goes down in context menu, shift + tab goes up in context menu\n        // if we're on the last item, one more tab will close the context menu\n        // similarly, if we're on the first item, one more shift + tab will close it\n        if ((event.shiftKey && option.first) || (!event.shiftKey && option.last)) {\n          this.props.hideContext();\n        }\n        break;\n      case \"Enter\":\n        this.props.hideContext();\n        option.onClick();\n        break;\n    }\n  }\n\n  render() {\n    const {option} = this.props;\n    return (\n      <li role=\"menuitem\" className=\"context-menu-item\">\n        <a onClick={this.onClick} onKeyDown={this.onKeyDown} tabIndex=\"0\" className={option.disabled ? \"disabled\" : \"\"}>\n          {option.icon && <span className={`icon icon-spacer icon-${option.icon}`} />}\n          {option.label}\n        </a>\n      </li>);\n  }\n}\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\n\n/**\n * List of functions that return items that can be included as menu options in a\n * SectionMenu. All functions take the section as the only parameter.\n */\nexport const SectionMenuOptions = {\n  Separator: () => ({type: \"separator\"}),\n  MoveUp: section => ({\n    id: \"section_menu_action_move_up\",\n    icon: \"arrowhead-up\",\n    action: ac.OnlyToMain({\n      type: at.SECTION_MOVE,\n      data: {id: section.id, direction: -1},\n    }),\n    userEvent: \"MENU_MOVE_UP\",\n    disabled: !!section.isFirst,\n  }),\n  MoveDown: section => ({\n    id: \"section_menu_action_move_down\",\n    icon: \"arrowhead-down\",\n    action: ac.OnlyToMain({\n      type: at.SECTION_MOVE,\n      data: {id: section.id, direction: +1},\n    }),\n    userEvent: \"MENU_MOVE_DOWN\",\n    disabled: !!section.isLast,\n  }),\n  RemoveSection: section => ({\n    id: \"section_menu_action_remove_section\",\n    icon: \"dismiss\",\n    action: ac.SetPref(section.showPrefName, false),\n    userEvent: \"MENU_REMOVE\",\n  }),\n  CollapseSection: section => ({\n    id: \"section_menu_action_collapse_section\",\n    icon: \"minimize\",\n    action: ac.OnlyToMain({type: at.UPDATE_SECTION_PREFS, data: {id: section.id, value: {collapsed: true}}}),\n    userEvent: \"MENU_COLLAPSE\",\n  }),\n  ExpandSection: section => ({\n    id: \"section_menu_action_expand_section\",\n    icon: \"maximize\",\n    action: ac.OnlyToMain({type: at.UPDATE_SECTION_PREFS, data: {id: section.id, value: {collapsed: false}}}),\n    userEvent: \"MENU_EXPAND\",\n  }),\n  ManageSection: section => ({\n    id: \"section_menu_action_manage_section\",\n    icon: \"settings\",\n    action: ac.OnlyToMain({type: at.SETTINGS_OPEN}),\n    userEvent: \"MENU_MANAGE\",\n  }),\n  ManageWebExtension: section => ({\n    id: \"section_menu_action_manage_webext\",\n    icon: \"settings\",\n    action: ac.OnlyToMain({type: at.OPEN_WEBEXT_SETTINGS, data: section.id}),\n  }),\n  AddTopSite: section => ({\n    id: \"section_menu_action_add_topsite\",\n    icon: \"add\",\n    action: {type: at.TOP_SITES_EDIT, data: {index: -1}},\n    userEvent: \"MENU_ADD_TOPSITE\",\n  }),\n  AddSearchShortcut: section => ({\n    id: \"section_menu_action_add_search_engine\",\n    icon: \"search\",\n    action: {type: at.TOP_SITES_OPEN_SEARCH_SHORTCUTS_MODAL},\n    userEvent: \"MENU_ADD_SEARCH\",\n  }),\n  PrivacyNotice: section => ({\n    id: \"section_menu_action_privacy_notice\",\n    icon: \"info\",\n    action: ac.OnlyToMain({\n      type: at.OPEN_LINK,\n      data: {url: section.privacyNoticeURL},\n    }),\n    userEvent: \"MENU_PRIVACY_NOTICE\",\n  }),\n  CheckCollapsed: section => (section.collapsed ? SectionMenuOptions.ExpandSection(section) : SectionMenuOptions.CollapseSection(section)),\n};\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {perfService as perfSvc} from \"common/PerfService.jsm\";\nimport React from \"react\";\n\n// Currently record only a fixed set of sections. This will prevent data\n// from custom sections from showing up or from topstories.\nconst RECORDED_SECTIONS = [\"highlights\", \"topsites\"];\n\nexport class ComponentPerfTimer extends React.Component {\n  constructor(props) {\n    super(props);\n    // Just for test dependency injection:\n    this.perfSvc = this.props.perfSvc || perfSvc;\n\n    this._sendBadStateEvent = this._sendBadStateEvent.bind(this);\n    this._sendPaintedEvent = this._sendPaintedEvent.bind(this);\n    this._reportMissingData = false;\n    this._timestampHandled = false;\n    this._recordedFirstRender = false;\n  }\n\n  componentDidMount() {\n    if (!RECORDED_SECTIONS.includes(this.props.id)) {\n      return;\n    }\n\n    this._maybeSendPaintedEvent();\n  }\n\n  componentDidUpdate() {\n    if (!RECORDED_SECTIONS.includes(this.props.id)) {\n      return;\n    }\n\n    this._maybeSendPaintedEvent();\n  }\n\n  /**\n   * Call the given callback after the upcoming frame paints.\n   *\n   * @note Both setTimeout and requestAnimationFrame are throttled when the page\n   * is hidden, so this callback may get called up to a second or so after the\n   * requestAnimationFrame \"paint\" for hidden tabs.\n   *\n   * Newtabs hidden while loading will presumably be fairly rare (other than\n   * preloaded tabs, which we will be filtering out on the server side), so such\n   * cases should get lost in the noise.\n   *\n   * If we decide that it's important to find out when something that's hidden\n   * has \"painted\", however, another option is to post a message to this window.\n   * That should happen even faster than setTimeout, and, at least as of this\n   * writing, it's not throttled in hidden windows in Firefox.\n   *\n   * @param {Function} callback\n   *\n   * @returns void\n   */\n  _afterFramePaint(callback) {\n    requestAnimationFrame(() => setTimeout(callback, 0));\n  }\n\n  _maybeSendBadStateEvent() {\n    // Follow up bugs:\n    // https://github.com/mozilla/activity-stream/issues/3691\n    if (!this.props.initialized) {\n      // Remember to report back when data is available.\n      this._reportMissingData = true;\n    } else if (this._reportMissingData) {\n      this._reportMissingData = false;\n      // Report how long it took for component to become initialized.\n      this._sendBadStateEvent();\n    }\n  }\n\n  _maybeSendPaintedEvent() {\n    // If we've already handled a timestamp, don't do it again.\n    if (this._timestampHandled || !this.props.initialized) {\n      return;\n    }\n\n    // And if we haven't, we're doing so now, so remember that. Even if\n    // something goes wrong in the callback, we can't try again, as we'd be\n    // sending back the wrong data, and we have to do it here, so that other\n    // calls to this method while waiting for the next frame won't also try to\n    // handle it.\n    this._timestampHandled = true;\n    this._afterFramePaint(this._sendPaintedEvent);\n  }\n\n  /**\n   * Triggered by call to render. Only first call goes through due to\n   * `_recordedFirstRender`.\n   */\n  _ensureFirstRenderTsRecorded() {\n    // Used as t0 for recording how long component took to initialize.\n    if (!this._recordedFirstRender) {\n      this._recordedFirstRender = true;\n      // topsites_first_render_ts, highlights_first_render_ts.\n      const key = `${this.props.id}_first_render_ts`;\n      this.perfSvc.mark(key);\n    }\n  }\n\n  /**\n   * Creates `TELEMETRY_UNDESIRED_EVENT` with timestamp in ms\n   * of how much longer the data took to be ready for display than it would\n   * have been the ideal case.\n   * https://github.com/mozilla/ping-centre/issues/98\n   */\n  _sendBadStateEvent() {\n    // highlights_data_ready_ts, topsites_data_ready_ts.\n    const dataReadyKey = `${this.props.id}_data_ready_ts`;\n    this.perfSvc.mark(dataReadyKey);\n\n    try {\n      const firstRenderKey = `${this.props.id}_first_render_ts`;\n      // value has to be Int32.\n      const value = parseInt(this.perfSvc.getMostRecentAbsMarkStartByName(dataReadyKey) -\n                             this.perfSvc.getMostRecentAbsMarkStartByName(firstRenderKey), 10);\n      this.props.dispatch(ac.OnlyToMain({\n        type: at.SAVE_SESSION_PERF_DATA,\n        // highlights_data_late_by_ms, topsites_data_late_by_ms.\n        data: {[`${this.props.id}_data_late_by_ms`]: value},\n      }));\n    } catch (ex) {\n      // If this failed, it's likely because the `privacy.resistFingerprinting`\n      // pref is true.\n    }\n  }\n\n  _sendPaintedEvent() {\n    // Record first_painted event but only send if topsites.\n    if (this.props.id !== \"topsites\") {\n      return;\n    }\n\n    // topsites_first_painted_ts.\n    const key = `${this.props.id}_first_painted_ts`;\n    this.perfSvc.mark(key);\n\n    try {\n      const data = {};\n      data[key] = this.perfSvc.getMostRecentAbsMarkStartByName(key);\n\n      this.props.dispatch(ac.OnlyToMain({\n        type: at.SAVE_SESSION_PERF_DATA,\n        data,\n      }));\n    } catch (ex) {\n      // If this failed, it's likely because the `privacy.resistFingerprinting`\n      // pref is true.  We should at least not blow up, and should continue\n      // to set this._timestampHandled to avoid going through this again.\n    }\n  }\n\n  render() {\n    if (RECORDED_SECTIONS.includes(this.props.id)) {\n      this._ensureFirstRenderTsRecorded();\n      this._maybeSendBadStateEvent();\n    }\n    return this.props.children;\n  }\n}\n","/* globals Services */\n\"use strict\";\n\n/* istanbul ignore if */\nif (typeof ChromeUtils !== \"undefined\") {\n  ChromeUtils.import(\"resource://gre/modules/Services.jsm\");\n}\n\nlet usablePerfObj;\n\n/* istanbul ignore if */\n/* istanbul ignore else */\nif (typeof Services !== \"undefined\") {\n  // Borrow the high-resolution timer from the hidden window....\n  usablePerfObj = Services.appShell.hiddenDOMWindow.performance;\n} else if (typeof performance !== \"undefined\") {\n  // we must be running in content space\n  // eslint-disable-next-line no-undef\n  usablePerfObj = performance;\n} else {\n  // This is a dummy object so this file doesn't crash in the node prerendering\n  // task.\n  usablePerfObj = {\n    now() {},\n    mark() {},\n  };\n}\n\nfunction _PerfService(options) {\n  // For testing, so that we can use a fake Window.performance object with\n  // known state.\n  if (options && options.performanceObj) {\n    this._perf = options.performanceObj;\n  } else {\n    this._perf = usablePerfObj;\n  }\n}\n\n_PerfService.prototype = {\n  /**\n   * Calls the underlying mark() method on the appropriate Window.performance\n   * object to add a mark with the given name to the appropriate performance\n   * timeline.\n   *\n   * @param  {String} name  the name to give the current mark\n   * @return {void}\n   */\n  mark: function mark(str) {\n    this._perf.mark(str);\n  },\n\n  /**\n   * Calls the underlying getEntriesByName on the appropriate Window.performance\n   * object.\n   *\n   * @param  {String} name\n   * @param  {String} type eg \"mark\"\n   * @return {Array}       Performance* objects\n   */\n  getEntriesByName: function getEntriesByName(name, type) {\n    return this._perf.getEntriesByName(name, type);\n  },\n\n  /**\n   * The timeOrigin property from the appropriate performance object.\n   * Used to ensure that timestamps from the add-on code and the content code\n   * are comparable.\n   *\n   * @note If this is called from a context without a window\n   * (eg a JSM in chrome), it will return the timeOrigin of the XUL hidden\n   * window, which appears to be the first created window (and thus\n   * timeOrigin) in the browser.  Note also, however, there is also a private\n   * hidden window, presumably for private browsing, which appears to be\n   * created dynamically later.  Exactly how/when that shows up needs to be\n   * investigated.\n   *\n   * @return {Number} A double of milliseconds with a precision of 0.5us.\n   */\n  get timeOrigin() {\n    return this._perf.timeOrigin;\n  },\n\n  /**\n   * Returns the \"absolute\" version of performance.now(), i.e. one that\n   * should ([bug 1401406](https://bugzilla.mozilla.org/show_bug.cgi?id=1401406)\n   * be comparable across both chrome and content.\n   *\n   * @return {Number}\n   */\n  absNow: function absNow() {\n    return this.timeOrigin + this._perf.now();\n  },\n\n  /**\n   * This returns the absolute startTime from the most recent performance.mark()\n   * with the given name.\n   *\n   * @param  {String} name  the name to lookup the start time for\n   *\n   * @return {Number}       the returned start time, as a DOMHighResTimeStamp\n   *\n   * @throws {Error}        \"No Marks with the name ...\" if none are available\n   *\n   * @note Always surround calls to this by try/catch.  Otherwise your code\n   * may fail when the `privacy.resistFingerprinting` pref is true.  When\n   * this pref is set, all attempts to get marks will likely fail, which will\n   * cause this method to throw.\n   *\n   * See [bug 1369303](https://bugzilla.mozilla.org/show_bug.cgi?id=1369303)\n   * for more info.\n   */\n  getMostRecentAbsMarkStartByName(name) {\n    let entries = this.getEntriesByName(name, \"mark\");\n\n    if (!entries.length) {\n      throw new Error(`No marks with the name ${name}`);\n    }\n\n    let mostRecentEntry = entries[entries.length - 1];\n    return this._perf.timeOrigin + mostRecentEntry.startTime;\n  },\n};\n\nthis.perfService = new _PerfService();\nconst EXPORTED_SYMBOLS = [\"_PerfService\", \"perfService\"];\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\nimport {TOP_SITES_SOURCE} from \"./TopSitesConstants\";\n\nclass SelectableSearchShortcut extends React.PureComponent {\n  render() {\n    const {shortcut, selected} = this.props;\n    const imageStyle = {backgroundImage: `url(\"${shortcut.tippyTopIcon}\")`};\n    return (\n      <div className=\"top-site-outer search-shortcut\">\n        <input type=\"checkbox\" id={shortcut.keyword} name={shortcut.keyword} checked={selected} onChange={this.props.onChange} />\n        <label htmlFor={shortcut.keyword}>\n          <div className=\"top-site-inner\">\n            <span>\n              <div className=\"tile\">\n                <div className=\"top-site-icon rich-icon\" style={imageStyle} data-fallback=\"@\" />\n                <div className=\"top-site-icon search-topsite\" />\n              </div>\n              <div className=\"title\">\n                <span dir=\"auto\">{shortcut.keyword}</span>\n              </div>\n            </span>\n          </div>\n        </label>\n      </div>\n    );\n  }\n}\n\nexport class SearchShortcutsForm extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.handleChange = this.handleChange.bind(this);\n    this.onCancelButtonClick = this.onCancelButtonClick.bind(this);\n    this.onSaveButtonClick = this.onSaveButtonClick.bind(this);\n\n    // clone the shortcuts and add them to the state so we can add isSelected property\n    const shortcuts = [];\n    const {rows, searchShortcuts} = props.TopSites;\n    searchShortcuts.forEach(shortcut => {\n      shortcuts.push({\n        ...shortcut,\n        isSelected: !!rows.find(row => row && row.isPinned && row.searchTopSite && row.label === shortcut.keyword),\n      });\n    });\n    this.state = {shortcuts};\n  }\n\n  handleChange(event) {\n    const {target} = event;\n    const {name, checked} = target;\n    this.setState(prevState => {\n      const shortcuts = prevState.shortcuts.slice();\n      let shortcut = shortcuts.find(({keyword}) => keyword === name);\n      shortcut.isSelected = checked;\n      return {shortcuts};\n    });\n  }\n\n  onCancelButtonClick(ev) {\n    ev.preventDefault();\n    this.props.onClose();\n  }\n\n  onSaveButtonClick(ev) {\n    ev.preventDefault();\n\n    // Check if there were any changes and act accordingly\n    const {rows} = this.props.TopSites;\n    const pinQueue = [];\n    const unpinQueue = [];\n    this.state.shortcuts.forEach(shortcut => {\n      const alreadyPinned = rows.find(row => row && row.isPinned && row.searchTopSite && row.label === shortcut.keyword);\n      if (shortcut.isSelected && !alreadyPinned) {\n        pinQueue.push(this._searchTopSite(shortcut));\n      } else if (!shortcut.isSelected && alreadyPinned) {\n        unpinQueue.push({url: alreadyPinned.url, searchVendor: shortcut.shortURL});\n      }\n    });\n\n    // Tell the feed to do the work.\n    this.props.dispatch(ac.OnlyToMain({\n      type: at.UPDATE_PINNED_SEARCH_SHORTCUTS,\n      data: {\n        addedShortcuts: pinQueue,\n        deletedShortcuts: unpinQueue,\n      },\n    }));\n\n    // Send the Telemetry pings.\n    pinQueue.forEach(shortcut => {\n      this.props.dispatch(ac.UserEvent({\n        source: TOP_SITES_SOURCE,\n        event: \"SEARCH_EDIT_ADD\",\n        value: {search_vendor: shortcut.searchVendor},\n      }));\n    });\n    unpinQueue.forEach(shortcut => {\n      this.props.dispatch(ac.UserEvent({\n        source: TOP_SITES_SOURCE,\n        event: \"SEARCH_EDIT_DELETE\",\n        value: {search_vendor: shortcut.searchVendor},\n      }));\n    });\n\n    this.props.onClose();\n  }\n\n  _searchTopSite(shortcut) {\n    return {\n      url: shortcut.url,\n      searchTopSite: true,\n      label: shortcut.keyword,\n      searchVendor: shortcut.shortURL,\n    };\n  }\n\n  render() {\n    return (\n      <form className=\"topsite-form\">\n        <div className=\"search-shortcuts-container\">\n          <h3 className=\"section-title\">\n            <FormattedMessage id=\"section_menu_action_add_search_engine\" />\n          </h3>\n          <div>\n            {this.state.shortcuts.map(shortcut => <SelectableSearchShortcut key={shortcut.keyword} shortcut={shortcut} selected={shortcut.isSelected} onChange={this.handleChange} />)}\n          </div>\n        </div>\n        <section className=\"actions\">\n          <button className=\"cancel\" type=\"button\" onClick={this.onCancelButtonClick}>\n            <FormattedMessage id=\"topsites_form_cancel_button\" />\n          </button>\n          <button className=\"done\" type=\"submit\" onClick={this.onSaveButtonClick}>\n            <FormattedMessage id=\"topsites_form_save_button\" />\n          </button>\n        </section>\n      </form>\n    );\n  }\n}\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {FormattedMessage, injectIntl} from \"react-intl\";\nimport {\n  MIN_CORNER_FAVICON_SIZE,\n  MIN_RICH_FAVICON_SIZE,\n  TOP_SITES_CONTEXT_MENU_OPTIONS,\n  TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS,\n  TOP_SITES_SOURCE,\n} from \"./TopSitesConstants\";\nimport {LinkMenu} from \"content-src/components/LinkMenu/LinkMenu\";\nimport React from \"react\";\nimport {ScreenshotUtils} from \"content-src/lib/screenshot-utils\";\nimport {TOP_SITES_MAX_SITES_PER_ROW} from \"common/Reducers.jsm\";\n\nexport class TopSiteLink extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.state = {screenshotImage: null};\n    this.onDragEvent = this.onDragEvent.bind(this);\n    this.onKeyPress = this.onKeyPress.bind(this);\n  }\n\n  /*\n   * Helper to determine whether the drop zone should allow a drop. We only allow\n   * dropping top sites for now.\n   */\n  _allowDrop(e) {\n    return e.dataTransfer.types.includes(\"text/topsite-index\");\n  }\n\n  onDragEvent(event) {\n    switch (event.type) {\n      case \"click\":\n        // Stop any link clicks if we started any dragging\n        if (this.dragged) {\n          event.preventDefault();\n        }\n        break;\n      case \"dragstart\":\n        this.dragged = true;\n        event.dataTransfer.effectAllowed = \"move\";\n        event.dataTransfer.setData(\"text/topsite-index\", this.props.index);\n        event.target.blur();\n        this.props.onDragEvent(event, this.props.index, this.props.link, this.props.title);\n        break;\n      case \"dragend\":\n        this.props.onDragEvent(event);\n        break;\n      case \"dragenter\":\n      case \"dragover\":\n      case \"drop\":\n        if (this._allowDrop(event)) {\n          event.preventDefault();\n          this.props.onDragEvent(event, this.props.index);\n        }\n        break;\n      case \"mousedown\":\n        // Block the scroll wheel from appearing for middle clicks on search top sites\n        if (event.button === 1 && this.props.link.searchTopSite) {\n          event.preventDefault();\n        }\n        // Reset at the first mouse event of a potential drag\n        this.dragged = false;\n        break;\n    }\n  }\n\n  /**\n   * Helper to obtain the next state based on nextProps and prevState.\n   *\n   * NOTE: Rename this method to getDerivedStateFromProps when we update React\n   *       to >= 16.3. We will need to update tests as well. We cannot rename this\n   *       method to getDerivedStateFromProps now because there is a mismatch in\n   *       the React version that we are using for both testing and production.\n   *       (i.e. react-test-render => \"16.3.2\", react => \"16.2.0\").\n   *\n   * See https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-react-16/package.json#L43.\n   */\n  static getNextStateFromProps(nextProps, prevState) {\n    const {screenshot} = nextProps.link;\n    const imageInState = ScreenshotUtils.isRemoteImageLocal(prevState.screenshotImage, screenshot);\n    if (imageInState) {\n      return null;\n    }\n\n    // Since image was updated, attempt to revoke old image blob URL, if it exists.\n    ScreenshotUtils.maybeRevokeBlobObjectURL(prevState.screenshotImage);\n\n    return {screenshotImage: ScreenshotUtils.createLocalImageObject(screenshot)};\n  }\n\n  // NOTE: Remove this function when we update React to >= 16.3 since React will\n  //       call getDerivedStateFromProps automatically. We will also need to\n  //       rename getNextStateFromProps to getDerivedStateFromProps.\n  componentWillMount() {\n    const nextState = TopSiteLink.getNextStateFromProps(this.props, this.state);\n    if (nextState) {\n      this.setState(nextState);\n    }\n  }\n\n  // NOTE: Remove this function when we update React to >= 16.3 since React will\n  //       call getDerivedStateFromProps automatically. We will also need to\n  //       rename getNextStateFromProps to getDerivedStateFromProps.\n  componentWillReceiveProps(nextProps) {\n    const nextState = TopSiteLink.getNextStateFromProps(nextProps, this.state);\n    if (nextState) {\n      this.setState(nextState);\n    }\n  }\n\n  componentWillUnmount() {\n    ScreenshotUtils.maybeRevokeBlobObjectURL(this.state.screenshotImage);\n  }\n\n  onKeyPress(event) {\n    // If we have tabbed to a search shortcut top site, and we click 'enter',\n    // we should execute the onClick function. This needs to be added because\n    // search top sites are anchor tags without an href. See bug 1483135\n    if (this.props.link.searchTopSite && event.key === \"Enter\") {\n      this.props.onClick(event);\n    }\n  }\n\n  render() {\n    const {children, className, defaultStyle, isDraggable, link, onClick, title} = this.props;\n    const topSiteOuterClassName = `top-site-outer${className ? ` ${className}` : \"\"}${link.isDragged ? \" dragged\" : \"\"}${link.searchTopSite ? \" search-shortcut\" : \"\"}`;\n    const {tippyTopIcon, faviconSize} = link;\n    const [letterFallback] = title;\n    let imageClassName;\n    let imageStyle;\n    let showSmallFavicon = false;\n    let smallFaviconStyle;\n    let smallFaviconFallback;\n    let hasScreenshotImage = this.state.screenshotImage && this.state.screenshotImage.url;\n    if (defaultStyle) { // force no styles (letter fallback) even if the link has imagery\n      smallFaviconFallback = false;\n    } else if (link.searchTopSite) {\n      imageClassName = \"top-site-icon rich-icon\";\n      imageStyle = {\n        backgroundColor: link.backgroundColor,\n        backgroundImage: `url(${tippyTopIcon})`,\n      };\n      smallFaviconStyle = {backgroundImage:  `url(${tippyTopIcon})`};\n    } else if (link.customScreenshotURL) {\n      // assume high quality custom screenshot and use rich icon styles and class names\n      imageClassName = \"top-site-icon rich-icon\";\n      imageStyle = {\n        backgroundColor: link.backgroundColor,\n        backgroundImage: hasScreenshotImage ? `url(${this.state.screenshotImage.url})` : \"none\",\n      };\n    } else if (tippyTopIcon || faviconSize >= MIN_RICH_FAVICON_SIZE) {\n      // styles and class names for top sites with rich icons\n      imageClassName = \"top-site-icon rich-icon\";\n      imageStyle = {\n        backgroundColor: link.backgroundColor,\n        backgroundImage: `url(${tippyTopIcon || link.favicon})`,\n      };\n    } else {\n      // styles and class names for top sites with screenshot + small icon in top left corner\n      imageClassName = `screenshot${hasScreenshotImage ? \" active\" : \"\"}`;\n      imageStyle = {backgroundImage: hasScreenshotImage ? `url(${this.state.screenshotImage.url})` : \"none\"};\n\n      // only show a favicon in top left if it's greater than 16x16\n      if (faviconSize >= MIN_CORNER_FAVICON_SIZE) {\n        showSmallFavicon = true;\n        smallFaviconStyle = {backgroundImage:  `url(${link.favicon})`};\n      } else if (hasScreenshotImage) {\n        // Don't show a small favicon if there is no screenshot, because that\n        // would result in two fallback icons\n        showSmallFavicon = true;\n        smallFaviconFallback = true;\n      }\n    }\n    let draggableProps = {};\n    if (isDraggable) {\n      draggableProps = {\n        onClick: this.onDragEvent,\n        onDragEnd: this.onDragEvent,\n        onDragStart: this.onDragEvent,\n        onMouseDown: this.onDragEvent,\n      };\n    }\n    return (<li className={topSiteOuterClassName} onDrop={this.onDragEvent} onDragOver={this.onDragEvent} onDragEnter={this.onDragEvent} onDragLeave={this.onDragEvent} {...draggableProps}>\n      <div className=\"top-site-inner\">\n         <a href={link.searchTopSite ? undefined : link.url} tabIndex=\"0\" onKeyPress={this.onKeyPress} onClick={onClick} draggable={true}>\n            <div className=\"tile\" aria-hidden={true} data-fallback={letterFallback}>\n              <div className={imageClassName} style={imageStyle} />\n              {link.searchTopSite && <div className=\"top-site-icon search-topsite\" />}\n              {showSmallFavicon && <div\n                className=\"top-site-icon default-icon\"\n                data-fallback={smallFaviconFallback && letterFallback}\n                style={smallFaviconStyle} />}\n           </div>\n           <div className={`title ${link.isPinned ? \"pinned\" : \"\"}`}>\n             {link.isPinned && <div className=\"icon icon-pin-small\" />}\n              <span dir=\"auto\">{title}</span>\n           </div>\n         </a>\n         {children}\n      </div>\n    </li>);\n  }\n}\nTopSiteLink.defaultProps = {\n  title: \"\",\n  link: {},\n  isDraggable: true,\n};\n\nexport class TopSite extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.state = {showContextMenu: false};\n    this.onLinkClick = this.onLinkClick.bind(this);\n    this.onMenuButtonClick = this.onMenuButtonClick.bind(this);\n    this.onMenuUpdate = this.onMenuUpdate.bind(this);\n  }\n\n  /**\n   * Report to telemetry additional information about the item.\n   */\n  _getTelemetryInfo() {\n    const value = {icon_type: this.props.link.iconType};\n    // Filter out \"not_pinned\" type for being the default\n    if (this.props.link.isPinned) {\n      value.card_type = \"pinned\";\n    }\n    if (this.props.link.searchTopSite) {\n      // Set the card_type as \"search\" regardless of its pinning status\n      value.card_type = \"search\";\n      value.search_vendor = this.props.link.hostname;\n    }\n    return {value};\n  }\n\n  userEvent(event) {\n    this.props.dispatch(ac.UserEvent(Object.assign({\n      event,\n      source: TOP_SITES_SOURCE,\n      action_position: this.props.index,\n    }, this._getTelemetryInfo())));\n  }\n\n  onLinkClick(event) {\n    this.userEvent(\"CLICK\");\n\n    // Specially handle a top site link click for \"typed\" frecency bonus as\n    // specified as a property on the link.\n    event.preventDefault();\n    const {altKey, button, ctrlKey, metaKey, shiftKey} = event;\n    if (!this.props.link.searchTopSite) {\n      this.props.dispatch(ac.OnlyToMain({\n        type: at.OPEN_LINK,\n        data: Object.assign(this.props.link, {event: {altKey, button, ctrlKey, metaKey, shiftKey}}),\n      }));\n    } else {\n      this.props.dispatch(ac.OnlyToMain({\n        type: at.FILL_SEARCH_TERM,\n        data: {label: this.props.link.label},\n      }));\n    }\n  }\n\n  onMenuButtonClick(event) {\n    event.preventDefault();\n    this.props.onActivate(this.props.index);\n    this.setState({showContextMenu: true});\n  }\n\n  onMenuUpdate(showContextMenu) {\n    this.setState({showContextMenu});\n  }\n\n  render() {\n    const {props} = this;\n    const {link} = props;\n    const isContextMenuOpen = this.state.showContextMenu && props.activeIndex === props.index;\n    const title = link.label || link.hostname;\n    return (<TopSiteLink {...props} onClick={this.onLinkClick} onDragEvent={this.props.onDragEvent} className={`${props.className || \"\"}${isContextMenuOpen ? \" active\" : \"\"}`} title={title}>\n        <div>\n          <button className=\"context-menu-button icon\" title={this.props.intl.formatMessage({id: \"context_menu_title\"})} onClick={this.onMenuButtonClick}>\n            <span className=\"sr-only\">\n              <FormattedMessage id=\"context_menu_button_sr\" values={{title}} />\n            </span>\n          </button>\n          {isContextMenuOpen &&\n            <LinkMenu\n              dispatch={props.dispatch}\n              index={props.index}\n              onUpdate={this.onMenuUpdate}\n              options={link.searchTopSite ? TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS : TOP_SITES_CONTEXT_MENU_OPTIONS}\n              site={link}\n              siteInfo={this._getTelemetryInfo()}\n              source={TOP_SITES_SOURCE} />\n          }\n        </div>\n    </TopSiteLink>);\n  }\n}\nTopSite.defaultProps = {\n  link: {},\n  onActivate() {},\n};\n\nexport class TopSitePlaceholder extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onEditButtonClick = this.onEditButtonClick.bind(this);\n  }\n\n  onEditButtonClick() {\n    this.props.dispatch(\n      {type: at.TOP_SITES_EDIT, data: {index: this.props.index}});\n  }\n\n  render() {\n    return (<TopSiteLink {...this.props} className={`placeholder ${this.props.className || \"\"}`} isDraggable={false}>\n      <button className=\"context-menu-button edit-button icon\"\n       title={this.props.intl.formatMessage({id: \"edit_topsites_edit_button\"})}\n       onClick={this.onEditButtonClick} />\n    </TopSiteLink>);\n  }\n}\n\nexport class _TopSiteList extends React.PureComponent {\n  static get DEFAULT_STATE() {\n    return {\n      activeIndex: null,\n      draggedIndex: null,\n      draggedSite: null,\n      draggedTitle: null,\n      topSitesPreview: null,\n    };\n  }\n\n  constructor(props) {\n    super(props);\n    this.state = _TopSiteList.DEFAULT_STATE;\n    this.onDragEvent = this.onDragEvent.bind(this);\n    this.onActivate = this.onActivate.bind(this);\n  }\n\n  componentWillReceiveProps(nextProps) {\n    if (this.state.draggedSite) {\n      const prevTopSites = this.props.TopSites && this.props.TopSites.rows;\n      const newTopSites = nextProps.TopSites && nextProps.TopSites.rows;\n      if (prevTopSites && prevTopSites[this.state.draggedIndex] &&\n        prevTopSites[this.state.draggedIndex].url === this.state.draggedSite.url &&\n        (!newTopSites[this.state.draggedIndex] || newTopSites[this.state.draggedIndex].url !== this.state.draggedSite.url)) {\n        // We got the new order from the redux store via props. We can clear state now.\n        this.setState(_TopSiteList.DEFAULT_STATE);\n      }\n    }\n  }\n\n  userEvent(event, index) {\n    this.props.dispatch(ac.UserEvent({\n      event,\n      source: TOP_SITES_SOURCE,\n      action_position: index,\n    }));\n  }\n\n  onDragEvent(event, index, link, title) {\n    switch (event.type) {\n      case \"dragstart\":\n        this.dropped = false;\n        this.setState({\n          draggedIndex: index,\n          draggedSite: link,\n          draggedTitle: title,\n          activeIndex: null,\n        });\n        this.userEvent(\"DRAG\", index);\n        break;\n      case \"dragend\":\n        if (!this.dropped) {\n          // If there was no drop event, reset the state to the default.\n          this.setState(_TopSiteList.DEFAULT_STATE);\n        }\n        break;\n      case \"dragenter\":\n        if (index === this.state.draggedIndex) {\n          this.setState({topSitesPreview: null});\n        } else {\n          this.setState({topSitesPreview: this._makeTopSitesPreview(index)});\n        }\n        break;\n      case \"drop\":\n        if (index !== this.state.draggedIndex) {\n          this.dropped = true;\n          this.props.dispatch(ac.AlsoToMain({\n            type: at.TOP_SITES_INSERT,\n            data: {\n              site: {\n                url: this.state.draggedSite.url,\n                label: this.state.draggedTitle,\n                customScreenshotURL: this.state.draggedSite.customScreenshotURL,\n                // Only if the search topsites experiment is enabled\n                ...(this.state.draggedSite.searchTopSite && {searchTopSite: true}),\n              },\n              index,\n              draggedFromIndex: this.state.draggedIndex,\n            },\n          }));\n          this.userEvent(\"DROP\", index);\n        }\n        break;\n    }\n  }\n\n  _getTopSites() {\n    // Make a copy of the sites to truncate or extend to desired length\n    let topSites = this.props.TopSites.rows.slice();\n    topSites.length = this.props.TopSitesRows * TOP_SITES_MAX_SITES_PER_ROW;\n    return topSites;\n  }\n\n  /**\n   * Make a preview of the topsites that will be the result of dropping the currently\n   * dragged site at the specified index.\n   */\n  _makeTopSitesPreview(index) {\n    const topSites = this._getTopSites();\n    topSites[this.state.draggedIndex] = null;\n    const pinnedOnly = topSites.map(site => ((site && site.isPinned) ? site : null));\n    const unpinned = topSites.filter(site => site && !site.isPinned);\n    const siteToInsert = Object.assign({}, this.state.draggedSite, {isPinned: true, isDragged: true});\n    if (!pinnedOnly[index]) {\n      pinnedOnly[index] = siteToInsert;\n    } else {\n      // Find the hole to shift the pinned site(s) towards. We shift towards the\n      // hole left by the site being dragged.\n      let holeIndex = index;\n      const indexStep = index > this.state.draggedIndex ? -1 : 1;\n      while (pinnedOnly[holeIndex]) {\n        holeIndex += indexStep;\n      }\n\n      // Shift towards the hole.\n      const shiftingStep = index > this.state.draggedIndex ? 1 : -1;\n      while (holeIndex !== index) {\n        const nextIndex = holeIndex + shiftingStep;\n        pinnedOnly[holeIndex] = pinnedOnly[nextIndex];\n        holeIndex = nextIndex;\n      }\n      pinnedOnly[index] = siteToInsert;\n    }\n\n    // Fill in the remaining holes with unpinned sites.\n    const preview = pinnedOnly;\n    for (let i = 0; i < preview.length; i++) {\n      if (!preview[i]) {\n        preview[i] = unpinned.shift() || null;\n      }\n    }\n\n    return preview;\n  }\n\n  onActivate(index) {\n    this.setState({activeIndex: index});\n  }\n\n  render() {\n    const {props} = this;\n    const topSites = this.state.topSitesPreview || this._getTopSites();\n    const topSitesUI = [];\n    const commonProps = {\n      onDragEvent: this.onDragEvent,\n      dispatch: props.dispatch,\n      intl: props.intl,\n    };\n    // We assign a key to each placeholder slot. We need it to be independent\n    // of the slot index (i below) so that the keys used stay the same during\n    // drag and drop reordering and the underlying DOM nodes are reused.\n    // This mostly (only?) affects linux so be sure to test on linux before changing.\n    let holeIndex = 0;\n\n    // On narrow viewports, we only show 6 sites per row. We'll mark the rest as\n    // .hide-for-narrow to hide in CSS via @media query.\n    const maxNarrowVisibleIndex = props.TopSitesRows * 6;\n\n    for (let i = 0, l = topSites.length; i < l; i++) {\n      const link = topSites[i] && Object.assign({}, topSites[i], {iconType: this.props.topSiteIconType(topSites[i])});\n      const slotProps = {\n        key: link ? link.url : holeIndex++,\n        index: i,\n      };\n      if (i >= maxNarrowVisibleIndex) {\n        slotProps.className = \"hide-for-narrow\";\n      }\n      topSitesUI.push(!link ? (\n        <TopSitePlaceholder\n          {...slotProps}\n          {...commonProps} />\n      ) : (\n        <TopSite\n          link={link}\n          activeIndex={this.state.activeIndex}\n          onActivate={this.onActivate}\n          {...slotProps}\n          {...commonProps} />\n      ));\n    }\n    return (<ul className={`top-sites-list${this.state.draggedSite ? \" dnd-active\" : \"\"}`}>\n      {topSitesUI}\n    </ul>);\n  }\n}\n\nexport const TopSiteList = injectIntl(_TopSiteList);\n","import {actionCreators as ac} from \"common/Actions.jsm\";\nimport {connect} from \"react-redux\";\nimport {ContextMenu} from \"content-src/components/ContextMenu/ContextMenu\";\nimport {injectIntl} from \"react-intl\";\nimport {LinkMenuOptions} from \"content-src/lib/link-menu-options\";\nimport React from \"react\";\n\nconst DEFAULT_SITE_MENU_OPTIONS = [\"CheckPinTopSite\", \"EditTopSite\", \"Separator\", \"OpenInNewWindow\", \"OpenInPrivateWindow\", \"Separator\", \"BlockUrl\"];\n\nexport class _LinkMenu extends React.PureComponent {\n  getOptions() {\n    const {props} = this;\n    const {site, index, source, isPrivateBrowsingEnabled, siteInfo, platform} = props;\n\n    // Handle special case of default site\n    const propOptions = (!site.isDefault || site.searchTopSite) ? props.options : DEFAULT_SITE_MENU_OPTIONS;\n\n    const options = propOptions.map(o => LinkMenuOptions[o](site, index, source, isPrivateBrowsingEnabled, siteInfo, platform)).map(option => {\n      const {action, impression, id, string_id, type, userEvent} = option;\n      if (!type && id) {\n        option.label = props.intl.formatMessage({id: string_id || id});\n        option.onClick = () => {\n          props.dispatch(action);\n          if (userEvent) {\n            const userEventData = Object.assign({\n              event: userEvent,\n              source,\n              action_position: index,\n            }, siteInfo);\n            props.dispatch(ac.UserEvent(userEventData));\n          }\n          if (impression && props.shouldSendImpressionStats) {\n            props.dispatch(impression);\n          }\n        };\n      }\n      return option;\n    });\n\n    // This is for accessibility to support making each item tabbable.\n    // We want to know which item is the first and which item\n    // is the last, so we can close the context menu accordingly.\n    options[0].first = true;\n    options[options.length - 1].last = true;\n    return options;\n  }\n\n  render() {\n    return (<ContextMenu\n      onUpdate={this.props.onUpdate}\n      options={this.getOptions()} />);\n  }\n}\n\nconst getState = state => ({isPrivateBrowsingEnabled: state.Prefs.values.isPrivateBrowsingEnabled, platform: state.Prefs.values.platform});\nexport const LinkMenu = connect(getState)(injectIntl(_LinkMenu));\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\n\nconst _OpenInPrivateWindow = site => ({\n  id: \"menu_action_open_private_window\",\n  icon: \"new-window-private\",\n  action: ac.OnlyToMain({\n    type: at.OPEN_PRIVATE_WINDOW,\n    data: {url: site.url, referrer: site.referrer},\n  }),\n  userEvent: \"OPEN_PRIVATE_WINDOW\",\n});\n\nexport const GetPlatformString = platform => {\n  switch (platform) {\n    case \"win\":\n      return \"menu_action_show_file_windows\";\n    case \"macosx\":\n      return \"menu_action_show_file_mac_os\";\n    case \"linux\":\n      return \"menu_action_show_file_linux\";\n    default:\n      return \"menu_action_show_file_default\";\n  }\n};\n\n/**\n * List of functions that return items that can be included as menu options in a\n * LinkMenu. All functions take the site as the first parameter, and optionally\n * the index of the site.\n */\nexport const LinkMenuOptions = {\n  Separator: () => ({type: \"separator\"}),\n  EmptyItem: () => ({type: \"empty\"}),\n  RemoveBookmark: site => ({\n    id: \"menu_action_remove_bookmark\",\n    icon: \"bookmark-added\",\n    action: ac.AlsoToMain({\n      type: at.DELETE_BOOKMARK_BY_ID,\n      data: site.bookmarkGuid,\n    }),\n    userEvent: \"BOOKMARK_DELETE\",\n  }),\n  AddBookmark: site => ({\n    id: \"menu_action_bookmark\",\n    icon: \"bookmark-hollow\",\n    action: ac.AlsoToMain({\n      type: at.BOOKMARK_URL,\n      data: {url: site.url, title: site.title, type: site.type},\n    }),\n    userEvent: \"BOOKMARK_ADD\",\n  }),\n  OpenInNewWindow: site => ({\n    id: \"menu_action_open_new_window\",\n    icon: \"new-window\",\n    action: ac.AlsoToMain({\n      type: at.OPEN_NEW_WINDOW,\n      data: {\n        referrer: site.referrer,\n        typedBonus: site.typedBonus,\n        url: site.url,\n      },\n    }),\n    userEvent: \"OPEN_NEW_WINDOW\",\n  }),\n  BlockUrl: (site, index, eventSource) => ({\n    id: \"menu_action_dismiss\",\n    icon: \"dismiss\",\n    action: ac.AlsoToMain({\n      type: at.BLOCK_URL,\n      data: {url: site.open_url || site.url, pocket_id: site.pocket_id},\n    }),\n    impression: ac.ImpressionStats({\n      source: eventSource,\n      block: 0,\n      tiles: [{id: site.guid, pos: index}],\n    }),\n    userEvent: \"BLOCK\",\n  }),\n\n  // This is an option for web extentions which will result in remove items from\n  // memory and notify the web extenion, rather than using the built-in block list.\n  WebExtDismiss: (site, index, eventSource) => ({\n    id: \"menu_action_webext_dismiss\",\n    string_id: \"menu_action_dismiss\",\n    icon: \"dismiss\",\n    action: ac.WebExtEvent(at.WEBEXT_DISMISS, {\n      source: eventSource,\n      url: site.url,\n      action_position: index,\n    }),\n  }),\n  DeleteUrl: (site, index, eventSource, isEnabled, siteInfo) => ({\n    id: \"menu_action_delete\",\n    icon: \"delete\",\n    action: {\n      type: at.DIALOG_OPEN,\n      data: {\n        onConfirm: [\n          ac.AlsoToMain({type: at.DELETE_HISTORY_URL, data: {url: site.url, pocket_id: site.pocket_id, forceBlock: site.bookmarkGuid}}),\n          ac.UserEvent(Object.assign({event: \"DELETE\", source: eventSource, action_position: index}, siteInfo)),\n        ],\n        eventSource,\n        body_string_id: [\"confirm_history_delete_p1\", \"confirm_history_delete_notice_p2\"],\n        confirm_button_string_id: \"menu_action_delete\",\n        cancel_button_string_id: \"topsites_form_cancel_button\",\n        icon: \"modal-delete\",\n      },\n    },\n    userEvent: \"DIALOG_OPEN\",\n  }),\n  ShowFile: (site, index, eventSource, isEnabled, siteInfo, platform) => ({\n    id: GetPlatformString(platform),\n    icon: \"search\",\n    action: ac.OnlyToMain({\n      type: at.SHOW_DOWNLOAD_FILE,\n      data: {url: site.url},\n    }),\n  }),\n  OpenFile: site => ({\n    id: \"menu_action_open_file\",\n    icon: \"open-file\",\n    action: ac.OnlyToMain({\n      type: at.OPEN_DOWNLOAD_FILE,\n      data: {url: site.url},\n    }),\n  }),\n  CopyDownloadLink: site => ({\n    id: \"menu_action_copy_download_link\",\n    icon: \"copy\",\n    action: ac.OnlyToMain({\n      type: at.COPY_DOWNLOAD_LINK,\n      data: {url: site.url},\n    }),\n  }),\n  GoToDownloadPage: site => ({\n    id: \"menu_action_go_to_download_page\",\n    icon: \"download\",\n    action: ac.OnlyToMain({\n      type: at.OPEN_LINK,\n      data: {url: site.referrer},\n    }),\n    disabled: !site.referrer,\n  }),\n  RemoveDownload: site => ({\n    id: \"menu_action_remove_download\",\n    icon: \"delete\",\n    action: ac.OnlyToMain({\n      type: at.REMOVE_DOWNLOAD_FILE,\n      data: {url: site.url},\n    }),\n  }),\n  PinTopSite: ({url, searchTopSite, label}, index) => ({\n    id: \"menu_action_pin\",\n    icon: \"pin\",\n    action: ac.AlsoToMain({\n      type: at.TOP_SITES_PIN,\n      data: {\n        site: {\n          url,\n          ...(searchTopSite && {searchTopSite, label}),\n        },\n        index,\n      },\n    }),\n    userEvent: \"PIN\",\n  }),\n  UnpinTopSite: site => ({\n    id: \"menu_action_unpin\",\n    icon: \"unpin\",\n    action: ac.AlsoToMain({\n      type: at.TOP_SITES_UNPIN,\n      data: {site: {url: site.url}},\n    }),\n    userEvent: \"UNPIN\",\n  }),\n  SaveToPocket: (site, index, eventSource) => ({\n    id: \"menu_action_save_to_pocket\",\n    icon: \"pocket-save\",\n    action: ac.AlsoToMain({\n      type: at.SAVE_TO_POCKET,\n      data: {site: {url: site.url, title: site.title}},\n    }),\n    impression: ac.ImpressionStats({\n      source: eventSource,\n      pocket: 0,\n      tiles: [{id: site.guid, pos: index}],\n    }),\n    userEvent: \"SAVE_TO_POCKET\",\n  }),\n  DeleteFromPocket: site => ({\n    id: \"menu_action_delete_pocket\",\n    icon: \"delete\",\n    action: ac.AlsoToMain({\n      type: at.DELETE_FROM_POCKET,\n      data: {pocket_id: site.pocket_id},\n    }),\n    userEvent: \"DELETE_FROM_POCKET\",\n  }),\n  ArchiveFromPocket: site => ({\n    id: \"menu_action_archive_pocket\",\n    icon: \"check\",\n    action: ac.AlsoToMain({\n      type: at.ARCHIVE_FROM_POCKET,\n      data: {pocket_id: site.pocket_id},\n    }),\n    userEvent: \"ARCHIVE_FROM_POCKET\",\n  }),\n  EditTopSite: (site, index) => ({\n    id: \"edit_topsites_button_text\",\n    icon: \"edit\",\n    action: {\n      type: at.TOP_SITES_EDIT,\n      data: {index},\n    },\n  }),\n  CheckBookmark: site => (site.bookmarkGuid ? LinkMenuOptions.RemoveBookmark(site) : LinkMenuOptions.AddBookmark(site)),\n  CheckPinTopSite: (site, index) => (site.isPinned ? LinkMenuOptions.UnpinTopSite(site) : LinkMenuOptions.PinTopSite(site, index)),\n  CheckSavedToPocket: (site, index) => (site.pocket_id ? LinkMenuOptions.DeleteFromPocket(site) : LinkMenuOptions.SaveToPocket(site, index)),\n  CheckBookmarkOrArchive: site => (site.pocket_id ? LinkMenuOptions.ArchiveFromPocket(site) : LinkMenuOptions.CheckBookmark(site)),\n  OpenInPrivateWindow: (site, index, eventSource, isEnabled) => (isEnabled ? _OpenInPrivateWindow(site) : LinkMenuOptions.EmptyItem()),\n};\n","/**\n * List of helper functions for screenshot-based images.\n *\n * There are two kinds of images:\n * 1. Remote Image: This is the image from the main process and it refers to\n *    the image in the React props. This can either be an object with the `data`\n *    and `path` properties, if it is a blob, or a string, if it is a normal image.\n * 2. Local Image: This is the image object in the content process and it refers\n *    to the image *object* in the React component's state. All local image\n *    objects have the `url` property, and an additional property `path`, if they\n *    are blobs.\n */\nexport const ScreenshotUtils = {\n  isBlob(isLocal, image) {\n    return !!(image && image.path && ((!isLocal && image.data) || (isLocal && image.url)));\n  },\n\n  // This should always be called with a remote image and not a local image.\n  createLocalImageObject(remoteImage) {\n    if (!remoteImage) {\n      return null;\n    }\n    if (this.isBlob(false, remoteImage)) {\n      return {url: global.URL.createObjectURL(remoteImage.data), path: remoteImage.path};\n    }\n    return {url: remoteImage};\n  },\n\n  // Revokes the object URL of the image if the local image is a blob.\n  // This should always be called with a local image and not a remote image.\n  maybeRevokeBlobObjectURL(localImage) {\n    if (this.isBlob(true, localImage)) {\n      global.URL.revokeObjectURL(localImage.url);\n    }\n  },\n\n  // Checks if remoteImage and localImage are the same.\n  isRemoteImageLocal(localImage, remoteImage) {\n    // Both remoteImage and localImage are present.\n    if (remoteImage && localImage) {\n      return this.isBlob(false, remoteImage) ?\n             localImage.path === remoteImage.path :\n             localImage.url === remoteImage;\n    }\n\n    // This will only handle the remaining three possible outcomes.\n    // (i.e. everything except when both image and localImage are present)\n    return !remoteImage && !localImage;\n  },\n};\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {connect} from \"react-redux\";\nimport {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\n\n/**\n * Manual migration component used to start the profile import wizard.\n * Message is presented temporarily and will go away if:\n * 1.  User clicks \"No Thanks\"\n * 2.  User completed the data import\n * 3.  After 3 active days\n * 4.  User clicks \"Cancel\" on the import wizard (currently not implemented).\n */\nexport class _ManualMigration extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onLaunchTour = this.onLaunchTour.bind(this);\n    this.onCancelTour = this.onCancelTour.bind(this);\n  }\n\n  onLaunchTour() {\n    this.props.dispatch(ac.AlsoToMain({type: at.MIGRATION_START}));\n    this.props.dispatch(ac.UserEvent({event: at.MIGRATION_START}));\n  }\n\n  onCancelTour() {\n    this.props.dispatch(ac.AlsoToMain({type: at.MIGRATION_CANCEL}));\n    this.props.dispatch(ac.UserEvent({event: at.MIGRATION_CANCEL}));\n  }\n\n  render() {\n    return (<div className=\"manual-migration-container\">\n        <p>\n          <span className=\"icon icon-import\" />\n          <FormattedMessage id=\"manual_migration_explanation2\" />\n        </p>\n        <div className=\"manual-migration-actions actions\">\n          <button className=\"dismiss\" onClick={this.onCancelTour}>\n            <FormattedMessage id=\"manual_migration_cancel_button\" />\n          </button>\n          <button onClick={this.onLaunchTour}>\n            <FormattedMessage id=\"manual_migration_import_button\" />\n          </button>\n        </div>\n    </div>);\n  }\n}\n\nexport const ManualMigration = connect()(_ManualMigration);\n","class _PrerenderData {\n  constructor(options) {\n    this.initialPrefs = options.initialPrefs;\n    this.initialSections = options.initialSections;\n    this._setValidation(options.validation);\n  }\n\n  get validation() {\n    return this._validation;\n  }\n\n  set validation(value) {\n    this._setValidation(value);\n  }\n\n  get invalidatingPrefs() {\n    return this._invalidatingPrefs;\n  }\n\n    // This is needed so we can use it in the constructor\n  _setValidation(value = []) {\n    this._validation = value;\n    this._invalidatingPrefs = value.reduce((result, next) => {\n      if (typeof next === \"string\") {\n        result.push(next);\n        return result;\n      } else if (next && next.oneOf) {\n        return result.concat(next.oneOf);\n      } else if (next && next.indexedDB) {\n        return result.concat(next.indexedDB);\n      } else if (next && next.jsonPrefs) {\n        return result.concat(next.jsonPrefs);\n      }\n      throw new Error(\"Your validation configuration is not properly configured\");\n    }, []);\n  }\n\n  _isPrefEnabled(prefObj) {\n    try {\n      let data = JSON.parse(prefObj);\n      return data && data.enabled;\n    } catch (e) {\n      return null;\n    }\n  }\n\n  arePrefsValid(getPref, indexedDBPrefs) {\n    for (const prefs of this.validation) {\n      // {oneOf: [\"foo\", \"bar\"]}\n      if (prefs && prefs.oneOf && !prefs.oneOf.some(name => getPref(name) === this.initialPrefs[name])) {\n        return false;\n\n        // {indexedDB: [\"foo\", \"bar\"]}\n      } else if (indexedDBPrefs && prefs && prefs.indexedDB) {\n        const anyModifiedPrefs = prefs.indexedDB.some(prefName => indexedDBPrefs.some(pref => pref && pref[prefName]));\n        if (anyModifiedPrefs) {\n          return false;\n        }\n        // {jsonPrefs: [\"foo\", \"bar\"]}\n      } else if (prefs && prefs.jsonPrefs) {\n        const isPrefModified =\n          prefs.jsonPrefs.some(name => this._isPrefEnabled(getPref(name)) !== this.initialPrefs[name].enabled);\n        if (isPrefModified) {\n          return false;\n        }\n        // \"foo\"\n      } else if (getPref(prefs) !== this.initialPrefs[prefs]) {\n        return false;\n      }\n    }\n    return true;\n  }\n}\n\nthis.PrerenderData = new _PrerenderData({\n  initialPrefs: {\n    \"migrationExpired\": true,\n    \"feeds.topsites\": true,\n    \"showSearch\": true,\n    \"topSitesRows\": 1,\n    \"feeds.section.topstories\": true,\n    \"feeds.section.highlights\": true,\n    \"sectionOrder\": \"topsites,topstories,highlights\",\n    \"collapsed\": false,\n    \"discoverystream.config\": {\"enabled\": false},\n  },\n  // Prefs listed as invalidating will prevent the prerendered version\n  // of AS from being used if their value is something other than what is listed\n  // here. This is required because some preferences cause the page layout to be\n  // too different for the prerendered version to be used. Unfortunately, this\n  // will result in users who have modified some of their preferences not being\n  // able to get the benefits of prerendering.\n  validation: [\n    \"feeds.topsites\",\n    \"showSearch\",\n    \"topSitesRows\",\n    \"sectionOrder\",\n    // This means if either of these are set to their default values,\n    // prerendering can be used.\n    {oneOf: [\"feeds.section.topstories\", \"feeds.section.highlights\"]},\n    // If any component has the following preference set to `true` it will\n    // invalidate the prerendered version.\n    {indexedDB: [\"collapsed\"]},\n    // For below prefs, parse value to check enabled property. If enabled property\n    // differs from initial prefs enabled value, prerendering cannot be used\n    {jsonPrefs: [\"discoverystream.config\"]},\n  ],\n  initialSections: [\n    {\n      enabled: true,\n      icon: \"pocket\",\n      id: \"topstories\",\n      order: 1,\n      title: {id: \"header_recommended_by\", values: {provider: \"Pocket\"}},\n    },\n    {\n      enabled: true,\n      id: \"highlights\",\n      icon: \"highlights\",\n      order: 2,\n      title: {id: \"header_highlights\"},\n    },\n  ],\n});\n\nthis._PrerenderData = _PrerenderData;\nconst EXPORTED_SYMBOLS = [\"PrerenderData\", \"_PrerenderData\"];\n","/* globals ContentSearchUIController */\n\"use strict\";\n\nimport {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {FormattedMessage, injectIntl} from \"react-intl\";\nimport {connect} from \"react-redux\";\nimport {IS_NEWTAB} from \"content-src/lib/constants\";\nimport React from \"react\";\n\nexport class _Search extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onSearchClick = this.onSearchClick.bind(this);\n    this.onSearchHandoffClick = this.onSearchHandoffClick.bind(this);\n    this.onSearchHandoffPaste = this.onSearchHandoffPaste.bind(this);\n    this.onSearchHandoffDrop = this.onSearchHandoffDrop.bind(this);\n    this.onInputMount = this.onInputMount.bind(this);\n    this.onSearchHandoffButtonMount = this.onSearchHandoffButtonMount.bind(this);\n  }\n\n  handleEvent(event) {\n    // Also track search events with our own telemetry\n    if (event.detail.type === \"Search\") {\n      this.props.dispatch(ac.UserEvent({event: \"SEARCH\"}));\n    }\n  }\n\n  onSearchClick(event) {\n    window.gContentSearchController.search(event);\n  }\n\n  doSearchHandoff(text) {\n    this.props.dispatch(ac.OnlyToMain({type: at.HANDOFF_SEARCH_TO_AWESOMEBAR, data: {text}}));\n    this.props.dispatch({type: at.FAKE_FOCUS_SEARCH});\n    this.props.dispatch(ac.UserEvent({event: \"SEARCH_HANDOFF\"}));\n    if (text) {\n      this.props.dispatch({type: at.HIDE_SEARCH});\n    }\n  }\n\n  onSearchHandoffClick(event) {\n    // When search hand-off is enabled, we render a big button that is styled to\n    // look like a search textbox. If the button is clicked, we style\n    // the button as if it was a focused search box and show a fake cursor but\n    // really focus the awesomebar without the focus styles (\"hidden focus\").\n    event.preventDefault();\n    this.doSearchHandoff();\n  }\n\n  onSearchHandoffPaste(event) {\n    event.preventDefault();\n    this.doSearchHandoff(event.clipboardData.getData(\"Text\"));\n  }\n\n  onSearchHandoffDrop(event) {\n    event.preventDefault();\n    let text = event.dataTransfer.getData(\"text\");\n    if (text) {\n      this.doSearchHandoff(text);\n    }\n  }\n\n  componentWillUnmount() {\n    delete window.gContentSearchController;\n  }\n\n  onInputMount(input) {\n    if (input) {\n      // The \"healthReportKey\" and needs to be \"newtab\" or \"abouthome\" so that\n      // BrowserUsageTelemetry.jsm knows to handle events with this name, and\n      // can add the appropriate telemetry probes for search. Without the correct\n      // name, certain tests like browser_UsageTelemetry_content.js will fail\n      // (See github ticket #2348 for more details)\n      const healthReportKey = IS_NEWTAB ? \"newtab\" : \"abouthome\";\n\n      // The \"searchSource\" needs to be \"newtab\" or \"homepage\" and is sent with\n      // the search data and acts as context for the search request (See\n      // nsISearchEngine.getSubmission). It is necessary so that search engine\n      // plugins can correctly atribute referrals. (See github ticket #3321 for\n      // more details)\n      const searchSource = IS_NEWTAB ? \"newtab\" : \"homepage\";\n\n      // gContentSearchController needs to exist as a global so that tests for\n      // the existing about:home can find it; and so it allows these tests to pass.\n      // In the future, when activity stream is default about:home, this can be renamed\n      window.gContentSearchController = new ContentSearchUIController(input, input.parentNode,\n        healthReportKey, searchSource);\n      addEventListener(\"ContentSearchClient\", this);\n    } else {\n      window.gContentSearchController = null;\n      removeEventListener(\"ContentSearchClient\", this);\n    }\n  }\n\n  onSearchHandoffButtonMount(button) {\n    // Keep a reference to the button for use during \"paste\" event handling.\n    this._searchHandoffButton = button;\n  }\n\n  /*\n   * Do not change the ID on the input field, as legacy newtab code\n   * specifically looks for the id 'newtab-search-text' on input fields\n   * in order to execute searches in various tests\n   */\n  render() {\n    const wrapperClassName = [\n      \"search-wrapper\",\n      this.props.hide && \"search-hidden\",\n      this.props.fakeFocus && \"fake-focus\",\n    ].filter(v => v).join(\" \");\n\n    return (<div className={wrapperClassName}>\n      {this.props.showLogo &&\n        <div className=\"logo-and-wordmark\">\n          <div className=\"logo\" />\n          <div className=\"wordmark\" />\n        </div>\n      }\n      {!this.props.handoffEnabled &&\n      <div className=\"search-inner-wrapper\">\n        <label htmlFor=\"newtab-search-text\" className=\"search-label\">\n          <span className=\"sr-only\"><FormattedMessage id=\"search_web_placeholder\" /></span>\n        </label>\n        <input\n          id=\"newtab-search-text\"\n          maxLength=\"256\"\n          placeholder={this.props.intl.formatMessage({id: \"search_web_placeholder\"})}\n          ref={this.onInputMount}\n          title={this.props.intl.formatMessage({id: \"search_web_placeholder\"})}\n          type=\"search\" />\n        <button\n          id=\"searchSubmit\"\n          className=\"search-button\"\n          onClick={this.onSearchClick}\n          title={this.props.intl.formatMessage({id: \"search_button\"})}>\n          <span className=\"sr-only\"><FormattedMessage id=\"search_button\" /></span>\n        </button>\n      </div>\n      }\n      {this.props.handoffEnabled &&\n        <div className=\"search-inner-wrapper\">\n          <button\n            className=\"search-handoff-button\"\n            ref={this.onSearchHandoffButtonMount}\n            onClick={this.onSearchHandoffClick}\n            tabIndex=\"-1\"\n            title={this.props.intl.formatMessage({id: \"search_web_placeholder\"})}>\n            <div className=\"fake-textbox\">{this.props.intl.formatMessage({id: \"search_web_placeholder\"})}</div>\n            <input type=\"search\" className=\"fake-editable\" tabIndex=\"-1\" aria-hidden=\"true\" onDrop={this.onSearchHandoffDrop} onPaste={this.onSearchHandoffPaste} />\n            <div className=\"fake-caret\" />\n          </button>\n          {/*\n            This dummy and hidden input below is so we can load ContentSearchUIController.\n            Why? It sets --newtab-search-icon for us and it isn't trivial to port over.\n          */}\n          <input\n            type=\"search\"\n            style={{display: \"none\"}}\n            ref={this.onInputMount} />\n        </div>\n      }\n    </div>);\n  }\n}\n\nexport const Search = connect()(injectIntl(_Search));\n","export const IS_NEWTAB = global.document && global.document.documentURI === \"about:newtab\";\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {Card, PlaceholderCard} from \"content-src/components/Card/Card\";\nimport {FormattedMessage, injectIntl} from \"react-intl\";\nimport {CollapsibleSection} from \"content-src/components/CollapsibleSection/CollapsibleSection\";\nimport {ComponentPerfTimer} from \"content-src/components/ComponentPerfTimer/ComponentPerfTimer\";\nimport {connect} from \"react-redux\";\nimport {MoreRecommendations} from \"content-src/components/MoreRecommendations/MoreRecommendations\";\nimport {PocketLoggedInCta} from \"content-src/components/PocketLoggedInCta/PocketLoggedInCta\";\nimport React from \"react\";\nimport {Topics} from \"content-src/components/Topics/Topics\";\nimport {TopSites} from \"content-src/components/TopSites/TopSites\";\n\nconst VISIBLE = \"visible\";\nconst VISIBILITY_CHANGE_EVENT = \"visibilitychange\";\nconst CARDS_PER_ROW_DEFAULT = 3;\nconst CARDS_PER_ROW_COMPACT_WIDE = 4;\n\nfunction getFormattedMessage(message) {\n  return typeof message === \"string\" ? <span>{message}</span> : <FormattedMessage {...message} />;\n}\n\nexport class Section extends React.PureComponent {\n  get numRows() {\n    const {rowsPref, maxRows, Prefs} = this.props;\n    return rowsPref ? Prefs.values[rowsPref] : maxRows;\n  }\n\n  _dispatchImpressionStats() {\n    const {props} = this;\n    let cardsPerRow = CARDS_PER_ROW_DEFAULT;\n    if (props.compactCards && global.matchMedia(`(min-width: 1072px)`).matches) {\n      // If the section has compact cards and the viewport is wide enough, we show\n      // 4 columns instead of 3.\n      // $break-point-widest = 1072px (from _variables.scss)\n      cardsPerRow = CARDS_PER_ROW_COMPACT_WIDE;\n    }\n    const maxCards = cardsPerRow * this.numRows;\n    const cards = props.rows.slice(0, maxCards);\n\n    if (this.needsImpressionStats(cards)) {\n      props.dispatch(ac.ImpressionStats({\n        source: props.eventSource,\n        tiles: cards.map(link => ({id: link.guid})),\n      }));\n      this.impressionCardGuids = cards.map(link => link.guid);\n    }\n  }\n\n  // This sends an event when a user sees a set of new content. If content\n  // changes while the page is hidden (i.e. preloaded or on a hidden tab),\n  // only send the event if the page becomes visible again.\n  sendImpressionStatsOrAddListener() {\n    const {props} = this;\n\n    if (!props.shouldSendImpressionStats || !props.dispatch) {\n      return;\n    }\n\n    if (props.document.visibilityState === VISIBLE) {\n      this._dispatchImpressionStats();\n    } else {\n      // We should only ever send the latest impression stats ping, so remove any\n      // older listeners.\n      if (this._onVisibilityChange) {\n        props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n      }\n\n      // When the page becomes visible, send the impression stats ping if the section isn't collapsed.\n      this._onVisibilityChange = () => {\n        if (props.document.visibilityState === VISIBLE) {\n          if (!this.props.pref.collapsed) {\n            this._dispatchImpressionStats();\n          }\n          props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n        }\n      };\n      props.document.addEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n    }\n  }\n\n  componentWillMount() {\n    this.sendNewTabRehydrated(this.props.initialized);\n  }\n\n  componentDidMount() {\n    if (this.props.rows.length && !this.props.pref.collapsed) {\n      this.sendImpressionStatsOrAddListener();\n    }\n  }\n\n  componentDidUpdate(prevProps) {\n    const {props} = this;\n    const isCollapsed = props.pref.collapsed;\n    const wasCollapsed = prevProps.pref.collapsed;\n    if (\n      // Don't send impression stats for the empty state\n      props.rows.length &&\n      (\n        // We only want to send impression stats if the content of the cards has changed\n        // and the section is not collapsed...\n        (props.rows !== prevProps.rows && !isCollapsed) ||\n        // or if we are expanding a section that was collapsed.\n        (wasCollapsed && !isCollapsed)\n      )\n    ) {\n      this.sendImpressionStatsOrAddListener();\n    }\n  }\n\n  componentWillUpdate(nextProps) {\n    this.sendNewTabRehydrated(nextProps.initialized);\n  }\n\n  componentWillUnmount() {\n    if (this._onVisibilityChange) {\n      this.props.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n    }\n  }\n\n  needsImpressionStats(cards) {\n    if (!this.impressionCardGuids || (this.impressionCardGuids.length !== cards.length)) {\n      return true;\n    }\n\n    for (let i = 0; i < cards.length; i++) {\n      if (cards[i].guid !== this.impressionCardGuids[i]) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  // The NEW_TAB_REHYDRATED event is used to inform feeds that their\n  // data has been consumed e.g. for counting the number of tabs that\n  // have rendered that data.\n  sendNewTabRehydrated(initialized) {\n    if (initialized && !this.renderNotified) {\n      this.props.dispatch(ac.AlsoToMain({type: at.NEW_TAB_REHYDRATED, data: {}}));\n      this.renderNotified = true;\n    }\n  }\n\n  render() {\n    const {\n      id, eventSource, title, icon, rows, Pocket, topics,\n      emptyState, dispatch, compactCards, read_more_endpoint,\n      contextMenuOptions, initialized, learnMore,\n      pref, privacyNoticeURL, isFirst, isLast,\n    } = this.props;\n\n    const waitingForSpoc = id === \"topstories\" && this.props.Pocket.waitingForSpoc;\n    const maxCardsPerRow = compactCards ? CARDS_PER_ROW_COMPACT_WIDE : CARDS_PER_ROW_DEFAULT;\n    const {numRows} = this;\n    const maxCards = maxCardsPerRow * numRows;\n    const maxCardsOnNarrow = CARDS_PER_ROW_DEFAULT * numRows;\n\n    const {pocketCta, isUserLoggedIn} = Pocket || {};\n    const {useCta} = pocketCta || {};\n\n    // Don't display anything until we have a definitve result from Pocket,\n    // to avoid a flash of logged out state while we render.\n    const isPocketLoggedInDefined = (isUserLoggedIn === true || isUserLoggedIn === false);\n\n    const hasTopics = topics && topics.length > 0;\n\n    const shouldShowPocketCta = (id === \"topstories\" &&\n      useCta && isUserLoggedIn === false);\n\n    // Show topics only for top stories and if it has loaded with topics.\n    // The classs .top-stories-bottom-container ensures content doesn't shift as things load.\n    const shouldShowTopics = (id === \"topstories\" && hasTopics &&\n      ((useCta && isUserLoggedIn === true) || (!useCta && isPocketLoggedInDefined)));\n\n    // We use topics to determine language support for read more.\n    const shouldShowReadMore = read_more_endpoint && hasTopics;\n\n    const realRows = rows.slice(0, maxCards);\n\n    // The empty state should only be shown after we have initialized and there is no content.\n    // Otherwise, we should show placeholders.\n    const shouldShowEmptyState = initialized && !rows.length;\n\n    const cards = [];\n    if (!shouldShowEmptyState) {\n      for (let i = 0; i < maxCards; i++) {\n        const link = realRows[i];\n        // On narrow viewports, we only show 3 cards per row. We'll mark the rest as\n        // .hide-for-narrow to hide in CSS via @media query.\n        const className = (i >= maxCardsOnNarrow) ? \"hide-for-narrow\" : \"\";\n        let usePlaceholder = !link;\n        // If we are in the third card and waiting for spoc,\n        // use the placeholder.\n        if (!usePlaceholder && i === 2 && waitingForSpoc) {\n          usePlaceholder = true;\n        }\n        cards.push(!usePlaceholder ? (\n          <Card key={i}\n            index={i}\n            className={className}\n            dispatch={dispatch}\n            link={link}\n            contextMenuOptions={contextMenuOptions}\n            eventSource={eventSource}\n            shouldSendImpressionStats={this.props.shouldSendImpressionStats}\n            isWebExtension={this.props.isWebExtension} />\n        ) : (\n          <PlaceholderCard key={i} className={className} />\n        ));\n      }\n    }\n\n    const sectionClassName = [\n      \"section\",\n      compactCards ? \"compact-cards\" : \"normal-cards\",\n    ].join(\" \");\n\n    // <Section> <-- React component\n    // <section> <-- HTML5 element\n    return (<ComponentPerfTimer {...this.props}>\n      <CollapsibleSection className={sectionClassName} icon={icon}\n        title={title}\n        id={id}\n        eventSource={eventSource}\n        collapsed={this.props.pref.collapsed}\n        showPrefName={(pref && pref.feed) || id}\n        privacyNoticeURL={privacyNoticeURL}\n        Prefs={this.props.Prefs}\n        isFirst={isFirst}\n        isLast={isLast}\n        learnMore={learnMore}\n        dispatch={this.props.dispatch}\n        isWebExtension={this.props.isWebExtension}>\n\n        {!shouldShowEmptyState && (<ul className=\"section-list\" style={{padding: 0}}>\n          {cards}\n        </ul>)}\n        {shouldShowEmptyState &&\n          <div className=\"section-empty-state\">\n            <div className=\"empty-state\">\n              {emptyState.icon && emptyState.icon.startsWith(\"moz-extension://\") ?\n                <span className=\"empty-state-icon icon\" style={{\"background-image\": `url('${emptyState.icon}')`}} /> :\n                <span className={`empty-state-icon icon icon-${emptyState.icon}`} />}\n              <p className=\"empty-state-message\">\n                {getFormattedMessage(emptyState.message)}\n              </p>\n            </div>\n          </div>}\n        {id === \"topstories\" &&\n          <div className=\"top-stories-bottom-container\">\n            {shouldShowTopics &&\n              <div className=\"wrapper-topics\">\n                <Topics topics={this.props.topics} />\n              </div>\n            }\n\n            {shouldShowPocketCta &&\n              <div className=\"wrapper-cta\">\n                <PocketLoggedInCta />\n              </div>\n            }\n\n            <div className=\"wrapper-more-recommendations\">\n              {shouldShowReadMore &&\n                <MoreRecommendations read_more_endpoint={read_more_endpoint} />}\n            </div>\n          </div>}\n      </CollapsibleSection>\n    </ComponentPerfTimer>);\n  }\n}\n\nSection.defaultProps = {\n  document: global.document,\n  rows: [],\n  emptyState: {},\n  pref: {},\n  title: \"\",\n};\n\nexport const SectionIntl = connect(state => ({Prefs: state.Prefs, Pocket: state.Pocket}))(injectIntl(Section));\n\nexport class _Sections extends React.PureComponent {\n  renderSections() {\n    const sections = [];\n    const enabledSections = this.props.Sections.filter(section => section.enabled);\n    const {sectionOrder, \"feeds.topsites\": showTopSites} = this.props.Prefs.values;\n    // Enabled sections doesn't include Top Sites, so we add it if enabled.\n    const expectedCount = enabledSections.length + ~~showTopSites;\n\n    for (const sectionId of sectionOrder.split(\",\")) {\n      const commonProps = {\n        key: sectionId,\n        isFirst: sections.length === 0,\n        isLast: sections.length === expectedCount - 1,\n      };\n      if (sectionId === \"topsites\" && showTopSites) {\n        sections.push(<TopSites {...commonProps} />);\n      } else {\n        const section = enabledSections.find(s => s.id === sectionId);\n        if (section) {\n          sections.push(<SectionIntl {...section} {...commonProps} />);\n        }\n      }\n    }\n    return sections;\n  }\n\n  render() {\n    return (\n      <div className=\"sections-list\">\n        {this.renderSections()}\n      </div>\n    );\n  }\n}\n\nexport const Sections = connect(state => ({Sections: state.Sections, Prefs: state.Prefs}))(_Sections);\n","import {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\n\nexport class MoreRecommendations extends React.PureComponent {\n  render() {\n    const {read_more_endpoint} = this.props;\n    if (read_more_endpoint) {\n      return (\n        <a className=\"more-recommendations\" href={read_more_endpoint}>\n          <FormattedMessage id=\"pocket_more_reccommendations\" />\n        </a>\n      );\n    }\n    return null;\n  }\n}\n","import {connect} from \"react-redux\";\nimport {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\n\nexport class _PocketLoggedInCta extends React.PureComponent {\n  render() {\n    const {pocketCta} = this.props.Pocket;\n    return (\n      <span className=\"pocket-logged-in-cta\">\n        <a className=\"pocket-cta-button\" href={pocketCta.ctaUrl ? pocketCta.ctaUrl : \"https://getpocket.com/\"}>\n         {pocketCta.ctaButton ? pocketCta.ctaButton : <FormattedMessage id=\"pocket_cta_button\" />}\n        </a>\n\n        <a href={pocketCta.ctaUrl ? pocketCta.ctaUrl : \"https://getpocket.com/\"}>\n          <span className=\"cta-text\">\n           {pocketCta.ctaText ? pocketCta.ctaText : <FormattedMessage id=\"pocket_cta_text\" />}\n          </span>\n        </a>\n      </span>\n    );\n  }\n}\n\nexport const PocketLoggedInCta = connect(state => ({Pocket: state.Pocket}))(_PocketLoggedInCta);\n","import {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\n\nexport class Topic extends React.PureComponent {\n  render() {\n    const {url, name} = this.props;\n    return (<li><a key={name} href={url}>{name}</a></li>);\n  }\n}\n\nexport class Topics extends React.PureComponent {\n  render() {\n    const {topics} = this.props;\n    return (\n      <span className=\"topics\">\n        <span><FormattedMessage id=\"pocket_read_more\" /></span>\n        <ul>{topics && topics.map(t => <Topic key={t.name} url={t.url} name={t.name} />)}</ul>\n      </span>\n    );\n  }\n}\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {perfService as perfSvc} from \"common/PerfService.jsm\";\n\nconst VISIBLE = \"visible\";\nconst VISIBILITY_CHANGE_EVENT = \"visibilitychange\";\n\nexport class DetectUserSessionStart {\n  constructor(store, options = {}) {\n    this._store = store;\n    // Overrides for testing\n    this.document = options.document || global.document;\n    this._perfService = options.perfService || perfSvc;\n    this._onVisibilityChange = this._onVisibilityChange.bind(this);\n  }\n\n  /**\n   * sendEventOrAddListener - Notify immediately if the page is already visible,\n   *                    or else set up a listener for when visibility changes.\n   *                    This is needed for accurate session tracking for telemetry,\n   *                    because tabs are pre-loaded.\n   */\n  sendEventOrAddListener() {\n    if (this.document.visibilityState === VISIBLE) {\n      // If the document is already visible, to the user, send a notification\n      // immediately that a session has started.\n      this._sendEvent();\n    } else {\n      // If the document is not visible, listen for when it does become visible.\n      this.document.addEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n    }\n  }\n\n  /**\n   * _sendEvent - Sends a message to the main process to indicate the current\n   *              tab is now visible to the user, includes the\n   *              visibility_event_rcvd_ts time in ms from the UNIX epoch.\n   */\n  _sendEvent() {\n    this._perfService.mark(\"visibility_event_rcvd_ts\");\n\n    try {\n      let visibility_event_rcvd_ts = this._perfService\n        .getMostRecentAbsMarkStartByName(\"visibility_event_rcvd_ts\");\n\n      this._store.dispatch(ac.AlsoToMain({\n        type: at.SAVE_SESSION_PERF_DATA,\n        data: {visibility_event_rcvd_ts},\n      }));\n    } catch (ex) {\n      // If this failed, it's likely because the `privacy.resistFingerprinting`\n      // pref is true.  We should at least not blow up.\n    }\n  }\n\n  /**\n   * _onVisibilityChange - If the visibility has changed to visible, sends a notification\n   *                      and removes the event listener. This should only be called once per tab.\n   */\n  _onVisibilityChange() {\n    if (this.document.visibilityState === VISIBLE) {\n      this._sendEvent();\n      this.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n    }\n  }\n}\n","export function enableASRouterContent(store, asrouterContent) {\n  // Enable asrouter content\n  store.subscribe(() => {\n    const state = store.getState();\n    if (!state.ASRouter.initialized) {\n      return;\n    }\n\n    if (!asrouterContent.initialized) {\n      asrouterContent.init(store);\n    }\n  });\n  // Return this for testing purposes\n  return {asrouterContent};\n}\n","import {actionCreators as ac} from \"common/Actions.jsm\";\nimport React from \"react\";\n\nexport class DSCard extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onLinkClick = this.onLinkClick.bind(this);\n  }\n\n  onLinkClick(event) {\n    if (this.props.dispatch) {\n      this.props.dispatch(ac.UserEvent({\n        event: \"CLICK\",\n        source: this.props.type.toUpperCase(),\n        action_position: this.props.index,\n      }));\n\n      this.props.dispatch(ac.ImpressionStats({\n        source: this.props.type.toUpperCase(),\n        click: 0,\n        tiles: [{id: this.props.id, pos: this.props.index}],\n      }));\n    }\n  }\n\n  render() {\n    return (\n      <a href={this.props.url} className=\"ds-card\" onClick={this.onLinkClick}>\n        <div className=\"img-wrapper\">\n          <div className=\"img\" style={{backgroundImage: `url(${this.props.image_src}`}} />\n        </div>\n        <div className=\"meta\">\n          <div className=\"info-wrap\">\n            <header className=\"title\">{this.props.title}</header>\n            {this.props.excerpt && <p className=\"excerpt\">{this.props.excerpt}</p>}\n          </div>\n          <p>\n            {this.props.context && (\n              <span>\n                <span className=\"context\">{this.props.context}</span>\n                <br />\n              </span>\n            )}\n            <span className=\"source\">{this.props.source}</span>\n          </p>\n        </div>\n      </a>\n    );\n  }\n}\n","import {DSCard} from \"../DSCard/DSCard.jsx\";\nimport React from \"react\";\n\nexport class CardGrid extends React.PureComponent {\n  render() {\n    const {data} = this.props;\n\n    // Handle a render before feed has been fetched by displaying nothing\n    if (!data) {\n      return (\n        <div />\n      );\n    }\n\n    let cards = data.recommendations.slice(0, this.props.items).map((rec, index) => (\n      <DSCard\n        key={`dscard-${index}`}\n        image_src={rec.image_src}\n        title={rec.title}\n        excerpt={rec.excerpt}\n        url={rec.url}\n        id={rec.id}\n        index={index}\n        type={this.props.type}\n        context={rec.context}\n        dispatch={this.props.dispatch}\n        source={rec.domain} />\n    ));\n\n    let divisibility = ``;\n\n    if (this.props.items % 4 === 0) {\n      divisibility = `divisible-by-4`;\n    } else if (this.props.items % 3 === 0) {\n      divisibility = `divisible-by-3`;\n    }\n\n    return (\n      <div>\n        <div className=\"ds-header\">{this.props.title}</div>\n        <div className={`ds-card-grid ds-card-grid-${this.props.border} ds-card-grid-${divisibility}`}>\n          {cards}\n        </div>\n      </div>\n    );\n  }\n}\n\nCardGrid.defaultProps = {\n  border: `border`,\n  items: 4, // Number of stories to display\n};\n","export function truncateText(text = \"\", cap) {\n  return text.substring(0, cap).trim() + (text.length > cap ? \"…\" : \"\");\n}\n","import {actionCreators as ac} from \"common/Actions.jsm\";\nimport {connect} from \"react-redux\";\nimport React from \"react\";\nimport {truncateText} from \"content-src/lib/truncate-text\";\n\n/**\n * @note exported for testing only\n */\nexport class ListItem extends React.PureComponent {\n  // TODO performance: get feeds to send appropriately sized images rather\n  // than waiting longer and scaling down on client?\n  constructor(props) {\n    super(props);\n    this.onLinkClick = this.onLinkClick.bind(this);\n  }\n\n  onLinkClick(event) {\n    if (this.props.dispatch) {\n      this.props.dispatch(ac.UserEvent({\n        event: \"CLICK\",\n        source: this.props.type.toUpperCase(),\n        action_position: this.props.index,\n      }));\n\n      this.props.dispatch(ac.ImpressionStats({\n        source: this.props.type.toUpperCase(),\n        click: 0,\n        tiles: [{id: this.props.id, pos: this.props.index}],\n      }));\n    }\n  }\n\n  render() {\n    return (\n      <li className=\"ds-list-item\">\n        <a className=\"ds-list-item-link\" href={this.props.url} onClick={this.onLinkClick}>\n          <div className=\"ds-list-item-text\">\n            <div className=\"ds-list-item-title\">{this.props.title}</div>\n            {this.props.excerpt && <div className=\"ds-list-item-excerpt\">{truncateText(this.props.excerpt, 90)}</div>}\n            <div className=\"ds-list-item-info\">{this.props.domain}</div>\n          </div>\n          <div className=\"ds-list-image\" style={{backgroundImage: `url(${this.props.image_src})`}} />\n        </a>\n      </li>\n    );\n  }\n}\n\n/**\n * @note exported for testing only\n */\nexport function _List(props) {\n  const feed = props.DiscoveryStream.feeds[props.feed.url];\n\n  if (!feed || !feed.data || !feed.data.recommendations) {\n    return null;\n  }\n\n  const recs = feed.data.recommendations;\n\n  let recMarkup = recs.slice(props.recStartingPoint,\n                             props.recStartingPoint + props.items).map((rec, index) => (\n    <ListItem key={`ds-list-item-${index}`}\n      dispatch={props.dispatch}\n      domain={rec.domain}\n      excerpt={rec.excerpt}\n      id={rec.id}\n      image_src={rec.image_src}\n      index={index}\n      title={rec.title}\n      type={props.type}\n      url={rec.url} />)\n  );\n\n  const listStyles = [\n    \"ds-list\",\n    props.fullWidth ? \"ds-list-full-width\" : \"\",\n    props.hasBorders ? \"ds-list-borders\" : \"\",\n    props.hasImages ? \"ds-list-images\" : \"\",\n    props.hasNumbers ? \"ds-list-numbers\" : \"\",\n  ];\n  return (\n    <div>\n      {props.header && props.header.title ? <div className=\"ds-header\">{props.header.title}</div> : null }\n      <ul className={listStyles.join(\" \")}>{recMarkup}</ul>\n    </div>\n  );\n}\n\n_List.defaultProps = {\n  recStartingPoint: 0, // Index of recommendations to start displaying from\n  fullWidth: false, // Display items taking up the whole column\n  hasBorders: false, // Display lines separating each item\n  hasImages: false, // Display images for each item\n  hasNumbers: false, // Display numbers for each item\n  items: 6, // Number of stories to display.  TODO: get from endpoint\n};\n\nexport const List = connect(state => ({DiscoveryStream: state.DiscoveryStream}))(_List);\n","import {actionCreators as ac} from \"common/Actions.jsm\";\nimport {DSCard} from \"../DSCard/DSCard.jsx\";\nimport {List} from \"../List/List.jsx\";\nimport React from \"react\";\nimport {truncateText} from \"content-src/lib/truncate-text\";\n\nexport class Hero extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onLinkClick = this.onLinkClick.bind(this);\n  }\n\n  onLinkClick(event) {\n    if (this.props.dispatch) {\n      this.props.dispatch(ac.UserEvent({\n        event: \"CLICK\",\n        source: this.props.type.toUpperCase(),\n        action_position: 0,\n      }));\n\n      this.props.dispatch(ac.ImpressionStats({\n        source: this.props.type.toUpperCase(),\n        click: 0,\n        tiles: [{id: this.heroRec.id, pos: 0}],\n      }));\n    }\n  }\n\n  render() {\n    const {data} = this.props;\n\n    // Handle a render before feed has been fetched by displaying nothing\n    if (!data || !data.recommendations) {\n      return (\n        <div />\n      );\n    }\n\n    let [heroRec, ...otherRecs] = data.recommendations.slice(0, this.props.items);\n    this.heroRec = heroRec;\n\n    // Note that `{index + 1}` is necessary below for telemetry since we treat heroRec as index 0.\n    let cards = otherRecs.map((rec, index) => (\n      <DSCard\n        key={`dscard-${index}`}\n        image_src={rec.image_src}\n        title={truncateText(rec.title, 44)}\n        url={rec.url}\n        id={rec.id}\n        index={index + 1}\n        type={this.props.type}\n        dispatch={this.props.dispatch}\n        context={truncateText(rec.context, 22)}\n        source={truncateText(rec.domain, 22)} />\n    ));\n\n    let list = (\n      <List\n        recStartingPoint={1}\n        feed={this.props.feed}\n        hasImages={true}\n        hasBorders={this.props.border === `border`}\n        items={this.props.items - 1}\n        type={`Hero`} />\n    );\n\n    return (\n      <div>\n        <div className=\"ds-header\">{this.props.title}</div>\n        <div className={`ds-hero ds-hero-${this.props.border}`}>\n          <a href={heroRec.url} className=\"wrapper\" onClick={this.onLinkClick}>\n            <div className=\"img-wrapper\">\n              <div className=\"img\" style={{backgroundImage: `url(${heroRec.image_src})`}} />\n            </div>\n            <div className=\"meta\">\n              <header>{truncateText(heroRec.title, 28)}</header>\n              <p>{truncateText(heroRec.excerpt, 114)}</p>\n              {heroRec.context ? (\n                <p className=\"context\">{truncateText(heroRec.context, 22)}</p>\n              ) : (\n                <p className=\"source\">{truncateText(heroRec.domain, 22)}</p>\n              )}\n            </div>\n          </a>\n          <div className={`${this.props.subComponentType}`}>\n            { this.props.subComponentType === `cards` ? cards : list }\n          </div>\n        </div>\n      </div>\n    );\n  }\n}\n\nHero.defaultProps = {\n  data: {},\n  border: `border`,\n  items: 1, // Number of stories to display\n};\n","import React from \"react\";\n\nexport class HorizontalRule extends React.PureComponent {\n  render() {\n    return (\n      <hr className=\"ds-hr\" />\n    );\n  }\n}\n","import React from \"react\";\n\nexport class Topic extends React.PureComponent {\n  render() {\n    const {url, name} = this.props;\n    return (<li><a key={name} href={url}>{name}</a></li>);\n  }\n}\n\nexport class Navigation extends React.PureComponent {\n  render() {\n    const {links} = this.props || [];\n    const {alignment} = this.props || \"centered\";\n    const header = this.props.header || {};\n    return (\n      <div className={`ds-navigation ds-navigation-${alignment}`}>\n        {header.title ? <div className=\"ds-header\">{header.title}</div> : null}\n        <div>\n          <ul>\n            {links && links.map(t => <Topic key={t.name} url={t.url} name={t.name} />)}\n          </ul>\n        </div>\n      </div>\n    );\n  }\n}\n","import React from \"react\";\n\nexport class SectionTitle extends React.PureComponent {\n  render() {\n    const {header: {title, subtitle}} = this.props;\n    return (\n      <div className=\"ds-section-title\">\n        <div className=\"title\">{title}</div>\n        {subtitle ? <div className=\"subtitle\">{subtitle}</div> : null}\n      </div>\n    );\n  }\n}\n","function defaultEqualityCheck(a, b) {\n  return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(equalityCheck, prev, next) {\n  if (prev === null || next === null || prev.length !== next.length) {\n    return false;\n  }\n\n  // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n  var length = prev.length;\n  for (var i = 0; i < length; i++) {\n    if (!equalityCheck(prev[i], next[i])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nexport function defaultMemoize(func) {\n  var equalityCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultEqualityCheck;\n\n  var lastArgs = null;\n  var lastResult = null;\n  // we reference arguments instead of spreading them for performance reasons\n  return function () {\n    if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n      // apply arguments instead of spreading for performance.\n      lastResult = func.apply(null, arguments);\n    }\n\n    lastArgs = arguments;\n    return lastResult;\n  };\n}\n\nfunction getDependencies(funcs) {\n  var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;\n\n  if (!dependencies.every(function (dep) {\n    return typeof dep === 'function';\n  })) {\n    var dependencyTypes = dependencies.map(function (dep) {\n      return typeof dep;\n    }).join(', ');\n    throw new Error('Selector creators expect all input-selectors to be functions, ' + ('instead received the following types: [' + dependencyTypes + ']'));\n  }\n\n  return dependencies;\n}\n\nexport function createSelectorCreator(memoize) {\n  for (var _len = arguments.length, memoizeOptions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n    memoizeOptions[_key - 1] = arguments[_key];\n  }\n\n  return function () {\n    for (var _len2 = arguments.length, funcs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      funcs[_key2] = arguments[_key2];\n    }\n\n    var recomputations = 0;\n    var resultFunc = funcs.pop();\n    var dependencies = getDependencies(funcs);\n\n    var memoizedResultFunc = memoize.apply(undefined, [function () {\n      recomputations++;\n      // apply arguments instead of spreading for performance.\n      return resultFunc.apply(null, arguments);\n    }].concat(memoizeOptions));\n\n    // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.\n    var selector = memoize(function () {\n      var params = [];\n      var length = dependencies.length;\n\n      for (var i = 0; i < length; i++) {\n        // apply arguments instead of spreading and mutate a local list of params for performance.\n        params.push(dependencies[i].apply(null, arguments));\n      }\n\n      // apply arguments instead of spreading for performance.\n      return memoizedResultFunc.apply(null, params);\n    });\n\n    selector.resultFunc = resultFunc;\n    selector.dependencies = dependencies;\n    selector.recomputations = function () {\n      return recomputations;\n    };\n    selector.resetRecomputations = function () {\n      return recomputations = 0;\n    };\n    return selector;\n  };\n}\n\nexport var createSelector = createSelectorCreator(defaultMemoize);\n\nexport function createStructuredSelector(selectors) {\n  var selectorCreator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createSelector;\n\n  if (typeof selectors !== 'object') {\n    throw new Error('createStructuredSelector expects first argument to be an object ' + ('where each property is a selector, instead received a ' + typeof selectors));\n  }\n  var objectKeys = Object.keys(selectors);\n  return selectorCreator(objectKeys.map(function (key) {\n    return selectors[key];\n  }), function () {\n    for (var _len3 = arguments.length, values = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n      values[_key3] = arguments[_key3];\n    }\n\n    return values.reduce(function (composition, value, index) {\n      composition[objectKeys[index]] = value;\n      return composition;\n    }, {});\n  });\n}","import {createSelector} from \"reselect\";\n\nexport const selectLayoutRender = createSelector(\n  // Selects layout, feeds, spocs so that we only recompute if\n  // any of these values change.\n  [\n    state => state.DiscoveryStream.layout,\n    state => state.DiscoveryStream.feeds,\n    state => state.DiscoveryStream.spocs,\n  ],\n\n  // Adds data to each component from feeds. This function only re-runs if one of the inputs change.\n  // TODO: calculate spocs\n  function layoutRender(layout, feeds, spocs) {\n    let spocIndex = 0;\n\n    function maybeInjectSpocs(data, spocsConfig) {\n      if (data &&\n          spocsConfig && spocsConfig.positions && spocsConfig.positions.length &&\n          spocs.data.spocs && spocs.data.spocs.length) {\n        const recommendations = [...data.recommendations];\n        for (let position of spocsConfig.positions) {\n          let rickRoll = Math.random();\n          if (spocs.data.spocs[spocIndex] && rickRoll <= spocsConfig.probability) {\n            recommendations.splice(position.index, 0, spocs.data.spocs[spocIndex++]);\n          }\n        }\n\n        return {\n          ...data,\n          recommendations,\n        };\n      }\n\n      return data;\n    }\n\n    return layout.map(row => ({\n      ...row,\n\n      // Loops through all the components and adds a .data property\n      // containing data from feeds\n      components: row.components.map(component => {\n        if (!component.feed || !feeds[component.feed.url]) {\n          return component;\n        }\n\n        return {...component, data: maybeInjectSpocs(feeds[component.feed.url].data, component.spocs)};\n      }),\n    }));\n  }\n);\n","import {connect} from \"react-redux\";\nimport {TopSites as OldTopSites} from \"content-src/components/TopSites/TopSites\";\nimport React from \"react\";\n\nexport class _TopSites extends React.PureComponent {\n  render() {\n    const header = this.props.header || {};\n    return (\n      <div className=\"ds-top-sites\">\n        {header.title ? (\n          <div className=\"ds-header\">\n            <span className=\"icon icon-small-spacer icon-topsites\" />\n            <span className=\"ds-header-title\">{header.title}</span>\n          </div>\n        ) : null}\n        <OldTopSites />\n      </div>\n    );\n  }\n}\n\nexport const TopSites = connect(state => ({TopSites: state.TopSites}))(_TopSites);\n","import {CardGrid} from \"content-src/components/DiscoveryStreamComponents/CardGrid/CardGrid\";\nimport {connect} from \"react-redux\";\nimport {Hero} from \"content-src/components/DiscoveryStreamComponents/Hero/Hero\";\nimport {HorizontalRule} from \"content-src/components/DiscoveryStreamComponents/HorizontalRule/HorizontalRule\";\nimport {ImpressionStats} from \"content-src/components/DiscoveryStreamImpressionStats/ImpressionStats\";\nimport {List} from \"content-src/components/DiscoveryStreamComponents/List/List\";\nimport {Navigation} from \"content-src/components/DiscoveryStreamComponents/Navigation/Navigation\";\nimport React from \"react\";\nimport {SectionTitle} from \"content-src/components/DiscoveryStreamComponents/SectionTitle/SectionTitle\";\nimport {selectLayoutRender} from \"content-src/lib/selectLayoutRender\";\nimport {TopSites} from \"content-src/components/DiscoveryStreamComponents/TopSites/TopSites\";\n\n// According to the Pocket API endpoint specs, `component.properties.items` is a required property with following values:\n//   - List 1-6 items\n//   - Hero 1-5 items\n//   - CardGrid 1-8 items\n// To enforce that, we define various maximium items for individual components as an extra check.\n// Note that these values are subject to the future changes of the specs.\nconst MAX_ROWS_HERO = 5;\nconst MAX_ROWS_LIST = 6;\nconst MAX_ROWS_CARDGRID = 8;\n\nconst ALLOWED_CSS_URL_PREFIXES = [\"chrome://\", \"resource://\", \"https://img-getpocket.cdn.mozilla.net/\"];\nconst DUMMY_CSS_SELECTOR = \"DUMMY#CSS.SELECTOR\";\n\n/**\n * Validate a CSS declaration. The values are assumed to be normalized by CSSOM.\n */\nexport function isAllowedCSS(property, value) {\n  // Bug 1454823: INTERNAL properties, e.g., -moz-context-properties, are\n  // exposed but their values aren't resulting in getting nothing. Fortunately,\n  // we don't care about validating the values of the current set of properties.\n  if (value === undefined) {\n    return true;\n  }\n\n  // Make sure all urls are of the allowed protocols/prefixes\n  const urls = value.match(/url\\(\"[^\"]+\"\\)/g);\n  return !urls || urls.every(url => ALLOWED_CSS_URL_PREFIXES.some(prefix =>\n    url.slice(5).startsWith(prefix)));\n}\n\nexport class _DiscoveryStreamBase extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onStyleMount = this.onStyleMount.bind(this);\n  }\n\n  /**\n   * Extracts the recommendation rows from component for the impression ping.\n   * If `component.data.recommendations` is unset, returns an empty array.\n   *\n   * The row size is determined by the following rules:\n   *   - Use `component.properties.items` from the endpoint if it's specified\n   *   - Otherwise, use the length of recommendation array\n   *   - The row size is capped by the argument `limit`, which could be one of\n   *     [`MAX_ROW_HERO`, `MAX_ROWS_LIST`, `MAX_ROWS_CARDGRID`]\n   */\n  extractRows(component, limit) {\n    if (component.data && component.data.recommendations) {\n      const items = Math.min(limit, component.properties.items || component.data.recommendations.length);\n      return component.data.recommendations.slice(0, items);\n    }\n\n    return [];\n  }\n\n  onStyleMount(style) {\n    // Unmounting style gets rid of old styles, so nothing else to do\n    if (!style) {\n      return;\n    }\n\n    const {sheet} = style;\n    const styles = JSON.parse(style.dataset.styles);\n    styles.forEach((row, rowIndex) => {\n      row.forEach((component, componentIndex) => {\n        // Nothing to do without optional styles overrides\n        if (!component) {\n          return;\n        }\n\n        Object.entries(component).forEach(([selectors, declarations]) => {\n          // Start with a dummy rule to validate declarations and selectors\n          sheet.insertRule(`${DUMMY_CSS_SELECTOR} {}`);\n          const [rule] = sheet.cssRules;\n\n          // Validate declarations and remove any offenders. CSSOM silently\n          // discards invalid entries, so here we apply extra restrictions.\n          rule.style = declarations;\n          [...rule.style].forEach(property => {\n            const value = rule.style[property];\n            if (!isAllowedCSS(property, value)) {\n              console.error(`Bad CSS declaration ${property}: ${value}`); // eslint-disable-line no-console\n              rule.style.removeProperty(property);\n            }\n          });\n\n          // Set the actual desired selectors scoped to the component\n          const prefix = `.ds-layout > .ds-column:nth-child(${rowIndex + 1}) .ds-column-grid > :nth-child(${componentIndex + 1})`;\n          // NB: Splitting on \",\" doesn't work with strings with commas, but\n          // we're okay with not supporting those selectors\n          rule.selectorText = selectors.split(\",\").map(selector => prefix +\n            // Assume :pseudo-classes are for component instead of descendant\n            (selector[0] === \":\" ? \"\" : \" \") + selector).join(\",\");\n\n          // CSSOM silently ignores bad selectors, so we'll be noisy instead\n          if (rule.selectorText === DUMMY_CSS_SELECTOR) {\n            console.error(`Bad CSS selector ${selectors}`); // eslint-disable-line no-console\n          }\n        });\n      });\n    });\n  }\n\n  renderComponent(component, embedWidth) {\n    let rows;\n    const {spocs} = this.props.DiscoveryStream;\n\n    // TODO: Can we make this a bit better visually while it loads?\n    // If this component expects spocs,\n    // wait until spocs are loaded before attempting to use it.\n    if (component.spocs && !spocs.loaded) {\n      return null;\n    }\n\n    switch (component.type) {\n      case \"TopSites\":\n        return (<TopSites header={component.header} />);\n      case \"SectionTitle\":\n        return (\n          <SectionTitle\n            header={component.header} />\n        );\n      case \"Navigation\":\n        return (\n          <Navigation\n            links={component.properties.links}\n            alignment={component.properties.alignment}\n            header={component.header} />\n        );\n      case \"CardGrid\":\n        rows = this.extractRows(component, MAX_ROWS_CARDGRID);\n        return (\n          <ImpressionStats rows={rows} dispatch={this.props.dispatch} source={component.type}>\n            <CardGrid\n              title={component.header && component.header.title}\n              data={component.data}\n              feed={component.feed}\n              border={component.properties.border}\n              type={component.type}\n              dispatch={this.props.dispatch}\n              items={component.properties.items} />\n          </ImpressionStats>\n        );\n      case \"Hero\":\n        rows = this.extractRows(component, MAX_ROWS_HERO);\n        return (\n          <ImpressionStats rows={rows} dispatch={this.props.dispatch} source={component.type}>\n            <Hero\n              subComponentType={embedWidth >= 9 ? `cards` : `list`}\n              feed={component.feed}\n              title={component.header && component.header.title}\n              data={component.data}\n              border={component.properties.border}\n              type={component.type}\n              dispatch={this.props.dispatch}\n              items={component.properties.items} />\n          </ImpressionStats>\n        );\n      case \"HorizontalRule\":\n        return (<HorizontalRule />);\n      case \"List\":\n        rows = this.extractRows(component, MAX_ROWS_LIST);\n        return (\n          <ImpressionStats rows={rows} dispatch={this.props.dispatch} source={component.type}>\n            <List\n              feed={component.feed}\n              fullWidth={component.properties.full_width}\n              hasBorders={component.properties.border === \"border\"}\n              hasImages={component.properties.has_images}\n              hasNumbers={component.properties.has_numbers}\n              items={component.properties.items}\n              type={component.type}\n              header={component.header} />\n          </ImpressionStats>\n        );\n      default:\n        return (<div>{component.type}</div>);\n    }\n  }\n\n  renderStyles(styles) {\n    // Use json string as both the key and styles to render so React knows when\n    // to unmount and mount a new instance for new styles.\n    const json = JSON.stringify(styles);\n    return (<style key={json} data-styles={json} ref={this.onStyleMount} />);\n  }\n\n  render() {\n    const {layoutRender} = this.props.DiscoveryStream;\n    const styles = [];\n    return (\n      <div className=\"discovery-stream ds-layout\">\n        {layoutRender.map((row, rowIndex) => (\n          <div key={`row-${rowIndex}`} className={`ds-column ds-column-${row.width}`}>\n            <div className=\"ds-column-grid\">\n              {row.components.map((component, componentIndex) => {\n                styles[rowIndex] = [...styles[rowIndex] || [], component.styles];\n                return (<div key={`component-${componentIndex}`}>\n                  {this.renderComponent(component, row.width)}\n                </div>);\n              })}\n            </div>\n          </div>\n        ))}\n        {this.renderStyles(styles)}\n      </div>\n    );\n  }\n}\n\nfunction transform(state) {\n  return {\n    DiscoveryStream: {\n      ...state.DiscoveryStream,\n      layoutRender: selectLayoutRender(state),\n    },\n  };\n}\n\nexport const DiscoveryStreamBase = connect(transform)(_DiscoveryStreamBase);\n","import React from \"react\";\n\nconst ALLOWED_STYLE_TAGS = [\"color\", \"backgroundColor\"];\n\nexport const Button = props => {\n  const style = {};\n\n  // Add allowed style tags from props, e.g. props.color becomes style={color: props.color}\n  for (const tag of ALLOWED_STYLE_TAGS) {\n    if (typeof props[tag] !== \"undefined\") {\n      style[tag] = props[tag];\n    }\n  }\n  // remove border if bg is set to something custom\n  if (style.backgroundColor) {\n    style.border = \"0\";\n  }\n\n  return (<button onClick={props.onClick}\n    className={props.className || \"ASRouterButton secondary\"}\n    style={style}>\n    {props.children}\n  </button>);\n};\n","// lifted from https://gist.github.com/kitze/23d82bb9eb0baabfd03a6a720b1d637f\nexport const ConditionalWrapper = ({condition, wrap, children}) => (condition ? wrap(children) : children);\n","import React from \"react\";\nimport schema from \"../../templates/SimpleSnippet/SimpleSnippet.schema.json\";\n\nexport class SnippetBase extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onBlockClicked = this.onBlockClicked.bind(this);\n    this.onDismissClicked = this.onDismissClicked.bind(this);\n  }\n\n  onBlockClicked() {\n    if (this.props.provider !== \"preview\") {\n      this.props.sendUserActionTelemetry({event: \"BLOCK\", id: this.props.UISurface});\n    }\n\n    this.props.onBlock();\n  }\n\n  onDismissClicked() {\n    if (this.props.provider !== \"preview\") {\n      this.props.sendUserActionTelemetry({event: \"DISMISS\", id: this.props.UISurface});\n    }\n\n    this.props.onDismiss();\n  }\n\n  renderDismissButton() {\n    if (this.props.footerDismiss) {\n      return (\n        <div className=\"footer\">\n          <div className=\"footer-content\">\n            <button\n              className=\"ASRouterButton secondary\"\n              onClick={this.onDismissClicked}>\n              {this.props.content.scene2_dismiss_button_text}\n            </button>\n          </div>\n        </div>\n      );\n    }\n\n    const defaultTitle = schema.properties.block_button_text.default;\n    return (\n      <button className=\"blockButton\" title={this.props.content.block_button_text || defaultTitle} onClick={this.onBlockClicked} />\n    );\n  }\n\n  render() {\n    const {props} = this;\n\n    const containerClassName = `SnippetBaseContainer${props.className ? ` ${props.className}` : \"\"}`;\n\n    return (<div className={containerClassName} style={this.props.textStyle}>\n      <div className=\"innerWrapper\">\n        {props.children}\n      </div>\n      {this.renderDismissButton()}\n    </div>);\n  }\n}\n","import {Button} from \"../../components/Button/Button\";\nimport {ConditionalWrapper} from \"../../components/ConditionalWrapper/ConditionalWrapper\";\nimport React from \"react\";\nimport {RichText} from \"../../components/RichText/RichText\";\nimport {safeURI} from \"../../template-utils\";\nimport {SnippetBase} from \"../../components/SnippetBase/SnippetBase\";\n\nconst DEFAULT_ICON_PATH = \"chrome://branding/content/icon64.png\";\n\nexport class SimpleSnippet extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onButtonClick = this.onButtonClick.bind(this);\n  }\n\n  onButtonClick() {\n    if (this.props.provider !== \"preview\") {\n      this.props.sendUserActionTelemetry({event: \"CLICK_BUTTON\", id: this.props.UISurface});\n    }\n    const {button_url} = this.props.content;\n    // If button_url is defined handle it as OPEN_URL action\n    const type = this.props.content.button_action || (button_url && \"OPEN_URL\");\n    this.props.onAction({\n      type,\n      data: {args: this.props.content.button_action_args || button_url},\n    });\n    if (!this.props.content.do_not_autoblock) {\n      this.props.onBlock();\n    }\n  }\n\n  _shouldRenderButton() {\n    return this.props.content.button_action || this.props.onButtonClick || this.props.content.button_url;\n  }\n\n  renderTitle() {\n    const {title} = this.props.content;\n    return title ?\n      <h3 className={`title ${this._shouldRenderButton() ? \"title-inline\" : \"\"}`}>{this.renderTitleIcon()} {title}</h3> :\n      null;\n  }\n\n  renderTitleIcon() {\n    const titleIcon = safeURI(this.props.content.title_icon);\n    return titleIcon ? <span className=\"titleIcon\" style={{backgroundImage: `url(\"${titleIcon}\")`}} /> : null;\n  }\n\n  renderButton() {\n    const {props} = this;\n    if (!this._shouldRenderButton()) {\n      return null;\n    }\n\n    return (<Button\n      onClick={props.onButtonClick || this.onButtonClick}\n      color={props.content.button_color}\n      backgroundColor={props.content.button_background_color}>\n      {props.content.button_label}\n    </Button>);\n  }\n\n  renderText() {\n    const {props} = this;\n    return (<RichText text={props.content.text}\n      customElements={this.props.customElements}\n      localization_id=\"text\"\n      links={props.content.links}\n      sendClick={props.sendClick} />);\n  }\n\n  wrapSectionHeader(url) {\n    return function(children) {\n      return <a href={url}>{children}</a>;\n    };\n  }\n\n  wrapSnippetContent(children) {\n    return <div className=\"innerContentWrapper\">{children}</div>;\n  }\n\n  renderSectionHeader() {\n    const {props} = this;\n\n    // an icon and text must be specified to render the section header\n    if (props.content.section_title_icon && props.content.section_title_text) {\n      const sectionTitleIcon = safeURI(props.content.section_title_icon);\n      const sectionTitleURL = props.content.section_title_url;\n\n      return (\n        <div className=\"section-header\">\n          <h3 className=\"section-title\">\n            <ConditionalWrapper condition={sectionTitleURL} wrap={this.wrapSectionHeader(sectionTitleURL)}>\n              <span className=\"icon icon-small-spacer\" style={{backgroundImage: `url(\"${sectionTitleIcon}\")`}} />\n              <span className=\"section-title-text\">{props.content.section_title_text}</span>\n            </ConditionalWrapper>\n          </h3>\n        </div>\n      );\n    }\n\n    return null;\n  }\n\n  render() {\n    const {props} = this;\n    const sectionHeader = this.renderSectionHeader();\n    let className = \"SimpleSnippet\";\n\n    if (props.className) {\n      className += ` ${props.className}`;\n    }\n    if (props.content.tall) {\n      className += \" tall\";\n    }\n    if (sectionHeader) {\n      className += \" has-section-header\";\n    }\n\n    return (<SnippetBase {...props} className={className} textStyle={this.props.textStyle}>\n      {sectionHeader}\n      <ConditionalWrapper condition={sectionHeader} wrap={this.wrapSnippetContent}>\n        <img src={safeURI(props.content.icon) || DEFAULT_ICON_PATH} className=\"icon\" />\n        <div>\n          {this.renderTitle()} <p className=\"body\">{this.renderText()}</p>\n          {this.props.extraContent}\n        </div>\n        {<div>{this.renderButton()}</div>}\n      </ConditionalWrapper>\n    </SnippetBase>);\n  }\n}\n","import React from \"react\";\nimport schema from \"./EOYSnippet.schema.json\";\nimport {SimpleSnippet} from \"../SimpleSnippet/SimpleSnippet\";\n\nclass EOYSnippetBase extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.handleSubmit = this.handleSubmit.bind(this);\n  }\n\n  /**\n   * setFrequencyValue - `frequency` form parameter value should be `monthly`\n   *                     if `monthly-checkbox` is selected or `single` otherwise\n   */\n  setFrequencyValue() {\n    const frequencyCheckbox = this.refs.form.querySelector(\"#monthly-checkbox\");\n    if (frequencyCheckbox.checked) {\n      this.refs.form.querySelector(\"[name='frequency']\").value = \"monthly\";\n    }\n  }\n\n  handleSubmit(event) {\n    event.preventDefault();\n    this.setFrequencyValue();\n    this.refs.form.submit();\n    if (!this.props.content.do_not_autoblock) {\n      this.props.onBlock();\n    }\n  }\n\n  renderDonations() {\n    const fieldNames = [\"first\", \"second\", \"third\", \"fourth\"];\n    const numberFormat = new Intl.NumberFormat(this.props.content.locale || navigator.language, {\n      style: \"currency\",\n      currency: this.props.content.currency_code,\n      minimumFractionDigits: 0,\n    });\n    // Default to `second` button\n    const {selected_button} = this.props.content;\n    const btnStyle = {\n      color: this.props.content.button_color,\n      backgroundColor: this.props.content.button_background_color,\n    };\n    const donationURLParams = [];\n    const paramsStartIndex = this.props.content.donation_form_url.indexOf(\"?\");\n    for (const entry of new URLSearchParams(this.props.content.donation_form_url.slice(paramsStartIndex)).entries()) {\n      donationURLParams.push(entry);\n    }\n\n    return (<form className=\"EOYSnippetForm\" action={this.props.content.donation_form_url} method={this.props.form_method} onSubmit={this.handleSubmit} ref=\"form\">\n      {donationURLParams.map(([key, value], idx) => <input type=\"hidden\" name={key} value={value} key={idx} />)}\n      {fieldNames.map((field, idx) => {\n        const button_name = `donation_amount_${field}`;\n        const amount = this.props.content[button_name];\n        return (<React.Fragment key={idx}>\n            <input type=\"radio\" name=\"amount\" value={amount} id={field} defaultChecked={button_name === selected_button} />\n            <label htmlFor={field} className=\"donation-amount\">\n              {numberFormat.format(amount)}\n            </label>\n          </React.Fragment>);\n      })}\n\n      <div className=\"monthly-checkbox-container\">\n        <input id=\"monthly-checkbox\" type=\"checkbox\" />\n        <label htmlFor=\"monthly-checkbox\">\n          {this.props.content.monthly_checkbox_label_text}\n        </label>\n      </div>\n\n      <input type=\"hidden\" name=\"frequency\" value=\"single\" />\n      <input type=\"hidden\" name=\"currency\" value={this.props.content.currency_code} />\n      <input type=\"hidden\" name=\"presets\" value={fieldNames.map(field => this.props.content[`donation_amount_${field}`])} />\n      <button style={btnStyle} type=\"submit\" className=\"ASRouterButton primary donation-form-url\">{this.props.content.button_label}</button>\n    </form>);\n  }\n\n  render() {\n    const textStyle = {\n      color: this.props.content.text_color,\n      backgroundColor: this.props.content.background_color,\n    };\n    const customElement = <em style={{backgroundColor: this.props.content.highlight_color}} />;\n    return (<SimpleSnippet {...this.props}\n      className={this.props.content.test}\n      customElements={{em: customElement}}\n      textStyle={textStyle}\n      extraContent={this.renderDonations()} />);\n  }\n}\n\nexport const EOYSnippet = props => {\n  const extendedContent = {\n    monthly_checkbox_label_text: schema.properties.monthly_checkbox_label_text.default,\n    locale: schema.properties.locale.default,\n    currency_code: schema.properties.currency_code.default,\n    selected_button: schema.properties.selected_button.default,\n    ...props.content,\n  };\n\n  return (<EOYSnippetBase\n    {...props}\n    content={extendedContent}\n    form_method=\"GET\" />);\n};\n","import {Button} from \"../../components/Button/Button\";\nimport React from \"react\";\nimport {RichText} from \"../../components/RichText/RichText\";\nimport {SimpleSnippet} from \"../SimpleSnippet/SimpleSnippet\";\nimport {SnippetBase} from \"../../components/SnippetBase/SnippetBase\";\n\nexport class SubmitFormSnippet extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.expandSnippet = this.expandSnippet.bind(this);\n    this.handleSubmit = this.handleSubmit.bind(this);\n    this.handleSubmitAttempt = this.handleSubmitAttempt.bind(this);\n    this.onInputChange = this.onInputChange.bind(this);\n    this.state = {\n      expanded: false,\n      submitAttempted: false,\n      signupSubmitted: false,\n      signupSuccess: false,\n      disableForm: false,\n    };\n  }\n\n  handleSubmitAttempt() {\n    if (!this.state.submitAttempted) {\n      this.setState({submitAttempted: true});\n    }\n  }\n\n  async handleSubmit(event) {\n    let json;\n\n    if (this.state.disableForm) {\n      return;\n    }\n\n    event.preventDefault();\n    this.setState({disableForm: true});\n    this.props.sendUserActionTelemetry({event: \"CLICK_BUTTON\", value: \"conversion-subscribe-activation\", id: \"NEWTAB_FOOTER_BAR_CONTENT\"});\n\n    if (this.props.form_method.toUpperCase() === \"GET\") {\n      this.props.onBlock({preventDismiss: true});\n      this.refs.form.submit();\n      return;\n    }\n\n    const {url, formData} = this.props.processFormData ?\n      this.props.processFormData(this.refs.mainInput, this.props) :\n      {url: this.refs.form.action, formData: new FormData(this.refs.form)};\n\n    try {\n      const fetchRequest = new Request(url, {body: formData, method: \"POST\", credentials: \"omit\"});\n      const response = await fetch(fetchRequest);\n      json = await response.json();\n    } catch (err) {\n      console.log(err); // eslint-disable-line no-console\n    }\n\n    if (json && json.status === \"ok\") {\n      this.setState({signupSuccess: true, signupSubmitted: true});\n      if (!this.props.content.do_not_autoblock) {\n        this.props.onBlock({preventDismiss: true});\n      }\n      this.props.sendUserActionTelemetry({event: \"CLICK_BUTTON\", value: \"subscribe-success\", id: \"NEWTAB_FOOTER_BAR_CONTENT\"});\n    } else {\n      console.error(\"There was a problem submitting the form\", json || \"[No JSON response]\"); // eslint-disable-line no-console\n      this.setState({signupSuccess: false, signupSubmitted: true});\n      this.props.sendUserActionTelemetry({event: \"CLICK_BUTTON\", value: \"subscribe-error\", id: \"NEWTAB_FOOTER_BAR_CONTENT\"});\n    }\n\n    this.setState({disableForm: false});\n  }\n\n  expandSnippet() {\n    this.props.sendUserActionTelemetry({event: \"CLICK_BUTTON\", value: \"scene1-button-learn-more\", id: this.props.UISurface});\n\n    this.setState({\n      expanded: true,\n      signupSuccess: false,\n      signupSubmitted: false,\n    });\n  }\n\n  renderHiddenFormInputs() {\n    const {hidden_inputs} = this.props.content;\n\n    if (!hidden_inputs) {\n      return null;\n    }\n\n    return Object.keys(hidden_inputs).map((key, idx) => <input key={idx} type=\"hidden\" name={key} value={hidden_inputs[key]} />);\n  }\n\n  renderDisclaimer() {\n    const {content} = this.props;\n    if (!content.scene2_disclaimer_html) {\n      return null;\n    }\n    return (<p className=\"disclaimerText\">\n      <RichText text={content.scene2_disclaimer_html}\n        localization_id=\"disclaimer_html\"\n        links={content.links}\n        doNotAutoBlock={true}\n        openNewWindow={true}\n        sendClick={this.props.sendClick} />\n    </p>);\n  }\n\n  renderFormPrivacyNotice() {\n    const {content} = this.props;\n    if (!content.scene2_privacy_html) {\n      return null;\n    }\n    return (<p className=\"privacyNotice\">\n        <input type=\"checkbox\" id=\"id_privacy\" name=\"privacy\" required=\"required\" />\n        <label htmlFor=\"id_privacy\">\n          <RichText text={content.scene2_privacy_html}\n          localization_id=\"privacy_html\"\n          links={content.links}\n          doNotAutoBlock={true}\n          openNewWindow={true}\n          sendClick={this.props.sendClick} />\n        </label>\n      </p>);\n  }\n\n  renderSignupSubmitted() {\n    const {content} = this.props;\n    const isSuccess = this.state.signupSuccess;\n    const successTitle = isSuccess && content.success_title;\n    const bodyText = isSuccess ? {success_text: content.success_text} : {error_text: content.error_text};\n    const retryButtonText = content.scene1_button_label;\n    return (<SnippetBase {...this.props}><div className=\"submissionStatus\">\n      {successTitle ? <h2 className=\"submitStatusTitle\">{successTitle}</h2> : null}\n      <p>\n        <RichText {...bodyText} localization_id={isSuccess ? \"success_text\" : \"error_text\"} />\n        {isSuccess ? null : <Button onClick={this.expandSnippet}>{retryButtonText}</Button>}\n      </p>\n    </div></SnippetBase>);\n  }\n\n  onInputChange(event) {\n    if (!this.props.validateInput) {\n      return;\n    }\n    const hasError = this.props.validateInput(event.target.value, this.props.content);\n    event.target.setCustomValidity(hasError);\n  }\n\n  renderInput() {\n    const placholder = this.props.content.scene2_email_placeholder_text || this.props.content.scene2_input_placeholder;\n    return (<input\n      ref=\"mainInput\"\n      type={this.props.inputType || \"email\"}\n      className={`mainInput${(this.state.submitAttempted ? \"\" : \" clean\")}`}\n      name=\"email\"\n      required={true}\n      placeholder={placholder}\n      onChange={this.props.validateInput ? this.onInputChange : null}\n      autoFocus={true} />);\n  }\n\n  renderSignupView() {\n    const {content} = this.props;\n    const containerClass = `SubmitFormSnippet ${this.props.className}`;\n    return (<SnippetBase {...this.props} className={containerClass} footerDismiss={true}>\n        {content.scene2_icon ? <div className=\"scene2Icon\"><img src={content.scene2_icon} /></div> : null}\n        <div className=\"message\">\n          <p>\n            {content.scene2_title && <h3 className=\"scene2Title\">{content.scene2_title}</h3>}\n            {\" \"}\n            {content.scene2_text && <RichText scene2_text={content.scene2_text} localization_id=\"scene2_text\" />}\n          </p>\n        </div>\n        <form action={this.props.form_action} method={this.props.form_method} onSubmit={this.handleSubmit} ref=\"form\">\n          {this.renderHiddenFormInputs()}\n          <div>\n            {this.renderInput()}\n            <button type=\"submit\" className=\"ASRouterButton primary\" onClick={this.handleSubmitAttempt} ref=\"formSubmitBtn\">{content.scene2_button_label}</button>\n          </div>\n          {this.renderFormPrivacyNotice() || this.renderDisclaimer()}\n        </form>\n      </SnippetBase>);\n  }\n\n  getFirstSceneContent() {\n    return Object.keys(this.props.content).filter(key => key.includes(\"scene1\")).reduce((acc, key) => {\n      acc[key.substr(7)] = this.props.content[key];\n      return acc;\n    }, {});\n  }\n\n  render() {\n    const content = {...this.props.content, ...this.getFirstSceneContent()};\n\n    if (this.state.signupSubmitted) {\n      return this.renderSignupSubmitted();\n    }\n    if (this.state.expanded) {\n      return this.renderSignupView();\n    }\n    return <SimpleSnippet {...this.props} content={content} onButtonClick={this.expandSnippet} />;\n  }\n}\n","import React from \"react\";\nimport schema from \"./FXASignupSnippet.schema.json\";\nimport {SubmitFormSnippet} from \"../SubmitFormSnippet/SubmitFormSnippet.jsx\";\n\nexport const FXASignupSnippet = props => {\n  const userAgent = window.navigator.userAgent.match(/Firefox\\/([0-9]+)\\./);\n  const firefox_version = userAgent ? parseInt(userAgent[1], 10) : 0;\n  const extendedContent = {\n    scene1_button_label: schema.properties.scene1_button_label.default,\n    scene2_email_placeholder_text: schema.properties.scene2_email_placeholder_text.default,\n    scene2_button_label: schema.properties.scene2_button_label.default,\n    scene2_dismiss_button_text: schema.properties.scene2_dismiss_button_text.default,\n    ...props.content,\n    hidden_inputs: {\n      action: \"email\",\n      context: \"fx_desktop_v3\",\n      entrypoint: \"snippets\",\n      service: \"sync\",\n      utm_source: \"snippet\",\n      utm_content: firefox_version,\n      utm_campaign: props.content.utm_campaign,\n      utm_term: props.content.utm_term,\n      ...props.content.hidden_inputs,\n    },\n  };\n\n  return (<SubmitFormSnippet\n    {...props}\n    content={extendedContent}\n    form_action={\"https://accounts.firefox.com/\"}\n    form_method=\"GET\" />);\n};\n","import React from \"react\";\nimport schema from \"./NewsletterSnippet.schema.json\";\nimport {SubmitFormSnippet} from \"../SubmitFormSnippet/SubmitFormSnippet.jsx\";\n\nexport const NewsletterSnippet = props => {\n  const extendedContent = {\n    scene1_button_label: schema.properties.scene1_button_label.default,\n    scene2_email_placeholder_text: schema.properties.scene2_email_placeholder_text.default,\n    scene2_button_label: schema.properties.scene2_button_label.default,\n    scene2_dismiss_button_text: schema.properties.scene2_dismiss_button_text.default,\n    scene2_newsletter: schema.properties.scene2_newsletter.default,\n    ...props.content,\n    hidden_inputs: {\n      newsletters: props.content.scene2_newsletter || schema.properties.scene2_newsletter.default,\n      fmt: schema.properties.hidden_inputs.properties.fmt.default,\n      lang: props.content.locale || schema.properties.locale.default,\n      source_url: `https://snippets.mozilla.com/show/${props.id}`,\n      ...props.content.hidden_inputs,\n    },\n  };\n\n  return (<SubmitFormSnippet\n    {...props}\n    content={extendedContent}\n    form_action={\"https://basket.mozilla.org/subscribe.json\"}\n    form_method=\"POST\" />);\n};\n","/**\n * Checks if a given string is an email or phone number or neither\n * @param {string} val The user input\n * @param {ASRMessageContent} content .content property on ASR message\n * @returns {\"email\"|\"phone\"|\"\"} The type of the input\n */\nexport function isEmailOrPhoneNumber(val, content) {\n  const {locale} = content;\n  // http://emailregex.com/\n  const email_re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n  const check_email = email_re.test(val);\n  let check_phone; // depends on locale\n  switch (locale) {\n    case \"en-US\":\n    case \"en-CA\":\n      // allow 10-11 digits in case user wants to enter country code\n      check_phone = val.length >= 10 && val.length <= 11 && !isNaN(val);\n      break;\n    case \"de\":\n      // allow between 2 and 12 digits for german phone numbers\n      check_phone = val.length >= 2 && val.length <= 12 && !isNaN(val);\n      break;\n    // this case should never be hit, but good to have a fallback just in case\n    default:\n      check_phone = !isNaN(val);\n      break;\n  }\n  if (check_email) {\n    return \"email\";\n  } else if (check_phone) {\n    return \"phone\";\n  }\n  return \"\";\n}\n","import {isEmailOrPhoneNumber} from \"./isEmailOrPhoneNumber\";\nimport React from \"react\";\nimport schema from \"./SendToDeviceSnippet.schema.json\";\nimport {SubmitFormSnippet} from \"../SubmitFormSnippet/SubmitFormSnippet.jsx\";\n\nfunction validateInput(value, content) {\n  const type = isEmailOrPhoneNumber(value, content);\n  return type ? \"\" : \"Must be an email or a phone number.\";\n}\n\nfunction processFormData(input, message) {\n  const {content} = message;\n  const type = content.include_sms ? isEmailOrPhoneNumber(input.value, content) : \"email\";\n  const formData = new FormData();\n  let url;\n  if (type === \"phone\") {\n    url = \"https://basket.mozilla.org/news/subscribe_sms/\";\n    formData.append(\"mobile_number\", input.value);\n    formData.append(\"msg_name\", content.message_id_sms);\n    formData.append(\"country\", content.country);\n  } else if (type === \"email\") {\n    url = \"https://basket.mozilla.org/news/subscribe/\";\n    formData.append(\"email\", input.value);\n    formData.append(\"newsletters\", content.message_id_email);\n    formData.append(\"source_url\", encodeURIComponent(`https://snippets.mozilla.com/show/${message.id}`));\n  }\n  formData.append(\"lang\", content.locale);\n  return {formData, url};\n}\n\nfunction addDefaultValues(props) {\n  return {\n    ...props,\n    content: {\n      scene1_button_label: schema.properties.scene1_button_label.default,\n      scene2_dismiss_button_text: schema.properties.scene2_dismiss_button_text.default,\n      scene2_button_label: schema.properties.scene2_button_label.default,\n      scene2_input_placeholder: schema.properties.scene2_input_placeholder.default,\n      locale: schema.properties.locale.default,\n      country: schema.properties.country.default,\n      message_id_email: \"\",\n      include_sms: schema.properties.include_sms.default,\n      ...props.content,\n    },\n  };\n}\n\nexport const SendToDeviceSnippet = props => {\n  const propsWithDefaults = addDefaultValues(props);\n\n  return (<SubmitFormSnippet {...propsWithDefaults}\n    form_method=\"POST\"\n    className=\"send_to_device_snippet\"\n    inputType={propsWithDefaults.content.include_sms ? \"text\" : \"email\"}\n    validateInput={propsWithDefaults.content.include_sms ? validateInput : null}\n    processFormData={processFormData} />);\n};\n","import {EOYSnippet} from \"./EOYSnippet/EOYSnippet\";\nimport {FXASignupSnippet} from \"./FXASignupSnippet/FXASignupSnippet\";\nimport {NewsletterSnippet} from \"./NewsletterSnippet/NewsletterSnippet\";\nimport {SendToDeviceSnippet} from \"./SendToDeviceSnippet/SendToDeviceSnippet\";\nimport {SimpleSnippet} from \"./SimpleSnippet/SimpleSnippet\";\n\n// Key names matching schema name of templates\nexport const SnippetsTemplates = {\n  simple_snippet: SimpleSnippet,\n  newsletter_snippet: NewsletterSnippet,\n  fxa_signup_snippet: FXASignupSnippet,\n  send_to_device_snippet: SendToDeviceSnippet,\n  eoy_snippet: EOYSnippet,\n};\n","/*  eslint no-magic-numbers: [0]  */\n\nconst MAX_PLACEABLES = 100;\n\nconst entryIdentifierRe = /-?[a-zA-Z][a-zA-Z0-9_-]*/y;\nconst identifierRe = /[a-zA-Z][a-zA-Z0-9_-]*/y;\nconst functionIdentifierRe = /^[A-Z][A-Z_?-]*$/;\n\n/**\n * The `Parser` class is responsible for parsing FTL resources.\n *\n * It's only public method is `getResource(source)` which takes an FTL string\n * and returns a two element Array with an Object of entries generated from the\n * source as the first element and an array of SyntaxError objects as the\n * second.\n *\n * This parser is optimized for runtime performance.\n *\n * There is an equivalent of this parser in syntax/parser which is\n * generating full AST which is useful for FTL tools.\n */\nclass RuntimeParser {\n  /**\n   * Parse FTL code into entries formattable by the MessageContext.\n   *\n   * Given a string of FTL syntax, return a map of entries that can be passed\n   * to MessageContext.format and a list of errors encountered during parsing.\n   *\n   * @param {String} string\n   * @returns {Array<Object, Array>}\n   */\n  getResource(string) {\n    this._source = string;\n    this._index = 0;\n    this._length = string.length;\n    this.entries = {};\n\n    const errors = [];\n\n    this.skipWS();\n    while (this._index < this._length) {\n      try {\n        this.getEntry();\n      } catch (e) {\n        if (e instanceof SyntaxError) {\n          errors.push(e);\n\n          this.skipToNextEntryStart();\n        } else {\n          throw e;\n        }\n      }\n      this.skipWS();\n    }\n\n    return [this.entries, errors];\n  }\n\n  /**\n   * Parse the source string from the current index as an FTL entry\n   * and add it to object's entries property.\n   *\n   * @private\n   */\n  getEntry() {\n    // The index here should either be at the beginning of the file\n    // or right after new line.\n    if (this._index !== 0 &&\n        this._source[this._index - 1] !== \"\\n\") {\n      throw this.error(`Expected an entry to start\n        at the beginning of the file or on a new line.`);\n    }\n\n    const ch = this._source[this._index];\n\n    // We don't care about comments or sections at runtime\n    if (ch === \"/\" ||\n      (ch === \"#\" &&\n        [\" \", \"#\", \"\\n\"].includes(this._source[this._index + 1]))) {\n      this.skipComment();\n      return;\n    }\n\n    if (ch === \"[\") {\n      this.skipSection();\n      return;\n    }\n\n    this.getMessage();\n  }\n\n  /**\n   * Skip the section entry from the current index.\n   *\n   * @private\n   */\n  skipSection() {\n    this._index += 1;\n    if (this._source[this._index] !== \"[\") {\n      throw this.error('Expected \"[[\" to open a section');\n    }\n\n    this._index += 1;\n\n    this.skipInlineWS();\n    this.getVariantName();\n    this.skipInlineWS();\n\n    if (this._source[this._index] !== \"]\" ||\n        this._source[this._index + 1] !== \"]\") {\n      throw this.error('Expected \"]]\" to close a section');\n    }\n\n    this._index += 2;\n  }\n\n  /**\n   * Parse the source string from the current index as an FTL message\n   * and add it to the entries property on the Parser.\n   *\n   * @private\n   */\n  getMessage() {\n    const id = this.getEntryIdentifier();\n\n    this.skipInlineWS();\n\n    if (this._source[this._index] === \"=\") {\n      this._index++;\n    }\n\n    this.skipInlineWS();\n\n    const val = this.getPattern();\n\n    if (id.startsWith(\"-\") && val === null) {\n      throw this.error(\"Expected term to have a value\");\n    }\n\n    let attrs = null;\n\n    if (this._source[this._index] === \" \") {\n      const lineStart = this._index;\n      this.skipInlineWS();\n\n      if (this._source[this._index] === \".\") {\n        this._index = lineStart;\n        attrs = this.getAttributes();\n      }\n    }\n\n    if (attrs === null && typeof val === \"string\") {\n      this.entries[id] = val;\n    } else {\n      if (val === null && attrs === null) {\n        throw this.error(\"Expected message to have a value or attributes\");\n      }\n\n      this.entries[id] = {};\n\n      if (val !== null) {\n        this.entries[id].val = val;\n      }\n\n      if (attrs !== null) {\n        this.entries[id].attrs = attrs;\n      }\n    }\n  }\n\n  /**\n   * Skip whitespace.\n   *\n   * @private\n   */\n  skipWS() {\n    let ch = this._source[this._index];\n    while (ch === \" \" || ch === \"\\n\" || ch === \"\\t\" || ch === \"\\r\") {\n      ch = this._source[++this._index];\n    }\n  }\n\n  /**\n   * Skip inline whitespace (space and \\t).\n   *\n   * @private\n   */\n  skipInlineWS() {\n    let ch = this._source[this._index];\n    while (ch === \" \" || ch === \"\\t\") {\n      ch = this._source[++this._index];\n    }\n  }\n\n  /**\n   * Skip blank lines.\n   *\n   * @private\n   */\n  skipBlankLines() {\n    while (true) {\n      const ptr = this._index;\n\n      this.skipInlineWS();\n\n      if (this._source[this._index] === \"\\n\") {\n        this._index += 1;\n      } else {\n        this._index = ptr;\n        break;\n      }\n    }\n  }\n\n  /**\n   * Get identifier using the provided regex.\n   *\n   * By default this will get identifiers of public messages, attributes and\n   * external arguments (without the $).\n   *\n   * @returns {String}\n   * @private\n   */\n  getIdentifier(re = identifierRe) {\n    re.lastIndex = this._index;\n    const result = re.exec(this._source);\n\n    if (result === null) {\n      this._index += 1;\n      throw this.error(`Expected an identifier [${re.toString()}]`);\n    }\n\n    this._index = re.lastIndex;\n    return result[0];\n  }\n\n  /**\n   * Get identifier of a Message or a Term (staring with a dash).\n   *\n   * @returns {String}\n   * @private\n   */\n  getEntryIdentifier() {\n    return this.getIdentifier(entryIdentifierRe);\n  }\n\n  /**\n   * Get Variant name.\n   *\n   * @returns {Object}\n   * @private\n   */\n  getVariantName() {\n    let name = \"\";\n\n    const start = this._index;\n    let cc = this._source.charCodeAt(this._index);\n\n    if ((cc >= 97 && cc <= 122) || // a-z\n        (cc >= 65 && cc <= 90) || // A-Z\n        cc === 95 || cc === 32) { // _ <space>\n      cc = this._source.charCodeAt(++this._index);\n    } else {\n      throw this.error(\"Expected a keyword (starting with [a-zA-Z_])\");\n    }\n\n    while ((cc >= 97 && cc <= 122) || // a-z\n           (cc >= 65 && cc <= 90) || // A-Z\n           (cc >= 48 && cc <= 57) || // 0-9\n           cc === 95 || cc === 45 || cc === 32) { // _- <space>\n      cc = this._source.charCodeAt(++this._index);\n    }\n\n    // If we encountered the end of name, we want to test if the last\n    // collected character is a space.\n    // If it is, we will backtrack to the last non-space character because\n    // the keyword cannot end with a space character.\n    while (this._source.charCodeAt(this._index - 1) === 32) {\n      this._index--;\n    }\n\n    name += this._source.slice(start, this._index);\n\n    return { type: \"varname\", name };\n  }\n\n  /**\n   * Get simple string argument enclosed in `\"`.\n   *\n   * @returns {String}\n   * @private\n   */\n  getString() {\n    const start = this._index + 1;\n\n    while (++this._index < this._length) {\n      const ch = this._source[this._index];\n\n      if (ch === '\"') {\n        break;\n      }\n\n      if (ch === \"\\n\") {\n        throw this.error(\"Unterminated string expression\");\n      }\n    }\n\n    return this._source.substring(start, this._index++);\n  }\n\n  /**\n   * Parses a Message pattern.\n   * Message Pattern may be a simple string or an array of strings\n   * and placeable expressions.\n   *\n   * @returns {String|Array}\n   * @private\n   */\n  getPattern() {\n    // We're going to first try to see if the pattern is simple.\n    // If it is we can just look for the end of the line and read the string.\n    //\n    // Then, if either the line contains a placeable opening `{` or the\n    // next line starts an indentation, we switch to complex pattern.\n    const start = this._index;\n    let eol = this._source.indexOf(\"\\n\", this._index);\n\n    if (eol === -1) {\n      eol = this._length;\n    }\n\n    const firstLineContent = start !== eol ?\n      this._source.slice(start, eol) : null;\n\n    if (firstLineContent && firstLineContent.includes(\"{\")) {\n      return this.getComplexPattern();\n    }\n\n    this._index = eol + 1;\n\n    this.skipBlankLines();\n\n    if (this._source[this._index] !== \" \") {\n      // No indentation means we're done with this message. Callers should check\n      // if the return value here is null. It may be OK for messages, but not OK\n      // for terms, attributes and variants.\n      return firstLineContent;\n    }\n\n    const lineStart = this._index;\n\n    this.skipInlineWS();\n\n    if (this._source[this._index] === \".\") {\n      // The pattern is followed by an attribute. Rewind _index to the first\n      // column of the current line as expected by getAttributes.\n      this._index = lineStart;\n      return firstLineContent;\n    }\n\n    if (firstLineContent) {\n      // It's a multiline pattern which started on the same line as the\n      // identifier. Reparse the whole pattern to make sure we get all of it.\n      this._index = start;\n    }\n\n    return this.getComplexPattern();\n  }\n\n  /**\n   * Parses a complex Message pattern.\n   * This function is called by getPattern when the message is multiline,\n   * or contains escape chars or placeables.\n   * It does full parsing of complex patterns.\n   *\n   * @returns {Array}\n   * @private\n   */\n  /* eslint-disable complexity */\n  getComplexPattern() {\n    let buffer = \"\";\n    const content = [];\n    let placeables = 0;\n\n    let ch = this._source[this._index];\n\n    while (this._index < this._length) {\n      // This block handles multi-line strings combining strings separated\n      // by new line.\n      if (ch === \"\\n\") {\n        this._index++;\n\n        // We want to capture the start and end pointers\n        // around blank lines and add them to the buffer\n        // but only if the blank lines are in the middle\n        // of the string.\n        const blankLinesStart = this._index;\n        this.skipBlankLines();\n        const blankLinesEnd = this._index;\n\n\n        if (this._source[this._index] !== \" \") {\n          break;\n        }\n        this.skipInlineWS();\n\n        if (this._source[this._index] === \"}\" ||\n            this._source[this._index] === \"[\" ||\n            this._source[this._index] === \"*\" ||\n            this._source[this._index] === \".\") {\n          this._index = blankLinesEnd;\n          break;\n        }\n\n        buffer += this._source.substring(blankLinesStart, blankLinesEnd);\n\n        if (buffer.length || content.length) {\n          buffer += \"\\n\";\n        }\n        ch = this._source[this._index];\n        continue;\n      } else if (ch === \"\\\\\") {\n        const ch2 = this._source[this._index + 1];\n        if (ch2 === '\"' || ch2 === \"{\" || ch2 === \"\\\\\") {\n          ch = ch2;\n          this._index++;\n        }\n      } else if (ch === \"{\") {\n        // Push the buffer to content array right before placeable\n        if (buffer.length) {\n          content.push(buffer);\n        }\n        if (placeables > MAX_PLACEABLES - 1) {\n          throw this.error(\n            `Too many placeables, maximum allowed is ${MAX_PLACEABLES}`);\n        }\n        buffer = \"\";\n        content.push(this.getPlaceable());\n\n        this._index++;\n\n        ch = this._source[this._index];\n        placeables++;\n        continue;\n      }\n\n      if (ch) {\n        buffer += ch;\n      }\n      this._index++;\n      ch = this._source[this._index];\n    }\n\n    if (content.length === 0) {\n      return buffer.length ? buffer : null;\n    }\n\n    if (buffer.length) {\n      content.push(buffer);\n    }\n\n    return content;\n  }\n  /* eslint-enable complexity */\n\n  /**\n   * Parses a single placeable in a Message pattern and returns its\n   * expression.\n   *\n   * @returns {Object}\n   * @private\n   */\n  getPlaceable() {\n    const start = ++this._index;\n\n    this.skipWS();\n\n    if (this._source[this._index] === \"*\" ||\n       (this._source[this._index] === \"[\" &&\n        this._source[this._index + 1] !== \"]\")) {\n      const variants = this.getVariants();\n\n      return {\n        type: \"sel\",\n        exp: null,\n        vars: variants[0],\n        def: variants[1]\n      };\n    }\n\n    // Rewind the index and only support in-line white-space now.\n    this._index = start;\n    this.skipInlineWS();\n\n    const selector = this.getSelectorExpression();\n\n    this.skipWS();\n\n    const ch = this._source[this._index];\n\n    if (ch === \"}\") {\n      if (selector.type === \"attr\" && selector.id.name.startsWith(\"-\")) {\n        throw this.error(\n          \"Attributes of private messages cannot be interpolated.\"\n        );\n      }\n\n      return selector;\n    }\n\n    if (ch !== \"-\" || this._source[this._index + 1] !== \">\") {\n      throw this.error('Expected \"}\" or \"->\"');\n    }\n\n    if (selector.type === \"ref\") {\n      throw this.error(\"Message references cannot be used as selectors.\");\n    }\n\n    if (selector.type === \"var\") {\n      throw this.error(\"Variants cannot be used as selectors.\");\n    }\n\n    if (selector.type === \"attr\" && !selector.id.name.startsWith(\"-\")) {\n      throw this.error(\n        \"Attributes of public messages cannot be used as selectors.\"\n      );\n    }\n\n\n    this._index += 2; // ->\n\n    this.skipInlineWS();\n\n    if (this._source[this._index] !== \"\\n\") {\n      throw this.error(\"Variants should be listed in a new line\");\n    }\n\n    this.skipWS();\n\n    const variants = this.getVariants();\n\n    if (variants[0].length === 0) {\n      throw this.error(\"Expected members for the select expression\");\n    }\n\n    return {\n      type: \"sel\",\n      exp: selector,\n      vars: variants[0],\n      def: variants[1]\n    };\n  }\n\n  /**\n   * Parses a selector expression.\n   *\n   * @returns {Object}\n   * @private\n   */\n  getSelectorExpression() {\n    const literal = this.getLiteral();\n\n    if (literal.type !== \"ref\") {\n      return literal;\n    }\n\n    if (this._source[this._index] === \".\") {\n      this._index++;\n\n      const name = this.getIdentifier();\n      this._index++;\n      return {\n        type: \"attr\",\n        id: literal,\n        name\n      };\n    }\n\n    if (this._source[this._index] === \"[\") {\n      this._index++;\n\n      const key = this.getVariantKey();\n      this._index++;\n      return {\n        type: \"var\",\n        id: literal,\n        key\n      };\n    }\n\n    if (this._source[this._index] === \"(\") {\n      this._index++;\n      const args = this.getCallArgs();\n\n      if (!functionIdentifierRe.test(literal.name)) {\n        throw this.error(\"Function names must be all upper-case\");\n      }\n\n      this._index++;\n\n      literal.type = \"fun\";\n\n      return {\n        type: \"call\",\n        fun: literal,\n        args\n      };\n    }\n\n    return literal;\n  }\n\n  /**\n   * Parses call arguments for a CallExpression.\n   *\n   * @returns {Array}\n   * @private\n   */\n  getCallArgs() {\n    const args = [];\n\n    while (this._index < this._length) {\n      this.skipInlineWS();\n\n      if (this._source[this._index] === \")\") {\n        return args;\n      }\n\n      const exp = this.getSelectorExpression();\n\n      // MessageReference in this place may be an entity reference, like:\n      // `call(foo)`, or, if it's followed by `:` it will be a key-value pair.\n      if (exp.type !== \"ref\") {\n        args.push(exp);\n      } else {\n        this.skipInlineWS();\n\n        if (this._source[this._index] === \":\") {\n          this._index++;\n          this.skipInlineWS();\n\n          const val = this.getSelectorExpression();\n\n          // If the expression returned as a value of the argument\n          // is not a quote delimited string or number, throw.\n          //\n          // We don't have to check here if the pattern is quote delimited\n          // because that's the only type of string allowed in expressions.\n          if (typeof val === \"string\" ||\n              Array.isArray(val) ||\n              val.type === \"num\") {\n            args.push({\n              type: \"narg\",\n              name: exp.name,\n              val\n            });\n          } else {\n            this._index = this._source.lastIndexOf(\":\", this._index) + 1;\n            throw this.error(\n              \"Expected string in quotes, number.\");\n          }\n\n        } else {\n          args.push(exp);\n        }\n      }\n\n      this.skipInlineWS();\n\n      if (this._source[this._index] === \")\") {\n        break;\n      } else if (this._source[this._index] === \",\") {\n        this._index++;\n      } else {\n        throw this.error('Expected \",\" or \")\"');\n      }\n    }\n\n    return args;\n  }\n\n  /**\n   * Parses an FTL Number.\n   *\n   * @returns {Object}\n   * @private\n   */\n  getNumber() {\n    let num = \"\";\n    let cc = this._source.charCodeAt(this._index);\n\n    // The number literal may start with negative sign `-`.\n    if (cc === 45) {\n      num += \"-\";\n      cc = this._source.charCodeAt(++this._index);\n    }\n\n    // next, we expect at least one digit\n    if (cc < 48 || cc > 57) {\n      throw this.error(`Unknown literal \"${num}\"`);\n    }\n\n    // followed by potentially more digits\n    while (cc >= 48 && cc <= 57) {\n      num += this._source[this._index++];\n      cc = this._source.charCodeAt(this._index);\n    }\n\n    // followed by an optional decimal separator `.`\n    if (cc === 46) {\n      num += this._source[this._index++];\n      cc = this._source.charCodeAt(this._index);\n\n      // followed by at least one digit\n      if (cc < 48 || cc > 57) {\n        throw this.error(`Unknown literal \"${num}\"`);\n      }\n\n      // and optionally more digits\n      while (cc >= 48 && cc <= 57) {\n        num += this._source[this._index++];\n        cc = this._source.charCodeAt(this._index);\n      }\n    }\n\n    return {\n      type: \"num\",\n      val: num\n    };\n  }\n\n  /**\n   * Parses a list of Message attributes.\n   *\n   * @returns {Object}\n   * @private\n   */\n  getAttributes() {\n    const attrs = {};\n\n    while (this._index < this._length) {\n      if (this._source[this._index] !== \" \") {\n        break;\n      }\n      this.skipInlineWS();\n\n      if (this._source[this._index] !== \".\") {\n        break;\n      }\n      this._index++;\n\n      const key = this.getIdentifier();\n\n      this.skipInlineWS();\n\n      if (this._source[this._index] !== \"=\") {\n        throw this.error('Expected \"=\"');\n      }\n      this._index++;\n\n      this.skipInlineWS();\n\n      const val = this.getPattern();\n\n      if (val === null) {\n        throw this.error(\"Expected attribute to have a value\");\n      }\n\n      if (typeof val === \"string\") {\n        attrs[key] = val;\n      } else {\n        attrs[key] = {\n          val\n        };\n      }\n\n      this.skipBlankLines();\n    }\n\n    return attrs;\n  }\n\n  /**\n   * Parses a list of Selector variants.\n   *\n   * @returns {Array}\n   * @private\n   */\n  getVariants() {\n    const variants = [];\n    let index = 0;\n    let defaultIndex;\n\n    while (this._index < this._length) {\n      const ch = this._source[this._index];\n\n      if ((ch !== \"[\" || this._source[this._index + 1] === \"[\") &&\n          ch !== \"*\") {\n        break;\n      }\n      if (ch === \"*\") {\n        this._index++;\n        defaultIndex = index;\n      }\n\n      if (this._source[this._index] !== \"[\") {\n        throw this.error('Expected \"[\"');\n      }\n\n      this._index++;\n\n      const key = this.getVariantKey();\n\n      this.skipInlineWS();\n\n      const val = this.getPattern();\n\n      if (val === null) {\n        throw this.error(\"Expected variant to have a value\");\n      }\n\n      variants[index++] = {key, val};\n\n      this.skipWS();\n    }\n\n    return [variants, defaultIndex];\n  }\n\n  /**\n   * Parses a Variant key.\n   *\n   * @returns {String}\n   * @private\n   */\n  getVariantKey() {\n    // VariantKey may be a Keyword or Number\n\n    const cc = this._source.charCodeAt(this._index);\n    let literal;\n\n    if ((cc >= 48 && cc <= 57) || cc === 45) {\n      literal = this.getNumber();\n    } else {\n      literal = this.getVariantName();\n    }\n\n    if (this._source[this._index] !== \"]\") {\n      throw this.error('Expected \"]\"');\n    }\n\n    this._index++;\n    return literal;\n  }\n\n  /**\n   * Parses an FTL literal.\n   *\n   * @returns {Object}\n   * @private\n   */\n  getLiteral() {\n    const cc0 = this._source.charCodeAt(this._index);\n\n    if (cc0 === 36) { // $\n      this._index++;\n      return {\n        type: \"ext\",\n        name: this.getIdentifier()\n      };\n    }\n\n    const cc1 = cc0 === 45 // -\n      // Peek at the next character after the dash.\n      ? this._source.charCodeAt(this._index + 1)\n      // Or keep using the character at the current index.\n      : cc0;\n\n    if ((cc1 >= 97 && cc1 <= 122) || // a-z\n        (cc1 >= 65 && cc1 <= 90)) { // A-Z\n      return {\n        type: \"ref\",\n        name: this.getEntryIdentifier()\n      };\n    }\n\n    if ((cc1 >= 48 && cc1 <= 57)) { // 0-9\n      return this.getNumber();\n    }\n\n    if (cc0 === 34) { // \"\n      return this.getString();\n    }\n\n    throw this.error(\"Expected literal\");\n  }\n\n  /**\n   * Skips an FTL comment.\n   *\n   * @private\n   */\n  skipComment() {\n    // At runtime, we don't care about comments so we just have\n    // to parse them properly and skip their content.\n    let eol = this._source.indexOf(\"\\n\", this._index);\n\n    while (eol !== -1 &&\n      ((this._source[eol + 1] === \"/\" && this._source[eol + 2] === \"/\") ||\n       (this._source[eol + 1] === \"#\" &&\n         [\" \", \"#\"].includes(this._source[eol + 2])))) {\n      this._index = eol + 3;\n\n      eol = this._source.indexOf(\"\\n\", this._index);\n\n      if (eol === -1) {\n        break;\n      }\n    }\n\n    if (eol === -1) {\n      this._index = this._length;\n    } else {\n      this._index = eol + 1;\n    }\n  }\n\n  /**\n   * Creates a new SyntaxError object with a given message.\n   *\n   * @param {String} message\n   * @returns {Object}\n   * @private\n   */\n  error(message) {\n    return new SyntaxError(message);\n  }\n\n  /**\n   * Skips to the beginning of a next entry after the current position.\n   * This is used to mark the boundary of junk entry in case of error,\n   * and recover from the returned position.\n   *\n   * @private\n   */\n  skipToNextEntryStart() {\n    let start = this._index;\n\n    while (true) {\n      if (start === 0 || this._source[start - 1] === \"\\n\") {\n        const cc = this._source.charCodeAt(start);\n\n        if ((cc >= 97 && cc <= 122) || // a-z\n            (cc >= 65 && cc <= 90) || // A-Z\n             cc === 47 || cc === 91) { // /[\n          this._index = start;\n          return;\n        }\n      }\n\n      start = this._source.indexOf(\"\\n\", start);\n\n      if (start === -1) {\n        this._index = this._length;\n        return;\n      }\n      start++;\n    }\n  }\n}\n\n/**\n * Parses an FTL string using RuntimeParser and returns the generated\n * object with entries and a list of errors.\n *\n * @param {String} string\n * @returns {Array<Object, Array>}\n */\nexport default function parse(string) {\n  const parser = new RuntimeParser();\n  return parser.getResource(string);\n}\n","/* global Intl */\n\n/**\n * The `FluentType` class is the base of Fluent's type system.\n *\n * Fluent types wrap JavaScript values and store additional configuration for\n * them, which can then be used in the `toString` method together with a proper\n * `Intl` formatter.\n */\nexport class FluentType {\n\n  /**\n   * Create an `FluentType` instance.\n   *\n   * @param   {Any}    value - JavaScript value to wrap.\n   * @param   {Object} opts  - Configuration.\n   * @returns {FluentType}\n   */\n  constructor(value, opts) {\n    this.value = value;\n    this.opts = opts;\n  }\n\n  /**\n   * Unwrap the raw value stored by this `FluentType`.\n   *\n   * @returns {Any}\n   */\n  valueOf() {\n    return this.value;\n  }\n\n  /**\n   * Format this instance of `FluentType` to a string.\n   *\n   * Formatted values are suitable for use outside of the `MessageContext`.\n   * This method can use `Intl` formatters memoized by the `MessageContext`\n   * instance passed as an argument.\n   *\n   * @param   {MessageContext} [ctx]\n   * @returns {string}\n   */\n  toString() {\n    throw new Error(\"Subclasses of FluentType must implement toString.\");\n  }\n}\n\nexport class FluentNone extends FluentType {\n  toString() {\n    return this.value || \"???\";\n  }\n}\n\nexport class FluentNumber extends FluentType {\n  constructor(value, opts) {\n    super(parseFloat(value), opts);\n  }\n\n  toString(ctx) {\n    try {\n      const nf = ctx._memoizeIntlObject(\n        Intl.NumberFormat, this.opts\n      );\n      return nf.format(this.value);\n    } catch (e) {\n      // XXX Report the error.\n      return this.value;\n    }\n  }\n\n  /**\n   * Compare the object with another instance of a FluentType.\n   *\n   * @param   {MessageContext} ctx\n   * @param   {FluentType}     other\n   * @returns {bool}\n   */\n  match(ctx, other) {\n    if (other instanceof FluentNumber) {\n      return this.value === other.value;\n    }\n    return false;\n  }\n}\n\nexport class FluentDateTime extends FluentType {\n  constructor(value, opts) {\n    super(new Date(value), opts);\n  }\n\n  toString(ctx) {\n    try {\n      const dtf = ctx._memoizeIntlObject(\n        Intl.DateTimeFormat, this.opts\n      );\n      return dtf.format(this.value);\n    } catch (e) {\n      // XXX Report the error.\n      return this.value;\n    }\n  }\n}\n\nexport class FluentSymbol extends FluentType {\n  toString() {\n    return this.value;\n  }\n\n  /**\n   * Compare the object with another instance of a FluentType.\n   *\n   * @param   {MessageContext} ctx\n   * @param   {FluentType}     other\n   * @returns {bool}\n   */\n  match(ctx, other) {\n    if (other instanceof FluentSymbol) {\n      return this.value === other.value;\n    } else if (typeof other === \"string\") {\n      return this.value === other;\n    } else if (other instanceof FluentNumber) {\n      const pr = ctx._memoizeIntlObject(\n        Intl.PluralRules, other.opts\n      );\n      return this.value === pr.select(other.value);\n    }\n    return false;\n  }\n}\n","/**\n * @overview\n *\n * The FTL resolver ships with a number of functions built-in.\n *\n * Each function take two arguments:\n *   - args - an array of positional args\n *   - opts - an object of key-value args\n *\n * Arguments to functions are guaranteed to already be instances of\n * `FluentType`.  Functions must return `FluentType` objects as well.\n */\n\nimport { FluentNumber, FluentDateTime } from \"./types\";\n\nexport default {\n  \"NUMBER\": ([arg], opts) =>\n    new FluentNumber(arg.valueOf(), merge(arg.opts, opts)),\n  \"DATETIME\": ([arg], opts) =>\n    new FluentDateTime(arg.valueOf(), merge(arg.opts, opts)),\n};\n\nfunction merge(argopts, opts) {\n  return Object.assign({}, argopts, values(opts));\n}\n\nfunction values(opts) {\n  const unwrapped = {};\n  for (const [name, opt] of Object.entries(opts)) {\n    unwrapped[name] = opt.valueOf();\n  }\n  return unwrapped;\n}\n","/**\n * @overview\n *\n * The role of the Fluent resolver is to format a translation object to an\n * instance of `FluentType` or an array of instances.\n *\n * Translations can contain references to other messages or external arguments,\n * conditional logic in form of select expressions, traits which describe their\n * grammatical features, and can use Fluent builtins which make use of the\n * `Intl` formatters to format numbers, dates, lists and more into the\n * context's language.  See the documentation of the Fluent syntax for more\n * information.\n *\n * In case of errors the resolver will try to salvage as much of the\n * translation as possible.  In rare situations where the resolver didn't know\n * how to recover from an error it will return an instance of `FluentNone`.\n *\n * `MessageReference`, `VariantExpression`, `AttributeExpression` and\n * `SelectExpression` resolve to raw Runtime Entries objects and the result of\n * the resolution needs to be passed into `Type` to get their real value.\n * This is useful for composing expressions.  Consider:\n *\n *     brand-name[nominative]\n *\n * which is a `VariantExpression` with properties `id: MessageReference` and\n * `key: Keyword`.  If `MessageReference` was resolved eagerly, it would\n * instantly resolve to the value of the `brand-name` message.  Instead, we\n * want to get the message object and look for its `nominative` variant.\n *\n * All other expressions (except for `FunctionReference` which is only used in\n * `CallExpression`) resolve to an instance of `FluentType`.  The caller should\n * use the `toString` method to convert the instance to a native value.\n *\n *\n * All functions in this file pass around a special object called `env`.\n * This object stores a set of elements used by all resolve functions:\n *\n *  * {MessageContext} ctx\n *      context for which the given resolution is happening\n *  * {Object} args\n *      list of developer provided arguments that can be used\n *  * {Array} errors\n *      list of errors collected while resolving\n *  * {WeakSet} dirty\n *      Set of patterns already encountered during this resolution.\n *      This is used to prevent cyclic resolutions.\n */\n\n\nimport { FluentType, FluentNone, FluentNumber, FluentDateTime, FluentSymbol }\n  from \"./types\";\nimport builtins from \"./builtins\";\n\n// Prevent expansion of too long placeables.\nconst MAX_PLACEABLE_LENGTH = 2500;\n\n// Unicode bidi isolation characters.\nconst FSI = \"\\u2068\";\nconst PDI = \"\\u2069\";\n\n\n/**\n * Helper for choosing the default value from a set of members.\n *\n * Used in SelectExpressions and Type.\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Object} members\n *    Hash map of variants from which the default value is to be selected.\n * @param   {Number} def\n *    The index of the default variant.\n * @returns {FluentType}\n * @private\n */\nfunction DefaultMember(env, members, def) {\n  if (members[def]) {\n    return members[def];\n  }\n\n  const { errors } = env;\n  errors.push(new RangeError(\"No default\"));\n  return new FluentNone();\n}\n\n\n/**\n * Resolve a reference to another message.\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Object} id\n *    The identifier of the message to be resolved.\n * @param   {String} id.name\n *    The name of the identifier.\n * @returns {FluentType}\n * @private\n */\nfunction MessageReference(env, {name}) {\n  const { ctx, errors } = env;\n  const message = name.startsWith(\"-\")\n    ? ctx._terms.get(name)\n    : ctx._messages.get(name);\n\n  if (!message) {\n    const err = name.startsWith(\"-\")\n      ? new ReferenceError(`Unknown term: ${name}`)\n      : new ReferenceError(`Unknown message: ${name}`);\n    errors.push(err);\n    return new FluentNone(name);\n  }\n\n  return message;\n}\n\n/**\n * Resolve a variant expression to the variant object.\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Object} expr\n *    An expression to be resolved.\n * @param   {Object} expr.id\n *    An Identifier of a message for which the variant is resolved.\n * @param   {Object} expr.id.name\n *    Name a message for which the variant is resolved.\n * @param   {Object} expr.key\n *    Variant key to be resolved.\n * @returns {FluentType}\n * @private\n */\nfunction VariantExpression(env, {id, key}) {\n  const message = MessageReference(env, id);\n  if (message instanceof FluentNone) {\n    return message;\n  }\n\n  const { ctx, errors } = env;\n  const keyword = Type(env, key);\n\n  function isVariantList(node) {\n    return Array.isArray(node) &&\n      node[0].type === \"sel\" &&\n      node[0].exp === null;\n  }\n\n  if (isVariantList(message.val)) {\n    // Match the specified key against keys of each variant, in order.\n    for (const variant of message.val[0].vars) {\n      const variantKey = Type(env, variant.key);\n      if (keyword.match(ctx, variantKey)) {\n        return variant;\n      }\n    }\n  }\n\n  errors.push(new ReferenceError(`Unknown variant: ${keyword.toString(ctx)}`));\n  return Type(env, message);\n}\n\n\n/**\n * Resolve an attribute expression to the attribute object.\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Object} expr\n *    An expression to be resolved.\n * @param   {String} expr.id\n *    An ID of a message for which the attribute is resolved.\n * @param   {String} expr.name\n *    Name of the attribute to be resolved.\n * @returns {FluentType}\n * @private\n */\nfunction AttributeExpression(env, {id, name}) {\n  const message = MessageReference(env, id);\n  if (message instanceof FluentNone) {\n    return message;\n  }\n\n  if (message.attrs) {\n    // Match the specified name against keys of each attribute.\n    for (const attrName in message.attrs) {\n      if (name === attrName) {\n        return message.attrs[name];\n      }\n    }\n  }\n\n  const { errors } = env;\n  errors.push(new ReferenceError(`Unknown attribute: ${name}`));\n  return Type(env, message);\n}\n\n/**\n * Resolve a select expression to the member object.\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Object} expr\n *    An expression to be resolved.\n * @param   {String} expr.exp\n *    Selector expression\n * @param   {Array} expr.vars\n *    List of variants for the select expression.\n * @param   {Number} expr.def\n *    Index of the default variant.\n * @returns {FluentType}\n * @private\n */\nfunction SelectExpression(env, {exp, vars, def}) {\n  if (exp === null) {\n    return DefaultMember(env, vars, def);\n  }\n\n  const selector = Type(env, exp);\n  if (selector instanceof FluentNone) {\n    return DefaultMember(env, vars, def);\n  }\n\n  // Match the selector against keys of each variant, in order.\n  for (const variant of vars) {\n    const key = Type(env, variant.key);\n    const keyCanMatch =\n      key instanceof FluentNumber || key instanceof FluentSymbol;\n\n    if (!keyCanMatch) {\n      continue;\n    }\n\n    const { ctx } = env;\n\n    if (key.match(ctx, selector)) {\n      return variant;\n    }\n  }\n\n  return DefaultMember(env, vars, def);\n}\n\n\n/**\n * Resolve expression to a Fluent type.\n *\n * JavaScript strings are a special case.  Since they natively have the\n * `toString` method they can be used as if they were a Fluent type without\n * paying the cost of creating a instance of one.\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Object} expr\n *    An expression object to be resolved into a Fluent type.\n * @returns {FluentType}\n * @private\n */\nfunction Type(env, expr) {\n  // A fast-path for strings which are the most common case, and for\n  // `FluentNone` which doesn't require any additional logic.\n  if (typeof expr === \"string\" || expr instanceof FluentNone) {\n    return expr;\n  }\n\n  // The Runtime AST (Entries) encodes patterns (complex strings with\n  // placeables) as Arrays.\n  if (Array.isArray(expr)) {\n    return Pattern(env, expr);\n  }\n\n\n  switch (expr.type) {\n    case \"varname\":\n      return new FluentSymbol(expr.name);\n    case \"num\":\n      return new FluentNumber(expr.val);\n    case \"ext\":\n      return ExternalArgument(env, expr);\n    case \"fun\":\n      return FunctionReference(env, expr);\n    case \"call\":\n      return CallExpression(env, expr);\n    case \"ref\": {\n      const message = MessageReference(env, expr);\n      return Type(env, message);\n    }\n    case \"attr\": {\n      const attr = AttributeExpression(env, expr);\n      return Type(env, attr);\n    }\n    case \"var\": {\n      const variant = VariantExpression(env, expr);\n      return Type(env, variant);\n    }\n    case \"sel\": {\n      const member = SelectExpression(env, expr);\n      return Type(env, member);\n    }\n    case undefined: {\n      // If it's a node with a value, resolve the value.\n      if (expr.val !== null && expr.val !== undefined) {\n        return Type(env, expr.val);\n      }\n\n      const { errors } = env;\n      errors.push(new RangeError(\"No value\"));\n      return new FluentNone();\n    }\n    default:\n      return new FluentNone();\n  }\n}\n\n/**\n * Resolve a reference to an external argument.\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Object} expr\n *    An expression to be resolved.\n * @param   {String} expr.name\n *    Name of an argument to be returned.\n * @returns {FluentType}\n * @private\n */\nfunction ExternalArgument(env, {name}) {\n  const { args, errors } = env;\n\n  if (!args || !args.hasOwnProperty(name)) {\n    errors.push(new ReferenceError(`Unknown external: ${name}`));\n    return new FluentNone(name);\n  }\n\n  const arg = args[name];\n\n  // Return early if the argument already is an instance of FluentType.\n  if (arg instanceof FluentType) {\n    return arg;\n  }\n\n  // Convert the argument to a Fluent type.\n  switch (typeof arg) {\n    case \"string\":\n      return arg;\n    case \"number\":\n      return new FluentNumber(arg);\n    case \"object\":\n      if (arg instanceof Date) {\n        return new FluentDateTime(arg);\n      }\n    default:\n      errors.push(\n        new TypeError(`Unsupported external type: ${name}, ${typeof arg}`)\n      );\n      return new FluentNone(name);\n  }\n}\n\n/**\n * Resolve a reference to a function.\n *\n * @param   {Object}  env\n *    Resolver environment object.\n * @param   {Object} expr\n *    An expression to be resolved.\n * @param   {String} expr.name\n *    Name of the function to be returned.\n * @returns {Function}\n * @private\n */\nfunction FunctionReference(env, {name}) {\n  // Some functions are built-in.  Others may be provided by the runtime via\n  // the `MessageContext` constructor.\n  const { ctx: { _functions }, errors } = env;\n  const func = _functions[name] || builtins[name];\n\n  if (!func) {\n    errors.push(new ReferenceError(`Unknown function: ${name}()`));\n    return new FluentNone(`${name}()`);\n  }\n\n  if (typeof func !== \"function\") {\n    errors.push(new TypeError(`Function ${name}() is not callable`));\n    return new FluentNone(`${name}()`);\n  }\n\n  return func;\n}\n\n/**\n * Resolve a call to a Function with positional and key-value arguments.\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Object} expr\n *    An expression to be resolved.\n * @param   {Object} expr.fun\n *    FTL Function object.\n * @param   {Array} expr.args\n *    FTL Function argument list.\n * @returns {FluentType}\n * @private\n */\nfunction CallExpression(env, {fun, args}) {\n  const callee = FunctionReference(env, fun);\n\n  if (callee instanceof FluentNone) {\n    return callee;\n  }\n\n  const posargs = [];\n  const keyargs = {};\n\n  for (const arg of args) {\n    if (arg.type === \"narg\") {\n      keyargs[arg.name] = Type(env, arg.val);\n    } else {\n      posargs.push(Type(env, arg));\n    }\n  }\n\n  try {\n    return callee(posargs, keyargs);\n  } catch (e) {\n    // XXX Report errors.\n    return new FluentNone();\n  }\n}\n\n/**\n * Resolve a pattern (a complex string with placeables).\n *\n * @param   {Object} env\n *    Resolver environment object.\n * @param   {Array} ptn\n *    Array of pattern elements.\n * @returns {Array}\n * @private\n */\nfunction Pattern(env, ptn) {\n  const { ctx, dirty, errors } = env;\n\n  if (dirty.has(ptn)) {\n    errors.push(new RangeError(\"Cyclic reference\"));\n    return new FluentNone();\n  }\n\n  // Tag the pattern as dirty for the purpose of the current resolution.\n  dirty.add(ptn);\n  const result = [];\n\n  // Wrap interpolations with Directional Isolate Formatting characters\n  // only when the pattern has more than one element.\n  const useIsolating = ctx._useIsolating && ptn.length > 1;\n\n  for (const elem of ptn) {\n    if (typeof elem === \"string\") {\n      result.push(elem);\n      continue;\n    }\n\n    const part = Type(env, elem).toString(ctx);\n\n    if (useIsolating) {\n      result.push(FSI);\n    }\n\n    if (part.length > MAX_PLACEABLE_LENGTH) {\n      errors.push(\n        new RangeError(\n          \"Too many characters in placeable \" +\n          `(${part.length}, max allowed is ${MAX_PLACEABLE_LENGTH})`\n        )\n      );\n      result.push(part.slice(MAX_PLACEABLE_LENGTH));\n    } else {\n      result.push(part);\n    }\n\n    if (useIsolating) {\n      result.push(PDI);\n    }\n  }\n\n  dirty.delete(ptn);\n  return result.join(\"\");\n}\n\n/**\n * Format a translation into a string.\n *\n * @param   {MessageContext} ctx\n *    A MessageContext instance which will be used to resolve the\n *    contextual information of the message.\n * @param   {Object}         args\n *    List of arguments provided by the developer which can be accessed\n *    from the message.\n * @param   {Object}         message\n *    An object with the Message to be resolved.\n * @param   {Array}          errors\n *    An error array that any encountered errors will be appended to.\n * @returns {FluentType}\n */\nexport default function resolve(ctx, args, message, errors = []) {\n  const env = {\n    ctx, args, errors, dirty: new WeakSet()\n  };\n  return Type(env, message).toString(ctx);\n}\n","import resolve from \"./resolver\";\nimport parse from \"./parser\";\n\n/**\n * Message contexts are single-language stores of translations.  They are\n * responsible for parsing translation resources in the Fluent syntax and can\n * format translation units (entities) to strings.\n *\n * Always use `MessageContext.format` to retrieve translation units from\n * a context.  Translations can contain references to other entities or\n * external arguments, conditional logic in form of select expressions, traits\n * which describe their grammatical features, and can use Fluent builtins which\n * make use of the `Intl` formatters to format numbers, dates, lists and more\n * into the context's language.  See the documentation of the Fluent syntax for\n * more information.\n */\nexport class MessageContext {\n\n  /**\n   * Create an instance of `MessageContext`.\n   *\n   * The `locales` argument is used to instantiate `Intl` formatters used by\n   * translations.  The `options` object can be used to configure the context.\n   *\n   * Examples:\n   *\n   *     const ctx = new MessageContext(locales);\n   *\n   *     const ctx = new MessageContext(locales, { useIsolating: false });\n   *\n   *     const ctx = new MessageContext(locales, {\n   *       useIsolating: true,\n   *       functions: {\n   *         NODE_ENV: () => process.env.NODE_ENV\n   *       }\n   *     });\n   *\n   * Available options:\n   *\n   *   - `functions` - an object of additional functions available to\n   *                   translations as builtins.\n   *\n   *   - `useIsolating` - boolean specifying whether to use Unicode isolation\n   *                    marks (FSI, PDI) for bidi interpolations.\n   *\n   * @param   {string|Array<string>} locales - Locale or locales of the context\n   * @param   {Object} [options]\n   * @returns {MessageContext}\n   */\n  constructor(locales, { functions = {}, useIsolating = true } = {}) {\n    this.locales = Array.isArray(locales) ? locales : [locales];\n\n    this._terms = new Map();\n    this._messages = new Map();\n    this._functions = functions;\n    this._useIsolating = useIsolating;\n    this._intls = new WeakMap();\n  }\n\n  /*\n   * Return an iterator over public `[id, message]` pairs.\n   *\n   * @returns {Iterator}\n   */\n  get messages() {\n    return this._messages[Symbol.iterator]();\n  }\n\n  /*\n   * Check if a message is present in the context.\n   *\n   * @param {string} id - The identifier of the message to check.\n   * @returns {bool}\n   */\n  hasMessage(id) {\n    return this._messages.has(id);\n  }\n\n  /*\n   * Return the internal representation of a message.\n   *\n   * The internal representation should only be used as an argument to\n   * `MessageContext.format`.\n   *\n   * @param {string} id - The identifier of the message to check.\n   * @returns {Any}\n   */\n  getMessage(id) {\n    return this._messages.get(id);\n  }\n\n  /**\n   * Add a translation resource to the context.\n   *\n   * The translation resource must use the Fluent syntax.  It will be parsed by\n   * the context and each translation unit (message) will be available in the\n   * context by its identifier.\n   *\n   *     ctx.addMessages('foo = Foo');\n   *     ctx.getMessage('foo');\n   *\n   *     // Returns a raw representation of the 'foo' message.\n   *\n   * Parsed entities should be formatted with the `format` method in case they\n   * contain logic (references, select expressions etc.).\n   *\n   * @param   {string} source - Text resource with translations.\n   * @returns {Array<Error>}\n   */\n  addMessages(source) {\n    const [entries, errors] = parse(source);\n    for (const id in entries) {\n      if (id.startsWith(\"-\")) {\n        // Identifiers starting with a dash (-) define terms. Terms are private\n        // and cannot be retrieved from MessageContext.\n        if (this._terms.has(id)) {\n          errors.push(`Attempt to override an existing term: \"${id}\"`);\n          continue;\n        }\n        this._terms.set(id, entries[id]);\n      } else {\n        if (this._messages.has(id)) {\n          errors.push(`Attempt to override an existing message: \"${id}\"`);\n          continue;\n        }\n        this._messages.set(id, entries[id]);\n      }\n    }\n\n    return errors;\n  }\n\n  /**\n   * Format a message to a string or null.\n   *\n   * Format a raw `message` from the context into a string (or a null if it has\n   * a null value).  `args` will be used to resolve references to external\n   * arguments inside of the translation.\n   *\n   * In case of errors `format` will try to salvage as much of the translation\n   * as possible and will still return a string.  For performance reasons, the\n   * encountered errors are not returned but instead are appended to the\n   * `errors` array passed as the third argument.\n   *\n   *     const errors = [];\n   *     ctx.addMessages('hello = Hello, { $name }!');\n   *     const hello = ctx.getMessage('hello');\n   *     ctx.format(hello, { name: 'Jane' }, errors);\n   *\n   *     // Returns 'Hello, Jane!' and `errors` is empty.\n   *\n   *     ctx.format(hello, undefined, errors);\n   *\n   *     // Returns 'Hello, name!' and `errors` is now:\n   *\n   *     [<ReferenceError: Unknown external: name>]\n   *\n   * @param   {Object | string}    message\n   * @param   {Object | undefined} args\n   * @param   {Array}              errors\n   * @returns {?string}\n   */\n  format(message, args, errors) {\n    // optimize entities which are simple strings with no attributes\n    if (typeof message === \"string\") {\n      return message;\n    }\n\n    // optimize simple-string entities with attributes\n    if (typeof message.val === \"string\") {\n      return message.val;\n    }\n\n    // optimize entities with null values\n    if (message.val === undefined) {\n      return null;\n    }\n\n    return resolve(this, args, message, errors);\n  }\n\n  _memoizeIntlObject(ctor, opts) {\n    const cache = this._intls.get(ctor) || {};\n    const id = JSON.stringify(opts);\n\n    if (!cache[id]) {\n      cache[id] = new ctor(this.locales, opts);\n      this._intls.set(ctor, cache);\n    }\n\n    return cache[id];\n  }\n}\n","/*\n * CachedIterable caches the elements yielded by an iterable.\n *\n * It can be used to iterate over an iterable many times without depleting the\n * iterable.\n */\nexport default class CachedIterable {\n  /**\n   * Create an `CachedIterable` instance.\n   *\n   * @param {Iterable} iterable\n   * @returns {CachedIterable}\n   */\n  constructor(iterable) {\n    if (Symbol.asyncIterator in Object(iterable)) {\n      this.iterator = iterable[Symbol.asyncIterator]();\n    } else if (Symbol.iterator in Object(iterable)) {\n      this.iterator = iterable[Symbol.iterator]();\n    } else {\n      throw new TypeError(\"Argument must implement the iteration protocol.\");\n    }\n\n    this.seen = [];\n  }\n\n  [Symbol.iterator]() {\n    const { seen, iterator } = this;\n    let cur = 0;\n\n    return {\n      next() {\n        if (seen.length <= cur) {\n          seen.push(iterator.next());\n        }\n        return seen[cur++];\n      }\n    };\n  }\n\n  [Symbol.asyncIterator]() {\n    const { seen, iterator } = this;\n    let cur = 0;\n\n    return {\n      async next() {\n        if (seen.length <= cur) {\n          seen.push(await iterator.next());\n        }\n        return seen[cur++];\n      }\n    };\n  }\n\n  /**\n   * This method allows user to consume the next element from the iterator\n   * into the cache.\n   */\n  touchNext() {\n    const { seen, iterator } = this;\n    if (seen.length === 0 || seen[seen.length - 1].done === false) {\n      seen.push(iterator.next());\n    }\n  }\n}\n","/*\n * @overview\n *\n * Functions for managing ordered sequences of MessageContexts.\n *\n * An ordered iterable of MessageContext instances can represent the current\n * negotiated fallback chain of languages.  This iterable can be used to find\n * the best existing translation for a given identifier.\n *\n * The mapContext* methods can be used to find the first MessageContext in the\n * given iterable which contains the translation with the given identifier.  If\n * the iterable is ordered according to the result of a language negotiation\n * the returned MessageContext contains the best available translation.\n *\n * A simple function which formats translations based on the identifier might\n * be implemented as follows:\n *\n *     formatString(id, args) {\n *         const ctx = mapContextSync(contexts, id);\n *\n *         if (ctx === null) {\n *             return id;\n *         }\n *\n *         const msg = ctx.getMessage(id);\n *         return ctx.format(msg, args);\n *     }\n *\n * In order to pass an iterator to mapContext*, wrap it in CachedIterable.\n * This allows multiple calls to mapContext* without advancing and eventually\n * depleting the iterator.\n *\n *     function *generateMessages() {\n *         // Some lazy logic for yielding MessageContexts.\n *         yield *[ctx1, ctx2];\n *     }\n *\n *     const contexts = new CachedIterable(generateMessages());\n *     const ctx = mapContextSync(contexts, id);\n *\n */\n\n/*\n * Synchronously map an identifier or an array of identifiers to the best\n * `MessageContext` instance(s).\n *\n * @param {Iterable} iterable\n * @param {string|Array<string>} ids\n * @returns {MessageContext|Array<MessageContext>}\n */\nexport function mapContextSync(iterable, ids) {\n  if (!Array.isArray(ids)) {\n    return getContextForId(iterable, ids);\n  }\n\n  return ids.map(\n    id => getContextForId(iterable, id)\n  );\n}\n\n/*\n * Find the best `MessageContext` with the translation for `id`.\n */\nfunction getContextForId(iterable, id) {\n  for (const context of iterable) {\n    if (context.hasMessage(id)) {\n      return context;\n    }\n  }\n\n  return null;\n}\n\n/*\n * Asynchronously map an identifier or an array of identifiers to the best\n * `MessageContext` instance(s).\n *\n * @param {AsyncIterable} iterable\n * @param {string|Array<string>} ids\n * @returns {Promise<MessageContext|Array<MessageContext>>}\n */\nexport async function mapContextAsync(iterable, ids) {\n  if (!Array.isArray(ids)) {\n    for await (const context of iterable) {\n      if (context.hasMessage(ids)) {\n        return context;\n      }\n    }\n  }\n\n  let remainingCount = ids.length;\n  const foundContexts = new Array(remainingCount).fill(null);\n\n  for await (const context of iterable) {\n    // XXX Switch to const [index, id] of id.entries() when we move to Babel 7.\n    // See https://github.com/babel/babel/issues/5880.\n    for (let index = 0; index < ids.length; index++) {\n      const id = ids[index];\n      if (!foundContexts[index] && context.hasMessage(id)) {\n        foundContexts[index] = context;\n        remainingCount--;\n      }\n\n      // Return early when all ids have been mapped to contexts.\n      if (remainingCount === 0) {\n        return foundContexts;\n      }\n    }\n  }\n\n  return foundContexts;\n}\n","function nonBlank(line) {\n  return !/^\\s*$/.test(line);\n}\n\nfunction countIndent(line) {\n  const [indent] = line.match(/^\\s*/);\n  return indent.length;\n}\n\n/**\n * Template literal tag for dedenting FTL code.\n *\n * Strip the common indent of non-blank lines. Remove blank lines.\n *\n * @param {Array<string>} strings\n */\nexport function ftl(strings) {\n  const [code] = strings;\n  const lines = code.split(\"\\n\").filter(nonBlank);\n  const indents = lines.map(countIndent);\n  const common = Math.min(...indents);\n  const indent = new RegExp(`^\\\\s{${common}}`);\n\n  return lines.map(\n    line => line.replace(indent, \"\")\n  ).join(\"\\n\");\n}\n","/*\n * @module fluent\n * @overview\n *\n * `fluent` is a JavaScript implementation of Project Fluent, a localization\n * framework designed to unleash the expressive power of the natural language.\n *\n */\n\nexport { default as _parse } from \"./parser\";\n\nexport { MessageContext } from \"./context\";\nexport {\n  FluentType as MessageArgument,\n  FluentNumber as MessageNumberArgument,\n  FluentDateTime as MessageDateTimeArgument,\n} from \"./types\";\n\nexport { default as CachedIterable } from \"./cached_iterable\";\nexport { mapContextSync, mapContextAsync } from \"./fallback\";\n\nexport { ftl } from \"./util\";\n","import { CachedIterable, mapContextSync } from \"fluent\";\n\n/*\n * `ReactLocalization` handles translation formatting and fallback.\n *\n * The current negotiated fallback chain of languages is stored in the\n * `ReactLocalization` instance in form of an iterable of `MessageContext`\n * instances.  This iterable is used to find the best existing translation for\n * a given identifier.\n *\n * `Localized` components must subscribe to the changes of the\n * `ReactLocalization`'s fallback chain.  When the fallback chain changes (the\n * `messages` iterable is set anew), all subscribed compontent must relocalize.\n *\n * The `ReactLocalization` class instances are exposed to `Localized` elements\n * via the `LocalizationProvider` component.\n */\nexport default class ReactLocalization {\n  constructor(messages) {\n    this.contexts = new CachedIterable(messages);\n    this.subs = new Set();\n  }\n\n  /*\n   * Subscribe a `Localized` component to changes of `messages`.\n   */\n  subscribe(comp) {\n    this.subs.add(comp);\n  }\n\n  /*\n   * Unsubscribe a `Localized` component from `messages` changes.\n   */\n  unsubscribe(comp) {\n    this.subs.delete(comp);\n  }\n\n  /*\n   * Set a new `messages` iterable and trigger the retranslation.\n   */\n  setMessages(messages) {\n    this.contexts = new CachedIterable(messages);\n\n    // Update all subscribed Localized components.\n    this.subs.forEach(comp => comp.relocalize());\n  }\n\n  getMessageContext(id) {\n    return mapContextSync(this.contexts, id);\n  }\n\n  formatCompound(mcx, msg, args) {\n    const value = mcx.format(msg, args);\n\n    if (msg.attrs) {\n      var attrs = {};\n      for (const name of Object.keys(msg.attrs)) {\n        attrs[name] = mcx.format(msg.attrs[name], args);\n      }\n    }\n\n    return { value, attrs };\n  }\n\n  /*\n   * Find a translation by `id` and format it to a string using `args`.\n   */\n  getString(id, args, fallback) {\n    const mcx = this.getMessageContext(id);\n\n    if (mcx === null) {\n      return fallback || id;\n    }\n\n    const msg = mcx.getMessage(id);\n    return mcx.format(msg, args);\n  }\n}\n\nexport function isReactLocalization(props, propName) {\n  const prop = props[propName];\n\n  if (prop instanceof ReactLocalization) {\n    return null;\n  }\n\n  return new Error(\n    `The ${propName} context field must be an instance of ReactLocalization.`\n  );\n}\n","import { Component, Children } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport ReactLocalization, { isReactLocalization} from \"./localization\";\n\n/*\n * The Provider component for the `ReactLocalization` class.\n *\n * Exposes a `ReactLocalization` instance to all descendants via React's\n * context feature.  It makes translations available to all localizable\n * elements in the descendant's render tree without the need to pass them\n * explicitly.\n *\n *     <LocalizationProvider messages={…}>\n *         …\n *     </LocalizationProvider>\n *\n * The `LocalizationProvider` component takes one prop: `messages`.  It should\n * be an iterable of `MessageContext` instances in order of the user's\n * preferred languages.  The `MessageContext` instances will be used by\n * `ReactLocalization` to format translations.  If a translation is missing in\n * one instance, `ReactLocalization` will fall back to the next one.\n */\nexport default class LocalizationProvider extends Component {\n  constructor(props) {\n    super(props);\n    const { messages } = props;\n\n    if (messages === undefined) {\n      throw new Error(\"LocalizationProvider must receive the messages prop.\");\n    }\n\n    if (!messages[Symbol.iterator]) {\n      throw new Error(\"The messages prop must be an iterable.\");\n    }\n\n    this.l10n = new ReactLocalization(messages);\n  }\n\n  getChildContext() {\n    return {\n      l10n: this.l10n\n    };\n  }\n\n  componentWillReceiveProps(next) {\n    const { messages } = next;\n\n    if (messages !== this.props.messages) {\n      this.l10n.setMessages(messages);\n    }\n  }\n\n  render() {\n    return Children.only(this.props.children);\n  }\n}\n\nLocalizationProvider.childContextTypes = {\n  l10n: isReactLocalization\n};\n\nLocalizationProvider.propTypes = {\n  children: PropTypes.element.isRequired,\n  messages: isIterable\n};\n\nfunction isIterable(props, propName, componentName) {\n  const prop = props[propName];\n\n  if (Symbol.iterator in Object(prop)) {\n    return null;\n  }\n\n  return new Error(\n    `The ${propName} prop supplied to ${componentName} must be an iterable.`\n  );\n}\n","import { createElement, Component } from \"react\";\n\nimport { isReactLocalization } from \"./localization\";\n\nexport default function withLocalization(Inner) {\n  class WithLocalization extends Component {\n    componentDidMount() {\n      const { l10n } = this.context;\n\n      if (l10n) {\n        l10n.subscribe(this);\n      }\n    }\n\n    componentWillUnmount() {\n      const { l10n } = this.context;\n\n      if (l10n) {\n        l10n.unsubscribe(this);\n      }\n    }\n\n    /*\n     * Rerender this component in a new language.\n     */\n    relocalize() {\n      // When the `ReactLocalization`'s fallback chain changes, update the\n      // component.\n      this.forceUpdate();\n    }\n\n    /*\n     * Find a translation by `id` and format it to a string using `args`.\n     */\n    getString(id, args, fallback) {\n      const { l10n } = this.context;\n\n      if (!l10n) {\n        return fallback || id;\n      }\n\n      return l10n.getString(id, args, fallback);\n    }\n\n    render() {\n      return createElement(\n        Inner,\n        Object.assign(\n          // getString needs to be re-bound on updates to trigger a re-render\n          { getString: (...args) => this.getString(...args) },\n          this.props\n        )\n      );\n    }\n  }\n\n  WithLocalization.displayName = `WithLocalization(${displayName(Inner)})`;\n\n  WithLocalization.contextTypes = {\n    l10n: isReactLocalization\n  };\n\n  return WithLocalization;\n}\n\nfunction displayName(component) {\n  return component.displayName || component.name || \"Component\";\n}\n","/* eslint-env browser */\n\nconst TEMPLATE = document.createElement(\"template\");\n\nexport function parseMarkup(str) {\n  TEMPLATE.innerHTML = str;\n  return TEMPLATE.content;\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in this directory.\n */\n\n// For HTML, certain tags should omit their close tag. We keep a whitelist for\n// those special-case tags.\n\nvar omittedCloseTags = {\n  area: true,\n  base: true,\n  br: true,\n  col: true,\n  embed: true,\n  hr: true,\n  img: true,\n  input: true,\n  keygen: true,\n  link: true,\n  meta: true,\n  param: true,\n  source: true,\n  track: true,\n  wbr: true,\n  // NOTE: menuitem's close tag should be omitted, but that causes problems.\n};\n\nexport default omittedCloseTags;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in this directory.\n */\n\nimport omittedCloseTags from './omittedCloseTags';\n\n// For HTML, certain tags cannot have children. This has the same purpose as\n// `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\nvar voidElementTags = {\n  menuitem: true,\n  ...omittedCloseTags,\n};\n\nexport default voidElementTags;\n","import { isValidElement, cloneElement, Component, Children } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { isReactLocalization } from \"./localization\";\nimport { parseMarkup } from \"./markup\";\nimport VOID_ELEMENTS from \"../vendor/voidElementTags\";\n\n// Match the opening angle bracket (<) in HTML tags, and HTML entities like\n// &amp;, &#0038;, &#x0026;.\nconst reMarkup = /<|&#?\\w+;/;\n\n/*\n * Prepare props passed to `Localized` for formatting.\n */\nfunction toArguments(props) {\n  const args = {};\n  const elems = {};\n\n  for (const [propname, propval] of Object.entries(props)) {\n    if (propname.startsWith(\"$\")) {\n      const name = propname.substr(1);\n      args[name] = propval;\n    } else if (isValidElement(propval)) {\n      // We'll try to match localNames of elements found in the translation with\n      // names of elements passed as props. localNames are always lowercase.\n      const name = propname.toLowerCase();\n      elems[name] = propval;\n    }\n  }\n\n  return [args, elems];\n}\n\n/*\n * The `Localized` class renders its child with translated props and children.\n *\n *     <Localized id=\"hello-world\">\n *         <p>{'Hello, world!'}</p>\n *     </Localized>\n *\n * The `id` prop should be the unique identifier of the translation.  Any\n * attributes found in the translation will be applied to the wrapped element.\n *\n * Arguments to the translation can be passed as `$`-prefixed props on\n * `Localized`.\n *\n *     <Localized id=\"hello-world\" $username={name}>\n *         <p>{'Hello, { $username }!'}</p>\n *     </Localized>\n *\n *  It's recommended that the contents of the wrapped component be a string\n *  expression.  The string will be used as the ultimate fallback if no\n *  translation is available.  It also makes it easy to grep for strings in the\n *  source code.\n */\nexport default class Localized extends Component {\n  componentDidMount() {\n    const { l10n } = this.context;\n\n    if (l10n) {\n      l10n.subscribe(this);\n    }\n  }\n\n  componentWillUnmount() {\n    const { l10n } = this.context;\n\n    if (l10n) {\n      l10n.unsubscribe(this);\n    }\n  }\n\n  /*\n   * Rerender this component in a new language.\n   */\n  relocalize() {\n    // When the `ReactLocalization`'s fallback chain changes, update the\n    // component.\n    this.forceUpdate();\n  }\n\n  render() {\n    const { l10n } = this.context;\n    const { id, attrs, children } = this.props;\n    const elem = Children.only(children);\n\n    if (!l10n) {\n      // Use the wrapped component as fallback.\n      return elem;\n    }\n\n    const mcx = l10n.getMessageContext(id);\n\n    if (mcx === null) {\n      // Use the wrapped component as fallback.\n      return elem;\n    }\n\n    const msg = mcx.getMessage(id);\n    const [args, elems] = toArguments(this.props);\n    const {\n      value: messageValue,\n      attrs: messageAttrs\n    } = l10n.formatCompound(mcx, msg, args);\n\n    // The default is to forbid all message attributes. If the attrs prop exists\n    // on the Localized instance, only set message attributes which have been\n    // explicitly allowed by the developer.\n    if (attrs && messageAttrs) {\n      var localizedProps = {};\n\n      for (const [name, value] of Object.entries(messageAttrs)) {\n        if (attrs[name]) {\n          localizedProps[name] = value;\n        }\n      }\n    }\n\n    // If the wrapped component is a known void element, explicitly dismiss the\n    // message value and do not pass it to cloneElement in order to avoid the\n    // \"void element tags must neither have `children` nor use\n    // `dangerouslySetInnerHTML`\" error.\n    if (elem.type in VOID_ELEMENTS) {\n      return cloneElement(elem, localizedProps);\n    }\n\n    // If the message has a null value, we're only interested in its attributes.\n    // Do not pass the null value to cloneElement as it would nuke all children\n    // of the wrapped component.\n    if (messageValue === null) {\n      return cloneElement(elem, localizedProps);\n    }\n\n    // If the message value doesn't contain any markup nor any HTML entities,\n    // insert it as the only child of the wrapped component.\n    if (!reMarkup.test(messageValue)) {\n      return cloneElement(elem, localizedProps, messageValue);\n    }\n\n    // If the message contains markup, parse it and try to match the children\n    // found in the translation with the props passed to this Localized.\n    const translationNodes = Array.from(parseMarkup(messageValue).childNodes);\n    const translatedChildren = translationNodes.map(childNode => {\n      if (childNode.nodeType === childNode.TEXT_NODE) {\n        return childNode.textContent;\n      }\n\n      // If the child is not expected just take its textContent.\n      if (!elems.hasOwnProperty(childNode.localName)) {\n        return childNode.textContent;\n      }\n\n      const sourceChild = elems[childNode.localName];\n\n      // If the element passed as a prop to <Localized> is a known void element,\n      // explicitly dismiss any textContent which might have accidentally been\n      // defined in the translation to prevent the \"void element tags must not\n      // have children\" error.\n      if (sourceChild.type in VOID_ELEMENTS) {\n        return sourceChild;\n      }\n\n      // TODO Protect contents of elements wrapped in <Localized>\n      // https://github.com/projectfluent/fluent.js/issues/184\n      // TODO  Control localizable attributes on elements passed as props\n      // https://github.com/projectfluent/fluent.js/issues/185\n      return cloneElement(sourceChild, null, childNode.textContent);\n    });\n\n    return cloneElement(elem, localizedProps, ...translatedChildren);\n  }\n}\n\nLocalized.contextTypes = {\n  l10n: isReactLocalization\n};\n\nLocalized.propTypes = {\n  children: PropTypes.element.isRequired,\n};\n","/*\n * @module fluent-react\n * @overview\n *\n\n * `fluent-react` provides React bindings for Fluent.  It takes advantage of\n * React's Components system and the virtual DOM.  Translations are exposed to\n * components via the provider pattern.\n *\n *     <LocalizationProvider messages={…}>\n *         <Localized id=\"hello-world\">\n *             <p>{'Hello, world!'}</p>\n *         </Localized>\n *     </LocalizationProvider>\n *\n * Consult the documentation of the `LocalizationProvider` and the `Localized`\n * components for more information.\n */\n\nexport { default as LocalizationProvider } from \"./provider\";\nexport { default as withLocalization } from \"./with_localization\";\nexport { default as Localized } from \"./localized\";\nexport { default as ReactLocalization, isReactLocalization }\n  from \"./localization\";\n","this.Dedupe = class Dedupe {\n  constructor(createKey) {\n    this.createKey = createKey || this.defaultCreateKey;\n  }\n\n  defaultCreateKey(item) {\n    return item;\n  }\n\n  /**\n   * Dedupe any number of grouped elements favoring those from earlier groups.\n   *\n   * @param {Array} groups Contains an arbitrary number of arrays of elements.\n   * @returns {Array} A matching array of each provided group deduped.\n   */\n  group(...groups) {\n    const globalKeys = new Set();\n    const result = [];\n    for (const values of groups) {\n      const valueMap = new Map();\n      for (const value of values) {\n        const key = this.createKey(value);\n        if (!globalKeys.has(key) && !valueMap.has(key)) {\n          valueMap.set(key, value);\n        }\n      }\n      result.push(valueMap);\n      valueMap.forEach((value, key) => globalKeys.add(key));\n    }\n    return result.map(m => Array.from(m.values()));\n  }\n};\n\nconst EXPORTED_SYMBOLS = [\"Dedupe\"];\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\"use strict\";\n\nconst {actionTypes: at} = ChromeUtils.import(\"resource://activity-stream/common/Actions.jsm\", {});\nconst {Dedupe} = ChromeUtils.import(\"resource://activity-stream/common/Dedupe.jsm\", {});\n\nconst TOP_SITES_DEFAULT_ROWS = 1;\nconst TOP_SITES_MAX_SITES_PER_ROW = 8;\n\nconst dedupe = new Dedupe(site => site && site.url);\n\nconst INITIAL_STATE = {\n  App: {\n    // Have we received real data from the app yet?\n    initialized: false,\n  },\n  ASRouter: {\n    initialized: false,\n    allowLegacySnippets: null,\n  },\n  Snippets: {initialized: false},\n  TopSites: {\n    // Have we received real data from history yet?\n    initialized: false,\n    // The history (and possibly default) links\n    rows: [],\n    // Used in content only to dispatch action to TopSiteForm.\n    editForm: null,\n    // Used in content only to open the SearchShortcutsForm modal.\n    showSearchShortcutsForm: false,\n    // The list of available search shortcuts.\n    searchShortcuts: [],\n  },\n  Prefs: {\n    initialized: false,\n    values: {},\n  },\n  Dialog: {\n    visible: false,\n    data: {},\n  },\n  Sections: [],\n  Pocket: {\n    isUserLoggedIn: null,\n    pocketCta: {},\n    waitingForSpoc: true,\n  },\n  // This is the new pocket configurable layout state.\n  DiscoveryStream: {\n    // This is a JSON-parsed copy of the discoverystream.config pref value.\n    config: {enabled: false, layout_endpoint: \"\"},\n    layout: [],\n    lastUpdated: null,\n    feeds: {\n      // \"https://foo.com/feed1\": {lastUpdated: 123, data: []}\n    },\n    spocs: {\n      spocs_endpoint: \"\",\n      lastUpdated: null,\n      data: {}, // {spocs: []}\n      loaded: false,\n    },\n  },\n  Search: {\n    // When search hand-off is enabled, we render a big button that is styled to\n    // look like a search textbox. If the button is clicked, we style\n    // the button as if it was a focused search box and show a fake cursor but\n    // really focus the awesomebar without the focus styles (\"hidden focus\").\n    fakeFocus: false,\n    // Hide the search box after handing off to AwesomeBar and user starts typing.\n    hide: false,\n  },\n};\n\nfunction App(prevState = INITIAL_STATE.App, action) {\n  switch (action.type) {\n    case at.INIT:\n      return Object.assign({}, prevState, action.data || {}, {initialized: true});\n    default:\n      return prevState;\n  }\n}\n\nfunction ASRouter(prevState = INITIAL_STATE.ASRouter, action) {\n  switch (action.type) {\n    case at.AS_ROUTER_INITIALIZED:\n      return {...action.data, initialized: true};\n    case at.AS_ROUTER_PREF_CHANGED:\n      return {...prevState, ...action.data};\n    default:\n      return prevState;\n  }\n}\n\n/**\n * insertPinned - Inserts pinned links in their specified slots\n *\n * @param {array} a list of links\n * @param {array} a list of pinned links\n * @return {array} resulting list of links with pinned links inserted\n */\nfunction insertPinned(links, pinned) {\n  // Remove any pinned links\n  const pinnedUrls = pinned.map(link => link && link.url);\n  let newLinks = links.filter(link => (link ? !pinnedUrls.includes(link.url) : false));\n  newLinks = newLinks.map(link => {\n    if (link && link.isPinned) {\n      delete link.isPinned;\n      delete link.pinIndex;\n    }\n    return link;\n  });\n\n  // Then insert them in their specified location\n  pinned.forEach((val, index) => {\n    if (!val) { return; }\n    let link = Object.assign({}, val, {isPinned: true, pinIndex: index});\n    if (index > newLinks.length) {\n      newLinks[index] = link;\n    } else {\n      newLinks.splice(index, 0, link);\n    }\n  });\n\n  return newLinks;\n}\n\nfunction TopSites(prevState = INITIAL_STATE.TopSites, action) {\n  let hasMatch;\n  let newRows;\n  switch (action.type) {\n    case at.TOP_SITES_UPDATED:\n      if (!action.data || !action.data.links) {\n        return prevState;\n      }\n      return Object.assign({}, prevState, {initialized: true, rows: action.data.links}, action.data.pref ? {pref: action.data.pref} : {});\n    case at.TOP_SITES_PREFS_UPDATED:\n      return Object.assign({}, prevState, {pref: action.data.pref});\n    case at.TOP_SITES_EDIT:\n      return Object.assign({}, prevState, {\n        editForm: {\n          index: action.data.index,\n          previewResponse: null,\n        },\n      });\n    case at.TOP_SITES_CANCEL_EDIT:\n      return Object.assign({}, prevState, {editForm: null});\n    case at.TOP_SITES_OPEN_SEARCH_SHORTCUTS_MODAL:\n      return Object.assign({}, prevState, {showSearchShortcutsForm: true});\n    case at.TOP_SITES_CLOSE_SEARCH_SHORTCUTS_MODAL:\n      return Object.assign({}, prevState, {showSearchShortcutsForm: false});\n    case at.PREVIEW_RESPONSE:\n      if (!prevState.editForm || action.data.url !== prevState.editForm.previewUrl) {\n        return prevState;\n      }\n      return Object.assign({}, prevState, {\n        editForm: {\n          index: prevState.editForm.index,\n          previewResponse: action.data.preview,\n          previewUrl: action.data.url,\n        },\n      });\n    case at.PREVIEW_REQUEST:\n      if (!prevState.editForm) {\n        return prevState;\n      }\n      return Object.assign({}, prevState, {\n        editForm: {\n          index: prevState.editForm.index,\n          previewResponse: null,\n          previewUrl: action.data.url,\n        },\n      });\n    case at.PREVIEW_REQUEST_CANCEL:\n      if (!prevState.editForm) {\n        return prevState;\n      }\n      return Object.assign({}, prevState, {\n        editForm: {\n          index: prevState.editForm.index,\n          previewResponse: null,\n        },\n      });\n    case at.SCREENSHOT_UPDATED:\n      newRows = prevState.rows.map(row => {\n        if (row && row.url === action.data.url) {\n          hasMatch = true;\n          return Object.assign({}, row, {screenshot: action.data.screenshot});\n        }\n        return row;\n      });\n      return hasMatch ? Object.assign({}, prevState, {rows: newRows}) : prevState;\n    case at.PLACES_BOOKMARK_ADDED:\n      if (!action.data) {\n        return prevState;\n      }\n      newRows = prevState.rows.map(site => {\n        if (site && site.url === action.data.url) {\n          const {bookmarkGuid, bookmarkTitle, dateAdded} = action.data;\n          return Object.assign({}, site, {bookmarkGuid, bookmarkTitle, bookmarkDateCreated: dateAdded});\n        }\n        return site;\n      });\n      return Object.assign({}, prevState, {rows: newRows});\n    case at.PLACES_BOOKMARK_REMOVED:\n      if (!action.data) {\n        return prevState;\n      }\n      newRows = prevState.rows.map(site => {\n        if (site && site.url === action.data.url) {\n          const newSite = Object.assign({}, site);\n          delete newSite.bookmarkGuid;\n          delete newSite.bookmarkTitle;\n          delete newSite.bookmarkDateCreated;\n          return newSite;\n        }\n        return site;\n      });\n      return Object.assign({}, prevState, {rows: newRows});\n    case at.PLACES_LINK_DELETED:\n      if (!action.data) {\n        return prevState;\n      }\n      newRows = prevState.rows.filter(site => action.data.url !== site.url);\n      return Object.assign({}, prevState, {rows: newRows});\n    case at.UPDATE_SEARCH_SHORTCUTS:\n      return {...prevState, searchShortcuts: action.data.searchShortcuts};\n    case at.SNIPPETS_PREVIEW_MODE:\n      return {...prevState, rows: []};\n    default:\n      return prevState;\n  }\n}\n\nfunction Dialog(prevState = INITIAL_STATE.Dialog, action) {\n  switch (action.type) {\n    case at.DIALOG_OPEN:\n      return Object.assign({}, prevState, {visible: true, data: action.data});\n    case at.DIALOG_CANCEL:\n      return Object.assign({}, prevState, {visible: false});\n    case at.DELETE_HISTORY_URL:\n      return Object.assign({}, INITIAL_STATE.Dialog);\n    default:\n      return prevState;\n  }\n}\n\nfunction Prefs(prevState = INITIAL_STATE.Prefs, action) {\n  let newValues;\n  switch (action.type) {\n    case at.PREFS_INITIAL_VALUES:\n      return Object.assign({}, prevState, {initialized: true, values: action.data});\n    case at.PREF_CHANGED:\n      newValues = Object.assign({}, prevState.values);\n      newValues[action.data.name] = action.data.value;\n      return Object.assign({}, prevState, {values: newValues});\n    default:\n      return prevState;\n  }\n}\n\nfunction Sections(prevState = INITIAL_STATE.Sections, action) {\n  let hasMatch;\n  let newState;\n  switch (action.type) {\n    case at.SECTION_DEREGISTER:\n      return prevState.filter(section => section.id !== action.data);\n    case at.SECTION_REGISTER:\n      // If section exists in prevState, update it\n      newState = prevState.map(section => {\n        if (section && section.id === action.data.id) {\n          hasMatch = true;\n          return Object.assign({}, section, action.data);\n        }\n        return section;\n      });\n      // Otherwise, append it\n      if (!hasMatch) {\n        const initialized = !!(action.data.rows && action.data.rows.length > 0);\n        const section = Object.assign({title: \"\", rows: [], enabled: false}, action.data, {initialized});\n        newState.push(section);\n      }\n      return newState;\n    case at.SECTION_UPDATE:\n      newState = prevState.map(section => {\n        if (section && section.id === action.data.id) {\n          // If the action is updating rows, we should consider initialized to be true.\n          // This can be overridden if initialized is defined in the action.data\n          const initialized = action.data.rows ? {initialized: true} : {};\n\n          // Make sure pinned cards stay at their current position when rows are updated.\n          // Disabling a section (SECTION_UPDATE with empty rows) does not retain pinned cards.\n          if (action.data.rows && action.data.rows.length > 0 && section.rows.find(card => card.pinned)) {\n            const rows = Array.from(action.data.rows);\n            section.rows.forEach((card, index) => {\n              if (card.pinned) {\n                // Only add it if it's not already there.\n                if (rows[index].guid !== card.guid) {\n                  rows.splice(index, 0, card);\n                }\n              }\n            });\n            return Object.assign({}, section, initialized, Object.assign({}, action.data, {rows}));\n          }\n\n          return Object.assign({}, section, initialized, action.data);\n        }\n        return section;\n      });\n\n      if (!action.data.dedupeConfigurations) {\n        return newState;\n      }\n\n      action.data.dedupeConfigurations.forEach(dedupeConf => {\n        newState = newState.map(section => {\n          if (section.id === dedupeConf.id) {\n            const dedupedRows = dedupeConf.dedupeFrom.reduce((rows, dedupeSectionId) => {\n              const dedupeSection = newState.find(s => s.id === dedupeSectionId);\n              const [, newRows] = dedupe.group(dedupeSection.rows, rows);\n              return newRows;\n            }, section.rows);\n\n            return Object.assign({}, section, {rows: dedupedRows});\n          }\n\n          return section;\n        });\n      });\n\n      return newState;\n    case at.SECTION_UPDATE_CARD:\n      return prevState.map(section => {\n        if (section && section.id === action.data.id && section.rows) {\n          const newRows = section.rows.map(card => {\n            if (card.url === action.data.url) {\n              return Object.assign({}, card, action.data.options);\n            }\n            return card;\n          });\n          return Object.assign({}, section, {rows: newRows});\n        }\n        return section;\n      });\n    case at.PLACES_BOOKMARK_ADDED:\n      if (!action.data) {\n        return prevState;\n      }\n      return prevState.map(section => Object.assign({}, section, {\n        rows: section.rows.map(item => {\n          // find the item within the rows that is attempted to be bookmarked\n          if (item.url === action.data.url) {\n            const {bookmarkGuid, bookmarkTitle, dateAdded} = action.data;\n            return Object.assign({}, item, {\n              bookmarkGuid,\n              bookmarkTitle,\n              bookmarkDateCreated: dateAdded,\n              type: \"bookmark\",\n            });\n          }\n          return item;\n        }),\n      }));\n    case at.PLACES_SAVED_TO_POCKET:\n      if (!action.data) {\n        return prevState;\n      }\n      return prevState.map(section => Object.assign({}, section, {\n        rows: section.rows.map(item => {\n          if (item.url === action.data.url) {\n            return Object.assign({}, item, {\n              open_url: action.data.open_url,\n              pocket_id: action.data.pocket_id,\n              title: action.data.title,\n              type: \"pocket\",\n            });\n          }\n          return item;\n        }),\n      }));\n    case at.PLACES_BOOKMARK_REMOVED:\n      if (!action.data) {\n        return prevState;\n      }\n      return prevState.map(section => Object.assign({}, section, {\n        rows: section.rows.map(item => {\n          // find the bookmark within the rows that is attempted to be removed\n          if (item.url === action.data.url) {\n            const newSite = Object.assign({}, item);\n            delete newSite.bookmarkGuid;\n            delete newSite.bookmarkTitle;\n            delete newSite.bookmarkDateCreated;\n            if (!newSite.type || newSite.type === \"bookmark\") {\n              newSite.type = \"history\";\n            }\n            return newSite;\n          }\n          return item;\n        }),\n      }));\n    case at.PLACES_LINK_DELETED:\n    case at.PLACES_LINK_BLOCKED:\n      if (!action.data) {\n        return prevState;\n      }\n      return prevState.map(section =>\n        Object.assign({}, section, {rows: section.rows.filter(site => site.url !== action.data.url)}));\n    case at.DELETE_FROM_POCKET:\n    case at.ARCHIVE_FROM_POCKET:\n      return prevState.map(section =>\n        Object.assign({}, section, {rows: section.rows.filter(site => site.pocket_id !== action.data.pocket_id)}));\n    case at.SNIPPETS_PREVIEW_MODE:\n      return prevState.map(section => ({...section, rows: []}));\n    default:\n      return prevState;\n  }\n}\n\nfunction Snippets(prevState = INITIAL_STATE.Snippets, action) {\n  switch (action.type) {\n    case at.SNIPPETS_DATA:\n      return Object.assign({}, prevState, {initialized: true}, action.data);\n    case at.SNIPPET_BLOCKED:\n      return Object.assign({}, prevState, {blockList: prevState.blockList.concat(action.data)});\n    case at.SNIPPETS_BLOCKLIST_CLEARED:\n      return Object.assign({}, prevState, {blockList: []});\n    case at.SNIPPETS_RESET:\n      return INITIAL_STATE.Snippets;\n    default:\n      return prevState;\n  }\n}\n\nfunction Pocket(prevState = INITIAL_STATE.Pocket, action) {\n  switch (action.type) {\n    case at.POCKET_WAITING_FOR_SPOC:\n      return {...prevState, waitingForSpoc: action.data};\n    case at.POCKET_LOGGED_IN:\n      return {...prevState, isUserLoggedIn: !!action.data};\n    case at.POCKET_CTA:\n      return {\n        ...prevState,\n        pocketCta: {\n          ctaButton: action.data.cta_button,\n          ctaText: action.data.cta_text,\n          ctaUrl: action.data.cta_url,\n          useCta: action.data.use_cta,\n        },\n      };\n    default:\n      return prevState;\n  }\n}\n\nfunction DiscoveryStream(prevState = INITIAL_STATE.DiscoveryStream, action) {\n  switch (action.type) {\n    case at.DISCOVERY_STREAM_CONFIG_CHANGE:\n    // The reason this is a separate action is so it doesn't trigger a listener update on init\n    case at.DISCOVERY_STREAM_CONFIG_SETUP:\n      return {...prevState, config: action.data || {}};\n    case at.DISCOVERY_STREAM_LAYOUT_UPDATE:\n      return {...prevState, lastUpdated: action.data.lastUpdated || null, layout: action.data.layout || []};\n    case at.DISCOVERY_STREAM_LAYOUT_RESET:\n      return {...prevState, lastUpdated: INITIAL_STATE.DiscoveryStream.lastUpdated, layout: INITIAL_STATE.DiscoveryStream.layout};\n    case at.DISCOVERY_STREAM_FEEDS_UPDATE:\n      return {...prevState, feeds: action.data || prevState.feeds};\n    case at.DISCOVERY_STREAM_SPOCS_ENDPOINT:\n      return {\n        ...prevState,\n        spocs: {\n          ...INITIAL_STATE.DiscoveryStream.spocs,\n          spocs_endpoint: action.data || INITIAL_STATE.DiscoveryStream.spocs.spocs_endpoint,\n        },\n      };\n    case at.DISCOVERY_STREAM_SPOCS_UPDATE:\n      if (action.data) {\n        return {\n          ...prevState,\n          spocs: {\n            ...prevState.spocs,\n            lastUpdated: action.data.lastUpdated,\n            data: action.data.spocs,\n            loaded: true,\n          },\n        };\n      }\n      return prevState;\n    default:\n      return prevState;\n  }\n}\n\nfunction Search(prevState = INITIAL_STATE.Search, action) {\n  switch (action.type) {\n    case at.HIDE_SEARCH:\n      return Object.assign({...prevState, hide: true});\n    case at.FAKE_FOCUS_SEARCH:\n      return Object.assign({...prevState, fakeFocus: true});\n    case at.SHOW_SEARCH:\n      return Object.assign({...prevState, hide: false, fakeFocus: false});\n    default:\n      return prevState;\n  }\n}\n\nthis.INITIAL_STATE = INITIAL_STATE;\nthis.TOP_SITES_DEFAULT_ROWS = TOP_SITES_DEFAULT_ROWS;\nthis.TOP_SITES_MAX_SITES_PER_ROW = TOP_SITES_MAX_SITES_PER_ROW;\n\nthis.reducers = {\n  TopSites,\n  App,\n  ASRouter,\n  Snippets,\n  Prefs,\n  Dialog,\n  Sections,\n  Pocket,\n  DiscoveryStream,\n  Search,\n};\n\nconst EXPORTED_SYMBOLS = [\n  \"reducers\",\n  \"INITIAL_STATE\",\n  \"insertPinned\",\n  \"TOP_SITES_DEFAULT_ROWS\",\n  \"TOP_SITES_MAX_SITES_PER_ROW\",\n];\n","export const cardContextTypes = {\n  history: {\n    intlID: \"type_label_visited\",\n    icon: \"history-item\",\n  },\n  bookmark: {\n    intlID: \"type_label_bookmarked\",\n    icon: \"bookmark-added\",\n  },\n  trending: {\n    intlID: \"type_label_recommended\",\n    icon: \"trending\",\n  },\n  now: {\n    intlID: \"type_label_now\",\n    icon: \"now\",\n  },\n  pocket: {\n    intlID: \"type_label_pocket\",\n    icon: \"pocket\",\n  },\n  download: {\n    intlID: \"type_label_downloaded\",\n    icon: \"download\",\n  },\n};\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {FormattedMessage, injectIntl} from \"react-intl\";\nimport {cardContextTypes} from \"./types\";\nimport {connect} from \"react-redux\";\nimport {GetPlatformString} from \"content-src/lib/link-menu-options\";\nimport {LinkMenu} from \"content-src/components/LinkMenu/LinkMenu\";\nimport React from \"react\";\nimport {ScreenshotUtils} from \"content-src/lib/screenshot-utils\";\n\n// Keep track of pending image loads to only request once\nconst gImageLoading = new Map();\n\n/**\n * Card component.\n * Cards are found within a Section component and contain information about a link such\n * as preview image, page title, page description, and some context about if the page\n * was visited, bookmarked, trending etc...\n * Each Section can make an unordered list of Cards which will create one instane of\n * this class. Each card will then get a context menu which reflects the actions that\n * can be done on this Card.\n */\nexport class _Card extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.state = {\n      activeCard: null,\n      imageLoaded: false,\n      showContextMenu: false,\n      cardImage: null,\n    };\n    this.onMenuButtonClick = this.onMenuButtonClick.bind(this);\n    this.onMenuUpdate = this.onMenuUpdate.bind(this);\n    this.onLinkClick = this.onLinkClick.bind(this);\n  }\n\n  /**\n   * Helper to conditionally load an image and update state when it loads.\n   */\n  async maybeLoadImage() {\n    // No need to load if it's already loaded or no image\n    const {cardImage} = this.state;\n    if (!cardImage) {\n      return;\n    }\n\n    const imageUrl = cardImage.url;\n    if (!this.state.imageLoaded) {\n      // Initialize a promise to share a load across multiple card updates\n      if (!gImageLoading.has(imageUrl)) {\n        const loaderPromise = new Promise((resolve, reject) => {\n          const loader = new Image();\n          loader.addEventListener(\"load\", resolve);\n          loader.addEventListener(\"error\", reject);\n          loader.src = imageUrl;\n        });\n\n        // Save and remove the promise only while it's pending\n        gImageLoading.set(imageUrl, loaderPromise);\n        loaderPromise.catch(ex => ex).then(() => gImageLoading.delete(imageUrl)).catch();\n      }\n\n      // Wait for the image whether just started loading or reused promise\n      await gImageLoading.get(imageUrl);\n\n      // Only update state if we're still waiting to load the original image\n      if (ScreenshotUtils.isRemoteImageLocal(this.state.cardImage, this.props.link.image) &&\n          !this.state.imageLoaded) {\n        this.setState({imageLoaded: true});\n      }\n    }\n  }\n\n  /**\n   * Helper to obtain the next state based on nextProps and prevState.\n   *\n   * NOTE: Rename this method to getDerivedStateFromProps when we update React\n   *       to >= 16.3. We will need to update tests as well. We cannot rename this\n   *       method to getDerivedStateFromProps now because there is a mismatch in\n   *       the React version that we are using for both testing and production.\n   *       (i.e. react-test-render => \"16.3.2\", react => \"16.2.0\").\n   *\n   * See https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-react-16/package.json#L43.\n   */\n  static getNextStateFromProps(nextProps, prevState) {\n    const {image} = nextProps.link;\n    const imageInState = ScreenshotUtils.isRemoteImageLocal(prevState.cardImage, image);\n    let nextState = null;\n\n    // Image is updating.\n    if (!imageInState && nextProps.link) {\n      nextState = {imageLoaded: false};\n    }\n\n    if (imageInState) {\n      return nextState;\n    }\n\n    // Since image was updated, attempt to revoke old image blob URL, if it exists.\n    ScreenshotUtils.maybeRevokeBlobObjectURL(prevState.cardImage);\n\n    nextState = nextState || {};\n    nextState.cardImage = ScreenshotUtils.createLocalImageObject(image);\n\n    return nextState;\n  }\n\n  onMenuButtonClick(event) {\n    event.preventDefault();\n    this.setState({\n      activeCard: this.props.index,\n      showContextMenu: true,\n    });\n  }\n\n  /**\n   * Report to telemetry additional information about the item.\n   */\n  _getTelemetryInfo() {\n    // Filter out \"history\" type for being the default\n    if (this.props.link.type !== \"history\") {\n      return {value: {card_type: this.props.link.type}};\n    }\n\n    return null;\n  }\n\n  onLinkClick(event) {\n    event.preventDefault();\n    if (this.props.link.type === \"download\") {\n      this.props.dispatch(ac.OnlyToMain({\n        type: at.SHOW_DOWNLOAD_FILE,\n        data: this.props.link,\n      }));\n    } else {\n      const {altKey, button, ctrlKey, metaKey, shiftKey} = event;\n      this.props.dispatch(ac.OnlyToMain({\n        type: at.OPEN_LINK,\n        data: Object.assign(this.props.link, {event: {altKey, button, ctrlKey, metaKey, shiftKey}}),\n      }));\n    }\n    if (this.props.isWebExtension) {\n      this.props.dispatch(ac.WebExtEvent(at.WEBEXT_CLICK, {\n        source: this.props.eventSource,\n        url: this.props.link.url,\n        action_position: this.props.index,\n      }));\n    } else {\n      this.props.dispatch(ac.UserEvent(Object.assign({\n        event: \"CLICK\",\n        source: this.props.eventSource,\n        action_position: this.props.index,\n      }, this._getTelemetryInfo())));\n\n      if (this.props.shouldSendImpressionStats) {\n        this.props.dispatch(ac.ImpressionStats({\n          source: this.props.eventSource,\n          click: 0,\n          tiles: [{id: this.props.link.guid, pos: this.props.index}],\n        }));\n      }\n    }\n  }\n\n  onMenuUpdate(showContextMenu) {\n    this.setState({showContextMenu});\n  }\n\n  componentDidMount() {\n    this.maybeLoadImage();\n  }\n\n  componentDidUpdate() {\n    this.maybeLoadImage();\n  }\n\n  // NOTE: Remove this function when we update React to >= 16.3 since React will\n  //       call getDerivedStateFromProps automatically. We will also need to\n  //       rename getNextStateFromProps to getDerivedStateFromProps.\n  componentWillMount() {\n    const nextState = _Card.getNextStateFromProps(this.props, this.state);\n    if (nextState) {\n      this.setState(nextState);\n    }\n  }\n\n  // NOTE: Remove this function when we update React to >= 16.3 since React will\n  //       call getDerivedStateFromProps automatically. We will also need to\n  //       rename getNextStateFromProps to getDerivedStateFromProps.\n  componentWillReceiveProps(nextProps) {\n    const nextState = _Card.getNextStateFromProps(nextProps, this.state);\n    if (nextState) {\n      this.setState(nextState);\n    }\n  }\n\n  componentWillUnmount() {\n    ScreenshotUtils.maybeRevokeBlobObjectURL(this.state.cardImage);\n  }\n\n  render() {\n    const {index, className, link, dispatch, contextMenuOptions, eventSource, shouldSendImpressionStats} = this.props;\n    const {props} = this;\n    const isContextMenuOpen = this.state.showContextMenu && this.state.activeCard === index;\n    // Display \"now\" as \"trending\" until we have new strings #3402\n    const {icon, intlID} = cardContextTypes[link.type === \"now\" ? \"trending\" : link.type] || {};\n    const hasImage = this.state.cardImage || link.hasImage;\n    const imageStyle = {backgroundImage: this.state.cardImage ? `url(${this.state.cardImage.url})` : \"none\"};\n    const outerClassName = [\n      \"card-outer\",\n      className,\n      isContextMenuOpen && \"active\",\n      props.placeholder && \"placeholder\",\n    ].filter(v => v).join(\" \");\n\n    return (<li className={outerClassName}>\n      <a href={link.type === \"pocket\" ? link.open_url : link.url} onClick={!props.placeholder ? this.onLinkClick : undefined}>\n        <div className=\"card\">\n          <div className=\"card-preview-image-outer\">\n            {hasImage &&\n              <div className={`card-preview-image${this.state.imageLoaded ? \" loaded\" : \"\"}`} style={imageStyle} />\n            }\n          </div>\n          <div className=\"card-details\">\n            {link.type === \"download\" && <div className=\"card-host-name alternate\"><FormattedMessage id={GetPlatformString(this.props.platform)} /></div>}\n            {link.hostname &&\n              <div className=\"card-host-name\">\n                {link.hostname.slice(0, 100)}{link.type === \"download\" && `  \\u2014 ${link.description}`}\n              </div>\n            }\n            <div className={[\n              \"card-text\",\n              icon ? \"\" : \"no-context\",\n              link.description ? \"\" : \"no-description\",\n              link.hostname ? \"\" : \"no-host-name\",\n            ].join(\" \")}>\n              <h4 className=\"card-title\" dir=\"auto\">{link.title}</h4>\n              <p className=\"card-description\" dir=\"auto\">{link.description}</p>\n            </div>\n            <div className=\"card-context\">\n              {icon && !link.context && <span className={`card-context-icon icon icon-${icon}`} />}\n              {link.icon && link.context && <span className=\"card-context-icon icon\" style={{backgroundImage: `url('${link.icon}')`}} />}\n              {intlID && !link.context && <div className=\"card-context-label\"><FormattedMessage id={intlID} defaultMessage=\"Visited\" /></div>}\n              {link.context && <div className=\"card-context-label\">{link.context}</div>}\n            </div>\n          </div>\n        </div>\n      </a>\n      {!props.placeholder && <button className=\"context-menu-button icon\" title={this.props.intl.formatMessage({id: \"context_menu_title\"})}\n        onClick={this.onMenuButtonClick}>\n        <span className=\"sr-only\">{`Open context menu for ${link.title}`}</span>\n      </button>}\n      {isContextMenuOpen &&\n        <LinkMenu\n          dispatch={dispatch}\n          index={index}\n          source={eventSource}\n          onUpdate={this.onMenuUpdate}\n          options={link.contextMenuOptions || contextMenuOptions}\n          site={link}\n          siteInfo={this._getTelemetryInfo()}\n          shouldSendImpressionStats={shouldSendImpressionStats} />\n      }\n   </li>);\n  }\n}\n_Card.defaultProps = {link: {}};\nexport const Card = connect(state => ({platform: state.Prefs.values.platform}))(injectIntl(_Card));\nexport const PlaceholderCard = props => <Card placeholder={true} className={props.className} />;\n","import {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\n\nexport class TopSiteFormInput extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.state = {validationError: this.props.validationError};\n    this.onChange = this.onChange.bind(this);\n    this.onMount = this.onMount.bind(this);\n  }\n\n  componentWillReceiveProps(nextProps) {\n    if (nextProps.shouldFocus && !this.props.shouldFocus) {\n      this.input.focus();\n    }\n    if (nextProps.validationError && !this.props.validationError) {\n      this.setState({validationError: true});\n    }\n    // If the component is in an error state but the value was cleared by the parent\n    if (this.state.validationError && !nextProps.value) {\n      this.setState({validationError: false});\n    }\n  }\n\n  onChange(ev) {\n    if (this.state.validationError) {\n      this.setState({validationError: false});\n    }\n    this.props.onChange(ev);\n  }\n\n  onMount(input) {\n    this.input = input;\n  }\n\n  render() {\n    const showClearButton = this.props.value && this.props.onClear;\n    const {typeUrl} = this.props;\n    const {validationError} = this.state;\n\n    return (<label><FormattedMessage id={this.props.titleId} />\n      <div className={`field ${typeUrl ? \"url\" : \"\"}${validationError ? \" invalid\" : \"\"}`}>\n        {this.props.loading ?\n          <div className=\"loading-container\"><div className=\"loading-animation\" /></div> :\n          showClearButton && <div className=\"icon icon-clear-input\" onClick={this.props.onClear} />}\n        <input type=\"text\"\n          value={this.props.value}\n          ref={this.onMount}\n          onChange={this.onChange}\n          placeholder={this.props.intl.formatMessage({id: this.props.placeholderId})}\n          autoFocus={this.props.shouldFocus}\n          disabled={this.props.loading} />\n        {validationError &&\n          <aside className=\"error-tooltip\">\n            <FormattedMessage id={this.props.errorMessageId} />\n          </aside>}\n      </div>\n    </label>);\n  }\n}\n\nTopSiteFormInput.defaultProps = {\n  showClearButton: false,\n  value: \"\",\n  validationError: false,\n};\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {FormattedMessage} from \"react-intl\";\nimport React from \"react\";\nimport {TOP_SITES_SOURCE} from \"./TopSitesConstants\";\nimport {TopSiteFormInput} from \"./TopSiteFormInput\";\nimport {TopSiteLink} from \"./TopSite\";\n\nexport class TopSiteForm extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    const {site} = props;\n    this.state = {\n      label: site ? (site.label || site.hostname) : \"\",\n      url: site ? site.url : \"\",\n      validationError: false,\n      customScreenshotUrl: site ? site.customScreenshotURL : \"\",\n      showCustomScreenshotForm: site ? site.customScreenshotURL : false,\n    };\n    this.onClearScreenshotInput = this.onClearScreenshotInput.bind(this);\n    this.onLabelChange = this.onLabelChange.bind(this);\n    this.onUrlChange = this.onUrlChange.bind(this);\n    this.onCancelButtonClick = this.onCancelButtonClick.bind(this);\n    this.onClearUrlClick = this.onClearUrlClick.bind(this);\n    this.onDoneButtonClick = this.onDoneButtonClick.bind(this);\n    this.onCustomScreenshotUrlChange = this.onCustomScreenshotUrlChange.bind(this);\n    this.onPreviewButtonClick = this.onPreviewButtonClick.bind(this);\n    this.onEnableScreenshotUrlForm = this.onEnableScreenshotUrlForm.bind(this);\n    this.validateUrl = this.validateUrl.bind(this);\n  }\n\n  onLabelChange(event) {\n    this.setState({\"label\": event.target.value});\n  }\n\n  onUrlChange(event) {\n    this.setState({\n      url: event.target.value,\n      validationError: false,\n    });\n  }\n\n  onClearUrlClick() {\n    this.setState({\n      url: \"\",\n      validationError: false,\n    });\n  }\n\n  onEnableScreenshotUrlForm() {\n    this.setState({showCustomScreenshotForm: true});\n  }\n\n  _updateCustomScreenshotInput(customScreenshotUrl) {\n    this.setState({\n      customScreenshotUrl,\n      validationError: false,\n    });\n    this.props.dispatch({type: at.PREVIEW_REQUEST_CANCEL});\n  }\n\n  onCustomScreenshotUrlChange(event) {\n    this._updateCustomScreenshotInput(event.target.value);\n  }\n\n  onClearScreenshotInput() {\n    this._updateCustomScreenshotInput(\"\");\n  }\n\n  onCancelButtonClick(ev) {\n    ev.preventDefault();\n    this.props.onClose();\n  }\n\n  onDoneButtonClick(ev) {\n    ev.preventDefault();\n\n    if (this.validateForm()) {\n      const site = {url: this.cleanUrl(this.state.url)};\n      const {index} = this.props;\n      if (this.state.label !== \"\") {\n        site.label = this.state.label;\n      }\n\n      if (this.state.customScreenshotUrl) {\n        site.customScreenshotURL = this.cleanUrl(this.state.customScreenshotUrl);\n      } else if (this.props.site && this.props.site.customScreenshotURL) {\n        // Used to flag that previously cached screenshot should be removed\n        site.customScreenshotURL = null;\n      }\n      this.props.dispatch(ac.AlsoToMain({\n        type: at.TOP_SITES_PIN,\n        data: {site, index},\n      }));\n      this.props.dispatch(ac.UserEvent({\n        source: TOP_SITES_SOURCE,\n        event: \"TOP_SITES_EDIT\",\n        action_position: index,\n      }));\n\n      this.props.onClose();\n    }\n  }\n\n  onPreviewButtonClick(event) {\n    event.preventDefault();\n    if (this.validateForm()) {\n      this.props.dispatch(ac.AlsoToMain({\n        type: at.PREVIEW_REQUEST,\n        data: {url: this.cleanUrl(this.state.customScreenshotUrl)},\n      }));\n      this.props.dispatch(ac.UserEvent({\n        source: TOP_SITES_SOURCE,\n        event: \"PREVIEW_REQUEST\",\n      }));\n    }\n  }\n\n  cleanUrl(url) {\n    // If we are missing a protocol, prepend http://\n    if (!url.startsWith(\"http:\") && !url.startsWith(\"https:\")) {\n      return `http://${url}`;\n    }\n    return url;\n  }\n\n  _tryParseUrl(url) {\n    try {\n      return new URL(url);\n    } catch (e) {\n      return null;\n    }\n  }\n\n  validateUrl(url) {\n    const validProtocols = [\"http:\", \"https:\"];\n    const urlObj = this._tryParseUrl(url) || this._tryParseUrl(this.cleanUrl(url));\n\n    return urlObj && validProtocols.includes(urlObj.protocol);\n  }\n\n  validateCustomScreenshotUrl() {\n    const {customScreenshotUrl} = this.state;\n    return !customScreenshotUrl || this.validateUrl(customScreenshotUrl);\n  }\n\n  validateForm() {\n    const validate = this.validateUrl(this.state.url) && this.validateCustomScreenshotUrl();\n\n    if (!validate) {\n      this.setState({validationError: true});\n    }\n\n    return validate;\n  }\n\n  _renderCustomScreenshotInput() {\n    const {customScreenshotUrl} = this.state;\n    const requestFailed = this.props.previewResponse === \"\";\n    const validationError = (this.state.validationError && !this.validateCustomScreenshotUrl()) || requestFailed;\n    // Set focus on error if the url field is valid or when the input is first rendered and is empty\n    const shouldFocus = (validationError && this.validateUrl(this.state.url)) || !customScreenshotUrl;\n    const isLoading = this.props.previewResponse === null &&\n      customScreenshotUrl && this.props.previewUrl === this.cleanUrl(customScreenshotUrl);\n\n    if (!this.state.showCustomScreenshotForm) {\n      return (<a className=\"enable-custom-image-input\" onClick={this.onEnableScreenshotUrlForm}>\n        <FormattedMessage id=\"topsites_form_use_image_link\" />\n      </a>);\n    }\n    return (<div className=\"custom-image-input-container\">\n      <TopSiteFormInput\n        errorMessageId={requestFailed ? \"topsites_form_image_validation\" : \"topsites_form_url_validation\"}\n        loading={isLoading}\n        onChange={this.onCustomScreenshotUrlChange}\n        onClear={this.onClearScreenshotInput}\n        shouldFocus={shouldFocus}\n        typeUrl={true}\n        value={customScreenshotUrl}\n        validationError={validationError}\n        titleId=\"topsites_form_image_url_label\"\n        placeholderId=\"topsites_form_url_placeholder\"\n        intl={this.props.intl} />\n    </div>);\n  }\n\n  render() {\n    const {customScreenshotUrl} = this.state;\n    const requestFailed = this.props.previewResponse === \"\";\n    // For UI purposes, editing without an existing link is \"add\"\n    const showAsAdd = !this.props.site;\n    const previous = (this.props.site && this.props.site.customScreenshotURL) || \"\";\n    const changed = customScreenshotUrl && this.cleanUrl(customScreenshotUrl) !== previous;\n    // Preview mode if changes were made to the custom screenshot URL and no preview was received yet\n    // or the request failed\n    const previewMode = changed && !this.props.previewResponse;\n    const previewLink = Object.assign({}, this.props.site);\n    if (this.props.previewResponse) {\n      previewLink.screenshot = this.props.previewResponse;\n      previewLink.customScreenshotURL = this.props.previewUrl;\n    }\n    return (\n      <form className=\"topsite-form\">\n        <div className=\"form-input-container\">\n          <h3 className=\"section-title\">\n            <FormattedMessage id={showAsAdd ? \"topsites_form_add_header\" : \"topsites_form_edit_header\"} />\n          </h3>\n          <div className=\"fields-and-preview\">\n            <div className=\"form-wrapper\">\n              <TopSiteFormInput onChange={this.onLabelChange}\n                value={this.state.label}\n                titleId=\"topsites_form_title_label\"\n                placeholderId=\"topsites_form_title_placeholder\"\n                intl={this.props.intl} />\n              <TopSiteFormInput onChange={this.onUrlChange}\n                shouldFocus={this.state.validationError && !this.validateUrl(this.state.url)}\n                value={this.state.url}\n                onClear={this.onClearUrlClick}\n                validationError={this.state.validationError && !this.validateUrl(this.state.url)}\n                titleId=\"topsites_form_url_label\"\n                typeUrl={true}\n                placeholderId=\"topsites_form_url_placeholder\"\n                errorMessageId=\"topsites_form_url_validation\"\n                intl={this.props.intl} />\n              {this._renderCustomScreenshotInput()}\n            </div>\n            <TopSiteLink link={previewLink}\n              defaultStyle={requestFailed}\n              title={this.state.label} />\n          </div>\n        </div>\n        <section className=\"actions\">\n          <button className=\"cancel\" type=\"button\" onClick={this.onCancelButtonClick}>\n            <FormattedMessage id=\"topsites_form_cancel_button\" />\n          </button>\n          {previewMode ?\n            <button className=\"done preview\" type=\"submit\" onClick={this.onPreviewButtonClick}>\n              <FormattedMessage id=\"topsites_form_preview_button\" />\n            </button> :\n            <button className=\"done\" type=\"submit\" onClick={this.onDoneButtonClick}>\n              <FormattedMessage id={showAsAdd ? \"topsites_form_add_button\" : \"topsites_form_save_button\"} />\n            </button>}\n        </section>\n      </form>\n    );\n  }\n}\n\nTopSiteForm.defaultProps = {\n  site: null,\n  index: -1,\n};\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./content-src/activity-stream.jsx","webpack:///(webpack)/buildin/global.js","webpack:///./common/Actions.jsm","webpack:///./content-src/lib/snippets.js","webpack:///./content-src/asrouter/asrouter-content.jsx","webpack:///external \"ReactIntl\"","webpack:///./content-src/lib/init-store.js","webpack:///external \"Redux\"","webpack:///./content-src/asrouter/rich-text-strings.js","webpack:///./content-src/asrouter/components/ImpressionsWrapper/ImpressionsWrapper.jsx","webpack:///external \"React\"","webpack:///external \"PropTypes\"","webpack:///./content-src/asrouter/templates/OnboardingMessage/OnboardingMessage.jsx","webpack:///./content-src/asrouter/components/ModalOverlay/ModalOverlay.jsx","webpack:///external \"ReactDOM\"","webpack:///./content-src/asrouter/templates/ReturnToAMO/ReturnToAMO.jsx","webpack:///./content-src/asrouter/components/RichText/RichText.jsx","webpack:///./content-src/asrouter/template-utils.js","webpack:///./content-src/asrouter/templates/StartupOverlay/StartupOverlay.jsx","webpack:///external \"ReactRedux\"","webpack:///./content-src/components/Base/Base.jsx","webpack:///./content-src/components/ASRouterAdmin/ASRouterAdmin.jsx","webpack:///./content-src/components/ASRouterAdmin/SimpleHashRouter.jsx","webpack:///./content-src/components/ConfirmDialog/ConfirmDialog.jsx","webpack:///./content-src/components/DiscoveryStreamImpressionStats/ImpressionStats.jsx","webpack:///./content-src/components/TopSites/TopSites.jsx","webpack:///./content-src/components/TopSites/TopSitesConstants.js","webpack:///./content-src/components/CollapsibleSection/CollapsibleSection.jsx","webpack:///./content-src/components/ErrorBoundary/ErrorBoundary.jsx","webpack:///./content-src/components/SectionMenu/SectionMenu.jsx","webpack:///./content-src/components/ContextMenu/ContextMenu.jsx","webpack:///./content-src/lib/section-menu-options.js","webpack:///./content-src/components/ComponentPerfTimer/ComponentPerfTimer.jsx","webpack:///./common/PerfService.jsm","webpack:///./content-src/components/TopSites/SearchShortcutsForm.jsx","webpack:///./content-src/components/TopSites/TopSite.jsx","webpack:///./content-src/components/LinkMenu/LinkMenu.jsx","webpack:///./content-src/lib/link-menu-options.js","webpack:///./content-src/lib/screenshot-utils.js","webpack:///./content-src/components/ManualMigration/ManualMigration.jsx","webpack:///./common/PrerenderData.jsm","webpack:///./content-src/components/Search/Search.jsx","webpack:///./content-src/lib/constants.js","webpack:///./content-src/components/Sections/Sections.jsx","webpack:///./content-src/components/MoreRecommendations/MoreRecommendations.jsx","webpack:///./content-src/components/PocketLoggedInCta/PocketLoggedInCta.jsx","webpack:///./content-src/components/Topics/Topics.jsx","webpack:///./content-src/lib/detect-user-session-start.js","webpack:///./content-src/lib/asroutercontent.js","webpack:///./content-src/components/DiscoveryStreamComponents/DSCard/DSCard.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/CardGrid/CardGrid.jsx","webpack:///./content-src/lib/truncate-text.js","webpack:///./content-src/components/DiscoveryStreamComponents/List/List.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/Hero/Hero.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/HorizontalRule/HorizontalRule.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/Navigation/Navigation.jsx","webpack:///./content-src/components/DiscoveryStreamComponents/SectionTitle/SectionTitle.jsx","webpack:///./node_modules/reselect/es/index.js","webpack:///./content-src/lib/selectLayoutRender.js","webpack:///./content-src/components/DiscoveryStreamComponents/TopSites/TopSites.jsx","webpack:///./content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx","webpack:///./content-src/asrouter/components/Button/Button.jsx","webpack:///./content-src/asrouter/components/ConditionalWrapper/ConditionalWrapper.jsx","webpack:///./content-src/asrouter/components/SnippetBase/SnippetBase.jsx","webpack:///./content-src/asrouter/templates/SimpleSnippet/SimpleSnippet.jsx","webpack:///./content-src/asrouter/templates/EOYSnippet/EOYSnippet.jsx","webpack:///./content-src/asrouter/templates/SubmitFormSnippet/SubmitFormSnippet.jsx","webpack:///./content-src/asrouter/templates/FXASignupSnippet/FXASignupSnippet.jsx","webpack:///./content-src/asrouter/templates/NewsletterSnippet/NewsletterSnippet.jsx","webpack:///./content-src/asrouter/templates/SendToDeviceSnippet/isEmailOrPhoneNumber.js","webpack:///./content-src/asrouter/templates/SendToDeviceSnippet/SendToDeviceSnippet.jsx","webpack:///./content-src/asrouter/templates/template-manifest.jsx","webpack:///./node_modules/fluent/src/parser.js","webpack:///./node_modules/fluent/src/types.js","webpack:///./node_modules/fluent/src/builtins.js","webpack:///./node_modules/fluent/src/resolver.js","webpack:///./node_modules/fluent/src/context.js","webpack:///./node_modules/fluent/src/cached_iterable.js","webpack:///./node_modules/fluent/src/fallback.js","webpack:///./node_modules/fluent/src/util.js","webpack:///./node_modules/fluent/src/index.js","webpack:///./node_modules/fluent-react/src/localization.js","webpack:///./node_modules/fluent-react/src/provider.js","webpack:///./node_modules/fluent-react/src/with_localization.js","webpack:///./node_modules/fluent-react/src/markup.js","webpack:///./node_modules/fluent-react/vendor/omittedCloseTags.js","webpack:///./node_modules/fluent-react/vendor/voidElementTags.js","webpack:///./node_modules/fluent-react/src/localized.js","webpack:///./node_modules/fluent-react/src/index.js","webpack:///./common/Dedupe.jsm","webpack:///./common/Reducers.jsm","webpack:///./content-src/components/Card/types.js","webpack:///./content-src/components/Card/Card.jsx","webpack:///./content-src/components/TopSites/TopSiteFormInput.jsx","webpack:///./content-src/components/TopSites/TopSiteForm.jsx"],"names":["store","initStore","reducers","global","gActivityStreamPrerenderedState","asrouterContent","ASRouterContent","DetectUserSessionStart","sendEventOrAddListener","dispatch","ac","AlsoToMain","type","at","NEW_TAB_STATE_REQUEST","enableASRouterContent","ReactDOM","hydrate","document","location","href","documentElement","lang","gActivityStreamStrings","getElementById","addSnippetsSubscriber","globalImportContext","Window","BACKGROUND_PROCESS","UI_CODE","actionTypes","ASRouterActions","_RouteMessage","action","options","meta","from","to","Error","forEach","o","fromTarget","skipLocal","CONTENT_MESSAGE_TYPE","MAIN_MESSAGE_TYPE","OnlyToMain","BroadcastToContent","AlsoToOneContent","target","skipMain","toTarget","OnlyToOneContent","AlsoToPreloaded","PRELOAD_MESSAGE_TYPE","UserEvent","data","TELEMETRY_USER_EVENT","ASRouterUserEvent","AS_ROUTER_TELEMETRY_USER_EVENT","UndesiredEvent","importContext","TELEMETRY_UNDESIRED_EVENT","PerfEvent","TELEMETRY_PERFORMANCE_EVENT","ImpressionStats","TELEMETRY_IMPRESSION_STATS","SetPref","name","value","SET_PREF","WebExtEvent","source","isSendToMain","isBroadcastToContent","isSendToOneContent","isSendToPreloaded","isFromMain","getPortIdOfSender","DATABASE_NAME","DATABASE_VERSION","SNIPPETS_OBJECTSTORE_NAME","SNIPPETS_UPDATE_INTERVAL_MS","SNIPPETS_ENABLED_EVENT","SNIPPETS_DISABLED_EVENT","SnippetsMap","Map","constructor","_db","_dispatch","set","key","_dbTransaction","db","put","delete","clear","SNIPPETS_BLOCKLIST_CLEARED","blockList","get","blockSnippetById","id","includes","push","SNIPPETS_BLOCKLIST_UPDATED","disableOnboarding","showFirefoxAccounts","SHOW_FIREFOX_ACCOUNTS","getTotalBookmarksCount","Promise","resolve","TOTAL_BOOKMARKS_REQUEST","RPMAddMessageListener","onMessage","TOTAL_BOOKMARKS_RESPONSE","RPMRemoveMessageListener","getAddonsInfo","ADDONS_INFO_REQUEST","ADDONS_INFO_RESPONSE","connect","_openDB","_restoreFromDb","modifier","reject","transaction","objectStore","onsuccess","event","onerror","error","openRequest","indexedDB","open","deleteDatabase","onupgradeneeded","result","objectStoreNames","contains","createObjectStore","err","console","onversionchange","versionChangeEvent","close","cursorRequest","openCursor","cursor","continue","SnippetsProvider","gSnippetsMap","_onAction","bind","snippetsMap","_refreshSnippets","cachedVersion","appData","version","lastUpdate","needsUpdate","Date","now","snippetsURL","response","fetch","status","payload","text","e","_showRemoteSnippets","snippetsEl","elementId","innerHTML","_logIfDevtools","scriptEl","getElementsByTagName","relocatedScript","createElement","parentNode","replaceChild","msg","SNIPPET_BLOCKED","concat","style","display","devtoolsEnabled","log","init","Object","assign","keys","window","dispatchEvent","Event","initialized","uninit","snippets","initializing","subscribe","state","getState","Prefs","values","ASRouter","allowLegacySnippets","disableSnippets","Snippets","hash","INCOMING_MESSAGE_NAME","OUTGOING_MESSAGE_NAME","ASR_CONTAINER_ID","ASRouterUtils","addListener","listener","removeListener","sendMessage","RPMSendAsyncMessage","blockById","dismissById","dismissBundle","bundle","executeAction","button_action","unblockById","unblockBundle","overrideMessage","sendTelemetry","ping","AS_GENERAL_OUTGOING_MESSAGE_NAME","getPreviewEndpoint","params","URLSearchParams","slice","indexOf","endpoint","URL","url","snippetId","shouldSendImpressionOnUpdate","nextProps","prevProps","message","ASRouterUISurface","React","PureComponent","props","onMessageFromParent","sendClick","sendImpression","sendUserActionTelemetry","extraProps","message_id","eventType","provider","metric","dataset","args","content","do_not_autoblock","onBlockById","onDismissById","triggerOnboarding","trigger","setState","body","classList","remove","componentWillMount","addLocaleData","componentWillUnmount","renderSnippets","template","SnippetComponent","SnippetsTemplates","generateMessages","renderOnboarding","renderFirstRunOverlay","add","activityStreamStore","renderPreviewBanner","render","defaultProps","containerElement","_mount","zIndex","appendChild","_activityStreamStore","_unmount","unmountComponentAtNode","MERGE_STORE_ACTION","EARLY_QUEUED_ACTIONS","SAVE_SESSION_PERF_DATA","PAGE_PRERENDERED","mergeStateReducer","mainReducer","prevState","messageMiddleware","next","au","rehydrationMiddleware","_didRehydrate","isMergeStoreAction","isRehydrationRequest","_didRequestInitialState","INIT","queueEarlyMessageMiddleware","_receivedFromMain","_earlyActionQueue","initialState","createStore","combineReducers","applyMiddleware","ex","dump","JSON","stringify","stack","RICH_TEXT_CONFIG","RICH_TEXT_KEYS","cx","MessageContext","attrs","attrsToTry","Array","isArray","string","length","attr","pop","addMessages","VISIBLE","VISIBILITY_CHANGE_EVENT","ImpressionsWrapper","sendImpressionOrAddListener","visibilityState","_onVisibilityChange","removeEventListener","addEventListener","componentDidMount","sendOnMount","componentDidUpdate","children","OnboardingCard","onClick","UISurface","onAction","primary_button","icon","title","label","OnboardingMessage","button_label","header","extraTemplateStrings","map","ModalOverlay","active","onDoneButton","ReturnToAMO","onClickAddExtension","onBlockButton","onReady","onBlock","renderText","customElement","addon_icon","secondary_button","ALLOWED_TAGS","b","i","u","strong","em","br","convertLinks","links","doNotAutoBlock","openNewWindow","reduce","acc","linkTag","safeURI","RichText","localization_id","customElements","protocol","isAllowed","warn","_StartupOverlay","onInputChange","onSubmit","clickSkip","initScene","removeOverlay","onInputInvalid","emailInput","overlayRemoved","flowId","flowBeginTime","didFetch","componentWillUpdate","fxa_endpoint","fxaParams","credentials","json","setTimeout","show","previousSibling","_getFormInfo","has_flow_params","preventDefault","focus","termsLink","privacyLink","intl","formatMessage","terms","privacy","StartupOverlay","injectIntl","didLogDevtoolsHelpText","PrefsButton","addLocaleDataForReactIntl","locale","parentLocale","debounce","func","wait","timer","wakeUp","apply","_Base","isFirstrun","isPrerendered","updateTheme","bodyClassName","filter","v","join","className","App","strings","prefs","startsWith","BaseContent","openPreferences","onWindowScroll","fixedSearch","SCROLL_THRESHOLD","scrollY","SETTINGS_OPEN","disableDarkTheme","bodyClassNames","shouldBeFixedToTop","PrerenderData","arePrefsValid","noSectionsEnabled","Sections","section","enabled","isDiscoveryStream","DiscoveryStream","config","searchHandoffEnabled","outerClassName","showSearch","Search","migrationExpired","Base","Row","relativeTime","timestamp","seconds","Math","floor","minutes","toLocaleString","DiscoveryStreamAdmin","onEnableToggle","setConfigValue","DISCOVERY_STREAM_CONFIG_SET_VALUE","checked","renderComponent","width","component","feed","renderFeed","feeds","lastUpdated","layout","opacity","layout_endpoint","row","rowIndex","components","componentIndex","ASRouterAdminInner","handleEnabledToggle","handleUserPrefToggle","onChangeMessageFilter","findOtherBundledMessagesOfSameTemplate","handleExpressionEval","onChangeTargetingParameters","onChangeAttributionParameters","setAttribution","onCopyTargetingParams","onPasteTargetingParams","onNewTargetingParams","messageFilter","evaluationStatus","stringTargetingParameters","newStringTargetingParameters","copiedToClipboard","pasteFromClipboard","attributionParameters","campaign","param","targetingParameters","messages","bundled","handleBlock","blockBundle","handleUnblock","handleOverride","expireCache","resetPref","context","parse","expression","refs","expressionInput","targetingParametersError","updatedParameters","providerPrefs","find","p","userPrefInfo","userPrefs","isUserEnabled","isSystemEnabled","isEnabling","undefined","setClipboardData","clipboardData","setData","execCommand","targetingParamsEval","innerText","renderMessageItem","isCurrent","lastMessageId","isBlocked","messageBlockList","impressions","messageImpressions","itemClassName","renderMessages","messagesToShow","renderMessageFilter","providers","renderTableHead","renderProviders","providersConfig","providerInfo","isTestProvider","info","bucket","reasonsDisabled","cohort","whiteSpace","renderPasteModal","errors","renderTargetingParameters","success","errorState","inputComp","renderPocketStory","story","guid","renderPocketStories","rows","Section","renderDiscoveryStream","renderAttributionParamers","getSection","routes","_ASRouterAdmin","ASRouterAdmin","SimpleHashRouter","onHashChange","replace","split","cloneElement","_ConfirmDialog","_handleCancelBtn","_handleConfirmBtn","DIALOG_CANCEL","eventSource","onConfirm","_renderModalMessage","message_body","body_string_id","visible","cancel_button_string_id","confirm_button_string_id","ConfirmDialog","Dialog","_needsImpressionStats","cards","impressionCardGuids","_dispatchImpressionStats","toUpperCase","tiles","link","sendImpressionStatsOrAddListener","topSiteIconType","customScreenshotURL","tippyTopIcon","faviconRef","faviconSize","MIN_RICH_FAVICON_SIZE","screenshot","MIN_CORNER_FAVICON_SIZE","countTopSitesIconsTypes","topSites","countTopSitesTypes","_TopSites","onEditFormClose","onSearchShortcutsFormClose","_dispatchTopSitesStats","_getVisibleTopSites","topSitesIconsStats","topSitesPinned","site","isPinned","searchShortcuts","searchTopSite","topsites_icon_stats","topsites_pinned","topsites_search_shortcuts","sitesPerRow","TOP_SITES_MAX_SITES_PER_ROW","matchMedia","matches","TopSites","TopSitesRows","TOP_SITES_SOURCE","TOP_SITES_CANCEL_EDIT","TOP_SITES_CLOSE_SEARCH_SHORTCUTS_MODAL","editForm","showSearchShortcutsForm","extraMenuOptions","pref","collapsed","isFirst","isLast","index","topSitesRows","TOP_SITES_CONTEXT_MENU_OPTIONS","TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS","getFormattedMessage","_CollapsibleSection","onBodyMount","onHeaderClick","onTransitionEnd","enableOrDisableAnimation","onMenuButtonClick","onMenuButtonMouseEnter","onMenuButtonMouseLeave","onMenuUpdate","enableAnimation","isAnimating","menuButtonHover","showContextMenu","setContextMenuButtonRef","sectionBody","scrollHeight","element","contextMenuButtonRef","node","maxHeight","_getSectionBodyHeight","userEvent","SectionMenuOptions","CheckCollapsed","div","currentTarget","renderIcon","backgroundImage","isCollapsible","learnMore","showPrefName","privacyNoticeURL","isWebExtension","bodyStyle","CollapsibleSection","ErrorBoundaryFallback","windowObj","reload","defaultClass","ErrorBoundary","hasError","componentDidCatch","FallbackComponent","DEFAULT_SECTION_MENU_OPTIONS","WEBEXT_SECTION_MENU_OPTIONS","_SectionMenu","getOptions","propOptions","extraOptions","splice","option","first","last","onUpdate","SectionMenu","ContextMenu","hideContext","stopPropagation","ContextMenuItem","onKeyDown","shiftKey","disabled","Separator","MoveUp","SECTION_MOVE","direction","MoveDown","RemoveSection","CollapseSection","UPDATE_SECTION_PREFS","ExpandSection","ManageSection","ManageWebExtension","OPEN_WEBEXT_SETTINGS","AddTopSite","TOP_SITES_EDIT","AddSearchShortcut","TOP_SITES_OPEN_SEARCH_SHORTCUTS_MODAL","PrivacyNotice","OPEN_LINK","RECORDED_SECTIONS","ComponentPerfTimer","Component","perfSvc","_sendBadStateEvent","_sendPaintedEvent","_reportMissingData","_timestampHandled","_recordedFirstRender","_maybeSendPaintedEvent","_afterFramePaint","callback","requestAnimationFrame","_maybeSendBadStateEvent","_ensureFirstRenderTsRecorded","mark","dataReadyKey","firstRenderKey","parseInt","getMostRecentAbsMarkStartByName","ChromeUtils","import","usablePerfObj","Services","appShell","hiddenDOMWindow","performance","_PerfService","performanceObj","_perf","prototype","str","getEntriesByName","timeOrigin","absNow","entries","mostRecentEntry","startTime","SelectableSearchShortcut","shortcut","selected","imageStyle","keyword","onChange","SearchShortcutsForm","handleChange","onCancelButtonClick","onSaveButtonClick","shortcuts","isSelected","ev","onClose","pinQueue","unpinQueue","alreadyPinned","_searchTopSite","searchVendor","shortURL","UPDATE_PINNED_SEARCH_SHORTCUTS","addedShortcuts","deletedShortcuts","search_vendor","TopSiteLink","screenshotImage","onDragEvent","onKeyPress","_allowDrop","dataTransfer","types","dragged","effectAllowed","blur","button","getNextStateFromProps","imageInState","ScreenshotUtils","isRemoteImageLocal","maybeRevokeBlobObjectURL","createLocalImageObject","nextState","componentWillReceiveProps","defaultStyle","isDraggable","topSiteOuterClassName","isDragged","letterFallback","imageClassName","showSmallFavicon","smallFaviconStyle","smallFaviconFallback","hasScreenshotImage","backgroundColor","favicon","draggableProps","onDragEnd","onDragStart","onMouseDown","TopSite","onLinkClick","_getTelemetryInfo","icon_type","iconType","card_type","hostname","action_position","altKey","ctrlKey","metaKey","FILL_SEARCH_TERM","onActivate","isContextMenuOpen","activeIndex","TopSitePlaceholder","onEditButtonClick","_TopSiteList","DEFAULT_STATE","draggedIndex","draggedSite","draggedTitle","topSitesPreview","prevTopSites","newTopSites","dropped","_makeTopSitesPreview","TOP_SITES_INSERT","draggedFromIndex","_getTopSites","pinnedOnly","unpinned","siteToInsert","holeIndex","indexStep","shiftingStep","nextIndex","preview","shift","topSitesUI","commonProps","maxNarrowVisibleIndex","l","slotProps","TopSiteList","DEFAULT_SITE_MENU_OPTIONS","_LinkMenu","isPrivateBrowsingEnabled","siteInfo","platform","isDefault","LinkMenuOptions","impression","string_id","userEventData","shouldSendImpressionStats","LinkMenu","_OpenInPrivateWindow","OPEN_PRIVATE_WINDOW","referrer","GetPlatformString","EmptyItem","RemoveBookmark","DELETE_BOOKMARK_BY_ID","bookmarkGuid","AddBookmark","BOOKMARK_URL","OpenInNewWindow","OPEN_NEW_WINDOW","typedBonus","BlockUrl","BLOCK_URL","open_url","pocket_id","block","pos","WebExtDismiss","WEBEXT_DISMISS","DeleteUrl","isEnabled","DIALOG_OPEN","DELETE_HISTORY_URL","forceBlock","ShowFile","SHOW_DOWNLOAD_FILE","OpenFile","OPEN_DOWNLOAD_FILE","CopyDownloadLink","COPY_DOWNLOAD_LINK","GoToDownloadPage","RemoveDownload","REMOVE_DOWNLOAD_FILE","PinTopSite","TOP_SITES_PIN","UnpinTopSite","TOP_SITES_UNPIN","SaveToPocket","SAVE_TO_POCKET","pocket","DeleteFromPocket","DELETE_FROM_POCKET","ArchiveFromPocket","ARCHIVE_FROM_POCKET","EditTopSite","CheckBookmark","CheckPinTopSite","CheckSavedToPocket","CheckBookmarkOrArchive","OpenInPrivateWindow","isBlob","isLocal","image","path","remoteImage","createObjectURL","localImage","revokeObjectURL","_ManualMigration","onLaunchTour","onCancelTour","MIGRATION_START","MIGRATION_CANCEL","ManualMigration","_PrerenderData","initialPrefs","initialSections","_setValidation","validation","_validation","invalidatingPrefs","_invalidatingPrefs","oneOf","jsonPrefs","_isPrefEnabled","prefObj","getPref","indexedDBPrefs","some","anyModifiedPrefs","prefName","isPrefModified","order","_Search","onSearchClick","onSearchHandoffClick","onSearchHandoffPaste","onSearchHandoffDrop","onInputMount","onSearchHandoffButtonMount","handleEvent","detail","gContentSearchController","search","doSearchHandoff","HANDOFF_SEARCH_TO_AWESOMEBAR","FAKE_FOCUS_SEARCH","HIDE_SEARCH","getData","input","healthReportKey","IS_NEWTAB","searchSource","ContentSearchUIController","_searchHandoffButton","wrapperClassName","hide","fakeFocus","showLogo","handoffEnabled","documentURI","CARDS_PER_ROW_DEFAULT","CARDS_PER_ROW_COMPACT_WIDE","numRows","rowsPref","maxRows","cardsPerRow","compactCards","maxCards","needsImpressionStats","sendNewTabRehydrated","isCollapsed","wasCollapsed","renderNotified","NEW_TAB_REHYDRATED","Pocket","topics","emptyState","read_more_endpoint","contextMenuOptions","waitingForSpoc","maxCardsPerRow","maxCardsOnNarrow","pocketCta","isUserLoggedIn","useCta","isPocketLoggedInDefined","hasTopics","shouldShowPocketCta","shouldShowTopics","shouldShowReadMore","realRows","shouldShowEmptyState","usePlaceholder","sectionClassName","padding","SectionIntl","_Sections","renderSections","sections","enabledSections","sectionOrder","showTopSites","expectedCount","sectionId","s","MoreRecommendations","_PocketLoggedInCta","ctaUrl","ctaButton","ctaText","PocketLoggedInCta","Topic","Topics","t","_store","_perfService","perfService","_sendEvent","visibility_event_rcvd_ts","DSCard","click","image_src","excerpt","CardGrid","recommendations","items","rec","domain","divisibility","border","truncateText","cap","substring","trim","ListItem","_List","recs","recMarkup","recStartingPoint","listStyles","fullWidth","hasBorders","hasImages","hasNumbers","List","Hero","heroRec","otherRecs","list","subComponentType","HorizontalRule","Navigation","alignment","SectionTitle","subtitle","selectLayoutRender","createSelector","spocs","layoutRender","spocIndex","maybeInjectSpocs","spocsConfig","positions","position","rickRoll","random","probability","MAX_ROWS_HERO","MAX_ROWS_LIST","MAX_ROWS_CARDGRID","ALLOWED_CSS_URL_PREFIXES","DUMMY_CSS_SELECTOR","isAllowedCSS","property","urls","match","every","prefix","_DiscoveryStreamBase","onStyleMount","extractRows","limit","min","properties","sheet","styles","selectors","declarations","insertRule","rule","cssRules","removeProperty","selectorText","selector","embedWidth","loaded","full_width","has_images","has_numbers","renderStyles","transform","DiscoveryStreamBase","ALLOWED_STYLE_TAGS","Button","tag","ConditionalWrapper","condition","wrap","SnippetBase","onBlockClicked","onDismissClicked","onDismiss","renderDismissButton","footerDismiss","scene2_dismiss_button_text","defaultTitle","schema","block_button_text","default","containerClassName","textStyle","DEFAULT_ICON_PATH","SimpleSnippet","onButtonClick","button_url","button_action_args","_shouldRenderButton","renderTitle","renderTitleIcon","titleIcon","title_icon","renderButton","button_color","button_background_color","wrapSectionHeader","wrapSnippetContent","renderSectionHeader","section_title_icon","section_title_text","sectionTitleIcon","sectionTitleURL","section_title_url","sectionHeader","tall","extraContent","EOYSnippetBase","handleSubmit","setFrequencyValue","frequencyCheckbox","form","querySelector","submit","renderDonations","fieldNames","numberFormat","Intl","NumberFormat","navigator","language","currency","currency_code","minimumFractionDigits","selected_button","btnStyle","color","donationURLParams","paramsStartIndex","donation_form_url","entry","form_method","idx","field","button_name","amount","format","monthly_checkbox_label_text","text_color","background_color","highlight_color","test","EOYSnippet","extendedContent","SubmitFormSnippet","expandSnippet","handleSubmitAttempt","expanded","submitAttempted","signupSubmitted","signupSuccess","disableForm","preventDismiss","formData","processFormData","mainInput","FormData","fetchRequest","Request","method","renderHiddenFormInputs","hidden_inputs","renderDisclaimer","scene2_disclaimer_html","renderFormPrivacyNotice","scene2_privacy_html","renderSignupSubmitted","isSuccess","successTitle","success_title","bodyText","success_text","error_text","retryButtonText","scene1_button_label","validateInput","setCustomValidity","renderInput","placholder","scene2_email_placeholder_text","scene2_input_placeholder","inputType","renderSignupView","containerClass","scene2_icon","scene2_title","scene2_text","form_action","scene2_button_label","getFirstSceneContent","substr","FXASignupSnippet","userAgent","firefox_version","entrypoint","service","utm_source","utm_content","utm_campaign","utm_term","NewsletterSnippet","scene2_newsletter","newsletters","fmt","source_url","isEmailOrPhoneNumber","val","email_re","check_email","check_phone","isNaN","include_sms","append","message_id_sms","country","message_id_email","encodeURIComponent","addDefaultValues","SendToDeviceSnippet","propsWithDefaults","simple_snippet","newsletter_snippet","fxa_signup_snippet","send_to_device_snippet","eoy_snippet","MAX_PLACEABLES","entryIdentifierRe","identifierRe","functionIdentifierRe","RuntimeParser","getResource","_source","_index","_length","skipWS","getEntry","SyntaxError","skipToNextEntryStart","ch","skipComment","skipSection","getMessage","skipInlineWS","getVariantName","getEntryIdentifier","getPattern","lineStart","getAttributes","skipBlankLines","ptr","getIdentifier","re","lastIndex","exec","toString","start","cc","charCodeAt","getString","eol","firstLineContent","getComplexPattern","buffer","placeables","blankLinesStart","blankLinesEnd","ch2","getPlaceable","variants","getVariants","exp","vars","def","getSelectorExpression","literal","getLiteral","getVariantKey","getCallArgs","fun","lastIndexOf","getNumber","num","defaultIndex","cc0","cc1","parser","FluentType","opts","valueOf","FluentNone","FluentNumber","parseFloat","ctx","nf","_memoizeIntlObject","other","FluentDateTime","dtf","DateTimeFormat","FluentSymbol","pr","PluralRules","select","arg","merge","argopts","unwrapped","opt","MAX_PLACEABLE_LENGTH","FSI","PDI","DefaultMember","env","members","RangeError","MessageReference","_terms","_messages","ReferenceError","VariantExpression","Type","isVariantList","variant","variantKey","AttributeExpression","attrName","SelectExpression","keyCanMatch","expr","Pattern","ExternalArgument","FunctionReference","CallExpression","member","hasOwnProperty","TypeError","_functions","builtins","callee","posargs","keyargs","ptn","dirty","has","useIsolating","_useIsolating","elem","part","WeakSet","locales","functions","_intls","WeakMap","Symbol","iterator","hasMessage","ctor","cache","CachedIterable","iterable","asyncIterator","seen","cur","touchNext","done","mapContextSync","ids","getContextForId","remainingCount","foundContexts","fill","mapContextAsync","nonBlank","line","countIndent","indent","ftl","code","lines","indents","common","RegExp","ReactLocalization","contexts","subs","Set","comp","unsubscribe","setMessages","relocalize","getMessageContext","formatCompound","mcx","fallback","isReactLocalization","propName","prop","LocalizationProvider","l10n","getChildContext","Children","only","childContextTypes","propTypes","PropTypes","isRequired","isIterable","componentName","withLocalization","Inner","WithLocalization","forceUpdate","displayName","contextTypes","TEMPLATE","parseMarkup","omittedCloseTags","area","base","col","embed","hr","img","keygen","track","wbr","voidElementTags","menuitem","reMarkup","toArguments","elems","propname","propval","isValidElement","toLowerCase","Localized","messageValue","messageAttrs","localizedProps","VOID_ELEMENTS","translationNodes","childNodes","translatedChildren","childNode","nodeType","TEXT_NODE","textContent","localName","sourceChild","Dedupe","createKey","defaultCreateKey","item","group","groups","globalKeys","valueMap","m","TOP_SITES_DEFAULT_ROWS","dedupe","INITIAL_STATE","spocs_endpoint","AS_ROUTER_INITIALIZED","AS_ROUTER_PREF_CHANGED","insertPinned","pinned","pinnedUrls","newLinks","pinIndex","hasMatch","newRows","TOP_SITES_UPDATED","TOP_SITES_PREFS_UPDATED","previewResponse","PREVIEW_RESPONSE","previewUrl","PREVIEW_REQUEST","PREVIEW_REQUEST_CANCEL","SCREENSHOT_UPDATED","PLACES_BOOKMARK_ADDED","bookmarkTitle","dateAdded","bookmarkDateCreated","PLACES_BOOKMARK_REMOVED","newSite","PLACES_LINK_DELETED","UPDATE_SEARCH_SHORTCUTS","SNIPPETS_PREVIEW_MODE","newValues","PREFS_INITIAL_VALUES","PREF_CHANGED","newState","SECTION_DEREGISTER","SECTION_REGISTER","SECTION_UPDATE","card","dedupeConfigurations","dedupeConf","dedupedRows","dedupeFrom","dedupeSectionId","dedupeSection","SECTION_UPDATE_CARD","PLACES_SAVED_TO_POCKET","PLACES_LINK_BLOCKED","SNIPPETS_DATA","SNIPPETS_RESET","POCKET_WAITING_FOR_SPOC","POCKET_LOGGED_IN","POCKET_CTA","cta_button","cta_text","cta_url","use_cta","DISCOVERY_STREAM_CONFIG_CHANGE","DISCOVERY_STREAM_CONFIG_SETUP","DISCOVERY_STREAM_LAYOUT_UPDATE","DISCOVERY_STREAM_LAYOUT_RESET","DISCOVERY_STREAM_FEEDS_UPDATE","DISCOVERY_STREAM_SPOCS_ENDPOINT","DISCOVERY_STREAM_SPOCS_UPDATE","SHOW_SEARCH","cardContextTypes","history","intlID","bookmark","trending","download","gImageLoading","_Card","activeCard","imageLoaded","cardImage","maybeLoadImage","imageUrl","loaderPromise","loader","Image","src","catch","then","WEBEXT_CLICK","hasImage","placeholder","description","Card","PlaceholderCard","TopSiteFormInput","validationError","onMount","shouldFocus","showClearButton","onClear","typeUrl","titleId","loading","placeholderId","errorMessageId","TopSiteForm","customScreenshotUrl","showCustomScreenshotForm","onClearScreenshotInput","onLabelChange","onUrlChange","onClearUrlClick","onDoneButtonClick","onCustomScreenshotUrlChange","onPreviewButtonClick","onEnableScreenshotUrlForm","validateUrl","_updateCustomScreenshotInput","validateForm","cleanUrl","_tryParseUrl","validProtocols","urlObj","validateCustomScreenshotUrl","validate","_renderCustomScreenshotInput","requestFailed","isLoading","showAsAdd","previous","changed","previewMode","previewLink"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MA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AADF,SADD,GAIC;AAAA;AAAA,YAAQ,WAAU,MAAlB,EAAyB,MAAK,QAA9B,EAAuC,SAAS,KAAKF,iBAArD;AACE,iDAAC,uCAAD,IAAkB,IAAIgB,YAAY,0BAAZ,GAAyC,2BAA/D;AADF;AARJ;AA7BF,KADF;AA4CD;AA7OkD;;AAgPrDvB,uBAAWA,CAACn1C,YAAZ,GAA2B;AACzBgW,QAAM,IADmB;AAEzBuB,SAAO,CAAC;AAFiB,CAA3B,C","file":"activity-stream.bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\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 = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\nimport {addSnippetsSubscriber} from \"content-src/lib/snippets\";\nimport {ASRouterContent} from \"content-src/asrouter/asrouter-content\";\nimport {Base} from \"content-src/components/Base/Base\";\nimport {DetectUserSessionStart} from \"content-src/lib/detect-user-session-start\";\nimport {enableASRouterContent} from \"content-src/lib/asroutercontent\";\nimport {initStore} from \"content-src/lib/init-store\";\nimport {Provider} from \"react-redux\";\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {reducers} from \"common/Reducers.jsm\";\n\nconst store = initStore(reducers, global.gActivityStreamPrerenderedState);\nconst asrouterContent = new ASRouterContent();\n\nnew DetectUserSessionStart(store).sendEventOrAddListener();\n\n// If we are starting in a prerendered state, we must wait until the first render\n// to request state rehydration (see Base.jsx). If we are NOT in a prerendered state,\n// we can request it immedately.\nif (!global.gActivityStreamPrerenderedState) {\n  store.dispatch(ac.AlsoToMain({type: at.NEW_TAB_STATE_REQUEST}));\n}\nenableASRouterContent(store, asrouterContent);\n\nReactDOM.hydrate(<Provider store={store}>\n  <Base\n    isFirstrun={global.document.location.href === \"about:welcome\"}\n    isPrerendered={!!global.gActivityStreamPrerenderedState}\n    locale={global.document.documentElement.lang}\n    strings={global.gActivityStreamStrings} />\n</Provider>, document.getElementById(\"root\"));\n\naddSnippetsSubscriber(store);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\"use strict\";\n\nthis.MAIN_MESSAGE_TYPE = \"ActivityStream:Main\";\nthis.CONTENT_MESSAGE_TYPE = \"ActivityStream:Content\";\nthis.PRELOAD_MESSAGE_TYPE = \"ActivityStream:PreloadedBrowser\";\nthis.UI_CODE = 1;\nthis.BACKGROUND_PROCESS = 2;\n\n/**\n * globalImportContext - Are we in UI code (i.e. react, a dom) or some kind of background process?\n *                       Use this in action creators if you need different logic\n *                       for ui/background processes.\n */\nconst globalImportContext = typeof Window === \"undefined\" ? BACKGROUND_PROCESS : UI_CODE;\n// Export for tests\nthis.globalImportContext = globalImportContext;\n\n// Create an object that avoids accidental differing key/value pairs:\n// {\n//   INIT: \"INIT\",\n//   UNINIT: \"UNINIT\"\n// }\nconst actionTypes = {};\nfor (const type of [\n  \"ADDONS_INFO_REQUEST\",\n  \"ADDONS_INFO_RESPONSE\",\n  \"ARCHIVE_FROM_POCKET\",\n  \"AS_ROUTER_INITIALIZED\",\n  \"AS_ROUTER_PREF_CHANGED\",\n  \"AS_ROUTER_TELEMETRY_USER_EVENT\",\n  \"BLOCK_URL\",\n  \"BOOKMARK_URL\",\n  \"COPY_DOWNLOAD_LINK\",\n  \"DELETE_BOOKMARK_BY_ID\",\n  \"DELETE_FROM_POCKET\",\n  \"DELETE_HISTORY_URL\",\n  \"DIALOG_CANCEL\",\n  \"DIALOG_OPEN\",\n  \"DISCOVERY_STREAM_CONFIG_CHANGE\",\n  \"DISCOVERY_STREAM_CONFIG_SETUP\",\n  \"DISCOVERY_STREAM_CONFIG_SET_VALUE\",\n  \"DISCOVERY_STREAM_FEEDS_UPDATE\",\n  \"DISCOVERY_STREAM_LAYOUT_RESET\",\n  \"DISCOVERY_STREAM_LAYOUT_UPDATE\",\n  \"DISCOVERY_STREAM_SPOCS_ENDPOINT\",\n  \"DISCOVERY_STREAM_SPOCS_UPDATE\",\n  \"DOWNLOAD_CHANGED\",\n  \"FAKE_FOCUS_SEARCH\",\n  \"FILL_SEARCH_TERM\",\n  \"HANDOFF_SEARCH_TO_AWESOMEBAR\",\n  \"HIDE_SEARCH\",\n  \"INIT\",\n  \"MIGRATION_CANCEL\",\n  \"MIGRATION_COMPLETED\",\n  \"MIGRATION_START\",\n  \"NEW_TAB_INIT\",\n  \"NEW_TAB_INITIAL_STATE\",\n  \"NEW_TAB_LOAD\",\n  \"NEW_TAB_REHYDRATED\",\n  \"NEW_TAB_STATE_REQUEST\",\n  \"NEW_TAB_UNLOAD\",\n  \"OPEN_DOWNLOAD_FILE\",\n  \"OPEN_LINK\",\n  \"OPEN_NEW_WINDOW\",\n  \"OPEN_PRIVATE_WINDOW\",\n  \"OPEN_WEBEXT_SETTINGS\",\n  \"PAGE_PRERENDERED\",\n  \"PLACES_BOOKMARK_ADDED\",\n  \"PLACES_BOOKMARK_REMOVED\",\n  \"PLACES_HISTORY_CLEARED\",\n  \"PLACES_LINKS_CHANGED\",\n  \"PLACES_LINK_BLOCKED\",\n  \"PLACES_LINK_DELETED\",\n  \"PLACES_SAVED_TO_POCKET\",\n  \"POCKET_CTA\",\n  \"POCKET_LOGGED_IN\",\n  \"POCKET_WAITING_FOR_SPOC\",\n  \"PREFS_INITIAL_VALUES\",\n  \"PREF_CHANGED\",\n  \"PREVIEW_REQUEST\",\n  \"PREVIEW_REQUEST_CANCEL\",\n  \"PREVIEW_RESPONSE\",\n  \"REMOVE_DOWNLOAD_FILE\",\n  \"RICH_ICON_MISSING\",\n  \"SAVE_SESSION_PERF_DATA\",\n  \"SAVE_TO_POCKET\",\n  \"SCREENSHOT_UPDATED\",\n  \"SECTION_DEREGISTER\",\n  \"SECTION_DISABLE\",\n  \"SECTION_ENABLE\",\n  \"SECTION_MOVE\",\n  \"SECTION_OPTIONS_CHANGED\",\n  \"SECTION_REGISTER\",\n  \"SECTION_UPDATE\",\n  \"SECTION_UPDATE_CARD\",\n  \"SETTINGS_CLOSE\",\n  \"SETTINGS_OPEN\",\n  \"SET_PREF\",\n  \"SHOW_DOWNLOAD_FILE\",\n  \"SHOW_FIREFOX_ACCOUNTS\",\n  \"SHOW_SEARCH\",\n  \"SKIPPED_SIGNIN\",\n  \"SNIPPETS_BLOCKLIST_CLEARED\",\n  \"SNIPPETS_BLOCKLIST_UPDATED\",\n  \"SNIPPETS_DATA\",\n  \"SNIPPETS_PREVIEW_MODE\",\n  \"SNIPPETS_RESET\",\n  \"SNIPPET_BLOCKED\",\n  \"SUBMIT_EMAIL\",\n  \"SYSTEM_TICK\",\n  \"TELEMETRY_IMPRESSION_STATS\",\n  \"TELEMETRY_PERFORMANCE_EVENT\",\n  \"TELEMETRY_UNDESIRED_EVENT\",\n  \"TELEMETRY_USER_EVENT\",\n  \"TOP_SITES_CANCEL_EDIT\",\n  \"TOP_SITES_CLOSE_SEARCH_SHORTCUTS_MODAL\",\n  \"TOP_SITES_EDIT\",\n  \"TOP_SITES_INSERT\",\n  \"TOP_SITES_OPEN_SEARCH_SHORTCUTS_MODAL\",\n  \"TOP_SITES_PIN\",\n  \"TOP_SITES_PREFS_UPDATED\",\n  \"TOP_SITES_UNPIN\",\n  \"TOP_SITES_UPDATED\",\n  \"TOTAL_BOOKMARKS_REQUEST\",\n  \"TOTAL_BOOKMARKS_RESPONSE\",\n  \"UNINIT\",\n  \"UPDATE_PINNED_SEARCH_SHORTCUTS\",\n  \"UPDATE_SEARCH_SHORTCUTS\",\n  \"UPDATE_SECTION_PREFS\",\n  \"WEBEXT_CLICK\",\n  \"WEBEXT_DISMISS\",\n]) {\n  actionTypes[type] = type;\n}\n\n// These are acceptable actions for AS Router messages to have. They can show up\n// as call-to-action buttons in snippets, onboarding tour, etc.\nconst ASRouterActions = {};\nfor (const type of [\n  \"INSTALL_ADDON_FROM_URL\",\n  \"OPEN_APPLICATIONS_MENU\",\n  \"OPEN_PRIVATE_BROWSER_WINDOW\",\n  \"OPEN_URL\",\n  \"OPEN_ABOUT_PAGE\",\n  \"OPEN_PREFERENCES_PAGE\",\n  \"SHOW_FIREFOX_ACCOUNTS\",\n]) {\n  ASRouterActions[type] = type;\n}\n\n// Helper function for creating routed actions between content and main\n// Not intended to be used by consumers\nfunction _RouteMessage(action, options) {\n  const meta = action.meta ? {...action.meta} : {};\n  if (!options || !options.from || !options.to) {\n    throw new Error(\"Routed Messages must have options as the second parameter, and must at least include a .from and .to property.\");\n  }\n  // For each of these fields, if they are passed as an option,\n  // add them to the action. If they are not defined, remove them.\n  [\"from\", \"to\", \"toTarget\", \"fromTarget\", \"skipMain\", \"skipLocal\"].forEach(o => {\n    if (typeof options[o] !== \"undefined\") {\n      meta[o] = options[o];\n    } else if (meta[o]) {\n      delete meta[o];\n    }\n  });\n  return {...action, meta};\n}\n\n/**\n * AlsoToMain - Creates a message that will be dispatched locally and also sent to the Main process.\n *\n * @param  {object} action Any redux action (required)\n * @param  {object} options\n * @param  {bool}   skipLocal Used by OnlyToMain to skip the main reducer\n * @param  {string} fromTarget The id of the content port from which the action originated. (optional)\n * @return {object} An action with added .meta properties\n */\nfunction AlsoToMain(action, fromTarget, skipLocal) {\n  return _RouteMessage(action, {\n    from: CONTENT_MESSAGE_TYPE,\n    to: MAIN_MESSAGE_TYPE,\n    fromTarget,\n    skipLocal,\n  });\n}\n\n/**\n * OnlyToMain - Creates a message that will be sent to the Main process and skip the local reducer.\n *\n * @param  {object} action Any redux action (required)\n * @param  {object} options\n * @param  {string} fromTarget The id of the content port from which the action originated. (optional)\n * @return {object} An action with added .meta properties\n */\nfunction OnlyToMain(action, fromTarget) {\n  return AlsoToMain(action, fromTarget, true);\n}\n\n/**\n * BroadcastToContent - Creates a message that will be dispatched to main and sent to ALL content processes.\n *\n * @param  {object} action Any redux action (required)\n * @return {object} An action with added .meta properties\n */\nfunction BroadcastToContent(action) {\n  return _RouteMessage(action, {\n    from: MAIN_MESSAGE_TYPE,\n    to: CONTENT_MESSAGE_TYPE,\n  });\n}\n\n/**\n * AlsoToOneContent - Creates a message that will be will be dispatched to the main store\n *                    and also sent to a particular Content process.\n *\n * @param  {object} action Any redux action (required)\n * @param  {string} target The id of a content port\n * @param  {bool} skipMain Used by OnlyToOneContent to skip the main process\n * @return {object} An action with added .meta properties\n */\nfunction AlsoToOneContent(action, target, skipMain) {\n  if (!target) {\n    throw new Error(\"You must provide a target ID as the second parameter of AlsoToOneContent. If you want to send to all content processes, use BroadcastToContent\");\n  }\n  return _RouteMessage(action, {\n    from: MAIN_MESSAGE_TYPE,\n    to: CONTENT_MESSAGE_TYPE,\n    toTarget: target,\n    skipMain,\n  });\n}\n\n/**\n * OnlyToOneContent - Creates a message that will be sent to a particular Content process\n *                    and skip the main reducer.\n *\n * @param  {object} action Any redux action (required)\n * @param  {string} target The id of a content port\n * @return {object} An action with added .meta properties\n */\nfunction OnlyToOneContent(action, target) {\n  return AlsoToOneContent(action, target, true);\n}\n\n/**\n * AlsoToPreloaded - Creates a message that dispatched to the main reducer and also sent to the preloaded tab.\n *\n * @param  {object} action Any redux action (required)\n * @return {object} An action with added .meta properties\n */\nfunction AlsoToPreloaded(action) {\n  return _RouteMessage(action, {\n    from: MAIN_MESSAGE_TYPE,\n    to: PRELOAD_MESSAGE_TYPE,\n  });\n}\n\n/**\n * UserEvent - A telemetry ping indicating a user action. This should only\n *                   be sent from the UI during a user session.\n *\n * @param  {object} data Fields to include in the ping (source, etc.)\n * @return {object} An AlsoToMain action\n */\nfunction UserEvent(data) {\n  return AlsoToMain({\n    type: actionTypes.TELEMETRY_USER_EVENT,\n    data,\n  });\n}\n\n/**\n * ASRouterUserEvent - A telemetry ping indicating a user action from AS router. This should only\n *                     be sent from the UI during a user session.\n *\n * @param  {object} data Fields to include in the ping (source, etc.)\n * @return {object} An AlsoToMain action\n */\nfunction ASRouterUserEvent(data) {\n  return AlsoToMain({\n    type: actionTypes.AS_ROUTER_TELEMETRY_USER_EVENT,\n    data,\n  });\n}\n\n/**\n * UndesiredEvent - A telemetry ping indicating an undesired state.\n *\n * @param  {object} data Fields to include in the ping (value, etc.)\n * @param  {int} importContext (For testing) Override the import context for testing.\n * @return {object} An action. For UI code, a AlsoToMain action.\n */\nfunction UndesiredEvent(data, importContext = globalImportContext) {\n  const action = {\n    type: actionTypes.TELEMETRY_UNDESIRED_EVENT,\n    data,\n  };\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\n/**\n * PerfEvent - A telemetry ping indicating a performance-related event.\n *\n * @param  {object} data Fields to include in the ping (value, etc.)\n * @param  {int} importContext (For testing) Override the import context for testing.\n * @return {object} An action. For UI code, a AlsoToMain action.\n */\nfunction PerfEvent(data, importContext = globalImportContext) {\n  const action = {\n    type: actionTypes.TELEMETRY_PERFORMANCE_EVENT,\n    data,\n  };\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\n/**\n * ImpressionStats - A telemetry ping indicating an impression stats.\n *\n * @param  {object} data Fields to include in the ping\n * @param  {int} importContext (For testing) Override the import context for testing.\n * #return {object} An action. For UI code, a AlsoToMain action.\n */\nfunction ImpressionStats(data, importContext = globalImportContext) {\n  const action = {\n    type: actionTypes.TELEMETRY_IMPRESSION_STATS,\n    data,\n  };\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\nfunction SetPref(name, value, importContext = globalImportContext) {\n  const action = {type: actionTypes.SET_PREF, data: {name, value}};\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\nfunction WebExtEvent(type, data, importContext = globalImportContext) {\n  if (!data || !data.source) {\n    throw new Error(\"WebExtEvent actions should include a property \\\"source\\\", the id of the webextension that should receive the event.\");\n  }\n  const action = {type, data};\n  return importContext === UI_CODE ? AlsoToMain(action) : action;\n}\n\nthis.actionTypes = actionTypes;\nthis.ASRouterActions = ASRouterActions;\n\nthis.actionCreators = {\n  BroadcastToContent,\n  UserEvent,\n  ASRouterUserEvent,\n  UndesiredEvent,\n  PerfEvent,\n  ImpressionStats,\n  AlsoToOneContent,\n  OnlyToOneContent,\n  AlsoToMain,\n  OnlyToMain,\n  AlsoToPreloaded,\n  SetPref,\n  WebExtEvent,\n};\n\n// These are helpers to test for certain kinds of actions\nthis.actionUtils = {\n  isSendToMain(action) {\n    if (!action.meta) {\n      return false;\n    }\n    return action.meta.to === MAIN_MESSAGE_TYPE && action.meta.from === CONTENT_MESSAGE_TYPE;\n  },\n  isBroadcastToContent(action) {\n    if (!action.meta) {\n      return false;\n    }\n    if (action.meta.to === CONTENT_MESSAGE_TYPE && !action.meta.toTarget) {\n      return true;\n    }\n    return false;\n  },\n  isSendToOneContent(action) {\n    if (!action.meta) {\n      return false;\n    }\n    if (action.meta.to === CONTENT_MESSAGE_TYPE && action.meta.toTarget) {\n      return true;\n    }\n    return false;\n  },\n  isSendToPreloaded(action) {\n    if (!action.meta) {\n      return false;\n    }\n    return action.meta.to === PRELOAD_MESSAGE_TYPE &&\n      action.meta.from === MAIN_MESSAGE_TYPE;\n  },\n  isFromMain(action) {\n    if (!action.meta) {\n      return false;\n    }\n    return action.meta.from === MAIN_MESSAGE_TYPE &&\n      action.meta.to === CONTENT_MESSAGE_TYPE;\n  },\n  getPortIdOfSender(action) {\n    return (action.meta && action.meta.fromTarget) || null;\n  },\n  _RouteMessage,\n};\n\nconst EXPORTED_SYMBOLS = [\n  \"actionTypes\",\n  \"actionCreators\",\n  \"actionUtils\",\n  \"ASRouterActions\",\n  \"globalImportContext\",\n  \"UI_CODE\",\n  \"BACKGROUND_PROCESS\",\n  \"MAIN_MESSAGE_TYPE\",\n  \"CONTENT_MESSAGE_TYPE\",\n  \"PRELOAD_MESSAGE_TYPE\",\n];\n","const DATABASE_NAME = \"snippets_db\";\nconst DATABASE_VERSION = 1;\nconst SNIPPETS_OBJECTSTORE_NAME = \"snippets\";\nexport const SNIPPETS_UPDATE_INTERVAL_MS = 14400000; // 4 hours.\n\nconst SNIPPETS_ENABLED_EVENT = \"Snippets:Enabled\";\nconst SNIPPETS_DISABLED_EVENT = \"Snippets:Disabled\";\n\nimport {actionCreators as ac, actionTypes as at} from \"common/Actions.jsm\";\n\n/**\n * SnippetsMap - A utility for cacheing values related to the snippet. It has\n *               the same interface as a Map, but is optionally backed by\n *               indexedDB for persistent storage.\n *               Call .connect() to open a database connection and restore any\n *               previously cached data, if necessary.\n *\n */\nexport class SnippetsMap extends Map {\n  constructor(dispatch) {\n    super();\n    this._db = null;\n    this._dispatch = dispatch;\n  }\n\n  set(key, value) {\n    super.set(key, value);\n    return this._dbTransaction(db => db.put(value, key));\n  }\n\n  delete(key) {\n    super.delete(key);\n    return this._dbTransaction(db => db.delete(key));\n  }\n\n  clear() {\n    super.clear();\n    this._dispatch(ac.OnlyToMain({type: at.SNIPPETS_BLOCKLIST_CLEARED}));\n    return this._dbTransaction(db => db.clear());\n  }\n\n  get blockList() {\n    return this.get(\"blockList\") || [];\n  }\n\n  /**\n   * blockSnippetById - Blocks a snippet given an id\n   *\n   * @param  {str|int} id   The id of the snippet\n   * @return {Promise}      Resolves when the id has been written to indexedDB,\n   *                        or immediately if the snippetMap is not connected\n   */\n  async blockSnippetById(id) {\n    if (!id) {\n      return;\n    }\n    const {blockList} = this;\n    if (!blockList.includes(id)) {\n      blockList.push(id);\n      this._dispatch(ac.AlsoToMain({type: at.SNIPPETS_BLOCKLIST_UPDATED, data: id}));\n      await this.set(\"blockList\", blockList);\n    }\n  }\n\n  disableOnboarding() {}\n\n  showFirefoxAccounts() {\n    this._dispatch(ac.AlsoToMain({type: at.SHOW_FIREFOX_ACCOUNTS}));\n  }\n\n  getTotalBookmarksCount() {\n    return new Promise(resolve => {\n      this._dispatch(ac.OnlyToMain({type: at.TOTAL_BOOKMARKS_REQUEST}));\n      global.RPMAddMessageListener(\"ActivityStream:MainToContent\", function onMessage({data: action}) {\n        if (action.type === at.TOTAL_BOOKMARKS_RESPONSE) {\n          resolve(action.data);\n          global.RPMRemoveMessageListener(\"ActivityStream:MainToContent\", onMessage);\n        }\n      });\n    });\n  }\n\n  getAddonsInfo() {\n    return new Promise(resolve => {\n      this._dispatch(ac.OnlyToMain({type: at.ADDONS_INFO_REQUEST}));\n      global.RPMAddMessageListener(\"ActivityStream:MainToContent\", function onMessage({data: action}) {\n        if (action.type === at.ADDONS_INFO_RESPONSE) {\n          resolve(action.data);\n          global.RPMRemoveMessageListener(\"ActivityStream:MainToContent\", onMessage);\n        }\n      });\n    });\n  }\n\n  /**\n   * connect - Attaches an indexedDB back-end to the Map so that any set values\n   *           are also cached in a store. It also restores any existing values\n   *           that are already stored in the indexedDB store.\n   *\n   * @return {type}  description\n   */\n  async connect() {\n    // Open the connection\n    const db = await this._openDB();\n\n    // Restore any existing values\n    await this._restoreFromDb(db);\n\n    // Attach a reference to the db\n    this._db = db;\n  }\n\n  /**\n   * _dbTransaction - Returns a db transaction wrapped with the given modifier\n   *                  function as a Promise. If the db has not been connected,\n   *                  it resolves immediately.\n   *\n   * @param  {func} modifier A function to call with the transaction\n   * @return {obj}           A Promise that resolves when the transaction has\n   *                         completed or errored\n   */\n  _dbTransaction(modifier) {\n    if (!this._db) {\n      return Promise.resolve();\n    }\n    return new Promise((resolve, reject) => {\n      const transaction = modifier(\n        this._db\n          .transaction(SNIPPETS_OBJECTSTORE_NAME, \"readwrite\")\n          .objectStore(SNIPPETS_OBJECTSTORE_NAME)\n      );\n      transaction.onsuccess = event => resolve();\n\n      /* istanbul ignore next */\n      transaction.onerror = event => reject(transaction.error);\n    });\n  }\n\n  _openDB() {\n    return new Promise((resolve, reject) => {\n      const openRequest = indexedDB.open(DATABASE_NAME, DATABASE_VERSION);\n\n      /* istanbul ignore next */\n      openRequest.onerror = event => {\n        // Try to delete the old database so that we can start this process over\n        // next time.\n        indexedDB.deleteDatabase(DATABASE_NAME);\n        reject(event);\n      };\n\n      openRequest.onupgradeneeded = event => {\n        const db = event.target.result;\n        if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) {\n          db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME);\n        }\n      };\n\n      openRequest.onsuccess = event => {\n        let db = event.target.result;\n\n        /* istanbul ignore next */\n        db.onerror = err => console.error(err); // eslint-disable-line no-console\n        /* istanbul ignore next */\n        db.onversionchange = versionChangeEvent => versionChangeEvent.target.close();\n\n        resolve(db);\n      };\n    });\n  }\n\n  _restoreFromDb(db) {\n    return new Promise((resolve, reject) => {\n      let cursorRequest;\n      try {\n        cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME)\n          .objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor();\n      } catch (err) {\n        // istanbul ignore next\n        reject(err);\n        // istanbul ignore next\n        return;\n      }\n\n      /* istanbul ignore next */\n      cursorRequest.onerror = event => reject(event);\n\n      cursorRequest.onsuccess = event => {\n        let cursor = event.target.result;\n        // Populate the cache from the persistent storage.\n        if (cursor) {\n          if (cursor.value !== \"blockList\") {\n            this.set(cursor.key, cursor.value);\n          }\n          cursor.continue();\n        } else {\n          // We are done.\n          resolve();\n        }\n      };\n    });\n  }\n}\n\n/**\n * SnippetsProvider - Initializes a SnippetsMap and loads snippets from a\n *                    remote location, or else default snippets if the remote\n *                    snippets cannot be retrieved.\n */\nexport class SnippetsProvider {\n  constructor(dispatch) {\n    // Initialize the Snippets Map and attaches it to a global so that\n    // the snippet payload can interact with it.\n    global.gSnippetsMap = new SnippetsMap(dispatch);\n    this._onAction = this._onAction.bind(this);\n  }\n\n  get snippetsMap() {\n    return global.gSnippetsMap;\n  }\n\n  async _refreshSnippets() {\n    // Check if the cached version of of the snippets in snippetsMap. If it's too\n    // old, blow away the entire snippetsMap.\n    const cachedVersion = this.snippetsMap.get(\"snippets-cached-version\");\n\n    if (cachedVersion !== this.appData.version) {\n      this.snippetsMap.clear();\n    }\n\n    // Has enough time passed for us to require an update?\n    const lastUpdate = this.snippetsMap.get(\"snippets-last-update\");\n    const needsUpdate = !(lastUpdate >= 0) || Date.now() - lastUpdate > SNIPPETS_UPDATE_INTERVAL_MS;\n\n    if (needsUpdate && this.appData.snippetsURL) {\n      this.snippetsMap.set(\"snippets-last-update\", Date.now());\n      try {\n        const response = await fetch(this.appData.snippetsURL);\n        if (response.status === 200) {\n          const payload = await response.text();\n\n          this.snippetsMap.set(\"snippets\", payload);\n          this.snippetsMap.set(\"snippets-cached-version\", this.appData.version);\n        }\n      } catch (e) {\n        console.error(e); // eslint-disable-line no-console\n      }\n    }\n  }\n\n  _showRemoteSnippets() {\n    const snippetsEl = document.getElementById(this.elementId);\n    const payload = this.snippetsMap.get(\"snippets\");\n\n    if (!snippetsEl) {\n      throw new Error(`No element was found with id '${this.elementId}'.`);\n    }\n\n    // This could happen if fetching failed\n    if (!payload) {\n      throw new Error(\"No remote snippets were found in gSnippetsMap.\");\n    }\n\n    if (typeof payload !== \"string\") {\n      throw new Error(\"Snippet payload was incorrectly formatted\");\n    }\n\n    // Note that injecting snippets can throw if they're invalid XML.\n    // eslint-disable-next-line no-unsanitized/property\n    snippetsEl.innerHTML = payload;\n\n    this._logIfDevtools(\"Successfully added snippets.\");\n\n    // Scripts injected by innerHTML are inactive, so we have to relocate them\n    // through DOM manipulation to activate their contents.\n    for (const scriptEl of snippetsEl.getElementsByTagName(\"script\")) {\n      const relocatedScript = document.createElement(\"script\");\n      relocatedScript.text = scriptEl.text;\n      scriptEl.parentNode.replaceChild(relocatedScript, scriptEl);\n    }\n  }\n\n  _onAction(msg) {\n    if (msg.data.type === at.SNIPPET_BLOCKED) {\n      if (!this.snippetsMap.blockList.includes(msg.data.data)) {\n        this.snippetsMap.set(\"blockList\", this.snippetsMap.blockList.concat(msg.data.data));\n        document.getElementById(\"snippets-container\").style.display = \"none\";\n      }\n    }\n  }\n\n  // istanbul ignore next\n  _logIfDevtools(text) {\n    if (this.devtoolsEnabled) {\n      console.log(\"Legacy snippets:\", text); // eslint-disable-line no-console\n    }\n  }\n\n  /**\n   * init - Fetch the snippet payload and show snippets\n   *\n   * @param  {obj} options\n   * @param  {str} options.appData.snippetsURL  The URL from which we fetch snippets\n   * @param  {int} options.appData.version  The current snippets version\n   * @param  {str} options.elementId  The id of the element in which to inject snippets\n   * @param  {bool} options.connect  Should gSnippetsMap connect to indexedDB?\n   */\n  async init(options) {\n    Object.assign(this, {\n      appData: {},\n      elementId: \"snippets\",\n      connect: true,\n      devtoolsEnabled: false,\n    }, options);\n\n    this._logIfDevtools(\"Initializing...\");\n\n    // Add listener so we know when snippets are blocked on other pages\n    if (global.RPMAddMessageListener) {\n      global.RPMAddMessageListener(\"ActivityStream:MainToContent\", this._onAction);\n    }\n\n    // TODO: Requires enabling indexedDB on newtab\n    // Restore the snippets map from indexedDB\n    if (this.connect) {\n      try {\n        await this.snippetsMap.connect();\n      } catch (e) {\n        console.error(e); // eslint-disable-line no-console\n      }\n    }\n\n    // Cache app data values so they can be accessible from gSnippetsMap\n    for (const key of Object.keys(this.appData)) {\n      if (key === \"blockList\") {\n        this.snippetsMap.set(\"blockList\", this.appData[key]);\n      } else {\n        this.snippetsMap.set(`appData.${key}`, this.appData[key]);\n      }\n    }\n\n    // Refresh snippets, if enough time has passed.\n    await this._refreshSnippets();\n\n    // Try showing remote snippets, falling back to defaults if necessary.\n    try {\n      this._showRemoteSnippets();\n    } catch (e) {\n      this._logIfDevtools(\"Problem inserting remote snippets!\");\n      console.error(e); // eslint-disable-line no-console\n    }\n\n    window.dispatchEvent(new Event(SNIPPETS_ENABLED_EVENT));\n\n    this.initialized = true;\n    this._logIfDevtools(\"Finished initializing.\");\n  }\n\n  uninit() {\n    window.dispatchEvent(new Event(SNIPPETS_DISABLED_EVENT));\n    if (global.RPMRemoveMessageListener) {\n      global.RPMRemoveMessageListener(\"ActivityStream:MainToContent\", this._onAction);\n    }\n    this.initialized = false;\n  }\n}\n\n/**\n * addSnippetsSubscriber - Creates a SnippetsProvider that Initializes\n *                         when the store has received the appropriate\n *                         Snippet data.\n *\n * @param  {obj} store   The redux store\n * @return {obj}         Returns the snippets instance, asrouterContent instance and unsubscribe function\n */\nexport function addSnippetsSubscriber(store) {\n  const snippets = new SnippetsProvider(store.dispatch);\n\n  let initializing = false;\n\n  store.subscribe(async () => {\n    const state = store.getState();\n\n    /**\n     * Sorry this code is so complicated. It will be removed soon.\n     * This is what the different values actually mean:\n     *\n     * ASRouter.initialized                   Is ASRouter.jsm initialised?\n     * ASRouter.allowLegacySnippets           Are ASRouter snippets turned OFF (i.e. legacy snippets are allowed)\n     * state.Prefs.values[\"feeds.snippets\"]   User preference for snippets\n     * state.Snippets.initialized             Is SnippetsFeed.jsm initialised?\n     * snippets.initialized                   Is in-content snippets currently initialised?\n     * state.Prefs.values.disableSnippets     This pref is used to disable legacy snippets in an emergency\n     *                                        in a way that is not user-editable (true = disabled)\n     */\n\n    /** If we should initialize snippets... */\n    if (\n      state.Prefs.values[\"feeds.snippets\"] &&\n      state.ASRouter.initialized &&\n      state.ASRouter.allowLegacySnippets &&\n      !state.Prefs.values.disableSnippets &&\n      state.Snippets.initialized &&\n      !snippets.initialized &&\n      // Don't call init multiple times\n      !initializing &&\n      location.href !== \"about:welcome\" &&\n      location.hash !== \"#asrouter\"\n    ) {\n      initializing = true;\n      await snippets.init({appData: state.Snippets, devtoolsEnabled: state.Prefs.values[\"asrouter.devtoolsEnabled\"]});\n      initializing = false;\n\n    /** If we should remove snippets... */\n    } else if (\n      (\n        state.Prefs.values[\"feeds.snippets\"] === false ||\n        state.Prefs.values.disableSnippets === true ||\n        (state.ASRouter.initialized && !state.ASRouter.allowLegacySnippets)\n      ) &&\n      snippets.initialized\n    ) {\n      // Remove snippets\n      snippets.uninit();\n      // istanbul ignore if\n      if (state.Prefs.values[\"asrouter.devtoolsEnabled\"]) {\n        console.log(\"Legacy snippets removed\"); // eslint-disable-line no-console\n      }\n    }\n  });\n\n  // Returned for testing purposes\n  return {snippets};\n}\n","import {addLocaleData, IntlProvider} from \"react-intl\";\nimport {actionCreators as ac} from \"common/Actions.jsm\";\nimport {OUTGOING_MESSAGE_NAME as AS_GENERAL_OUTGOING_MESSAGE_NAME} from \"content-src/lib/init-store\";\nimport {generateMessages} from \"./rich-text-strings\";\nimport {ImpressionsWrapper} from \"./components/ImpressionsWrapper/ImpressionsWrapper\";\nimport {LocalizationProvider} from \"fluent-react\";\nimport {OnboardingMessage} from \"./templates/OnboardingMessage/OnboardingMessage\";\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {ReturnToAMO} from \"./templates/ReturnToAMO/ReturnToAMO\";\nimport {SnippetsTemplates} from \"./templates/template-manifest\";\nimport {StartupOverlay} from \"./templates/StartupOverlay/StartupOverlay\";\n\nconst INCOMING_MESSAGE_NAME = \"ASRouter:parent-to-child\";\nconst OUTGOING_MESSAGE_NAME = \"ASRouter:child-to-parent\";\nconst ASR_CONTAINER_ID = \"asr-newtab-container\";\n\nexport const ASRouterUtils = {\n  addListener(listener) {\n    global.RPMAddMessageListener(INCOMING_MESSAGE_NAME, listener);\n  },\n  removeListener(listener) {\n    global.RPMRemoveMessageListener(INCOMING_MESSAGE_NAME, listener);\n  },\n  sendMessage(action) {\n    global.RPMSendAsyncMessage(OUTGOING_MESSAGE_NAME, action);\n  },\n  blockById(id, options) {\n    ASRouterUtils.sendMessage({type: \"BLOCK_MESSAGE_BY_ID\", data: {id, ...options}});\n  },\n  dismissById(id) {\n    ASRouterUtils.sendMessage({type: \"DISMISS_MESSAGE_BY_ID\", data: {id}});\n  },\n  dismissBundle(bundle) {\n    ASRouterUtils.sendMessage({type: \"DISMISS_BUNDLE\", data: {bundle}});\n  },\n  executeAction(button_action) {\n    ASRouterUtils.sendMessage({\n      type: \"USER_ACTION\",\n      data: button_action,\n    });\n  },\n  unblockById(id) {\n    ASRouterUtils.sendMessage({type: \"UNBLOCK_MESSAGE_BY_ID\", data: {id}});\n  },\n  unblockBundle(bundle) {\n    ASRouterUtils.sendMessage({type: \"UNBLOCK_BUNDLE\", data: {bundle}});\n  },\n  overrideMessage(id) {\n    ASRouterUtils.sendMessage({type: \"OVERRIDE_MESSAGE\", data: {id}});\n  },\n  sendTelemetry(ping) {\n    const payload = ac.ASRouterUserEvent(ping);\n    global.RPMSendAsyncMessage(AS_GENERAL_OUTGOING_MESSAGE_NAME, payload);\n  },\n  getPreviewEndpoint() {\n    if (window.location.href.includes(\"endpoint\")) {\n      const params = new URLSearchParams(window.location.href.slice(window.location.href.indexOf(\"endpoint\")));\n      try {\n        const endpoint = new URL(params.get(\"endpoint\"));\n        return {\n          url: endpoint.href,\n          snippetId: params.get(\"snippetId\"),\n        };\n      } catch (e) {}\n    }\n\n    return null;\n  },\n};\n\n// Note: nextProps/prevProps refer to props passed to <ImpressionsWrapper />, not <ASRouterUISurface />\nfunction shouldSendImpressionOnUpdate(nextProps, prevProps) {\n  return (nextProps.message.id && (!prevProps.message || prevProps.message.id !== nextProps.message.id));\n}\n\nexport class ASRouterUISurface extends React.PureComponent {\n  constructor(props) {\n    super(props);\n    this.onMessageFromParent = this.onMessageFromParent.bind(this);\n    this.sendClick = this.sendClick.bind(this);\n    this.sendImpression = this.sendImpression.bind(this);\n    this.sendUserActionTelemetry = this.sendUserActionTelemetry.bind(this);\n    this.state = {message: {}, bundle: {}};\n  }\n\n  sendUserActionTelemetry(extraProps = {}) {\n    const {message, bundle} = this.state;\n    if (!message && !extraProps.message_id) {\n      throw new Error(`You must provide a message_id for bundled messages`);\n    }\n    const eventType = `${message.provider || bundle.provider}_user_event`;\n    ASRouterUtils.sendTelemetry({\n      message_id: message.id || extraProps.message_id,\n      source: extraProps.id,\n      action: eventType,\n      ...extraProps,\n    });\n  }\n\n  sendImpression(extraProps) {\n    if (this.state.message.provider === \"preview\") {\n      return;\n    }\n\n    ASRouterUtils.sendMessage({type: \"IMPRESSION\", data: this.state.message});\n    this.sendUserActionTelemetry({event: \"IMPRESSION\", ...extraProps});\n  }\n\n  // If link has a `metric` data attribute send it as part of the `value`\n  // telemetry field which can have arbitrary values.\n  // Used for router messages with links as part of the content.\n  sendClick(event) {\n    const metric = {\n      value: event.target.dataset.metric,\n      // Used for the `source` of the event. Needed to differentiate\n      // from other snippet or onboarding events that may occur.\n      id: \"NEWTAB_FOOTER_BAR_CONTENT\",\n    };\n    const action = {\n      type: event.target.dataset.action,\n      data: {args: event.target.dataset.args},\n    };\n    if (action.type) {\n      ASRouterUtils.executeAction(action);\n    }\n    if (!this.state.message.content.do_not_autoblock && !event.target.dataset.do_not_autoblock) {\n      ASRouterUtils.blockById(this.state.message.id);\n    }\n    if (this.state.message.provider !== \"preview\") {\n      this.sendUserActionTelemetry({event: \"CLICK_BUTTON\", ...metric});\n    }\n  }\n\n  onBlockById(id) {\n    return options => ASRouterUtils.blockById(id, options);\n  }\n\n  onDismissById(id) {\n    return () => ASRouterUtils.dismissById(id);\n  }\n\n  dismissBundle(bundle) {\n    return () => ASRouterUtils.dismissBundle(bundle);\n  }\n\n  triggerOnboarding() {\n    ASRouterUtils.sendMessage({type: \"TRIGGER\", data: {trigger: {id: \"showOnboarding\"}}});\n  }\n\n  onMessageFromParent({data: action}) {\n    switch (action.type) {\n      case \"SET_MESSAGE\":\n        this.setState({message: action.data});\n        break;\n      case \"SET_BUNDLED_MESSAGES\":\n        this.setState({bundle: action.data});\n        break;\n      case \"CLEAR_MESSAGE\":\n        if (action.data.id === this.state.message.id) {\n          this.setState({message: {}});\n          // Remove any styles related to the RTAMO message\n          document.body.classList.remove(\"welcome\", \"hide-main\", \"amo\");\n        }\n        break;\n      case \"CLEAR_PROVIDER\":\n        if (action.data.id === this.state.message.provider) {\n          this.setState({message: {}});\n        }\n        break;\n      case \"CLEAR_BUNDLE\":\n        if (this.state.bundle.bundle) {\n          this.setState({bundle: {}});\n        }\n        break;\n      case \"CLEAR_ALL\":\n        this.setState({message: {}, bundle: {}});\n    }\n  }\n\n  componentWillMount() {\n    // Add locale data for StartupOverlay because it uses react-intl\n    addLocaleData(global.document.documentElement.lang);\n\n    const endpoint = ASRouterUtils.getPreviewEndpoint();\n    ASRouterUtils.addListener(this.onMessageFromParent);\n\n    // If we are loading about:welcome we want to trigger the onboarding messages\n    if (this.props.document.location.href === \"about:welcome\") {\n      ASRouterUtils.sendMessage({type: \"TRIGGER\", data: {trigger: {id: \"firstRun\"}}});\n    } else {\n      ASRouterUtils.sendMessage({type: \"SNIPPETS_REQUEST\", data: {endpoint}});\n    }\n  }\n\n  componentWillUnmount() {\n    ASRouterUtils.removeListener(this.onMessageFromParent);\n  }\n\n  renderSnippets() {\n    if (this.state.bundle.template === \"onboarding\" ||\n        this.state.message.template === \"fxa_overlay\" ||\n        this.state.message.template === \"return_to_amo_overlay\") {\n      return null;\n    }\n    const SnippetComponent = SnippetsTemplates[this.state.message.template];\n    const {content} = this.state.message;\n\n    return (\n      <ImpressionsWrapper\n        id=\"NEWTAB_FOOTER_BAR\"\n        message={this.state.message}\n        sendImpression={this.sendImpression}\n        shouldSendImpressionOnUpdate={shouldSendImpressionOnUpdate}\n        // This helps with testing\n        document={this.props.document}>\n          <LocalizationProvider messages={generateMessages(content)}>\n            <SnippetComponent\n              {...this.state.message}\n              UISurface=\"NEWTAB_FOOTER_BAR\"\n              onBlock={this.onBlockById(this.state.message.id)}\n              onDismiss={this.onDismissById(this.state.message.id)}\n              onAction={ASRouterUtils.executeAction}\n              sendClick={this.sendClick}\n              sendUserActionTelemetry={this.sendUserActionTelemetry} />\n          </LocalizationProvider>\n      </ImpressionsWrapper>);\n  }\n\n  renderOnboarding() {\n    if (this.state.bundle.template === \"onboarding\") {\n      return (\n        <OnboardingMessage\n          {...this.state.bundle}\n          UISurface=\"NEWTAB_OVERLAY\"\n          onAction={ASRouterUtils.executeAction}\n          onDoneButton={this.dismissBundle(this.state.bundle.bundle)}\n          sendUserActionTelemetry={this.sendUserActionTelemetry} />);\n    }\n    return null;\n  }\n\n  renderFirstRunOverlay() {\n    const {message} = this.state;\n    if (message.template === \"fxa_overlay\") {\n      global.document.body.classList.add(\"fxa\");\n      return (\n        <IntlProvider locale={global.document.documentElement.lang} messages={global.gActivityStreamStrings}>\n          <StartupOverlay\n            onReady={this.triggerOnboarding}\n            onBlock={this.onDismissById(message.id)}\n            dispatch={this.props.activityStreamStore.dispatch}\n            store={this.props.activityStreamStore} />\n        </IntlProvider>\n      );\n    } else if (message.template === \"return_to_amo_overlay\") {\n      global.document.body.classList.add(\"amo\");\n      return (\n        <LocalizationProvider messages={generateMessages({\"amo_html\": message.content.text})}>\n          <ReturnToAMO\n            {...message}\n            onReady={this.triggerOnboarding}\n            onBlock={this.onDismissById(message.id)}\n            onAction={ASRouterUtils.executeAction} />\n        </LocalizationProvider>\n      );\n    }\n    return null;\n  }\n\n  renderPreviewBanner() {\n    if (this.state.message.provider !== \"preview\") {\n      return null;\n    }\n\n    return (\n      <div className=\"snippets-preview-banner\">\n        <span className=\"icon icon-small-spacer icon-info\" />\n        <span>Preview Purposes Only</span>\n      </div>\n    );\n  }\n\n  render() {\n    const {message, bundle} = this.state;\n    if (!message.id && !bundle.template) { return null; }\n    return (\n      <React.Fragment>\n        {this.renderPreviewBanner()}\n        {this.renderFirstRunOverlay()}\n        {this.renderOnboarding()}\n        {this.renderSn