export const NAME_MAX_LENGTH = 200;

export const DOWNLOAD_TIMEOUT = 20000;
export const MONITORING_DELAY = 5000;
export const MAX_DOWNLOAD_TRY_REQUESTS = DOWNLOAD_TIMEOUT / MONITORING_DELAY;

export const TABLE_HEADERS = [
  {
    id: 'name',
    label: 'Name',
    isSortable: true,
  },
  {
    id: 'name',
    label: 'Owner',
    isSortable: true,
  },
  {
    id: 'createdAt',
    label: 'Created',
    isSortable: true,
  },
  {
    id: 'updatedAt',
    label: 'Updated',
    isSortable: true,
  },
  {
    id: '',
    label: '',
    isSortable: false,
  },
  {
    id: 'lastDelivery',
    label: 'Last Delivery',
    isSortable: true,
  },
  {
    id: 'nextDelivery',
    label: 'Next Delivery',
    isSortable: true,
  },
  {
    id: '',
    label: '',
    isSortable: false,
  },
];

export const CALENDAR_FILTER_VALUE = {
  today: {
    label: 'Today',
    value: 'TODAY',
  },
  yesterday: {
    label: 'Yesterday',
    value: 'YESTERDAY',
  },
  last7Days: {
    label: 'Last 7 days',
    value: 'LAST_7_DAYS',
  },
  monthToDate: {
    label: 'Month to Date',
    value: 'MONTH_TO_DATE',
  },
  lastMonth: {
    label: 'Last Month',
    value: 'LAST_MONTH',
  },
  last30Days: {
    label: 'Last 30 Days',
    value: 'LAST_30_DAYS',
  },
  thisQuarter: {
    label: 'This Quarter',
    value: 'THIS_QUARTER',
  },
  lastQuarter: {
    label: 'Last Quarter',
    value: 'LAST_QUARTER',
  },
  thisYear: {
    label: 'This Year',
    value: 'THIS_YEAR',
  },
  lastYear: {
    label: 'Last Year',
    value: 'LAST_YEAR',
  },
  custom: 'CUSTOM',
};

export const CALENDAR_FILTER = [
  { label: CALENDAR_FILTER_VALUE.today.label, value: CALENDAR_FILTER_VALUE.today.value },
  { label: CALENDAR_FILTER_VALUE.yesterday.label, value: CALENDAR_FILTER_VALUE.yesterday.value },
  { label: CALENDAR_FILTER_VALUE.last7Days.label, value: CALENDAR_FILTER_VALUE.last7Days.value },
  { label: CALENDAR_FILTER_VALUE.monthToDate.label, value: CALENDAR_FILTER_VALUE.monthToDate.value },
  { label: CALENDAR_FILTER_VALUE.lastMonth.label, value: CALENDAR_FILTER_VALUE.lastMonth.value },
  { label: CALENDAR_FILTER_VALUE.last30Days.label, value: CALENDAR_FILTER_VALUE.last30Days.value },
  { label: CALENDAR_FILTER_VALUE.thisQuarter.label, value: CALENDAR_FILTER_VALUE.thisQuarter.value },
  { label: CALENDAR_FILTER_VALUE.lastQuarter.label, value: CALENDAR_FILTER_VALUE.lastQuarter.value },
  { label: CALENDAR_FILTER_VALUE.thisYear.label, value: CALENDAR_FILTER_VALUE.thisYear.value },
  { label: CALENDAR_FILTER_VALUE.lastYear.label, value: CALENDAR_FILTER_VALUE.lastYear.value },
  { label: 'Custom', value: CALENDAR_FILTER_VALUE.custom },
];

export const RECURRENCE_VALUES = {
  daily: {
    label: 'Daily',
    value: 'DAILY',
  },
  weekly: {
    label: 'Weekly',
    value: 'WEEKLY',
  },
  monthly: {
    label: 'Monthly',
    value: 'MONTHLY',
  },
};

export const RECURRENCE_LIST = [
  {
    label: RECURRENCE_VALUES.daily.label,
    value: RECURRENCE_VALUES.daily.value,
  },
  {
    label: RECURRENCE_VALUES.weekly.label,
    value: RECURRENCE_VALUES.weekly.value,
  },
  {
    label: RECURRENCE_VALUES.monthly.label,
    value: RECURRENCE_VALUES.monthly.value,
  },
];

export const DAY_OPTIONS_WEEKLY = [
  {
    label: 'Monday',
    value: 1,
  },
  {
    label: 'Tuesday',
    value: 2,
  },
  {
    label: 'Wednesday',
    value: 3,
  },
  {
    label: 'Thursday',
    value: 4,
  },
  {
    label: 'Friday',
    value: 5,
  },
  {
    label: 'Saturday',
    value: 6,
  },
  {
    label: 'Sunday',
    value: 7,
  },
];

