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boB,WAAY,CACVN,OAAQ,QACRO,WAAY,QACZb,QAAS,QACTP,WAAY,GACZN,SAAU,GACV2B,YA9F8C,IAAA7B,EAAG,CAAC,EAACA,GA8FpC8B,QAEjBC,SAAU,CACRnB,QAAS,SACTV,SAAU,GACVM,WAAY,GAEdlC,UAAW,CACTiC,UAAW,EACXL,SAAU,GACV2B,MAAO,WAETG,WAAY,CACVzB,UAAW,EACXL,SAAU,GACV2B,MAAO,WAETI,kBAAmB,CACjBrB,QAAS,cACTze,OAAQ,GACR+f,WAAY,UAEf,G","sources":["../../../../advisor/packages/competition-tab/index.js","../../../../advisor/packages/competition-tab/src/projection-grid-pill-control.js","../../../../advisor/packages/competition-tab/src/projection-grid-chart.js","../../../../advisor/packages/competition-tab/src/pill-control-decorator.js","../../../../advisor/packages/competition-tab/src/general-insights-data-source.js","../../../../advisor/packages/competition-tab/src/general-insights-grid-columns.js","../../../../advisor/packages/competition-tab/src/general-insights-plugin-config.js","../../../../advisor/packages/competition-tab/src/general-insights-grid-config.js","../../../../advisor/packages/competition-tab/src/general-insights-grid.js","../../../../advisor/packages/competition-tab/src/general-insights-chart-container.js","../../../../advisor/packages/competition-tab/src/general-insights.js","../../../../advisor/packages/competition-tab/src/competition-recommendations.js","../../../../advisor/packages/competition-tab/src/competition-tab.js","../../../../advisor/packages/competition-tab/src/competition-tab-view.js","../../../../advisor/packages/competition-tab/src/new-pkg/general-insights-grid.js","../../../../advisor/packages/competition-tab/src/new-pkg/pill-control-plugin.js","../../../../advisor/packages/competition-tab/src/new-pkg/const.js","../../../../advisor/packages/competition-tab/src/new-pkg/campaign-type-switch-plugin.js","../../../../advisor/packages/competition-tab/src/new-pkg/plugins.js","../../../../advisor/packages/competition-tab/src/new-pkg/general-insights-gridview-factory.js","../../../../advisor/packages/competition-tab/src/new-pkg/grid-config.js","../../../../advisor/packages/recommendation-bulk-aar/src/const.js","../../../../advisor/packages/recommendation-bulk-aar/src/bulk-aar-upload.js","../../../../advisor/packages/recommendation-bulk-aar/src/index.js","../../../../advisor/packages/recommendation-bulk-aar/style/bulk-aar-header-style.js"],"sourcesContent":["import { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport pkg from './package.json';\r\n\r\nexport const { version } = pkg;\r\n\r\nexport default globalContext.define(\r\n pkg.legacyDependencies,\r\n Promise => import(/* webpackMode: 'eager' */ './src/index') // eslint-disable-line no-unused-vars\r\n);\r\n","import _ from 'underscore';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { defineGridPlugin } from '@bingads-webui/projection-grid-plugin';\r\nimport {\r\n PILL_CONTROL,\r\n saveGeneralInsightsPreferences,\r\n getSegmentationData,\r\n} from '@bingads-webui-campaign-react/competition-core';\r\n\r\nconst preferencesService = globalContext.requireDefault('component/preference/service/index');\r\nconst appState = globalContext.require('component/state/index');\r\nconst { getSegType } = globalContext.require('component/bingads-grid/service/segmentation-preferences');\r\n\r\nexport const pillControlPlugin = defineGridPlugin(\r\n 'pillControl',\r\n [\r\n 'gridView',\r\n 'config',\r\n 'toolbar',\r\n 'segment',\r\n ],\r\n (gridView, config, toolbar, segment) => {\r\n const menuId = 'summary-overtime';\r\n const type = [PILL_CONTROL.overtime, PILL_CONTROL.summary];\r\n const toolbarEditor = toolbar.gridToolbarGroup.toolbarWithItem(menuId);\r\n const pluginConfig = _.result(config.plugins, 'pillControl', {});\r\n const {\r\n i18n,\r\n segmentationTypesCollection,\r\n } = pluginConfig;\r\n const {\r\n currentActivity,\r\n } = config;\r\n\r\n function updateSegmentMenu(selectedIndex) {\r\n toolbarEditor.update(getMenu(selectedIndex)); // eslint-disable-line no-use-before-define\r\n const segmentationTypes = segmentationTypesCollection[selectedIndex];\r\n let newSegType = getSegmentationData({\r\n activity: currentActivity,\r\n appState,\r\n getSegType,\r\n preferencesService,\r\n });\r\n\r\n currentActivity.trace(`use segment type ${newSegType}`, 'pillControlPlugin');\r\n if (!_.contains(segmentationTypes, newSegType) && newSegType !== 'None') {\r\n newSegType = 'None';\r\n currentActivity.error(`${newSegType} doesn't exist, fall back to None`, 'pillControlPlugin');\r\n }\r\n segment.setSegmentType(newSegType, segmentationTypes);\r\n }\r\n\r\n function getMenu(selectedIndex) {\r\n return {\r\n type: 'pill-control',\r\n id: menuId,\r\n items: [{\r\n text: i18n.getString('Over_Time'),\r\n }, {\r\n text: i18n.getString('Summary'),\r\n }],\r\n selectedIndex,\r\n onClick(index) {\r\n if (index !== this.selectedIndex) {\r\n const menuName = type[index];\r\n\r\n saveGeneralInsightsPreferences({ pillControlType: menuName }, preferencesService);\r\n currentActivity.trace(`click ${menuName} menu `, 'pillControlPlugin');\r\n updateSegmentMenu(index);\r\n gridView.refresh(true);\r\n }\r\n },\r\n };\r\n }\r\n\r\n const pillControlTypeInPreference = _.chain({})\r\n .defaults(config.query)\r\n .result('query')\r\n .result('PillControlType', PILL_CONTROL.overtime)\r\n .value();\r\n let defaultIndex = 0;\r\n\r\n defaultIndex = _.indexOf(type, pillControlTypeInPreference);\r\n updateSegmentMenu(defaultIndex);\r\n }\r\n);\r\n\r\n","import { defineGridPlugin } from '@bingads-webui/projection-grid-plugin';\r\n\r\nexport const chartPlugin = defineGridPlugin(\r\n 'chart',\r\n [\r\n 'config',\r\n 'toolbar',\r\n ],\r\n (config, toolbar) => {\r\n const menuId = 'button-chart-toggle';\r\n const toolbarEditor = toolbar.gridToolbarGroup.toolbarWithItem(menuId);\r\n const {\r\n chart: {\r\n toggleChartToolbar,\r\n },\r\n } = config.plugins;\r\n\r\n toolbarEditor.update({\r\n type: 'button',\r\n id: menuId,\r\n classes: ['btn', 'chart-icon'],\r\n onClick: () => {\r\n toggleChartToolbar();\r\n },\r\n });\r\n }\r\n);\r\n","import _ from 'underscore';\r\n\r\nimport {\r\n getPillControlTypeFromPreferences,\r\n} from '@bingads-webui-campaign-react/competition-core';\r\n\r\nexport function getPillControlDecorator(preferencesService) {\r\n return {\r\n run(queryParams) {\r\n const query = _.defaults({\r\n PillControlType: getPillControlTypeFromPreferences(preferencesService),\r\n }, queryParams.query);\r\n\r\n return _.defaults({\r\n query,\r\n }, queryParams);\r\n },\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { QueryBuilderFactory } from '@bingads-webui-campaign/query-builder';\r\nimport { connect } from '@bingads-webui-campaign/dqb-grid-datasource-connector';\r\nimport { DataSourceStore } from '@bingads-webui-campaign/data-source-store';\r\nimport { GENERAL_INSIGHTS_DATA_TYPES, GeneralInsightsSegmentationDecorator } from '@bingads-webui-campaign-react/competition-core';\r\nimport { getPillControlDecorator } from './pill-control-decorator';\r\n\r\nconst appState = globalContext.require('component/state/index');\r\nconst dateUtil = globalContext.require('component/humanize/date');\r\nconst SegmentationPreference = globalContext.require('component/bingads-grid/service/segmentation-preferences');\r\nconst { fetchSortInfo } = globalContext.require('component/bingads-grid/service/fetch-sortinfo');\r\nconst preferencesService = globalContext.requireDefault('component/preference/service/index');\r\n\r\nexport function initializeDataSource({\r\n type = GENERAL_INSIGHTS_DATA_TYPES.Grid,\r\n dataService,\r\n filterService = null,\r\n featureName,\r\n afterFindAll,\r\n}) {\r\n const isType = (...types) => _.contains(types, type);\r\n const { Chart, Tile, Grid } = GENERAL_INSIGHTS_DATA_TYPES;\r\n\r\n const queryBuilderConfig = {\r\n decorators: _.compact([\r\n { name: 'dateFilter' },\r\n isType(Chart, Grid) && { name: 'segment' },\r\n isType(Chart, Grid) && { name: 'filter', filterService },\r\n isType(Chart, Grid) && { name: 'sorting' },\r\n isType(Chart, Grid) && getPillControlDecorator(preferencesService),\r\n isType(Chart, Tile) && new GeneralInsightsSegmentationDecorator(type === Tile),\r\n ]),\r\n commonConfig: {\r\n featureName,\r\n isOdataActionSource: false,\r\n deps: {\r\n dateUtil,\r\n state: appState,\r\n SegmentationPreference,\r\n fetchSortInfo,\r\n },\r\n },\r\n };\r\n\r\n const queryBuilder = QueryBuilderFactory.make(queryBuilderConfig);\r\n const dataSource = connect(\r\n {\r\n type: 'jsdata',\r\n entity: dataService,\r\n options: {\r\n useDfmCache: true,\r\n afterFindAll: isType(Grid) ? afterFindAll : _.noop,\r\n },\r\n },\r\n queryBuilder,\r\n type\r\n );\r\n\r\n // Prefetch\r\n dataSource.query();\r\n\r\n DataSourceStore.set(type, dataSource);\r\n}\r\n\r\nexport function initializeDataSources({\r\n dataService,\r\n filterService,\r\n featureName,\r\n afterFindAll,\r\n}) {\r\n initializeDataSource({\r\n type: GENERAL_INSIGHTS_DATA_TYPES.Grid,\r\n dataService,\r\n filterService,\r\n featureName,\r\n preferencesService,\r\n afterFindAll,\r\n });\r\n initializeDataSource({\r\n type: GENERAL_INSIGHTS_DATA_TYPES.Chart,\r\n dataService,\r\n filterService,\r\n featureName,\r\n preferencesService,\r\n });\r\n}\r\n\r\nexport function getDataSource(type = GENERAL_INSIGHTS_DATA_TYPES.Grid) {\r\n return DataSourceStore.get(type);\r\n}\r\n","import _ from 'underscore';\r\nimport {\r\n DisplayDomainColumn,\r\n StoreDisplayNameColumn,\r\n ImpressionShareColumn,\r\n AveragePositionColumn,\r\n OverlapRateColumn,\r\n AboveRateColumn,\r\n TopOfPageRateColumn,\r\n AbsoluteTopOfPageRateColumn,\r\n OutrankingShareColumn,\r\n ImpressionShareWithInsightColumn,\r\n} from '@bingads-webui-campaign/auction-insight-common';\r\nimport { ColumnsConfigBuilder } from '@bingads-webui-campaign/summary-grid-helper';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { CAMPAIGN_TYPES } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\nimport { levelAtConstant } from '@bingads-webui-campaign/scope-constants';\r\n\r\nconst appConfig = globalContext.require('component/config/index');\r\nconst { Columns, SelectedColumns } = globalContext.require('component/bingads-grid/service/column-chooser-preferences');\r\nconst i18n = globalContext.require('@bingads-webui/i18n-amd-loader!campaignui/feature/competition-tab');\r\nconst permissions = appConfig.get('Permissions');\r\n\r\nlet builder = null;\r\nlet campaignTypeInLastBuilder;\r\n\r\nfunction getBuilder({\r\n campaignType,\r\n scope,\r\n}) {\r\n if (builder === null || campaignTypeInLastBuilder !== campaignType) {\r\n campaignTypeInLastBuilder = campaignType;\r\n\r\n let performanceColumns;\r\n let attributesColumns;\r\n let lockedColumns;\r\n const isCustomerLevel = _.result(scope, 'levelAt') === levelAtConstant.CUSTOMER;\r\n\r\n if (campaignType === CAMPAIGN_TYPES.Shopping) {\r\n attributesColumns = [StoreDisplayNameColumn];\r\n lockedColumns = [\r\n StoreDisplayNameColumn,\r\n isCustomerLevel ? ImpressionShareWithInsightColumn : ImpressionShareColumn,\r\n ];\r\n performanceColumns = _.compact([\r\n isCustomerLevel ? ImpressionShareWithInsightColumn : ImpressionShareColumn,\r\n OverlapRateColumn,\r\n permissions.IsAvgPositionDeprecationPhase1Enabled && AbsoluteTopOfPageRateColumn,\r\n OutrankingShareColumn,\r\n ]);\r\n } else {\r\n attributesColumns = [DisplayDomainColumn];\r\n lockedColumns = [\r\n DisplayDomainColumn,\r\n isCustomerLevel ? ImpressionShareWithInsightColumn : ImpressionShareColumn,\r\n ];\r\n performanceColumns = _.compact([\r\n isCustomerLevel ? ImpressionShareWithInsightColumn : ImpressionShareColumn,\r\n !permissions.IsAvgPositionDeprecationPhase2Enabled && AveragePositionColumn,\r\n OverlapRateColumn,\r\n AboveRateColumn,\r\n TopOfPageRateColumn,\r\n permissions.IsAvgPositionDeprecationPhase1Enabled && AbsoluteTopOfPageRateColumn,\r\n OutrankingShareColumn,\r\n ]);\r\n }\r\n const selectedColumns = _.union(attributesColumns, performanceColumns);\r\n\r\n builder = new ColumnsConfigBuilder()\r\n .addCategory('Attributes', category => category.addColumns(attributesColumns))\r\n .addCategory('Performance', category => category.addColumns(performanceColumns))\r\n .setLockedColumns(lockedColumns)\r\n .setSelectedColumns(selectedColumns);\r\n }\r\n\r\n return builder;\r\n}\r\n\r\nexport function getColumnsConfig({\r\n scope,\r\n campaignType,\r\n}) {\r\n return getBuilder({ campaignType, scope }).getColumnsConfig({\r\n i18n,\r\n scope,\r\n campaignType,\r\n });\r\n}\r\n\r\nexport function getColumnChooserConfig({ campaignType, scope }) {\r\n return getBuilder({ campaignType, scope }).getColumnChooserConfig({\r\n i18n,\r\n patchQuery: true,\r\n Columns,\r\n SelectedColumns,\r\n });\r\n}\r\n","import $ from 'jquery';\r\nimport _ from 'underscore';\r\n\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { clientSideDownload } from '@bingads-webui-campaign/auction-insight-common';\r\nimport { segmentationType, adinsightSegmentationTypeEnum } from '@bingads-webui-campaign/segmentation-utilities';\r\nimport {\r\n CAMPAIGN_TYPES,\r\n} from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\nimport { setSegmentationData } from '@bingads-webui-campaign-react/competition-core';\r\n\r\nimport { getColumnChooserConfig } from './general-insights-grid-columns';\r\n\r\nconst i18n = globalContext.require('@bingads-webui/i18n-amd-loader!campaignui/feature/competition-tab');\r\nconst DownloadView = globalContext.require('campaignui/feature/griddownload/view/baseDownload');\r\nconst appConfig = globalContext.require('component/config/index');\r\nconst appState = globalContext.require('component/state/index');\r\nconst permissions = appConfig.get('Permissions');\r\nconst { getSegType, setSegType } = globalContext.require('component/bingads-grid/service/segmentation-preferences');\r\nconst instrumentation = globalContext.require('campaignui/feature/instrumentation/index');\r\nconst preferencesService = globalContext.requireDefault('component/preference/service/index');\r\n\r\nconst campaignTypeItems = _.map(_.values(CAMPAIGN_TYPES), (campaignType, index) => ({\r\n id: index,\r\n text: i18n.getString(`AuctionInsights_CampaignType_${campaignType}`),\r\n key: campaignType,\r\n}));\r\n\r\nexport function getPluginsConfig({\r\n scope,\r\n addDateChangeListener,\r\n container,\r\n toggleChartToolbar,\r\n view,\r\n campaignType,\r\n onCampaignTypeSelectChange,\r\n showCampaignTypeDropdown,\r\n showAlertHandler,\r\n}) {\r\n const upperToolbarItems = [{\r\n type: 'button',\r\n id: 'button-chart-toggle',\r\n }, {\r\n type: 'pill-control',\r\n id: 'summary-overtime',\r\n }, {\r\n type: 'dropdown',\r\n id: 'filter-menu',\r\n }, {\r\n type: 'dropdown',\r\n id: 'dropdown-segment',\r\n }];\r\n\r\n if (showCampaignTypeDropdown) {\r\n upperToolbarItems.push({\r\n type: 'selector',\r\n id: 'dropdown-campaign-type',\r\n items: campaignTypeItems,\r\n selectedKey: campaignType,\r\n onChange({ key }) {\r\n if (key !== campaignType) {\r\n onCampaignTypeSelectChange({\r\n campaignType: key,\r\n });\r\n }\r\n },\r\n });\r\n }\r\n\r\n const lowerToolbarItems = [{\r\n type: 'button',\r\n id: 'button-download',\r\n }, {\r\n type: 'dropdown',\r\n id: 'dropdown-column-chooser',\r\n }];\r\n\r\n const segmentationTypesForSummaryMenu = [\r\n segmentationType.DayOfWeek,\r\n segmentationType.HourOfDay,\r\n segmentationType.Device,\r\n ];\r\n const segmentationTypesForOverTimeMenu = [\r\n segmentationType.Day,\r\n segmentationType.Week,\r\n segmentationType.Month,\r\n segmentationType.Quarter,\r\n segmentationType.Year,\r\n segmentationType.Device,\r\n ];\r\n\r\n return {\r\n dateFilter: {\r\n state: appState,\r\n addDateChangeListener,\r\n },\r\n toolbar: {\r\n 'upper-toolbar': {\r\n items: upperToolbarItems,\r\n },\r\n 'lower-toolbar': {\r\n items: lowerToolbarItems,\r\n },\r\n },\r\n columnChooser: getColumnChooserConfig({ campaignType }),\r\n inlineDownload: {\r\n DownloadView,\r\n isAvailable: true,\r\n i18n,\r\n entity: 'AuctionInsight',\r\n customDownloadService: (format, segmentType) => {\r\n clientSideDownload(format, segmentType, view, scope, appState, i18n, showAlertHandler);\r\n },\r\n downloadFormats: ['Csv'],\r\n segmentationTypes: adinsightSegmentationTypeEnum,\r\n },\r\n placeholder: {\r\n container: '.general-insights .grid-noresult',\r\n filteredEmptyText: i18n.getString('Grid_NoFilteredRecords'),\r\n text: i18n.getString('AuctionInsights_GridNoDataDetail'),\r\n },\r\n uiBlocker: {\r\n el: container && $(container),\r\n },\r\n segment: {\r\n cellTemplates: {\r\n DisplayDomain: 'default',\r\n },\r\n i18n,\r\n permissions,\r\n cultureShortDatePattern: 'M/d/yyyy',\r\n state: appState,\r\n setSegType(name, segType) {\r\n setSegmentationData({\r\n gridName: name,\r\n segType,\r\n setSegType,\r\n preferencesService,\r\n });\r\n },\r\n isOdataActionSource: false,\r\n edm: null,\r\n segmentationTypes: [], // use pill control to dynamic set allowed segmentation types\r\n instrumentation,\r\n getSegType,\r\n },\r\n pillControl: {\r\n i18n,\r\n segmentationTypesCollection: [\r\n segmentationTypesForOverTimeMenu,\r\n segmentationTypesForSummaryMenu,\r\n ],\r\n },\r\n chart: {\r\n toggleChartToolbar,\r\n },\r\n performanceLogNew: {\r\n instrumentation: instrumentation.default,\r\n },\r\n };\r\n}\r\n","import $ from 'jquery';\r\nimport { helpers } from '@bingads-webui/projection-grid-toolbar';\r\nimport { GENERAL_INSIGHTS_DATA_TYPES } from '@bingads-webui-campaign-react/competition-core';\r\n\r\nimport { getDataSource } from './general-insights-data-source';\r\nimport { getPluginsConfig } from './general-insights-plugin-config';\r\nimport { getColumnsConfig } from './general-insights-grid-columns';\r\n\r\nconst { toolbarRow } = helpers;\r\n\r\nexport function getConfig({\r\n view,\r\n scope,\r\n addDateChangeListener,\r\n container,\r\n filterService,\r\n currentScenario,\r\n currentActivity,\r\n toggleChartToolbar,\r\n campaignType,\r\n onCampaignTypeSelectChange,\r\n showCampaignTypeDropdown,\r\n featureName,\r\n showAlertHandler,\r\n}) {\r\n const dataSource = getDataSource(GENERAL_INSIGHTS_DATA_TYPES.Grid);\r\n\r\n return {\r\n name: featureName,\r\n tableClasses: ['table', 'table-bordered'],\r\n isDataFetchManagerSource: true,\r\n dataSource,\r\n filterService,\r\n rows: {\r\n headRows: [\r\n toolbarRow('lower-toolbar'),\r\n 'column-header-rows',\r\n ],\r\n bodyRows: [\r\n {\r\n type: 'data-rows',\r\n classes: {\r\n 'auction-insight-column-you': ({ DisplayDomain }) => DisplayDomain === 'You',\r\n },\r\n },\r\n ],\r\n },\r\n columns: getColumnsConfig({\r\n scope,\r\n campaignType,\r\n }),\r\n scrolling: {\r\n header: {\r\n type: 'sticky',\r\n offset() {\r\n return $('nav.navbar-default.navbar-fixed-top').height();\r\n },\r\n },\r\n virtualized: true,\r\n },\r\n plugins: getPluginsConfig({\r\n view,\r\n scope,\r\n addDateChangeListener,\r\n container,\r\n toggleChartToolbar,\r\n campaignType,\r\n onCampaignTypeSelectChange,\r\n showCampaignTypeDropdown,\r\n showAlertHandler,\r\n }),\r\n currentScenario,\r\n currentActivity,\r\n };\r\n}\r\n","import pgrid from 'projection-grid';\r\nimport _ from 'underscore';\r\nimport { DeterministicWrapperView } from '@bingads-webui/deterministic-wrapper-view';\r\nimport { toolbarPlugin } from '@bingads-webui/projection-grid-toolbar';\r\nimport { inlineDownloadWithoutFilterstatePlugin } from '@bingads-webui-campaign/projection-grid-inline-download';\r\nimport { columnChooserPlugin } from '@bingads-webui-campaign/projection-grid-column-chooser';\r\nimport { dateFilterPlugin } from '@bingads-webui-campaign/projection-grid-date-filter';\r\nimport { placeholderPlugin } from '@bingads-webui/projection-grid-placeholder';\r\nimport { segmentPlugin } from '@bingads-webui-campaign/projection-grid-segment';\r\nimport { uiBlockerPlugin } from '@bingads-webui/projection-grid-uiblocker';\r\nimport { merge } from '@bingads-webui-universal/primitive-utilities';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\n\r\nimport { pillControlPlugin } from './projection-grid-pill-control';\r\nimport { chartPlugin } from './projection-grid-chart';\r\nimport { getConfig } from './general-insights-grid-config';\r\n\r\nconst preferencesService = globalContext.requireDefault('component/preference/service/index');\r\nconst { newPerformanceLogPlugin } = globalContext.require('component/bingads-grid/plugin/new-performance-log');\r\n\r\nexport class GeneralInsightsGrid extends DeterministicWrapperView {\r\n viewFactory({\r\n scope,\r\n addDateChangeListener,\r\n container,\r\n filterService,\r\n preferenceConfig,\r\n currentScenario,\r\n currentActivity,\r\n toggleChartToolbar,\r\n campaignType,\r\n onCampaignTypeSelectChange,\r\n showCampaignTypeDropdown,\r\n featureName,\r\n showAlertHandler,\r\n }) {\r\n const gridPlugins = pgrid.factory({ vnext: true })\r\n .use(dateFilterPlugin)\r\n .use(toolbarPlugin)\r\n .use(columnChooserPlugin)\r\n .use(uiBlockerPlugin)\r\n .use(placeholderPlugin)\r\n .use(segmentPlugin)\r\n .use(inlineDownloadWithoutFilterstatePlugin)\r\n .use(pillControlPlugin)\r\n .use(chartPlugin)\r\n .use(newPerformanceLogPlugin);\r\n\r\n let config = getConfig({\r\n scope,\r\n view: this,\r\n addDateChangeListener,\r\n container,\r\n filterService,\r\n currentScenario,\r\n currentActivity,\r\n toggleChartToolbar,\r\n campaignType,\r\n onCampaignTypeSelectChange,\r\n showCampaignTypeDropdown,\r\n featureName,\r\n showAlertHandler,\r\n });\r\n\r\n config = merge(config, preferenceConfig);\r\n\r\n this.grid = gridPlugins\r\n .create(config);\r\n\r\n this.grid.gridView.on('willUpdate', (changes) => {\r\n if (_.has(changes, 'sortableHeader')) {\r\n const orderby = _.result(changes.query, 'orderby') || _.result(this.grid.gridView.get('query'), 'orderby');\r\n const { sortableHeader } = changes;\r\n\r\n preferencesService.setAtUserLevel({\r\n Name: `WebApp.CampaignUI.${config.name}`,\r\n Data: { sortInfo: { orderby, sortableHeader } },\r\n });\r\n }\r\n });\r\n\r\n return this.grid.gridView;\r\n }\r\n\r\n getUpperToolbar() {\r\n return this.grid.toolbar.gridToolbarGroup.toolbarWithName('upper-toolbar');\r\n }\r\n\r\n hideLowerToolbar() {\r\n this.grid.toolbar.gridToolbarGroup.toolbarWithName('lower-toolbar').hide();\r\n }\r\n\r\n showLowerToolbar() {\r\n this.grid.toolbar.gridToolbarGroup.toolbarWithName('lower-toolbar').show();\r\n }\r\n\r\n remove() {\r\n this.grid.toolbar.gridToolbarGroup.remove();\r\n this.grid.toolbar = null;\r\n super.remove();\r\n }\r\n\r\n refresh() {\r\n this.grid.gridView.refresh(true);\r\n }\r\n\r\n get className() { return 'general-insights-grid'; }\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { DropdownSelector } from '@bingads-webui-react/dropdown-selector';\r\nimport { localizeSegmentationValue, segmentationType } from '@bingads-webui-campaign/segmentation-utilities';\r\nimport { perfMarkerPropTypes } from '@bingads-webui/performance-marker';\r\n\r\nimport { METRIC_PREFERENCE_KEY_NAME, CAMPAIGN_TYPES } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\n\r\nimport {\r\n METRICS,\r\n getLocalizedMetrics,\r\n AdvisorChartWithMetrics,\r\n EmptyChart,\r\n} from '@bingads-webui-campaign-react/advisor-chart';\r\nimport { getGeneralInsightsPreferences, saveGeneralInsightsPreferences, getPillControlTypeFromPreferences } from '@bingads-webui-campaign-react/competition-core';\r\n\r\nconst i18n = globalContext.require('@bingads-webui/i18n-amd-loader!campaignui/feature/competition-tab');\r\nconst preferencesService = globalContext.requireDefault('component/preference/service/index');\r\nconst appConfig = globalContext.require('component/config/index');\r\nconst permissions = appConfig.get('Permissions');\r\n\r\nconst DEVICE_TYPE = {\r\n PC: 'PC',\r\n SmartPhone: 'SmartPhone',\r\n Tablet: 'Tablet',\r\n};\r\n\r\nfunction localizeDeviceType(value) {\r\n return localizeSegmentationValue({\r\n i18n,\r\n type: segmentationType.DeviceType,\r\n value,\r\n });\r\n}\r\n\r\nfunction getDeviceTypeList(raw, primaryDeviceType) {\r\n // get segmentData from first item\r\n const segmentData = raw[0].PerformanceMetrics.SegmentedData;\r\n\r\n if (_.size(segmentData) > 0 && _.size(segmentData[0].Key) > 1) {\r\n const keys = _.pluck(segmentData[0].Key, 'StringValue');\r\n\r\n if (_.intersection(keys, DEVICE_TYPE).length > 0) {\r\n // Move the primaryDeviceType to start of the list\r\n return _.union(\r\n [primaryDeviceType],\r\n _.values(DEVICE_TYPE)\r\n );\r\n }\r\n }\r\n\r\n return [null];\r\n}\r\n\r\nexport class GeneralInsightsChartContainer extends React.PureComponent {\r\n static defaultProps = {\r\n domains: null,\r\n isShoppingCampaignType: false,\r\n parentPerfMarker: null,\r\n perfMarker: null,\r\n };\r\n\r\n static propTypes = {\r\n data: PropTypes.shape({\r\n totalCount: PropTypes.number.isRequired,\r\n items: PropTypes.arrayOf(PropTypes.shape({\r\n PerformanceMetrics: PropTypes.object.isRequired,\r\n DisplayDomain: PropTypes.string.isRequired,\r\n })).isRequired,\r\n }).isRequired,\r\n domains: PropTypes.arrayOf(PropTypes.string),\r\n isShoppingCampaignType: PropTypes.bool,\r\n /* eslint-disable react/forbid-prop-types */\r\n currentScenario: PropTypes.object.isRequired,\r\n currentActivity: PropTypes.object.isRequired,\r\n parentPerfMarker: perfMarkerPropTypes,\r\n perfMarker: perfMarkerPropTypes,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n this.pillControlType = getPillControlTypeFromPreferences(preferencesService);\r\n\r\n this.mountChartActitivy = props.currentScenario.mountChart.create();\r\n this.mountChartActitivy.start();\r\n const preferences = getGeneralInsightsPreferences(preferencesService);\r\n const { primaryDeviceType } = preferences;\r\n\r\n this.metrics = getLocalizedMetrics(\r\n i18n, props.isShoppingCampaignType,\r\n permissions.IsAvgPositionDeprecationPhase1Enabled,\r\n permissions.IsAvgPositionDeprecationPhase2Enabled\r\n );\r\n\r\n // since when campaign type is changed, general insights component will be re-constructed,\r\n // here we can store a value which is computed from prop.\r\n if (props.isShoppingCampaignType) {\r\n this.metricPreferenceName = METRIC_PREFERENCE_KEY_NAME[CAMPAIGN_TYPES.Shopping];\r\n } else {\r\n this.metricPreferenceName = METRIC_PREFERENCE_KEY_NAME[CAMPAIGN_TYPES.Search];\r\n }\r\n\r\n let selectedMetric = preferences[this.metricPreferenceName] || METRICS.ImpressionShare;\r\n const availableMetrics = _.map(this.metrics, item => item.metric);\r\n\r\n if (!_.contains(availableMetrics, selectedMetric)) {\r\n selectedMetric = METRICS.ImpressionShare;\r\n\r\n _.defer(() => {\r\n saveGeneralInsightsPreferences({\r\n [this.metricPreferenceName]: selectedMetric,\r\n }, preferencesService);\r\n });\r\n }\r\n\r\n this.state = {\r\n selectedMetric,\r\n primaryDeviceType: primaryDeviceType || DEVICE_TYPE.PC,\r\n };\r\n\r\n this.deviceTypes = _.map(_.keys(DEVICE_TYPE), (deviceType, id) => ({\r\n id,\r\n value: localizeDeviceType(deviceType),\r\n deviceType,\r\n }));\r\n }\r\n\r\n componentDidMount() {\r\n const { totalCount } = this.props.data;\r\n this.mountChartActitivy.stop();\r\n if (totalCount === 0) {\r\n this.onChartRenderedCallback();\r\n }\r\n }\r\n\r\n componentWillReceiveProps() {\r\n const prevPillControlType = this.pillControlType;\r\n this.pillControlType = getPillControlTypeFromPreferences(preferencesService);\r\n if (this.props.parentPerfMarker && (this.pillControlType !== prevPillControlType)) {\r\n this.actionPerfMarker = this.props.parentPerfMarker.createChild(`Auction_Insight_Chart_${this.pillControlType}_Action`);\r\n this.actionPerfMarker.willInit();\r\n }\r\n return null;\r\n }\r\n\r\n onMetricChange = ({ metric }) => {\r\n if (this.props.parentPerfMarker) {\r\n this.actionPerfMarker = this.props.parentPerfMarker.createChild(`Auction_Insight_Chart_${this.pillControlType}_Action`);\r\n this.actionPerfMarker.willInit();\r\n }\r\n\r\n saveGeneralInsightsPreferences({ [this.metricPreferenceName]: metric }, preferencesService);\r\n this.setState({\r\n selectedMetric: metric,\r\n });\r\n };\r\n\r\n onDeviceTypeChange = ({ deviceType }) => {\r\n if (this.props.parentPerfMarker) {\r\n this.actionPerfMarker = this.props.parentPerfMarker.createChild(`Auction_Insight_Chart_${this.pillControlType}_Action`);\r\n this.actionPerfMarker.willInit();\r\n }\r\n\r\n saveGeneralInsightsPreferences({ primaryDeviceType: deviceType }, preferencesService);\r\n this.setState({\r\n primaryDeviceType: deviceType,\r\n });\r\n };\r\n\r\n onChartRenderedCallback = () => {\r\n if (this.props.perfMarker && !this.props.perfMarker.isDone) {\r\n this.props.perfMarker.done();\r\n }\r\n if (this.actionPerfMarker && !this.actionPerfMarker.isDone) {\r\n this.actionPerfMarker.done();\r\n }\r\n };\r\n\r\n render() {\r\n const { totalCount, items } = this.props.data;\r\n\r\n if (totalCount > 0) {\r\n const { primaryDeviceType, selectedMetric } = this.state;\r\n const deviceTypeList = getDeviceTypeList(items, primaryDeviceType);\r\n const showDeviceTypeDropdown = _.size(deviceTypeList) > 1;\r\n\r\n\r\n const selectedMetricItem = _.findWhere(this.metrics, { metric: selectedMetric });\r\n const selectedDeviceType = _.findWhere(this.deviceTypes, { deviceType: primaryDeviceType });\r\n\r\n this.props.currentActivity.trace(\r\n `selected metric is ${selectedMetric}, selected device type is ${primaryDeviceType}`,\r\n 'GeneralInsightsChart/render'\r\n );\r\n\r\n return (\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n {showDeviceTypeDropdown &&\r\n
\r\n \r\n
}\r\n
\r\n
\r\n \r\n
\r\n );\r\n }\r\n\r\n return ();\r\n }\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\n\r\nimport { AuctionInsightService } from '@bingads-webui-campaign/auction-insight-service';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { FilterService } from '@bingads-webui/filter-service';\r\nimport { BackboneInstanceWrapper } from '@bingads-webui-react/backbone-instance-wrapper';\r\nimport { CampaignAdgroupSelectorFilterAgent } from '@bingads-webui-campaign-react/campaign-adgroup-selector-filter';\r\n\r\nimport { levelAtConstant } from '@bingads-webui-campaign/scope-constants';\r\n\r\nimport {\r\n CAMPAIGN_TYPES,\r\n GENERAL_INSIGHTS_FEATURE_NAMES,\r\n} from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\n\r\nimport {\r\n getFilterConfig,\r\n GENERAL_INSIGHTS_DATA_TYPES,\r\n} from '@bingads-webui-campaign-react/competition-core';\r\n\r\nimport { GeneralInsightsGrid } from './general-insights-grid';\r\nimport { initializeDataSources, getDataSource } from './general-insights-data-source';\r\nimport { GeneralInsightsChartContainer } from './general-insights-chart-container';\r\n\r\nconst appConfig = globalContext.require('component/config/index');\r\nconst permissions = appConfig.get('Permissions');\r\nconst i18n = globalContext.require('@bingads-webui/i18n-amd-loader!campaignui/feature/competition-tab');\r\nconst instrumentation = globalContext.requireDefault('campaignui/feature/instrumentation/index');\r\nconst appState = globalContext.require('component/state/index');\r\nconst dateUtil = globalContext.require('component/humanize/date');\r\nconst sessionStore = globalContext.requireDefault('component/js-data-storage/session-storage');\r\nconst preferenceStoreFactory = globalContext.require('component/bingads-grid/service/filter-preferences').getFilters;\r\nconst cacheService = globalContext.require('Services/CacheService');\r\nconst dataContextManager = globalContext.require('SummaryDataContextManager');\r\nconst edmCampaign = globalContext.requireDefault('component/edm-campaign/index');\r\nconst jsdata = globalContext.require('component/js-data-campaign/index');\r\n\r\nconst isBAACompetitionBSCAuctionInsightsEnabled =\r\n permissions.IsBAACompetitionBSCAuctionInsightsEnabled;\r\n\r\n// Cache the function's result.\r\n// Solve the 'i18n not ready' issue. Memoizing the funciton is a solution\r\nexport const UsedImpressions = _.memoize(props => (\r\n
\r\n \r\n {i18n.getString('AuctionInsights_DataExplanation_Bold_Without_Percent')\r\n .replace('{0}', i18n.formatPercent(\r\n props.used,\r\n {\r\n maximumFractionDigits: 0,\r\n minimumFractionDigits: 0,\r\n }\r\n ))}\r\n \r\n  \r\n \r\n {i18n.getString('AuctionInsights_DataExplanationWithoutKeywordCount')}\r\n \r\n  \r\n \r\n
\r\n), props => props.used);\r\n\r\nUsedImpressions.propTypes = {\r\n used: PropTypes.number.isRequired,\r\n};\r\n\r\nexport const GeneralInsightsFooter = _.memoize(() => (\r\n
\r\n \r\n {i18n.getString('BIAuctionInsightStampNotes_Label')}\r\n \r\n \r\n
\r\n));\r\n\r\n\r\nexport class GeneralInsights extends React.Component {\r\n static propTypes = {\r\n customDataService: PropTypes.objectOf(PropTypes.any),\r\n el: PropTypes.oneOfType([\r\n PropTypes.string,\r\n PropTypes.object,\r\n ]).isRequired,\r\n grid: PropTypes.shape({\r\n addDateChangeListener: PropTypes.func.isRequired,\r\n showAlertHandler: PropTypes.func.isRequired,\r\n }).isRequired,\r\n scope: PropTypes.shape({\r\n customerId: PropTypes.string.isRequired,\r\n accountId: PropTypes.string,\r\n campaignId: PropTypes.string,\r\n adGroupId: PropTypes.string,\r\n token: PropTypes.string.isRequired,\r\n levelAt: PropTypes.string.isRequired,\r\n entityIds: PropTypes.arrayOf(PropTypes.string).isRequired,\r\n }).isRequired,\r\n campaignType: PropTypes.string.isRequired,\r\n onCampaignTypeSelectChange: PropTypes.func.isRequired,\r\n /* eslint-disable react/forbid-prop-types, react/require-default-props */\r\n preferenceConfig: PropTypes.object,\r\n parentScenario: PropTypes.object,\r\n perfMarker: PropTypes.shape({\r\n willInit: PropTypes.func.isRequired,\r\n willFetchData: PropTypes.func.isRequired,\r\n willRender: PropTypes.func.isRequired,\r\n done: PropTypes.func.isRequired,\r\n createChild: PropTypes.func.isRequired,\r\n }),\r\n };\r\n\r\n static defaultProps = {\r\n customDataService: null,\r\n perfMarker: {\r\n willInit: _.noop,\r\n willFetchData: _.noop,\r\n willRender: _.noop,\r\n done: _.noop,\r\n createChild() {\r\n return this;\r\n },\r\n },\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n props.perfMarker.willInit();\r\n\r\n const { scope } = this.props;\r\n this.currentScenario = instrumentation.loadGeneralInsights.create(props.parentScenario);\r\n this.currentActivity = this.currentScenario.loadGeneralInsights.create();\r\n this.showAlertHandler = this.props.grid && this.props.grid.showAlertHandler;\r\n\r\n this.campaignTypes = _.map(_.values(CAMPAIGN_TYPES), (campaignType, index) => ({\r\n id: index,\r\n value: i18n.getString(`AuctionInsights_CampaignType_${campaignType}`),\r\n campaignType,\r\n }));\r\n\r\n this.dataService = this.props.customDataService || new AuctionInsightService({\r\n scope,\r\n showAlertHandler: this.showAlertHandler,\r\n i18n,\r\n currentScenario: this.currentScenario,\r\n currentActivity: this.currentActivity,\r\n odataPath: appConfig.get('adinsight.odata.url'),\r\n campaignType: this.useShoppingCampaignType() ? CAMPAIGN_TYPES.Shopping : '',\r\n });\r\n\r\n this.gridFeatureName = GENERAL_INSIGHTS_FEATURE_NAMES[props.campaignType];\r\n\r\n const campaignTypeForQuery = props.campaignType === CAMPAIGN_TYPES.Shopping ?\r\n \"Enum.CampaignType'Shopping'\" : \"Enum.CampaignType'Default'\";\r\n this.filterConfig = getFilterConfig({\r\n scope,\r\n dataService: this.dataService,\r\n campaignType: props.campaignType,\r\n featureName: this.gridFeatureName,\r\n existingCampaignFilter: this.showCampaignTypeDropdown() && props.campaignType && {\r\n CampaignType: {\r\n $eq: campaignTypeForQuery,\r\n },\r\n },\r\n appState,\r\n dateUtil,\r\n sessionStore,\r\n preferenceStoreFactory,\r\n cacheService,\r\n dataContextManager,\r\n edmCampaign,\r\n jsdata,\r\n i18n,\r\n permissions,\r\n });\r\n this.filterService = new FilterService(this.filterConfig);\r\n\r\n // Set up QueryBuilder based DateSource for Grid and Chart\r\n initializeDataSources({\r\n dataService: this.dataService,\r\n filterService: this.filterService,\r\n featureName: this.gridFeatureName,\r\n });\r\n\r\n this.chartDataSource = getDataSource(GENERAL_INSIGHTS_DATA_TYPES.Chart);\r\n\r\n this.initializeGrid();\r\n\r\n // When the grid reloaded from the datasource, update data state\r\n this.grid.on('didReload', () => {\r\n this.refreshData();\r\n if (this.mounted) {\r\n this.setState({\r\n usedImpressions: this.dataService.getUsedImpressions(),\r\n });\r\n }\r\n });\r\n\r\n props.perfMarker.willFetchData();\r\n }\r\n\r\n state = {\r\n chartData: null,\r\n showChart: true,\r\n usedImpressions: 0,\r\n };\r\n\r\n componentDidMount() {\r\n // Use this trick before we figure out the long term solution\r\n // https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html\r\n this.mounted = true;\r\n }\r\n\r\n componentDidUpdate(prevProps, prevState) {\r\n // We only care the first render after chartData first turn non null\r\n if (prevState.chartData === null && this.state.chartData !== null) {\r\n this.props.perfMarker.done();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.mounted = false;\r\n if (this.upperToolBar) {\r\n this.upperToolBar.remove();\r\n }\r\n }\r\n\r\n onFilterUIChanged = (state) => {\r\n if (state.showToolBar) {\r\n this.grid.showLowerToolbar();\r\n } else {\r\n this.grid.hideLowerToolbar();\r\n }\r\n }\r\n\r\n onFilterStateChanged = () => {\r\n this.grid.refresh();\r\n }\r\n\r\n initializeGrid() {\r\n const ops = _.defaults({\r\n scope: this.props.scope,\r\n container: this.props.el,\r\n filterService: this.filterService,\r\n currentScenario: this.currentScenario,\r\n currentActivity: this.currentActivity,\r\n preferenceConfig: this.props.preferenceConfig,\r\n toggleChartToolbar: this.toggleChartToolbar,\r\n campaignType: this.props.campaignType,\r\n featureName: this.gridFeatureName,\r\n onCampaignTypeSelectChange: this.props.onCampaignTypeSelectChange,\r\n showCampaignTypeDropdown: this.showCampaignTypeDropdown(),\r\n showAlertHandler: this.showAlertHandler,\r\n }, this.props.grid);\r\n this.grid = new GeneralInsightsGrid(ops);\r\n this.upperToolBar = this.grid.getUpperToolbar();\r\n }\r\n\r\n toggleChartToolbar = () => {\r\n this.setState(prevState => ({\r\n showChart: !prevState.showChart,\r\n }));\r\n }\r\n\r\n refreshData() {\r\n this.currentActivity.trace('start refresh chart data', 'GeneralInsights/refreshData');\r\n const refreshChartActivity = this.currentScenario.refreshChart.create();\r\n refreshChartActivity.start();\r\n\r\n this.chartDataSource.query()\r\n .then((chartData) => {\r\n this.currentActivity.trace('end refresh chart data', 'GeneralInsights/refreshData');\r\n refreshChartActivity.stop();\r\n if (this.mounted) {\r\n this.setState({ chartData });\r\n }\r\n });\r\n }\r\n\r\n showCampaignTypeDropdown() {\r\n return isBAACompetitionBSCAuctionInsightsEnabled &&\r\n (this.props.scope.levelAt === levelAtConstant.ACCOUNT);\r\n }\r\n\r\n useShoppingCampaignType() {\r\n return isBAACompetitionBSCAuctionInsightsEnabled &&\r\n this.props.campaignType === CAMPAIGN_TYPES.Shopping;\r\n }\r\n\r\n render() {\r\n // when we get chartData, it means all data have been fetched\r\n if (this.state.chartData) {\r\n this.props.perfMarker.willRender();\r\n }\r\n\r\n return (\r\n
\r\n {this.state.usedImpressions !== 0 &&\r\n }\r\n \r\n
\r\n {this.state.showChart &&\r\n this.state.chartData &&\r\n }\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\n","/* eslint-disable jsx-a11y/anchor-is-valid, no-script-url */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport * as urlUtil from '@bingads-webui/url-util';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport {\r\n RecommendationService,\r\n RecommendationDownloadService,\r\n isRecommendationTypeEnabled,\r\n CHANNEL_TYPES,\r\n COMPETITION_RECOMMENDATION_FEATURE_NAME,\r\n COMPETITION_RECOMMENDATION_PREFERENCES,\r\n COMPETITION_DEFAULT_PAGE_SIZE,\r\n isReadOnly,\r\n} from '@bingads-webui-campaign/recommendation-core';\r\nimport { getCampaignAdgroupSelectorFilterConfig } from '@bingads-webui-campaign-react/campaign-adgroup-selector-filter';\r\nimport { FilterService } from '@bingads-webui/filter-service';\r\nimport { withCcJsData } from '@bingads-webui-cc-react/js-data-rest';\r\n\r\nconst appConfig = globalContext.require('component/config/index');\r\nconst permissions = appConfig.get('Permissions');\r\nconst i18n = globalContext.require('@bingads-webui/i18n-amd-loader!campaignui/feature/competition-tab');\r\nconst instrumentation = globalContext.requireDefault('campaignui/feature/instrumentation/index');\r\nconst pageContext = globalContext.require('PageContext');\r\nconst sessionStore = globalContext.requireDefault('component/js-data-storage/session-storage');\r\nconst filterPreferences = globalContext.require('component/bingads-grid/service/filter-preferences');\r\nconst cacheService = globalContext.require('Services/CacheService');\r\nconst dataContextManager = globalContext.require('SummaryDataContextManager');\r\nconst edmCampaign = globalContext.requireDefault('component/edm-campaign/index');\r\nconst jsdata = globalContext.require('component/js-data-campaign/index');\r\nconst locationMap = globalContext.requireDefault('campaignui/feature/location-targets/view/locationMap');\r\nconst preferencesService = globalContext.requireDefault('component/preference/service/index');\r\nconst asyncScheduler = globalContext.require('module/service/shared/asyncScheduler');\r\nconst cacheManager = globalContext.requireDefault('campaignui/feature/cache-manager/index');\r\nconst { getODataErrors } = globalContext.require('component/api-errors-campaign/index');\r\nconst odata = globalContext.require('component/http/channel/odata');\r\nconst constants = globalContext.require('Constants');\r\nconst SummaryViewLazy = React.lazy(() => import(/* webpackMode: 'eager' */ '@bingads-webui-campaign-react/recommendation-summary-view').then(({ SummaryView }) => ({ default: SummaryView })));\r\nconst DetailsViewLazy = React.lazy(() => import(/* webpackMode: 'eager' */ '@bingads-webui-campaign-react/recommendation-details-view').then(({ DetailsView }) => ({ default: DetailsView })));\r\n\r\nconst readOnly = isReadOnly(appConfig);\r\n\r\nclass CompetitionRecommendationsView extends React.Component {\r\n static propTypes = {\r\n filterService: PropTypes.shape({\r\n getCombinedFilter: PropTypes.func,\r\n }),\r\n grid: PropTypes.shape({\r\n showAlertHandler: PropTypes.func.isRequired,\r\n }).isRequired,\r\n scope: PropTypes.shape({\r\n customerId: PropTypes.string.isRequired,\r\n accountId: PropTypes.string.isRequired,\r\n campaignId: PropTypes.string,\r\n adGroupId: PropTypes.string,\r\n token: PropTypes.string.isRequired,\r\n levelAt: PropTypes.string.isRequired,\r\n }).isRequired,\r\n recommendationType: PropTypes.string,\r\n // eslint-disable-next-line react/forbid-prop-types, react/require-default-props\r\n parentScenario: PropTypes.object,\r\n el: PropTypes.string.isRequired,\r\n guid: PropTypes.string.isRequired, // for adinsight view event log in aria\r\n // eslint-disable-next-line react/forbid-prop-types, react/require-default-props\r\n perfMarker: PropTypes.object,\r\n logExpInfo: PropTypes.func.isRequired,\r\n viewDetails: PropTypes.func.isRequired,\r\n viewSummary: PropTypes.func.isRequired,\r\n initialToolbarConfig: PropTypes.objectOf(PropTypes.any),\r\n toolbar: PropTypes.element,\r\n ccJsData: PropTypes.object, // eslint-disable-line react/forbid-prop-types\r\n };\r\n\r\n static defaultProps = {\r\n recommendationType: null,\r\n initialToolbarConfig: null,\r\n toolbar: null,\r\n filterService: null,\r\n ccJsData: null,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n const { scope } = this.props;\r\n this.currentScenario =\r\n instrumentation.loadCompetitionRecommendation.create(props.parentScenario);\r\n this.currentActivity = this.currentScenario.loadCompetitionRecommendation.create();\r\n\r\n const showAlertHandler = this.props.grid && this.props.grid.showAlertHandler;\r\n this.dataService = new RecommendationService({\r\n scope,\r\n showAlertHandler,\r\n i18n,\r\n currentScenario: this.currentScenario,\r\n currentActivity: this.currentActivity,\r\n odataPath: appConfig.get('adinsight.odata.url'),\r\n permissions,\r\n lcid: pageContext.CultureLcid,\r\n ccJsData: props.ccJsData,\r\n cacheManager,\r\n });\r\n\r\n this.downloadService = null;\r\n if (permissions.IsBAACompetitionRecommendationsDownloadEnabled === true) {\r\n this.downloadService = new RecommendationDownloadService({\r\n alertCenter: window.App.views.alertCenter,\r\n asyncScheduler,\r\n cacheManager,\r\n currentActivity: this.currentActivity,\r\n getODataErrors,\r\n i18n,\r\n odata,\r\n pageContext,\r\n permissions,\r\n });\r\n }\r\n\r\n this.legacyDependencies = {\r\n sessionStore,\r\n i18n,\r\n filterPreferences,\r\n cacheService,\r\n jsdata,\r\n edmCampaign,\r\n dataContextManager,\r\n locationMap,\r\n preferencesService,\r\n appConfig,\r\n constants,\r\n permissions,\r\n };\r\n }\r\n\r\n initializeFilter = () => {\r\n this.filterConfig = getCampaignAdgroupSelectorFilterConfig({\r\n scope: this.props.scope,\r\n entitySchema: {\r\n properties: {},\r\n },\r\n featureName: COMPETITION_RECOMMENDATION_FEATURE_NAME,\r\n i18n,\r\n sessionStore,\r\n preferenceStoreFactory: filterPreferences.getFilters,\r\n cacheService,\r\n dataContextManager,\r\n edmCampaign,\r\n jsdata,\r\n });\r\n this.filterService = new FilterService(this.filterConfig);\r\n }\r\n\r\n render() {\r\n const channel = CHANNEL_TYPES.COMPETITION;\r\n const showDetailsView = this.props.recommendationType\r\n && isRecommendationTypeEnabled(\r\n this.props.recommendationType,\r\n channel,\r\n permissions\r\n );\r\n\r\n const options = {\r\n type: showDetailsView ? this.props.recommendationType : null,\r\n dataService: this.dataService,\r\n downloadService: this.downloadService,\r\n currency: pageContext.AccountCurrencyCode,\r\n scope: this.props.scope,\r\n deps: this.legacyDependencies,\r\n channel,\r\n el: this.props.el,\r\n filterConfig: this.filterConfig,\r\n filterService: this.props.filterService ? this.props.filterService : this.filterService,\r\n currentActivity: this.currentActivity,\r\n readOnly,\r\n context: {\r\n Level: this.props.scope.levelAt,\r\n Source: null,\r\n },\r\n guid: this.props.guid,\r\n perfMarker: this.props.perfMarker,\r\n logExpInfo: this.props.logExpInfo,\r\n };\r\n\r\n if (showDetailsView && appConfig.get('recsrc') !== 'summarypage') {\r\n options.context.Source = urlUtil.getParameter('recsrc');\r\n }\r\n\r\n return (\r\n
\r\n \r\n {showDetailsView ?\r\n :\r\n \r\n }\r\n \r\n\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport const CompetitionRecommendations = withCcJsData(CompetitionRecommendationsView);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { levelAtConstant } from '@bingads-webui-campaign/scope-constants';\r\n\r\nimport { createAsyncToken } from '@bingads-webui-universal/primitive-utilities';\r\nimport { CAMPAIGN_TYPES, CAMPAIGN_TYPES_ENUM_VALUE } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\nimport {\r\n fetchPreferenceForGeneralInsights,\r\n instrumentationSchema,\r\n} from '@bingads-webui-campaign-react/competition-core';\r\nimport { ExpLoggerFactory } from '@bingads-webui/experiment-logger';\r\n\r\nimport { GeneralInsights } from './general-insights';\r\nimport { CompetitionRecommendations } from './competition-recommendations';\r\n\r\nconst CompetitionTabType = {\r\n AuctionInsights: 'auction-insights',\r\n RecommendationSummary: 'recommendation-summary',\r\n RecommendationDetails: 'recommendation-details',\r\n};\r\nconst instrumentation = globalContext.requireDefault('campaignui/feature/instrumentation/index');\r\nconst i18n = globalContext.require('@bingads-webui/i18n-amd-loader!campaignui/feature/competition-tab');\r\nconst appConfig = globalContext.require('component/config/index');\r\nconst preferencesService = globalContext.requireDefault('component/preference/service/index');\r\nconst { getSegPreference, getSegType } = globalContext.require('component/bingads-grid/service/segmentation-preferences');\r\nconst appState = globalContext.require('component/state/index');\r\nconst { fetchSortInfo } = globalContext.require('component/bingads-grid/service/fetch-sortinfo');\r\nconst permissions = appConfig.get('Permissions');\r\nconst { legacyRouter } = globalContext.require('component/legacy-router/index');\r\n\r\nconst auctionInsightsBaseRoute = 'competition';\r\nconst recommendationsBaseRoute = 'competition_recommendation';\r\n\r\nexport class CompetitionTab extends React.Component {\r\n static propTypes = {\r\n scope: PropTypes.shape({\r\n customerId: PropTypes.string.isRequired,\r\n accountId: PropTypes.string.isRequired,\r\n campaignId: PropTypes.string,\r\n adGroupId: PropTypes.string,\r\n campaignName: PropTypes.string,\r\n campaignType: PropTypes.number,\r\n token: PropTypes.string.isRequired,\r\n levelAt: PropTypes.string,\r\n }).isRequired,\r\n viewType: PropTypes.string.isRequired,\r\n el: PropTypes.oneOfType([\r\n PropTypes.string,\r\n PropTypes.object,\r\n ]).isRequired,\r\n grid: PropTypes.shape({\r\n addDateChangeListener: PropTypes.func.isRequired,\r\n showAlertHandler: PropTypes.func.isRequired,\r\n }).isRequired,\r\n recommendationType: PropTypes.string,\r\n customDataService: PropTypes.objectOf(PropTypes.any),\r\n guid: PropTypes.string, // for adinsight view event log in aria\r\n // eslint-disable-next-line react/forbid-prop-types, react/require-default-props\r\n perfMarker: PropTypes.object,\r\n };\r\n\r\n static defaultProps = {\r\n recommendationType: null,\r\n customDataService: null,\r\n guid: null,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.initializeInstrumentation();\r\n this.initializeScope();\r\n\r\n const {\r\n IsABRecTabTitleGroupB,\r\n IsABRecTabTitleEnabled,\r\n } = permissions;\r\n\r\n this.flight = IsABRecTabTitleGroupB ? 'Treatment' : 'Control';\r\n this.recTabTitle = IsABRecTabTitleEnabled ?\r\n i18n.getString('Deeper_Insights_Actions') :\r\n i18n.getString('Deeper_Insights');\r\n this.expLogger = ExpLoggerFactory.createLogger('AB_RecTabTitle');\r\n this.logExpInfo = action => this.expLogger.log(action, this.flight);\r\n }\r\n\r\n state = {\r\n campaignType: this.getCampaignTypeSettingForAuctionInsights(),\r\n };\r\n\r\n componentDidMount() {\r\n const isAuctionInsights = this.props.viewType === CompetitionTabType.AuctionInsights;\r\n const action = `${isAuctionInsights ? auctionInsightsBaseRoute : recommendationsBaseRoute} Tab clicked. ${!isAuctionInsights ? this.recTabTitle : ''}`;\r\n this.logExpInfo(action); // only log once for each tab instance\r\n\r\n this.fetchPreferenceToken =\r\n createAsyncToken(fetchPreferenceForGeneralInsights({\r\n campaignType: this.state.campaignType,\r\n preferencesService,\r\n getSegPreference,\r\n fetchSortInfo,\r\n appState,\r\n getSegType,\r\n }))\r\n .on({\r\n onSuccess: ({ campaignType, gridConfig }) => {\r\n this.setState({\r\n campaignType,\r\n preferenceForGeneralInsights: gridConfig,\r\n });\r\n },\r\n });\r\n }\r\n\r\n componentDidUpdate() {\r\n if (this.state.preferenceForGeneralInsights && this.renderWithPreference) {\r\n this.renderWithPreference.stop();\r\n this.renderWithPreference = null;\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.fetchPreferenceToken) {\r\n this.fetchPreferenceToken.cancel();\r\n }\r\n }\r\n\r\n onCampaignTypeSelectChange = ({ campaignType }) => {\r\n this.activity.trace(\r\n `select campaign type '${campaignType}'`,\r\n 'Competition/onCampaignTypeSelectChange'\r\n );\r\n\r\n if (this.fetchPreferenceToken) {\r\n this.fetchPreferenceToken.cancel();\r\n }\r\n\r\n this.fetchPreferenceToken = createAsyncToken(fetchPreferenceForGeneralInsights({\r\n campaignType,\r\n preferencesService,\r\n getSegPreference,\r\n fetchSortInfo,\r\n appState,\r\n getSegType,\r\n }))\r\n .on({\r\n onSuccess: ({ gridConfig }) => {\r\n this.setState({\r\n campaignType,\r\n preferenceForGeneralInsights: gridConfig,\r\n });\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Get campaign type that will be used in fetching auction insights\r\n * @param {bool} fetch only dynamically fetch campaign type when fetch is true.\r\n * @returns {string} campaign type that will be used in fetching auction insights.\r\n */\r\n getCampaignTypeSettingForAuctionInsights() {\r\n if (this.props.viewType !== CompetitionTabType.AuctionInsights) {\r\n return CAMPAIGN_TYPES.Search;\r\n }\r\n if (this.props.scope.campaignType) {\r\n // pagecontext only has enum value.\r\n const shoppingEnum = CAMPAIGN_TYPES_ENUM_VALUE[CAMPAIGN_TYPES.Shopping];\r\n return this.props.scope.campaignType === shoppingEnum ?\r\n CAMPAIGN_TYPES.Shopping : CAMPAIGN_TYPES.Search;\r\n }\r\n\r\n return null; // when null, will use preference to decide final value.\r\n }\r\n\r\n initializeInstrumentation() {\r\n instrumentation.addScenario(instrumentationSchema);\r\n this.currentScenario = instrumentation.loadCompetitionTab.create();\r\n this.renderWithPreference = this.currentScenario.renderWithPreference.create();\r\n this.renderWithPreference.start();\r\n }\r\n\r\n initializeScope = () => {\r\n const {\r\n accountId,\r\n campaignId,\r\n adGroupId,\r\n } = this.props.scope;\r\n let levelAt = levelAtConstant.ACCOUNT;\r\n let entityIds = [accountId];\r\n\r\n if (adGroupId) {\r\n levelAt = levelAtConstant.ADGROUP;\r\n entityIds = [adGroupId];\r\n } else if (campaignId) {\r\n levelAt = levelAtConstant.CAMPAIGN;\r\n entityIds = [campaignId];\r\n }\r\n this.renderWithPreference.trace(`scope is ${levelAt}`, 'Competition/initializeScope');\r\n\r\n this.scope = _.defaults({}, this.props.scope, {\r\n levelAt,\r\n entityIds,\r\n });\r\n };\r\n\r\n navigate = baseRoute => () => {\r\n let route = baseRoute;\r\n switch (this.scope.levelAt) {\r\n case levelAtConstant.CAMPAIGN:\r\n route = `campaign_${baseRoute}`;\r\n break;\r\n case levelAtConstant.ADGROUP:\r\n route = `adgroup_${baseRoute}`;\r\n break;\r\n case levelAtConstant.ACCOUNT:\r\n default:\r\n break;\r\n }\r\n\r\n legacyRouter.navigateToRoute(route);\r\n }\r\n\r\n route = ({\r\n accountLevelRouteName,\r\n additionalParams,\r\n scope,\r\n }) => {\r\n const {\r\n scope: {\r\n customerId,\r\n accountId,\r\n campaignId,\r\n adGroupId,\r\n },\r\n } = this.props;\r\n\r\n let route = '';\r\n let params = {\r\n customer_id: customerId,\r\n account_id: accountId,\r\n campaign_id: campaignId,\r\n adgroup_id: adGroupId,\r\n };\r\n _.extend(params, additionalParams);\r\n\r\n const levelAt = scope || this.props.scope.levelAt;\r\n switch (levelAt) {\r\n case levelAtConstant.CAMPAIGN:\r\n route = `campaign_${accountLevelRouteName}`;\r\n params = _.omit(params, 'adgroup_id');\r\n break;\r\n case levelAtConstant.ADGROUP:\r\n route = `adgroup_${accountLevelRouteName}`;\r\n break;\r\n case levelAtConstant.ACCOUNT:\r\n default:\r\n route = accountLevelRouteName;\r\n params = _.omit(params, 'campaign_id', 'adgroup_id');\r\n break;\r\n }\r\n\r\n legacyRouter.navigateToRoute(route, params);\r\n }\r\n\r\n\r\n viewSummary = (op) => {\r\n this.route(_.defaults({\r\n accountLevelRouteName: 'competition_recommendation',\r\n }, op));\r\n };\r\n\r\n viewDetails = type => () => {\r\n this.route({\r\n accountLevelRouteName: 'competition_recommendation_details',\r\n additionalParams: { type },\r\n });\r\n };\r\n\r\n render() {\r\n const isAuctionInsights = this.props.viewType === CompetitionTabType.AuctionInsights;\r\n const mainView = isAuctionInsights ?\r\n (\r\n
\r\n {this.state.preferenceForGeneralInsights &&\r\n \r\n }\r\n
\r\n ) : (\r\n
\r\n \r\n
\r\n );\r\n\r\n this.activity = isAuctionInsights ?\r\n this.currentScenario.viewGeneralInsights.create() :\r\n this.currentScenario.viewDeeperInsights.create();\r\n\r\n if (isAuctionInsights && this.state.preferenceForGeneralInsights) {\r\n this.activity.trace(\r\n `render the competition auction insights view with selected campaign type '${this.state.campaignType}'`,\r\n 'Competition/render'\r\n );\r\n } else if (isAuctionInsights) {\r\n this.activity.trace('preference is not back yet for competition auction insights', 'Competition/render');\r\n } else {\r\n this.activity.trace('render the competition recommendation view', 'Competition/render');\r\n }\r\n\r\n return (\r\n
\r\n \r\n {mainView}\r\n
\r\n );\r\n }\r\n}\r\n\r\n","import Backbone from 'backbone';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { CompetitionTab } from './competition-tab';\r\n\r\nexport class CompetitionTabView extends Backbone.View {\r\n initialize(options) {\r\n this.options = options;\r\n }\r\n\r\n render() {\r\n ReactDOM.render(\r\n (\r\n \r\n ), this.el\r\n );\r\n return this;\r\n }\r\n\r\n remove() {\r\n ReactDOM.unmountComponentAtNode(this.el);\r\n return super.remove();\r\n }\r\n}\r\n","import { defer } from 'underscore';\r\nimport { pgridFactory } from '@bingads-webui-campaign/pgrid-factory';\r\nimport { DeterministicWrapperView } from '@bingads-webui/deterministic-wrapper-view';\r\nimport { updateGridQuery } from '@bingads-webui-campaign/summary-grid-helper';\r\nimport { createAuctionInsightPopupFactory } from '@bingads-webui-campaign/auction-insight-popup';\r\nimport { insightPopupContainerId, insertPopoverContainer } from '@bingads-webui-campaign/fluctuation-common';\r\nimport { levelAtConstant } from '@bingads-webui-campaign/scope-constants';\r\n\r\nexport class GeneralInsightsGrid extends DeterministicWrapperView {\r\n viewFactory({\r\n i18n,\r\n newI18n,\r\n serverContext,\r\n scope,\r\n instrumentation,\r\n filterService,\r\n getGridConfig,\r\n getPlugins,\r\n preferenceConfig,\r\n refreshChart,\r\n }) {\r\n this.grid = pgridFactory({\r\n gridConfig: getGridConfig(this),\r\n plugins: getPlugins(this),\r\n preferenceConfig,\r\n });\r\n this.filterService = filterService;\r\n this.refreshChart = refreshChart;\r\n this.gridRemoved = false;\r\n this.newI18n = newI18n;\r\n this.i18n = i18n;\r\n this.serverContext = serverContext;\r\n this.scope = scope;\r\n this.instrumentation = instrumentation;\r\n\r\n filterService.on('filter-state-changed', () => {\r\n if (!this.gridRemoved) {\r\n updateGridQuery(\r\n this.grid.gridView,\r\n this.filterService.getCombinedFilter(), true\r\n );\r\n defer(this.refreshChart);\r\n }\r\n });\r\n\r\n return this.grid.gridView;\r\n }\r\n\r\n renderTrunk() {\r\n this.filterService.initializeCombinedFilterPromise.then(() => {\r\n if (!this.gridRemoved) {\r\n updateGridQuery(\r\n this.grid.gridView,\r\n this.filterService.getCombinedFilter(), true\r\n );\r\n defer(this.refreshChart);\r\n }\r\n });\r\n super.renderTrunk();\r\n }\r\n\r\n remove() {\r\n this.gridRemoved = true;\r\n super.remove();\r\n }\r\n\r\n showInsightsPopup(event) {\r\n if (!this.scope.levelAt === levelAtConstant.CUSTOMER) { return; }\r\n const { currentTarget } = event;\r\n event.stopPropagation();\r\n insertPopoverContainer();\r\n const dateRange = this.grid.dateFilter.getCurrentDateRange();\r\n\r\n createAuctionInsightPopupFactory({\r\n triggerButton: currentTarget,\r\n i18n: this.newI18n,\r\n legacyI18n: this.i18n,\r\n context: this.serverContext,\r\n instrumentation: this.instrumentation,\r\n insightData: {\r\n startDate: dateRange.RangeStartDate,\r\n endDate: dateRange.RangeEndDate,\r\n metric: {\r\n name: this.newI18n.getString(_TL_('Impression share')),\r\n value: currentTarget.getAttribute('data-metric-value'),\r\n },\r\n domainNumber: currentTarget.getAttribute('data-item-index'),\r\n accountIds: this.scope.underPerformingAccountIds,\r\n },\r\n accountsInfo: this.scope.accountsInfo.items,\r\n onDismiss: () => {\r\n if (currentTarget) {\r\n currentTarget.focus();\r\n }\r\n },\r\n }, document.getElementById(insightPopupContainerId));\r\n }\r\n\r\n get className() { return 'general-insights-grid'; }\r\n\r\n get events() {\r\n return {\r\n 'click .performance-metrics-insight .iconba': 'showInsightsPopup',\r\n };\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { defineGridPlugin } from '@bingads-webui/projection-grid-plugin';\r\nimport {\r\n PILL_CONTROL,\r\n saveGeneralInsightsPreferences,\r\n getSegmentationData,\r\n} from '@bingads-webui-campaign-react/competition-core';\r\n\r\nconst preferencesService = globalContext.requireDefault('component/preference/service/index');\r\nconst appState = globalContext.require('component/state/index');\r\nconst { getSegType } = globalContext.require('component/bingads-grid/service/segmentation-preferences');\r\n\r\nexport const pillControlPlugin = defineGridPlugin('pillControl', [\r\n 'gridView',\r\n 'config',\r\n 'toolbar',\r\n 'segment',\r\n], (gridView, config, toolbar, segment) => {\r\n const menuIdSummary = 'button-summary';\r\n const menuIdOvertime = 'button-overtime';\r\n const type = [PILL_CONTROL.overtime, PILL_CONTROL.summary];\r\n const toolbarEditorOvertime = toolbar.gridToolbarGroup.toolbarWithItem(menuIdOvertime);\r\n const toolbarEditorSummary = toolbar.gridToolbarGroup.toolbarWithItem(menuIdSummary);\r\n\r\n const pluginConfig = _.result(config.plugins, 'pillControl', {});\r\n const {\r\n i18n,\r\n segmentationTypesCollection,\r\n pillControlType = PILL_CONTROL.overtime,\r\n } = pluginConfig;\r\n const {\r\n currentActivity,\r\n } = config;\r\n\r\n function updateSegmentMenu(selectedIndex) {\r\n const items = getMenu(selectedIndex); // eslint-disable-line no-use-before-define\r\n toolbarEditorSummary.update(items[PILL_CONTROL.summary]);\r\n toolbarEditorOvertime.update(items[PILL_CONTROL.overtime]);\r\n const segmentationTypes = segmentationTypesCollection[selectedIndex];\r\n let newSegType = getSegmentationData({\r\n activity: currentActivity,\r\n appState,\r\n getSegType,\r\n preferencesService,\r\n });\r\n\r\n\r\n currentActivity.trace(`use segment type ${newSegType}`, 'pillControlPlugin');\r\n if (!_.contains(segmentationTypes, newSegType) && newSegType !== 'None') {\r\n newSegType = 'None';\r\n currentActivity.error(`${newSegType} doesn't exist, fall back to None`, 'pillControlPlugin');\r\n }\r\n segment.setSegmentType(newSegType, segmentationTypes);\r\n }\r\n\r\n function getMenu(selectedIndex) {\r\n const overtimeItem = {\r\n id: 'button-overtime',\r\n iconLeftGlyphName: 'ba-Chart',\r\n text: i18n.getString('Over_Time'),\r\n type: 'button',\r\n classes: selectedIndex === 0 ? ['view-switch-button left', 'selected'] : ['view-switch-button left'],\r\n attrs: selectedIndex === 0 ? {\r\n 'aria-current': true,\r\n } : {},\r\n onClick: () => {\r\n if (selectedIndex !== 0) {\r\n saveGeneralInsightsPreferences({\r\n pillControlType: PILL_CONTROL.overtime,\r\n }, preferencesService);\r\n currentActivity.trace(`click ${PILL_CONTROL.overtime} menu `, 'pillControlPlugin');\r\n updateSegmentMenu(0);\r\n }\r\n },\r\n };\r\n\r\n const summaryItem = {\r\n id: 'button-summary',\r\n iconLeftGlyphName: 'ba-BarChartVertical',\r\n text: i18n.getString('Summary'),\r\n type: 'button',\r\n classes: selectedIndex === 1 ? ['view-switch-button right', 'selected'] : ['view-switch-button right'],\r\n attrs: selectedIndex === 1 ? {\r\n 'aria-current': true,\r\n } : {},\r\n onClick: () => {\r\n if (selectedIndex !== 1) {\r\n saveGeneralInsightsPreferences({\r\n pillControlType: PILL_CONTROL.summary,\r\n }, preferencesService);\r\n currentActivity.trace(`click ${PILL_CONTROL.summary} menu `, 'pillControlPlugin');\r\n updateSegmentMenu(1);\r\n }\r\n },\r\n };\r\n return {\r\n [PILL_CONTROL.summary]: summaryItem,\r\n [PILL_CONTROL.overtime]: overtimeItem,\r\n };\r\n }\r\n\r\n const defaultIndex = _.indexOf(type, pillControlType);\r\n updateSegmentMenu(defaultIndex);\r\n});\r\n\r\n","export const CampaignType = {\r\n None: 0,\r\n Default: 0b1,\r\n Shopping: 0b10,\r\n DynamicSearchAds: 0b100,\r\n Audience: 0b1000,\r\n Smart: 0b10000,\r\n All: 0xFFFF,\r\n};\r\n","import { CAMPAIGN_TYPES } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\nimport { CampaignType } from './const';\r\n\r\nexport const campaignTypeSwitcher = definePlugin => definePlugin('campaignTypeSwitcher', [\r\n 'config',\r\n 'gridView',\r\n 'toolbar',\r\n], ({\r\n plugins: {\r\n campaignTypeSwitcher: {\r\n campaignType,\r\n selectedCampaignType,\r\n onCampaignTypeChange,\r\n i18n,\r\n },\r\n },\r\n} = {}, gridView, toolbar) => {\r\n const menuId = 'dropdown-campaign-type';\r\n const toolbarEditor = toolbar.gridToolbarGroup.toolbarWithItem(menuId);\r\n\r\n const campaignTypeI18nMap = {\r\n [CAMPAIGN_TYPES.Search]: i18n.getString('AuctionInsights_CampaignType_Search'),\r\n [CAMPAIGN_TYPES.Shopping]: i18n.getString('AuctionInsights_CampaignType_Shopping'),\r\n };\r\n const menu = {\r\n id: 'dropdown-campaign-type',\r\n type: 'dropdown',\r\n iconLeftGlyphName: 'ba-OEM',\r\n classes: [],\r\n button: {\r\n text: campaignTypeI18nMap[campaignType],\r\n iconLeft: ['glyphicon', 'toolbar-icon', 'toolbar-icon-left', 'icon-columnchooser-normal'],\r\n iconRight: ['glyphicon', 'toolbar-icon', 'glyphicon-triangle-bottom'],\r\n },\r\n menu: {\r\n items: [{\r\n text: campaignTypeI18nMap[CAMPAIGN_TYPES.Search],\r\n onClick: () => onCampaignTypeChange(CAMPAIGN_TYPES.Search),\r\n iconLeftGlyphName: campaignType === CAMPAIGN_TYPES.Search ? 'ba-CheckMark' : '',\r\n }, {\r\n text: campaignTypeI18nMap[CAMPAIGN_TYPES.Shopping],\r\n onClick: () => onCampaignTypeChange(CAMPAIGN_TYPES.Shopping),\r\n iconLeftGlyphName: campaignType === CAMPAIGN_TYPES.Shopping ? 'ba-CheckMark' : '',\r\n }],\r\n },\r\n };\r\n\r\n // only show campaign type selector when the campaign type is 'All' in global menu\r\n if (selectedCampaignType === CampaignType.All) {\r\n toolbarEditor.update(menu);\r\n } else {\r\n toolbarEditor.update({\r\n id: 'dropdown-campaign-type',\r\n classes: ['hide'],\r\n });\r\n }\r\n});\r\n","import $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { columnChooserPlugin } from '@bingads-webui-campaign/projection-grid-column-chooser';\r\nimport { segmentPlugin } from '@bingads-webui-campaign/projection-grid-segment';\r\nimport { setSegmentationData } from '@bingads-webui-campaign-react/competition-core';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { placeholderPlugin } from '@bingads-webui/projection-grid-placeholder';\r\nimport { dateFilterPlugin } from '@bingads-webui-campaign/projection-grid-date-filter';\r\nimport { segmentationType, adinsightSegmentationTypeEnum } from '@bingads-webui-campaign/segmentation-utilities';\r\nimport { inlineDownloadWithoutFilterstatePlugin } from '@bingads-webui-campaign/projection-grid-inline-download';\r\nimport { clientSideDownload, MAX_NUMBER_OF_ACCOUNT, TOO_MUCH_DATA_TO_DOWNLOAD_ERROR } from '@bingads-webui-campaign/auction-insight-common';\r\nimport { uiBlockerPlugin } from '@bingads-webui/projection-grid-uiblocker';\r\nimport { a11yPlugin } from '@bingads-webui/projection-grid-a11y';\r\nimport { perfMarkerPlugin } from '@bingads-webui-campaign/pgrid-performance-log';\r\nimport { getPGridColumnResizePlugin } from '@bingads-webui-campaign/projection-grid-column-resize-helper';\r\nimport { GENERAL_INSIGHTS_FEATURE_NAMES } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\n\r\nimport { pillControlPlugin } from './pill-control-plugin';\r\nimport { getColumnChooserConfig } from '../general-insights-grid-columns';\r\nimport { campaignTypeSwitcher } from './campaign-type-switch-plugin';\r\n\r\nconst { getSegType, setSegType } = globalContext.require('component/bingads-grid/service/segmentation-preferences');\r\nconst instrumentation = globalContext.require('campaignui/feature/instrumentation/index');\r\nconst appState = globalContext.require('component/state/index');\r\nconst appConfig = globalContext.require('component/config/index');\r\nconst permissions = appConfig.get('Permissions');\r\nconst DownloadView = globalContext.require('campaignui/feature/griddownload/view/baseDownload');\r\n\r\n\r\nconst segmentationTypesForSummaryMenu = [\r\n segmentationType.DayOfWeek,\r\n segmentationType.HourOfDay,\r\n segmentationType.Device,\r\n];\r\nconst segmentationTypesForOverTimeMenu = [\r\n segmentationType.Day,\r\n segmentationType.Week,\r\n segmentationType.Month,\r\n segmentationType.Quarter,\r\n segmentationType.Year,\r\n segmentationType.Device,\r\n];\r\n\r\nexport function getGeneralInsightsPlugins({\r\n campaignType,\r\n selectedCampaignType,\r\n refreshChart,\r\n onCampaignTypeChange,\r\n preferenceServiceLegacy,\r\n auctionInsightPerfMarker,\r\n i18n,\r\n scope,\r\n getView,\r\n preferenceConfig,\r\n showAlertHandler,\r\n p$daterange,\r\n}) {\r\n const columnChooserConfig = getColumnChooserConfig({ campaignType, scope });\r\n columnChooserConfig.customToolbarIcon = 'ba-TripleColumnSolid';\r\n\r\n let noDataText = i18n.getString('AuctionInsights_GridNoDataDetail');\r\n if (scope.levelAt === 'Customer') {\r\n if (scope.accountsInfo.error === TOO_MUCH_DATA_TO_DOWNLOAD_ERROR) {\r\n noDataText = i18n.getString('AuctionInsights_GridNoDataDetail_TooMuchDataError');\r\n } else if (scope.accountsInfo.totalCount > MAX_NUMBER_OF_ACCOUNT) {\r\n noDataText = i18n.getString('AuctionInsights_GridNoDataDetail_ExceedMaxNum', { maxNumberOfAccount: MAX_NUMBER_OF_ACCOUNT });\r\n }\r\n }\r\n\r\n return _.compact([{\r\n // For accurate grid init latency, PerfMarkerPlugin should be the first plugin to load.\r\n plugin: perfMarkerPlugin,\r\n config: {\r\n appConfig,\r\n marker: auctionInsightPerfMarker,\r\n },\r\n },\r\n {\r\n plugin: a11yPlugin,\r\n config: { i18n },\r\n },\r\n {\r\n plugin: columnChooserPlugin,\r\n config: columnChooserConfig,\r\n }, {\r\n plugin: segmentPlugin,\r\n config: {\r\n cellTemplates: {\r\n DisplayDomain: 'default',\r\n },\r\n i18n,\r\n permissions,\r\n cultureShortDatePattern: 'M/d/yyyy',\r\n state: appState,\r\n setSegType(name, segType) {\r\n setSegmentationData({\r\n gridName: name,\r\n segType,\r\n setSegType,\r\n preferencesService: preferenceServiceLegacy,\r\n });\r\n _.defer(refreshChart);\r\n },\r\n isOdataActionSource: false,\r\n edm: null,\r\n segmentationTypes: [], // use pill control to dynamic set allowed segmentation types\r\n instrumentation,\r\n getSegType,\r\n },\r\n }, {\r\n plugin: placeholderPlugin,\r\n config: {\r\n container: '.auction-insight-page-container .grid-noresult',\r\n filteredEmptyText: i18n.getString('Grid_NoFilteredRecords'),\r\n text: noDataText,\r\n },\r\n }, {\r\n plugin: dateFilterPlugin,\r\n config: {\r\n state: appState,\r\n addDateChangeListener: _.noop,\r\n p$daterange,\r\n },\r\n }, {\r\n plugin: pillControlPlugin,\r\n config: {\r\n i18n,\r\n pillControlType:\r\n _.chain(preferenceConfig)\r\n .result('query').result('query')\r\n .result('PillControlType')\r\n .value(),\r\n segmentationTypesCollection: [\r\n segmentationTypesForOverTimeMenu,\r\n segmentationTypesForSummaryMenu,\r\n ],\r\n },\r\n }, {\r\n plugin: inlineDownloadWithoutFilterstatePlugin,\r\n config: {\r\n DownloadView,\r\n isAvailable: true,\r\n i18n,\r\n entity: 'AuctionInsight',\r\n customDownloadService: (format, segmentType) => {\r\n clientSideDownload(format, segmentType, getView(), scope, appState, i18n, showAlertHandler);\r\n },\r\n downloadFormats: ['Csv'],\r\n segmentationTypes: adinsightSegmentationTypeEnum,\r\n },\r\n }, {\r\n plugin: uiBlockerPlugin,\r\n config: { el: $('.auction-insight-page-container') },\r\n }, {\r\n plugin: campaignTypeSwitcher,\r\n config: {\r\n campaignType,\r\n selectedCampaignType,\r\n onCampaignTypeChange,\r\n i18n,\r\n },\r\n },\r\n getPGridColumnResizePlugin({\r\n gridName: GENERAL_INSIGHTS_FEATURE_NAMES[campaignType],\r\n preferenceService: preferenceServiceLegacy,\r\n permissions,\r\n }),\r\n ]);\r\n}\r\n","/* eslint-disable import/no-unresolved */\r\n/* eslint-disable import/extensions */\r\nimport _ from 'underscore';\r\nimport { uncheckedInjectionContext as globalContext } from '@bingads-webui-campaign/injection-context';\r\nimport { AuctionInsightService } from '@bingads-webui-campaign/auction-insight-service';\r\nimport { GENERAL_INSIGHTS_FEATURE_NAMES, CAMPAIGN_TYPES } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\nimport { GENERAL_INSIGHTS_DATA_TYPES, getFilterConfig, instrumentationSchema } from '@bingads-webui-campaign-react/competition-core';\r\nimport { FilterService } from '@bingads-webui/filter-service';\r\n\r\nimport { initializeDataSources, getDataSource } from '../general-insights-data-source';\r\nimport { GeneralInsightsGrid } from './general-insights-grid';\r\nimport { getConfig } from './grid-config';\r\nimport { getGeneralInsightsPlugins } from './plugins';\r\n\r\nconst appConfig = globalContext.require('component/config/index');\r\nconst i18n = globalContext.require('@bingads-webui/i18n-amd-loader!campaignui/feature/competition-tab');\r\nconst appState = globalContext.require('component/state/index');\r\nconst dateUtil = globalContext.require('component/humanize/date');\r\nconst sessionStore = globalContext.requireDefault('component/js-data-storage/session-storage');\r\nconst preferenceStoreFactory = globalContext.require('component/bingads-grid/service/filter-preferences').getFilters;\r\nconst cacheService = globalContext.require('Services/CacheService');\r\nconst dataContextManager = globalContext.require('SummaryDataContextManager');\r\nconst edmCampaign = globalContext.requireDefault('component/edm-campaign/index');\r\nconst jsdata = globalContext.require('component/js-data-campaign/index');\r\nconst instrumentation = globalContext.requireDefault('campaignui/feature/instrumentation/index');\r\nconst preferenceServiceLegacy = globalContext.requireDefault('component/preference/service/index');\r\n\r\nconst permissions = appConfig.get('Permissions');\r\n\r\nexport function createGeneralInsightsGrid({\r\n newI18n,\r\n getAdditionalPlugins,\r\n preferenceService,\r\n preferenceConfig,\r\n router,\r\n scope,\r\n context,\r\n serverContext,\r\n auctionInsightPerfMarker,\r\n viewport,\r\n customHeaderOffset,\r\n showAlertHandler,\r\n campaignType,\r\n selectedCampaignType,\r\n onCampaignTypeChange,\r\n refreshChart,\r\n p$daterange,\r\n customizedGenerateSchemaForAdGroupProperty,\r\n customizedGenerateSchemaForCampaignProperty,\r\n generateSchemaForAccountProperty,\r\n}) {\r\n instrumentation.addScenario(instrumentationSchema);\r\n const parentScenario = instrumentation.loadCompetitionTab.create();\r\n const currentScenario = instrumentation.loadGeneralInsights.create(parentScenario);\r\n const currentActivity = currentScenario.loadGeneralInsights.create();\r\n\r\n const dataService = new AuctionInsightService({\r\n scope,\r\n showAlertHandler,\r\n i18n,\r\n currentScenario,\r\n currentActivity,\r\n odataPath: appConfig.get('adinsight.odata.url'),\r\n campaignType: CAMPAIGN_TYPES.Shopping === campaignType ? campaignType : '',\r\n });\r\n\r\n const campaignTypeForQuery = campaignType === CAMPAIGN_TYPES.Shopping ?\r\n \"Enum.CampaignType'Shopping'\" : \"Enum.CampaignType'Default'\";\r\n\r\n const filterConfig = getFilterConfig({\r\n scope,\r\n dataService,\r\n campaignType,\r\n featureName: GENERAL_INSIGHTS_FEATURE_NAMES[campaignType],\r\n existingCampaignFilter: { // todo, some hide logic\r\n CampaignType: {\r\n $eq: campaignTypeForQuery,\r\n },\r\n },\r\n appState,\r\n dateUtil,\r\n sessionStore,\r\n preferenceStoreFactory,\r\n cacheService,\r\n dataContextManager,\r\n edmCampaign,\r\n jsdata,\r\n i18n,\r\n permissions,\r\n customizedGenerateSchemaForAdGroupProperty,\r\n customizedGenerateSchemaForCampaignProperty,\r\n generateSchemaForAccountProperty,\r\n preferenceService,\r\n });\r\n const filterService = new FilterService(filterConfig);\r\n\r\n\r\n initializeDataSources({\r\n dataService,\r\n filterService,\r\n featureName: GENERAL_INSIGHTS_FEATURE_NAMES[campaignType],\r\n afterFindAll: ({ rawData, request }) => {\r\n const { AccountIds } = request;\r\n const requestLog = _.omit(request, 'AccountIds', 'EntityIds');\r\n\r\n if (AccountIds && AccountIds.length !== 0) {\r\n _.extend(requestLog, {\r\n accountAppliedCount: AccountIds.length,\r\n totalAccountCount: scope.accountsInfo.totalCoun9t,\r\n });\r\n currentActivity.trace(`findAll option: ${JSON.stringify(requestLog)}`, 'AuctionInsightService/afterFindAll');\r\n\r\n if (AccountIds.length !== scope.accountsInfo.totalCount) {\r\n currentActivity.trace(\r\n `account filter applied. accounts count: ${scope.accountsInfo.totalCount}, accounts filtered: ${AccountIds.length}`,\r\n 'generalInsight/afterFindAll'\r\n );\r\n }\r\n }\r\n if (rawData.UnderPerformingAccountIds && rawData.UnderPerformingAccountIds.length > 0) {\r\n currentActivity.trace(`Auction insight light bulb rendered. Request: ${JSON.stringify(requestLog)}`, 'generalInsight/afterFindAll');\r\n }\r\n },\r\n });\r\n\r\n const dataSource = getDataSource(GENERAL_INSIGHTS_DATA_TYPES.Grid);\r\n const chartDataSource = getDataSource(GENERAL_INSIGHTS_DATA_TYPES.Chart);\r\n\r\n const gridView = new GeneralInsightsGrid({\r\n filterService,\r\n dataSource,\r\n i18n,\r\n newI18n,\r\n serverContext,\r\n instrumentation,\r\n refreshChart,\r\n getGridConfig: () => getConfig({\r\n scope,\r\n i18n,\r\n campaignType,\r\n filterService,\r\n context,\r\n dataSource,\r\n viewport,\r\n customHeaderOffset,\r\n currentActivity,\r\n currentScenario,\r\n }),\r\n getPlugins: view => getGeneralInsightsPlugins({\r\n campaignType,\r\n selectedCampaignType,\r\n refreshChart,\r\n onCampaignTypeChange,\r\n preferenceService,\r\n auctionInsightPerfMarker,\r\n i18n,\r\n scope,\r\n getView: () => gridView,\r\n preferenceConfig,\r\n preferenceServiceLegacy,\r\n showAlertHandler,\r\n p$daterange,\r\n }).concat(getAdditionalPlugins(view)),\r\n router,\r\n scope,\r\n preferenceConfig,\r\n });\r\n\r\n // todo rename\r\n const { grid } = gridView;\r\n\r\n grid.gridView.on('willUpdate', (changes) => {\r\n if (_.has(changes, 'sortableHeader')) {\r\n const orderby = _.result(changes.query, 'orderby') || _.result(grid.gridView.get('query'), 'orderby');\r\n const { sortableHeader } = changes;\r\n\r\n // since the query-build using the old preferenceservice to fetch the sorting information.\r\n preferenceServiceLegacy.setAtUserLevel({\r\n Name: `WebApp.CampaignUI.${GENERAL_INSIGHTS_FEATURE_NAMES[campaignType]}`,\r\n Data: { sortInfo: { orderby, sortableHeader } },\r\n });\r\n }\r\n });\r\n\r\n filterService.on('filter-state-changed', () => {\r\n grid.gridView.refresh(true);\r\n });\r\n\r\n return {\r\n gridView,\r\n filterConfig,\r\n filterService,\r\n currentScenario,\r\n currentActivity,\r\n chartDataSource,\r\n dataService,\r\n };\r\n}\r\n","import $ from 'jquery';\r\nimport { GENERAL_INSIGHTS_DATA_TYPES } from '@bingads-webui-campaign-react/competition-core';\r\nimport { GENERAL_INSIGHTS_FEATURE_NAMES } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\n\r\nimport { getDataSource } from '../general-insights-data-source';\r\nimport { getColumnsConfig } from '../general-insights-grid-columns';\r\n\r\n\r\nexport function getConfig({\r\n customHeaderOffset,\r\n scope,\r\n i18n,\r\n filterService,\r\n campaignType,\r\n viewport,\r\n currentScenario,\r\n currentActivity,\r\n}) {\r\n const tableName = i18n.getString('Broad_Insights');\r\n const dataSource = getDataSource(GENERAL_INSIGHTS_DATA_TYPES.Grid);\r\n const scrolling = {\r\n header: {\r\n type: 'sticky',\r\n offset: customHeaderOffset || (() => $('nav.navbar-default.navbar-fixed-top').height()),\r\n },\r\n virtualized: true,\r\n attributes: { 'aria-label': i18n.getString('{{tableName}} table header', { tableName }) },\r\n };\r\n\r\n if (viewport) {\r\n scrolling.viewport = viewport;\r\n }\r\n\r\n return {\r\n name: GENERAL_INSIGHTS_FEATURE_NAMES[campaignType],\r\n tableClasses: ['table', 'table-bordered'],\r\n tableAttributes: { 'aria-label': tableName },\r\n isDataFetchManagerSource: true,\r\n dataSource,\r\n filterService,\r\n rows: {\r\n headRows: [\r\n 'column-header-rows',\r\n ],\r\n bodyRows: [\r\n {\r\n type: 'data-rows',\r\n classes: {\r\n 'auction-insight-column-you': ({ DisplayDomain }) => DisplayDomain === 'You',\r\n },\r\n },\r\n ],\r\n },\r\n columns: getColumnsConfig({\r\n scope,\r\n campaignType,\r\n }),\r\n scrolling,\r\n currentScenario,\r\n currentActivity,\r\n i18n,\r\n };\r\n}\r\n","export const TITLE = _TL_('Auto Apply Recommendation Bulk Update Tool');\r\nexport const HINT = _TL_('You can reference the sample payload below to prepare your CSV file to be uploaded.');\r\nexport const DESCRIPTION = _TL_('Please prepare a csv file with three columns \"Account ID\", \"Recommendation Type\" and \"Opt-in status\". Fill up the values of each row following the instructions below.\\nTo avoid naming confusion, suggest following the convention below to name your file each time:\\n\\nAAR_update_yyyy_mm__dd.csv');\r\nexport const UPLOAD_COMFIRM = _TL_('You are trying to make {{number}} updates, please confirm that you will make the change.');\r\n\r\nexport const LIMIT_UPLOAD_NUMBER = 2000;\r\nexport const INSTRUCTION_STRINGS = {\r\n LIMIT: _TL_('Don\\'t include more than {{number}} account id in each individual CSV file.'),\r\n ACCOUNT_ID: _TL_('Column \"Account ID\" requires a numeric value. For example, 35000220 is valid, but B00573KQ is not.'),\r\n RECOMMENDATION_TYPE: _TL_('Column \"Recommendation Type\" requires a valid value that must be selected from the following sample list. Any other texts are not accepted.'),\r\n OPTIN_STATUS: _TL_('Column \"Opt-in status\" requires a \"YES\" or \"NO\" text value. Setting it to \"YES\" means to opt-in, and \"NO\" to opt-out.'),\r\n};\r\nexport const STEP_STRINGS = [\r\n _TL_('Check the file format as well as the content. You may get error message if the format is not in CSV or the content is invalid.'),\r\n _TL_('Upload the CSV file to remote server where we store it temporarily.'),\r\n _TL_('Validate the account list that current user has access to update status for. You will get error prompts if you don\\'t have corresponding access.'),\r\n _TL_('Apply the changes for you.'),\r\n];\r\n\r\nexport const SUPPORT_RECOMMENDATION_TYPE_TITLE = [\r\n 'Create responsive search ads',\r\n 'Create multimedia ads',\r\n 'Fix conversion goal setting issues',\r\n 'Remove negative keyword conflicts',\r\n 'Create conversion goal',\r\n 'Repair missing keyword param issue',\r\n];\r\n\r\nexport const SAMPLE_TABLE_DATA = [\r\n {\r\n accountId: '35000220',\r\n recommendationType: SUPPORT_RECOMMENDATION_TYPE_TITLE[0],\r\n optIn: 'YES',\r\n },\r\n {\r\n accountId: '35000220',\r\n recommendationType: SUPPORT_RECOMMENDATION_TYPE_TITLE[1],\r\n optIn: 'NO',\r\n },\r\n {\r\n accountId: '35000220',\r\n recommendationType: SUPPORT_RECOMMENDATION_TYPE_TITLE[2],\r\n optIn: 'YES',\r\n },\r\n {\r\n accountId: '35000220',\r\n recommendationType: SUPPORT_RECOMMENDATION_TYPE_TITLE[3],\r\n optIn: 'NO',\r\n },\r\n {\r\n accountId: '35000220',\r\n recommendationType: SUPPORT_RECOMMENDATION_TYPE_TITLE[4],\r\n optIn: 'YES',\r\n },\r\n {\r\n accountId: '35000220',\r\n recommendationType: SUPPORT_RECOMMENDATION_TYPE_TITLE[5],\r\n optIn: 'YES',\r\n },\r\n];\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _, { result } from 'underscore';\r\nimport { RecommendationModal, AsyncBulkAarConfirmForm } from '@bingads-webui-campaign-react/recommendation-modal';\r\nimport { UPLOAD_COMFIRM, SUPPORT_RECOMMENDATION_TYPE_TITLE, LIMIT_UPLOAD_NUMBER } from './const';\r\n\r\nexport class BulkAARUpload extends React.PureComponent {\r\n static propTypes = {\r\n classes: PropTypes.objectOf(PropTypes.string).isRequired,\r\n i18n: PropTypes.shape({ getString: PropTypes.func }).isRequired,\r\n newI18n: PropTypes.shape({ getString: PropTypes.func }).isRequired,\r\n dataService: PropTypes.shape({\r\n getBulkAarUploadBlobUrl: PropTypes.func.isRequired,\r\n setBulkAarUploadBlob: PropTypes.func.isRequired,\r\n submitBulkAarOptInStatusTask: PropTypes.func.isRequired,\r\n pollBulkAarOptInStatusTask: PropTypes.func.isRequired,\r\n }).isRequired,\r\n serverContext: PropTypes.objectOf(PropTypes.any).isRequired,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n this.fileInput = React.createRef();\r\n this.state = {\r\n fileName: null,\r\n fileContent: null,\r\n errorMessage: '',\r\n isBulkAarUploadModalOpen: false,\r\n uploadContent: props.newI18n.getString(UPLOAD_COMFIRM, { number: 0 }),\r\n loading: false,\r\n stage: 0,\r\n };\r\n }\r\n\r\n onClick = () => {\r\n this.fileInput.current.value = '';\r\n this.fileInput.current.click();\r\n };\r\n\r\n filter = (element, seenRow, seenAccount) => {\r\n const rowChain = _.chain(element.split(/,/)).map(column => column.trim()).value();\r\n const accountIdRegex = /^[0-9]*$/;\r\n const optInRegex = /\\byes\\b|\\bno\\b/;\r\n\r\n if (rowChain[0] && rowChain[1] && rowChain[2]) {\r\n if (accountIdRegex.test(rowChain[0]) &&\r\n _.contains(SUPPORT_RECOMMENDATION_TYPE_TITLE, rowChain[1]) &&\r\n optInRegex.test(rowChain[2].toLowerCase())) {\r\n seenRow.add(`${rowChain[0]}, ${rowChain[1]}`);\r\n seenAccount.add(rowChain[0]);\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n\r\n parseCsvFromFile = (stream) => {\r\n if (!stream) {\r\n return 0;\r\n }\r\n\r\n const emptyRegex = /^,,$/; // stream should filter out lines containing only commas\r\n const rowCount = _.chain(stream.split(/\\r\\n|\\n/)).filter(row => !emptyRegex.test(row)).filter(row => row.trim()).value().length - 1; // minus 1 for the header row\r\n\r\n const seenRow = new Set();\r\n const seenAccount = new Set();\r\n const optIn = _.chain(stream.split(/\\r\\n|\\n/))\r\n .filter(row => this.filter(row, seenRow, seenAccount))\r\n .value();\r\n\r\n let output = 'Account Id, Recommendation Type, Opt-In\\n';\r\n _.each(optIn, (optInElement) => {\r\n const rowChain = _.chain(optInElement.split(/,/)).map(column => column.trim()).value();\r\n output += `${rowChain[0]}, ${rowChain[1]}, ${rowChain[2]}\\n`;\r\n });\r\n\r\n return {\r\n content: output,\r\n count: optIn.length,\r\n rowCount,\r\n uniqueCount: seenRow.size,\r\n accountCount: seenAccount.size,\r\n };\r\n };\r\n\r\n handleFile = (e) => {\r\n const { files } = e.target;\r\n if (files.length > 0 && files[0]) {\r\n const file = files[0];\r\n if (file.name.endsWith('.csv')) {\r\n this.saveCurrent(file);\r\n\r\n const reader = new FileReader();\r\n reader.readAsText(file);\r\n reader.onload = () => {\r\n const validContent = this.parseCsvFromFile(reader.result);\r\n\r\n if (validContent.count === validContent.rowCount &&\r\n validContent.count === validContent.uniqueCount &&\r\n validContent.accountCount <= LIMIT_UPLOAD_NUMBER) {\r\n this.setState({\r\n isBulkAarUploadModalOpen: true,\r\n uploadContent: this.props.newI18n.getString(UPLOAD_COMFIRM, { number: validContent.count }),\r\n fileContent: validContent.content,\r\n });\r\n } else if (validContent.accountCount > LIMIT_UPLOAD_NUMBER) {\r\n this.saveCurrent(file, this.props.newI18n.getString(_TL_('There are more than {{limit}} account id in the CSV file, please remove some and try again.'), { limit: LIMIT_UPLOAD_NUMBER }));\r\n } else if (validContent.count !== validContent.uniqueCount) {\r\n this.saveCurrent(file, this.props.newI18n.getString(_TL_('There are duplicated records in the CSV file, please fix them and then try again.')));\r\n } else {\r\n this.saveCurrent(file, this.props.newI18n.getString(_TL_('Some of rows in the CSV file have invalid account id, recommendation type name or opt-in status, please fix them and then try again.')));\r\n }\r\n };\r\n } else {\r\n this.saveCurrent(null, this.props.newI18n.getString(_TL_('The format of the file is not supported, please upload CSV file.')));\r\n }\r\n }\r\n };\r\n\r\n saveCurrent = (file, errorMessage = '') => {\r\n this.setState({\r\n fileName: file && `${result(this.props.serverContext, ['CurrentUser', 'Id'])}_${Date.now()}_${file.name}`,\r\n errorMessage,\r\n });\r\n };\r\n\r\n confirmBulkAarUploadModal = () => {\r\n const { fileName, fileContent } = this.state;\r\n this.setState({ loading: true, stage: 0 });\r\n this.props.dataService.getBulkAarUploadBlobUrl({ fileName })\r\n .then(({ data }) => {\r\n if (data) {\r\n return this.props.dataService.setBulkAarUploadBlob(data.value, fileContent);\r\n }\r\n return null;\r\n })\r\n .then((response) => {\r\n if (response.ok) {\r\n this.setState({ stage: 1 });\r\n return this.props.dataService.submitBulkAarOptInStatusTask({ fileName });\r\n }\r\n return null;\r\n })\r\n .then(({ res }) => {\r\n if (res.value) {\r\n this.setState({ stage: 2 });\r\n return this.props.dataService.pollBulkAarOptInStatusTask({ reqId: res.value });\r\n }\r\n return null;\r\n })\r\n .then(() => {})\r\n .finally(() => { this.closeBulkAarUploadModalOpen(); });\r\n };\r\n\r\n closeBulkAarUploadModalOpen = () => {\r\n this.setState({\r\n fileName: '',\r\n isBulkAarUploadModalOpen: false,\r\n uploadContent: this.props.newI18n.getString(UPLOAD_COMFIRM, { number: 0 }),\r\n loading: false,\r\n errorMessage: '',\r\n });\r\n };\r\n\r\n render() {\r\n const {\r\n classes, i18n, newI18n,\r\n } = this.props;\r\n const {\r\n errorMessage, uploadContent,\r\n } = this.state;\r\n\r\n return (\r\n
\r\n \r\n \r\n {\r\n !_.isEmpty(errorMessage) &&\r\n
\r\n {errorMessage}\r\n
\r\n }\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n","import React, { PureComponent } from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport {\r\n TITLE,\r\n INSTRUCTION_STRINGS,\r\n DESCRIPTION,\r\n HINT,\r\n SAMPLE_TABLE_DATA,\r\n LIMIT_UPLOAD_NUMBER,\r\n STEP_STRINGS,\r\n} from './const';\r\nimport { BulkAARUpload } from './bulk-aar-upload';\r\nimport { getBulkAarHeaderStyle } from '../style/bulk-aar-header-style';\r\n\r\nexport class RecommendationBulkAAR extends PureComponent {\r\n static propTypes = {\r\n classes: PropTypes.objectOf(PropTypes.string).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n newI18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n };\r\n\r\n renderColumn(string, newI18n) {\r\n return (\r\n
  • \r\n {newI18n.getString(string, { number: LIMIT_UPLOAD_NUMBER })}\r\n
  • \r\n );\r\n }\r\n\r\n renderSampleTableData(column) {\r\n return (\r\n \r\n {column.accountId}\r\n {column.recommendationType}\r\n {column.optIn}\r\n \r\n );\r\n }\r\n\r\n render() {\r\n const {\r\n i18n, newI18n, classes,\r\n } = this.props;\r\n\r\n const instructionStrings = _.map(INSTRUCTION_STRINGS, string => this.renderColumn(string, newI18n));\r\n const stepStrings = _.map(STEP_STRINGS, string => this.renderColumn(string, newI18n));\r\n const sampleTableData = _.map(SAMPLE_TABLE_DATA, data => this.renderSampleTableData(data));\r\n const sampleTable = (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {sampleTableData}\r\n \r\n
    Account IDRecommendation TypeOpt-in
    \r\n );\r\n\r\n return (\r\n
    \r\n

    \r\n {newI18n.getString(TITLE)}\r\n

    \r\n

    \r\n {newI18n.getString(DESCRIPTION)}\r\n

    \r\n \r\n
    \r\n
    \r\n {newI18n.getString(_TL_('Instructions:'))}\r\n
      \r\n {instructionStrings}\r\n
    \r\n
    \r\n
    \r\n

    \r\n {newI18n.getString(HINT)}\r\n

    \r\n {sampleTable}\r\n
    \r\n
    \r\n
    \r\n {newI18n.getString(_TL_('The bulk update tool follow the steps below to update AAR status:'))}\r\n
      \r\n {stepStrings}\r\n
    \r\n
    \r\n
    \r\n );\r\n }\r\n}\r\n\r\nexport const StyledRecommendationBulkAAR =\r\n withDefaultStyles(RecommendationBulkAAR, getBulkAarHeaderStyle);\r\n","export const getBulkAarHeaderStyle = (_, { palette = {} }) => ({\r\n title: {\r\n fontSize: 20,\r\n fontStyle: 'normal',\r\n fontFamily: 'Segoe UI',\r\n fontWeight: 600,\r\n lineHeight: '27px',\r\n marginTop: 24,\r\n marginLeft: 27,\r\n marginBottom: 14,\r\n },\r\n bulkAarDescription: {\r\n paddingLeft: 27,\r\n marginTop: 20,\r\n marginBottom: 20,\r\n whiteSpace: 'pre-line',\r\n },\r\n bulkAarInstruction: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n marginBottom: 20,\r\n },\r\n bulkAarInstructionStep: {\r\n width: 500,\r\n padding: '10px 27px',\r\n lineHeight: '24px',\r\n borderRight: 'solid 0.5px #979797',\r\n '& ol': {\r\n marginTop: 9,\r\n paddingLeft: 20,\r\n },\r\n },\r\n '@media (max-width: 1100px)': {\r\n bulkAarInstruction: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n marginBottom: 20,\r\n },\r\n bulkAarInstructionStep: {\r\n borderRight: 'none',\r\n },\r\n },\r\n sampleTable: {\r\n width: 600,\r\n margin: '10px 27px',\r\n '& table': {\r\n marginLeft: 20,\r\n borderLeft: '2px solid #fff',\r\n borderRight: '2px solid #fff',\r\n },\r\n '& thead': {\r\n borderTop: '2px solid #979797',\r\n borderBottom: '2px solid #979797',\r\n fontWeight: 600,\r\n },\r\n '& td': {\r\n padding: '4px 8px',\r\n border: '1px solid #EDEBE9',\r\n },\r\n },\r\n bulkAarStep: {\r\n width: 500,\r\n padding: '10px 27px',\r\n paddingRight: 5,\r\n lineHeight: '24px',\r\n '& ol': {\r\n marginTop: 9,\r\n paddingLeft: 20,\r\n },\r\n },\r\n uploadContatiner: {\r\n marginLeft: 27,\r\n marginBottom: 16,\r\n '& #select-file-format': {\r\n marginRight: 6,\r\n fontColot: '#B3B0AD',\r\n height: 32,\r\n width: 220,\r\n },\r\n },\r\n uploadInput: {\r\n display: 'none !important',\r\n },\r\n fileUploadDescription: {\r\n fontSize: 12,\r\n opacity: 0.6,\r\n marginTop: 4,\r\n },\r\n fileRemove: {\r\n border: 'unset',\r\n background: 'unset',\r\n padding: 'unset',\r\n marginLeft: 12,\r\n fontSize: 14,\r\n color: palette.accent,\r\n },\r\n fileInfo: {\r\n display: 'inline',\r\n fontSize: 14,\r\n marginLeft: 5,\r\n },\r\n fileError: {\r\n marginTop: 6,\r\n fontSize: 14,\r\n color: '#A80000',\r\n },\r\n fileFormat: {\r\n marginTop: 6,\r\n fontSize: 14,\r\n color: '#A19F9D',\r\n },\r\n fileInfoContainer: {\r\n display: 'inline-flex',\r\n height: 32,\r\n alignItems: 'center',\r\n },\r\n});\r\n"],"names":["pkg","globalContext","define","Promise","preferencesService","requireDefault","appState","require","getSegType","pillControlPlugin","defineGridPlugin","gridView","config","toolbar","segment","menuId","type","PILL_CONTROL","overtime","summary","toolbarEditor","gridToolbarGroup","toolbarWithItem","pluginConfig","_","plugins","i18n","segmentationTypesCollection","currentActivity","updateSegmentMenu","selectedIndex","update","id","items","text","getString","onClick","index","this","menuName","saveGeneralInsightsPreferences","pillControlType","trace","concat","refresh","getMenu","segmentationTypes","newSegType","getSegmentationData","activity","error","setSegmentType","pillControlTypeInPreference","defaults","query","result","value","chartPlugin","toggleChartToolbar","chart","classes","getPillControlDecorator","run","queryParams","PillControlType","getPillControlTypeFromPreferences","dateUtil","SegmentationPreference","fetchSortInfo","initializeDataSource","_ref","_ref$type","GENERAL_INSIGHTS_DATA_TYPES","Grid","dataService","_ref$filterService","filterService","featureName","afterFindAll","isType","_len","arguments","length","types","Array","_key","Chart","Tile","queryBuilderConfig","decorators","name","GeneralInsightsSegmentationDecorator","commonConfig","isOdataActionSource","deps","state","queryBuilder","QueryBuilderFactory","make","dataSource","connect","entity","options","useDfmCache","DataSourceStore","set","initializeDataSources","_ref2","getDataSource","undefined","get","campaignTypeInLastBuilder","appConfig","_globalContext$requir","Columns","SelectedColumns","permissions","builder","getBuilder","campaignType","scope","performanceColumns","attributesColumns","lockedColumns","isCustomerLevel","levelAtConstant","CUSTOMER","CAMPAIGN_TYPES","Shopping","StoreDisplayNameColumn","ImpressionShareWithInsightColumn","ImpressionShareColumn","OverlapRateColumn","IsAvgPositionDeprecationPhase1Enabled","AbsoluteTopOfPageRateColumn","OutrankingShareColumn","DisplayDomainColumn","IsAvgPositionDeprecationPhase2Enabled","AveragePositionColumn","AboveRateColumn","TopOfPageRateColumn","selectedColumns","ColumnsConfigBuilder","addCategory","category","addColumns","setLockedColumns","setSelectedColumns","getColumnsConfig","getColumnChooserConfig","_ref3","patchQuery","DownloadView","setSegType","instrumentation","campaignTypeItems","key","getPluginsConfig","addDateChangeListener","container","view","onCampaignTypeSelectChange","showCampaignTypeDropdown","showAlertHandler","upperToolbarItems","push","selectedKey","onChange","segmentationTypesForSummaryMenu","segmentationType","segmentationTypesForOverTimeMenu","dateFilter","columnChooser","inlineDownload","isAvailable","customDownloadService","format","segmentType","clientSideDownload","downloadFormats","adinsightSegmentationTypeEnum","placeholder","filteredEmptyText","uiBlocker","el","$","cellTemplates","DisplayDomain","cultureShortDatePattern","segType","setSegmentationData","gridName","edm","pillControl","performanceLogNew","default","toolbarRow","helpers","newPerformanceLogPlugin","GeneralInsightsGrid","_DeterministicWrapper","_classCallCheck","_callSuper","_inherits","_createClass","_this","preferenceConfig","currentScenario","gridPlugins","pgrid","vnext","use","dateFilterPlugin","toolbarPlugin","columnChooserPlugin","uiBlockerPlugin","placeholderPlugin","segmentPlugin","inlineDownloadWithoutFilterstatePlugin","tableClasses","isDataFetchManagerSource","rows","headRows","bodyRows","columns","scrolling","header","offset","height","virtualized","getConfig","merge","grid","create","on","changes","orderby","sortableHeader","setAtUserLevel","Name","Data","sortInfo","toolbarWithName","hide","show","remove","_superPropGet","DeterministicWrapperView","DEVICE_TYPE","PC","SmartPhone","Tablet","GeneralInsightsChartContainer","_React$PureComponent","props","onMetricChange","metric","parentPerfMarker","actionPerfMarker","createChild","willInit","_defineProperty","metricPreferenceName","setState","selectedMetric","onDeviceTypeChange","deviceType","primaryDeviceType","onChartRenderedCallback","perfMarker","isDone","done","mountChartActitivy","mountChart","start","preferences","getGeneralInsightsPreferences","metrics","getLocalizedMetrics","isShoppingCampaignType","METRIC_PREFERENCE_KEY_NAME","Search","METRICS","ImpressionShare","availableMetrics","item","deviceTypes","localizeSegmentationValue","totalCount","data","stop","prevPillControlType","_this$props$data","_this$state","deviceTypeList","raw","segmentData","PerformanceMetrics","SegmentedData","Key","keys","getDeviceTypeList","showDeviceTypeDropdown","selectedMetricItem","selectedDeviceType","_jsxs","className","children","_jsx","DropdownSelector","selectedItem","onSelect","enableArrowKeysSupport","shouldFocusFirstFocusableItemOnMount","AdvisorChartWithMetrics","domains","EmptyChart","React","defaultProps","sessionStore","preferenceStoreFactory","getFilters","cacheService","dataContextManager","edmCampaign","jsdata","isBAACompetitionBSCAuctionInsightsEnabled","IsBAACompetitionBSCAuctionInsightsEnabled","UsedImpressions","replace","formatPercent","used","maximumFractionDigits","minimumFractionDigits","propTypes","PropTypes","isRequired","GeneralInsightsFooter","GeneralInsights","_React$Component","chartData","showChart","usedImpressions","onFilterUIChanged","showToolBar","showLowerToolbar","hideLowerToolbar","onFilterStateChanged","prevState","loadGeneralInsights","parentScenario","campaignTypes","customDataService","AuctionInsightService","odataPath","useShoppingCampaignType","gridFeatureName","GENERAL_INSIGHTS_FEATURE_NAMES","campaignTypeForQuery","filterConfig","getFilterConfig","existingCampaignFilter","CampaignType","$eq","FilterService","chartDataSource","initializeGrid","refreshData","mounted","getUsedImpressions","willFetchData","prevProps","upperToolBar","ops","getUpperToolbar","_this2","refreshChartActivity","refreshChart","then","levelAt","ACCOUNT","willRender","CampaignAdgroupSelectorFilterAgent","BackboneInstanceWrapper","instance","pageContext","filterPreferences","locationMap","asyncScheduler","cacheManager","getODataErrors","odata","constants","SummaryViewLazy","SummaryView","DetailsViewLazy","DetailsView","readOnly","isReadOnly","CompetitionRecommendationsView","initializeFilter","getCampaignAdgroupSelectorFilterConfig","entitySchema","properties","COMPETITION_RECOMMENDATION_FEATURE_NAME","loadCompetitionRecommendation","RecommendationService","lcid","CultureLcid","ccJsData","downloadService","IsBAACompetitionRecommendationsDownloadEnabled","RecommendationDownloadService","alertCenter","window","App","views","legacyDependencies","channel","CHANNEL_TYPES","COMPETITION","showDetailsView","recommendationType","isRecommendationTypeEnabled","currency","AccountCurrencyCode","context","Level","Source","guid","logExpInfo","urlUtil","fallback","_objectSpread","viewSummary","preferencesName","COMPETITION_RECOMMENDATION_PREFERENCES","defaultPageSize","COMPETITION_DEFAULT_PAGE_SIZE","defaultPageNumber","initialToolbarConfig","viewDetails","CompetitionRecommendations","withCcJsData","CompetitionTabType","getSegPreference","legacyRouter","auctionInsightsBaseRoute","recommendationsBaseRoute","CompetitionTab","getCampaignTypeSettingForAuctionInsights","fetchPreferenceToken","cancel","createAsyncToken","fetchPreferenceForGeneralInsights","onSuccess","gridConfig","preferenceForGeneralInsights","initializeScope","_this$props$scope","accountId","campaignId","adGroupId","entityIds","ADGROUP","CAMPAIGN","renderWithPreference","navigate","baseRoute","route","navigateToRoute","accountLevelRouteName","additionalParams","_this$props$scope2","params","customer_id","customerId","account_id","campaign_id","adgroup_id","op","initializeInstrumentation","IsABRecTabTitleGroupB","IsABRecTabTitleEnabled","flight","recTabTitle","expLogger","ExpLoggerFactory","createLogger","action","log","isAuctionInsights","viewType","_ref4","shoppingEnum","CAMPAIGN_TYPES_ENUM_VALUE","addScenario","instrumentationSchema","loadCompetitionTab","mainView","railviewid","viewGeneralInsights","viewDeeperInsights","href","IsBAACompetitionRecommendationsEnabled","CompetitionTabView","_Backbone$View","ReactDOM","Backbone","newI18n","serverContext","getGridConfig","getPlugins","pgridFactory","gridRemoved","updateGridQuery","getCombinedFilter","defer","initializeCombinedFilterPromise","event","currentTarget","stopPropagation","insertPopoverContainer","dateRange","getCurrentDateRange","createAuctionInsightPopupFactory","triggerButton","legacyI18n","insightData","startDate","RangeStartDate","endDate","RangeEndDate","_TL_","getAttribute","domainNumber","accountIds","underPerformingAccountIds","accountsInfo","onDismiss","focus","document","getElementById","insightPopupContainerId","toolbarEditorOvertime","toolbarEditorSummary","_pluginConfig$pillCon","overtimeItem","iconLeftGlyphName","attrs","summaryItem","campaignTypeSwitcher","definePlugin","_ref$plugins$campaign","selectedCampaignType","onCampaignTypeChange","campaignTypeI18nMap","menu","button","iconLeft","iconRight","preferenceServiceLegacy","createGeneralInsightsGrid","getAdditionalPlugins","preferenceService","router","auctionInsightPerfMarker","viewport","customHeaderOffset","p$daterange","customizedGenerateSchemaForAdGroupProperty","customizedGenerateSchemaForCampaignProperty","generateSchemaForAccountProperty","rawData","request","AccountIds","requestLog","accountAppliedCount","totalAccountCount","totalCoun9t","JSON","stringify","UnderPerformingAccountIds","tableName","attributes","tableAttributes","getView","columnChooserConfig","customToolbarIcon","noDataText","TOO_MUCH_DATA_TO_DOWNLOAD_ERROR","MAX_NUMBER_OF_ACCOUNT","maxNumberOfAccount","plugin","perfMarkerPlugin","marker","a11yPlugin","getPGridColumnResizePlugin","getGeneralInsightsPlugins","UPLOAD_COMFIRM","LIMIT_UPLOAD_NUMBER","INSTRUCTION_STRINGS","LIMIT","ACCOUNT_ID","RECOMMENDATION_TYPE","OPTIN_STATUS","STEP_STRINGS","SUPPORT_RECOMMENDATION_TYPE_TITLE","SAMPLE_TABLE_DATA","optIn","BulkAARUpload","fileInput","current","click","filter","element","seenRow","seenAccount","rowChain","split","map","column","trim","test","toLowerCase","add","parseCsvFromFile","stream","emptyRegex","rowCount","row","Set","output","optInElement","content","count","uniqueCount","size","accountCount","handleFile","e","files","target","file","endsWith","saveCurrent","reader","FileReader","readAsText","onload","validContent","isBulkAarUploadModalOpen","uploadContent","number","fileContent","limit","errorMessage","fileName","Date","now","confirmBulkAarUploadModal","loading","stage","getBulkAarUploadBlobUrl","setBulkAarUploadBlob","response","ok","submitBulkAarOptInStatusTask","res","pollBulkAarOptInStatusTask","reqId","finally","closeBulkAarUploadModalOpen","_this$props","_this$state2","uploadContatiner","uploadInput","accept","ref","fileError","RecommendationModal","isOpen","onCancel","closeOnOverlayClick","AsyncBulkAarConfirmForm","title","confirmString","cancelString","onConfirm","RecommendationBulkAAR","_PureComponent","string","instructionStrings","renderColumn","stepStrings","sampleTableData","renderSampleTableData","sampleTable","bulkAarDescription","bulkAarInstruction","bulkAarInstructionStep","bulkAarStep","PureComponent","StyledRecommendationBulkAAR","withDefaultStyles","_ref$palette","palette","fontSize","fontStyle","fontFamily","fontWeight","lineHeight","marginTop","marginLeft","marginBottom","paddingLeft","whiteSpace","display","flexDirection","width","padding","borderRight","margin","borderLeft","borderTop","borderBottom","border","paddingRight","marginRight","fontColot","fileUploadDescription","opacity","fileRemove","background","color","accent","fileInfo","fileFormat","fileInfoContainer","alignItems"],"sourceRoot":""}