export const TIME_OPTIONS = [
  {
    label: '12 AM',
    value: 0,
  },
  {
    label: '1 AM',
    value: 1,
  },
  {
    label: '2 AM',
    value: 2,
  },
  {
    label: '3 AM',
    value: 3,
  },
  {
    label: '4 AM',
    value: 4,
  },
  {
    label: '5 AM',
    value: 5,
  },
  {
    label: '6 AM',
    value: 6,
  },
  {
    label: '7 AM',
    value: 7,
  },
  {
    label: '8 AM',
    value: 8,
  },
  {
    label: '9 AM',
    value: 9,
  },
  {
    label: '10 AM',
    value: 10,
  },
  {
    label: '11 AM',
    value: 11,
  },
  {
    label: '12 PM',
    value: 12,
  },
  {
    label: '1 PM',
    value: 13,
  },
  {
    label: '2 PM',
    value: 14,
  },
  {
    label: '3 PM',
    value: 15,
  },
  {
    label: '4 PM',
    value: 16,
  },
  {
    label: '5 PM',
    value: 17,
  },
  {
    label: '6 PM',
    value: 18,
  },
  {
    label: '7 PM',
    value: 19,
  },
  {
    label: '8 PM',
    value: 20,
  },
  {
    label: '9 PM',
    value: 21,
  },
  {
    label: '10 PM',
    value: 22,
  },
  {
    label: '11 PM',
    value: 23,
  },
];

export const DEMAND_SOURCE_FILTER_NAME = 'DEMAND_SOURCE';
export const AD_FORMAT_FILTER_NAME = 'AD_FORMAT';
export const HUB_FILTER_NAME = 'HUB';
export const PLAYER_NAME_FILTER_NAME = 'PLAYER_NAME';
export const PLAYER_ID_FILTER_NAME = 'PLAYER_ID';
export const PLAYER_TYPE_FILTER_NAME = 'PLAYER_TYPE';
export const COUNTRY_FILTER_NAME = 'COUNTRY';
export const DEVICE_FILTER_NAME = 'DEVICE';
export const PLAYER_DOMAIN_FILTER_NAME = 'PLAYER_DOMAIN';
export const EMBED_CODE_VARIANT_FILTER_NAME = 'EMBED_CODE_VARIANT';

export const AD_FORMAT_FILTER_OPTIONS = [
  {
    label: 'Display',
    value: 'DISPLAY',
  },
  {
    label: 'Video',
    value: 'VIDEO',
  },
];

export const DEVICE_FILTER_OPTIONS = [
  {
    label: 'Desktop',
    value: 'DESKTOP',
  },
  {
    label: 'Mobile',
    value: 'MOBILE',
  },
  {
    label: 'Other',
    value: 'OTHER',
  },
];

export const EMBED_CODE_VARIANT_FILTER_OPTIONS = [
  {
    label: 'None',
    value: 'NONE',
  },
  ...[...'0123456789abcdefghijklmnopqrstuvwxyz'].map((item) => ({ label: item.toUpperCase(), value: item })),
];

// key must be equals with value
export const DIMENSIONS = {
  MONTH: {
    label: 'Month',
    value: 'MONTH',
    previewTitle: 'MON YYYY',
  },
  DAY: {
    label: 'Day',
    value: 'DAY',
    previewTitle: 'MON DD YYYY',
  },
  HOUR_OF_DAY: {
    label: 'Hour of day',
    value: 'HOUR_OF_DAY',
    previewTitle: 'Hour',
  },
  HOUR: {
    label: 'Hour',
    value: 'HOUR',
    previewTitle: 'HH MON DD YYYY',
  },
  DEMAND_SOURCE: {
    label: 'Demand Source',
    value: 'DEMAND_SOURCE',
  },
  AD_FORMAT: {
    label: 'Ad format',
    value: 'AD_FORMAT',
  },
  HUB: {
    label: 'Hub',
    value: 'HUB',
  },
  PLAYER_NAME: {
    label: 'Player name',
    value: 'PLAYER_NAME',
  },
  PLAYER_ID: {
    label: 'Player ID',
    value: 'PLAYER_ID',
  },
  PLAYER_TYPE: {
    label: 'Player type',
    value: 'PLAYER_TYPE',
  },
  COUNTRY: {
    label: 'Country',
    value: 'COUNTRY',
  },
  DEVICE: {
    label: 'Device',
    value: 'DEVICE',
  },
  PLAYER_DOMAIN: {
    label: 'Player domain',
    value: 'PLAYER_DOMAIN',
  },
  EMBED_CODE_VARIANT: {
    label: 'Embed code variant',
    value: 'EMBED_CODE_VARIANT',
  },
};

// key must be equals with value
export const METRICS_VALUES = {
  // playerData
  PAGE_LOADS: {
    label: 'Page Loads',
    value: 'PAGE_LOADS',
    tooltip: 'The number of times the player was loaded on a page',
  },
  PLAYER_LOADS: {
    label: 'Player Loads',
    value: 'PLAYER_LOADS',
    tooltip: 'The number of times the player was loaded on an ad blocker free page',
  },
  PLAYER_AD_IMPRESSIONS: {
    label: 'Player Ad Impressions',
    value: 'PLAYER_AD_IMPRESSIONS',
    tooltip: 'The number of times the player was loaded on a page and served at least one ad impression',
  },
  VIEWABLE_PLAYER_LOADS: {
    label: 'Viewable Player Loads',
    value: 'VIEWABLE_PLAYER_LOADS',
    tooltip: 'The number of times the player was loaded on an ad blocker free page and was in view',
  },
  VIEWABLE_PLAYER_AD_IMPRESSIONS: {
    label: 'Viewable Player Ad Impressions',
    value: 'VIEWABLE_PLAYER_AD_IMPRESSIONS',

    tooltip:
      'The number of times the player was loaded on a page and served at least one ad impression which was in view',
  },
  GROSS_PAGE_RPM: {
    label: 'Gross Page RPM',
    value: 'GROSS_PAGE_RPM',

    tooltip:
      'The total (gross) revenue generated by the AnyClip player for every 1,000 player loads, before the platform fee is deducted.',
  },
  NET_PAGE_RPM: {
    label: 'NET Page RPM',
    value: 'NET_PAGE_RPM',

    tooltip:
      'The net revenue generated by the AnyClip player for every 1,000 player loads, after all platform fees and revenue shares are deducted.',
  },
  PLAYER_FILL_RATE: {
    label: 'Player Fill Rate',
    value: 'PLAYER_FILL_RATE',
    tooltip: 'Ratio of player ad impressions to player loads',
  },
  PLAYER_VIEWABILITY: {
    label: 'Player Viewability',
    value: 'PLAYER_VIEWABILITY',
    tooltip: 'Ratio of viewble player loads to all player loads',
  },
  // videoAdData
  VIDEO_AD_IMPRESSIONS: {
    label: 'Video Ad Impressions',
    value: 'VIDEO_AD_IMPRESSIONS',
    tooltip: 'The number of video ads served',
  },
  VIDEO_AD_CLICKS: {
    label: 'Video Ad Clicks',
    value: 'VIDEO_AD_CLICKS',
    tooltip: 'The number of clicks on video ads',
  },
  VIDEO_AD_RPM: {
    label: 'Video Ad RPM',
    value: 'VIDEO_AD_RPM',
    tooltip: 'Ovarall video revenue generated per Video ad served',
  },
  VIDEO_AD_FILL_RATE: {
    label: 'Video Ad Fill Rate',
    value: 'VIDEO_AD_FILL_RATE',
    tooltip: 'Ratio of video ad requests to video ad impressions',
  },
  VIDEO_AD_VIEWEABILITY: {
    label: 'Video Ad Viewability',
    value: 'VIDEO_AD_VIEWEABILITY',
    tooltip: 'Ratio of viewble video ad impressions to all video ad Impressions',
  },
  AD_WATCHED_25: {
    label: '25% ad watched',
    value: 'AD_WATCHED_25',
    tooltip: '25% of an Ad was viewed',
  },
  AD_WATCHED_50: {
    label: '50% ad watched',
    value: 'AD_WATCHED_50',
    tooltip: '50% of an Ad was viewed',
  },
  AD_WATCHED_75: {
    label: '75% ad watched',
    value: 'AD_WATCHED_75',
    tooltip: '75% of an Ad was viewed',
  },
  AD_WATCHED_100: {
    label: '100% ad watched',
    value: 'AD_WATCHED_100',
    tooltip: 'The Ad was viewed completely',
  },
  // displayAdData
  DISPLAY_AD_IMPRESSIONS: {
    label: 'Display Ad Impressions',
    value: 'DISPLAY_AD_IMPRESSIONS',
    tooltip: 'The number of display ads served',
  },
  DISPLAY_AD_RPM: {
    label: 'Display Ad RPM',
    value: 'DISPLAY_AD_RPM',
    tooltip: 'Overall display revenue generated per display ad served',
  },
  DISPLAY_AD_FILL_RATE: {
    label: 'Display Ad Fill Rate',
    value: 'DISPLAY_AD_FILL_RATE',
    tooltip: 'Ratio of display ad requests to display ad impressions',
  },
  DISPLAY_AD_VIEWEABILITY: {
    label: 'Display Ad Viewability',
    value: 'DISPLAY_AD_VIEWEABILITY',
    tooltip: 'Ratio of viewble display ad impressions to all display ad Impressions',
  },
  // revenuesAndFees
  REVENUE_OVERALL_TOTAL: {
    label: 'Overall Revenue, Total',
    value: 'REVENUE_OVERALL_TOTAL',
    tooltip: 'Total revenue from all ad formats before platform fees are deducted',
  },
  REVENUE_OVERALL_VIDEO: {
    label: 'Overall Revenue, Video',
    value: 'REVENUE_OVERALL_VIDEO',
    tooltip: 'Total revenue from video ads before platform fees are deducted',
  },
  REVENUE_OVERALL_DISPLAY: {
    label: 'Overall Revenue, Display',
    value: 'REVENUE_OVERALL_DISPLAY',
    tooltip: 'Total revenue from display ads before platform fees are deducted',
  },
  REVENUE_NET_TOTAL: {
    label: 'Net Revenue, Total',
    value: 'REVENUE_NET_TOTAL',
    tooltip: 'Total revenue across all formats after platform fees and revenue share deductions',
  },
  REVENUE_NET_VIDEO: {
    label: 'Net Revenue, Video',
    value: 'REVENUE_NET_VIDEO',
    tooltip: 'Video ad revenue after platform fees and revenue share deductions',
  },
  REVENUE_NET_DISPLAY: {
    label: 'Net Revenue, Display',
    value: 'REVENUE_NET_DISPLAY',
    tooltip: 'Display ad revenue after platform fees and revenue share deductions',
  },
  REVENUE_PD_TOTAL: {
    label: 'Publisher Demand Revenue, Total',
    value: 'REVENUE_PD_TOTAL',
    tooltip: 'Total revenue generated by your demand sources across all ad formats',
  },
  REVENUE_PD_VIDEO: {
    label: 'Publisher Demand Revenue, Video',
    value: 'REVENUE_PD_VIDEO',
    tooltip: 'Revenue generated by your demand sources from video ads',
  },
  REVENUE_PD_DISPLAY: {
    label: 'Publisher Demand Revenue, Display',
    value: 'REVENUE_PD_DISPLAY',
    tooltip: 'Revenue generated by your demand sources from display ads',
  },
  REVENUE_AD_TOTAL: {
    label: 'AnyClip Demand Revenue, Total',
    value: 'REVENUE_AD_TOTAL',
    tooltip: 'Total revenue generated for you by AnyClip Demand (after revenue share) across all ad formats',
  },
  REVENUE_AD_VIDEO: {
    label: 'AnyClip Demand Revenue, Video',
    value: 'REVENUE_AD_VIDEO',
    tooltip: 'Revenue generated for you by AnyClip Demand from video ads (after revenue share)',
  },
  REVENUE_AD_DISPLAY: {
    label: 'AnyClip Demand Revenue, Display',
    value: 'REVENUE_AD_DISPLAY',
    tooltip: 'Revenue generated for you by AnyClip Demand from display ads (after revenue share)',
  },
  PLATFORM_FEES_TOTAL: {
    label: 'Platform Fees, Total',
    value: 'PLATFORM_FEES_TOTAL',
    tooltip: 'Total platform fees charged to you for delivering ads from your demand sources across all formats',
  },
  PLATFORM_FEES_VIDEO: {
    label: 'Platform Fees, Video',
    value: 'PLATFORM_FEES_VIDEO',
    tooltip: 'Total platform fees charged to you for delivering video ads from your demand sources',
  },
  PLATFORM_FEES_DISPLAY: {
    label: 'Platform Fees, Display',
    value: 'PLATFORM_FEES_DISPLAY',
    tooltip: 'Total platform fees charged to you for delivering dIsplay ads from your demand sources',
  },

  // playerEvents
  CLIP_IMPRESSION: {
    label: 'Clip Impression',
    value: 'CLIP_IMPRESSION',
    tooltip: 'The number of clip plays',
  },
  CLIP_SEEK: {
    label: 'Clip Seek',
    value: 'CLIP_SEEK',
    tooltip: 'The user clicked on the clip progress bar',
  },
  FULLSCREEN: {
    label: 'Fullscreen',
    value: 'FULLSCREEN',
    tooltip: 'The user clicked on the full screen button',
  },
  MUTE: {
    label: 'Mute',
    value: 'MUTE',
    tooltip: 'Every time there is a mute event (automated event as well)',
  },
  PAUSE: {
    label: 'Pause',
    value: 'PAUSE',
    tooltip: 'The number of times the user paused a video',
  },
  PLAY: {
    label: 'Play',
    value: 'PLAY',
    tooltip: 'The number of times the user started a video (excluding autoplay)',
  },
  // clipCompletionRate
  CLIP_WATCHED_25: {
    label: '25% clip watched',
    value: 'CLIP_WATCHED_25',
    tooltip: '25% of a clip was viewed',
  },
  CLIP_WATCHED_50: {
    label: '50% clip watched',
    value: 'CLIP_WATCHED_50',
    tooltip: '50% of a clip was viewed',
  },
  CLIP_WATCHED_75: {
    label: '75% clip watched',
    value: 'CLIP_WATCHED_75',
    tooltip: '75% of a clip was viewed',
  },
  CLIP_WATCHED_100: {
    label: '100% clip watched',
    value: 'CLIP_WATCHED_100',
    tooltip: 'The Clip was viewed completely',
  },
  // adRequests
  DEMAND_AD_REQUESTS_VIDEO: {
    label: 'Demand Ad Requests, Video',
    value: 'DEMAND_AD_REQUESTS_VIDEO',
    tooltip: 'The number of ad requests sent to demand sources for video ads',
  },
  DEMAND_AD_REQUESTS_DISPLAY: {
    label: 'Demand Ad Requests, Display',
    value: 'DEMAND_AD_REQUESTS_DISPLAY',
    tooltip: 'The number of ad requests sent to demand sources for display ads',
  },
  // adOpportunities
  SUPPLY_AD_OPPORTUNITIES_VIDEO: {
    label: 'Supply Ad Opportunities, Video',
    value: 'SUPPLY_AD_OPPORTUNITIES_VIDEO',
    tooltip: 'The number of opportunities where a video ad could have been served',
  },
  SUPPLY_AD_OPPORTUNITIES_DISPLAY: {
    label: 'Supply Ad Opportunities, Display',
    value: 'SUPPLY_AD_OPPORTUNITIES_DISPLAY',
    tooltip: 'The number of opportunities where a display ad could have been served',
  },
};

export const METRICS = {
  playerData: {
    id: 'PLAYER_DATA',
    label: 'Player Data',
    values: [
      METRICS_VALUES.PAGE_LOADS,
      METRICS_VALUES.PLAYER_LOADS,
      METRICS_VALUES.PLAYER_AD_IMPRESSIONS,
      METRICS_VALUES.VIEWABLE_PLAYER_LOADS,
      METRICS_VALUES.VIEWABLE_PLAYER_AD_IMPRESSIONS,
      METRICS_VALUES.GROSS_PAGE_RPM,
      METRICS_VALUES.NET_PAGE_RPM,
      METRICS_VALUES.PLAYER_FILL_RATE,
      METRICS_VALUES.PLAYER_VIEWABILITY,
    ],
  },
  videoAdData: {
    id: 'VIDEO_AD_DATA',
    label: 'Video Ad Data',
    values: [
      METRICS_VALUES.VIDEO_AD_IMPRESSIONS,
      METRICS_VALUES.VIDEO_AD_CLICKS,
      METRICS_VALUES.VIDEO_AD_RPM,
      METRICS_VALUES.VIDEO_AD_FILL_RATE,
      METRICS_VALUES.VIDEO_AD_VIEWEABILITY,
      // hide by BIP-670
      // METRICS_VALUES.AD_WATCHED_25,
      // METRICS_VALUES.AD_WATCHED_50,
      // METRICS_VALUES.AD_WATCHED_75,
      METRICS_VALUES.AD_WATCHED_100,
    ],
  },
  displayAdData: {
    id: 'DISPLAY_AD_DATA',
    label: 'Display Ad Data',
    values: [
      METRICS_VALUES.DISPLAY_AD_IMPRESSIONS,
      METRICS_VALUES.DISPLAY_AD_RPM,
      METRICS_VALUES.DISPLAY_AD_FILL_RATE,
      METRICS_VALUES.DISPLAY_AD_VIEWEABILITY,
    ],
  },
  revenuesAndFees: {
    id: 'REVENUES_AND_FEES',
    label: 'Revenues and Fees',
    values: [
      METRICS_VALUES.REVENUE_OVERALL_TOTAL,
      METRICS_VALUES.REVENUE_OVERALL_VIDEO,
      METRICS_VALUES.REVENUE_OVERALL_DISPLAY,
      METRICS_VALUES.REVENUE_NET_TOTAL,
      METRICS_VALUES.REVENUE_NET_VIDEO,
      METRICS_VALUES.REVENUE_NET_DISPLAY,
      METRICS_VALUES.REVENUE_PD_TOTAL,
      METRICS_VALUES.REVENUE_PD_VIDEO,
      METRICS_VALUES.REVENUE_PD_DISPLAY,
      METRICS_VALUES.REVENUE_AD_TOTAL,
      METRICS_VALUES.REVENUE_AD_VIDEO,
      METRICS_VALUES.REVENUE_AD_DISPLAY,
      METRICS_VALUES.PLATFORM_FEES_TOTAL,
      METRICS_VALUES.PLATFORM_FEES_VIDEO,
      METRICS_VALUES.PLATFORM_FEES_DISPLAY,
    ],
  },
  playerEvents: {
    id: 'PLAYER_EVENTS',
    label: 'Player Events',
    values: [
      METRICS_VALUES.CLIP_IMPRESSION,
      METRICS_VALUES.CLIP_SEEK,
      METRICS_VALUES.FULLSCREEN,
      METRICS_VALUES.MUTE,
      METRICS_VALUES.PAUSE,
      METRICS_VALUES.PLAY,
    ],
  },
  clipCompletionRate: {
    id: 'CLIP_COMPLETION_RATE',
    label: 'Clip Completion Rate',
    values: [
      METRICS_VALUES.CLIP_WATCHED_25,
      METRICS_VALUES.CLIP_WATCHED_50,
      METRICS_VALUES.CLIP_WATCHED_75,
      METRICS_VALUES.CLIP_WATCHED_100,
    ],
  },
  adRequests: {
    id: 'AD_REQUESTS',
    label: 'Demand: Ad Requests',
    values: [METRICS_VALUES.DEMAND_AD_REQUESTS_VIDEO, METRICS_VALUES.DEMAND_AD_REQUESTS_DISPLAY],
  },
  adOpportunities: {
    id: 'AD_OPPORTUNITIES',
    label: 'Supply: Ad Opportunities',
    values: [METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_VIDEO, METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_DISPLAY],
  },
};

export const METRICS_WITH_EXEPTIONS = {
  playerData: {
    ...METRICS.playerData,
    exceptDimensions: [DIMENSIONS.DEMAND_SOURCE.value, DIMENSIONS.AD_FORMAT.value],
    exceptFilters: [DEMAND_SOURCE_FILTER_NAME, AD_FORMAT_FILTER_NAME],
  },
  videoAdData: {
    ...METRICS.videoAdData,
  },
  displayAdData: {
    ...METRICS.displayAdData,
  },
  revenuesAndFees: {
    ...METRICS.revenuesAndFees,
  },
  playerEvents: {
    ...METRICS.playerEvents,
    exceptDimensions: [DIMENSIONS.DEMAND_SOURCE.value, DIMENSIONS.AD_FORMAT.value],
    exceptFilters: [DEMAND_SOURCE_FILTER_NAME, AD_FORMAT_FILTER_NAME],
  },
  clipCompletionRate: {
    ...METRICS.clipCompletionRate,
    exceptDimensions: [DIMENSIONS.DEMAND_SOURCE.value, DIMENSIONS.AD_FORMAT.value],
    exceptFilters: [DEMAND_SOURCE_FILTER_NAME, AD_FORMAT_FILTER_NAME],
  },
  adRequests: {
    ...METRICS.adRequests,
    exceptMetrics: [
      // playerData
      METRICS_VALUES.PAGE_LOADS.value,
      METRICS_VALUES.PLAYER_LOADS.value,
      METRICS_VALUES.PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_LOADS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.GROSS_PAGE_RPM.value,
      METRICS_VALUES.NET_PAGE_RPM.value,
      METRICS_VALUES.PLAYER_FILL_RATE.value,
      METRICS_VALUES.PLAYER_VIEWABILITY.value,
      // playerEvents
      METRICS_VALUES.CLIP_IMPRESSION.value,
      METRICS_VALUES.CLIP_SEEK.value,
      METRICS_VALUES.FULLSCREEN.value,
      METRICS_VALUES.MUTE.value,
      METRICS_VALUES.PAUSE.value,
      METRICS_VALUES.PLAY.value,
      // clipCompletionRate
      METRICS_VALUES.CLIP_WATCHED_25.value,
      METRICS_VALUES.CLIP_WATCHED_50.value,
      METRICS_VALUES.CLIP_WATCHED_75.value,
      METRICS_VALUES.CLIP_WATCHED_100.value,
      // adOpportunities
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_VIDEO.value,
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_DISPLAY.value,
    ],
    selectWithDimensions: [DIMENSIONS.DEMAND_SOURCE.value],
  },
  adOpportunities: {
    ...METRICS.adOpportunities,
    exceptDimensions: [DIMENSIONS.DEMAND_SOURCE.value, DIMENSIONS.AD_FORMAT.value],
    exceptFilters: [DEMAND_SOURCE_FILTER_NAME, AD_FORMAT_FILTER_NAME],
  },
};

export const METRICS_LIST = [
  METRICS_WITH_EXEPTIONS.playerData,
  METRICS_WITH_EXEPTIONS.videoAdData,
  METRICS_WITH_EXEPTIONS.displayAdData,
  METRICS_WITH_EXEPTIONS.revenuesAndFees,
  METRICS_WITH_EXEPTIONS.playerEvents,
  METRICS_WITH_EXEPTIONS.clipCompletionRate,
  METRICS_WITH_EXEPTIONS.adRequests,
  METRICS_WITH_EXEPTIONS.adOpportunities,
];

export const DIMENSIONS_WITH_EXEPTIONS = {
  MONTH: {
    ...DIMENSIONS.MONTH,
  },
  DAY: {
    ...DIMENSIONS.DAY,
  },
  HOUR_OF_DAY: {
    ...DIMENSIONS.HOUR_OF_DAY,
    exceptDimensions: [DIMENSIONS.HOUR.value],
  },
  HOUR: {
    ...DIMENSIONS.HOUR,
    exceptDimensions: [DIMENSIONS.HOUR_OF_DAY.value],
  },
  DEMAND_SOURCE: {
    ...DIMENSIONS.DEMAND_SOURCE,
    exceptMetrics: [
      // playerData
      METRICS_VALUES.PAGE_LOADS.value,
      METRICS_VALUES.PLAYER_LOADS.value,
      METRICS_VALUES.PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_LOADS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.GROSS_PAGE_RPM.value,
      METRICS_VALUES.NET_PAGE_RPM.value,
      METRICS_VALUES.PLAYER_FILL_RATE.value,
      METRICS_VALUES.PLAYER_VIEWABILITY.value,
      // playerEvents
      METRICS_VALUES.CLIP_IMPRESSION.value,
      METRICS_VALUES.CLIP_SEEK.value,
      METRICS_VALUES.FULLSCREEN.value,
      METRICS_VALUES.MUTE.value,
      METRICS_VALUES.PAUSE.value,
      METRICS_VALUES.PLAY.value,
      // clipCompletionRate
      METRICS_VALUES.CLIP_WATCHED_25.value,
      METRICS_VALUES.CLIP_WATCHED_50.value,
      METRICS_VALUES.CLIP_WATCHED_75.value,
      METRICS_VALUES.CLIP_WATCHED_100.value,
      // adOpportunities
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_VIDEO.value,
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_DISPLAY.value,
    ],
    deselectWithMetrics: [
      METRICS_VALUES.DEMAND_AD_REQUESTS_VIDEO.value,
      METRICS_VALUES.DEMAND_AD_REQUESTS_DISPLAY.value,
    ],
  },
  AD_FORMAT: {
    ...DIMENSIONS.AD_FORMAT,
    exceptMetrics: [
      // playerData
      METRICS_VALUES.PAGE_LOADS.value,
      METRICS_VALUES.PLAYER_LOADS.value,
      METRICS_VALUES.PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_LOADS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.GROSS_PAGE_RPM.value,
      METRICS_VALUES.NET_PAGE_RPM.value,
      METRICS_VALUES.PLAYER_FILL_RATE.value,
      METRICS_VALUES.PLAYER_VIEWABILITY.value,
      // playerEvents
      METRICS_VALUES.CLIP_IMPRESSION.value,
      METRICS_VALUES.CLIP_SEEK.value,
      METRICS_VALUES.FULLSCREEN.value,
      METRICS_VALUES.MUTE.value,
      METRICS_VALUES.PAUSE.value,
      METRICS_VALUES.PLAY.value,
      // clipCompletionRate
      METRICS_VALUES.CLIP_WATCHED_25.value,
      METRICS_VALUES.CLIP_WATCHED_50.value,
      METRICS_VALUES.CLIP_WATCHED_75.value,
      METRICS_VALUES.CLIP_WATCHED_100.value,
      // adOpportunities
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_VIDEO.value,
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_DISPLAY.value,
    ],
  },
  HUB: {
    ...DIMENSIONS.HUB,
  },
  PLAYER_NAME: {
    ...DIMENSIONS.PLAYER_NAME,
  },
  PLAYER_ID: {
    ...DIMENSIONS.PLAYER_ID,
  },
  PLAYER_TYPE: {
    ...DIMENSIONS.PLAYER_TYPE,
  },
  COUNTRY: {
    ...DIMENSIONS.COUNTRY,
  },
  DEVICE: {
    ...DIMENSIONS.DEVICE,
  },
  PLAYER_DOMAIN: {
    ...DIMENSIONS.PLAYER_DOMAIN,
  },
  EMBED_CODE_VARIANT: {
    ...DIMENSIONS.EMBED_CODE_VARIANT,
  },
};

export const DIMENSIONS_LIST = [
  DIMENSIONS_WITH_EXEPTIONS.MONTH,
  DIMENSIONS_WITH_EXEPTIONS.DAY,
  DIMENSIONS_WITH_EXEPTIONS.HOUR_OF_DAY,
  DIMENSIONS_WITH_EXEPTIONS.HOUR,
  DIMENSIONS_WITH_EXEPTIONS.DEMAND_SOURCE,
  DIMENSIONS_WITH_EXEPTIONS.AD_FORMAT,
  DIMENSIONS_WITH_EXEPTIONS.HUB,
  DIMENSIONS_WITH_EXEPTIONS.PLAYER_NAME,
  DIMENSIONS_WITH_EXEPTIONS.PLAYER_ID,
  DIMENSIONS_WITH_EXEPTIONS.PLAYER_TYPE,
  DIMENSIONS_WITH_EXEPTIONS.COUNTRY,
  DIMENSIONS_WITH_EXEPTIONS.DEVICE,
  DIMENSIONS_WITH_EXEPTIONS.PLAYER_DOMAIN,
  DIMENSIONS_WITH_EXEPTIONS.EMBED_CODE_VARIANT,
];

export const FILTERS = {
  [DEMAND_SOURCE_FILTER_NAME]: {
    label: 'Demand Source',
    name: DEMAND_SOURCE_FILTER_NAME,
    multiple: true,
    exceptMetrics: [
      // playerData
      METRICS_VALUES.PAGE_LOADS.value,
      METRICS_VALUES.PLAYER_LOADS.value,
      METRICS_VALUES.PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_LOADS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.GROSS_PAGE_RPM.value,
      METRICS_VALUES.NET_PAGE_RPM.value,
      METRICS_VALUES.PLAYER_FILL_RATE.value,
      METRICS_VALUES.PLAYER_VIEWABILITY.value,
      // playerEvents
      METRICS_VALUES.CLIP_IMPRESSION.value,
      METRICS_VALUES.CLIP_SEEK.value,
      METRICS_VALUES.FULLSCREEN.value,
      METRICS_VALUES.MUTE.value,
      METRICS_VALUES.PAUSE.value,
      METRICS_VALUES.PLAY.value,
      // clipCompletionRate
      METRICS_VALUES.CLIP_WATCHED_25.value,
      METRICS_VALUES.CLIP_WATCHED_50.value,
      METRICS_VALUES.CLIP_WATCHED_75.value,
      METRICS_VALUES.CLIP_WATCHED_100.value,
      // adOpportunities
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_VIDEO.value,
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_DISPLAY.value,
    ],
  },
  [AD_FORMAT_FILTER_NAME]: {
    label: 'Ad Format',
    name: AD_FORMAT_FILTER_NAME,
    multiple: true,
    exceptMetrics: [
      // playerData
      METRICS_VALUES.PAGE_LOADS.value,
      METRICS_VALUES.PLAYER_LOADS.value,
      METRICS_VALUES.PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_LOADS.value,
      METRICS_VALUES.VIEWABLE_PLAYER_AD_IMPRESSIONS.value,
      METRICS_VALUES.GROSS_PAGE_RPM.value,
      METRICS_VALUES.NET_PAGE_RPM.value,
      METRICS_VALUES.PLAYER_FILL_RATE.value,
      METRICS_VALUES.PLAYER_VIEWABILITY.value,
      // playerEvents
      METRICS_VALUES.CLIP_IMPRESSION.value,
      METRICS_VALUES.CLIP_SEEK.value,
      METRICS_VALUES.FULLSCREEN.value,
      METRICS_VALUES.MUTE.value,
      METRICS_VALUES.PAUSE.value,
      METRICS_VALUES.PLAY.value,
      // clipCompletionRate
      METRICS_VALUES.CLIP_WATCHED_25.value,
      METRICS_VALUES.CLIP_WATCHED_50.value,
      METRICS_VALUES.CLIP_WATCHED_75.value,
      METRICS_VALUES.CLIP_WATCHED_100.value,
      // adOpportunities
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_VIDEO.value,
      METRICS_VALUES.SUPPLY_AD_OPPORTUNITIES_DISPLAY.value,
    ],
  },
  [HUB_FILTER_NAME]: {
    label: 'Hub',
    name: HUB_FILTER_NAME,
    multiple: true,
  },
  [PLAYER_NAME_FILTER_NAME]: {
    label: 'Player Name',
    name: PLAYER_NAME_FILTER_NAME,
    multiple: true,
  },
  [PLAYER_ID_FILTER_NAME]: {
    label: 'Player ID',
    name: PLAYER_ID_FILTER_NAME,
    multiple: true,
  },
  [PLAYER_TYPE_FILTER_NAME]: {
    label: 'Player Type',
    name: PLAYER_TYPE_FILTER_NAME,
    multiple: true,
  },
  [COUNTRY_FILTER_NAME]: {
    label: 'Country',
    name: COUNTRY_FILTER_NAME,
    multiple: true,
  },
  [DEVICE_FILTER_NAME]: {
    label: 'Device',
    name: DEVICE_FILTER_NAME,
    multiple: true,
  },
  [PLAYER_DOMAIN_FILTER_NAME]: {
    label: 'Player Domain',
    name: PLAYER_DOMAIN_FILTER_NAME,
    multiple: true,
  },
  [EMBED_CODE_VARIANT_FILTER_NAME]: {
    label: 'Embed Code Variant',
    name: EMBED_CODE_VARIANT_FILTER_NAME,
    multiple: true,
  },
};

export const FILTERS_LIST = [
  FILTERS[DEMAND_SOURCE_FILTER_NAME],
  FILTERS[AD_FORMAT_FILTER_NAME],
  FILTERS[HUB_FILTER_NAME],
  FILTERS[PLAYER_NAME_FILTER_NAME],
  FILTERS[PLAYER_ID_FILTER_NAME],
  FILTERS[PLAYER_TYPE_FILTER_NAME],
  FILTERS[COUNTRY_FILTER_NAME],
  FILTERS[DEVICE_FILTER_NAME],
  FILTERS[PLAYER_DOMAIN_FILTER_NAME],
  FILTERS[EMBED_CODE_VARIANT_FILTER_NAME],
];
