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B,EAAS,SAAW,wBAAwBq4D,cAAuBL,YAAuBC,ICAlOK,EAA0B,CAAChnE,EAAMuT,EAAamzD,EAAcC,EAAKxmE,EAAUyzB,K,MACtF,GAAwB,QAApB,EAAW,OAAXrgB,QAAW,IAAXA,OAAW,EAAXA,EAAaC,eAAO,eAAEyzD,oBAAqB,CAC7C,MAAMF,EAAaN,EAA2BzmE,EAAM0mE,EAAcC,GAClExmE,EAASie,MAAM0oD,EAAaC,EAAYL,EAAcC,EAAK/yC,GAAU,G,mECElE,MAAMszC,EAAiC,EAC5CR,eACAC,MACAxmE,WACAyzB,WACArgB,cACA4zD,e,MASA,MAAMnnE,GAAY,IAAAC,YAAW,EAAAC,aAEvBknE,GAAuC,QAApB,EAAW,OAAX7zD,QAAW,IAAXA,OAAW,EAAXA,EAAaC,eAAO,eAAEyzD,sBAAuBE,EAEhEE,GAAmB,IAAA9mE,UAAQ,KAC/B,MAAMwmE,EAAaN,EAA2BzmE,EAAM0mE,EAAcC,GAElE,OADAxmE,EAASie,MAAM0oD,EAAaC,EAAYL,EAAcC,EAAK/yC,GAAU,IAC9DmzC,CAAU,GAChB,CAAC5mE,EAAUumE,EAAcC,EAAK3mE,EAAM4zB,IAEvC,OACEwzC,GAAoBC,EAClB,gBAACrC,EAAA,EAAU,CACTE,OAAO,UACPxiE,UAAU,4BACVC,MAAO,CACL+7B,UAAW,OACXv6B,MAAO,OACPmjE,UAAW,aACXtgE,UAAW,SAGb,gBAACo+D,EAAA,EAAc,KACZplE,EAAKkB,UAAU,gOAGlB,IACL,EAGHgmE,EAA+BtjE,aAAe,CAC5CujE,UAAU,GAGL,MAAMI,GAAyB,IAAA/nC,iBAAgB0nC,E","sources":["../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/use-impulse.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/use-is-mounted.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/validated-budget.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/validated-conversion-goals.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/validated-conversion-goals-selector.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/validated-fabric-controls.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/validated-listing-groups.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/validated-location-target-setting.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/location-target-setting-panel.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/audience-signal-panel.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/server-validated-url-options-parameters.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-controls/src/video-panel.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-layout/src/styles/step-base-layout-footer-styles.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-layout/src/step-base-layout-footer.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-layout/src/styles/step-base-layout-styles.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-layout/src/step-base-layout.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-layout/src/styles/step-base-modal-footer-styles.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-layout/src/step-base-modal-footer.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-layout/src/styles/step-base-modal-layout-styles.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-layout/src/step-base-modal-layout.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-logger/src/helper.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-logger/src/constants.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-logger/src/step-flow-provider-with-context.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-logger/src/basic-step-logger.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-logger/src/step-logger.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-logger/src/wizard-step-logger.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-logger/src/single-step-logger.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-machine/src/wizard-events.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-machine/src/step-events.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-machine/src/debug.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-machine/src/wizard-state-machine.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-machine/src/step-state-machine.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard-machine-capi/index.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/styles/wizard-styles.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/shared/use-is-mounted.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/shared/step-repository.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/wizard/use-wizard-state.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/styles/get-step-progress-item-glyphicon.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/styles/footer-style-overrides.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/wizard/multi-step-layout.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/wizard/single-step-layout.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/wizard/wizard.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/shared/use-navigation-confirmation-prompt.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/shared/use-exit-without-saving-confirmation.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/shared/use-window-confirm.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/shared/step-loading-shell.js","../../../node_modules/@bingads-webui-campaign-react/step-wizard/src/shared/no-data-step-repository.js","../../../node_modules/@bingads-webui-campaign-react/stock-image-filter/src/shutter-stock/shutter-stock-filter.js","../../../node_modules/@bingads-webui-campaign-react/stock-image-filter/src/shutter-stock/shutter-stock-filter-schema.js","../../../node_modules/@bingads-webui-campaign-react/stock-image-filter/src/stock-filter.js","../../../node_modules/@bingads-webui-campaign-react/store-select/styles/get-store-style.js","../../../node_modules/@bingads-webui-campaign-react/store-select/src/store-select-view.js","../../../node_modules/@bingads-webui-campaign-react/store-select/src/store-select-creation.js","../../../node_modules/@bingads-webui-campaign-react/store-select/src/utils.js","../../../node_modules/@bingads-webui-campaign-react/store-select/src/store-select-loading.js","../../../node_modules/@bingads-webui-campaign-react/store-select/src/store-select-container.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/ad-creation-preview.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/store.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/product-collections.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/local-inventory.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/products.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/feeds.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/location-targeting.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/age-range-targeting.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/gender-targeting.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/ad-schedule.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/ad-schedule-with-bid-adjustments.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/common-targeting.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/audience.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/interest.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/predictive-targeting.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/start-end-dates.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/ad-distribution.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/keywords.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/genre.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/disclaimer.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/company-name-targeting.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/job-function-targeting.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/industry-targeting.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/conversion-goals.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/budget.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/bid-strategy.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/bid-value.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/languages.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/audience-signal.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/images.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/store-info.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/auto-gen-assets.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/url-options.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/bid-target.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/final-url-expansions.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/search-themes.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/cost-per-sale.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/url-rules.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/new-customer-acquisition.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/videos.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/summary-page-component-types.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/ad-creation.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/text-asset-summary.js","../../../node_modules/@bingads-webui-campaign-react/summary-page/src/components/properties/listing-group.js","../../../node_modules/@bingads-webui-campaign-react/table-page-container/src/virtual-scrollbar.js","../../../node_modules/@bingads-webui-campaign-react/table-page-container/src/scrollbar.js","../../../node_modules/@bingads-webui-campaign-react/table-page-container/src/table-page-container.js","../../../node_modules/@bingads-webui-campaign-react/table-page-state-manager/src/index.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/third-party-measurement.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/third-party-measurement-V2.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/third-party-measurement-container.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/third-party-measurement-backbone-view.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/model/campaign-third-party-vendor-setting.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/styles/third-party-measurement-setting-styles.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/component/warning-message.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/component/account-linked-status-label.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/component/custom-config.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/component/third-party-vendor-setting.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/component/third-party-measurement-remove-all-button.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/third-party-measurement-V3.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/view/component/use-account-property-repository.js","../../../node_modules/@bingads-webui-campaign-react/third-party-measurement/src/model/verified-tracking-setting.js","../../../node_modules/@bingads-webui-campaign-react/thumbs-up-down/src/styles/thumbs-up-down.js","../../../node_modules/@bingads-webui-campaign-react/thumbs-up-down/src/styles/feedback-form.js","../../../node_modules/@bingads-webui-campaign-react/thumbs-up-down/src/feedback-form.js","../../../node_modules/@bingads-webui-campaign-react/thumbs-up-down/src/styles/thank-you-icon.js","../../../node_modules/@bingads-webui-campaign-react/thumbs-up-down/src/thank-you-content.js","../../../node_modules/@bingads-webui-campaign-react/thumbs-up-down/src/ocv-data-source.js","../../../node_modules/@bingads-webui-campaign-react/thumbs-up-down/src/thumbs-up-down.js","../../../node_modules/@bingads-webui-campaign-react/toolbar-plugin/src/plugin.js","../../../node_modules/@bingads-webui-campaign-react/summary-diagnostic/src/constants.ts","../../../node_modules/@bingads-webui-campaign-react/summary-diagnostic/src/diagnostic-bar.tsx","../../../node_modules/@bingads-webui-campaign-react/summary-diagnostic/src/summary-diagnostic.tsx","../../../node_modules/@bingads-webui-campaign-react/target-cpa-warning-banner/src/utils.ts","../../../node_modules/@bingads-webui-campaign-react/target-cpa-warning-banner/src/log-target-cpa-check-on-save.tsx","../../../node_modules/@bingads-webui-campaign-react/target-cpa-warning-banner/src/target-cpa-warning-banner.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\r\n\r\nexport const useImpulse = (activate) => {\r\n  const [isActive, setIsActive] = useState(false);\r\n  const [isRestarting, setIsRestarting] = useState(false);\r\n\r\n  if (activate) {\r\n    if (isActive && !isRestarting) {\r\n      setIsRestarting(true);\r\n      setIsActive(false);\r\n    } else if (!isActive) {\r\n      setIsActive(true);\r\n    }\r\n  }\r\n  useEffect(() => {\r\n    if (isRestarting && !isActive) {\r\n      setIsActive(true);\r\n      setIsRestarting(false);\r\n    }\r\n  }, [isActive, isRestarting]);\r\n\r\n  return isActive;\r\n};\r\n","import { useEffect, useRef } from 'react';\r\n\r\nexport const useIsMounted = () => {\r\n  const isMountedRef = useRef(false);\r\n  useEffect(() => {\r\n    isMountedRef.current = true;\r\n    return () => {\r\n      isMountedRef.current = false;\r\n    };\r\n  }, []);\r\n\r\n  return isMountedRef;\r\n};\r\n","import _ from 'underscore';\r\nimport React, { useCallback, useContext, useState, useEffect, useMemo } from 'react';\r\nimport { Text } from '@fluentui/react';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport PropTypes from 'prop-types';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { LegacyBudget } from '@bingads-webui-campaign-react/legacy-budget';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { BudgetSuggestionDialog, useBudgetSuggestionRepository, MODE } from '@bingads-webui-campaign-react/budget-suggestion-v2';\r\nimport { CampaignTypes } from '@bingads-webui-campaign-react/constants';\r\n// eslint-disable-next-line\r\nimport _bingads_webui_static_legacy_page_context from '@bingads-webui-static-legacy/page-context';\r\n// eslint-disable-next-line\r\nconst { BudgetRange } = _bingads_webui_static_legacy_page_context;\r\n\r\nconst LegacyBudgetWithCustomValidation = ({\r\n  campaignId, showBudgetSuggestion, isCampaignSetting, currency, validationProps, updateValidation, campaign, isPremiumStreaming, ...restProps\r\n}) => {\r\n  const { data } = validationProps;\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const activity = useContext(ActivityContext);\r\n\r\n  const { DailyRange } = BudgetRange || {};\r\n\r\n  const budgetSuggestion = useMemo(() => ({\r\n    Currency: currency,\r\n    GlobalMaximumBudget: { DailyBudget: DailyRange.CeilingValue ? DailyRange.CeilingValue : 3000000 },\r\n    GlobalMinimumBudget: { DailyBudget: DailyRange.FloorValue ? DailyRange.FloorValue : 0.05 },\r\n  }), [currency, DailyRange.CeilingValue, DailyRange.FloorValue]);\r\n\r\n  const onChange = useCallback((newData, newIsValid) => {\r\n    updateValidation(newIsValid ? [] : [i18n.getString(_TL_('Legacy Budget has validation errors'))], { Budget: newData });\r\n    if (activity) {\r\n      // signal activity to parent\r\n      activity.signal(`onLegacyBudgetChange - ${JSON.stringify(newData.Amount)} - isValid: ${newIsValid}}`);\r\n    }\r\n  }, [i18n, updateValidation, activity]);\r\n\r\n  const [budgetSuggestionData, setBudgetSuggestionData] = useState(null);\r\n  const {\r\n    loadBudget,\r\n  } = useBudgetSuggestionRepository({\r\n    campaignId,\r\n    mode: MODE.EDITING,\r\n    campaignType: CampaignTypes.PerformanceMax,\r\n    currency,\r\n  });\r\n\r\n\r\n  useEffect(() => {\r\n    if (showBudgetSuggestion && isCampaignSetting) {\r\n      loadBudget({ campaign: {}, assetGroup: {} }).then((datas) => {\r\n        setBudgetSuggestionData(datas);\r\n      }).finally(() => {\r\n      });\r\n    }\r\n  }, [isCampaignSetting, loadBudget, showBudgetSuggestion]);\r\n\r\n  return (\r\n    <div>\r\n      <div className=\"budget-title-container\" style={{ marginBottom: 10, fontWeight: 600 }}>\r\n        <Text>{i18n.getString(_TL_('Daily budget'))}</Text>\r\n        <HelpPopup\r\n          topic={isPremiumStreaming ? 'pop_BA_PremiumStreaming_Budget' : 'pop_BA_CampaignCreate_Budget_SharedBudget'}\r\n          aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: i18n.getString(_TL_('Campaign budget')) })}\r\n        />\r\n      </div>\r\n      <LegacyBudget\r\n        level=\"campaign\"\r\n        campaignId={campaignId}\r\n        onChange={onChange}\r\n        budget={data.Budget}\r\n        {...restProps}\r\n        i18n={i18n}\r\n      />\r\n\r\n      {/* will check Delivery Status in campaign when MT added */}\r\n      {/* {showBudgetSuggestion && (data.DeliveryStatus === 'BudgetSuggestions' || 'BudgetSuggestions' in data.DeliveryStatusDetails) && isCampaignSetting && */}\r\n      {showBudgetSuggestion &&\r\n      isCampaignSetting &&\r\n      !_.isEmpty(budgetSuggestionData) &&\r\n      <BudgetSuggestionDialog\r\n        campaignId={campaignId}\r\n        budget={data.Budget}\r\n        currency={currency}\r\n        onBudgetChange={onChange}\r\n        i18n={i18n}\r\n        activity={activity}\r\n        campaign={campaign.data}\r\n        minBudget={budgetSuggestion.GlobalMinimumBudget.DailyBudget}\r\n        maxBudget={budgetSuggestion.GlobalMaximumBudget.DailyBudget}\r\n        {...restProps}\r\n      />\r\n     }\r\n    </div>\r\n\r\n  );\r\n};\r\n\r\nLegacyBudgetWithCustomValidation.propTypes = {\r\n  campaignId: PropTypes.string.isRequired,\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      Budget: PropTypes.shape({\r\n        Amount: PropTypes.number,\r\n      }),\r\n      DeliveryStatus: PropTypes.string,\r\n      DeliveryStatusDetails: PropTypes.arrayOf(PropTypes.string),\r\n    }),\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  showBudgetSuggestion: PropTypes.bool,\r\n  isCampaignSetting: PropTypes.bool,\r\n  isPremiumStreaming: PropTypes.bool,\r\n  currency: PropTypes.string,\r\n  campaign: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n    }),\r\n  }),\r\n};\r\n\r\nLegacyBudgetWithCustomValidation.defaultProps = {\r\n  showBudgetSuggestion: false,\r\n  isCampaignSetting: false,\r\n  isPremiumStreaming: false,\r\n  currency: 'USD',\r\n  campaign: {\r\n    data: {},\r\n  },\r\n};\r\n\r\nexport const ValidatedLegacyBudget = withCustomValidation(LegacyBudgetWithCustomValidation);\r\n\r\n","import { isEqual } from 'underscore';\r\nimport React, { useCallback, useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@fluentui/react';\r\nimport { buildLegacyI18n } from '@bingads-webui/build-legacy-i18n';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { useP$DaterangeDefault, ConversionGoalKeyToStringMapping } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport {\r\n  ConversionGoalSelector,\r\n} from '@bingads-webui-campaign-react/goal-selector';\r\nimport { LearnMoreLink } from '@bingads-webui-campaign-react/help';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { paginationStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nexport const getConversionGoalStyles = (_, theme) => ({\r\n  ConversionGoalSelectorContainer: {\r\n    ...paginationStyle(theme),\r\n    '& .list-selector-container': {\r\n      width: 468,\r\n    },\r\n  },\r\n});\r\n\r\nconst ConversionGoalsWithCustomValidation = ({ validationProps, updateValidation, ...restProps }) => {\r\n  const { data: conversionGoalsData } = validationProps;\r\n  const { conversionGoals = {} } = conversionGoalsData;\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const classes = useDefaultStyles(getConversionGoalStyles);\r\n\r\n  const activity = useContext(ActivityContext);\r\n\r\n  const legacyI18n = useMemo(() => buildLegacyI18n(\r\n    i18n,\r\n    [ConversionGoalKeyToStringMapping]\r\n  ), [i18n]);\r\n  const $dataRange = useP$DaterangeDefault();\r\n\r\n  const onChange = useCallback((changedData) => {\r\n    const newData = {\r\n      conversionGoals: {\r\n        ...conversionGoalsData.conversionGoals,\r\n        ...changedData,\r\n      },\r\n    };\r\n\r\n    updateValidation([], isEqual(newData, conversionGoalsData) ? conversionGoalsData : newData);\r\n\r\n    if (activity) {\r\n      activity.signal(`onConversionGoalsChange - ${JSON.stringify(newData)}`);\r\n    }\r\n  }, [conversionGoalsData, updateValidation, activity]);\r\n  const campaignConversionGoal = useMemo(() => ({\r\n    Goals: conversionGoals.originalConversionGoals,\r\n  }), [conversionGoals.originalConversionGoals]);\r\n\r\n  return (conversionGoals && conversionGoals.goalScopeSelection ?\r\n    <div className={classes.ConversionGoalSelectorContainer}>\r\n      <div className=\"conversion-goal-label-container\" style={{ marginBottom: 10 }}>\r\n        <Text>{i18n.getString(_TL_('Select which conversions are included in the Conversion columns for this campaign and used for optimizing your bid strategy. Updating this setting will override the “Include in conversions” setting made at the account level.'))}</Text>\r\n        <LearnMoreLink\r\n          linkText={i18n.getString(_TL_('Learn more'))}\r\n          topic=\"app54814\"\r\n        />\r\n      </div>\r\n      <ConversionGoalSelector\r\n        {...restProps}\r\n        i18n={legacyI18n}\r\n        isSelectorEnabled\r\n        pageSize={10}\r\n        isMultiMode\r\n        isHideSaveBar\r\n        $dataRange={$dataRange}\r\n        goalSelection={conversionGoals.goalSelection}\r\n        campaignConversionGoal={campaignConversionGoal}\r\n        goalScopeSelection={conversionGoals.goalScopeSelection}\r\n        onChange={onChange}\r\n        activityLogger={activity}\r\n      />\r\n    </div> : null\r\n  );\r\n};\r\n\r\nConversionGoalsWithCustomValidation.propTypes = {\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      conversionGoals: PropTypes.shape({\r\n        goalSelection: PropTypes.arrayOf(PropTypes.shape({})),\r\n        goalScopeSelection: PropTypes.string,\r\n        originalConversionGoals: PropTypes.arrayOf(PropTypes.shape({})),\r\n      }),\r\n    }),\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  showTrackingStatusIcon: PropTypes.bool, // included in restProps\r\n};\r\n\r\nConversionGoalsWithCustomValidation.defaultProps = {\r\n  showTrackingStatusIcon: false,\r\n};\r\n\r\nexport const ValidatedConversionGoals = withCustomValidation(ConversionGoalsWithCustomValidation);\r\n","import { isEqual } from 'underscore';\r\nimport React, { useCallback, useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { GoalSelector } from '@bingads-webui-campaign-react/goal-selector-v3';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nimport { getConversionGoalStyles } from './validated-conversion-goals';\r\n\r\nconst ConversionGoalsWithCustomValidation = ({\r\n  validationProps, updateValidation, cid, aid, ...restProps\r\n}) => {\r\n  const { data: conversionGoalsData } = validationProps;\r\n  const { conversionGoals = {} } = conversionGoalsData;\r\n  const i18n = useContext(I18nContext);\r\n  const classes = useDefaultStyles(getConversionGoalStyles);\r\n\r\n  const activity = useContext(ActivityContext);\r\n\r\n  const onChange = useCallback((changedData) => {\r\n    const newData = {\r\n      conversionGoals: {\r\n        ...conversionGoalsData.conversionGoals,\r\n        ...changedData,\r\n      },\r\n    };\r\n\r\n    updateValidation([], isEqual(newData, conversionGoalsData) ? conversionGoalsData : newData);\r\n\r\n    if (activity) {\r\n      activity.signal(`onConversionGoalsChange - ${JSON.stringify(newData)}`);\r\n    }\r\n  }, [conversionGoalsData, updateValidation, activity]);\r\n\r\n  const campaignConversionGoal = useMemo(() => ({\r\n    Goals: conversionGoals.originalConversionGoals,\r\n  }), [conversionGoals.originalConversionGoals]);\r\n\r\n  return (conversionGoals && conversionGoals.goalScopeSelection ?\r\n    <div className={classes.ConversionGoalSelectorContainer}>\r\n      <GoalSelector\r\n        {...restProps}\r\n        i18n={i18n}\r\n        cid={cid}\r\n        aid={aid}\r\n        open={open}\r\n        value={conversionGoals.goalSelection}\r\n        campaignConversionGoal={campaignConversionGoal}\r\n        goalScopeSelection={conversionGoals.goalScopeSelection}\r\n        onChange={onChange}\r\n        activityLogger={activity}\r\n      />\r\n    </div> : null\r\n  );\r\n};\r\n\r\nConversionGoalsWithCustomValidation.propTypes = {\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      conversionGoals: PropTypes.shape({\r\n        goalSelection: PropTypes.arrayOf(PropTypes.shape({})),\r\n        goalScopeSelection: PropTypes.string,\r\n        originalConversionGoals: PropTypes.arrayOf(PropTypes.shape({})),\r\n      }),\r\n    }),\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  isCreationWorkflow: PropTypes.bool,\r\n  cid: PropTypes.number.isRequired,\r\n  aid: PropTypes.number.isRequired,\r\n};\r\n\r\nConversionGoalsWithCustomValidation.defaultProps = {\r\n  isCreationWorkflow: false,\r\n};\r\n\r\nexport const ValidatedConversionGoalsScopeSelector = withCustomValidation(ConversionGoalsWithCustomValidation);\r\n","import { withValidation, withError } from '@bingads-webui-react/validation';\r\nimport { TextField } from '@bingads-webui-react/fabric-control';\r\n\r\nexport const ValidatedTextField = withError(withValidation(TextField));\r\n","import { identity, pluck } from 'underscore';\r\nimport React, { useCallback, useMemo, useState, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { DefaultButton, ChoiceGroup, Text, Stack } from '@fluentui/react';\r\nimport { withScope } from '@bingads-webui-react/scope-service';\r\nimport { Glyphicon } from '@bingads-webui-react/primitive';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getRoutePathById, withCampaignSiteMap } from '@bingads-webui-react/with-site-map';\r\nimport { PanelSelector, useTreeViewPanelSelector, fillDataToBulkAddedItem, useAPIsOfListingGroup } from '@bingads-webui-campaign-react/listing-groups-page';\r\nimport { SelectedItem } from '@bingads-webui-campaign-react/pill-item-components';\r\nimport { withStoreFromProviderId } from '@bingads-webui-campaign-react/with-store-details';\r\nimport { useDateRange } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { siteMapPropType } from '@bingads-webui-campaign-react/with-site-map';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\n\r\nexport const getStyles = (_, { palette = {} }) => ({\r\n  productOptions: {\r\n    '& label': {\r\n      padding: 0,\r\n      fontWeight: 'normal',\r\n    },\r\n  },\r\n  buttonContainer: {\r\n    marginTop: 10,\r\n    '& .iconba': {\r\n      fontSize: '16px',\r\n      color: palette.themePrimary,\r\n      marginRight: '8px',\r\n      paddingBottom: '5px', // align to link\r\n    },\r\n  },\r\n  merchantCenterAccountContainer: {\r\n    marginBottom: 12,\r\n  },\r\n  productFilterEditContainer: {\r\n    marginBottom: 12,\r\n  },\r\n});\r\n\r\nconst stackContainerToken = {\r\n  childrenGap: 8,\r\n};\r\n\r\nconst ListingGroupsWithCustomValidation = (props) => {\r\n  const {\r\n    scope, campaignId, i18n, updateValidation, campaignSettings, siteMap, listingGroup, storeDetails, assetGroupId, onClickNavigateToListingGroups,\r\n  } = props;\r\n  const classes = useDefaultStyles(getStyles);\r\n  const {\r\n    isTreeViewSelectorOpen,\r\n    setIsTreeViewSelectorOpen,\r\n    treeViewSelectorColumns,\r\n    treeViewSelectorDimensions,\r\n    treeViewSelectorInitialSelectedItems,\r\n    treeViewSelectorItems,\r\n    treeViewSelectorHeaderText,\r\n    onTreeViewCancel,\r\n    onTreeViewSelectedDimensionChangeWithoutStatistics,\r\n    isTreeViewShimmerEnabled,\r\n    onFilterProduct,\r\n  } = useTreeViewPanelSelector({\r\n    i18n,\r\n    setAllRowRawData: identity,\r\n    scope,\r\n    currentCampaign: {\r\n      Id: campaignId,\r\n      CampaignSettings: [campaignSettings],\r\n    },\r\n    refreshGridData: identity,\r\n    getArguemntsOfUpdateGridDataByCurrentState: identity,\r\n  });\r\n  const { listingGroupGridData } = useAPIsOfListingGroup();\r\n  const options = useMemo(() => [\r\n    {\r\n      key: 'all-products',\r\n      text: i18n.getString(_TL_('All products')),\r\n    },\r\n    {\r\n      key: 'filter-products',\r\n      text: (\r\n        <div>\r\n          {i18n.getString(_TL_('Filtered products'))}\r\n          <HelpPopup\r\n            aria-label=\"Filtered products\"\r\n            topic=\"pop_BA_ProdAdAddFilter\"\r\n          />\r\n        </div >\r\n      ),\r\n    },\r\n  ], [i18n]);\r\n  const isEditing = useMemo(() => !!scope.values.assetGroupId || assetGroupId, [assetGroupId, scope.values.assetGroupId]);\r\n  const [selectedOption, setSelectedOption] = useState(listingGroup && listingGroup.items && listingGroup.items.length > 0 ? options[1] : options[0]);\r\n  const [selectedProducts, setSelectedProducts] = useState(listingGroup && listingGroup.items);\r\n  const [selectedOperand, setSelectedOperand] = useState(listingGroup && listingGroup.operand);\r\n  const [productFilter, setProductFilter] = useState(null);\r\n\r\n  const onChange = useCallback((newData, selectedDimension) => {\r\n    newData.forEach((selectedItem) => {\r\n      fillDataToBulkAddedItem(selectedItem);\r\n    });\r\n    setSelectedProducts(newData);\r\n    setSelectedOperand(selectedDimension);\r\n    setIsTreeViewSelectorOpen(false);\r\n    updateValidation([], {\r\n      listingGroup: {\r\n        items: newData,\r\n        operand: selectedDimension.data.operand,\r\n      },\r\n    });\r\n  }, [setIsTreeViewSelectorOpen, updateValidation]);\r\n  const onOpenPanel = useCallback(() => {\r\n    onFilterProduct();\r\n  }, [onFilterProduct]);\r\n  const onDeleteProduct = useCallback((index) => {\r\n    selectedProducts.splice(index, 1);\r\n    setSelectedProducts([...selectedProducts]);\r\n    updateValidation([], {\r\n      listingGroup: {\r\n        items: [...selectedProducts],\r\n        operand: selectedOperand.data.operand,\r\n      },\r\n    });\r\n  }, [selectedOperand, selectedProducts, updateValidation]);\r\n  const navigateToListingGroupPage = useCallback(() => {\r\n    if (onClickNavigateToListingGroups) {\r\n      onClickNavigateToListingGroups();\r\n    } else {\r\n      scope.save(getRoutePathById(siteMap, 'listing-groups'));\r\n    }\r\n  }, [onClickNavigateToListingGroups, scope, siteMap]);\r\n  const onChangeOptions = useCallback((_, option) => {\r\n    setSelectedOption(option);\r\n\r\n    const hasSelectedProducts = selectedProducts && selectedProducts.length > 0;\r\n    const hasSelectedOperand = selectedOperand && selectedOperand.data && selectedOperand.data.operand;\r\n\r\n    const updatedListingGroup = option.key === 'all-products' || !hasSelectedProducts || !hasSelectedOperand ?\r\n      null : { items: selectedProducts, operand: selectedOperand.data.operand };\r\n\r\n    updateValidation([], { listingGroup: updatedListingGroup });\r\n  }, [selectedOperand, selectedProducts, updateValidation]);\r\n\r\n  const dataRange = useDateRange();\r\n\r\n  useEffect(() => {\r\n    if (isEditing) {\r\n      listingGroupGridData({\r\n        queryOptions: {\r\n          $top: 2,\r\n        },\r\n        entityPath: {\r\n          accountId: scope.values.aid,\r\n          campaignId: scope.values.campaignId || campaignId,\r\n          customerId: scope.values.cid,\r\n          assetGroupId: scope.values.assetGroupId || assetGroupId,\r\n        },\r\n        payload: {\r\n          gridDataParameters: {\r\n            DateRange: {\r\n              StartDate: dataRange.StartDate,\r\n              EndDate: dataRange.EndDate,\r\n            },\r\n          },\r\n        },\r\n      }).then(({ value }) => {\r\n        if (value.length === 1) {\r\n          setProductFilter(i18n.getString('ProductsGrid_Column_All'));\r\n          updateValidation([], {\r\n            productFilter: i18n.getString('ProductsGrid_Column_All'),\r\n          });\r\n        } else if (value.length === 2) {\r\n          setProductFilter(i18n.getString(`ProductsGrid_Column_${value[1].Condition.Operand}`));\r\n          updateValidation([], {\r\n            productFilter: i18n.getString(`ProductsGrid_Column_${value[1].Condition.Operand}`),\r\n          });\r\n        }\r\n      });\r\n    }\r\n    // Remove the functions from dependency to reduce duplicate calls\r\n  }, [scope.values.cid, scope.values.aid, scope.values.uid, dataRange.StartDate, dataRange.EndDate, scope.values.campaignId, scope.values.assetGroupId, isEditing, campaignId, assetGroupId]);\r\n\r\n  return (\r\n    <div>\r\n      {storeDetails && storeDetails.text &&\r\n        <div className={classNames(classes.merchantCenterAccountContainer, 'store-details-container')}>\r\n          <Text style={{ fontWeight: 'bold' }}>\r\n            {i18n.getString(_TL_('Merchant Center account: '))}\r\n          </Text>\r\n          <Text className=\"store-text\">\r\n            {storeDetails.text}\r\n          </Text>\r\n        </div>\r\n      }\r\n      {isEditing && productFilter &&\r\n        <div>\r\n          <div className={classes.productFilterEditContainer}>\r\n            <Text style={{ fontWeight: 'bold' }}>\r\n              {i18n.getString(_TL_('Products:'))}\r\n            </Text>\r\n            <Text >\r\n              {`${i18n.getString(_TL_(' Filtered by '))}${productFilter}`}\r\n            </Text>\r\n          </div>\r\n          <div>\r\n            <DefaultButton onClick={navigateToListingGroupPage}>\r\n              {i18n.getString(_TL_('Go to listing groups'))}\r\n            </DefaultButton>\r\n          </div>\r\n        </div>\r\n      }\r\n      {\r\n        !isEditing &&\r\n        <ChoiceGroup\r\n          className={classNames(classes.productOptions, 'product-options')}\r\n          options={options}\r\n          onChange={onChangeOptions}\r\n          selectedKey={selectedOption ? selectedOption.key : null}\r\n          ariaLabel={i18n.getString(_TL_('Listing groups'))}\r\n        />\r\n      }\r\n      {!isEditing && selectedOption.key === 'filter-products' &&\r\n        <div>\r\n          <div className={classNames('filtered-products-preview', classes.filterProductsPreview)}>\r\n            <Stack\r\n              horizontal\r\n              wrap\r\n              disableShrink\r\n              tokens={stackContainerToken}\r\n            >\r\n              {pluck(selectedProducts, 'primary').map((item, index) => (\r\n                <SelectedItem\r\n                  key={item}\r\n                  itemText={item}\r\n                  itemIndex={index}\r\n                  onDelete={onDeleteProduct}\r\n                />\r\n              ))}\r\n            </Stack>\r\n          </div>\r\n          <div className={classes.buttonContainer}>\r\n            <DefaultButton onClick={onOpenPanel}>\r\n              <Glyphicon glyph=\"ba-Add\" />\r\n              {i18n.getString(_TL_('Add filter'))}\r\n            </DefaultButton>\r\n          </div>\r\n        </div>\r\n      }\r\n      {isTreeViewSelectorOpen && <PanelSelector\r\n        getErrors={() => []}// TO DO SIMXU update to real error handling\r\n        isOpen={isTreeViewSelectorOpen}\r\n        columns={treeViewSelectorColumns}\r\n        dimensions={treeViewSelectorDimensions}\r\n        headerText={treeViewSelectorHeaderText}\r\n        initialSelectedItems={treeViewSelectorInitialSelectedItems}\r\n        items={treeViewSelectorItems}\r\n        onCancel={onTreeViewCancel}\r\n        onSave={onChange}\r\n        onSelectedDimensionChange={onTreeViewSelectedDimensionChangeWithoutStatistics}\r\n        enableShimmer={isTreeViewShimmerEnabled}\r\n        keyOfItem={item => item.key}\r\n        isBulkAddEnabledForDimension={d => d.data.isBulkAddEnabled}\r\n      />}\r\n    </div>\r\n  );\r\n};\r\n\r\nListingGroupsWithCustomValidation.propTypes = {\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      locationTargets: PropTypes.shape({}),\r\n    }),\r\n  }).isRequired,\r\n  scope: PropTypes.shape({\r\n    values: PropTypes.shape({\r\n      cid: PropTypes.number.isRequired,\r\n      aid: PropTypes.number.isRequired,\r\n      uid: PropTypes.number.isRequired,\r\n      campaignId: PropTypes.number.isRequired,\r\n      assetGroupId: PropTypes.number,\r\n    }).isRequired,\r\n    save: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  campaignId: PropTypes.number.isRequired,\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  campaignSettings: PropTypes.arrayOf(PropTypes.shape({})),\r\n  siteMap: siteMapPropType.isRequired,\r\n  listingGroup: PropTypes.shape({\r\n    items: PropTypes.arrayOf(PropTypes.shape({\r\n      key: PropTypes.string,\r\n    })),\r\n    operand: PropTypes.string,\r\n  }),\r\n  storeDetails: PropTypes.shape({\r\n    text: PropTypes.string,\r\n  }),\r\n  assetGroupId: PropTypes.number,\r\n  onClickNavigateToListingGroups: PropTypes.func,\r\n};\r\n\r\nListingGroupsWithCustomValidation.defaultProps = {\r\n  campaignSettings: [],\r\n  listingGroup: {},\r\n  storeDetails: undefined,\r\n  assetGroupId: undefined,\r\n  onClickNavigateToListingGroups: undefined,\r\n};\r\n\r\nexport const ValidatedListingGroups = withCampaignSiteMap(withScope(withCustomValidation(withStoreFromProviderId(ListingGroupsWithCustomValidation))));\r\n","import React, { useCallback, useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { ActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport {\r\n  LocationTargetSetting,\r\n  isLocationValid,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\n\r\nconst LocationTargetSettingWithCustomValidation = ({\r\n  validationProps, updateValidation, skipValidation, allowBidAdjustment, dealInfo, ...restProps\r\n}) => {\r\n  const { data: locationTargets } = validationProps;\r\n  const i18n = useContext(I18nContext);\r\n  const activity = useContext(ActivityContext);\r\n\r\n  const onChange = useCallback((newData) => {\r\n    let errors = [];\r\n\r\n    if (!skipValidation) {\r\n      errors = isLocationValid(newData) ? [] : [i18n.getString(_TL_('Location target has validation errors'))];\r\n    }\r\n\r\n    const isForDeal = _.get(dealInfo, 'isForDeal', false);\r\n    if (isForDeal) {\r\n      errors = isLocationValid(newData, 'placeholder', dealInfo) ? [] : [i18n.getString(_TL_('Location target has validation errors.'))];\r\n    }\r\n\r\n    updateValidation(errors, { locationTargets: newData });\r\n\r\n    if (activity) {\r\n      // signal activity to parent\r\n      activity.signal(`onLocationTargettingChange - ${JSON.stringify(newData)}`);\r\n    }\r\n  }, [skipValidation, updateValidation, activity, i18n, dealInfo]);\r\n\r\n  return (locationTargets ?\r\n    <LocationTargetSetting\r\n      allowBidAdjustment={allowBidAdjustment}\r\n      data={locationTargets}\r\n      setData={onChange}\r\n      dealInfo={dealInfo}\r\n      {...restProps}\r\n    /> : <div />\r\n  );\r\n};\r\n\r\nLocationTargetSettingWithCustomValidation.propTypes = {\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      locationTargets: PropTypes.shape({}),\r\n    }),\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  skipValidation: PropTypes.bool,\r\n  allowBidAdjustment: PropTypes.bool,\r\n  dealInfo: PropTypes.shape({\r\n    isForDeal: PropTypes.bool,\r\n    dealCountryCode: PropTypes.string,\r\n    dealSupportedLocationType: PropTypes.arrayOf(PropTypes.string),\r\n  }),\r\n};\r\n\r\nLocationTargetSettingWithCustomValidation.defaultProps = {\r\n  skipValidation: true,\r\n  allowBidAdjustment: false,\r\n  dealInfo: {},\r\n};\r\n\r\nexport const ValidatedLocationTargetSetting = withCustomValidation(LocationTargetSettingWithCustomValidation);\r\n","import React, { useContext, } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withUnvalidatedControlErrors, withControlErrorHandling } from '@bingads-webui-campaign-react/error-handling';\r\nimport {\r\n  entityIs,\r\n  anyComp,\r\n} from '@bingads-webui-campaign-react/form-error';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getLocationTargetingStyles } from '@bingads-webui-campaign-react/location-targeting';\r\nimport {\r\n  TextTitle,\r\n  ValidatedPanel,\r\n  getPanelErrorProps\r\n} from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { SectionShimmer, getLocationTargetTitleDetails, ERROR_ENTITY } from '@bingads-webui-campaign-react/wizard-shared-components';\r\n\r\nimport { LocationImg } from './media';\r\nimport { ValidatedLocationTargetSetting } from './validated-location-target-setting';\r\n\r\nconst getTargetingStyles = () => ({\r\n  container: {\r\n    maxWidth: 680,\r\n    '& .title-item': {\r\n      width: 'unset !important',\r\n    },\r\n    '& .specific-location-targets-editor': {\r\n      marginLeft: '-25px !important',\r\n    },\r\n    '& .intent-target ul': {\r\n      paddingLeft: '20px',\r\n    },\r\n  },\r\n  header: {\r\n    marginBottom: 20,\r\n  },\r\n  ...getLocationTargetingStyles(),\r\n});\r\n\r\nconst campaignLocationCriterions = anyComp(\r\n  entityIs(ERROR_ENTITY.CampaignLocation),\r\n  entityIs(ERROR_ENTITY.CampaignRadius),\r\n  entityIs(ERROR_ENTITY.CampaignNegativeLocation),\r\n  entityIs(ERROR_ENTITY.CampaignLocationIntent)\r\n);\r\n\r\nconst ServerValidatedLocationTargetSetting = withControlErrorHandling(withUnvalidatedControlErrors(\r\n  ValidatedLocationTargetSetting,\r\n  { filter: campaignLocationCriterions }\r\n));\r\n\r\nexport const LocationTargetingSettingPanel = (props) => {\r\n  const { scope } = useContext(ScopeContext) || {};\r\n  const i18n = useContext(I18nContext);\r\n  const classes = useDefaultStyles(getTargetingStyles);\r\n\r\n  const {\r\n    key,\r\n    isLoading,\r\n    options,\r\n    expand,\r\n    data = {},\r\n    topicKey,\r\n    ...rest\r\n  } = props;\r\n\r\n\r\n  return (\r\n    <ValidatedPanel\r\n      key={key}\r\n      title={<TextTitle\r\n        titleKey={_TL_('Location')}\r\n        topicKey={topicKey || 'pop_BA_Settings_LocationTargeting'}\r\n        icon={LocationImg}\r\n        details={\r\n          getLocationTargetTitleDetails(\r\n            i18n,\r\n            data && data.locationTargets,\r\n            false,\r\n            data && data.BiddingScheme && data.BiddingScheme.Type,\r\n            true\r\n          )}\r\n      />}\r\n      attentionBeaconProps={{ getExtraProps: getPanelErrorProps }}\r\n      actuationProps={{\r\n        expand,\r\n        expandKey: key,\r\n      }}\r\n      {...rest}\r\n    >\r\n      {\r\n        isLoading ?\r\n          <SectionShimmer /> :\r\n          <div className={classes.LocationTargeting}>\r\n            <ServerValidatedLocationTargetSetting\r\n              validationProps={{\r\n                data: data && data.locationTargets,\r\n              }}\r\n              scope={scope}\r\n              bidStrategyType={data && data.DisplayBiddingStrategyType}\r\n              {...options}\r\n            />\r\n          </div>\r\n        }\r\n    </ValidatedPanel>\r\n  );\r\n};\r\n\r\nLocationTargetingSettingPanel.propTypes = {\r\n  key: PropTypes.string.isRequired,\r\n  isLoading: PropTypes.bool,\r\n  options: PropTypes.shape({\r\n    bundleCountries: PropTypes.arrayOf(PropTypes.shape({})),\r\n    bundleLocationCriterions: PropTypes.arrayOf(PropTypes.shape({})),\r\n  }),\r\n  expand: PropTypes.func.isRequired,\r\n  data: PropTypes.shape({}),\r\n  topicKey: PropTypes.string,\r\n};\r\n\r\nLocationTargetingSettingPanel.defaultProps = {\r\n  isLoading: false,\r\n  options: {},\r\n  data: {},\r\n  topicKey: null,\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { AudienceWizard } from '@bingads-webui-campaign-react/audience-signals';\r\nimport {\r\n  TextTitle,\r\n  getPanelErrorProps,\r\n  ValidatedFixedPanel,\r\n} from '@bingads-webui-campaign/wizard-jumbo-card';\r\n\r\nimport { AudienceSignalShimmer, withShimmer } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { AudienceImg } from './media';\r\n\r\nconst AudienceWizardWithShimmer = withShimmer(AudienceWizard, AudienceSignalShimmer);\r\n\r\nexport const AudienceSignalPanel = (props) => {\r\n  const i18n = useContext(I18nContext);\r\n  const { scope } = useContext(ScopeContext) || {};\r\n  const serverContext = useContext(ServerContext);\r\n\r\n  const {\r\n    DynamicPermissions,\r\n    Permissions,\r\n  } = serverContext;\r\n\r\n  const { aid, cid } = scope.values;\r\n\r\n  const permissions = useMemo(\r\n    () => ({ dynamic: { ...DynamicPermissions }, ...Permissions }),\r\n    [DynamicPermissions, Permissions]\r\n  );\r\n\r\n  const isReadOnlyUser = useMemo(\r\n    () => permissions.IsReadOnlyUser || serverContext.CurrentAccount.Status === 32, // 32 is InActive\r\n    [permissions.IsReadOnlyUser, serverContext.CurrentAccount.Status]\r\n  );\r\n\r\n  const {\r\n    key,\r\n    isLoading,\r\n    options,\r\n    expand,\r\n    data = {},\r\n    ...rest\r\n  } = props;\r\n\r\n  const {\r\n    AudienceGroup,\r\n    OriginalAudienceGroup,\r\n  } = data;\r\n\r\n  return (\r\n    <ValidatedFixedPanel\r\n      key={key}\r\n      title={<TextTitle\r\n        titleKey={_TL_('Audience')}\r\n        details={_TL_('Create or add an audience signal to guide automation.')}\r\n        icon={AudienceImg}\r\n      />}\r\n      attentionBeaconProps={{ getExtraProps: getPanelErrorProps }}\r\n      actuationProps={{\r\n          expand,\r\n          expandKey: key,\r\n        }}\r\n      {...rest}\r\n    >\r\n      <AudienceWizardWithShimmer\r\n        showShimmer={isLoading}\r\n        audienceGroup={AudienceGroup}\r\n        originalAudienceGroup={OriginalAudienceGroup}\r\n        aid={aid}\r\n        cid={cid}\r\n        i18n={i18n}\r\n        isReadOnlyUser={isReadOnlyUser}\r\n        {...options}\r\n      />\r\n    </ValidatedFixedPanel>\r\n  );\r\n};\r\n\r\nAudienceSignalPanel.propTypes = {\r\n  key: PropTypes.string.isRequired,\r\n  isLoading: PropTypes.bool,\r\n  options: PropTypes.shape({\r\n    wizardPerfMarker: PropTypes.shape({}),\r\n  }),\r\n  expand: PropTypes.func,\r\n  wizardPerfMarker: PropTypes.shape({}).isRequired,\r\n  data: PropTypes.shape({}),\r\n};\r\n\r\nAudienceSignalPanel.defaultProps = {\r\n  isLoading: false,\r\n  options: {},\r\n  data: {},\r\n  expand: () => {},\r\n};\r\n","import _, { compose, partial } from 'underscore';\r\nimport { withProps } from '@bingads-webui-react/with-props';\r\nimport { withControlErrorHandling, withUnvalidatedControlErrors } from '@bingads-webui-campaign-react/error-handling';\r\nimport { propertyIs, StandardControlAdapter } from '@bingads-webui-campaign-react/form-error';\r\nimport { ValidatedUrlOptionsParameters } from '@bingads-webui-campaign-react/url-options';\r\n\r\nconst campaignTrackingUrlTemplate = propertyIs('TrackingUrlTemplate');\r\nconst campaignFinalUrlSuffix = propertyIs('FinalUrlSuffix');\r\nconst campaignUrlCustomParameters = propertyIs('UrlCustomParameters');\r\nconst trackingUrlTemplateControlsWrapper = compose(\r\n  withControlErrorHandling,\r\n  partial(withUnvalidatedControlErrors, _, { filter: campaignTrackingUrlTemplate, Adapter: StandardControlAdapter() })\r\n);\r\nconst finalUrlSuffixControlsWrapper = compose(\r\n  withControlErrorHandling,\r\n  partial(withUnvalidatedControlErrors, _, { filter: campaignFinalUrlSuffix, Adapter: StandardControlAdapter() })\r\n);\r\nconst urlCustomParametersControlsWrapper = compose(\r\n  withControlErrorHandling,\r\n  partial(withUnvalidatedControlErrors, _, { filter: campaignUrlCustomParameters, Adapter: StandardControlAdapter({ functionsToInject: ['onCustomParameterKeyChange', 'onCustomParameterValueChange', 'onRemoveUrlParameter', 'onAddUrlParameter'] }) })\r\n);\r\n\r\nexport const ServerValidatedUrlOptionsParameters = withControlErrorHandling(withProps({\r\n  trackingUrlTemplateControlsWrapper,\r\n  finalUrlSuffixControlsWrapper,\r\n  urlCustomParametersControlsWrapper,\r\n}, ValidatedUrlOptionsParameters));\r\n","import React, { useMemo, useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { noop } from 'underscore';\r\nimport {\r\n  TextTitle,\r\n  ValidatedPanel,\r\n  getPanelErrorProps,\r\n} from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { ValidatedVideoExperience, getODataConfig } from '@bingads-webui-campaign-react/xandr-video-campaign-shared-components';\r\nimport { PermissionsContext } from '@bingads-webui-react/hoc-with-permissions';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport {\r\n  ImageListSummaryCardDetails,\r\n} from '@bingads-webui-campaign-react/pmax-image-experience';\r\n\r\nimport { PANEL_KEYS } from '@bingads-webui-campaign-react/wizard-shared-components';\r\n\r\nconst DisplayPlusMaxVideoCount = 5;\r\n\r\nexport const VideoPanel = ({\r\n  perfMarker,\r\n  mergedI18n,\r\n  videos,\r\n  setSelectedVideoId = noop,\r\n  selectedVideoId,\r\n  icon,\r\n  allAssetsExpand,\r\n  isVideoRequired,\r\n  topicKey,\r\n  skipQualityValidation,\r\n  ...rest\r\n}) => {\r\n  const permissions = useContext(PermissionsContext);\r\n\r\n  const serverContext = useContext(ServerContext);\r\n\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const oDataConfig = useMemo(() => getODataConfig(serverContext), [serverContext]);\r\n\r\n  const { scope } = useContext(ScopeContext);\r\n\r\n  const { cid, aid } = scope.values;\r\n\r\n  const videoTypesWithOrder = useMemo(() => (['VideoMedia16X9']), []);\r\n\r\n  const videosContainer = useMemo(() => {\r\n    const videoAd = { videos: videos || [] };\r\n\r\n    return (\r\n      <ValidatedVideoExperience\r\n        i18n={mergedI18n}\r\n        perfMarker={perfMarker}\r\n        permissions={permissions}\r\n        oDataConfig={oDataConfig}\r\n        cid={cid}\r\n        aid={aid}\r\n        multiVideoMode\r\n        allowedVideoSizes={videoTypesWithOrder}\r\n        disableRemoveAll\r\n        hideRatioLabel\r\n        videoAd={videoAd}\r\n        videoExperienceCircleUploadType\r\n        disableUploadTextField\r\n        videoPickerContainerHeight=\"auto\"\r\n        setSelectedVideoIdx={setSelectedVideoId}\r\n        selectedVideoIdx={selectedVideoId}\r\n        copilotEnabled\r\n        isVideoRequired={isVideoRequired}\r\n        skipQualityValidation={skipQualityValidation}\r\n      />\r\n    );\r\n  }, [videos, mergedI18n, perfMarker, permissions, videoTypesWithOrder, selectedVideoId, oDataConfig, cid, aid, setSelectedVideoId, isVideoRequired, skipQualityValidation]);\r\n\r\n  return (\r\n    <ValidatedPanel\r\n      key={PANEL_KEYS.VIDEOS}\r\n      title={<TextTitle\r\n        titleKey={_TL_('Videos')}\r\n        topicKey={topicKey || 'pop_BA_VideoAds_VideoSource'}\r\n        icon={icon}\r\n        iconAltText={i18n.getString(_TL_('\"Videos\" panel\\'s image'))}\r\n        details={<ImageListSummaryCardDetails i18n={i18n} videos={videos} isLogos={false} isVideos />}\r\n      />}\r\n      attentionBeaconProps={{ getExtraProps: getPanelErrorProps }}\r\n      actuationProps={{\r\n      expand: allAssetsExpand,\r\n      expandKey: PANEL_KEYS.VIDEOS,\r\n      }}\r\n      {...rest}\r\n    >\r\n      <span>{i18n.getString(_TL_('You can add up to {{limit}} videos to your ad.'), { limit: DisplayPlusMaxVideoCount })}</span>\r\n      <div className={classNames('imageExperienceStyle')}>\r\n        {videosContainer}\r\n      </div>\r\n    </ValidatedPanel>\r\n  );\r\n};\r\n\r\nVideoPanel.propTypes = {\r\n  perfMarker: PropTypes.string.isRequired,\r\n  mergedI18n: PropTypes.shape({}).isRequired,\r\n  videos: PropTypes.shape([]).isRequired,\r\n  setSelectedVideoId: PropTypes.func,\r\n  selectedVideoId: PropTypes.number.isRequired,\r\n  skipQualityValidation: PropTypes.bool,\r\n  icon: PropTypes.node.isRequired,\r\n  allAssetsExpand: PropTypes.func.isRequired,\r\n  isVideoRequired: PropTypes.bool,\r\n  topicKey: PropTypes.string,\r\n};\r\n\r\nVideoPanel.defaultProps = {\r\n  isVideoRequired: false,\r\n  topicKey: null,\r\n  skipQualityValidation: false,\r\n};\r\n","import { getTheme } from '@fluentui/react';\r\nimport { merge } from '@bingads-webui-universal/primitive-utilities';\r\n\r\nconst { palette } = getTheme();\r\n\r\nexport const getStepBaseLayoutFooterStyles = (styleOverrides = {}) => () => merge({\r\n  footerContainer: {\r\n    clear: 'both',\r\n    borderTop: `1px solid ${palette.neutralLight}`,\r\n    paddingLeft: '24px',\r\n    paddingTop: '16px',\r\n    paddingBottom: '16px',\r\n  },\r\n  previousButton: {\r\n    marginRight: '8px',\r\n  },\r\n  previousButtonOnTheRightOfNext: {\r\n    marginLeft: '12px',\r\n  },\r\n  cancelButton: {\r\n    marginLeft: '33px',\r\n  },\r\n  skippingLink: {\r\n    marginLeft: '41px',\r\n    textDecoration: 'underline',\r\n  },\r\n}, styleOverrides);\r\n\r\nexport const baseLayoutFooterStyles = {\r\n  stepProgress: {\r\n    root: {\r\n      color: palette.neutralPrimary,\r\n      paddingTop: 5,\r\n      paddingLeft: 16,\r\n    },\r\n  },\r\n};\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport _ from 'underscore';\r\nimport React, { useContext } from 'react';\r\nimport classNames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { DefaultButton, PrimaryButton, Link } from '@bingads-webui-react/fabric-with-signal';\r\nimport { Text } from '@fluentui/react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nimport { getStepBaseLayoutFooterStyles, baseLayoutFooterStyles } from './styles/step-base-layout-footer-styles';\r\n\r\nexport function StepFooter(props) {\r\n  const {\r\n    onCancelClick,\r\n    onPreviousClick,\r\n    onNextClick,\r\n    nextButtonText,\r\n    previousButtonAfterNext,\r\n    previousButtonText,\r\n    cancelButtonText,\r\n    onSkippingLinkClick,\r\n    skippingLinkTitle,\r\n    onRenderFooterNote,\r\n    isPreviousClickDisabled,\r\n    isNextClickDisabled,\r\n    isSkipLinkDisabled,\r\n    stepProgressContent,\r\n    className,\r\n    styleOverrides,\r\n  } = props;\r\n  const classes = useDefaultStyles(getStepBaseLayoutFooterStyles(styleOverrides));\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <div className={classNames('step-footer', classes.footerContainer, className)}>\r\n      {\r\n        _.isFunction(onRenderFooterNote) && onRenderFooterNote()\r\n      }\r\n      {!previousButtonAfterNext &&\r\n        _.isFunction(onPreviousClick) &&\r\n        <DefaultButton\r\n          className={classNames('step-previous', classes.previousButton)}\r\n          onClick={onPreviousClick}\r\n          disabled={isPreviousClickDisabled}\r\n        >\r\n          {previousButtonText || i18n.getString(_TL_('Previous'))}\r\n        </DefaultButton>\r\n      }\r\n\r\n      <PrimaryButton\r\n        className={classNames('step-next')}\r\n        onClick={_.isFunction(onNextClick) ? onNextClick : null}\r\n        disabled={!_.isFunction(onNextClick) || isNextClickDisabled}\r\n      >\r\n        {nextButtonText || i18n.getString(_TL_('Next'))}\r\n      </PrimaryButton>\r\n\r\n      {previousButtonAfterNext &&\r\n        _.isFunction(onPreviousClick) &&\r\n        <DefaultButton\r\n          className={classNames('step-previous', classes.previousButtonOnTheRightOfNext)}\r\n          onClick={onPreviousClick}\r\n          disabled={isPreviousClickDisabled}\r\n        >\r\n          {previousButtonText || i18n.getString(_TL_('Previous'))}\r\n        </DefaultButton>\r\n      }\r\n\r\n      {\r\n        _.isFunction(onCancelClick) &&\r\n        <DefaultButton\r\n          className={classNames('step-cancel', classes.cancelButton)}\r\n          onClick={onCancelClick}\r\n        >\r\n          {cancelButtonText || i18n.getString(_TL_('Cancel'))}\r\n        </DefaultButton>\r\n      }\r\n\r\n      {\r\n        stepProgressContent &&\r\n        <div className={classNames('step-progress-container', classes.stepProgressContainer)}>\r\n          <Text\r\n            variant=\"medium\"\r\n            block\r\n            styles={baseLayoutFooterStyles.stepProgress}\r\n            className=\"step-progress\"\r\n          >\r\n            {stepProgressContent}\r\n          </Text>\r\n        </div>\r\n      }\r\n\r\n      {\r\n        _.isFunction(onSkippingLinkClick) &&\r\n        <Link\r\n          className={classNames(['link-button', 'step-skip', classes.skippingLink])}\r\n          onClick={onSkippingLinkClick}\r\n          disabled={isSkipLinkDisabled}\r\n        >\r\n          {skippingLinkTitle || i18n.getString(_TL_('Skip campaign creation'))}\r\n        </Link>\r\n      }\r\n    </div>\r\n  );\r\n}\r\n\r\nStepFooter.propTypes = {\r\n  onCancelClick: PropTypes.func,\r\n  onPreviousClick: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\r\n  onNextClick: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\r\n  onSkippingLinkClick: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\r\n  skippingLinkTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\r\n\r\n  onRenderFooterNote: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\r\n\r\n  previousButtonAfterNext: PropTypes.bool,\r\n  previousButtonText: PropTypes.string,\r\n  nextButtonText: PropTypes.string,\r\n  cancelButtonText: PropTypes.string,\r\n  isPreviousClickDisabled: PropTypes.bool,\r\n  isNextClickDisabled: PropTypes.bool,\r\n  isSkipLinkDisabled: PropTypes.bool,\r\n  className: PropTypes.string,\r\n  styleOverrides: PropTypes.shape({}),\r\n  stepProgressContent: PropTypes.string,\r\n};\r\n\r\nStepFooter.defaultProps = {\r\n  previousButtonAfterNext: false,\r\n  previousButtonText: null,\r\n  nextButtonText: null,\r\n  cancelButtonText: null,\r\n  onPreviousClick: null,\r\n  onNextClick: null,\r\n  onCancelClick: null,\r\n  onSkippingLinkClick: null,\r\n  skippingLinkTitle: null,\r\n  onRenderFooterNote: null,\r\n\r\n  isPreviousClickDisabled: false,\r\n  isNextClickDisabled: false,\r\n  isSkipLinkDisabled: false,\r\n  className: '',\r\n  styleOverrides: undefined,\r\n  stepProgressContent: '',\r\n};\r\n","import { getTheme } from '@fluentui/react';\r\n\r\nconst { palette } = getTheme();\r\n\r\nexport const getBaseStepLayoutStyles = () => ({\r\n  stepContainer: {\r\n    height: '100%',\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n  },\r\n\r\n  stepContentContainer: {\r\n    overflowY: 'hidden',\r\n    display: 'table-column',\r\n    height: '100%',\r\n    backgroundColor: palette.neutralLighterAlt,\r\n  },\r\n\r\n  mainSide: {\r\n    width: '100%',\r\n    height: '100%',\r\n    paddingLeft: '32px',\r\n    display: 'table-cell',\r\n  },\r\n});\r\n","import _ from 'underscore';\r\nimport classNames from 'classnames';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nimport { getBaseStepLayoutStyles } from './styles/step-base-layout-styles';\r\nimport { StepFooter } from './step-base-layout-footer';\r\n\r\n/**\r\n * Base layout for wizard steps. Includes header and footer.\r\n * @param {*} props - See propTypes definition.\r\n * @returns {ReactNode} - Base layout component.\r\n */\r\nexport function StepBaseLayout(props) {\r\n  const {\r\n    children,\r\n    className,\r\n    stepContainerClassName,\r\n    stepContentContainerClassName,\r\n    mainSideClassName,\r\n    nextButtonText,\r\n    previousButtonText,\r\n    cancelButtonText,\r\n    onCancelClick,\r\n    onNextClick,\r\n    onPreviousClick,\r\n    onSkippingLinkClick,\r\n    skippingLinkTitle,\r\n    title,\r\n    onRenderFooterNote,\r\n    onRenderRightSide,\r\n    isPreviousClickDisabled,\r\n    isNextClickDisabled,\r\n    isSkipLinkDisabled,\r\n    isHideFooter,\r\n  } = props;\r\n\r\n  const classes = useDefaultStyles(getBaseStepLayoutStyles);\r\n  return (\r\n    <div className={classNames('step', className, stepContainerClassName || classes.stepContainer)}>\r\n      <div className={classNames('step-content', className, stepContentContainerClassName || classes.stepContentContainer)}>\r\n        <div className={classNames(mainSideClassName || classes.mainSide)}>\r\n          {title && <div className=\"step-header\"><h1>{title}</h1></div>}\r\n\r\n          <div className=\"step-primary-content\">\r\n            {children}\r\n          </div>\r\n        </div>\r\n\r\n        {\r\n          _.isFunction(onRenderRightSide) && onRenderRightSide()\r\n        }\r\n      </div>\r\n\r\n      {!isHideFooter && <StepFooter\r\n        onCancelClick={onCancelClick}\r\n        onPreviousClick={onPreviousClick}\r\n        onNextClick={onNextClick}\r\n        onSkippingLinkClick={onSkippingLinkClick}\r\n        skippingLinkTitle={skippingLinkTitle}\r\n        onRenderFooterNote={onRenderFooterNote}\r\n\r\n        cancelButtonText={cancelButtonText}\r\n        previousButtonText={previousButtonText}\r\n        nextButtonText={nextButtonText}\r\n        isPreviousClickDisabled={isPreviousClickDisabled}\r\n        isNextClickDisabled={isNextClickDisabled}\r\n        isSkipLinkDisabled={isSkipLinkDisabled}\r\n      />}\r\n    </div>\r\n  );\r\n}\r\n\r\nStepBaseLayout.propTypes = {\r\n  children: PropTypes.oneOfType([\r\n    PropTypes.node,\r\n    PropTypes.arrayOf(PropTypes.node),\r\n  ]),\r\n  className: PropTypes.string,\r\n  stepContainerClassName: PropTypes.string,\r\n  stepContentContainerClassName: PropTypes.string,\r\n  mainSideClassName: PropTypes.string,\r\n\r\n  onPreviousClick: PropTypes.func,\r\n  onNextClick: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\r\n  onCancelClick: PropTypes.func,\r\n  onSkippingLinkClick: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\r\n  skippingLinkTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\r\n  onRenderFooterNote: PropTypes.func,\r\n\r\n  cancelButtonText: PropTypes.string,\r\n  previousButtonText: PropTypes.string,\r\n  nextButtonText: PropTypes.string,\r\n  isPreviousClickDisabled: PropTypes.bool,\r\n  isNextClickDisabled: PropTypes.bool,\r\n  isSkipLinkDisabled: PropTypes.bool,\r\n\r\n  title: PropTypes.string,\r\n  onRenderRightSide: PropTypes.func,\r\n  isHideFooter: PropTypes.bool,\r\n};\r\n\r\nStepBaseLayout.defaultProps = {\r\n  children: null,\r\n  className: null,\r\n  stepContainerClassName: undefined,\r\n  stepContentContainerClassName: undefined,\r\n  mainSideClassName: undefined,\r\n\r\n  title: null,\r\n  onRenderRightSide: null,\r\n\r\n  skippingLinkTitle: null,\r\n  onPreviousClick: null,\r\n  onNextClick: null,\r\n  onCancelClick: null,\r\n  onSkippingLinkClick: null,\r\n  onRenderFooterNote: null,\r\n\r\n  cancelButtonText: null,\r\n  previousButtonText: null,\r\n  nextButtonText: null,\r\n  isPreviousClickDisabled: false,\r\n  isNextClickDisabled: false,\r\n  isSkipLinkDisabled: false,\r\n  isHideFooter: false,\r\n};\r\n","import { getTheme } from '@fluentui/react';\r\n\r\nconst { palette } = getTheme();\r\n\r\nexport const getBaseModalFooterStyles = () => ({\r\n  stepModalFooterContainer: {\r\n    display: 'flex',\r\n    justifyContent: 'space-between',\r\n    position: 'absolute',\r\n    bottom: 16,\r\n    width: '100%',\r\n  },\r\n  actionsContainer: {\r\n    display: 'flex',\r\n    paddingLeft: 16,\r\n  },\r\n  defaultButton: {\r\n    marginRight: 8,\r\n  },\r\n  skipLink: {\r\n    textDecoration: 'underline',\r\n  },\r\n  stepProgressContainer: {\r\n    marginLeft: 'auto',\r\n  },\r\n});\r\n\r\nexport const baseModalFooterStyles = {\r\n  stepProgress: {\r\n    root: {\r\n      color: palette.neutralPrimary,\r\n      paddingTop: 5,\r\n    },\r\n  },\r\n};\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport _ from 'underscore';\r\nimport React, { useContext } from 'react';\r\nimport classNames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { DefaultButton, PrimaryButton, Link, Text } from '@fluentui/react';\r\n\r\nimport { getBaseModalFooterStyles, baseModalFooterStyles } from './styles/step-base-modal-footer-styles';\r\n\r\nexport function StepModalFooter(props) {\r\n  const {\r\n    onPreviousClick,\r\n    onNextClick,\r\n    onSkippingLinkClick,\r\n    skippingLinkTitle,\r\n    nextButtonText,\r\n    previousButtonText,\r\n    stepProgressContent,\r\n    isPreviousDisabled,\r\n  } = props;\r\n  const classes = useDefaultStyles(getBaseModalFooterStyles);\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <div className={classNames('step-modal-footer', classes.stepModalFooterContainer)}>\r\n      {\r\n        _.isFunction(onSkippingLinkClick) && (\r\n          <div className={classNames('skip-link-container')}>\r\n            <Link\r\n              className={classNames(['link-button', 'step-skip', classes.skipLink])}\r\n              onClick={onSkippingLinkClick}\r\n            >\r\n              {skippingLinkTitle || i18n.getString(_TL_('Skip campaign creation')) }\r\n            </Link>\r\n          </div>\r\n        )\r\n      }\r\n\r\n      {\r\n        stepProgressContent &&\r\n        <div className={classNames('step-progress-container', classes.stepProgressContainer)}>\r\n          <Text\r\n            variant=\"medium\"\r\n            block\r\n            styles={baseModalFooterStyles.stepProgress}\r\n            className=\"step-progress\"\r\n          >\r\n            {stepProgressContent}\r\n          </Text>\r\n        </div>\r\n      }\r\n\r\n      <div className={classes.actionsContainer}>\r\n        {\r\n          _.isFunction(onPreviousClick) &&\r\n          <DefaultButton\r\n            className={classNames('step-previous', classes.defaultButton)}\r\n            onClick={onPreviousClick}\r\n            disabled={isPreviousDisabled}\r\n          >\r\n            {previousButtonText || i18n.getString(_TL_('Previous'))}\r\n          </DefaultButton>\r\n        }\r\n        {\r\n        _.isFunction(onNextClick) &&\r\n        <PrimaryButton\r\n          className={classNames('step-next', classes.primaryButton)}\r\n          onClick={onNextClick}\r\n        >\r\n          {nextButtonText || i18n.getString(_TL_('Next'))}\r\n        </PrimaryButton>\r\n      }\r\n      </div>\r\n\r\n    </div>\r\n  );\r\n}\r\n\r\nStepModalFooter.propTypes = {\r\n  nextButtonText: PropTypes.string,\r\n  onPreviousClick: PropTypes.func,\r\n  onNextClick: PropTypes.func,\r\n  onSkippingLinkClick: PropTypes.func,\r\n  skippingLinkTitle: PropTypes.string,\r\n  previousButtonText: PropTypes.string,\r\n  stepProgressContent: PropTypes.string,\r\n  isPreviousDisabled: PropTypes.bool,\r\n};\r\n\r\nStepModalFooter.defaultProps = {\r\n  nextButtonText: null,\r\n  onPreviousClick: null,\r\n  onNextClick: null,\r\n  onSkippingLinkClick: null,\r\n  skippingLinkTitle: null,\r\n  previousButtonText: null,\r\n  stepProgressContent: null,\r\n  isPreviousDisabled: false,\r\n};\r\n","import { getTheme } from '@fluentui/react';\r\n\r\nconst { palette } = getTheme();\r\n\r\nexport const getStepBaseModalLayoutStyles = () => ({\r\n  stepModalHeader: {\r\n    display: 'flex',\r\n    paddingTop: '21px',\r\n    justifyContent: 'space-between',\r\n  },\r\n  stepModalIndex: {\r\n    marginLeft: 'auto',\r\n    alignSelf: 'center',\r\n    fontSize: '20px',\r\n    color: palette.neutralPrimary,\r\n  },\r\n  stepModalContainer: {\r\n    width: 632,\r\n    height: 616,\r\n    margin: '0 24px',\r\n    position: 'relative',\r\n  },\r\n  stepModalContentContainer: {\r\n    marginTop: '7px',\r\n    '& .error': {\r\n      fontSize: '12px',\r\n      lineHeight: '16px',\r\n      color: '#a80000',\r\n    },\r\n  },\r\n  modalContainer: {\r\n    display: 'flex',\r\n  },\r\n});\r\n\r\nexport const stepBaseModalStyles = {\r\n  cancelButtonStyles: {\r\n    root: {\r\n      color: palette.neutralPrimary,\r\n    },\r\n    rootHovered: {\r\n      color: palette.neutralDark,\r\n    },\r\n  },\r\n};\r\n","import React, { useContext, useState, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport _ from 'underscore';\r\n\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { Modal, IconButton, Text } from '@fluentui/react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { UiBlocker } from '@bingads-webui-react/ui-blocker';\r\n\r\nimport { getStepBaseModalLayoutStyles } from './styles/step-base-modal-layout-styles';\r\nimport { StepModalFooter } from './step-base-modal-footer';\r\n\r\nexport function StepBaseModalLayout(props) {\r\n  const {\r\n    modalClassName,\r\n    modalStyles,\r\n    isLoading,\r\n\r\n    onCancelClick,\r\n    onPreviousClick,\r\n    onNextClick,\r\n    skippingLinkTitle,\r\n    onSkippingLinkClick,\r\n\r\n    nextButtonText,\r\n    previousButtonText,\r\n    title,\r\n    stepProgressContent,\r\n\r\n    isCloseDisabled,\r\n    isPreviousDisabled,\r\n\r\n    children,\r\n  } = props;\r\n  const classes = useDefaultStyles(getStepBaseModalLayoutStyles);\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const [isModalOpen, setShowModal] = useState(true);\r\n  const onCloseClick = useCallback(() => {\r\n    onCancelClick();\r\n    setShowModal(false);\r\n  }, [onCancelClick]);\r\n\r\n  return (\r\n    <Modal\r\n      isOpen={isModalOpen}\r\n      onDismiss={onCloseClick}\r\n      isBlocking\r\n      className={classNames('step-base-modal', modalClassName)}\r\n      containerClassName={classNames('step-base-modal-container', classes.modalContainer)}\r\n      styles={modalStyles}\r\n    >\r\n      <UiBlocker\r\n        blocking={isLoading}\r\n        loadingText={i18n.getString(_TL_('Loading...'))}\r\n      >\r\n        <div className={classNames('step-modal-container', classes.stepModalContainer)}>\r\n          <div className={classNames('step-base-modal-header', classes.stepModalHeader)}>\r\n            {\r\n              title &&\r\n              <Text\r\n                block\r\n                variant=\"xLarge\"\r\n                className=\"modal-title\"\r\n              >\r\n                {title}\r\n              </Text>\r\n            }\r\n            <IconButton\r\n              className=\"modal-cancel\"\r\n              iconProps={{ iconName: 'Cancel' }}\r\n              ariaLabel={i18n.getString(_TL_('Cancel'))}\r\n              onClick={onCloseClick}\r\n              disabled={isCloseDisabled}\r\n            />\r\n          </div>\r\n          <div className={classes.stepModalContentContainer}>\r\n            <div className={classNames('step-base-modal-content', classes.stepContentContainer)}>\r\n              {children}\r\n            </div>\r\n            <StepModalFooter\r\n              onPreviousClick={onPreviousClick}\r\n              onNextClick={onNextClick}\r\n              onSkippingLinkClick={onSkippingLinkClick}\r\n              skippingLinkTitle={skippingLinkTitle}\r\n              previousButtonText={previousButtonText}\r\n              nextButtonText={nextButtonText}\r\n              stepProgressContent={stepProgressContent}\r\n              isPreviousDisabled={isPreviousDisabled}\r\n            />\r\n          </div>\r\n        </div>\r\n      </UiBlocker>\r\n    </Modal>\r\n  );\r\n}\r\n\r\nStepBaseModalLayout.propTypes = {\r\n  modalClassName: PropTypes.string,\r\n  modalStyles: PropTypes.shape({}),\r\n  isLoading: PropTypes.bool,\r\n\r\n  onCancelClick: PropTypes.func,\r\n  onNextClick: PropTypes.func,\r\n  onPreviousClick: PropTypes.func,\r\n  skippingLinkTitle: PropTypes.string,\r\n  onSkippingLinkClick: PropTypes.func,\r\n\r\n  title: PropTypes.string,\r\n  stepProgressContent: PropTypes.string,\r\n  nextButtonText: PropTypes.string,\r\n  previousButtonText: PropTypes.string,\r\n  isCloseDisabled: PropTypes.bool,\r\n  isPreviousDisabled: PropTypes.bool,\r\n\r\n  children: PropTypes.oneOfType([\r\n    PropTypes.node,\r\n    PropTypes.arrayOf(PropTypes.node),\r\n  ]),\r\n};\r\n\r\nStepBaseModalLayout.defaultProps = {\r\n  modalClassName: '',\r\n  modalStyles: null,\r\n  isLoading: false,\r\n\r\n  onNextClick: null,\r\n  onPreviousClick: null,\r\n  skippingLinkTitle: null,\r\n  onSkippingLinkClick: null,\r\n  onCancelClick: _.noop,\r\n\r\n  nextButtonText: null,\r\n  previousButtonText: null,\r\n\r\n  children: null,\r\n  title: null,\r\n  stepProgressContent: null,\r\n\r\n  isCloseDisabled: false,\r\n  isPreviousDisabled: false,\r\n};\r\n","import { useEffect, useState } from 'react';\r\n\r\nexport function useOnceEffect(callFn) {\r\n  const [called, setCalled] = useState(false);\r\n\r\n  useEffect(() => {\r\n    if (!called && callFn()) {\r\n      setCalled(true);\r\n    }\r\n  }, [callFn, called]);\r\n}\r\n","import { STEP_STATES } from '@bingads-webui-react/wizard-core';\r\n\r\n/**\r\n * Define this file to simplify later logging mapping in consumer side.\r\n */\r\nexport const WIZARD_EVENT_PREFIX = 'WizardStepFlow:';\r\n\r\nexport const WIZARD_STEP_EVENT = {\r\n  APP_LOAD: 'AppLoad',\r\n  START_FLOW: 'StartedFlow',\r\n  SWITCH_FLOW: 'SwitchedFlow',\r\n  ENTER_PAGE: 'EnteredPage',\r\n  COMPLETE: 'WizardComplete',\r\n};\r\n\r\nexport const SINGLE_STEP_EVENT = {\r\n  LOADING: 'Loading',\r\n  SAVING_SUCCEEDED: 'SavingSucceeded',\r\n  SAVING_FAILED: 'SavingFailed',\r\n};\r\n\r\nexport const USER_TRIGGER_STEP_EVENT = {\r\n  [STEP_STATES.GOING_NEXT]: 'SaveAndGoNext',\r\n  [STEP_STATES.GOING_BACK]: 'SaveAndGoBack',\r\n  [STEP_STATES.EXITING]: 'SaveAndExit',\r\n};\r\n\r\nexport const USER_TRIGGER_STEP_EVENT_KEYS = Object.keys(USER_TRIGGER_STEP_EVENT);\r\n","import _ from 'underscore';\r\nimport React, { useCallback, useEffect, useState, useRef, useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { useOnceEffect } from './helper';\r\nimport { WIZARD_EVENT_PREFIX, WIZARD_STEP_EVENT } from './constants';\r\n\r\nconst NoOpContext = {\r\n  logComplete: _.noop,\r\n  changedChannel: _.noop,\r\n  enteredPage: _.noop,\r\n};\r\n\r\nexport const StepFlowContext = React.createContext(NoOpContext);\r\nconst DEFAULT_EVENT_VALUE = '';\r\n\r\nexport function useLogEnteredPage({\r\n  Flow,\r\n  SubFlow = DEFAULT_EVENT_VALUE,\r\n  Page,\r\n}) {\r\n  const { enteredPage } = useContext(StepFlowContext);\r\n  useEffect(() => {\r\n    if (Page) {\r\n      enteredPage({ Flow, SubFlow, Page });\r\n    }\r\n  }, [Flow, Page, SubFlow, enteredPage]);\r\n}\r\n\r\nfunction useStateWithPrevious(initialValue) {\r\n  const [state, setState] = useState(initialValue);\r\n  const cache = useRef({});\r\n\r\n  const updateState = useCallback((newValue) => {\r\n    const value = {\r\n      Flow: newValue.Flow || DEFAULT_EVENT_VALUE,\r\n      SubFlow: newValue.SubFlow || DEFAULT_EVENT_VALUE,\r\n      Page: newValue.Page || DEFAULT_EVENT_VALUE,\r\n    };\r\n    setState((prev) => {\r\n      if (!_.isEqual(prev, value)) {\r\n        cache.current = prev;\r\n        return value;\r\n      }\r\n      return prev;\r\n    });\r\n  }, []);\r\n\r\n  return [state, updateState, cache.current];\r\n}\r\n\r\nexport function StepFlowProvider({ children, shouldPost, postEventLog }) {\r\n  const serverContext = useContext(ServerContext);\r\n  const instrumentation = useContext(InstrumentationContext);\r\n\r\n  const activity = useMemo(() => {\r\n    if (instrumentation && instrumentation.stepFlowScenario) {\r\n      const scenario = instrumentation.stepFlowScenario.create();\r\n      return scenario.stepFlow.create();\r\n    }\r\n    return { trace: _.noop, error: _.noop };\r\n  }, [instrumentation]);\r\n\r\n  const triggerPostEventLog = postEventLog(serverContext, activity.trace);\r\n  const shouldPostLog = shouldPost && _.isFunction(activity.trace) && _.isFunction(triggerPostEventLog);\r\n\r\n  const [{\r\n    Flow,\r\n    SubFlow,\r\n    Page,\r\n  }, setContext, prevContext] = useStateWithPrevious({\r\n    Flow: DEFAULT_EVENT_VALUE,\r\n    SubFlow: DEFAULT_EVENT_VALUE,\r\n    Page: DEFAULT_EVENT_VALUE,\r\n  });\r\n\r\n  const eventValues = useRef({});\r\n  const postEventLogRef = useRef({});\r\n  postEventLogRef.current = {\r\n    postEvent: (EventName, EventValue) => triggerPostEventLog({\r\n      EventName: `${WIZARD_EVENT_PREFIX}${EventName}`,\r\n      EventValue,\r\n    }),\r\n    logValidationError: (error) => {\r\n      const message = `WizardStepFlow validation error: ${error}`;\r\n      activity.trace(message);\r\n    },\r\n  };\r\n\r\n  useOnceEffect(() => {\r\n    if (shouldPostLog) {\r\n      postEventLogRef.current.postEvent(WIZARD_STEP_EVENT.APP_LOAD, {\r\n        ...eventValues.current,\r\n      });\r\n      return true;\r\n    }\r\n    return false;\r\n  });\r\n\r\n  useOnceEffect(() => {\r\n    if (shouldPostLog && Flow !== DEFAULT_EVENT_VALUE) {\r\n      postEventLogRef.current.postEvent(WIZARD_STEP_EVENT.START_FLOW, {\r\n        ...eventValues.current,\r\n        Flow,\r\n      });\r\n      return true;\r\n    }\r\n    return false;\r\n  });\r\n\r\n  const logComplete = useCallback(() => {\r\n    postEventLogRef.current.postEvent(WIZARD_STEP_EVENT.COMPLETE, {\r\n      ...eventValues.current,\r\n      Flow,\r\n      SubFlow,\r\n      Page,\r\n      Complete: true,\r\n    });\r\n  }, [Flow, SubFlow, Page]);\r\n\r\n\r\n  useEffect(() => {\r\n    if (!shouldPost || Flow === DEFAULT_EVENT_VALUE) {\r\n      return;\r\n    }\r\n\r\n    if (\r\n      (prevContext.Flow !== Flow || prevContext.SubFlow !== SubFlow || prevContext.Page !== Page) &&\r\n      Page !== DEFAULT_EVENT_VALUE\r\n    ) {\r\n      postEventLogRef.current.postEvent(WIZARD_STEP_EVENT.ENTER_PAGE, {\r\n        ...eventValues.current,\r\n        Flow,\r\n        SubFlow,\r\n        Page,\r\n      });\r\n    }\r\n\r\n    if (prevContext.Flow !== Flow && prevContext.Flow !== DEFAULT_EVENT_VALUE) {\r\n      if (prevContext.Page === Page) {\r\n        postEventLogRef.current.logValidationError('page should have been modified when flow changed');\r\n      }\r\n\r\n      postEventLogRef.current.postEvent(WIZARD_STEP_EVENT.SWITCH_FLOW, {\r\n        CID: eventValues.current.CID,\r\n        AID: eventValues.current.AID,\r\n        FromFlow: prevContext.Flow,\r\n        ToFlow: Flow,\r\n        FromPage: prevContext.Page || null,\r\n        ToPage: Page || null,\r\n      });\r\n    }\r\n  }, [Flow, Page, SubFlow, prevContext.Flow, prevContext.Page, prevContext.SubFlow, shouldPost]);\r\n\r\n  return (\r\n    <StepFlowContext.Provider value={shouldPost ? {\r\n      enteredPage: setContext,\r\n      logComplete,\r\n    } : NoOpContext}\r\n    >\r\n      {children}\r\n    </StepFlowContext.Provider>\r\n  );\r\n}\r\n\r\nStepFlowProvider.propTypes = {\r\n  shouldPost: PropTypes.bool,\r\n  postEventLog: PropTypes.func.isRequired,\r\n  children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,\r\n  serverContext: PropTypes.shape({}),\r\n};\r\n\r\nStepFlowProvider.defaultProps = {\r\n  shouldPost: true,\r\n  serverContext: undefined,\r\n};\r\n","import PropTypes from 'prop-types';\r\nimport { useLogEnteredPage } from './step-flow-provider-with-context';\r\n\r\nexport const BasicStepLogger = ({\r\n  flow, subflow, Page,\r\n}) => {\r\n  useLogEnteredPage({ Flow: flow, SubFlow: subflow, Page: Page || 'unknown step' });\r\n  return null;\r\n};\r\n\r\nBasicStepLogger.propTypes = {\r\n  flow: PropTypes.string.isRequired,\r\n  Page: PropTypes.string.isRequired,\r\n  subflow: PropTypes.string,\r\n};\r\nBasicStepLogger.defaultProps = {\r\n  subflow: '',\r\n};\r\n","import _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { useContext, useMemo } from 'react';\r\nimport { useWizardService, getCurrentStepId } from '@bingads-webui-react/wizard-core';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { useLogEnteredPage } from './step-flow-provider-with-context';\r\n\r\nexport const StepLogger = ({\r\n  flow, subflow, stepToPage,\r\n}) => {\r\n  const { state } = useWizardService();\r\n  const currentStepId = getCurrentStepId(state);\r\n  const instrumentation = useContext(InstrumentationContext);\r\n  const activity = useMemo(() => {\r\n    if (instrumentation && instrumentation.stepFlowScenario) {\r\n      const scenario = instrumentation.stepFlowScenario.create();\r\n      return scenario.stepFlow.create();\r\n    }\r\n    return { trace: _.noop, error: _.noop };\r\n  }, [instrumentation]);\r\n\r\n  if (!stepToPage[currentStepId]) {\r\n    activity.error(`Cannot find the step name from stepToPage: ${currentStepId}`);\r\n  }\r\n\r\n  useLogEnteredPage({ Flow: flow, SubFlow: subflow, Page: stepToPage[currentStepId] || 'unknown step' });\r\n\r\n  return null;\r\n};\r\n\r\nStepLogger.propTypes = {\r\n  flow: PropTypes.string.isRequired,\r\n  stepToPage: PropTypes.shape({}).isRequired,\r\n  subflow: PropTypes.string.isRequired,\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { StepFlowProvider } from './step-flow-provider-with-context';\r\nimport { StepLogger } from './step-logger';\r\n\r\nexport const WizardStepLogger = ({\r\n  children,\r\n  writeLog,\r\n  shouldPost,\r\n  flow,\r\n  subflow,\r\n  stepToPage,\r\n}) => (\r\n  <StepFlowProvider\r\n    postEventLog={() => writeLog}\r\n    shouldPost={shouldPost}\r\n  >\r\n    {children}\r\n    <StepLogger\r\n      flow={flow}\r\n      subflow={subflow}\r\n      stepToPage={stepToPage}\r\n    />\r\n  </StepFlowProvider>\r\n);\r\n\r\nWizardStepLogger.propTypes = {\r\n  children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,\r\n  writeLog: PropTypes.func.isRequired,\r\n  shouldPost: PropTypes.bool,\r\n  flow: PropTypes.string.isRequired,\r\n  subflow: PropTypes.string.isRequired,\r\n  stepToPage: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nWizardStepLogger.defaultProps = {\r\n  shouldPost: true,\r\n};\r\n","import _ from 'underscore';\r\nimport { useCallback, useEffect, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { useFormService, FORM_STATES } from '@bingads-webui-react/form-core';\r\nimport { useWizardService } from '@bingads-webui-react/wizard-core';\r\nimport { SINGLE_STEP_EVENT, USER_TRIGGER_STEP_EVENT, USER_TRIGGER_STEP_EVENT_KEYS } from './constants';\r\n\r\nconst matchStepSubState = (wizardState, stepSubState) => {\r\n  const stateArr = wizardState.toStrings();\r\n  const fullState = stateArr[stateArr.length - 1];\r\n  return fullState.includes(stepSubState);\r\n};\r\n\r\n/**\r\n * This component logs the single step, which needs to be put under the FormService.\r\n * @param {writeLog} write log function, e.g., API call or aria logging\r\n * @returns {void}\r\n */\r\nexport const SingleStepLogger = ({ writeLog }) => {\r\n  const [startTime, setStartTime] = useState(Date.now());\r\n  const { state } = useFormService();\r\n  const isLoading = state.matches(FORM_STATES.LOADING);\r\n  const isSaveSucceeded = state.matches(FORM_STATES.SAVING_SUCCEEDED);\r\n  const isSaveFailed = state.matches(FORM_STATES.SAVING_FAILED);\r\n\r\n  const { state: wizardState } = useWizardService();\r\n  const [trigger, setTrigger] = useState(null);\r\n\r\n  useEffect(() => {\r\n    if (_.some(USER_TRIGGER_STEP_EVENT_KEYS, key => matchStepSubState(wizardState, key))) {\r\n      const triggerKey = _.find(USER_TRIGGER_STEP_EVENT_KEYS, key => matchStepSubState(wizardState, key));\r\n      setTrigger(USER_TRIGGER_STEP_EVENT[triggerKey]);\r\n    }\r\n  }, [wizardState]);\r\n\r\n  const triggerWriteLog = useCallback((EventName, EventValue) => {\r\n    writeLog({\r\n      EventName,\r\n      EventValue,\r\n    });\r\n  }, [writeLog]);\r\n\r\n  useEffect(() => {\r\n    if (isLoading) {\r\n      setStartTime(Date.now());\r\n      triggerWriteLog(SINGLE_STEP_EVENT.LOADING);\r\n    }\r\n  }, [isLoading, triggerWriteLog]);\r\n\r\n  useEffect(() => {\r\n    if (isSaveSucceeded) {\r\n      const duration = Date.now() - startTime;\r\n      triggerWriteLog(SINGLE_STEP_EVENT.SAVING_SUCCEEDED, {\r\n        duration,\r\n        trigger,\r\n      });\r\n    }\r\n  }, [trigger, isSaveSucceeded, startTime, triggerWriteLog]);\r\n\r\n  useEffect(() => {\r\n    if (isSaveFailed) {\r\n      triggerWriteLog(SINGLE_STEP_EVENT.SAVING_FAILED, {\r\n        trigger,\r\n      });\r\n    }\r\n  }, [trigger, isSaveFailed, triggerWriteLog, writeLog]);\r\n\r\n  return null;\r\n};\r\n\r\nSingleStepLogger.propTypes = {\r\n  writeLog: PropTypes.func.isRequired,\r\n};\r\n","export const WizardEvents = {\r\n  STEP_LOADING: 'STEP_LOADING',\r\n  STEP_SAVING: 'STEP_SAVING',\r\n  STEP_DONE_LOADING: 'STEP_DONE_LOADING',\r\n  STEP_DONE_SAVING: 'STEP_DONE_SAVING',\r\n  STEP_DONE_CANCELING: 'STEP_DONE_CANCELING',\r\n  STEP_FAILED_LOADING: 'STEP_FAILED_LOADING',\r\n  STEP_ABORTED_SAVING: 'STEP_ABORTED_SAVING',\r\n  STEP_ABORTED_CANCELING: 'STEP_ABORTED_CANCELING',\r\n  STEP_STOPPED: 'STEP_STOPPED',\r\n\r\n\r\n  NAVIGATE_BACK: 'NAVIGATE_BACK',\r\n  NAVIGATE_NEXT: 'NAVIGATE_NEXT',\r\n  CANCEL: 'CANCEL',\r\n  EXIT: 'EXIT',\r\n};\r\n","export const StepEvents = {\r\n  SAVE: 'SAVE',\r\n  DONE_SAVING: 'DONE_SAVING',\r\n  FAILED_SAVING: 'DAILED_SAVING',\r\n  DONE_LOADING: 'DONE_LOADING',\r\n  FAILED_LOADING: 'FAILED_LOADING',\r\n  CANCEL: 'CANCEL',\r\n  ACTIVATE: 'ACTIVATE',\r\n  DEACTIVATE: 'DEACTIVATE',\r\n  UPDATE_VALIDATION: 'UPDATE_VALIDATION',\r\n  STOP: 'STOP',\r\n  DONE_STOPPING: 'DONE_STOPPING',\r\n\r\n  OVERRIDE_ACTIONS: 'OVERRIDE_ACTIONS',\r\n  OVERRIDE_GUARDS: 'OVERRIDE_GUARDS',\r\n};\r\n","import { noop } from 'underscore';\r\n\r\nconst isDebugLoggingEnabled = true;\r\n\r\nconst jsonArgsSerializer = (...args) => args.map(JSON.stringify);\r\nconst identityArgsSerializer = (...args) => args;\r\n\r\nconst logF = argsSerializer => (isDebugLoggingEnabled ?\r\n  (msg, ...args) => {\r\n    // eslint-disable-next-line\r\n    console.log(`[DWD] ${msg}`, ...(argsSerializer(...args)));\r\n  } :\r\n  noop\r\n);\r\n\r\nexport const log = logF(identityArgsSerializer);\r\nexport const logJson = logF(jsonArgsSerializer);\r\n\r\nexport const logWrapper = (tag, func, toJson) => {\r\n  const logg = toJson ? logJson : log;\r\n\r\n  return (...args) => {\r\n    logg(`${tag}.ENTER: args=_`, ...args);\r\n    let ret;\r\n    try {\r\n      ret = func(...args);\r\n      return ret;\r\n    } finally {\r\n      // logg(`${tag}.EXIT: ret=_`, ret);\r\n    }\r\n  };\r\n};\r\n\r\nexport const logAction = (msg, ...args) =>\r\n  (context, event) =>\r\n    log(`${(context && context.id) || 'UNKNOWN'}: ${msg}`, ...args, context, event);\r\n\r\nexport const stateLoggingListener = (state) => {\r\n  // subscribes to state changes\r\n  log(`${state && state.machine && state.machine.id}: state=_`, state);\r\n};\r\n","import { isFunction, isNumber, noop } from 'underscore';\r\nimport { createMachine, assign, spawn, send } from 'xstate';\r\nimport { logAction } from './debug';\r\nimport { StepEvents } from './step-events';\r\nimport { WizardEvents } from './wizard-events';\r\n\r\nconst WizardStates = {\r\n  INIT: 'INIT',\r\n  STEP_ACTIVE: 'STEP_ACTIVE',\r\n  STEP_LOADING: 'STEP_LOADING',\r\n  STEP_SAVING: 'STEP_SAVING',\r\n  STEP_FAILED: 'STEP_FAILED',\r\n  STEP_CANCELING: 'STEP_CANCELING',\r\n  DONE: 'DONE',\r\n  FIN: 'FIN',\r\n};\r\n\r\n// Public state selectors\r\nexport const stepListSelector = state => state.context.stepList;\r\nexport const stepIndexSelector = state => state.context.stepIndex;\r\nexport const stepServicesCacheSelector = state => state.context.stepServicesCache;\r\nexport const isBusySelector = state => state.matches(WizardStates.STEP_LOADING) || state.matches(WizardStates.STEP_SAVING) || state.matches(WizardStates.STEP_CANCELING) || state.matches(WizardStates.DONE) || state.matches(WizardStates.FIN);\r\nexport const wasSavingSelector = state => state.matches(WizardStates.STEP_SAVING);\r\nexport const wasWaitingForConfirmationSelector = state => state.matches(WizardStates.STEP_CANCELING);\r\nexport const wasStoppingSelector = state => state.matches(WizardStates.DONE) || state.matches(WizardStates.FIN);\r\n\r\n\r\n// Derived state accessors\r\nconst getStepInfo = context => context.stepList[context.stepIndex];\r\nconst getStepServiceRef = context => context.stepServicesCache[getStepInfo(context).id];\r\n\r\n// Guards\r\nconst doesServiceNeedActivation = context => context.stepServiceNeedsActivation;\r\nconst isNotNavigating = context => !isNumber(context.navigatingTo) && !context.isExiting;\r\nconst isExiting = context => context.isExiting || (isNumber(context.navigatingTo) && context.navigatingTo >= context.stepList.length);\r\nconst isFirstStep = context => context.stepIndex - 1 < 0;\r\nconst canNavigateBackWithoutSaving = context => getStepInfo(context).canNavigateBackWithoutSaving;\r\n\r\n// Actions\r\nconst acquireStepService = assign((context) => {\r\n  const stepInfo = getStepInfo(context);\r\n  let stepService = getStepServiceRef(context);\r\n  if (stepService) {\r\n    return {\r\n      ...context,\r\n      stepService,\r\n      stepServiceNeedsActivation: true,\r\n    };\r\n  }\r\n\r\n  const extendedStepMachine = stepInfo\r\n    .StepMachine(stepInfo.StepMachineOptions(stepInfo, context.stepsData));\r\n  stepService = spawn(extendedStepMachine);\r\n\r\n  return {\r\n    ...context,\r\n    stepServicesCache: {\r\n      ...context.stepServicesCache,\r\n      [stepInfo.id]: stepService,\r\n    },\r\n    stepService,\r\n    stepServiceNeedsActivation: false,\r\n  };\r\n});\r\n\r\nconst stopStep = send(StepEvents.STOP, { to: getStepServiceRef });\r\n\r\nconst activateStep = send(\r\n  context => ({\r\n    type: StepEvents.ACTIVATE,\r\n    stepsData: context.stepsData,\r\n  }),\r\n  { to: getStepServiceRef }\r\n);\r\nconst deactivateStep = send(StepEvents.DEACTIVATE, { to: getStepServiceRef });\r\nconst notifyStepToSave = send(StepEvents.SAVE, { to: getStepServiceRef });\r\nconst notifyStepToCancel = send(StepEvents.CANCEL, { to: getStepServiceRef });\r\nconst setNavigatingForward = assign({\r\n  navigatingTo: context => context.stepIndex + 1,\r\n});\r\nconst setNavigatingBack = assign({\r\n  navigatingTo: context => context.stepIndex - 1,\r\n});\r\nconst setExiting = assign({\r\n  isExiting: () => true,\r\n});\r\nconst applyNavigation = assign({\r\n  stepIndex: context => context.navigatingTo,\r\n  navigatingTo: () => null,\r\n});\r\nconst resetNavigation = assign({\r\n  navigatingTo: () => null,\r\n  isExiting: () => false,\r\n});\r\nconst notifyDone = (context) => {\r\n  if (isFunction(context.onDone)) {\r\n    context.onDone(context.stepsData);\r\n  }\r\n};\r\nconst patchStepsData = assign({\r\n  stepsData: (context, event) => ({\r\n    ...context.stepsData,\r\n    ...event.stepsData,\r\n  }),\r\n});\r\n\r\nconst defaultActions = {\r\n  acquireStepService,\r\n  stopStep,\r\n  activateStep,\r\n  deactivateStep,\r\n  notifyStepToSave,\r\n  notifyStepToCancel,\r\n  setNavigatingForward,\r\n  setNavigatingBack,\r\n  setExiting,\r\n  applyNavigation,\r\n  resetNavigation,\r\n  notifyDone,\r\n  patchStepsData,\r\n};\r\n\r\nconst defaultServices = {\r\n};\r\n\r\nconst defaultGuards = {\r\n  isFirstStep,\r\n  isNotNavigating,\r\n  isExiting,\r\n  doesServiceNeedActivation,\r\n  canNavigateBackWithoutSaving,\r\n};\r\n\r\nconst getStartingState = (machineId, wizardOptions) => {\r\n  const {\r\n    stepList, stepsData, onDone = noop,\r\n  } = wizardOptions;\r\n  const stepIndex = 0;\r\n  return {\r\n    id: machineId,\r\n    stepList,\r\n    stepIndex,\r\n    stepServicesCache: {},\r\n\r\n    stepsData,\r\n\r\n    navigatingTo: null, // pending navigation direction\r\n    isExiting: false, // pending exit\r\n\r\n    onDone,\r\n  };\r\n};\r\n\r\n/**\r\n * Creates a new instance of the wizard state machine.\r\n * The xstate-based wizard state machine must be created only once per the lifetime of the hosting React component.\r\n * If props' changes need to be reflected in the state machine, the state machine must provide\r\n * event-based API to communicate such changes.\r\n * @param {object} options - wizard options\r\n * @returns {object} xstate machine\r\n */\r\nexport const wizardStateMachine = ({\r\n  machineId = 'WizardStateMachine',\r\n  wizardOptions,\r\n  actions = defaultActions,\r\n  services = defaultServices,\r\n  guards = defaultGuards,\r\n} = {}) => createMachine({\r\n  preserveActionOrder: true,\r\n  predictableActionArguments: true,\r\n  strict: true,\r\n\r\n  id: machineId,\r\n  context: getStartingState(machineId, wizardOptions),\r\n  initial: WizardStates.INIT,\r\n  states: {\r\n    [WizardStates.INIT]: {\r\n      entry: ['acquireStepService'],\r\n      always: [\r\n        {\r\n          target: WizardStates.STEP_ACTIVE,\r\n          cond: 'doesServiceNeedActivation',\r\n          actions: 'activateStep',\r\n        },\r\n        {\r\n          target: WizardStates.STEP_ACTIVE,\r\n        },\r\n      ],\r\n    },\r\n    [WizardStates.STEP_ACTIVE]: {\r\n      on: {\r\n        [WizardEvents.STEP_LOADING]: [WizardStates.STEP_LOADING],\r\n        [WizardEvents.CANCEL]: [\r\n          {\r\n            target: WizardStates.STEP_CANCELING,\r\n            actions: ['setExiting', 'notifyStepToCancel'],\r\n          },\r\n        ],\r\n        [WizardEvents.EXIT]: [\r\n          {\r\n            target: WizardStates.STEP_SAVING,\r\n            actions: ['setExiting', 'notifyStepToSave'],\r\n          },\r\n        ],\r\n        [WizardEvents.NAVIGATE_NEXT]: [\r\n          {\r\n            target: WizardStates.STEP_SAVING,\r\n            actions: ['setNavigatingForward', 'notifyStepToSave'],\r\n          },\r\n        ],\r\n        [WizardEvents.NAVIGATE_BACK]: [\r\n          {\r\n            // Gracefully handling of navigating back at 1st step\r\n            cond: 'isFirstStep',\r\n          },\r\n          {\r\n            target: WizardStates.INIT,\r\n            cond: 'canNavigateBackWithoutSaving',\r\n            actions: ['deactivateStep', 'setNavigatingBack', 'applyNavigation'],\r\n          },\r\n          {\r\n            target: WizardStates.STEP_SAVING,\r\n            actions: ['setNavigatingBack', 'notifyStepToSave'],\r\n          },\r\n        ],\r\n      },\r\n    },\r\n    [WizardStates.STEP_LOADING]: {\r\n      on: {\r\n        [WizardEvents.STEP_DONE_LOADING]: [\r\n          {\r\n            target: WizardStates.STEP_ACTIVE,\r\n          },\r\n        ],\r\n        [WizardEvents.STEP_FAILED_LOADING]: [\r\n          {\r\n            target: WizardStates.STEP_FAILED,\r\n          },\r\n        ],\r\n      },\r\n    },\r\n    [WizardStates.STEP_SAVING]: {\r\n      on: {\r\n        [WizardEvents.STEP_DONE_SAVING]: [\r\n          // Save and stay on the same step\r\n          {\r\n            target: WizardStates.STEP_ACTIVE,\r\n            cond: 'isNotNavigating',\r\n            actions: [logAction('STEP_SAVING: STEP_DONE_SAVING -> STEP_ACTIVE'), 'patchStepsData'],\r\n          },\r\n          // Save and exit\r\n          {\r\n            target: WizardStates.DONE,\r\n            cond: 'isExiting',\r\n            actions: [logAction('STEP_SAVING: STEP_DONE_SAVING -> done'), 'patchStepsData'],\r\n          },\r\n          // Save and navigate\r\n          {\r\n            target: WizardStates.INIT,\r\n            actions: [logAction('STEP_SAVING: STEP_DONE_SAVING -> INIT'), 'patchStepsData', 'deactivateStep', 'applyNavigation'],\r\n          },\r\n        ],\r\n        [WizardEvents.STEP_ABORTED_SAVING]: [\r\n          {\r\n            target: WizardStates.STEP_ACTIVE,\r\n            actions: [logAction('STEP_SAVING: STEP_ABORTED_SAVING -> STEP_ACTIVE'), 'resetNavigation'],\r\n          },\r\n        ],\r\n      },\r\n    },\r\n    [WizardStates.STEP_CANCELING]: {\r\n      on: {\r\n        [WizardEvents.STEP_SAVING]: [WizardStates.STEP_SAVING],\r\n        [WizardEvents.STEP_ABORTED_CANCELING]: [\r\n          {\r\n            target: WizardStates.STEP_ACTIVE,\r\n            actions: ['resetNavigation'],\r\n          },\r\n        ],\r\n        [WizardEvents.STEP_DONE_CANCELING]: [WizardStates.DONE],\r\n      },\r\n    },\r\n    [WizardStates.STEP_FAILED]: {},\r\n\r\n    [WizardStates.DONE]: {\r\n      entry: ['stopStep'],\r\n      on: {\r\n        [WizardEvents.STEP_STOPPED]: [\r\n          { target: WizardStates.FIN, actions: [logAction('DONE: STEP_STOPPED -> FIN')] },\r\n        ],\r\n      },\r\n    },\r\n\r\n    [WizardStates.FIN]: { entry: [logAction('calling notifyDone'), 'notifyDone'] },\r\n  },\r\n}, {\r\n  actions: {\r\n    ...defaultActions,\r\n    ...actions,\r\n  },\r\n  services: {\r\n    ...defaultServices,\r\n    ...services,\r\n  },\r\n  guards: {\r\n    ...defaultGuards,\r\n    ...guards,\r\n  },\r\n});\r\n","import { isFunction, delay } from 'underscore';\r\nimport { createMachine, assign, sendParent } from 'xstate';\r\nimport { StepEvents } from './step-events';\r\nimport { WizardEvents } from './wizard-events';\r\n\r\nconst StepStates = {\r\n  INIT: 'INIT',\r\n  FAILED_INIT: 'FAILED_INIT',\r\n  LOADING: 'LOADING',\r\n  SAVING: 'SAVING',\r\n  CANCELING: 'CANCELING',\r\n  VALIDATING: 'VALIDATING',\r\n  VALID: 'VALID',\r\n  INVALID: 'INVALID',\r\n  INACTIVE: 'INACTIVE',\r\n  STOPPING: 'STOPPING',\r\n  FIN: 'FIN',\r\n};\r\n\r\n// Public state selectors\r\nexport const isCanceling = state => state.matches(StepStates.CANCELING);\r\nexport const isStopping = state => state.matches(StepStates.STOPPING);\r\nexport const isFin = state => state.matches(StepStates.FIN);\r\nexport const isFailedInit = state => state.matches(StepStates.FAILED_INIT);\r\nexport const isActive = state => state.matches(StepStates.VALID) || state.matches(StepStates.INVALID);\r\nexport const isLoading = state => state.matches(StepStates.LOADING);\r\nexport const isSaving = state => state.matches(StepStates.SAVING);\r\n\r\nexport const contextSelector = state => state.context;\r\n\r\nconst defaultInitialContext = {\r\n  stepsData: {},\r\n  actionsOverride: {},\r\n  guardsOverride: {},\r\n  data: {\r\n    data: {},\r\n    isValid: true,\r\n    isDirty: false,\r\n  },\r\n  invalidSaveAttempt: 0,\r\n};\r\n\r\n// Derived state accessors\r\nconst needsLoading = () => false;\r\nconst hasIncomingSystemError = () => false;\r\nconst isValid = context => context.data.isValid;\r\nconst isDirty = context => context.data.isDirty;\r\nconst needsSaving = isDirty;\r\nconst needsStopping = (context) => {\r\n  if (isFunction(context.guardsOverride.needsStopping)) {\r\n    return context.guardsOverride.needsStopping(context);\r\n  }\r\n  return false;\r\n};\r\n// State \"assigners\"\r\nconst replaceData = assign({\r\n  data: (_, event) => event.data,\r\n});\r\nconst patchStepsData = assign({\r\n  stepsData: (context, event) => ({\r\n    ...context.stepsData,\r\n    ...event.stepsData,\r\n  }),\r\n});\r\nconst replaceStepsData = assign({\r\n  stepsData: (_, event) => event.stepsData,\r\n});\r\nconst patchData = assign({\r\n  data: (context, event) => ({\r\n    ...context.data,\r\n    ...event.data,\r\n  }),\r\n});\r\nconst clearErrors = () => { };\r\nconst onInvalidSaveAttempt = assign({\r\n  // eslint-disable-next-line no-bitwise\r\n  invalidSaveAttempt: context => (context.invalidSaveAttempt | 0) + 1,\r\n});\r\nconst overrideActions = assign({\r\n  actionsOverride: (context, event) => ({\r\n    ...context.actionsOverride,\r\n    ...event.data,\r\n  }),\r\n});\r\nconst overrideGuards = assign({\r\n  guardsOverride: (context, event) => ({\r\n    ...context.guardsOverride,\r\n    ...event.data,\r\n  }),\r\n});\r\n\r\nconst notifyLoading = sendParent(WizardEvents.STEP_LOADING);\r\nconst notifyDoneLoading = sendParent(WizardEvents.STEP_DONE_LOADING);\r\n// non-recoverable step failure\r\nconst notifyFailedLoading = sendParent(WizardEvents.STEP_FAILED_LOADING);\r\n\r\nconst notifySaving = sendParent(WizardEvents.STEP_SAVING);\r\nconst notifyDoneSaving = sendParent((context/* , event */) => ({\r\n  type: WizardEvents.STEP_DONE_SAVING,\r\n  stepsData: context.stepsData,\r\n}));\r\nconst notifyDoneCanceling = sendParent({ type: WizardEvents.STEP_DONE_CANCELING });\r\nconst notifyAbortedSaving = sendParent(WizardEvents.STEP_ABORTED_SAVING);\r\nconst notifyAbortedCanceling = sendParent(WizardEvents.STEP_ABORTED_CANCELING);\r\nconst notifyStopped = sendParent({ type: WizardEvents.STEP_STOPPED });\r\nconst requestConfirmation = context => new Promise((resolve, reject) => {\r\n  delay(() => {\r\n    const response = { aborted: false };\r\n    if (isFunction(context.actionsOverride.confirmCancel)) {\r\n      if (!context.actionsOverride.confirmCancel()) {\r\n        response.aborted = true;\r\n      }\r\n    }\r\n    if (response.aborted) {\r\n      reject();\r\n    } else {\r\n      resolve();\r\n    }\r\n  }, 200);\r\n});\r\n\r\n\r\nconst defaultActions = {\r\n  notifyLoading,\r\n  notifySaving,\r\n  notifyAbortedSaving,\r\n  notifyAbortedCanceling,\r\n  notifyFailedLoading,\r\n  notifyDoneLoading,\r\n  notifyDoneSaving,\r\n  notifyDoneCanceling,\r\n  notifyStopped,\r\n\r\n  replaceData,\r\n  patchData,\r\n  replaceStepsData,\r\n  patchStepsData,\r\n\r\n  clearErrors,\r\n  onInvalidSaveAttempt,\r\n\r\n  overrideActions,\r\n  overrideGuards,\r\n};\r\n\r\nconst defaultServices = {\r\n  requestConfirmation,\r\n};\r\n\r\nconst defaultGuards = {\r\n  needsLoading,\r\n  isValid,\r\n  needsSaving,\r\n  needsStopping,\r\n};\r\n\r\n\r\nexport const stepStateMachine = ({\r\n  machineId = 'StepStateMachine',\r\n  initialContext = defaultInitialContext,\r\n  actions = defaultActions,\r\n  services = defaultServices,\r\n  guards = defaultGuards,\r\n} = {}) => createMachine({\r\n  preserveActionOrder: true,\r\n  predictableActionArguments: true,\r\n  strict: true,\r\n\r\n  id: machineId,\r\n  context: {\r\n    ...defaultInitialContext,\r\n    ...initialContext,\r\n  },\r\n  initial: StepStates.INIT,\r\n  on: {\r\n    [StepEvents.OVERRIDE_ACTIONS]: [\r\n      { actions: 'overrideActions' },\r\n    ],\r\n    [StepEvents.OVERRIDE_GUARDS]: [\r\n      { actions: 'overrideGuards' },\r\n    ],\r\n    [StepEvents.STOP]: [\r\n      { target: StepStates.STOPPING, cond: 'needsStopping' },\r\n      StepStates.FIN,\r\n    ],\r\n  },\r\n  states: {\r\n    [StepStates.INIT]: {\r\n      always: [\r\n        { target: StepStates.LOADING, cond: 'needsLoading' },\r\n        { target: StepStates.VALIDATING },\r\n      ],\r\n    },\r\n    [StepStates.LOADING]: {\r\n      entry: ['notifyLoading'],\r\n      on: {\r\n        [StepEvents.DONE_LOADING]: {\r\n          target: StepStates.VALIDATING,\r\n          actions: [\r\n            'replaceData',\r\n            'patchStepsData',\r\n            'notifyDoneLoading',\r\n          ],\r\n        },\r\n        [StepEvents.FAILED_LOADING]: [\r\n          {\r\n            target: StepStates.FAILED_INIT,\r\n            cond: hasIncomingSystemError,\r\n            actions: [\r\n              'replaceData',\r\n              'patchStepsData',\r\n              'notifyFailedLoading',\r\n            ],\r\n          },\r\n          {\r\n            target: StepStates.VALIDATING,\r\n            actions: [\r\n              'replaceData',\r\n              'patchStepsData',\r\n              'notifyDoneLoading',\r\n            ],\r\n          },\r\n        ],\r\n      },\r\n    },\r\n    [StepStates.FAILED_INIT]: {},\r\n    [StepStates.SAVING]: {\r\n      entry: ['clearErrors', 'notifySaving'],\r\n      on: {\r\n        [StepEvents.DONE_SAVING]: {\r\n          target: StepStates.VALIDATING,\r\n          actions: [\r\n            'replaceData',\r\n            'patchStepsData',\r\n            'notifyDoneSaving',\r\n          ],\r\n        },\r\n        [StepEvents.FAILED_SAVING]: {\r\n          target: StepStates.VALIDATING,\r\n          actions: [\r\n            'replaceData',\r\n            'patchStepsData',\r\n            'onInvalidSaveAttempt',\r\n            'notifyAbortedSaving',\r\n          ],\r\n        },\r\n      },\r\n    },\r\n    [StepStates.CANCELING]: {\r\n      invoke: {\r\n        id: 'requestConfirmationCallback',\r\n        src: 'requestConfirmation',\r\n        onDone: {\r\n          target: StepStates.VALIDATING,\r\n          actions: ['notifyDoneCanceling'],\r\n        },\r\n        onError: {\r\n          target: StepStates.VALIDATING,\r\n          actions: ['notifyAbortedCanceling'],\r\n        },\r\n      },\r\n    },\r\n    [StepStates.STOPPING]: {\r\n      on: {\r\n        [StepEvents.DONE_STOPPING]: [StepStates.FIN],\r\n      },\r\n    },\r\n    [StepStates.VALIDATING]: {\r\n      always: [\r\n        { target: StepStates.VALID, cond: 'isValid' },\r\n        { target: StepStates.INVALID },\r\n      ],\r\n    },\r\n    [StepStates.VALID]: {\r\n      on: {\r\n        [StepEvents.UPDATE_VALIDATION]: [\r\n          {\r\n            target: StepStates.VALIDATING,\r\n            actions: ['patchData'],\r\n          },\r\n        ],\r\n        [StepEvents.CANCEL]: [\r\n          { target: StepStates.CANCELING, cond: 'needsSaving' },\r\n          { actions: ['notifyDoneCanceling'] },\r\n        ],\r\n        [StepEvents.SAVE]: [\r\n          { target: StepStates.SAVING, cond: 'needsSaving' },\r\n          { actions: ['notifyDoneSaving'] },\r\n        ],\r\n        [StepEvents.DEACTIVATE]: StepStates.INACTIVE,\r\n      },\r\n    },\r\n    [StepStates.INVALID]: {\r\n      on: {\r\n        [StepEvents.UPDATE_VALIDATION]: [\r\n          {\r\n            target: StepStates.VALIDATING,\r\n            actions: ['patchData'],\r\n          },\r\n        ],\r\n        [StepEvents.CANCEL]: [\r\n          { target: StepStates.CANCELING, cond: 'needsSaving' },\r\n          { actions: ['notifyDoneCanceling'] },\r\n        ],\r\n        [StepEvents.SAVE]: {\r\n          actions: ['onInvalidSaveAttempt', 'notifyAbortedSaving'],\r\n        },\r\n        [StepEvents.DEACTIVATE]: StepStates.INACTIVE,\r\n      },\r\n    },\r\n    [StepStates.INACTIVE]: {\r\n      on: {\r\n        [StepEvents.ACTIVATE]: [\r\n          { target: StepStates.LOADING, cond: 'needsLoading', actions: ['replaceStepsData'] },\r\n          { target: StepStates.VALIDATING, actions: ['replaceStepsData'] },\r\n        ],\r\n      },\r\n    },\r\n    [StepStates.FIN]: {\r\n      entry: ['notifyStopped'],\r\n    },\r\n  },\r\n}, {\r\n  actions: {\r\n    ...defaultActions,\r\n    ...actions,\r\n  },\r\n  services: {\r\n    ...defaultServices,\r\n    ...services,\r\n  },\r\n  guards: {\r\n    ...defaultGuards,\r\n    ...guards,\r\n  },\r\n});\r\n","import PropTypes from 'prop-types';\r\n\r\nexport const xstateStateMachine = PropTypes.oneOfType([\r\n  PropTypes.shape({}),\r\n  PropTypes.func,\r\n]);\r\n\r\nexport const stepListProp = PropTypes.arrayOf(PropTypes.shape({\r\n  id: PropTypes.string.isRequired,\r\n  title: PropTypes.string.isRequired,\r\n  StepMachine: xstateStateMachine.isRequired,\r\n  StepMachineOptions: PropTypes.func.isRequired,\r\n  StepComponent: PropTypes.elementType.isRequired,\r\n}));\r\n","import { mergeStyles, convertToLocalStyle, glyphIconStyle }\r\n  from '@bingads-webui-campaign-react/common-styles';\r\n\r\nconst borderWidth = '2px';\r\n\r\nconst formStyle = ({ palette = {} }) => ({\r\n  '.error': {\r\n    color: '#A80000',\r\n  },\r\n\r\n  'input.error, select.error, textarea.error, input.campaign-error-row, select.campaign-error-row, textarea.campaign-error-row': {\r\n    border: '1px solid @input-error-border !important',\r\n    color: palette.neutralPrimary,\r\n  },\r\n});\r\n\r\nexport const getWizardStyles = (components, theme = {}) => ({\r\n  '@global': {\r\n    ...components.spinnerKeyframe, // FIXME: UINext must load this, or '@bingads-webui-react/ui-blocker' must properly style itself\r\n  },\r\n  hidden: {\r\n    display: 'none',\r\n  },\r\n  show: {\r\n    display: 'flex',\r\n  },\r\n  uiBlockerAdapter: {\r\n    ...mergeStyles(\r\n      { theme },\r\n      components.reactUIBlockerStyle(theme.palette, 'rgba(255, 255, 255, 0.4)'),\r\n      {\r\n        '& .react-block-ui-none, & .react-block-ui': {\r\n          display: 'flex',\r\n          flexDirection: 'column',\r\n          flexGrow: 1,\r\n          overflowY: 'hidden', // to not extend to the content, but shrink to flex-parent\r\n        },\r\n      },\r\n      {\r\n        display: 'flex',\r\n        flexDirection: 'column',\r\n        flexGrow: 1,\r\n        overflowY: 'hidden',\r\n      }\r\n    ),\r\n  },\r\n  wizardContainer: {\r\n    ...mergeStyles(\r\n      { theme },\r\n      convertToLocalStyle(components.helpbuttonStyle(theme)),\r\n      convertToLocalStyle(glyphIconStyle(theme)),\r\n      {\r\n        display: 'flex',\r\n        flexGrow: 1,\r\n        overflowY: 'hidden',\r\n      }\r\n    ),\r\n  },\r\n  // StepProgressList on left side\r\n  wizardListContainer: {\r\n    width: '228px',\r\n    minWidth: '228px',\r\n    borderRight: `1px solid ${theme.palette.neutralQuaternaryAlt}`,\r\n    paddingLeft: '32px',\r\n    paddingTop: '32px',\r\n    paddingBottom: '32px',\r\n    overflow: 'hidden auto',\r\n\r\n    '& ol': {\r\n      margin: 0,\r\n      padding: 0,\r\n      listStyle: 'none',\r\n    },\r\n\r\n    // Styles for drawing the vertical line\r\n    '& .step-progress-list-item': {\r\n      borderLeft: `${borderWidth} solid ${theme.palette.blue}`,\r\n      '&.step-progress-list-item-ahead': { borderLeftColor: '#ebebeb' },\r\n    },\r\n\r\n    '& .step-progress-list-item-title': {\r\n      position: 'absolute',\r\n      float: 'right',\r\n      maxWidth: 165,\r\n    },\r\n\r\n    // top level list items\r\n    '& ol.step-progress-list>.step-progress-list-item': {\r\n      paddingTop: 39,\r\n      position: 'relative',\r\n\r\n      '&:first-child': { borderLeftColor: theme.palette.white, paddingTop: 0 },\r\n\r\n      '&>.step-progress-list-item-glyphicon': {\r\n        marginLeft: '-8px',\r\n        marginRight: '8px',\r\n        background: theme.palette.white,\r\n        paddingTop: '5px',\r\n        paddingBottom: '4px',\r\n      },\r\n\r\n      '&>.step-progress-list-item-glyphicon.iconba-RadioBullet2': {\r\n        paddingTop: 0,\r\n        paddingBottom: 0,\r\n        transform: 'scale(1.52)',\r\n      },\r\n    },\r\n\r\n    // nested list items\r\n    '& ol.step-progress-list-item-list>.step-progress-list-item': {\r\n      fontSize: '12px',\r\n      lineHeight: '16px',\r\n      paddingTop: '24px',\r\n      marginLeft: `-${borderWidth}`,\r\n\r\n      '&>.step-progress-list-item-glyphicon': {\r\n        marginLeft: '-8px',\r\n        marginRight: '12px',\r\n        white: theme.palette.white,\r\n        paddingBottom: '1px',\r\n      },\r\n    },\r\n\r\n    '& .step-progress-list-item-selected, & .step-progress-list-item-contains-selected': { fontWeight: '600' },\r\n\r\n    // glyphicon colors\r\n    '& .step-progress-list-item-behind .step-progress-list-item-glyphicon': {\r\n      color: theme.palette.blue,\r\n    },\r\n    '& .step-progress-list-item-selected .step-progress-list-item-glyphicon, & .step-progress-list-item-contains-selected>.step-progress-list-item-glyphicon': {\r\n      color: '#c0def6',\r\n    },\r\n    '& .step-progress-list-item-ahead .step-progress-list-item-glyphicon': {\r\n      color: theme.palette.neutralLight,\r\n    },\r\n  },\r\n  wizardMainContainer: {\r\n    backgroundColor: theme.palette.neutralLighterAlt,\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    flexGrow: 1,\r\n  },\r\n  wizardStepContainer: {\r\n    display: 'flex',\r\n    overflowY: 'auto',\r\n  },\r\n  wizardSingleStepLayoutStepScrollingContainer: {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    overflowY: 'auto',\r\n  },\r\n  wizardSingleStepLayoutCenteredStepContainer: {\r\n    display: 'flex',\r\n    flexDirection: 'column',\r\n    marginLeft: 'auto',\r\n    marginRight: 'auto',\r\n  },\r\n  wizardSingleStepLayoutStepContainer: {\r\n    display: 'flex',\r\n  },\r\n  wizardStep: {\r\n    ...mergeStyles(\r\n      { theme },\r\n      convertToLocalStyle(formStyle(theme)),\r\n      {\r\n        display: 'flex',\r\n        flexBasis: '1px',\r\n        flexDirection: 'column',\r\n        paddingLeft: 32,\r\n        paddingRight: 32,\r\n      }\r\n    ),\r\n  },\r\n  wizardFooter: {\r\n    marginTop: 'auto', // to expand as flex-item\r\n    backgroundColor: theme.palette.white,\r\n  },\r\n  mobileNavContainer: {\r\n    position: 'fixed',\r\n    display: 'none',\r\n    height: 60,\r\n    width: '100%',\r\n    background: theme.palette.white,\r\n    zIndex: 2,\r\n    boxShadow: '0px 3.2px 7.2px rgba(0, 0, 0, 0.132), 0px 0.6px 1.8px rgba(0, 0, 0, 0.108)',\r\n  },\r\n});\r\n","import { useEffect, useRef } from 'react';\r\n\r\nexport const useIsMounted = () => {\r\n  const isMountedRef = useRef(false);\r\n  useEffect(() => {\r\n    isMountedRef.current = true;\r\n    return () => {\r\n      isMountedRef.current = false;\r\n    };\r\n  }, []);\r\n\r\n  return isMountedRef;\r\n};\r\n","import { useEffect, useRef } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { useSelector } from '@xstate/react';\r\nimport { createAsyncToken } from '@bingads-webui-universal/primitive-utilities';\r\nimport {\r\n  isLoading as isLoadingSelector,\r\n  isSaving as isSavingSelector, contextSelector,\r\n  StepEvents,\r\n  log,\r\n} from '@bingads-webui-campaign-react/step-wizard-machine';\r\nimport { useIsMounted } from './use-is-mounted';\r\n\r\n/**\r\n * Loads step's data asynchronously. The returned promise must resolve\r\n * into a single object, opaque to the step, which will be saved\r\n * in the context under the `data` property, completely replacing\r\n * the current value.\r\n *\r\n * The function is called when the wizard enters the step.\r\n * The wizard and the step will be blocked until the promise resolves.\r\n *\r\n * If promise is rejected, the step will:\r\n * - transition to `FAILED_INIT` state if `hasIncomingSystemError` returns true;\r\n * - transition through `VALIDATING -> (VALID | INVALID)`.\r\n * @callback loadData\r\n * @param {Object} context - the current context\r\n * @returns {Promise<Object>} a promise that must resolve\r\n * into a single object, opaque to the step, which will be saved\r\n * in the context under the `data` property, completely replacing\r\n * the current value.\r\n */\r\n\r\n/**\r\n * Saves step's data asynchronously. The returned promise must resolve\r\n * into a single object, opaque to the step, which will be saved\r\n * in the context under the `data` property, completely replacing\r\n * the current value.\r\n *\r\n * The function is called when the wizard attempts to leave the step.\r\n * The wizard and the step will be blocked until the promise resolves.\r\n *\r\n * If promise is rejected, the step will transition through `VALIDATING -> (VALID | INVALID)`.\r\n * @callback saveData\r\n * @param {Object} context - the current context\r\n * @returns {Promise<Object>} a promise that must resolve\r\n * into a single object, opaque to the step, which will be saved\r\n * in the context under the `data` property, completely replacing\r\n * the current value.\r\n */\r\n\r\n\r\n/**\r\n * Default step repository React component.\r\n * @param {Object} props the component's props\r\n * @param {Object} props.stepService an instance of the step's state machine\r\n * @param {loadData} props.loadData a callback which loads data\r\n * @param {saveData} props.saveData a callback which saves data\r\n * @returns {Element} an empty VDOM\r\n */\r\nexport const StepRepository = ({\r\n  stepService,\r\n  loadData,\r\n  saveData,\r\n}) => {\r\n  const isMountedRef = useIsMounted();\r\n\r\n  const isLoading = useSelector(stepService, isLoadingSelector);\r\n  const isSaving = useSelector(stepService, isSavingSelector);\r\n  const context = useSelector(stepService, contextSelector);\r\n  const contextRef = useRef(context);\r\n  contextRef.current = context;\r\n  const asyncTokenRef = useRef();\r\n\r\n  useEffect(() => {\r\n    if (isLoading) {\r\n      log('StepRepository loading data with loadData');\r\n      if (asyncTokenRef.current) {\r\n        asyncTokenRef.current.cancel();\r\n        asyncTokenRef.current = null;\r\n      }\r\n      asyncTokenRef.current = createAsyncToken(loadData(contextRef.current))\r\n        .on({\r\n          onSuccess: (arg0) => {\r\n            if (isMountedRef.current) {\r\n              log('StepRepository sending DONE_LOADING');\r\n              stepService.send({ type: StepEvents.DONE_LOADING, data: arg0 });\r\n            } else {\r\n              log('StepRepository ignoring sending DONE_LOADING due to unmount');\r\n            }\r\n          },\r\n          onError: (arg0) => {\r\n            if (isMountedRef.current) {\r\n              log('StepRepository sending FAILED_LOADING');\r\n              stepService.send({ type: StepEvents.FAILED_LOADING, data: arg0 });\r\n            } else {\r\n              log('StepRepository ignoring sending FAILED_LOADING due to unmount');\r\n            }\r\n          },\r\n        });\r\n    } else if (isSaving) {\r\n      log('StepRepository saving data with saveData');\r\n      if (asyncTokenRef.current) {\r\n        asyncTokenRef.current.cancel();\r\n        asyncTokenRef.current = null;\r\n      }\r\n      asyncTokenRef.current = createAsyncToken(saveData(contextRef.current))\r\n        .on({\r\n          onSuccess: (arg0) => {\r\n            if (isMountedRef.current) {\r\n              log('StepRepository sending DONE_SAVING');\r\n              stepService.send({ type: StepEvents.DONE_SAVING, data: arg0 });\r\n            } else {\r\n              log('StepRepository ignoring sending DONE_SAVING due to unmount');\r\n            }\r\n          },\r\n          onError: (arg0) => {\r\n            if (isMountedRef.current) {\r\n              log('StepRepository sending FAILED_SAVING');\r\n              stepService.send({ type: StepEvents.FAILED_SAVING, data: arg0 });\r\n            } else {\r\n              log('StepRepository ignoring sending FAILED_SAVING due to unmount');\r\n            }\r\n          },\r\n        });\r\n    }\r\n  }, [stepService, loadData, saveData, isLoading, isSaving, isMountedRef]);\r\n\r\n  log('StepRepository.render: isLoading=_, isSaving=_', isLoading, isSaving);\r\n\r\n  return null;\r\n};\r\n\r\nStepRepository.propTypes = {\r\n  stepService: PropTypes.shape({\r\n    subscribe: PropTypes.func.isRequired,\r\n    send: PropTypes.func,\r\n  }).isRequired,\r\n  loadData: PropTypes.func.isRequired,\r\n  saveData: PropTypes.func.isRequired,\r\n};\r\n","import { isEmpty } from 'underscore';\r\nimport { useCallback, useContext, useMemo, useRef, useEffect } from 'react';\r\nimport { useInterpret, useSelector } from '@xstate/react';\r\nimport { withProps } from '@bingads-webui-react/with-props';\r\nimport { useRefInit } from '@bingads-webui-campaign-react/common-generic-hooks';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { setClarityTag } from '@bingads-webui-universal/clarity';\r\nimport {\r\n  wizardStateMachine, WizardEvents,\r\n  isBusySelector, stepIndexSelector, stepServicesCacheSelector,\r\n  wasSavingSelector, wasWaitingForConfirmationSelector, wasStoppingSelector, stateLoggingListener,\r\n} from '@bingads-webui-campaign-react/step-wizard-machine';\r\nimport { StepRepository } from '../shared/step-repository';\r\n\r\nconst getStepRepository = stepInfo => (!stepInfo.stepRepositoryConfig && !stepInfo.StepRepository ?\r\n  undefined :\r\n  withProps(\r\n    stepInfo.stepRepositoryConfig || {},\r\n    stepInfo.StepRepository || StepRepository\r\n  ));\r\n\r\nexport const useWizardState = (props) => {\r\n  const {\r\n    routeToNavigateToWhenDone,\r\n    scopeToRemoveWhenDone,\r\n    scope,\r\n    instrumentation,\r\n    permissions,\r\n    extraStepsData = {},\r\n    wizardScenario: {\r\n      scenarioName, isCenteredLayout, isEditing, stepList, withContentFooter,\r\n    },\r\n    machineId = 'StepWizard',\r\n  } = props;\r\n  const { scenario, activity } = useMemo(() => instrumentation.createScenarioAndActivity({\r\n    scenarioName, // TODO: consider '...ForRetail' and '...ForSearch\r\n    activityName: isEditing ? 'Settings' : 'Creation',\r\n  }), [instrumentation, isEditing, scenarioName]);\r\n\r\n  useEffect(() => {\r\n    setClarityTag({ StepWizardScenario: scenarioName });\r\n  }, [scenarioName]);\r\n\r\n  const i18n = useContext(I18nContext);\r\n  const serverContext = useContext(ServerContext);\r\n\r\n  const scopeRef = useRef(scope);\r\n  scopeRef.current = scope;\r\n  const onDone = useCallback(() => {\r\n    if (!isEmpty(scopeToRemoveWhenDone)) {\r\n      scopeRef.current.remove(scopeToRemoveWhenDone);\r\n    }\r\n    scopeRef.current.save(routeToNavigateToWhenDone);\r\n  }, [routeToNavigateToWhenDone, scopeToRemoveWhenDone]);\r\n\r\n  // The xstate-based wizard state machine must be created only once per the lifetime of the component.\r\n  // If props' changes need to be reflected in the state machine, the state machine must provide\r\n  // event-based API to communicate such changes.\r\n  const wizardMachineRef = useRefInit(() => wizardStateMachine({\r\n    machineId,\r\n    wizardOptions: {\r\n      stepList,\r\n      onDone,\r\n      stepsData: {\r\n        permissions,\r\n        isEditing,\r\n        scenarioName,\r\n        scenario,\r\n        activity,\r\n        i18n,\r\n        serverContext,\r\n        scope,\r\n        ...scope.values,\r\n        ...extraStepsData,\r\n      },\r\n    },\r\n  }));\r\n  const wizardMachine = wizardMachineRef.current;\r\n  const service = useInterpret(wizardMachine, undefined, stateLoggingListener);\r\n  const { send } = service;\r\n\r\n  const stepServicesCache = useSelector(service, stepServicesCacheSelector);\r\n  const stepListWithServiceInfo = useMemo(() => stepList.map(stepInfo2 => ({\r\n    stepInfo: stepInfo2,\r\n    stepService: stepServicesCache[stepInfo2.id],\r\n    StepRepository: getStepRepository(stepInfo2),\r\n  })), [stepList, stepServicesCache]);\r\n\r\n  const stepIndex = useSelector(service, stepIndexSelector);\r\n  const isBusy = useSelector(service, isBusySelector);\r\n  const wasSaving = useSelector(service, wasSavingSelector);\r\n  const wasWaitingForConfirmation = useSelector(service, wasWaitingForConfirmationSelector);\r\n  const wasStopping = useSelector(service, wasStoppingSelector);\r\n\r\n  const stepInfo = useMemo(() => stepList[stepIndex], [stepIndex, stepList]);\r\n\r\n  const isReadOnlyUser = useMemo(() => permissions.IsReadOnlyUser || serverContext.CurrentAccount.Status === 32, [permissions.IsReadOnlyUser, serverContext.CurrentAccount.Status]); // 32 is InActive\r\n\r\n  const state = {\r\n    isReadOnlyUser,\r\n    isCenteredLayout,\r\n    withContentFooter,\r\n    i18n,\r\n    scenarioName,\r\n    scenario,\r\n    activity,\r\n\r\n    stepListWithServiceInfo,\r\n    stepIndex,\r\n    stepInfo,\r\n    isBusy,\r\n    wasSaving,\r\n    wasWaitingForConfirmation,\r\n    wasStopping,\r\n  };\r\n\r\n\r\n  const saveAndNavigateNext = useCallback(() => {\r\n    send(WizardEvents.NAVIGATE_NEXT);\r\n  }, [send]);\r\n  const saveAndNavigateBack = useCallback(() => {\r\n    send(WizardEvents.NAVIGATE_BACK);\r\n  }, [send]);\r\n  const cancelAndExit = useCallback(() => {\r\n    send(WizardEvents.CANCEL);\r\n  }, [send]);\r\n  const saveAndExit = useCallback(() => {\r\n    send(WizardEvents.EXIT);\r\n  }, [send]);\r\n\r\n  useEffect(() => {\r\n    window.addEventListener('popstate', cancelAndExit);\r\n\r\n    return () => {\r\n      window.removeEventListener('popstate', cancelAndExit);\r\n    };\r\n  }, [cancelAndExit]);\r\n\r\n  const api = {\r\n    saveAndNavigateNext, saveAndNavigateBack, cancelAndExit, saveAndExit,\r\n  };\r\n\r\n  return [state, api];\r\n};\r\n","export const getStepProgressItemGlyphicon = (step) => {\r\n  // sub steps\r\n  if (step.path.indexOf('.') >= 0) {\r\n    return 'ba-RadioBullet';\r\n  }\r\n\r\n  if (step.isSelected || step.containsSelected) {\r\n    return 'ba-RadioBullet2'; // current step\r\n  } else if (step.isBehind) {\r\n    return 'ba-CompletedSolid';\r\n  }\r\n\r\n  // default\r\n  return 'ba-RadioBtnOff';\r\n};\r\n","export const footerStyleOverrides = {\r\n  skippingLink: {\r\n    marginLeft: 28,\r\n  },\r\n  cancelButton: {\r\n    marginLeft: 12,\r\n  },\r\n};\r\n","import { last } from 'underscore';\r\nimport React, { useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { VerticalSeparatedLayout } from '@bingads-webui-react/steps';\r\nimport { StepFooter } from '@bingads-webui-campaign-react/step-wizard-layout';\r\nimport { getStepProgressItemGlyphicon } from '../styles/get-step-progress-item-glyphicon';\r\nimport { footerStyleOverrides } from '../styles/footer-style-overrides';\r\n\r\nconst {\r\n  StepsContextProvider,\r\n  StepContainer,\r\n  StepProgressList,\r\n} = VerticalSeparatedLayout;\r\n\r\n// Navigation buttons scenarios:\r\n//    - 1st step:\r\n//      - Before campaign is created:\r\n//        - Next button: \"Save & go to the next step\"\r\n//        - Cancel button: \"Cancel\"\r\n//      - After campaign is created:\r\n//        - Next button: \"Save & go to the next step\"\r\n//        - Exit button: \"Save & exit\"\r\n//    - [2nd..last) steps:\r\n//      - Next button:  \"Save & go to the next step\"\r\n//      - Back button: \"Back\"\r\n//      - Exit button: \"Save & exit\"\r\n//    - last step (with data entry):\r\n//      - Next/Exit button: \"Save\"\r\n//      - Back button: \"Back\"\r\n//    - last step (read-only):\r\n//      - Next/Exit button: \"Done\"\r\n//      - Back button: \"Back\"\r\n\r\nexport const MultiStepLayout = React.memo(({\r\n  children,\r\n  wizardState: {\r\n    i18n, stepInfo, isBusy, stepIndex, stepListWithServiceInfo,\r\n  },\r\n  wizardActions: {\r\n    saveAndNavigateNext, saveAndNavigateBack, cancelAndExit, saveAndExit,\r\n  },\r\n  classes,\r\n}) => {\r\n  const stepFooter = useMemo(() => {\r\n    const beforeLastStepNextButtonText = i18n.getString(_TL_('Save & go to next step'));\r\n    const saveAndExitButtonText = i18n.getString(_TL_('Save & exit'));\r\n    const previousButtonText = i18n.getString(_TL_('Back'));\r\n    if (stepIndex === 0) {\r\n      // 1st step\r\n      // will use the presence of 2nd step's stepService\r\n      // as the fact that campaign has been saved\r\n      if (stepListWithServiceInfo[1].stepService) {\r\n        // After campaign is created\r\n        return (\r\n          <StepFooter\r\n            className={classNames('wizard-step-footer', classes.wizardFooter)}\r\n            styleOverrides={footerStyleOverrides}\r\n            nextButtonText={beforeLastStepNextButtonText}\r\n            onNextClick={saveAndNavigateNext}\r\n            isNextClickDisabled={isBusy}\r\n            // Using cancel button for \"Save & exit\"\r\n            onCancelClick={saveAndExit}\r\n            cancelButtonText={saveAndExitButtonText}\r\n          />\r\n        );\r\n      }\r\n      // Before campaign is created\r\n      return (\r\n        <StepFooter\r\n          className={classNames('wizard-step-footer', classes.wizardFooter)}\r\n          styleOverrides={footerStyleOverrides}\r\n          nextButtonText={beforeLastStepNextButtonText}\r\n          onNextClick={saveAndNavigateNext}\r\n          isNextClickDisabled={isBusy}\r\n          // onCancelClick={cancelAndExit}\r\n          // Using the \"skip\" link-button for \"Cancel\"\r\n          onSkippingLinkClick={cancelAndExit}\r\n          skippingLinkTitle={i18n.getString(_TL_('Cancel'))}\r\n        />\r\n      );\r\n    }\r\n    if (stepIndex < stepListWithServiceInfo.length - 1) {\r\n      // [2nd..last) steps\r\n      return (\r\n        <StepFooter\r\n          className={classNames('wizard-step-footer', classes.wizardFooter)}\r\n          styleOverrides={footerStyleOverrides}\r\n          previousButtonAfterNext\r\n          nextButtonText={beforeLastStepNextButtonText}\r\n          onNextClick={saveAndNavigateNext}\r\n          isNextClickDisabled={isBusy}\r\n          previousButtonText={previousButtonText}\r\n          onPreviousClick={saveAndNavigateBack}\r\n          isPreviousClickDisabled={isBusy}\r\n          // Using cancel button for \"Save & exit\"\r\n          onCancelClick={saveAndExit}\r\n          cancelButtonText={saveAndExitButtonText}\r\n        />\r\n      );\r\n    }\r\n    // last step\r\n    const lastStepInfo = last(stepListWithServiceInfo);\r\n    if (lastStepInfo.isReadOnly) {\r\n      return (\r\n        <StepFooter\r\n          className={classNames('wizard-step-footer', classes.wizardFooter)}\r\n          styleOverrides={footerStyleOverrides}\r\n          previousButtonAfterNext\r\n          nextButtonText={i18n.getString(_TL_('Done'))}\r\n          onNextClick={saveAndNavigateNext}\r\n          isNextClickDisabled={isBusy}\r\n          previousButtonText={previousButtonText}\r\n          onPreviousClick={saveAndNavigateBack}\r\n          isPreviousClickDisabled={isBusy}\r\n        />\r\n      );\r\n    }\r\n\r\n    return (\r\n      <StepFooter\r\n        className={classNames('wizard-step-footer', classes.wizardFooter)}\r\n        styleOverrides={footerStyleOverrides}\r\n        previousButtonAfterNext\r\n        nextButtonText={i18n.getString(_TL_('Save'))}\r\n        onNextClick={saveAndNavigateNext}\r\n        isNextClickDisabled={isBusy}\r\n        previousButtonText={previousButtonText}\r\n        onPreviousClick={saveAndNavigateBack}\r\n        isPreviousClickDisabled={isBusy}\r\n      />\r\n    );\r\n  }, [\r\n    stepIndex, classes.wizardFooter, i18n, stepListWithServiceInfo,\r\n    saveAndNavigateNext, saveAndNavigateBack, saveAndExit, cancelAndExit, isBusy,\r\n  ]);\r\n\r\n  return (\r\n    <StepsContextProvider currentPath={stepInfo.id}>\r\n      <div className={classes.wizardContainer}>\r\n        <div className={classNames('wizard-list-container', classes.wizardListContainer)}>\r\n          <StepProgressList getItemGlyphicon={getStepProgressItemGlyphicon} />\r\n        </div>\r\n        <div className={classNames('wizard-main-container', classes.wizardMainContainer)}>\r\n          <StepContainer className={classNames('wizard-step-container', classes.wizardStepContainer)}>\r\n            {children}\r\n          </StepContainer>\r\n          {stepFooter}\r\n        </div>\r\n      </div>\r\n    </StepsContextProvider>\r\n  );\r\n});\r\n\r\nMultiStepLayout.propTypes = {\r\n  children: PropTypes.oneOfType([\r\n    PropTypes.arrayOf(PropTypes.node),\r\n    PropTypes.node,\r\n  ]).isRequired,\r\n  wizardState: PropTypes.shape({\r\n    i18n: PropTypes.shape({\r\n      getString: PropTypes.func.isRequired,\r\n    }).isRequired,\r\n    stepInfo: PropTypes.shape({\r\n      id: PropTypes.string.isRequired,\r\n    }),\r\n    stepIndex: PropTypes.number.isRequired,\r\n    stepListWithServiceInfo: PropTypes.arrayOf(PropTypes.shape({\r\n      stepService: PropTypes.shape({}),\r\n    })).isRequired,\r\n    isBusy: PropTypes.bool.isRequired,\r\n  }).isRequired,\r\n  wizardActions: PropTypes.shape({\r\n    saveAndNavigateNext: PropTypes.func.isRequired,\r\n    saveAndNavigateBack: PropTypes.func.isRequired,\r\n    cancelAndExit: PropTypes.func.isRequired,\r\n    saveAndExit: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  classes: PropTypes.shape({\r\n    wizardContainer: PropTypes.string.isRequired,\r\n    wizardListContainer: PropTypes.string.isRequired,\r\n    wizardMainContainer: PropTypes.string.isRequired,\r\n    wizardStepContainer: PropTypes.string.isRequired,\r\n    wizardFooter: PropTypes.string.isRequired,\r\n  }).isRequired,\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { VerticalSeparatedLayout } from '@bingads-webui-react/steps';\r\nimport { StepFooter } from '@bingads-webui-campaign-react/step-wizard-layout';\r\nimport { footerStyleOverrides } from '../styles/footer-style-overrides';\r\n\r\nconst {\r\n  StepsContextProvider,\r\n  StepContainer,\r\n} = VerticalSeparatedLayout;\r\n\r\nexport const SingleStepLayout = React.memo(({\r\n  children,\r\n  wizardState: {\r\n    i18n,\r\n    stepInfo,\r\n    isBusy,\r\n    isReadOnlyUser,\r\n  },\r\n  wizardActions: {\r\n    saveAndNavigateNext,\r\n    cancelAndExit,\r\n  },\r\n  isCenteredLayout, classes,\r\n}) => (\r\n  <StepsContextProvider currentPath={stepInfo.id}>\r\n    <div className={classNames(classes.wizardContainer, classes.wizardMainContainer)}>\r\n      <div className={classNames(classes.wizardSingleStepLayoutStepScrollingContainer)}>\r\n        <StepContainer\r\n          className={isCenteredLayout ?\r\n            classes.wizardSingleStepLayoutCenteredStepContainer :\r\n            classes.wizardSingleStepLayoutStepContainer}\r\n        >\r\n          {children}\r\n        </StepContainer>\r\n      </div>\r\n      <StepFooter\r\n        className={classes.wizardFooter}\r\n        styleOverrides={footerStyleOverrides}\r\n        nextButtonText={i18n.getString(_TL_('Save'))}\r\n        onNextClick={saveAndNavigateNext}\r\n        isNextClickDisabled={isBusy || isReadOnlyUser}\r\n        onCancelClick={cancelAndExit}\r\n      />\r\n    </div>\r\n  </StepsContextProvider>\r\n));\r\n\r\nSingleStepLayout.propTypes = {\r\n  children: PropTypes.oneOfType([\r\n    PropTypes.arrayOf(PropTypes.node),\r\n    PropTypes.node,\r\n  ]).isRequired,\r\n  wizardState: PropTypes.shape({\r\n    i18n: PropTypes.shape({\r\n      getString: PropTypes.func.isRequired,\r\n    }).isRequired,\r\n    stepInfo: PropTypes.shape({\r\n      id: PropTypes.string.isRequired,\r\n    }),\r\n    isBusy: PropTypes.bool.isRequired,\r\n    isReadOnlyUser: PropTypes.bool.isRequired,\r\n  }).isRequired,\r\n  wizardActions: PropTypes.shape({\r\n    saveAndNavigateNext: PropTypes.func.isRequired,\r\n    cancelAndExit: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  isCenteredLayout: PropTypes.bool,\r\n  classes: PropTypes.shape({\r\n    wizardContainer: PropTypes.string.isRequired,\r\n    wizardMainContainer: PropTypes.string.isRequired,\r\n    wizardSingleStepLayoutStepScrollingContainer: PropTypes.string.isRequired,\r\n    wizardSingleStepLayoutCenteredStepContainer: PropTypes.string.isRequired,\r\n    wizardSingleStepLayoutStepContainer: PropTypes.string.isRequired,\r\n    wizardFooter: PropTypes.string.isRequired,\r\n  }).isRequired,\r\n};\r\n\r\nSingleStepLayout.defaultProps = {\r\n  isCenteredLayout: false,\r\n};\r\n","import React, { useEffect, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { withScope } from '@bingads-webui-react/scope-service';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { ContentFooter } from '@bingads-webui-campaign-react/content-footer';\r\nimport { UiBlocker } from '@bingads-webui-react/ui-blocker';\r\nimport { InstrumentationContext, withInstrumentation } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { Scenario, Activity } from '@bingads-webui-react/hoc-with-signal';\r\nimport { log } from '@bingads-webui-campaign-react/step-wizard-machine';\r\nimport { stepListProp } from '@bingads-webui-campaign-react/step-wizard-machine-capi';\r\nimport { VerticalSeparatedLayout } from '@bingads-webui-react/steps';\r\nimport { getWizardStyles } from '../styles/wizard-styles';\r\nimport { useWizardState } from './use-wizard-state';\r\nimport { MultiStepLayout } from './multi-step-layout';\r\nimport { SingleStepLayout } from './single-step-layout';\r\n\r\nconst { Step } = VerticalSeparatedLayout;\r\n\r\nconst StepWizardImpl = ({\r\n  wizardScenario, instrumentation, extraStepsData, permissions, scope, routeToNavigateToWhenDone, scopeToRemoveWhenDone, perfMarker,\r\n}) => {\r\n  useEffect(() => {\r\n    log('StepWizard mounted');\r\n    return () => {\r\n      log('StepWizard unmounted');\r\n    };\r\n  }, []);\r\n\r\n  const classes = useDefaultStyles(getWizardStyles);\r\n\r\n  const [wizardState, wizardActions] = useWizardState({\r\n    permissions,\r\n    wizardScenario,\r\n    scope,\r\n    routeToNavigateToWhenDone,\r\n    scopeToRemoveWhenDone,\r\n    instrumentation,\r\n    extraStepsData,\r\n    perfMarker,\r\n  });\r\n\r\n  const {\r\n    isCenteredLayout,\r\n    withContentFooter = true,\r\n    i18n,\r\n    scenarioName,\r\n    scenario,\r\n    stepListWithServiceInfo,\r\n    isBusy,\r\n    wasSaving,\r\n    wasWaitingForConfirmation,\r\n    wasStopping,\r\n  } = wizardState;\r\n\r\n  const Layout = useMemo(\r\n    () => (wizardScenario.stepList.length > 1 ? MultiStepLayout : SingleStepLayout),\r\n    [wizardScenario.stepList.length]\r\n  );\r\n\r\n  const loadingText = useMemo(\r\n    () => {\r\n      if (wasWaitingForConfirmation) {\r\n        return i18n.getString(_TL_('Waiting for confirmation...'));\r\n      }\r\n      if (wasStopping) {\r\n        return i18n.getString(_TL_('Finishing...'));\r\n      }\r\n      return wasSaving ? i18n.getString(_TL_('Saving...')) : i18n.getString(_TL_('Loading...'));\r\n    },\r\n    [wasWaitingForConfirmation, wasSaving, wasStopping, i18n]\r\n  );\r\n\r\n  const steps = useMemo(() => stepListWithServiceInfo\r\n    .map(({ stepInfo: stepInfo2, stepService, StepRepository }) => (\r\n      <Step\r\n        className={classes.wizardStep}\r\n        title={i18n.getString(stepInfo2.title)}\r\n        path={stepInfo2.id}\r\n        key={stepInfo2.id}\r\n        enabled\r\n        enableRenderingLog\r\n      >\r\n        <Activity name={stepInfo2.id}>\r\n          {stepService && stepService.initialized &&\r\n          <>\r\n            {StepRepository &&\r\n              <StepRepository stepService={stepService} />\r\n            }\r\n            <stepInfo2.StepComponent\r\n              stepService={stepService}\r\n              wizardActions={wizardActions}\r\n              wizardPerfMarker={perfMarker}\r\n              stepPerfMarkerName={stepInfo2.id}\r\n            />\r\n          </>\r\n          }\r\n          {/* the below element is there because StepContainer complains if Step.children is null,\r\n          even though it is not going to render them. It is a bug in Step component. It scans the React VDOM tree to\r\n          extract meta-information about steps, nested steps and so on.  */}\r\n          {!stepService &&\r\n            <p>Loading...</p>\r\n          }\r\n        </Activity>\r\n      </Step>\r\n    )), [stepListWithServiceInfo, classes.wizardStep, i18n, wizardActions, perfMarker]);\r\n\r\n  return (\r\n    <InstrumentationContext.Provider value={instrumentation}>\r\n      <Scenario name={scenario.name}>\r\n        <Activity name=\"Wizard\">\r\n          <div className={classNames(scenarioName.toLowerCase(), classes.uiBlockerAdapter)}>\r\n            <UiBlocker\r\n              blocking={isBusy}\r\n              loadingText={loadingText}\r\n            >\r\n              <Layout wizardState={wizardState} wizardActions={wizardActions} classes={classes} isCenteredLayout={isCenteredLayout}>\r\n                {steps}\r\n              </Layout>\r\n              {withContentFooter && <ContentFooter />}\r\n            </UiBlocker>\r\n          </div>\r\n        </Activity>\r\n      </Scenario>\r\n    </InstrumentationContext.Provider>\r\n  );\r\n};\r\n\r\nStepWizardImpl.propTypes = {\r\n  permissions: PropTypes.shape({}).isRequired,\r\n  wizardScenario: PropTypes.shape({\r\n    scenarioName: PropTypes.string.isRequired,\r\n    stepList: stepListProp.isRequired,\r\n  }).isRequired,\r\n  scope: PropTypes.shape({\r\n    values: PropTypes.shape({\r\n      cid: PropTypes.number.isRequired,\r\n      aid: PropTypes.number.isRequired,\r\n    }).isRequired,\r\n  }).isRequired,\r\n  routeToNavigateToWhenDone: PropTypes.string.isRequired,\r\n  scopeToRemoveWhenDone: PropTypes.arrayOf(PropTypes.string),\r\n  instrumentation: PropTypes.shape({}).isRequired,\r\n  extraStepsData: PropTypes.shape({}),\r\n  perfMarker: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nStepWizardImpl.defaultProps = {\r\n  extraStepsData: {},\r\n  scopeToRemoveWhenDone: [],\r\n};\r\n\r\nexport const StepWizard = withInstrumentation(withScope(StepWizardImpl));\r\n","import { isFunction } from 'underscore';\r\nimport React, { useCallback, useEffect, useMemo } from 'react';\r\nimport { Prompt } from 'react-router-dom';\r\n\r\nexport const useNavigationConfirmationPrompt = (needsConfirmation, confirmationMessage) => {\r\n  const onUserNavigation = useCallback((location, action) => {\r\n    if ((isFunction(needsConfirmation) && needsConfirmation(location, action)) || needsConfirmation) {\r\n      return confirmationMessage;\r\n    }\r\n    return true;\r\n  }, [needsConfirmation, confirmationMessage]);\r\n\r\n  const navigationConfirmationPrompt = useMemo(() => (\r\n    <Prompt message={onUserNavigation} />\r\n  ), [onUserNavigation]);\r\n\r\n  const beforeUnloadListener = useCallback((event) => {\r\n    event.preventDefault();\r\n    // eslint-disable-next-line no-param-reassign\r\n    event.returnValue = confirmationMessage;\r\n    return confirmationMessage;\r\n  }, [confirmationMessage]);\r\n  useEffect(() => {\r\n    if (needsConfirmation) {\r\n      addEventListener('beforeunload', beforeUnloadListener, { capture: true });\r\n    } else {\r\n      removeEventListener('beforeunload', beforeUnloadListener, { capture: true });\r\n    }\r\n\r\n    return () => {\r\n      removeEventListener('beforeunload', beforeUnloadListener, { capture: true });\r\n    };\r\n  }, [needsConfirmation, beforeUnloadListener]);\r\n\r\n  return navigationConfirmationPrompt;\r\n};\r\n","import { useEffect, useMemo } from 'react';\r\nimport { StepEvents } from '@bingads-webui-campaign-react/step-wizard-machine';\r\nimport { useNavigationConfirmationPrompt } from './use-navigation-confirmation-prompt';\r\nimport { useWindowConfirm } from './use-window-confirm';\r\n\r\nconst EXIT_WITHOUT_SAVING_MESSAGE_KEY = _TL_('Your latest changes have not been saved. Do you want to continue without saving changes?');\r\n\r\nexport const useExitWithoutSavingConfirmation = (needsConfirmation, stepService, i18n, confirmationMessage = undefined) => {\r\n  // Browser and router navigation cancelation must be synchronous, so cannot be handled by wizard-state-machine\r\n  // because wizard-state-machine doesn't have enough information on whether an individual step can\r\n  // navigate away or not, and would need to delegate this to the step-state-machine.\r\n  // Wizard's navigation button based existing/canceling can be asynchronous and, again, will be\r\n  // delegated to the current step as the step has necessary information.\r\n  const exitConfirmationMessage = useMemo(() => confirmationMessage || i18n.getString(EXIT_WITHOUT_SAVING_MESSAGE_KEY), [i18n, confirmationMessage]);\r\n  const navigationConfirmationPrompt = useNavigationConfirmationPrompt(needsConfirmation, exitConfirmationMessage);\r\n  const confirmCancel = useWindowConfirm(exitConfirmationMessage);\r\n  useEffect(() => {\r\n    stepService.send({ type: StepEvents.OVERRIDE_ACTIONS, data: { confirmCancel } });\r\n  }, [stepService, confirmCancel]);\r\n\r\n  return [navigationConfirmationPrompt];\r\n};\r\n","import { useCallback } from 'react';\r\n\r\nexport const useWindowConfirm = message =>\r\n  // eslint-disable-next-line no-alert\r\n  useCallback(() => window.confirm(message), [message]);\r\n","import { constant } from 'underscore';\r\nimport React, { useEffect, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { useSelector } from '@xstate/react';\r\nimport hoistNonReactStatics from 'hoist-non-react-statics';\r\nimport { getDisplayName } from '@bingads-webui-react/hoc-utils';\r\nimport { ProgressiveLoadingBlock } from '@bingads-webui-campaign-react/shell-ui-common';\r\nimport {\r\n  StepEvents,\r\n  isLoading as isLoadingSelector,\r\n  isFailedInit as isFailedInitSelector,\r\n  isFin as isFinSelector,\r\n  isStopping as sharedIsStoppingSelector,\r\n  log,\r\n  stateLoggingListener,\r\n} from '@bingads-webui-campaign-react/step-wizard-machine';\r\nimport { useUpdateChildPerfMarker } from '@bingads-webui-campaign-react/performance-marker-provider';\r\n\r\nexport const StepLoadingStatus = {\r\n  loading: 'loading',\r\n  ready: 'ready',\r\n  failed: 'failed',\r\n};\r\n\r\nexport const defaultLoadingStatusSelector = (state) => {\r\n  if (isFailedInitSelector(state)) {\r\n    return StepLoadingStatus.failed;\r\n  }\r\n\r\n  if (isLoadingSelector(state)) {\r\n    return StepLoadingStatus.loading;\r\n  }\r\n\r\n  return StepLoadingStatus.ready;\r\n};\r\n\r\nexport const defaultIsStoppingSelector = state => sharedIsStoppingSelector(state) || isFinSelector(state);\r\n\r\nexport const defaultFallback = () => (<ProgressiveLoadingBlock />);\r\n\r\n/**\r\n * The step state machine-aware higher-order React component for wrapping an actual step UI component.\r\n * The HOC will render the provided fallback UI until the step has loaded initial data\r\n * required for it to render.\r\n */\r\nconst StepLoadingShell = React.memo(({\r\n  stepService,\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  loadingStatusSelector,\r\n  isStoppingSelector,\r\n  stepComponent: StepComponent,\r\n  fallback: Fallback,\r\n  wizardPerfMarker,\r\n  stepPerfMarkerName,\r\n  ...restProps\r\n}) => {\r\n  useEffect(() => {\r\n    const subscription = stepService.subscribe(stateLoggingListener);\r\n    log('StepLoadingShell mounted');\r\n    return () => {\r\n      log('StepLoadingShell unmounted');\r\n      subscription.unsubscribe();\r\n    };\r\n  }, [stepService]);\r\n\r\n  const isLoading = useSelector(stepService, isLoadingSelector);\r\n  const isStopping = useSelector(stepService, isStoppingSelector);\r\n  const perfmarker = useMemo(\r\n    () => {\r\n      const child = wizardPerfMarker.createChild(stepPerfMarkerName, { autoEnd: false });\r\n      child.willInit();\r\n      return child;\r\n    },\r\n    [wizardPerfMarker, stepPerfMarkerName]\r\n  );\r\n\r\n  useUpdateChildPerfMarker(perfmarker, isLoading);\r\n\r\n  useEffect(() => {\r\n    stepService.send({ type: StepEvents.OVERRIDE_GUARDS, data: { needsStopping: constant(true) } });\r\n  }, [stepService]);\r\n\r\n  useEffect(() => {\r\n    if (isStopping) {\r\n      log('StepLoadingShell sending DONE_STOPPING');\r\n      stepService.send({ type: StepEvents.DONE_STOPPING });\r\n    }\r\n  }, [stepService, isStopping]);\r\n\r\n  log('StepLoadingShell.render: isLoading, isStopping', isLoading, isStopping);\r\n\r\n  if (isLoading) {\r\n    return <Fallback stepService={stepService} wizardPerfMarker={perfmarker} {...restProps} />;\r\n  } else if (!isStopping) {\r\n    return <StepComponent stepService={stepService} wizardPerfMarker={perfmarker} {...restProps} />;\r\n  }\r\n  return null;\r\n});\r\n\r\nStepLoadingShell.propTypes = {\r\n  stepService: PropTypes.shape({\r\n    subscribe: PropTypes.func.isRequired,\r\n    send: PropTypes.func,\r\n  }).isRequired,\r\n  stepComponent: PropTypes.elementType.isRequired,\r\n  loadingStatusSelector: PropTypes.func,\r\n  isStoppingSelector: PropTypes.func,\r\n  fallback: PropTypes.elementType,\r\n  wizardPerfMarker: PropTypes.shape({\r\n    createChild: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  stepPerfMarkerName: PropTypes.string.isRequired,\r\n};\r\n\r\nStepLoadingShell.defaultProps = {\r\n  loadingStatusSelector: defaultLoadingStatusSelector,\r\n  isStoppingSelector: defaultIsStoppingSelector,\r\n  fallback: defaultFallback,\r\n};\r\n\r\nexport const withStepLoadingShell = (\r\n  StepComponent,\r\n  {\r\n    loadingStatusSelector: staticLoadingStatusSelector,\r\n    isStoppingSelector: staticIsStoppingSelector,\r\n    fallback: staticFallback,\r\n  } = {}\r\n) => {\r\n  const HOC = ({\r\n    stepService, loadingStatusSelector, isStoppingSelector, fallback, wizardPerfMarker, stepPerfMarkerName, ...restProps\r\n  }) => (\r\n    <StepLoadingShell\r\n      stepService={stepService}\r\n      stepComponent={StepComponent}\r\n      loadingStatusSelector={loadingStatusSelector || staticLoadingStatusSelector}\r\n      isStoppingSelector={isStoppingSelector || staticIsStoppingSelector}\r\n      fallback={fallback || staticFallback}\r\n      wizardPerfMarker={wizardPerfMarker}\r\n      stepPerfMarkerName={stepPerfMarkerName}\r\n      {...restProps}\r\n    />\r\n  );\r\n\r\n  HOC.propTypes = {\r\n    stepService: PropTypes.shape({}).isRequired,\r\n    loadingStatusSelector: PropTypes.func,\r\n    isStoppingSelector: PropTypes.func,\r\n    fallback: PropTypes.elementType,\r\n    wizardPerfMarker: PropTypes.shape({\r\n      createChild: PropTypes.func.isRequired,\r\n    }).isRequired,\r\n    stepPerfMarkerName: PropTypes.string.isRequired,\r\n  };\r\n\r\n  HOC.defaultProps = {\r\n    loadingStatusSelector: undefined,\r\n    isStoppingSelector: undefined,\r\n    fallback: undefined,\r\n  };\r\n\r\n  HOC.displayName = `withStepLoadingShell(${getDisplayName(StepComponent)})`;\r\n  hoistNonReactStatics(HOC, StepComponent);\r\n\r\n  return HOC;\r\n};\r\n","import { useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { useSelector } from '@xstate/react';\r\nimport {\r\n  isLoading as isLoadingSelector,\r\n  isSaving as isSavingSelector,\r\n  StepEvents,\r\n  log,\r\n} from '@bingads-webui-campaign-react/step-wizard-machine';\r\nimport { useIsMounted } from './use-is-mounted';\r\n\r\n/**\r\n * A step repository React component for steps that neither load, nor save any data.\r\n * @param {Object} props the component's props\r\n * @param {Object} props.stepService an instance of the step's state machine\r\n * @returns {Element} an empty VDOM\r\n */\r\nexport const NoDataStepRepository = ({ stepService }) => {\r\n  const isMountedRef = useIsMounted();\r\n\r\n  const isLoading = useSelector(stepService, isLoadingSelector);\r\n  const isSaving = useSelector(stepService, isSavingSelector);\r\n\r\n  useEffect(() => {\r\n    if (isLoading) {\r\n      log('NoDataStepRepository loading data with loadData');\r\n      if (isMountedRef.current) {\r\n        log('NoDataStepRepository sending DONE_LOADING');\r\n        stepService.send({ type: StepEvents.DONE_LOADING, data: {} });\r\n      }\r\n    } else if (isSaving) {\r\n      log('NoDataStepRepository saving data with saveData');\r\n      if (isMountedRef.current) {\r\n        log('NoDataStepRepository sending DONE_SAVING');\r\n        stepService.send({ type: StepEvents.DONE_SAVING, data: {} });\r\n      }\r\n    }\r\n  }, [stepService, isLoading, isSaving, isMountedRef]);\r\n\r\n  log('NoDataStepRepository.render: isLoading=_, isSaving=_', isLoading, isSaving);\r\n\r\n  return null;\r\n};\r\n\r\nNoDataStepRepository.propTypes = {\r\n  stepService: PropTypes.shape({\r\n    subscribe: PropTypes.func.isRequired,\r\n    send: PropTypes.func,\r\n  }).isRequired,\r\n};\r\n","import React from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { FilterEntity } from '@bingads-webui/filter-entity';\r\nimport { PredicateList } from '@bingads-webui/predicate-list-react';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getStockPhotoFilterStyle } from '@bingads-webui-campaign/shared-image-experience-styles';\r\n\r\nimport { getShutterStockFilterSchema } from './shutter-stock-filter-schema';\r\n\r\nconst isPlainObject = value => _.isObject(value) && !_.isArray(value);\r\n\r\n/* istanbul ignore next */\r\nconst queryToPredicates = (query) => {\r\n  if (!isPlainObject(query) || _.isEmpty(query)) {\r\n    return [];\r\n  }\r\n  if (query.$and) {\r\n    return query.$and;\r\n  }\r\n  return [query];\r\n};\r\n\r\n/* istanbul ignore next */\r\nconst predicatesToQuery = (predicates) => {\r\n  if (!_.isArray(predicates) || _.isEmpty(predicates)) {\r\n    return {};\r\n  }\r\n  if (predicates.length === 1) {\r\n    return predicates[0];\r\n  }\r\n  return {\r\n    $and: predicates,\r\n  };\r\n};\r\n\r\nclass ShutterStockFilterInternal extends React.Component {\r\n  constructor(props) {\r\n    super(props);\r\n\r\n    const { i18nLegacy } = props;\r\n\r\n    this.filterSchema = getShutterStockFilterSchema(i18nLegacy);\r\n\r\n    this.editableFilter = new FilterEntity({}, {\r\n      entitySchema: this.filterSchema,\r\n    });\r\n  }\r\n\r\n  onQueryChange = (query) => {\r\n    const {\r\n      data: prevData,\r\n      setData,\r\n    } = this.props;\r\n    const currData = {\r\n      predicates: queryToPredicates(query),\r\n    };\r\n\r\n    /* istanbul ignore else */\r\n    if (!_.isEqual(prevData, currData)) {\r\n      setData(currData);\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const {\r\n      classes,\r\n      data: {\r\n        predicates,\r\n      },\r\n      popoverContainer,\r\n    } = this.props;\r\n\r\n    const query = predicatesToQuery(predicates);\r\n    this.editableFilter.updateQuery(query);\r\n\r\n    return (\r\n      <div className={`stock-photo-new-filter ${classes.filterContainer}`}>\r\n        <I18nContext.Consumer>\r\n          {i18n => (\r\n            <PredicateList\r\n              i18n={i18n}\r\n              onApplySavedFilter={_.noop}\r\n              onDeleteFilters={_.noop}\r\n              selector={[]}\r\n              entitySchema={this.filterSchema}\r\n              editableFilter={this.editableFilter}\r\n              selectableFilter={null}\r\n              onEditableFilterUpdate={this.onQueryChange}\r\n              onSelectableFilterUpdate={_.noop}\r\n              disallowDuplicateFilters\r\n              popoverContainer={popoverContainer}\r\n            />\r\n          )}\r\n        </I18nContext.Consumer>\r\n      </div>\r\n    );\r\n  }\r\n}\r\n\r\nShutterStockFilterInternal.propTypes = {\r\n  classes: PropTypes.objectOf(PropTypes.string).isRequired,\r\n  setData: PropTypes.func.isRequired,\r\n  data: PropTypes.objectOf(PropTypes.any),\r\n  i18nLegacy: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }),\r\n  popoverContainer: PropTypes.shape(),\r\n};\r\n\r\nShutterStockFilterInternal.defaultProps = {\r\n  data: null,\r\n  i18n: {\r\n    getString: _.identity,\r\n  },\r\n  popoverContainer: {},\r\n};\r\n\r\nconst ShutterStockFilter = withDefaultStyles(ShutterStockFilterInternal, getStockPhotoFilterStyle);\r\nexport { ShutterStockFilter };\r\n\r\n","const getShutterStockFilterSchema = (i18n) => {\r\n  const filterSchema = {\r\n    properties: {\r\n      people_model_released: {\r\n        name: 'People Model Released',\r\n        filterable: true,\r\n        title: i18n.getString('ShutterStock_Filter_People_Model_Released'),\r\n        type: 'string',\r\n        property: 'people_model_released',\r\n        enum: [\r\n          'true',\r\n          'false',\r\n        ],\r\n        localized: {\r\n          true: i18n.getString('ShutterStock_Filter_People_Model_Released_True'),\r\n          false: i18n.getString('ShutterStock_Filter_People_Model_Released_False'),\r\n        },\r\n        operatorDisplayNameMap: {\r\n          eq: i18n.getString('ShutterStock_Filter_Operator_Eq'),\r\n        },\r\n        operators: [\r\n          'eq',\r\n        ],\r\n        chooseType: 'radio',\r\n      },\r\n      people_ethnicity: {\r\n        name: 'People Ethnicity',\r\n        filterable: true,\r\n        title: i18n.getString('ShutterStock_Filter_People_Ethnicity'),\r\n        type: 'string',\r\n        property: 'people_ethnicity',\r\n        enum: [\r\n          'african',\r\n          'african_american',\r\n          'black',\r\n          'brazilian',\r\n          'chinese',\r\n          'caucasian',\r\n          'east_asian',\r\n          'hispanic',\r\n          'japanese',\r\n          'middle_eastern',\r\n          'native_american',\r\n          'pacific_islander',\r\n          'south_asian',\r\n          'southeast_asian',\r\n          'other',\r\n        ],\r\n        localized: {\r\n          african: i18n.getString('ShutterStock_Filter_People_Ethnicity_African'),\r\n          african_american: i18n.getString('ShutterStock_Filter_People_Ethnicity_African_American'),\r\n          black: i18n.getString('ShutterStock_Filter_People_Ethnicity_Black'),\r\n          brazilian: i18n.getString('ShutterStock_Filter_People_Ethnicity_Brazilian'),\r\n          chinese: i18n.getString('ShutterStock_Filter_People_Ethnicity_Chinese'),\r\n          caucasian: i18n.getString('ShutterStock_Filter_People_Ethnicity_Caucasian'),\r\n          east_asian: i18n.getString('ShutterStock_Filter_People_Ethnicity_East_Asian'),\r\n          hispanic: i18n.getString('ShutterStock_Filter_People_Ethnicity_Hispanic'),\r\n          japanese: i18n.getString('ShutterStock_Filter_People_Ethnicity_Japanese'),\r\n          middle_eastern: i18n.getString('ShutterStock_Filter_People_Ethnicity_Middle_Eastern'),\r\n          native_american: i18n.getString('ShutterStock_Filter_People_Ethnicity_Native_American'),\r\n          pacific_islander: i18n.getString('ShutterStock_Filter_People_Ethnicity_Pacific_Islander'),\r\n          south_asian: i18n.getString('ShutterStock_Filter_People_Ethnicity_South_Asian'),\r\n          southeast_asian: i18n.getString('ShutterStock_Filter_People_Ethnicity_Southeast_Asian'),\r\n          other: i18n.getString('ShutterStock_Filter_People_Ethnicity_Other'),\r\n        },\r\n        operatorDisplayNameMap: {\r\n          eq: i18n.getString('ShutterStock_Filter_Operator_Eq'),\r\n        },\r\n        operators: [\r\n          'eq',\r\n        ],\r\n        chooseType: 'checkbox',\r\n      },\r\n      people_gender: {\r\n        name: 'People Gender',\r\n        filterable: true,\r\n        title: i18n.getString('ShutterStock_Filter_People_Gender'),\r\n        type: 'string',\r\n        property: 'people_gender',\r\n        enum: [\r\n          'male',\r\n          'female',\r\n          'both',\r\n        ],\r\n        localized: {\r\n          male: i18n.getString('ShutterStock_Filter_People_Male'),\r\n          female: i18n.getString('ShutterStock_Filter_People_Female'),\r\n          both: i18n.getString('ShutterStock_Filter_People_Both'),\r\n        },\r\n        operatorDisplayNameMap: {\r\n          eq: i18n.getString('ShutterStock_Filter_Operator_Eq'),\r\n        },\r\n        operators: [\r\n          'eq',\r\n        ],\r\n        chooseType: 'radio',\r\n      },\r\n      people_age: {\r\n        name: 'People Age',\r\n        filterable: true,\r\n        title: i18n.getString('ShutterStock_Filter_People_Age'),\r\n        type: 'string',\r\n        property: 'people_model_age',\r\n        enum: [\r\n          'infants',\r\n          'children',\r\n          'teenagers',\r\n          '20s',\r\n          '30s',\r\n          '40s',\r\n          '50s',\r\n          '60s',\r\n          'older',\r\n        ],\r\n        localized: {\r\n          infants: i18n.getString('ShutterStock_Filter_People_Age_Infants'),\r\n          children: i18n.getString('ShutterStock_Filter_People_Age_Children'),\r\n          teenagers: i18n.getString('ShutterStock_Filter_People_Age_Teenagers'),\r\n          '20s': i18n.getString('ShutterStock_Filter_People_Age_20s'),\r\n          '30s': i18n.getString('ShutterStock_Filter_People_Age_30s'),\r\n          '40s': i18n.getString('ShutterStock_Filter_People_Age_40s'),\r\n          '50s': i18n.getString('ShutterStock_Filter_People_Age_50s'),\r\n          '60s': i18n.getString('ShutterStock_Filter_People_Age_60s'),\r\n          older: i18n.getString('ShutterStock_Filter_People_Age_Older'),\r\n        },\r\n        operatorDisplayNameMap: {\r\n          eq: i18n.getString('ShutterStock_Filter_Operator_Eq'),\r\n        },\r\n        operators: [\r\n          'eq',\r\n        ],\r\n        chooseType: 'radio',\r\n      },\r\n      people_number: {\r\n        name: 'People Number',\r\n        filterable: true,\r\n        title: i18n.getString('ShutterStock_Filter_People_Number'),\r\n        type: 'string',\r\n        property: 'people_number',\r\n        enum: [\r\n          '1',\r\n          '2',\r\n          '3',\r\n          '4',\r\n        ],\r\n        localized: {\r\n          1: '1',\r\n          2: '2',\r\n          3: '3',\r\n          4: '4+',\r\n        },\r\n        operatorDisplayNameMap: {\r\n          eq: i18n.getString('ShutterStock_Filter_Operator_Eq'),\r\n        },\r\n        operators: [\r\n          'eq',\r\n        ],\r\n        chooseType: 'radio',\r\n      },\r\n    },\r\n    // work-around to have the noDuplicateValidation. Will remove once predicate supports it\r\n    name: 'ShutterStockPeopleFilterSchema',\r\n    type: 'object',\r\n  };\r\n\r\n  return filterSchema;\r\n};\r\n\r\nexport { getShutterStockFilterSchema };\r\n","import React, { useState, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport { ShutterStockFilter } from './shutter-stock/shutter-stock-filter';\r\n\r\nexport const StockImageFilter = (props) => {\r\n  const {\r\n    i18nLegacy,\r\n    onFilterQueryChange,\r\n    popoverContainer,\r\n  } = props;\r\n\r\n  const [data, setData] = useState({});\r\n  // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\r\n  const [filterQuery, setFilterQuery] = useState({});\r\n\r\n  useEffect(() => {\r\n    if (data.predicates) {\r\n      const keyValueQueryPairs = _.reduce(\r\n        data.predicates,\r\n        (memo, predicate) => {\r\n          // there is only one key per predicate\r\n          const [key] = _.keys(predicate);\r\n          const addedKeyValue = {};\r\n          const [valuesArray] = _.values(_.values(predicate)[0]);\r\n\r\n          // As we support multi-selection, we format the array in the following way\r\n          // key[0]=value, key[1]=value\r\n          /* istanbul ignore next */\r\n          if (valuesArray.length > 1) {\r\n            valuesArray.forEach((value, index) => {\r\n              addedKeyValue[`${key}[${index}]`] = value;\r\n            });\r\n          } else {\r\n            [addedKeyValue[key]] = valuesArray;\r\n          }\r\n\r\n          return _.extend(memo, addedKeyValue);\r\n        }, {}\r\n      );\r\n\r\n      setFilterQuery(keyValueQueryPairs);\r\n\r\n      /* istanbul ignore else */\r\n      onFilterQueryChange(keyValueQueryPairs);\r\n    }\r\n  }, [data, onFilterQueryChange]);\r\n\r\n  return (\r\n    <ShutterStockFilter\r\n      i18nLegacy={i18nLegacy}\r\n      data={data}\r\n      setData={setData}\r\n      popoverContainer={popoverContainer}\r\n    />\r\n  );\r\n};\r\n\r\nStockImageFilter.propTypes = {\r\n  onFilterQueryChange: PropTypes.func.isRequired,\r\n  i18nLegacy: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  popoverContainer: PropTypes.shape(),\r\n};\r\n\r\nStockImageFilter.defaultProps = {\r\n  popoverContainer: null,\r\n};\r\n","export const getStoreStyles = () => ({\r\n  storeSettings: {\r\n    '& .alert': {\r\n      alignItems: 'center',\r\n      padding: [4, 16, 4, 12],\r\n\r\n      '& .alert-image:before': {\r\n        lineHeight: '32px',\r\n      },\r\n\r\n      '& .alert__content': {\r\n        display: 'flex',\r\n        flexDirection: 'row',\r\n        flexGrow: 1,\r\n        alignItems: 'center',\r\n      },\r\n\r\n      '& .alert__action': {\r\n        marginLeft: 'auto',\r\n        marginTop: 'unset',\r\n      },\r\n    },\r\n  },\r\n  storeSettingsLoading: {\r\n    minHeight: 64, // for spinner\r\n  },\r\n  select_store_link: {\r\n    border: '1px solid #8A8886',\r\n    display: 'inline-block',\r\n    background: '#FFF',\r\n    borderRadius: '2px',\r\n    color: '#323130',\r\n    padding: '2px 20px',\r\n    cursor: 'pointer',\r\n    float: 'right',\r\n  },\r\n  warning_no_store: {\r\n    '& .alert': {\r\n      marginTop: 12,\r\n    },\r\n  },\r\n  errorIcon_no_store: {\r\n    padding: '8px 8px 8px 12px',\r\n  },\r\n  select_store_no_store_message: {\r\n    padding: '8px 8px 8px 0px',\r\n  },\r\n  select: {\r\n    width: '252px',\r\n    height: '32px',\r\n    border: '1px solid #605E5C',\r\n    borderRadius: '2px',\r\n  },\r\n  control_title: {\r\n    fontWeight: 600,\r\n    fontSize: '14px',\r\n    lineHeight: '20px',\r\n  },\r\n  control: {\r\n    '&:not(:last-child)': {\r\n      marginBottom: 16,\r\n    },\r\n  },\r\n  title_text: {\r\n    margin: '8px 0 8px 0',\r\n  },\r\n  select_label: {\r\n    marginBottom: '4px',\r\n  },\r\n  storeSelectContent: {\r\n    '& div[role=\"alert\"] .error:first-child': {\r\n      paddingTop: '12px',\r\n    },\r\n  },\r\n});\r\n","import { pairs } from 'underscore';\r\nimport React, { useContext, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { Text, Label, Checkbox } from '@fluentui/react';\r\nimport { useId } from '@fluentui/react-hooks';\r\nimport { withCustomValidation, withError } from '@bingads-webui-react/validation';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport { withUnvalidatedControlErrors, withControlErrorHandling } from '@bingads-webui-campaign-react/error-handling';\r\nimport { Alert } from '@bingads-webui-react/alert';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { withPermissions } from '@bingads-webui-react/hoc-with-permissions';\r\nimport { FeedFilterPicker } from '@bingads-webui-campaign-react/feed-filter';\r\nimport { getStoreStyles } from '../styles/get-store-style';\r\n\r\nconst validate = (i18n, data) => {\r\n  const validationErrors = [];\r\n\r\n  if (data.IsFeedFiltered && !data.FeedLabel && !data.SalesCountry) {\r\n    validationErrors.push(i18n.getString(_TL_('Either feed label or country/region of sale needs to be selected with the filter enabled. If you want to disable the filter, please click \"Use all products\" button.')));\r\n  }\r\n\r\n  return validationErrors;\r\n};\r\n\r\nfunction StoreSelectView(props) {\r\n  const {\r\n    stores,\r\n    countries,\r\n    validationProps,\r\n    updateValidation,\r\n    permissions,\r\n  } = props;\r\n\r\n  const { data } = validationProps;\r\n  const {\r\n    dynamic: {\r\n      FeedLabel: feedLabelEnabled,\r\n      FeedLabelBlockList: feedLabelBlockListEnabled,\r\n    },\r\n  } = permissions;\r\n  const isFeedLabelEnabled = feedLabelEnabled && !feedLabelBlockListEnabled;\r\n\r\n  const i18n = useContext(I18nContext);\r\n  const classes = useDefaultStyles(getStoreStyles);\r\n\r\n  const onLocalChecked = useCallback((event) => {\r\n    const isChecked = event.target.checked;\r\n    const newData = {\r\n      ...data,\r\n      LocalInventoryAdsEnabled: isChecked,\r\n    };\r\n\r\n    updateValidation([], newData);\r\n  }, [updateValidation, data]);\r\n\r\n  const onDataChange = useCallback((dataPatch) => {\r\n    const newData = {\r\n      ...data,\r\n      ...dataPatch,\r\n    };\r\n    const validationErrors = validate(i18n, newData);\r\n\r\n    updateValidation(validationErrors, newData);\r\n  }, [data, i18n, updateValidation]);\r\n\r\n  const onIsFeedFilteredChange = useCallback((isFeedFiltered) => {\r\n    onDataChange({\r\n      IsFeedFiltered: isFeedFiltered,\r\n      SalesCountry: isFeedFiltered ? data.SalesCountry : null,\r\n      FeedLabel: isFeedFiltered ? data.FeedLabel : null,\r\n    });\r\n  }, [data.FeedLabel, data.SalesCountry, onDataChange]);\r\n\r\n  const onSelectedFeedLabelChangeByValue = useCallback((value) => {\r\n    onDataChange({\r\n      FeedLabel: value,\r\n    });\r\n  }, [onDataChange]);\r\n\r\n  const onSelectedSaleCountryChangeByValue = useCallback((value) => {\r\n    onDataChange({\r\n      SalesCountry: value,\r\n    });\r\n  }, [onDataChange]);\r\n\r\n  const selectedStoreId = data.ProviderId;\r\n  const selectedCountry = data.SalesCountry;\r\n\r\n  const storeFieldId = useId('storeText');\r\n  const countryFieldId = useId('countryText');\r\n  const localInventoryFieldId = useId('localInventoryInput');\r\n\r\n  return (\r\n    <div className={classNames('store-settings-view', classes.storeSettings)}>\r\n      <div className={classNames('strore-theme-info-pre-selected-items', classes.preSelectedItemsStyle)}>\r\n        {selectedStoreId &&\r\n          <div className=\"select-store-container\">\r\n            <div className={classNames(classes.select_label)}>\r\n              <Text>{i18n.getString(_TL_('You will use this Merchant Center account to advertise products on your website.'))}</Text>\r\n            </div>\r\n            <Label htmlFor={storeFieldId}>\r\n              {i18n.getString(_TL_('Store'))}\r\n              <HelpPopup aria-label=\"Store\" topic=\"pop_BA_PMAX_Store\" />\r\n            </Label>\r\n            <div className={classes.control}>\r\n              <Text id={storeFieldId} className=\"store-info-text\">\r\n                {/* If store has been deleted, or if the set store is a draft store, we show its ID without any additional info or formatting. The same as in the legacy shopping campaigns */}\r\n                {(stores[selectedStoreId] && stores[selectedStoreId].text) || selectedStoreId}\r\n              </Text>\r\n            </div>\r\n            {isFeedLabelEnabled ? (\r\n              <FeedFilterPicker\r\n                isEditMode\r\n                isFeedFiltered={data.IsFeedFiltered}\r\n                onIsFeedFilteredChange={onIsFeedFilteredChange}\r\n                saleCountries={pairs(countries).map(([key, { text }]) => ({ key, text }))}\r\n                selectedFeedLabel={data.FeedLabel}\r\n                onSelectedFeedLabelChange={onSelectedFeedLabelChangeByValue}\r\n                selectedSaleCountry={data.SalesCountry}\r\n                onSelectedSaleCountryChange={onSelectedSaleCountryChangeByValue}\r\n                storeId={selectedStoreId}\r\n              />\r\n            ) : (\r\n              <>\r\n                <Label htmlFor={countryFieldId}>\r\n                  {i18n.getString(_TL_('Country/region of sale'))}\r\n                </Label>\r\n                <div className={classes.control}>\r\n                  <Text id={countryFieldId} className=\"country-name-text\">\r\n                    {countries[selectedCountry].text}\r\n                  </Text>\r\n                </div>\r\n              </>\r\n            )}\r\n            <Label htmlFor={localInventoryFieldId}>\r\n              {i18n.getString(_TL_('Local inventory ads'))}\r\n              <HelpPopup aria-label=\"Local\" topic=\"pop_BA_PMAX_Local\" />\r\n            </Label>\r\n            <Checkbox\r\n              id={localInventoryFieldId}\r\n              className={classNames('local-inventory', classes.control)}\r\n              label={i18n.getString(_TL_('Enable local inventory ads'))}\r\n              onChange={onLocalChecked}\r\n              checked={data.LocalInventoryAdsEnabled}\r\n            />\r\n          </div>\r\n        }\r\n\r\n        {/* user doesn’t select store, then comes back to this step\r\n        *View-only state for settings that can’t change */}\r\n        {!selectedStoreId &&\r\n          <div className={classNames('select-store-no-store', classes.warning_panel_bottom)}>\r\n            <Alert\r\n              message={i18n.getString(_TL_('This campaign can’t serve product ads because you didn’t select a Merchant Center store. If at some point you want to add a store, you’ll need to create a new campaign.'))}\r\n              level=\"Info\"\r\n              icon={(<div className=\"alert-image\" />)}\r\n              dismissible={false}\r\n            />\r\n          </div>\r\n        }\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n\r\nStoreSelectView.propTypes = {\r\n  stores: PropTypes.shape({}).isRequired,\r\n  countries: PropTypes.shape({\r\n    text: PropTypes.string,\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      IsFeedFiltered: PropTypes.bool,\r\n      FeedLabel: PropTypes.string,\r\n      SalesCountry: PropTypes.string,\r\n      LocalInventoryAdsEnabled: PropTypes.bool,\r\n      ProviderId: PropTypes.string,\r\n    }).isRequired,\r\n    alwaysShowError: PropTypes.bool,\r\n  }).isRequired,\r\n  permissions: PropTypes.shape({\r\n    dynamic: PropTypes.shape({\r\n      FeedLabel: PropTypes.bool,\r\n      FeedLabelBlockList: PropTypes.bool,\r\n    }),\r\n  }).isRequired,\r\n};\r\n\r\nexport const ValidatedStoreView = withError(withControlErrorHandling(withUnvalidatedControlErrors(withCustomValidation(withPermissions(StoreSelectView)))));\r\n","import _ from 'underscore';\r\nimport React, { useContext, useEffect, useCallback } from 'react';\r\nimport classNames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport { withCustomValidation, withError } from '@bingads-webui-react/validation';\r\nimport { withUnvalidatedControlErrors, withControlErrorHandling } from '@bingads-webui-campaign-react/error-handling';\r\nimport { Alert } from '@bingads-webui-react/alert';\r\nimport { Text, Label, Checkbox } from '@fluentui/react';\r\nimport { useId } from '@fluentui/react-hooks';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport { Select } from '@bingads-webui-react/primitive';\r\nimport { getRouterDep } from '@bingads-webui-campaign-react/legacy-router-dep';\r\nimport { withScope } from '@bingads-webui-react/scope-service';\r\nimport { withSiteMap } from '@bingads-webui-campaign-react/with-site-map';\r\nimport { withPermissions } from '@bingads-webui-react/hoc-with-permissions';\r\nimport { FeedFilterPicker } from '@bingads-webui-campaign-react/feed-filter';\r\nimport { getStoreStyles } from '../styles/get-store-style';\r\n\r\nconst validate = (i18n, campaignObjective, data) => {\r\n  const validationErrors = campaignObjective === 'ShoppingCampaign' && !data.ProviderId ?\r\n    [i18n.getString(_TL_('At least one store needs to be selected.'))] : [];\r\n\r\n  if (campaignObjective === 'ShoppingCampaign' && data.IsFeedFiltered && !data.FeedLabel && !data.SalesCountry) {\r\n    validationErrors.push(i18n.getString(_TL_('Either feed label or country/region of sale needs to be selected with the filter enabled. If you want to disable the filter, please click \"Use all products\" button.')));\r\n  }\r\n\r\n  return validationErrors;\r\n};\r\n\r\nfunction StoreSelectCreation(props) {\r\n  const {\r\n    hasStores,\r\n    stores,\r\n    countries,\r\n    campaignObjective,\r\n    updateValidation,\r\n    scope,\r\n    siteMap,\r\n    permissions,\r\n    validationProps,\r\n    showProductCollections,\r\n    hideFeedLabelAndCountry,\r\n  } = props;\r\n\r\n  const { data } = validationProps;\r\n  const {\r\n    dynamic: {\r\n      FeedLabel: feedLabelEnabled,\r\n      FeedLabelBlockList: feedLabelBlockListEnabled,\r\n    },\r\n  } = permissions;\r\n  const isFeedLabelEnabled = feedLabelEnabled && !feedLabelBlockListEnabled;\r\n\r\n  const i18n = useContext(I18nContext);\r\n  const classes = useDefaultStyles(getStoreStyles);\r\n\r\n  const onDataChange = useCallback((dataPatch) => {\r\n    const newData = {\r\n      ...data,\r\n      ...dataPatch,\r\n    };\r\n    const validationErrors = validate(i18n, campaignObjective, newData);\r\n\r\n    updateValidation(validationErrors, newData);\r\n  }, [i18n, campaignObjective, updateValidation, data]);\r\n\r\n  const onSelectedStoreChange = useCallback((event) => {\r\n    const storeId = event.target.value;\r\n\r\n    onDataChange({\r\n      ProviderId: storeId,\r\n    });\r\n  }, [onDataChange]);\r\n\r\n  useEffect(() => {\r\n    let newData = data;\r\n    if (campaignObjective === 'ShoppingCampaign' && _.keys(stores).length === 1) {\r\n      const preSelectedStoreId = Object.keys(stores)[0];\r\n      newData = {\r\n        ...data,\r\n        ProviderId: preSelectedStoreId,\r\n      };\r\n    }\r\n    if (isFeedLabelEnabled) {\r\n      newData = {\r\n        ...newData,\r\n        FeedLabel: null,\r\n        SalesCountry: null,\r\n      };\r\n    } else {\r\n      newData = {\r\n        ...newData,\r\n        FeedLabel: null,\r\n        SalesCountry: 'US',\r\n      };\r\n    }\r\n    const validationErrors = validate(i18n, campaignObjective, newData);\r\n    updateValidation(validationErrors, newData, false);\r\n\r\n    // Ignoring deps to fire only once this store pre-select logic\r\n    // eslint-disable-next-line react-hooks/exhaustive-deps\r\n  }, []);\r\n\r\n  const onSelectedCountryChange = useCallback((event) => {\r\n    const countryId = event.target.value;\r\n    onDataChange({\r\n      SalesCountry: countryId,\r\n    });\r\n  }, [onDataChange]);\r\n\r\n  const onIsFeedFilteredChange = useCallback((isFeedFiltered) => {\r\n    onDataChange({\r\n      IsFeedFiltered: isFeedFiltered,\r\n      SalesCountry: isFeedFiltered ? data.SalesCountry : null,\r\n      FeedLabel: isFeedFiltered ? data.FeedLabel : null,\r\n    });\r\n  }, [data.FeedLabel, data.SalesCountry, onDataChange]);\r\n\r\n  const onSelectedFeedLabelChangeByValue = useCallback((value) => {\r\n    onDataChange({\r\n      FeedLabel: value,\r\n    });\r\n  }, [onDataChange]);\r\n\r\n  const onSelectedSaleCountryChangeByValue = useCallback((value) => {\r\n    onDataChange({\r\n      SalesCountry: value,\r\n    });\r\n  }, [onDataChange]);\r\n\r\n  const goToBMC = () => {\r\n    const router = getRouterDep(scope, siteMap);\r\n    router.navigateToRoute('bing_merchant_center');\r\n  };\r\n\r\n  const onLocalChecked = useCallback((event) => {\r\n    const isChecked = event.target.checked;\r\n    onDataChange({\r\n      LocalInventoryAdsEnabled: isChecked,\r\n    });\r\n  }, [onDataChange]);\r\n\r\n  const onProductCollectionChecked = useCallback((event) => {\r\n    const isChecked = event.target.checked;\r\n    onDataChange({\r\n      ProductCollectionsEnabled: isChecked,\r\n    });\r\n  }, [onDataChange]);\r\n\r\n  const storeFieldId = useId('storeInput');\r\n  const countryFieldId = useId('countryInput');\r\n  const localInventoryFieldId = useId('localInventoryInput');\r\n  const productCollectionFieldId = useId('productCollectionInput');\r\n\r\n  return (\r\n    <div className={classNames('store-settings-creation', classes.storeSettings)}>\r\n      <div className={classNames('strore-theme-info-pre-selectedStoreId-items', classes.preselectedStoreIdItemsStyle)}>\r\n        {/* user doesn’t have store */}\r\n        {!hasStores ?\r\n          <div className={classNames('select-store-no-store', classes.warning_panel_bottom)}>\r\n            <Alert\r\n              message={i18n.getString(_TL_('No merchant center stores found. Create a store in Merchant Center in order to run product ads.'))}\r\n              level=\"Info\"\r\n              icon={(<div className=\"alert-image\" />)}\r\n              dismissible={false}\r\n              action={{\r\n                callback: goToBMC,\r\n                message: i18n.getString(_TL_('Create a store')),\r\n              }}\r\n            />\r\n          </div>\r\n          :\r\n          <div >\r\n            {/* user has store + selects \"sell products from catalog\" + not selects \"sell products from catalog\" */}\r\n            <div className={classNames(classes.select_label)}>\r\n              <Text>{i18n.getString(_TL_('Select a Merchant Center store to advertise your products.'))}</Text>\r\n            </div>\r\n            <Label htmlFor={storeFieldId}>\r\n              {i18n.getString(_TL_('Store'))}\r\n              <HelpPopup aria-label=\"Store\" topic=\"pop_BA_PMAX_Store\" />\r\n            </Label>\r\n            <Select\r\n              id={storeFieldId}\r\n              className={classNames('store-select', classes.select, classes.control)}\r\n              value={data.ProviderId}\r\n              onChange={onSelectedStoreChange}\r\n            >\r\n              <option key=\"select-a-store\" value=\"\">{i18n.getString(_TL_('Select account'))}</option>\r\n              {_.pairs(stores).map(([key, { text }]) =>\r\n              (\r\n                <option key={key} value={key}>{text}</option>\r\n              ))}\r\n            </Select>\r\n\r\n            {(campaignObjective === 'ShoppingCampaign' || data.ProviderId) &&\r\n              (!hideFeedLabelAndCountry)\r\n              &&\r\n              <>\r\n                {isFeedLabelEnabled ? (\r\n                  <FeedFilterPicker\r\n                    className={classNames('feed-select', classes.control)}\r\n                    isFeedFiltered={data.IsFeedFiltered}\r\n                    onIsFeedFilteredChange={onIsFeedFilteredChange}\r\n                    saleCountries={_.pairs(countries).map(([key, { text }]) => ({ key, text }))}\r\n                    selectedFeedLabel={data.FeedLabel}\r\n                    onSelectedFeedLabelChange={onSelectedFeedLabelChangeByValue}\r\n                    selectedSaleCountry={data.SalesCountry}\r\n                    onSelectedSaleCountryChange={onSelectedSaleCountryChangeByValue}\r\n                    storeId={data.ProviderId}\r\n                  />\r\n                ) : (\r\n                  <>\r\n                    <Label htmlFor={countryFieldId}>\r\n                      {i18n.getString(_TL_('Country/region of sale'))}\r\n                    </Label>\r\n                    <Select\r\n                      id={countryFieldId}\r\n                      className={classNames('country-select', classes.select, classes.control)}\r\n                      value={data.SalesCountry}\r\n                      onChange={onSelectedCountryChange}\r\n                    >\r\n                      {_.pairs(countries).map(([key, { text }]) =>\r\n                      (\r\n                        <option key={key} value={key}>{text}</option>\r\n                      ))}\r\n                    </Select>\r\n                  </>\r\n                )}\r\n                <Label htmlFor={localInventoryFieldId}>\r\n                  {i18n.getString(_TL_('Local inventory ads'))}\r\n                  <HelpPopup aria-label=\"Local\" topic=\"pop_BA_PMAX_Local\" />\r\n                </Label>\r\n                <Checkbox\r\n                  id={localInventoryFieldId}\r\n                  className={classNames('local-inventory', classes.control)}\r\n                  label={i18n.getString(_TL_('Enable local inventory ads'))}\r\n                  onChange={onLocalChecked}\r\n                  checked={data.LocalInventoryAdsEnabled}\r\n                />\r\n                {/* TODO: should also add this field to edit page when setting page finalized. for now. add this to creation page first. */}\r\n                {showProductCollections &&\r\n                  <>\r\n                    <Label htmlFor={productCollectionFieldId}>\r\n                      {i18n.getString(_TL_('Product collections'))}\r\n                      {/* <HelpPopup aria-label=\"Local\" topic=\"pop_BA_PMAX_Local\" /> */}\r\n                    </Label>\r\n                    <Checkbox\r\n                      id={productCollectionFieldId}\r\n                      className={classNames('product-collections', classes.control)}\r\n                      label={i18n.getString(_TL_('Enable collections'))}\r\n                      onChange={onProductCollectionChecked}\r\n                      checked={data.ProductCollectionsEnabled}\r\n                    />\r\n                  </>\r\n                }\r\n\r\n                {/* Scenario: customers link a store and we want to tell them the link can’t be changed once they go to the next step */}\r\n                <div className={classNames('select-store-store-selected-warning', classes.warning_panel_bottom)}>\r\n                  <Alert\r\n                    message={\r\n                      isFeedLabelEnabled ? (\r\n                        i18n.getString(_TL_('Note: While you can always change the feed label or country/region of sale you use, doing so will prompt new performance data. You can switch back to the original feed label or country/region of sale to review its performance data; however, the performance data for each cannot merge. '))\r\n                      ) : (\r\n                        i18n.getString(_TL_('Once you select a Store and Country/region of sale for this campaign, you cannot change them. If at some point you want to add a different store, you’ll need to create a new campaign. '))\r\n                      )\r\n                    }\r\n                    level=\"Info\"\r\n                    icon={(<div className=\"alert-image\" />)}\r\n                    dismissible={false}\r\n                  />\r\n                </div>\r\n              </>\r\n            }\r\n\r\n            {(campaignObjective !== 'ShoppingCampaign' && !data.ProviderId) && !hideFeedLabelAndCountry &&\r\n              <div className={classNames('select-store-no-store', classes.warning_panel_bottom)}>\r\n                <Alert\r\n                  message={i18n.getString(_TL_('Without a store you won’t be able to use product ads and can’t add it later.'))}\r\n                  level=\"Info\"\r\n                  icon={(<div className=\"alert-image\" />)}\r\n                  dismissible={false}\r\n                />\r\n              </div>\r\n            }\r\n          </div>\r\n        }\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n\r\nStoreSelectCreation.propTypes = {\r\n  hasStores: PropTypes.bool.isRequired,\r\n  stores: PropTypes.shape({\r\n    StoreId: PropTypes.string,\r\n    Name: PropTypes.string,\r\n  }).isRequired,\r\n  countries: PropTypes.shape({\r\n    name: PropTypes.string,\r\n  }).isRequired,\r\n  campaignObjective: PropTypes.string.isRequired,\r\n  siteMap: PropTypes.arrayOf(PropTypes.shape({\r\n    id: PropTypes.string,\r\n  })).isRequired,\r\n  scope: PropTypes.shape({}).isRequired,\r\n  permissions: PropTypes.shape({\r\n    dynamic: PropTypes.shape({\r\n      FeedLabel: PropTypes.bool,\r\n      FeedLabelBlockList: PropTypes.bool,\r\n    }),\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      IsFeedFiltered: PropTypes.bool,\r\n      FeedLabel: PropTypes.string,\r\n      SalesCountry: PropTypes.string,\r\n      LocalInventoryAdsEnabled: PropTypes.bool,\r\n      ProviderId: PropTypes.string,\r\n      ProductCollectionsEnabled: PropTypes.bool,\r\n    }).isRequired,\r\n    alwaysShowError: PropTypes.bool,\r\n  }).isRequired,\r\n  showProductCollections: PropTypes.bool,\r\n  hideFeedLabelAndCountry: PropTypes.bool,\r\n};\r\n\r\nStoreSelectCreation.defaultProps = {\r\n  showProductCollections: false,\r\n  hideFeedLabelAndCountry: false,\r\n};\r\n\r\nexport const ValidatedStoreCreation = withError(withControlErrorHandling(withUnvalidatedControlErrors(withCustomValidation(withScope(withSiteMap(withPermissions(StoreSelectCreation)))))));\r\n","import _ from 'underscore';\r\nimport { trim } from 'underscore.string';\r\nimport { queryify } from '@bingads-webui/url-util';\r\nimport { createAsyncToken } from '@bingads-webui-universal/primitive-utilities';\r\nimport jsData from '@bingads-webui-component-legacy/js-data-campaign/index';\r\nimport { getProductScopeData, mergeData } from '@bingads-webui-campaign-react/product-services';\r\nimport { withDFMCache, getDFMCache, setDFMCache } from '@bingads-webui/dfm-cache';\r\n\r\nexport const getProductData = (cid, aid, uid) => {\r\n  const url = queryify('/Campaign/NewCampaign/GetProductScope', {\r\n    aid,\r\n    cid,\r\n    uid,\r\n  });\r\n\r\n  const params = {\r\n    url,\r\n    adapter: 'legacy',\r\n    bypassCache: false,\r\n    cacheResponse: true,\r\n  };\r\n\r\n  return createAsyncToken(jsData.Product.find('MetaData', params))\r\n    // .chain((...args) => new Promise((resolve) => {\r\n    //   setTimeout(() => resolve(...args), 5000);\r\n    // }))\r\n    // .chain((...args) => new Promise((resolve, reject) => {\r\n    //   setTimeout(() => reject(new Error('Failed loading stores', ...args)), 5000);\r\n    // }))\r\n    .chain((data) => {\r\n      // Filtering out Co-Op Store\r\n      // eslint-disable-next-line no-param-reassign\r\n      data.ProductCollectionAccounts =\r\n        _.filter(data.ProductCollectionAccounts, store => !store.IsCoOpStore && !store.IsGlobalStore);\r\n\r\n      return data;\r\n    });\r\n};\r\n\r\nexport const getProductScopeFromOData = (serverContext) => {\r\n  const options = {\r\n    dataName: 'MetaData',\r\n    bypassCache: false,\r\n    cacheResponse: true,\r\n    getSalesCountryCollection: true,\r\n  };\r\n\r\n  const p$GetProductData = () => getProductScopeData(null, serverContext, options);\r\n  const cacheKey = 'getPmaxProductScopeDFM';\r\n  const getProductDataWithCache = withDFMCache(p$GetProductData, cacheKey, {}, false);\r\n\r\n  return createAsyncToken(getProductDataWithCache())\r\n  .chain((data) => {\r\n    if (!getDFMCache(cacheKey)) {\r\n      setDFMCache(cacheKey, new Promise((resolve) => { resolve(data) }));\r\n    }\r\n\r\n    // Filtering out Co-Op Store\r\n    const mergedData = mergeData(data)\r\n\r\n    mergedData.ProductCollectionAccounts = _.filter(mergedData.ProductCollectionAccounts, store => !store.IsCoOpStore && !store.IsGlobalStore);\r\n\r\n    return mergedData;\r\n  });\r\n}\r\n\r\nconst parseStoreName = (storeText) => {\r\n  const nameComponentIndex = storeText.indexOf(',');\r\n  const nameComponent = storeText.substring(nameComponentIndex + 1);\r\n  const nameIndex = nameComponent.indexOf(':');\r\n  const name = trim(nameComponent.substring(nameIndex + 1));\r\n  return name;\r\n};\r\n\r\nexport const getStoreFromProductCollectionAccount = productCollectionAccount => ({\r\n  id: productCollectionAccount.Value,\r\n  text: productCollectionAccount.Text,\r\n  name: parseStoreName(productCollectionAccount.Text),\r\n});\r\n\r\nexport const getCountryFromSalesCountryCollection = legacyI18n => salesCountry => ({\r\n  id: salesCountry.Value,\r\n  text: legacyI18n.getString(`UserCountry_${salesCountry.Value}`),\r\n});\r\n\r\nexport const getStores = ({ productData }) => {\r\n  const stores = (productData && productData.ProductCollectionAccounts\r\n    .map(getStoreFromProductCollectionAccount)\r\n    .reduce((memo, store) => {\r\n      // eslint-disable-next-line no-param-reassign\r\n      memo[store.id] = store;\r\n      return memo;\r\n    }, {})) || [];\r\n  return stores;\r\n};\r\n\r\nexport const getCountries = ({ productData, IsDomesticSimplifiedChineseEnabled, legacyI18n }) => {\r\n  const countries = (productData && productData.SalesCountryCollection\r\n    .filter((salesCountry) => {\r\n      const id = salesCountry.Value;\r\n      let result = true;\r\n\r\n      if (IsDomesticSimplifiedChineseEnabled) {\r\n        result = result && (id === 'CN');\r\n      }\r\n\r\n      return result;\r\n    })\r\n    .map(getCountryFromSalesCountryCollection(legacyI18n))\r\n    .reduce((memo, country) => {\r\n      // eslint-disable-next-line no-param-reassign\r\n      memo[country.id] = country;\r\n      return memo;\r\n    }, {})) || [];\r\n  return countries;\r\n};\r\n\r\n","import { isEmpty, isFunction, get } from 'underscore';\r\nimport React, { useEffect, useRef } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { withScope } from '@bingads-webui-react/scope-service';\r\nimport { Alert } from '@bingads-webui-react/alert';\r\nimport { Loading } from '@bingads-webui-campaign-react/loading';\r\nimport { withCustomValidation } from '@bingads-webui-react/validation';\r\nimport { withUnvalidatedControlErrors, withControlErrorHandling } from '@bingads-webui-campaign-react/error-handling';\r\nimport { withPermissions } from '@bingads-webui-react/hoc-with-permissions';\r\nimport { withServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { withActivityContext } from '@bingads-webui-react/hoc-with-signal';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getProductData, getProductScopeFromOData, getStores, getCountries } from './utils';\r\nimport { getStoreStyles } from '../styles/get-store-style';\r\n\r\nexport const StoreSelectLoading = ({\r\n  i18n, legacyI18n, scope, campaignObjective, updateValidation,\r\n  validationProps: { data, alwaysShowError },\r\n  isLoading, onLoadingDone, onLoadingError, loadingErrors, permissions, onRenderCustomLoadingComponent, serverContext, activity,\r\n}) => {\r\n  const asyncTokenRef = useRef();\r\n  const {\r\n    IsDomesticSimplifiedChineseEnabled,\r\n  } = permissions || {};\r\n  const isOdataGetProductScopeEnabled = get(serverContext, ['DynamicPermissions', 'OdataGetProductScope'], false);\r\n\r\n  const isUnmounted = useRef(false);\r\n  useEffect(() => () => {\r\n    isUnmounted.current = true;\r\n    if (asyncTokenRef.current) {\r\n      asyncTokenRef.current.cancel();\r\n    }\r\n  }, []);\r\n\r\n  useEffect(() => {\r\n    const errors = [\r\n      ...isLoading && campaignObjective === 'ShoppingCampaign' ?\r\n        [i18n.getString(_TL_('Cannot continue until stores are loaded.'))] : [],\r\n      ...!isEmpty(loadingErrors) && campaignObjective === 'ShoppingCampaign' ?\r\n        [i18n.getString(_TL_('Cannot continue because stores failed to load. Please try again or contact the customer support.'))] : [],\r\n    ];\r\n    updateValidation(errors, data);\r\n  }, [i18n, campaignObjective, updateValidation, data, isLoading, loadingErrors]);\r\n\r\n  useEffect(() => {\r\n    if (!isLoading) {\r\n      return;\r\n    }\r\n\r\n    if (asyncTokenRef.current) {\r\n      asyncTokenRef.current.cancel();\r\n    }\r\n    const { cid, aid, uid } = scope.values;\r\n    const getProductDataCall = isOdataGetProductScopeEnabled ? () => getProductScopeFromOData(serverContext) : () => getProductData(cid, aid, uid);\r\n    const callStartTime = Date.now();\r\n\r\n    asyncTokenRef.current = getProductDataCall()\r\n      .on({\r\n        onSuccess: (productData) => {\r\n          const deltaTime = Date.now() - callStartTime;\r\n          if (isOdataGetProductScopeEnabled) {\r\n            activity.trace(`[PmaxStoreSelect][OdataGetProductScope] GetProductDataCallTime: ${deltaTime}`);\r\n          } else {\r\n            activity.trace(`[PmaxStoreSelect] GetProductDataCallTime: ${deltaTime}`);\r\n          }\r\n\r\n          if (!isUnmounted.current) {\r\n            const stores = getStores({ productData });\r\n            const countries = getCountries({ productData, legacyI18n, IsDomesticSimplifiedChineseEnabled });\r\n            if (isFunction(onLoadingDone)) {\r\n              onLoadingDone({ stores, countries });\r\n            }\r\n          }\r\n        },\r\n        onError: (err) => {\r\n          if (!isUnmounted.current) {\r\n            if (isFunction(onLoadingError)) {\r\n              onLoadingError(err);\r\n            }\r\n          }\r\n        },\r\n      });\r\n  }, [i18n, legacyI18n, scope.values, isLoading, onLoadingDone, onLoadingError, IsDomesticSimplifiedChineseEnabled, isOdataGetProductScopeEnabled, serverContext]);\r\n\r\n  const classes = useDefaultStyles(getStoreStyles);\r\n\r\n  return (\r\n    <div className={classNames('store-settings-loading', classes.storeSettings, isLoading && classes.storeSettingsLoading)}>\r\n      {isEmpty(loadingErrors) &&\r\n        <>\r\n          { onRenderCustomLoadingComponent ? onRenderCustomLoadingComponent() : <Loading text={i18n.getString(_TL_('Loading...'))} isVisible /> }\r\n          {alwaysShowError && campaignObjective === 'ShoppingCampaign' &&\r\n            <Alert\r\n              message={i18n.getString(_TL_('Cannot continue until stores are loaded.'))}\r\n              level=\"Error\"\r\n              icon={(<div className=\"alert-image\" />)}\r\n              dismissible={false}\r\n            />\r\n          }\r\n        </>\r\n      }\r\n      {!isEmpty(loadingErrors) &&\r\n        <Alert\r\n          message={i18n.getString(_TL_('Cannot continue because stores failed to load. Please try again or contact the customer support.'))}\r\n          level=\"Error\"\r\n          icon={(<div className=\"alert-image\" />)}\r\n          dismissible={false}\r\n        />\r\n      }\r\n    </div>\r\n  );\r\n};\r\n\r\nStoreSelectLoading.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  legacyI18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  scope: PropTypes.shape({\r\n    values: PropTypes.shape({\r\n      cid: PropTypes.number.isRequired,\r\n      aid: PropTypes.number.isRequired,\r\n      uid: PropTypes.number.isRequired,\r\n    }),\r\n  }).isRequired,\r\n  permissions: PropTypes.shape({\r\n    IsDomesticSimplifiedChineseEnabled: PropTypes.bool,\r\n  }).isRequired,\r\n  campaignObjective: PropTypes.string.isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({}).isRequired,\r\n    alwaysShowError: PropTypes.bool,\r\n  }).isRequired,\r\n  isLoading: PropTypes.bool.isRequired,\r\n  serverContext: PropTypes.shape({\r\n    CurrentAccount: PropTypes.shape({\r\n      TimeZone: PropTypes.number.isRequired,\r\n    }).isRequired,\r\n  }).isRequired,\r\n  activity: PropTypes.shape({\r\n    trace: PropTypes.func,\r\n  }),\r\n  onLoadingDone: PropTypes.func,\r\n  onLoadingError: PropTypes.func,\r\n  loadingErrors: PropTypes.arrayOf({}),\r\n  onRenderCustomLoadingComponent: PropTypes.func,\r\n};\r\n\r\nStoreSelectLoading.defaultProps = {\r\n  onLoadingDone: undefined,\r\n  onLoadingError: undefined,\r\n  loadingErrors: [],\r\n  onRenderCustomLoadingComponent: null,\r\n  activity: null,\r\n};\r\n\r\nexport const ValidatedStoreSelectLoading = withControlErrorHandling(withUnvalidatedControlErrors(withCustomValidation(withPermissions(withScope(withServerContext(withActivityContext(StoreSelectLoading)))))));\r\n","import _ from 'underscore';\r\nimport React, { useContext, useState, useCallback, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { getStoreStyles } from '../styles/get-store-style';\r\nimport { ValidatedStoreView } from './store-select-view';\r\nimport { ValidatedStoreCreation } from './store-select-creation';\r\nimport { ValidatedStoreSelectLoading } from './store-select-loading';\r\n\r\nexport function StoreSelectContainer(props) {\r\n  const {\r\n    campaign,\r\n    campaignObjective,\r\n    data,\r\n    onStoreDataLoaded,\r\n    showProductCollections,\r\n    hideFeedLabelAndCountry,\r\n    onRenderCustomLoadingComponent,\r\n  } = props;\r\n\r\n  const i18n = useContext(I18nContext);\r\n  const legacyI18n = useMemo(() => window.globalLegacyI18n.get('$/i18n!legacy/global'), []);\r\n  const classes = useDefaultStyles(getStoreStyles);\r\n  const [isLoading, setIsLoading] = useState(true);\r\n  const [stores, setStores] = useState({});\r\n  const [countries, setCountries] = useState({});\r\n  const hasStores = _.keys(stores).length > 0;\r\n  const campaignSaved = campaign.data.Id && campaign.data.Id > 0;\r\n\r\n  const onStoresLoadingDone = useCallback(({ stores: newStores, countries: newCountries }) => {\r\n    setStores(newStores);\r\n    setCountries(newCountries);\r\n    setIsLoading(false);\r\n    if (_.isFunction(onStoreDataLoaded)) {\r\n      onStoreDataLoaded({ stores: newStores, countries: newCountries });\r\n    }\r\n  }, [onStoreDataLoaded]);\r\n\r\n  const [storesLoadingErrors, setStoresLoadingErrors] = useState([]);\r\n  const onStoresLoadingError = useCallback((error) => {\r\n    setStoresLoadingErrors([error]);\r\n    setIsLoading(false);\r\n    if (_.isFunction(onStoreDataLoaded)) {\r\n      onStoreDataLoaded({ error });\r\n    }\r\n  }, [onStoreDataLoaded]);\r\n\r\n  return (\r\n    <div className={classNames('store-container', classes.intentTarget)}>\r\n      <div className={classNames('strore-theme-info-pre-selected-items', classes.preSelectedItemsStyle)}>\r\n        {isLoading || !_.isEmpty(storesLoadingErrors) ?\r\n          <ValidatedStoreSelectLoading\r\n            i18n={i18n}\r\n            legacyI18n={legacyI18n}\r\n            campaignObjective={campaignObjective}\r\n            isLoading={isLoading}\r\n            onLoadingDone={onStoresLoadingDone}\r\n            onLoadingError={onStoresLoadingError}\r\n            loadingErrors={storesLoadingErrors}\r\n            validationProps={{\r\n              initialValue: data,\r\n              data,\r\n            }}\r\n            formErrorProps={{\r\n              filter: () => false, // TODO: map store-related server errors\r\n            }}\r\n            onRenderCustomLoadingComponent={onRenderCustomLoadingComponent}\r\n          />\r\n          :\r\n          <div className={classes.storeSelectContent}>\r\n            {campaignSaved ?\r\n              <ValidatedStoreView\r\n                hasStores={hasStores}\r\n                stores={stores}\r\n                countries={countries}\r\n                validationProps={{\r\n                  initialValue: data,\r\n                  data,\r\n                }}\r\n                formErrorProps={{\r\n                  filter: () => false, // TODO: map store-related server errors\r\n                }}\r\n                showProductCollections={showProductCollections}\r\n              />\r\n              :\r\n              <ValidatedStoreCreation\r\n                hasStores={hasStores}\r\n                stores={stores}\r\n                countries={countries}\r\n                campaignObjective={campaignObjective}\r\n                validationProps={{\r\n                  initialValue: data,\r\n                  data,\r\n                }}\r\n                formErrorProps={{\r\n                  filter: () => false, // TODO: map store-related server errors\r\n                }}\r\n                showProductCollections={showProductCollections}\r\n                hideFeedLabelAndCountry={hideFeedLabelAndCountry}\r\n              />}\r\n          </div>\r\n        }\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n\r\nStoreSelectContainer.propTypes = {\r\n  campaign: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      Id: PropTypes.number,\r\n    }),\r\n  }).isRequired,\r\n  campaignObjective: PropTypes.string.isRequired,\r\n  data: PropTypes.shape({}).isRequired,\r\n  onStoreDataLoaded: PropTypes.func,\r\n  showProductCollections: PropTypes.bool,\r\n  hideFeedLabelAndCountry: PropTypes.bool,\r\n  onRenderCustomLoadingComponent: PropTypes.func,\r\n};\r\n\r\nStoreSelectContainer.defaultProps = {\r\n  onStoreDataLoaded: undefined,\r\n  showProductCollections: false,\r\n  hideFeedLabelAndCountry: false,\r\n  onRenderCustomLoadingComponent: null,\r\n};\r\n","/* eslint-disable jsx-a11y/img-redundant-alt */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport _ from 'underscore';\r\nimport React, { useCallback, useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { Link } from '@bingads-webui-react/fabric-with-signal';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getTitlePreview, getDescPreview } from '@bingads-webui-campaign/summary-grid-helper';\r\nimport { getExpandedTextAdDisplayUrl } from '@bingads-webui-campaign-legacy/crud-ad/service/displayUrl';\r\nimport { originalActionTextMapper } from '@bingads-webui-campaign-legacy/adextension-actionlink/model/language-type-translator';\r\n\r\nconst getAdCreationPreviewStyle = () => ({\r\n  AdCreationPreviewContainer: {\r\n    whiteSpace: 'normal',\r\n    '& .ad-preview-content-container': {\r\n      width: '338px',\r\n      border: '1px solid rgba(151, 151, 151, 1)',\r\n      borderRadius: '2px',\r\n      padding: '16px',\r\n      '& .ad-title-preview': {\r\n        fontSize: '18px',\r\n        lineHeight: '22px',\r\n        color: '#1A0DAB',\r\n      },\r\n      '& .url-line': {\r\n        alignItems: 'baseline',\r\n      },\r\n      '& .ad-url-preview': {\r\n        fontSize: '14px',\r\n        fontWeight: '700',\r\n        lineHeight: '20px',\r\n        color: '#006621',\r\n      },\r\n      '& .ad-description-preview': {\r\n        '& .ad-slug': {\r\n          color: '#666',\r\n          lineHeight: '24px',\r\n          border: '1px solid #ddd',\r\n          padding: '0 2px',\r\n          fontSize: '11px',\r\n          marginRight: '4px',\r\n          borderRadius: '6px',\r\n        },\r\n        fontSize: '14px',\r\n        lineHeight: '20px',\r\n        color: '#666666',\r\n        marginTop: '6px',\r\n      },\r\n    },\r\n    '& .responsive-ad-preview-content-container': {\r\n      display: 'flex',\r\n      flexDirection: 'column',\r\n      position: 'relative',\r\n      borderRadius: '10px',\r\n      width: '260px',\r\n      overflow: 'hidden',\r\n      cursor: 'pointer',\r\n      textDecoration: 'none',\r\n      boxShadow: '0px 4px 4px 0px rgba(0, 0, 0, 0.15)',\r\n      '&:active:hover': {\r\n        textDecoration: 'none',\r\n      },\r\n      '& .ad-label': {\r\n        color: '#ddddd',\r\n        opacity: '0.9',\r\n        margin: '5px',\r\n        position: 'absolute',\r\n        fontSize: '8px',\r\n        borderRadius: '2px',\r\n        backgroundColor: 'white',\r\n        width: '18px',\r\n        height: '13px',\r\n        textAlign: 'center',\r\n        verticalAlign: 'middle',\r\n      },\r\n      '& .ad-preview-image': {\r\n        width: '100%',\r\n        height: '136px',\r\n        objectFit: 'cover',\r\n        objectPosition: 'top',\r\n      },\r\n      '& .mma-text-content-container': {\r\n        padding: '12px 0 16px 16px',\r\n        fontWeight: '600',\r\n        wordWrap: 'break-word',\r\n        '& .mma-short-headline': {\r\n          fontSize: '16px',\r\n          color: '#323130',\r\n        },\r\n        '& .mma-display-url': {\r\n          fontSize: '8px',\r\n          lineHeight: '12px',\r\n          color: '#459D64',\r\n        },\r\n        '& .mma-description': {\r\n          fontSize: '10px',\r\n          lineHeight: '16px',\r\n          color: '#323130',\r\n          maxWidth: '160px',\r\n          wordWrap: 'break-word',\r\n        },\r\n\r\n      },\r\n      '& .mma-callToAction': {\r\n        color: 'white',\r\n        right: '12px',\r\n        border: 'none',\r\n        bottom: '12px',\r\n        position: 'absolute',\r\n        fontSize: '11px',\r\n        lineHeight: '24px',\r\n        fontWeight: '600',\r\n        borderRadius: '20px',\r\n        opacity: '0.9',\r\n        backgroundColor: '#A0A0A0',\r\n      },\r\n    },\r\n  },\r\n});\r\n\r\nconst ResponsiveSearchAdPreview = ({ data }) => { // for RSA\r\n  const i18n = useContext(I18nContext);\r\n  const handleRSAData = useCallback(() => {\r\n    const convertedFinalUrl = _.first(data.FinalUrls);\r\n    const headlineList = _.map(data.Headlines, i => ({\r\n      Text: i.Asset && i.Asset.Text,\r\n      PinnedField: i.PinnedField,\r\n    }));\r\n    const descriptionList = _.map(data.Descriptions, i => ({\r\n      Text: i.Asset && i.Asset.Text,\r\n      PinnedField: i.PinnedField,\r\n    }));\r\n    const convertedTitle = getTitlePreview(headlineList);\r\n    const convertedText = getDescPreview(descriptionList);\r\n    const convertedDisplayUrl = getExpandedTextAdDisplayUrl(_.first(data.FinalUrls), data.DisplayUrl, data.Path1, data.Path2);\r\n    const resultData = {\r\n      convertedFinalUrl,\r\n      convertedTitle,\r\n      convertedText,\r\n      convertedDisplayUrl,\r\n    };\r\n    return resultData;\r\n  }, [data]);\r\n\r\n  const resultData = useMemo(handleRSAData, [data]);\r\n  return (\r\n    <div className=\"ad-preview-content-container\">\r\n      <Text block>\r\n        <Link className=\"ad-title-preview\" target=\"_blank\" href={resultData.convertedFinalUrl}>{resultData.convertedTitle}</Link>\r\n      </Text>\r\n      <Text block nowrap className=\"url-line\">\r\n        <Link className=\"ad-url-preview\">{resultData.convertedDisplayUrl}</Link>\r\n      </Text>\r\n      <Text block className=\"ad-description-preview\">\r\n        <span className=\"ad-slug\">{i18n.getString(_TL_('Ad'))}</span>{resultData.convertedText}\r\n      </Text>\r\n    </div>\r\n  );\r\n};\r\nResponsiveSearchAdPreview.propTypes = {\r\n  data: PropTypes.shape({\r\n    FinalUrls: PropTypes.arrayOf(PropTypes.string),\r\n    Headlines: PropTypes.arrayOf(PropTypes.shape({\r\n      Asset: PropTypes.shape({\r\n        Text: PropTypes.string,\r\n      }),\r\n      PinnedField: PropTypes.string,\r\n    })),\r\n    Descriptions: PropTypes.arrayOf(PropTypes.shape({\r\n      Asset: PropTypes.shape({\r\n        Text: PropTypes.string,\r\n      }),\r\n      PinnedField: PropTypes.string,\r\n    })),\r\n    DisplayUrl: PropTypes.string,\r\n    Path1: PropTypes.string,\r\n    Path2: PropTypes.string,\r\n  }),\r\n};\r\nResponsiveSearchAdPreview.defaultProps = {\r\n  data: {\r\n    FinalUrls: [],\r\n    Headlines: [],\r\n    Descriptions: [],\r\n    DisplayUrl: '',\r\n    Path1: '',\r\n    Path2: '',\r\n  },\r\n};\r\n\r\nconst ResponsiveAdPreview = ({ data }) => { // for MMA\r\n  const i18n = useContext(I18nContext);\r\n  const { LandscapeImageMediaUrl } = data;\r\n  const convertedFinalUrl = _.first(data.FinalUrls);\r\n  const callToAction = originalActionTextMapper[data.CallToActionLanguage] && originalActionTextMapper[data.CallToActionLanguage][data.CallToAction];\r\n  return (\r\n    <Link target=\"_blank\" href={convertedFinalUrl} className=\"responsive-ad-preview-content-container\">\r\n      <div className=\"\">\r\n        <div className=\"ad-label\">{i18n.getString(_TL_('Ad'))}</div>\r\n        {LandscapeImageMediaUrl && <img className=\"ad-preview-image\" src={LandscapeImageMediaUrl} align=\"left\" alt=\"Ad Preview Image\" />}\r\n      </div>\r\n      <div className=\"mma-text-content-container\">\r\n        <div className=\"mma-short-headline\">{data.Headline}</div>\r\n        <div className=\"mma-display-url\">{data.DisplayUrl}</div>\r\n        <div className=\"mma-description\">{data.Text}</div>\r\n      </div>\r\n      {callToAction && <button className=\"mma-callToAction\">{callToAction}</button>}\r\n    </Link>\r\n  );\r\n};\r\n\r\nResponsiveAdPreview.propTypes = {\r\n  data: PropTypes.shape({\r\n    Headline: PropTypes.string,\r\n    Text: PropTypes.string,\r\n    LandscapeImageMediaUrl: PropTypes.string,\r\n    DisplayUrl: PropTypes.string,\r\n    CallToActionLanguage: PropTypes.string,\r\n    CallToAction: PropTypes.string,\r\n  }),\r\n};\r\nResponsiveAdPreview.defaultProps = {\r\n  data: {\r\n    Headline: '',\r\n    Text: '',\r\n    LandscapeImageMediaUrl: '',\r\n    DisplayUrl: '',\r\n    CallToActionLanguage: '',\r\n    CallToAction: '',\r\n  },\r\n};\r\n\r\nexport const AdCreationPreview = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const classes = useDefaultStyles(getAdCreationPreviewStyle);\r\n\r\n  const getAdContent = useCallback(() => {\r\n    if (_.isEmpty(data)) {\r\n      return i18n.getString(_TL_('No Ad'));\r\n    } else if (data.Type === 'ResponsiveSearch') {\r\n      return <div className={classes.AdCreationPreviewContainer}><ResponsiveSearchAdPreview i18n={i18n} data={data} /></div>;\r\n    } else if (data.Type === 'Responsive') {\r\n      return <div className={classes.AdCreationPreviewContainer}><ResponsiveAdPreview data={data} /></div>;\r\n    }\r\n    return i18n.getString(_TL_('1 Ad'));\r\n  }, [data, classes, i18n]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Ad creation') }}>\r\n      {getAdContent()}\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nAdCreationPreview.propTypes = {\r\n  data: PropTypes.shape({\r\n    Type: PropTypes.string.isRequired,\r\n  }),\r\n};\r\n\r\nAdCreationPreview.defaultProps = {\r\n  data: PropTypes.shape({\r\n  }),\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const Store = ({ storeName }) => (\r\n  <PropertyRow propertyLabel={{ label: _TL_('Store') }}>\r\n    <Text>{storeName}</Text>\r\n  </PropertyRow>\r\n);\r\n\r\nStore.propTypes = {\r\n  storeName: PropTypes.string,\r\n};\r\n\r\nStore.defaultProps = {\r\n  storeName: null,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const ProductCollections = ({ isProductCollectionsEnabled }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const productCollectionsText = isProductCollectionsEnabled ? i18n.getString(_TL_('Enabled')) : i18n.getString(_TL_('Not enabled'));\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Product collections') }}>\r\n      <Text>{productCollectionsText}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nProductCollections.propTypes = {\r\n  isProductCollectionsEnabled: PropTypes.bool,\r\n};\r\n\r\nProductCollections.defaultProps = {\r\n  isProductCollectionsEnabled: false,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const LocalInventory = ({ isLocalInventoryEnabled }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const localInventoryText = isLocalInventoryEnabled ? i18n.getString(_TL_('Enabled')) : i18n.getString(_TL_('Not enabled'));\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Local inventory') }}>\r\n      <Text>{localInventoryText}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nLocalInventory.propTypes = {\r\n  isLocalInventoryEnabled: PropTypes.bool,\r\n};\r\n\r\nLocalInventory.defaultProps = {\r\n  isLocalInventoryEnabled: false,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { isEmpty } from 'underscore';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { SelectedItem } from '@bingads-webui-campaign-react/pill-item-components';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nconst getProductsStyle = () => ({\r\n  productFilterItem: {\r\n    marginBottom: 5,\r\n  },\r\n});\r\n\r\nexport const Products = ({ productFilters, useSelectedItem }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const classes = useDefaultStyles(getProductsStyle);\r\n\r\n  let productsText = '';\r\n\r\n  if (isEmpty(productFilters)) {\r\n    productsText = i18n.getString(_TL_('All products'));\r\n  } else if (!useSelectedItem) {\r\n    productsText = productFilters.join(' & ');\r\n  }\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Products') }}>\r\n      {useSelectedItem && !isEmpty(productFilters) ?\r\n        productFilters.map((filter, index) => (\r\n          <div key={filter} className={classes.productFilterItem}>\r\n            <SelectedItem\r\n              key={filter}\r\n              itemText={filter}\r\n              itemIndex={index}\r\n              maxContentWidth\r\n            />\r\n          </div>)) :\r\n        (<Text>{productsText}</Text>)}\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nProducts.propTypes = {\r\n  productFilters: PropTypes.arrayOf(PropTypes.string),\r\n  useSelectedItem: PropTypes.bool,\r\n};\r\n\r\nProducts.defaultProps = {\r\n  productFilters: [],\r\n  useSelectedItem: false,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const Feeds = ({ feedLabel }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const feedLabelsText = i18n.getString(_TL_('Filter by feed label: {{feedLabel}}'), { feedLabel });\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Feeds') }}>\r\n      <Text>{feedLabelsText}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nFeeds.propTypes = {\r\n  feedLabel: PropTypes.string.isRequired,\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const LocationTargeting = ({ locations, targetOption }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const explicitLocations = useMemo(() => {\r\n    const numLocations = locations.length;\r\n\r\n    if (targetOption === 'everywhere') {\r\n      return i18n.getString(_TL_('Everywhere'));\r\n    }\r\n\r\n    if (numLocations === 1) {\r\n      return locations[0];\r\n    } else if (numLocations === 2) {\r\n      return `${locations[0]}, ${locations[1]}`;\r\n    } else if (numLocations >= 3) {\r\n      const moreThan2LocationsTemplate = _TL_('{0} +{1} more', 'The {0} placeholder represents the first location. The {1} placeholder represents the number of remaining locations');\r\n      return i18n.getString(moreThan2LocationsTemplate).replace('{0}', locations[0]).replace('{1}', numLocations - 1);\r\n    }\r\n    return null;\r\n  }, [i18n, locations, targetOption]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Location') }}>\r\n      <Text>{explicitLocations}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nLocationTargeting.propTypes = {\r\n  locations: PropTypes.arrayOf(PropTypes.string),\r\n  targetOption: PropTypes.string,\r\n};\r\n\r\nLocationTargeting.defaultProps = {\r\n  locations: [],\r\n  targetOption: null,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const AgeRanges = {\r\n  EighteenToTwentyFive: _TL_('18-24'),\r\n  TwentyFiveToThirtyFive: _TL_('25-34'),\r\n  ThirtyFiveToFifty: _TL_('35-49'),\r\n  FiftyToSixtyFive: _TL_('50-64'),\r\n  SixtyFiveAndAbove: _TL_('65+'),\r\n  Unknown: _TL_('Unknown'),\r\n  // LinkedIn specific\r\n  ThirtyFiveToFiftyFive: _TL_('35-54'),\r\n  FiftyFiveAndAbove: _TL_('55+'),\r\n};\r\n\r\nconst sortAgeRanges = ageRanges => _.sortBy(ageRanges, ageRange => AgeRanges[ageRange]);\r\n\r\nexport const formatAgeRange = (ageRange, i18n) => (AgeRanges[ageRange] ? i18n.getString(AgeRanges[ageRange]) : ageRange);\r\n\r\nexport const formatAgeRanges = (ageRanges, i18n) => _.chain(sortAgeRanges(ageRanges))\r\n  .map(ageRange => formatAgeRange(ageRange, i18n))\r\n  .join(i18n.getString(_TL_(', ')))\r\n  .value();\r\n\r\nexport const AgeRangeTargeting = ({ ageRanges }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Age') }}>\r\n      <Text>{formatAgeRanges(ageRanges, i18n)}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nAgeRangeTargeting.propTypes = {\r\n  ageRanges: PropTypes.arrayOf(PropTypes.string),\r\n};\r\n\r\nAgeRangeTargeting.defaultProps = {\r\n  ageRanges: [],\r\n};\r\n","import React, { useContext } from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const Genders = {\r\n  Female: _TL_('Female'),\r\n  Male: _TL_('Male'),\r\n  Unknown: _TL_('Unknown'),\r\n};\r\n\r\nconst sortGenders = genders => _.sortBy(genders, gender => Genders[gender]);\r\n\r\nexport const formatGender = (gender, i18n) => (Genders[gender] ? i18n.getString(Genders[gender]) : gender);\r\n\r\nexport const formatGenders = (genders, i18n) => _.chain(sortGenders(genders))\r\n  .map(gender => formatGender(gender, i18n))\r\n  .join(i18n.getString(_TL_(', ')))\r\n  .value();\r\n\r\nexport const GenderTargeting = ({ genders }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Gender') }}>\r\n      <Text>{formatGenders(genders, i18n)}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nGenderTargeting.propTypes = {\r\n  genders: PropTypes.arrayOf(PropTypes.string),\r\n};\r\n\r\nGenderTargeting.defaultProps = {\r\n  genders: [],\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { getDay, getMin, getTime, minuteToSaveMap } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { getDateSettingDetails } from '@bingads-webui-campaign/date-setting';\r\n\r\nexport const getDayTimeDetails = (i18n, dayTime, is12) => {\r\n  const startHour = dayTime.StartHour;\r\n  const endHour = dayTime.EndHour;\r\n  const startMin = getMin(minuteToSaveMap[dayTime.StartMinute]);\r\n  const endMin = getMin(minuteToSaveMap[dayTime.EndMinute]);\r\n  const dateTimePart = `${i18n.getString(getDay(dayTime.Day))} ${i18n.getString(_TL_('from {{from}} to {{to}}'), {\r\n    from: i18n.getString(getTime(startHour, is12), { min: startMin }),\r\n    to: i18n.getString(getTime(endHour, is12), { min: endMin }),\r\n  })}`;\r\n\r\n  return dateTimePart;\r\n};\r\n\r\nconst getAdScheduleDetails = (i18n, adSchedules, timeDisplayType, useSearcherTimeZone) => {\r\n  let details = '';\r\n\r\n  const is12 = timeDisplayType === '12-hour';\r\n  const len = adSchedules.length;\r\n\r\n  if (len === 0) {\r\n    const defaultSchedule = {\r\n      Id: '',\r\n      Day: 'Alldays',\r\n      StartHour: 0,\r\n      StartMinute: 'ZERO',\r\n      EndHour: 24,\r\n      EndMinute: 'ZERO',\r\n      BidAdjustmentType: 1,\r\n      BidAdjustmentAmount: 0,\r\n      CashbackPercent: null,\r\n    };\r\n\r\n    details += getDayTimeDetails(i18n, defaultSchedule, is12);\r\n  } else {\r\n    _.forEach(adSchedules, (schedule, index) => {\r\n      details += getDayTimeDetails(i18n, schedule, is12);\r\n      if (details && index < len - 1) {\r\n        details += ', ';\r\n      }\r\n    });\r\n  }\r\n\r\n  if (useSearcherTimeZone) {\r\n    details += ` ${i18n.getString(_TL_('In Ad viewer\\'s time zone'))}`;\r\n  } else {\r\n    details += ` ${i18n.getString(_TL_('In Your account\\'s time zone'))}`;\r\n  }\r\n\r\n  return details;\r\n};\r\n\r\nexport const AdSchedule = ({\r\n  startDate, endDate, adSchedules, useSearcherTimeZone, timeDisplayType, includeStartEnd,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const dateSettings = useMemo(() => (includeStartEnd ? getDateSettingDetails(i18n, startDate, endDate) : ''), [endDate, i18n, includeStartEnd, startDate]);\r\n  const adScheduleSettings = useMemo(\r\n    () => (adSchedules ?\r\n      getAdScheduleDetails(i18n, adSchedules, timeDisplayType, useSearcherTimeZone) : '')\r\n    , [adSchedules, i18n, timeDisplayType, useSearcherTimeZone]\r\n  );\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Schedule') }}>\r\n      <Text>{includeStartEnd ? `${dateSettings}${adScheduleSettings && `: ${adScheduleSettings}`}` : adScheduleSettings}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nAdSchedule.propTypes = {\r\n  startDate: PropTypes.string.isRequired,\r\n  endDate: PropTypes.string,\r\n  adSchedules: PropTypes.arrayOf(PropTypes.shape({})),\r\n  useSearcherTimeZone: PropTypes.bool,\r\n  timeDisplayType: PropTypes.string,\r\n  includeStartEnd: PropTypes.bool,\r\n};\r\n\r\nAdSchedule.defaultProps = {\r\n  endDate: null,\r\n  adSchedules: null,\r\n  useSearcherTimeZone: false,\r\n  timeDisplayType: '12-hour',\r\n  includeStartEnd: true,\r\n};\r\n","/* eslint-disable react/no-array-index-key */\r\nimport React, { useContext, useMemo } from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { getDay, getMin, getTime, minuteToSaveMap, } from '@bingads-webui-campaign-react/wizard-shared-components';\r\n\r\nexport const getDayTimeDetails = (i18n, dayTime, is12) => {\r\n  const startHour = dayTime.StartHour;\r\n  const endHour = dayTime.EndHour;\r\n  const startMin = getMin(minuteToSaveMap[dayTime.StartMinute]);\r\n  const endMin = getMin(minuteToSaveMap[dayTime.EndMinute]);\r\n  const dateTimePart = `${i18n.getString(getDay(dayTime.Day))}, ${i18n.getString(_TL_('{{from}} - {{to}}'), {\r\n    from: i18n.getString(getTime(startHour, is12), { min: startMin }),\r\n    to: i18n.getString(getTime(endHour, is12), { min: endMin }),\r\n  })}`;\r\n\r\n  return `${dateTimePart}: ${dayTime.BidAdjustmentType > 0 ? i18n.getString(_TL_('Increase by')) : i18n.getString(_TL_('Decrease by'))}\r\n  ${dayTime.BidAdjustmentAmount || 0}%`;\r\n};\r\n\r\nconst getAdScheduleDetails = (i18n, adSchedules, timeDisplayType, useSearcherTimeZone) => {\r\n  const details = [];\r\n\r\n  const is12 = timeDisplayType === '12-hour';\r\n  const len = (adSchedules && adSchedules.length) || 0;\r\n\r\n  if (len === 0) {\r\n    const defaultSchedule = {\r\n      Id: '',\r\n      Day: 'Alldays',\r\n      StartHour: 0,\r\n      StartMinute: 'ZERO',\r\n      EndHour: 24,\r\n      EndMinute: 'ZERO',\r\n      BidAdjustmentType: 1,\r\n      BidAdjustmentAmount: 0,\r\n      CashbackPercent: null,\r\n    };\r\n\r\n    details.push(getDayTimeDetails(i18n, defaultSchedule, is12));\r\n  } else {\r\n    _.forEach(adSchedules, (schedule) => {\r\n      details.push(getDayTimeDetails(i18n, schedule, is12));\r\n    });\r\n  }\r\n\r\n  if (useSearcherTimeZone) {\r\n    details.push(i18n.getString(_TL_('In ad viewer\\'s time zone')));\r\n  } else {\r\n    details.push(i18n.getString(_TL_('In your account\\'s time zone')));\r\n  }\r\n\r\n  return details;\r\n};\r\n\r\nexport const AdScheduleWithBidAdjustments = ({\r\n  adSchedules, useSearcherTimeZone, timeDisplayType,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const adScheduleSettings = useMemo(\r\n    () => (getAdScheduleDetails(i18n, adSchedules, timeDisplayType, useSearcherTimeZone))\r\n    , [adSchedules, i18n, timeDisplayType, useSearcherTimeZone]\r\n  );\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Ad schedule') }}>\r\n      {adScheduleSettings.map((schedule, index) => (\r\n        <Text block key={index}>{schedule}</Text>\r\n      ))}\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nAdScheduleWithBidAdjustments.propTypes = {\r\n  adSchedules: PropTypes.arrayOf(PropTypes.shape({})),\r\n  useSearcherTimeZone: PropTypes.bool,\r\n  timeDisplayType: PropTypes.string,\r\n};\r\n\r\nAdScheduleWithBidAdjustments.defaultProps = {\r\n  adSchedules: null,\r\n  useSearcherTimeZone: false,\r\n  timeDisplayType: '12-hour',\r\n};\r\n","import React, { useContext } from 'react';\r\nimport { isEmpty } from 'underscore'\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const formatTargets = ({ data, includedData, excludedData, i18n, singularText, pluralText }) => {\r\n  if ((!data || !data.length) && (isEmpty(includedData) && isEmpty(excludedData))) {\r\n    return i18n.getString(_TL_('Targeting: No {{singularText}} segments selected.'), { singularText });\r\n  }\r\n\r\n  const targetedCriterions = includedData || data.filter(({ Status }) => Status === 'Active');\r\n  const excludedCriterions = excludedData || data.filter(({ Status }) => Status === 'Excluded');\r\n\r\n  let targetedCriterionDetails = '';\r\n  let excludedCriterionDetails = '';\r\n\r\n  if (targetedCriterions.length === 1) {\r\n    targetedCriterionDetails = i18n.getString(_TL_('Targeted: 1 {{singularText}}'), { singularText });\r\n  } else if (targetedCriterions.length > 1) {\r\n    targetedCriterionDetails = i18n.getString(_TL_('Targeted: {{count}} {{pluralText}}'), { count: (targetedCriterions.length), pluralText });\r\n  }\r\n\r\n  if (excludedCriterions.length === 1) {\r\n    excludedCriterionDetails = i18n.getString(_TL_('Excluded: 1 {{singularText}}'), { singularText });\r\n  } else if (excludedCriterions.length > 1) {\r\n    excludedCriterionDetails = i18n.getString(_TL_('Excluded: {{count}} {{pluralText}}'), { count: (excludedCriterions.length), pluralText });\r\n  }\r\n\r\n  return `${targetedCriterionDetails}${targetedCriterionDetails && excludedCriterionDetails && '. '}${excludedCriterionDetails}`;\r\n};\r\n\r\nexport const CommonTarget = ({ data, label, singularText, pluralText, includedData, excludedData }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label }}>\r\n      <Text>{formatTargets({ data, i18n, singularText, pluralText, includedData, excludedData })}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nCommonTarget.propTypes = {\r\n  data: PropTypes.arrayOf(PropTypes.shape({})),\r\n  label: PropTypes.string,\r\n  includedData: PropTypes.arrayOf(PropTypes.shape({})),\r\n  excludedData: PropTypes.arrayOf(PropTypes.shape({})),\r\n  singularText: PropTypes.string,\r\n  pluralText: PropTypes.string,\r\n};\r\n\r\nCommonTarget.defaultProps = {\r\n  data: [],\r\n  label: '',\r\n  includedData: null,\r\n  excludedData: null,\r\n  singularText: '',\r\n  pluralText: '',\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { CommonTarget } from './common-targeting';\r\n\r\nexport const Audience = ({ audiences }) => (\r\n  <CommonTarget label={_TL_('Audience')} data={audiences} pluralText=\"audiences\" singularText=\"audience\" />\r\n);\r\n\r\nAudience.propTypes = {\r\n  audiences: PropTypes.arrayOf(PropTypes.shape({})),\r\n};\r\n\r\nAudience.defaultProps = {\r\n  audiences: [],\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { CommonTarget } from './common-targeting';\r\n\r\nexport const Interest = ({ interests }) => (\r\n  <CommonTarget label={_TL_('Interest')} data={interests} pluralText=\"interests\" singularText=\"interest\" />\r\n);\r\n\r\nInterest.propTypes = {\r\n  interests: PropTypes.arrayOf(PropTypes.shape({})),\r\n};\r\n\r\nInterest.defaultProps = {\r\n  interests: [],\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nconst predictiveTargetingMessageTemplate = _TL_('Predictive targeting is {0}', \"The placeholder will display either 'on' or 'off'.\");\r\nconst predictiveTargetingOn = _TL_('on');\r\nconst predictiveTargetingOff = _TL_('off');\r\n\r\nexport const PredictiveTargeting = ({ isPredictiveTargetingEnabled }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const predictiveTargetingText = i18n.getString(predictiveTargetingMessageTemplate).replace('{0}', isPredictiveTargetingEnabled ? predictiveTargetingOn : predictiveTargetingOff);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Predictive targeting') }}>\r\n      <Text>{predictiveTargetingText}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nPredictiveTargeting.propTypes = {\r\n  isPredictiveTargetingEnabled: PropTypes.bool,\r\n};\r\n\r\nPredictiveTargeting.defaultProps = {\r\n  isPredictiveTargetingEnabled: false,\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { getDateSettingDetails } from '@bingads-webui-campaign/date-setting';\r\n\r\nexport const StartEndDates = ({\r\n  startDate, endDate, isUseCampaignLevelDates, isDateLevelDisplayed,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n  const dateSettings = useMemo(\r\n    () => getDateSettingDetails(i18n, startDate, endDate, isUseCampaignLevelDates, isDateLevelDisplayed),\r\n    [i18n, startDate, endDate, isUseCampaignLevelDates, isDateLevelDisplayed]\r\n  );\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Start and end dates') }}>\r\n      <Text>{dateSettings}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nStartEndDates.propTypes = {\r\n  startDate: PropTypes.string.isRequired,\r\n  endDate: PropTypes.string,\r\n  isUseCampaignLevelDates: PropTypes.bool,\r\n  isDateLevelDisplayed: PropTypes.bool,\r\n};\r\n\r\nStartEndDates.defaultProps = {\r\n  endDate: null,\r\n  isUseCampaignLevelDates: false,\r\n  isDateLevelDisplayed: false,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { syndEnum } from '@bingads-webui-campaign-react/constants';\r\n\r\n// Does not support campaign type specific localization\r\nconst getLocalizationMapping = (adDistribution) => {\r\n  switch (adDistribution) {\r\n    case syndEnum.BingYahooOnly:\r\n      return _TL_('Microsoft sites and select traffic');\r\n    case syndEnum.SearchPartnersOnly:\r\n      return _TL_('Only partner traffic');\r\n    case syndEnum.BingYahooAndSearchPartners:\r\n    default:\r\n      return _TL_('The entire Microsoft Advertising Network (recommended)');\r\n  }\r\n};\r\n\r\nexport const AdDistribution = ({ adDistribution }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Ad distribution') }}>\r\n      <Text>{i18n.getString(getLocalizationMapping(adDistribution))}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nAdDistribution.propTypes = {\r\n  adDistribution: PropTypes.string.isRequired,\r\n};\r\n","import _ from 'underscore';\r\nimport React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nconst formatKeywords = ({ i18n, data, showLength }) => {\r\n  if (_.isEmpty(data) || data.total === 0 || _.isEmpty(data.value)) {\r\n    return i18n.getString(_TL_('No keyword'));\r\n  }\r\n  const len = data.total;\r\n  if (len > showLength) {\r\n    let detail = data.value.slice(0, showLength).map(keyword => keyword.Text).join(i18n.getString(_TL_(', ')));\r\n    detail += i18n.getString(_TL_('... +{{count}} more'), { count: len - showLength });\r\n    return detail;\r\n  }\r\n  return data.value.map(keyword => keyword.Text).join(i18n.getString(_TL_(', ')));\r\n};\r\n\r\nexport const Keywords = ({ data, showLength }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Keywords') }}>\r\n      <Text block style={{ 'white-space': 'normal' }} >{formatKeywords({ i18n, data, showLength })}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nKeywords.propTypes = {\r\n  data: PropTypes.shape({\r\n    value: PropTypes.arrayOf(PropTypes.shape({\r\n      Text: PropTypes.string,\r\n    })),\r\n    total: PropTypes.number,\r\n  }),\r\n  showLength: PropTypes.number,\r\n};\r\n\r\nKeywords.defaultProps = {\r\n  data: {},\r\n  showLength: 10,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nconst formatText = ({ data, i18n }) => {\r\n  if (!data || data.length === 0) {\r\n    return i18n.getString(_TL_('All genres'));\r\n  }\r\n\r\n  if (data.length === 1) {\r\n    return i18n.getString(_TL_('1 genre'));\r\n  }\r\n\r\n  return i18n.getString(_TL_('{{count}} genres'), { count: data.length });\r\n};\r\n\r\nexport const Genre = ({ genreTargets }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Genre') }}>\r\n      <Text>{formatText({ data: genreTargets, i18n })}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nGenre.propTypes = {\r\n  genreTargets: PropTypes.arrayOf(PropTypes.shape({})),\r\n};\r\n\r\nGenre.defaultProps = {\r\n  genreTargets: [],\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const Disclaimer = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const disclaimerName = data?.Name || '';\r\n  const disclaimerText = disclaimerName.length > 0 ? i18n.getString(_TL_('{{disclaimerName}}'), { disclaimerName }) : i18n.getString(_TL_('No disclaimer selected'));\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Disclaimers') }}>\r\n      <Text>{disclaimerText}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nDisclaimer.propTypes = {\r\n  data: PropTypes.shape({\r\n    Name: PropTypes.string,\r\n  }),\r\n};\r\n\r\nDisclaimer.defaultProps = {\r\n  data: {\r\n    Name: '',\r\n  },\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { CommonTarget } from './common-targeting';\r\n\r\nexport const CompanyName = ({ companyTargets, negativeCompanyTargets }) => (\r\n  <CommonTarget label={_TL_('Company')} includedData={companyTargets} excludedData={negativeCompanyTargets} singularText=\"company\" pluralText=\"companies\" />\r\n);\r\n\r\nCompanyName.propTypes = {\r\n  companyTargets: PropTypes.arrayOf(PropTypes.shape({})),\r\n  negativeCompanyTargets: PropTypes.arrayOf(PropTypes.shape({})),\r\n};\r\n\r\nCompanyName.defaultProps = {\r\n  companyTargets: [],\r\n  negativeCompanyTargets: [],\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { CommonTarget } from './common-targeting';\r\n\r\nexport const JobFunction = ({ jobTargets, negativeJobTargets }) => (\r\n  <CommonTarget label={_TL_('Job')} includedData={jobTargets} excludedData={negativeJobTargets} singularText=\"job function\" pluralText=\"job functions\" />\r\n);\r\n\r\nJobFunction.propTypes = {\r\n  jobTargets: PropTypes.arrayOf(PropTypes.shape({})),\r\n  negativeJobTargets: PropTypes.arrayOf(PropTypes.shape({})),\r\n};\r\n\r\nJobFunction.defaultProps = {\r\n  jobTargets: [],\r\n  negativeJobTargets: [],\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { CommonTarget } from './common-targeting';\r\n\r\nexport const Industry = ({ industryTargets, negativeIndustryTargets }) => (\r\n  <CommonTarget label={_TL_('Industry')} includedData={industryTargets} excludedData={negativeIndustryTargets} singularText=\"industry\" pluralText=\"industries\" />\r\n);\r\n\r\nIndustry.propTypes = {\r\n  industryTargets: PropTypes.arrayOf(PropTypes.shape({})),\r\n  negativeIndustryTargets: PropTypes.arrayOf(PropTypes.shape({})),\r\n};\r\n\r\nIndustry.defaultProps = {\r\n  industryTargets: [],\r\n  negativeIndustryTargets: [],\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const formatConversionGoals = (i18n, conversionGoals) => {\r\n  if (conversionGoals && conversionGoals.goalScopeSelection === 'account-scope') {\r\n    return i18n.getString(_TL_('Account level conversion goals'));\r\n  }\r\n\r\n  const goalSelection = (conversionGoals && conversionGoals.goalSelection) || [];\r\n\r\n  if (goalSelection.length === 1) {\r\n    return i18n.getString(_TL_('1 conversion goal'));\r\n  } else if (goalSelection.length > 1) {\r\n    return i18n.getString(_TL_('{{count}} conversion goals'), { count: goalSelection.length });\r\n  }\r\n\r\n  return i18n.getString(_TL_('No conversion goals'));\r\n};\r\n\r\nexport const ConversionGoals = ({ conversionGoals }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Conversion goals') }}>\r\n      <Text>{formatConversionGoals(i18n, conversionGoals)}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nConversionGoals.propTypes = {\r\n  conversionGoals: PropTypes.shape({}),\r\n};\r\n\r\nConversionGoals.defaultProps = {\r\n  conversionGoals: null,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const BudgetTypes = {\r\n  DailyStandard: 'DailyStandard',\r\n  LifetimeBudgetStandard: 'LifetimeBudgetStandard',\r\n};\r\n\r\n\r\nconst formatBudget = (i18n, data, currencyCode) => {\r\n  if (!data) {\r\n    return i18n.getString(_TL_('No budget'));\r\n  }\r\n\r\n  const { Amount, Id, Type } = data;\r\n\r\n  if (Id) {\r\n    return i18n.getString(_TL_('Budget applied from shared library'));\r\n  }\r\n\r\n  const currencySymbol = i18n.getCurrencySymbol(currencyCode);\r\n\r\n  if (Type === BudgetTypes.LifetimeBudgetStandard) {\r\n    return `${currencySymbol}${Amount} ${i18n.getString(_TL_('campaign total'))}`;\r\n  }\r\n\r\n  return `${currencySymbol}${Amount}/${i18n.getString(_TL_('day'))}`;\r\n};\r\n\r\nexport const Budget = ({ data, currencyCode }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Budget') }}>\r\n      <Text>{formatBudget(i18n, data, currencyCode)}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nBudget.propTypes = {\r\n  data: PropTypes.shape({}),\r\n  currencyCode: PropTypes.string,\r\n};\r\n\r\nBudget.defaultProps = {\r\n  data: null,\r\n  currencyCode: 'USD',\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { getBidTitleDetails } from '@bingads-webui-campaign-react/wizard-shared-components';\r\n\r\nconst formatBidStrategy = (i18n, data) => getBidTitleDetails(i18n, data);\r\n\r\n\r\nexport const BidStrategy = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Bid strategy') }}>\r\n      <Text>{formatBidStrategy(i18n, data)}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nBidStrategy.propTypes = {\r\n  data: PropTypes.shape({}),\r\n};\r\n\r\nBidStrategy.defaultProps = {\r\n  data: {},\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const formatBidValue = (i18n, data, currencyCode) => {\r\n  if (!data) {\r\n    return i18n.getString(_TL_('No bid value'));\r\n  }\r\n\r\n  return `${i18n.getCurrencySymbol(currencyCode)}${data} ${currencyCode}`;\r\n};\r\n\r\nexport const BidValue = ({ data, currencyCode }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Bid value') }}>\r\n      <Text>{formatBidValue(i18n, data, currencyCode)}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nBidValue.propTypes = {\r\n  data: PropTypes.string,\r\n  currencyCode: PropTypes.string,\r\n};\r\n\r\nBidValue.defaultProps = {\r\n  data: '',\r\n  currencyCode: 'USD',\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { campaignLanguageStrings } from '@bingads-webui-campaign-react/language-target';\r\n\r\nexport const Languages = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  // format languages\r\n  const formattedLanguages = useMemo(() => _.map(data, language => i18n.getString(campaignLanguageStrings[language] || language)).toString(), [i18n, data]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Languages') }}>\r\n      <Text>{formattedLanguages}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nLanguages.propTypes = {\r\n  data: PropTypes.arrayOf(PropTypes.string),\r\n};\r\n\r\nLanguages.defaultProps = {\r\n  data: [],\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const AudienceSignal = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n  // get audience signal name\r\n  const audienceSignalName = useMemo(() => data && data.Name, [data]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Audience signal') }}>\r\n      <Text>{audienceSignalName || i18n.getString(_TL_('No audience signal'))}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nAudienceSignal.propTypes = {\r\n  data: PropTypes.arrayOf(PropTypes.string),\r\n};\r\n\r\nAudienceSignal.defaultProps = {\r\n  data: [],\r\n};\r\n","import React, { useContext, useEffect, useState } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { Shimmer } from '@fluentui/react';\r\nimport { ImageListSummaryCardDetails, processImageListModelToViewModel } from '@bingads-webui-campaign-react/pmax-image-experience';\r\n\r\nexport const Images = ({\r\n  data,\r\n  shouldFetchFromMT,\r\n  cid,\r\n  aid,\r\n  isLogo,\r\n  label,\r\n}) => {\r\n  // get images\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const [images, setImages] = useState({});\r\n  const [isLoading, setIsLoading] = useState(false);\r\n\r\n  useEffect(() => {\r\n    if (shouldFetchFromMT) {\r\n      setIsLoading(true);\r\n      // fetch images from MT\r\n      processImageListModelToViewModel(data.ImageAssets, cid, aid).on({\r\n        onSuccess: (loadedImageList) => {\r\n          setImages({\r\n            ImageList: loadedImageList,\r\n          });\r\n          setIsLoading(false);\r\n        },\r\n        onError: () => {\r\n          setImages({});\r\n          setIsLoading(false);\r\n        },\r\n      });\r\n    }\r\n  }, [aid, cid, data.ImageAssets, shouldFetchFromMT]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label }}>\r\n      {\r\n        isLoading\r\n        ? <Shimmer />\r\n        : <ImageListSummaryCardDetails i18n={i18n} images={images} isLogos={isLogo} />\r\n      }\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nImages.propTypes = {\r\n  data: PropTypes.shape({\r\n    ImageAssets: PropTypes.arrayOf(PropTypes.shape({})),\r\n  }),\r\n  shouldFetchFromMT: PropTypes.bool,\r\n  aid: PropTypes.string,\r\n  cid: PropTypes.string,\r\n  isLogo: PropTypes.bool,\r\n  label: PropTypes.string,\r\n};\r\n\r\nImages.defaultProps = {\r\n  data: {},\r\n  shouldFetchFromMT: false,\r\n  aid: null,\r\n  cid: null,\r\n  isLogo: false,\r\n  label: _TL_('Images'),\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { getStoreTitleDetails } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nconst getStoreInfoStyle = () => ({\r\n  storeTitleDetails: {\r\n    whiteSpace: 'normal',\r\n  },\r\n});\r\n\r\nexport const StoreInfo = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const classes = useDefaultStyles(getStoreInfoStyle);\r\n\r\n  const {\r\n    ProviderId,\r\n    IsFeedFiltered,\r\n    SalesCountry,\r\n    FeedLabel,\r\n    LocalInventoryAdsEnabled,\r\n    storesData,\r\n  } = data || {};\r\n\r\n  const storeContainerData = useMemo(() => ({\r\n    ProviderId,\r\n    IsFeedFiltered,\r\n    SalesCountry,\r\n    FeedLabel,\r\n    LocalInventoryAdsEnabled,\r\n  }), [ProviderId, IsFeedFiltered, SalesCountry, FeedLabel, LocalInventoryAdsEnabled]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Store summary') }}>\r\n      <div className={classes.storeTitleDetails}>{storesData && getStoreTitleDetails(i18n, storesData, storeContainerData)}</div>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nStoreInfo.propTypes = {\r\n  data: PropTypes.shape({\r\n    ProviderId: PropTypes.string,\r\n    IsFeedFiltered: PropTypes.bool,\r\n    SalesCountry: PropTypes.string,\r\n    FeedLabel: PropTypes.string,\r\n    LocalInventoryAdsEnabled: PropTypes.bool,\r\n  }).isRequired,\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const AutoGeneratedAssets = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const {\r\n    autoGeneratedTextOptOut,\r\n    autoGeneratedImageOptOut,\r\n    finalUrlExpansionOptOut,\r\n  } = data || {};\r\n\r\n  const autoGenAssetsSummary = useMemo(() => {\r\n    if (finalUrlExpansionOptOut && autoGeneratedTextOptOut && autoGeneratedImageOptOut) {\r\n      return i18n.getString(_TL_('Off: Do not use autogenerated assets in ads.'));\r\n    }\r\n    return i18n.getString(_TL_('On: You’ve enabled autogenerated assets for your ads.'));\r\n  }, [i18n, finalUrlExpansionOptOut, autoGeneratedTextOptOut, autoGeneratedImageOptOut]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Autogenerated Assets') }}>\r\n      <Text>{autoGenAssetsSummary}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nAutoGeneratedAssets.propTypes = {\r\n  data: PropTypes.shape({\r\n    autoGeneratedTextOptOut: PropTypes.bool,\r\n    autoGeneratedImageOptOut: PropTypes.bool,\r\n    finalUrlExpansionOptOut: PropTypes.bool,\r\n    finalUrlExpansions: PropTypes.arrayOf(PropTypes.string),\r\n  }),\r\n};\r\n\r\nAutoGeneratedAssets.defaultProps = {\r\n  data: {},\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { getUrlOptionsDetails } from '@bingads-webui-campaign-react/url-options';\r\n\r\nexport const UrlOptions = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const urlOptionsDetails = getUrlOptionsDetails(i18n, data);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Campaign URL Options') }}>\r\n      <Text>{urlOptionsDetails}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nUrlOptions.propTypes = {\r\n  data: PropTypes.shape({\r\n    TrackingUrlTemplate: PropTypes.string,\r\n    FinalUrlSuffix: PropTypes.string,\r\n    UrlCustomParameters: PropTypes.arrayOf(PropTypes.shape({\r\n      Key: PropTypes.string,\r\n      Value: PropTypes.string,\r\n    })),\r\n  }),\r\n};\r\n\r\nUrlOptions.defaultProps = {\r\n  data: {\r\n    TrackingUrlTemplate: '',\r\n    FinalUrlSuffix: '',\r\n    UrlCustomParameters: [],\r\n  },\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nconst formatBidValue = (i18n, targetCpa, currencyCode) => {\r\n  if (!targetCpa) {\r\n    return i18n.getString(_TL_('No bid value'));\r\n  }\r\n  return `${i18n.getCurrencySymbol(currencyCode)}${targetCpa} ${currencyCode}`;\r\n};\r\n\r\nconst formatRoasValue = (i18n, targetRoas) => {\r\n  if (!targetRoas) {\r\n    return i18n.getString(_TL_('No bid value'));\r\n  }\r\n  return `${targetRoas * 100} %`;\r\n};\r\n\r\nexport const BidTarget = ({ data, currencyCode }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const {\r\n    Type,\r\n    TargetRoas,\r\n    TargetCpa,\r\n  } = data || {};\r\n\r\n  let label = null;\r\n  let targetValue = null;\r\n  if (Type === 'MaxConversions') {\r\n    label = _TL_('Target CPA');\r\n    targetValue = formatBidValue(i18n, TargetCpa, currencyCode);\r\n  } else {\r\n    label = _TL_('Target ROAS');\r\n    targetValue = formatRoasValue(i18n, TargetRoas);\r\n  }\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label }}>\r\n      <Text>{targetValue}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nBidTarget.propTypes = {\r\n  data: PropTypes.shape({\r\n    Type: PropTypes.string,\r\n    TargetRoas: PropTypes.number,\r\n    TargetCpa: PropTypes.number,\r\n  }),\r\n  currencyCode: PropTypes.string,\r\n};\r\n\r\nBidTarget.defaultProps = {\r\n  data: {\r\n    Type: '',\r\n    TargetRoas: null,\r\n    TargetCpa: null,\r\n  },\r\n  currencyCode: 'USD',\r\n};\r\n","import React, { useContext } from 'react';\r\nimport _ from 'underscore';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nconst getExpansionsSummary = (i18n, finalUrlExpansions) => {\r\n  const exactUrls = [];\r\n  const rules = [];\r\n\r\n  _.each(finalUrlExpansions, (target) => {\r\n    const conditions = target.Criterion.WebPage.Parameter.Conditions;\r\n    _.each(conditions, (condition) => {\r\n      if (condition.Operator === 'Equals') {\r\n        exactUrls.push(condition.ArgumentOperand);\r\n      } else {\r\n        rules.push(`URL contains ${condition.ArgumentOperand}`);\r\n      }\r\n    });\r\n  });\r\n\r\n  const exactUrlsDetails = exactUrls.length > 0 ? `${i18n.getString(_TL_('Excluded URLs: '))}${exactUrls.join(', ')}` : null;\r\n  const rulesDetails = rules.length > 0 ? `${i18n.getString(_TL_('Exclusion rules: '))}${rules.join(', ')}`:null;\r\n\r\n  if (exactUrlsDetails && rulesDetails) {\r\n    return `${exactUrlsDetails}; ${rulesDetails}`;\r\n  }\r\n  return exactUrlsDetails || rulesDetails || i18n.getString(_TL_('You’ve disabled Final URL expansion'));\r\n};\r\n\r\nexport const FinalURLExpansions = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const { finalUrlExpansions } = data || {};\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Final URL Expansions') }}>\r\n      <Text>{getExpansionsSummary(i18n, finalUrlExpansions)}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nFinalURLExpansions.propTypes = {\r\n  data: PropTypes.shape({\r\n    finalUrlExpansions: PropTypes.arrayOf(PropTypes.string),\r\n  }),\r\n};\r\n\r\nFinalURLExpansions.defaultProps = {\r\n  data: {},\r\n};\r\n","import React, { useContext } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const getSearchThemeDetails = (i18n, searchThemes) => {\r\n  if (searchThemes && searchThemes.length > 0) {\r\n    return searchThemes.map(item => item.SearchTheme).join(', ');\r\n  }\r\n  return i18n.getString(_TL_('No search themes added'));\r\n};\r\n\r\nexport const SearchThemes = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Search themes') }}>\r\n      <Text>{getSearchThemeDetails(i18n, data)}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nSearchThemes.propTypes = {\r\n  data: PropTypes.arrayOf(PropTypes.string),\r\n};\r\n\r\nSearchThemes.defaultProps = {\r\n  data: [],\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const CostPerSale = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const { costPerSaleOptOut } = data || {};\r\n\r\n  const costPerSaleSummary = useMemo(() => {\r\n    if (costPerSaleOptOut) {\r\n      return i18n.getString(_TL_('Off'));\r\n    }\r\n    return i18n.getString(_TL_('On'));\r\n  }, [i18n, costPerSaleOptOut]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Cost per sale') }}>\r\n      <Text>{costPerSaleSummary}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nCostPerSale.propTypes = {\r\n  data: PropTypes.shape({\r\n    costPerSaleOptOut: PropTypes.bool,\r\n  }),\r\n};\r\n\r\nCostPerSale.defaultProps = {\r\n  data: {},\r\n};\r\n","import React, { useContext } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { UrlOptionsDetailsWithRules } from '@bingads-webui-campaign-react/url-rules';\r\nimport { UrlOptionsDetailsWithRulesV2 } from '@bingads-webui-campaign-react/url-rules-v2';\r\n\r\nexport const UrlRules = ({ data, isAssetGroupUrlRulesV2Enabled }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const {\r\n    finalUrls, path1, path2, mobileFinalUrls, urlRules,\r\n  } = data || {};\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Advanced URL options') }}>\r\n      {\r\n        isAssetGroupUrlRulesV2Enabled ? (\r\n          <UrlOptionsDetailsWithRulesV2\r\n            i18n={i18n}\r\n            finalUrls={finalUrls}\r\n            path1={path1}\r\n            path2={path2}\r\n            mobileFinalUrls={mobileFinalUrls}\r\n            urlRules={urlRules}\r\n          />\r\n        ) : (\r\n          <UrlOptionsDetailsWithRules\r\n            i18n={i18n}\r\n            finalUrls={finalUrls}\r\n            path1={path1}\r\n            path2={path2}\r\n            mobileFinalUrls={mobileFinalUrls}\r\n            urlRules={urlRules}\r\n          />\r\n        )\r\n      }\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nUrlRules.propTypes = {\r\n  data: PropTypes.shape({\r\n    finalUrls: PropTypes.arrayOf(PropTypes.string),\r\n    path1: PropTypes.string,\r\n    path2: PropTypes.string,\r\n    mobileFinalUrls: PropTypes.arrayOf(PropTypes.string),\r\n    urlRules: PropTypes.arrayOf(PropTypes.shape({})),\r\n  }),\r\n  isAssetGroupUrlRulesV2Enabled: PropTypes.bool,\r\n};\r\n\r\nUrlRules.defaultProps = {\r\n  data: {\r\n    finalUrls: [],\r\n    path1: '',\r\n    path2: '',\r\n    mobileFinalUrls: [],\r\n    urlRules: [],\r\n  },\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { get } from 'underscore';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\n\r\nexport const NewCustomerAcquisition = ({ data, currencyCode }) => {\r\n  const i18n = useContext(I18nContext);\r\n  const { newCustomerAcquisitionOptOut, newCustomerAcquisition } = data || {};\r\n  const { campaignSettings, accountSettings } = newCustomerAcquisition || {};\r\n\r\n  const summary = useMemo(() => {\r\n    let summaryText = newCustomerAcquisitionOptOut ? i18n.getString(_TL_('Off')) : i18n.getString(_TL_('On'));\r\n\r\n    if (!newCustomerAcquisitionOptOut) {\r\n      const bidOnlyMode = get(campaignSettings, 'bidOnlyMode', false);\r\n      const campaignAdditionalValue = get(campaignSettings, 'additionalConversionValue', 0) || 0;\r\n      const accountAdditionalValue = get(accountSettings, 'additionalConversionValue', 0) || 0;\r\n\r\n      if (!bidOnlyMode) {\r\n        if (campaignAdditionalValue !== 0) {\r\n          summaryText += i18n.getString(_TL_('; Bid higher for new customers; Additional conversion value'));\r\n          summaryText += ` ${i18n.formatCurrency(campaignAdditionalValue, currencyCode)}`;\r\n        } else {\r\n          summaryText += i18n.getString(_TL_('; Bid higher for new customers; Additional conversion value (account level setting)'));\r\n          summaryText += ` ${i18n.formatCurrency(accountAdditionalValue, currencyCode)}`;\r\n        }\r\n      } else {\r\n        summaryText += i18n.getString(_TL_('; Bid only for new customers'));\r\n      }\r\n    }\r\n\r\n    return summaryText;\r\n  }, [accountSettings, campaignSettings, currencyCode, i18n, newCustomerAcquisitionOptOut]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('New Customer Acquisition') }}>\r\n      <Text>{summary}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nNewCustomerAcquisition.propTypes = {\r\n  data: PropTypes.shape({\r\n    newCustomerAcquisitionOptOut: PropTypes.bool,\r\n    newCustomerAcquisition: PropTypes.shape({\r\n      campaignSettings: PropTypes.shape({}),\r\n      accountSettings: PropTypes.shape({}),\r\n    }),\r\n  }),\r\n  currencyCode: PropTypes.string,\r\n};\r\n\r\nNewCustomerAcquisition.defaultProps = {\r\n  data: {\r\n    newCustomerAcquisitionOptOut: true,\r\n    newCustomerAcquisition: {\r\n      campaignSettings: {},\r\n      accountSettings: {},\r\n    },\r\n  },\r\n  currencyCode: '',\r\n};\r\n","import React, { useContext } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\nimport { ImageListSummaryCardDetails } from '@bingads-webui-campaign-react/pmax-image-experience';\r\n\r\nexport const Videos = ({\r\n  data,\r\n  label,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label }}>\r\n      <ImageListSummaryCardDetails i18n={i18n} videos={data} isLogos={false} isVideos />\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nVideos.propTypes = {\r\n  data: PropTypes.arrayOf(PropTypes.shape({})),\r\n  label: PropTypes.string,\r\n};\r\n\r\nVideos.defaultProps = {\r\n  data: [],\r\n  label: _TL_('Videos'),\r\n};\r\n","import {\r\n  AdCreation,\r\n  AdCreationPreview,\r\n  Store,\r\n  ProductCollections,\r\n  LocalInventory,\r\n  Products,\r\n  Feeds,\r\n  LocationTargeting,\r\n  AgeRangeTargeting,\r\n  GenderTargeting,\r\n  AdSchedule,\r\n  AdScheduleWithBidAdjustments,\r\n  StartEndDates,\r\n  AdDistribution,\r\n  Audience,\r\n  Interest,\r\n  PredictiveTargeting,\r\n  CompanyName,\r\n  JobFunction,\r\n  Industry,\r\n  ConversionGoals,\r\n  Budget,\r\n  BidStrategy,\r\n  BidValue,\r\n  Languages,\r\n  AudienceSignal,\r\n  Images,\r\n  LongHeadlinesSummary,\r\n  DescriptionsSummary,\r\n  HeadlinesSummary,\r\n  StoreInfo,\r\n  ListingGroup,\r\n  AutoGeneratedAssets,\r\n  UrlOptions,\r\n  BidTarget,\r\n  FinalURLExpansions,\r\n  Keywords,\r\n  SearchThemes,\r\n  CostPerSale,\r\n  UrlRules,\r\n  Genre,\r\n  NewCustomerAcquisition,\r\n  Videos,\r\n  Disclaimer,\r\n} from './components';\r\n\r\nexport const summaryPageComponentTypes = {\r\n  'ad-creation': AdCreation,\r\n  'ad-creation-preview': AdCreationPreview,\r\n  store: Store,\r\n  'product-collections': ProductCollections,\r\n  'local-inventory': LocalInventory,\r\n  feeds: Feeds,\r\n  products: Products,\r\n  'location-targeting': LocationTargeting,\r\n  'age-range-targeting': AgeRangeTargeting,\r\n  'gender-targeting': GenderTargeting,\r\n  'genre-targeting': Genre,\r\n  'ad-schedule': AdSchedule,\r\n  'ad-schedule-with-bid-adjustments': AdScheduleWithBidAdjustments,\r\n  'start-end-dates': StartEndDates,\r\n  'ad-distribution': AdDistribution,\r\n  interest: Interest,\r\n  audience: Audience,\r\n  company: CompanyName,\r\n  industry: Industry,\r\n  'job-function': JobFunction,\r\n  'predictive-targeting': PredictiveTargeting,\r\n  'conversion-goals': ConversionGoals,\r\n  budget: Budget,\r\n  'bid-strategy': BidStrategy,\r\n  'bid-value': BidValue,\r\n  languages: Languages,\r\n  'audience-signal': AudienceSignal,\r\n  images: Images,\r\n  'long-headlines': LongHeadlinesSummary,\r\n  descriptions: DescriptionsSummary,\r\n  headlines: HeadlinesSummary,\r\n  'store-info': StoreInfo,\r\n  'listing-group': ListingGroup,\r\n  'auto-generated-assets': AutoGeneratedAssets,\r\n  'url-options': UrlOptions,\r\n  'bid-target': BidTarget,\r\n  'final-url-expansions': FinalURLExpansions,\r\n  keywords: Keywords,\r\n  'search-themes': SearchThemes,\r\n  'cost-per-sale': CostPerSale,\r\n  'url-rules': UrlRules,\r\n  'new-customer-acquisition': NewCustomerAcquisition,\r\n  videos: Videos,\r\n  disclaimer: Disclaimer,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const AdCreation = ({ numAds }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Ad creation') }}>\r\n      <Text>{`${numAds} ${numAds === 1 ? i18n.getString(_TL_('Ad')) : i18n.getString(_TL_('Ads'))}`}</Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nAdCreation.propTypes = {\r\n  numAds: PropTypes.number.isRequired,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { getHeadlinesCardSummaryDetails, getLongHeadlinesCardSummaryDetails, getDescriptionsCardSummaryDetails } from '@bingads-webui-campaign-react/validated-text-collection';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const HeadlinesSummary = ({\r\n  data: headlines,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow\r\n      propertyLabel={{ label: _TL_('Headlines') }}\r\n    >\r\n      <Text>\r\n        {getHeadlinesCardSummaryDetails(i18n, headlines)}\r\n      </Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nHeadlinesSummary.propTypes = {\r\n  data: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\r\n};\r\n\r\n\r\nexport const LongHeadlinesSummary = ({\r\n  data: longHeadlines,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow\r\n      propertyLabel={{ label: _TL_('Long Headlines') }}\r\n    >\r\n      <Text>\r\n        {getLongHeadlinesCardSummaryDetails(i18n, longHeadlines)}\r\n      </Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nLongHeadlinesSummary.propTypes = {\r\n  data: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\r\n};\r\n\r\nexport const DescriptionsSummary = ({\r\n  data: descriptions,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <PropertyRow\r\n      propertyLabel={{ label: _TL_('Descriptions') }}\r\n    >\r\n      <Text>\r\n        {getDescriptionsCardSummaryDetails(i18n, descriptions)}\r\n      </Text>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nDescriptionsSummary.propTypes = {\r\n  data: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { getListingGroupDetails } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { PropertyRow } from '@bingads-webui-campaign-react/ui-generator';\r\n\r\nexport const ListingGroup = ({ data }) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const {\r\n    productFilter,\r\n    listingGroup,\r\n  } = data || {};\r\n\r\n  const listingGroupDetails = useMemo(() => getListingGroupDetails(\r\n    i18n,\r\n    !!productFilter,\r\n    {\r\n      productFilter,\r\n      listingGroup,\r\n    }\r\n  ), [i18n, listingGroup, productFilter]);\r\n\r\n  return (\r\n    <PropertyRow propertyLabel={{ label: _TL_('Listing group') }}>\r\n      <div>{listingGroupDetails}</div>\r\n    </PropertyRow>\r\n  );\r\n};\r\n\r\nListingGroup.propTypes = {\r\n  data: PropTypes.shape({\r\n    listingGroup: PropTypes.shape({}),\r\n    productFilter: PropTypes.shape({}),\r\n  }).isRequired,\r\n};\r\n","/* eslint-disable no-unused-expressions */\r\n/* eslint-disable jsx-a11y/no-static-element-interactions */\r\nimport React from 'react';\r\nimport { result } from 'underscore';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst setTranslateX = (el, value) => {\r\n  // eslint-disable-next-line no-param-reassign\r\n  el && el.style && (el.style.transform = `matrix(1, 0, 0, 1, ${value}, 0)`);\r\n};\r\nconst getTranslateX = (el) => {\r\n  const matrix = el.style.transform.replace(/\\s/g, '');\r\n  const arr = matrix.split(',');\r\n  const translateX = result(arr, 4, '0');\r\n  return parseInt(translateX, 10);\r\n};\r\n\r\nexport class VirtualScrollbar extends React.PureComponent {\r\n  constructor(props) {\r\n    super(props);\r\n    this.view = React.createRef();\r\n    this.child = React.createRef();\r\n    this.isDown = false;\r\n    this.prev = 0;\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.view.current.addEventListener('scroll', this.onViewScroll);\r\n    document.addEventListener('mousemove', this.onMouseMove);\r\n    document.addEventListener('mouseup', this.onMouseUp);\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.view.current.removeEventListener('scroll', this.onViewScroll);\r\n    document.removeEventListener('mousemove', this.onMouseMove);\r\n    document.removeEventListener('mouseup', this.onMouseUp);\r\n  }\r\n\r\n  onMouseUp = () => {\r\n    this.isDown = false;\r\n  }\r\n\r\n  onMouseDown = (e) => {\r\n    this.isDown = true;\r\n\r\n    let offsetLeft;\r\n    if (this.child.current.style.transform) {\r\n      offsetLeft = getTranslateX(this.child.current);\r\n    } else {\r\n      offsetLeft = 0;\r\n    }\r\n    this.prev = offsetLeft - e.clientX;\r\n  }\r\n\r\n  onMouseMove = (e) => {\r\n    if (this.isDown) {\r\n      let offsetX = e.clientX + this.prev;\r\n      const thumbWidth = (this.props.width * this.props.width) / this.props.viewWidth;\r\n\r\n      // set virtual bar\r\n      if (offsetX < 0) {\r\n        offsetX = 0;\r\n      } else if (offsetX > this.props.width - thumbWidth) {\r\n        offsetX = this.props.width - thumbWidth;\r\n      }\r\n      setTranslateX(this.child.current, offsetX);\r\n\r\n      // set physical bar\r\n      const viewOffsetX = (offsetX / this.props.width) * this.props.viewWidth;\r\n      this.view.current.scrollLeft = viewOffsetX;\r\n    }\r\n  }\r\n\r\n  onViewScroll = (e) => {\r\n    const viewOffsetX = e.target.scrollLeft;\r\n    const offsetX = (viewOffsetX / this.props.viewWidth) * this.props.width;\r\n    setTranslateX(this.child.current, offsetX);\r\n  }\r\n\r\n  render() {\r\n    const parentStyle = {\r\n      ...this.props.style,\r\n      width: this.props.width,\r\n      height: this.props.height,\r\n    };\r\n\r\n    const childStyle = {\r\n      width: (this.props.width * this.props.width) / this.props.viewWidth,\r\n      height: this.props.height,\r\n      userSelect: 'none',\r\n    };\r\n\r\n    return (\r\n      <div className=\"virtual-scrollbar-container\">\r\n        <div>{React.cloneElement(this.props.children, { ref: this.view })}</div>\r\n        <div\r\n          className=\"parent-bar\"\r\n          style={parentStyle}\r\n          onMouseMove={this.onMouseMove}\r\n        >\r\n          <div\r\n            className=\"child-bar\"\r\n            onMouseDown={this.onMouseDown}\r\n            onMouseUp={this.onMouseUp}\r\n            ref={this.child}\r\n            style={childStyle}\r\n          />\r\n        </div>\r\n      </div>\r\n    );\r\n  }\r\n}\r\n\r\nVirtualScrollbar.propTypes = {\r\n  height: PropTypes.number,\r\n  width: PropTypes.number.isRequired,\r\n  viewWidth: PropTypes.number.isRequired,\r\n  children: PropTypes.element.isRequired,\r\n  // eslint-disable-next-line react/forbid-prop-types\r\n  style: PropTypes.object,\r\n};\r\n\r\nVirtualScrollbar.defaultProps = {\r\n  height: 15,\r\n  style: {},\r\n};\r\n","/* eslint-disable no-nested-ternary */\r\n/* eslint-disable react/forbid-prop-types */\r\n/* eslint-disable no-underscore-dangle */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { extend, defaults, delay } from 'underscore';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { VirtualScrollbar } from './virtual-scrollbar';\r\n\r\nconst SCROLLBAR_HEIGHT = 17;\r\nconst MARGIN_RIGHT = 17;\r\nconst VIRTUAL_SCROLLBAR_HEIGHT = 14;\r\n\r\nconst getTablePageStyles = () => extend({\r\n  scrollBarView: {\r\n    marginRight: MARGIN_RIGHT,\r\n    overflow: 'auto',\r\n    scrollbarWidth: 'none',\r\n    '&::-webkit-scrollbar': {\r\n      display: 'none',\r\n    },\r\n  },\r\n});\r\n\r\nclass UnStyledScrollbar extends React.PureComponent {\r\n  constructor(props) {\r\n    super(props);\r\n    this.unmounted = false;\r\n    this.pgridView = props.pgridView;\r\n    this.state = { bottom: '0', positionStatic: false };\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.unmounted = true;\r\n  }\r\n\r\n  render() {\r\n    if (this.props.pgridView) {\r\n      const $table = this.props.pgridView.$el.find('.table-container');\r\n      if ($table.length > 0) {\r\n        delay(() => {\r\n          if (this.unmounted) {\r\n            return;\r\n          }\r\n\r\n          let bottom;\r\n          let positionStatic;\r\n          const $tfoot = $table.find('tfoot');\r\n\r\n          if ($tfoot && $tfoot.offset().top !== 0) { // if tfoot visible\r\n            bottom = $tfoot.height() - VIRTUAL_SCROLLBAR_HEIGHT;\r\n          } else {\r\n            bottom = 'auto';\r\n          }\r\n          if ($tfoot.children().length === 0) { // if tfoot has no child\r\n            positionStatic = 'static';\r\n          }\r\n\r\n          if (bottom !== this.state.bottom || this.state.positionStatic !== positionStatic) {\r\n            this.setState({ bottom, positionStatic });\r\n          }\r\n        }, 100);\r\n      }\r\n    }\r\n\r\n    const fixedBottomOffset = this.props.containerOverflowX ? SCROLLBAR_HEIGHT : 0;\r\n\r\n    const parentStyle = defaults(\r\n      { display: this.props.shouldDisplay ? 'block' : 'none' },\r\n      { position: this.props.positionFixed ? 'fixed' : this.state.positionStatic ? 'static' : 'absolute' },\r\n      { bottom: this.props.positionFixed ? fixedBottomOffset : this.state.bottom },\r\n      { width: this.props.width }\r\n    );\r\n\r\n    return (\r\n      <VirtualScrollbar\r\n        style={parentStyle}\r\n        height={VIRTUAL_SCROLLBAR_HEIGHT}\r\n        width={this.props.width}\r\n        viewWidth={this.props.gridViewWidth + this.props.gridPaddingLeft + MARGIN_RIGHT}\r\n      >\r\n        <div className={this.props.classes.scrollBarView}>\r\n          {this.props.children}\r\n        </div>\r\n      </VirtualScrollbar>\r\n    );\r\n  }\r\n}\r\n\r\nUnStyledScrollbar.propTypes = {\r\n  children: PropTypes.object.isRequired,\r\n  pgridView: PropTypes.object,\r\n  classes: PropTypes.object.isRequired,\r\n  shouldDisplay: PropTypes.bool,\r\n  positionFixed: PropTypes.bool,\r\n  gridViewWidth: PropTypes.number,\r\n  width: PropTypes.number,\r\n  containerOverflowX: PropTypes.bool,\r\n  gridPaddingLeft: PropTypes.number,\r\n};\r\n\r\nUnStyledScrollbar.defaultProps = {\r\n  pgridView: null,\r\n  shouldDisplay: false,\r\n  positionFixed: false,\r\n  gridViewWidth: 0,\r\n  width: 0,\r\n  containerOverflowX: false,\r\n  gridPaddingLeft: 32,\r\n};\r\n\r\nexport const Scrollbar = withDefaultStyles(UnStyledScrollbar, getTablePageStyles);\r\n","/* eslint-disable react/sort-comp,react/forbid-prop-types */\r\nimport classNames from 'classnames';\r\nimport React, { Fragment } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {\r\n  result,\r\n  chain,\r\n  reduce,\r\n  extend,\r\n  max,\r\n  throttle,\r\n  map,\r\n  contains,\r\n  keys,\r\n  isEmpty,\r\n  isString,\r\n} from 'underscore';\r\nimport $ from 'jquery';\r\nimport { ResizeObserver as ResizeObserverPollyFill } from '@juggle/resize-observer';\r\n\r\nimport { Constants } from '@bingads-webui-theme-2018/theme-fluent';\r\nimport { DisclaimerBanner } from '@bingads-webui-campaign-react/help';\r\nimport { ContentFooter } from '@bingads-webui-campaign-react/content-footer';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getBidLandscapeStyle } from '@bingads-webui-campaign/bid-landscape-style';\r\nimport { getBudgetSuggestionPopupStyle } from '@bingads-webui-campaign/budget-suggestion-popup-style';\r\nimport { getInlineOpportunityStyle } from '@bingads-webui-campaign/inline-opportunity-style';\r\nimport { helpbuttonStyle, uiblockerStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport { gridPaddingLeft } from '@bingads-webui-campaign-react/grid-view-wrapper';\r\nimport { getHeightIncludeAbsolutePositionedElements } from '@bingads-webui-campaign-react/virtual-scrollbar-recalculate-trigger';\r\nimport { Scrollbar } from './scrollbar';\r\n\r\nconst SCROLLBAR_WIDTH = 17;\r\n\r\nconst getShadowWidthOutofYBorder = ($el) => {\r\n  const boxShadow = $el.css('box-shadow');\r\n  if (boxShadow === 'none') {\r\n    return 0;\r\n  }\r\n\r\n  const pixels = map(boxShadow.match(/([+-.0-9]+)(?=px)/g), v => Number(v));\r\n  // only handle one shadow\r\n  // offset-y + blur radius + spread radius\r\n  return pixels[1] + pixels[2] + pixels[3];\r\n};\r\n\r\nconst getTableView = (props) => {\r\n  const p$gridViewContainer = props.backboneGridView || props.pgridView;\r\n  const tableView = result(p$gridViewContainer, '_tableView') ||\r\n    chain(p$gridViewContainer)\r\n      .result('grid')\r\n      .result('gridView')\r\n      .result('_tableView')\r\n      .value() ||\r\n    chain(p$gridViewContainer)\r\n      .result('grid')\r\n      .result('grid')\r\n      .result('gridView')\r\n      .result('_tableView')\r\n      .value();\r\n\r\n  return tableView;\r\n};\r\n\r\nconst getTableWidth = ($table) => {\r\n  const tableWidth = reduce(\r\n    $table.find('.column-header').toArray(),\r\n    (memo, i) => memo + i.getBoundingClientRect().width,\r\n    0\r\n  );\r\n  return tableWidth;\r\n};\r\n\r\nconst getTablePageStyles = (_, { palette = {} }) => extend(\r\n  {\r\n    pageContainer: {\r\n      display: 'flex',\r\n      flex: '1 0 1px',\r\n      flexDirection: 'column',\r\n      overflow: 'auto',\r\n    },\r\n    gridContainer: {\r\n      overflowX: 'hidden',\r\n      overflowY: 'hidden',\r\n    },\r\n    gridViewContainer: {\r\n      marginRight: 15,\r\n    },\r\n    contentFooter: {\r\n      display: 'flex',\r\n      flexDirection: 'column-reverse',\r\n      width: '100%',\r\n      position: 'static',\r\n      marginTop: 'auto',\r\n    },\r\n    resizeMarker: {\r\n      position: 'absolute',\r\n      top: 0,\r\n      left: 0,\r\n      bottom: 0,\r\n      right: 0,\r\n      zIndex: '-1',\r\n      visibility: 'hidden',\r\n    },\r\n  },\r\n  {\r\n    '@global': extend(\r\n      uiblockerStyle({ palette }),\r\n      getBidLandscapeStyle(palette),\r\n      getBudgetSuggestionPopupStyle(palette),\r\n      getInlineOpportunityStyle(palette),\r\n      helpbuttonStyle({ palette }),\r\n      {\r\n        // [TODO] Move to theme-fluent/src/components/grid-shared/global.js\r\n        '.grid-noresult, .grid-noresult-empty, .noresult': {\r\n          display: 'none',\r\n        },\r\n        '.virtual-scrollbar-container': {\r\n          '& .parent-bar': {\r\n            backgroundColor: '#f1f1f1',\r\n          },\r\n          '& .child-bar': {\r\n            backgroundColor: '#c1c1c1',\r\n            '&:hover': {\r\n              backgroundColor: '#a8a8a8',\r\n            },\r\n          },\r\n        },\r\n      }\r\n    ),\r\n  }\r\n);\r\n\r\nclass TablePageContainer extends React.PureComponent {\r\n  constructor(props) {\r\n    super(props);\r\n\r\n    this.state = {\r\n      gridPopupHeight: -1,\r\n      gridViewWidth: -1,\r\n\r\n      // In case of no IntersectionObserver support on browser, use this\r\n      // default virtualscrollbar state, position: fixed, bottom: 0\r\n      virtualScrollbarFixed: true,\r\n      virtualScrollbarInView: true,\r\n\r\n      containerOverflowX: false,\r\n    };\r\n\r\n    this.gridEventMap = {};\r\n    this.lastVirtualScrollLeft = 0;\r\n    this.letPopUpScrollHorizontal = false;\r\n\r\n    this.viewport = React.createRef();\r\n    this.gridAndStickyContainer = React.createRef();\r\n    this.topOfGridContainer = React.createRef();\r\n    this.stickyContainer = React.createRef();\r\n    this.gridAndDisclaimContainer = React.createRef();\r\n\r\n    // Use the feature of 'IntersectionObserver' to update the horizontal virtual scrollbar\r\n    this.topMarker = { el: null, isInView: null };\r\n    this.bottomMarker = { el: null, isInView: null, isHiddenInView: null };\r\n\r\n    if (window && 'IntersectionObserver' in window) {\r\n      this.intersectionObserver = new IntersectionObserver(this.handleIntersectionChange.bind(this), {\r\n        root: null,\r\n        rootMargin: '0px',\r\n        threshold: [0, 1],\r\n      });\r\n    } else {\r\n      // All supported browsers are providing this feature, this is a fallback for backword compatibility\r\n      this.intersectionObserver = null;\r\n    }\r\n\r\n    this.resizeMarker = React.createRef();\r\n    this.lastResizerWidth = 0;\r\n    if (window && 'ResizeObserver' in window) {\r\n      this.resizeObserver = new ResizeObserver(throttle(this.handleResizeChange.bind(this), 250));\r\n    } else {\r\n      // All supported browsers are providing this feature, if not, switch to polly fill\r\n      this.resizeObserver = new ResizeObserverPollyFill(throttle(this.handleResizeChange.bind(this), 250));\r\n    }\r\n\r\n    const SMALL_PADDING_LEFT_CLASS = 'small-padding-left';\r\n    let shouldUseSmallPadding = false;\r\n    if (isString(this.props.customClasses.tablePageContainer)) {\r\n      shouldUseSmallPadding = this.props.customClasses.tablePageContainer.includes(SMALL_PADDING_LEFT_CLASS);\r\n    } else {\r\n      shouldUseSmallPadding = contains(this.props.customClasses.tablePageContainer, SMALL_PADDING_LEFT_CLASS);\r\n    }\r\n\r\n    this.paddingLeft = shouldUseSmallPadding ? 0 : gridPaddingLeft;\r\n  }\r\n\r\n  getChildBarScrollLeftValue() {\r\n    if (this.state.gridViewWidth === -1) {\r\n      return 0;\r\n    }\r\n    const childBar = $('.child-bar');\r\n    // align with scrollbar;\r\n    const viewWidth = this.state.gridViewWidth + this.paddingLeft + SCROLLBAR_WIDTH;\r\n\r\n    if (childBar) {\r\n      const parentWidth = this.state.stickyTopOfGridWidth;\r\n      const childOffset = childBar.position().left;\r\n      return (childOffset / parentWidth) * viewWidth;\r\n    }\r\n    return 0;\r\n  }\r\n\r\n  handleResizeChange(entries) {\r\n    // For now, we only observe one entry and we only compare one threshold.\r\n    const entry = entries[0];\r\n    const threshold = this.props.tablePageMinWidth;\r\n\r\n    // Decide whether to adjust virtual scrollbar\r\n    const { width } = entry.contentRect;\r\n    if ((this.lastResizerWidth === 0 || this.lastResizerWidth >= threshold) && width < threshold) {\r\n      this.setState({\r\n        containerOverflowX: true,\r\n      });\r\n    }\r\n\r\n    if (this.lastResizerWidth < threshold && width >= threshold) {\r\n      this.setState({\r\n        containerOverflowX: false,\r\n      });\r\n    }\r\n\r\n    this.lastResizerWidth = width;\r\n\r\n    // notify gridView\r\n    // FIXME: the below logic is also used by inline chart, we should have other ways to trigger the grid re-render\r\n    const p$gridViewContainer = this.props.backboneGridView || this.props.pgridView;\r\n    if (p$gridViewContainer) {\r\n      const tableView = getTableView(this.props);\r\n      if (tableView) {\r\n        tableView.trigger('didChangeBound'); // eslint-disable-line no-underscore-dangle\r\n      }\r\n    }\r\n\r\n    if (this.viewport && this.viewport.current) {\r\n      let event;\r\n      const eventName = 'scroll';\r\n      if (typeof Event === 'function') {\r\n        event = new Event(eventName);\r\n      } else {\r\n        // IE 11 patch\r\n        event = document.createEvent('Event');\r\n        event.initEvent(eventName, false, false);\r\n      }\r\n\r\n      this.viewport.current.dispatchEvent(event);\r\n    }\r\n  }\r\n\r\n  handleIntersectionChange(entries) {\r\n    let handleScrollbar = false;\r\n\r\n    entries.forEach((entry) => {\r\n      if (entry.target && entry.target === this.topMarker.el) {\r\n        // Sometimes the top marker (the thead) has zero intersection height, which will cause the intersectionRation to be 0\r\n        this.topMarker.isInView = entry.isIntersecting; // (entry.intersectionRatio !== 0);\r\n\r\n        handleScrollbar = true;\r\n      }\r\n      if (entry.target && entry.target === this.bottomMarker.el) {\r\n        this.bottomMarker.isInView = (entry.intersectionRatio !== 0);\r\n        this.bottomMarker.isHiddenInView = false;\r\n\r\n        handleScrollbar = true;\r\n      }\r\n    });\r\n\r\n    if (handleScrollbar) {\r\n      this.handleScrollbar();\r\n    }\r\n  }\r\n\r\n  handleScrollbar() {\r\n    if (this.bottomMarker.isInView) {\r\n      // Append the scrollbar at the end of the table\r\n      this.setState({\r\n        virtualScrollbarFixed: false,\r\n        virtualScrollbarInView: true,\r\n      });\r\n    } else if (this.topMarker.isInView) {\r\n      // Detach the scrollbar and make it fixed, with bottom: 0\r\n      this.setState({\r\n        virtualScrollbarFixed: true,\r\n        virtualScrollbarInView: true,\r\n      });\r\n    } else {\r\n      // The grid is completely pushed out of viewport by top of grid panel, hide scrollbar.\r\n      // Note: it is also possible that the bottom marker element is hidden (display: none)\r\n      //       we will get a chance to evaluate that again before rendering.\r\n      this.setState({\r\n        virtualScrollbarInView: false,\r\n      });\r\n    }\r\n  }\r\n\r\n  handlePopup(prevPopupHeight) {\r\n    const popupHeight = this.getInlineEditPopupHeight();\r\n    if (!prevPopupHeight || popupHeight !== prevPopupHeight) {\r\n      this.setState({ gridPopupHeight: popupHeight });\r\n    }\r\n    if (this.letPopUpScrollHorizontal) {\r\n      this.onScrollbarsViewUpdate();\r\n    }\r\n  }\r\n\r\n  handleScroll(prevState = {}) {\r\n    const p$gridViewContainer = this.props.backboneGridView || this.props.pgridView;\r\n    if (p$gridViewContainer) {\r\n      // when parentElement is null, grid view is not in dom yet.\r\n      // Calling getBoundingClientRect will cause unspecified error in IE.\r\n      // no need to handle scroll at this moment.\r\n      if (p$gridViewContainer.$el.get(0).parentElement === null) {\r\n        return;\r\n      }\r\n\r\n      const viewportRect = this.viewport.current.getBoundingClientRect();\r\n      const topOfGridRect = this.topOfGridContainer.current.getBoundingClientRect();\r\n      const gridAndStickyRect = this.gridAndStickyContainer.current.getBoundingClientRect();\r\n      const stickyContainer = this.stickyContainer.current.getBoundingClientRect();\r\n\r\n      // we have two different modes for positioning sticky top of grid content depending on scroll position\r\n      // check here if the sticky top of grid content would have already been visible in the viewport without\r\n      // sticky behavior (just based on element placement)\r\n      const shouldAdjustStickyTopOfGrid = gridAndStickyRect.top < viewportRect.top;\r\n\r\n\r\n      // only display virtual scrollbar if grid has horizontal overflow and...\r\n      const tableWidth = getTableWidth(p$gridViewContainer.$('table')); // Sovle the Mac Safari issue\r\n      const gridViewHasHorizontalOverflow = Math.round(tableWidth) > Math.round(viewportRect.width) - this.paddingLeft;\r\n      let emptyHeight = Math.round(viewportRect.height) - Math.round(gridAndStickyRect.height) - Math.round(topOfGridRect.height);\r\n      emptyHeight = shouldAdjustStickyTopOfGrid ? emptyHeight + stickyContainer.height : emptyHeight;\r\n      const gridViewHasVerticalOverflow = emptyHeight < 0;\r\n\r\n      const newState = {\r\n        stickyTopOfGridTopOffset: shouldAdjustStickyTopOfGrid ? viewportRect.top : 0,\r\n        stickyTopOfGridPosition: shouldAdjustStickyTopOfGrid ? 'fixed' : 'relative',\r\n        stickyTopOfGridWidth: Math.floor(viewportRect.width - (gridViewHasVerticalOverflow ? SCROLLBAR_WIDTH : 0)),\r\n        stickyTopOfGridHeight: stickyContainer.height,\r\n        gridViewHasHorizontalOverflow,\r\n        gridViewHasVerticalOverflow,\r\n        shouldAdjustStickyTopOfGrid,\r\n      };\r\n\r\n      const scrollStateKeys = keys(newState);\r\n\r\n      const modifiedState = reduce(scrollStateKeys, (memo, stateKey) => {\r\n        if (prevState[stateKey] !== newState[stateKey]) {\r\n          memo[stateKey] = newState[stateKey]; // eslint-disable-line no-param-reassign\r\n        }\r\n\r\n        return memo;\r\n      }, {});\r\n\r\n      if (!isEmpty(modifiedState)) {\r\n        this.setState(modifiedState);\r\n      }\r\n    }\r\n\r\n    // Also adjust the grid+disclaimer height based on popupheight.\r\n    this.handlePopup(prevState.gridPopupHeight);\r\n  }\r\n\r\n  componentDidMount() {\r\n    if (this.resizeObserver && this.resizeMarker && this.resizeMarker.current) {\r\n      this.resizeObserver.observe(this.resizeMarker.current);\r\n    }\r\n    this.setScrollPosition();\r\n    this.handleScroll();\r\n    $(this.viewport.current).on('resizeContainerBasedOnPopupHeight', (event, options) => {\r\n      // Assume here is the reset,\r\n      this.letPopUpScrollHorizontal = options ? options.letPopUpScrollHorizontal : false;\r\n      if (this.letPopUpScrollHorizontal) {\r\n        this.lastVirtualScrollLeft = this.getChildBarScrollLeftValue();\r\n      }\r\n      this.handlePopup();\r\n    });\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    const p$gridView = (this.props.backboneGridView && this.props.backboneGridView.grid && this.props.backboneGridView.grid.gridView) || this.props.pgridView;\r\n    if (p$gridView) {\r\n      p$gridView.off('didUpdate');\r\n    }\r\n\r\n    if (this.intersectionObserver) {\r\n      if (this.topMarker.el) {\r\n        this.intersectionObserver.unobserve(this.topMarker.el);\r\n      }\r\n\r\n      if (this.bottomMarker.el) {\r\n        this.intersectionObserver.unobserve(this.bottomMarker.el);\r\n      }\r\n\r\n      this.intersectionObserver = null;\r\n    }\r\n\r\n    if (this.resizeObserver && this.resizeMarker && this.resizeMarker.current) {\r\n      this.resizeObserver.unobserve(this.resizeMarker.current);\r\n    }\r\n\r\n    $(this.viewport.current).off('resizeContainerBasedOnPopupHeight');\r\n  }\r\n\r\n  componentDidUpdate(prevProps, prevState) {\r\n    if (this.state.stickyTopOfGridPosition === 'fixed' && prevState.stickyTopOfGridPosition !== 'fixed') {\r\n      const stickyContainer = this.stickyContainer.current.getBoundingClientRect();\r\n      this.shiftThePopUp(stickyContainer.height);\r\n    } else if (this.state.stickyTopOfGridPosition !== 'fixed' && prevState.stickyTopOfGridPosition === 'fixed') {\r\n      const stickyContainer = this.stickyContainer.current.getBoundingClientRect();\r\n      this.shiftThePopUp(-stickyContainer.height);\r\n    }\r\n    this.setScrollPosition(prevProps);\r\n    this.handleScroll(prevState);\r\n  }\r\n\r\n  onScrollbarsViewUpdate() {\r\n    const $popup = $(this.props.inlineEditPopupSelector);\r\n    const currentLeft = this.getChildBarScrollLeftValue();\r\n    if ($popup.length) {\r\n      const cssLeft = parseFloat($popup.css('left'));\r\n      const newLeft = cssLeft - (currentLeft - this.lastVirtualScrollLeft);\r\n      $popup.css('left', `${newLeft}px`);\r\n    }\r\n    this.lastVirtualScrollLeft = currentLeft;\r\n  }\r\n\r\n  shiftThePopUp(height) {\r\n    let $popup = $(this.props.inlineEditPopupSelector);\r\n    if (!$popup.attr('style')) {\r\n      $popup = $(this.props.inlineEditPopupSelector).closest('[style*=\"absolute\"]');\r\n    }\r\n    if ($popup.length) {\r\n      const cssTop = parseFloat($popup.css('top'));\r\n      const newTop = cssTop + height;\r\n      $popup.css('top', `${newTop}px`);\r\n    }\r\n  }\r\n\r\n  setScrollPosition(prevProps) {\r\n    if (this.props.forceResetScrollFlag !== (prevProps && prevProps.forceResetScrollFlag)) {\r\n      this.viewport.current.scrollTop = 0;\r\n    }\r\n  }\r\n\r\n  getInlineEditPopupHeight() {\r\n    // TODO: should also check filter editor popup\r\n    const popup = document.querySelector(this.props.inlineEditPopupSelector);\r\n    const popupHeight = getHeightIncludeAbsolutePositionedElements(popup);\r\n\r\n    if (popupHeight) {\r\n      const popupTop = $(popup).offset().top - $('.grid-and-disclaim-container').offset().top;\r\n      return popupTop + popupHeight + getShadowWidthOutofYBorder($(popup));\r\n    }\r\n\r\n    return -1;\r\n  }\r\n\r\n  render() {\r\n    const p$gridView = (this.props.backboneGridView && this.props.backboneGridView.grid && this.props.backboneGridView.grid.gridView) || this.props.pgridView;\r\n\r\n    if (p$gridView && this.intersectionObserver) {\r\n      // Find a chance to initiate the intersection observing\r\n      const thead = p$gridView.$('thead').get(0);\r\n      if (thead && thead !== this.topMarker.el) {\r\n        if (this.topMarker.el) {\r\n          this.intersectionObserver.unobserve(this.topMarker.el);\r\n        }\r\n        this.topMarker.el = thead;\r\n        this.intersectionObserver.observe(this.topMarker.el);\r\n      }\r\n\r\n      const tfoot = p$gridView.$('tfoot').get(0);\r\n      if (tfoot && tfoot !== this.bottomMarker.el) {\r\n        if (this.bottomMarker.el) {\r\n          this.intersectionObserver.unobserve(this.bottomMarker.el);\r\n        }\r\n        this.bottomMarker.el = tfoot;\r\n        this.intersectionObserver.observe(this.bottomMarker.el);\r\n      }\r\n    }\r\n\r\n    if (p$gridView && !this.gridEventMap[p$gridView.cid]) {\r\n      p$gridView.on('didUpdate', () => {\r\n        const tableWidth = getTableWidth(p$gridView.$el.find('table'));\r\n        // // only for safari. The root cause is we should set a width for the fixed-layout table\r\n        // window.safari && p$gridView.$el.find('table').css('min-width', tableWidth);\r\n\r\n        this.setState({\r\n          // get notified when grid width changed by column-resize plugin\r\n          gridViewWidth: tableWidth,\r\n        });\r\n      });\r\n\r\n      this.gridEventMap[p$gridView.cid] = true;\r\n    }\r\n\r\n    const CustomDisclaimerBanner = this.props.CustomDisclaimerBanner || DisclaimerBanner;\r\n\r\n    const stickyStyle = { position: this.state.stickyTopOfGridPosition, top: this.state.stickyTopOfGridTopOffset, zIndex: Constants.ZIndexContentComponents.GridToolbar + 1 };\r\n\r\n    // Do the final adjustment before rendering the virtual scrollbar\r\n    let { virtualScrollbarFixed, virtualScrollbarInView } = this.state;\r\n\r\n    if (this.state.shouldAdjustStickyTopOfGrid) {\r\n      stickyStyle.width = this.state.stickyTopOfGridWidth;\r\n    }\r\n\r\n    if (this.intersectionObserver) {\r\n      if (!this.bottomMarker.isInView && this.bottomMarker.el) {\r\n        // By the time when we handle intersection change, the client rect is not always updated\r\n        const bottomMarkerRect = this.bottomMarker.el.getBoundingClientRect();\r\n        if (bottomMarkerRect.top === 0 && bottomMarkerRect.height === 0) {\r\n          // The 'tfoot' is hidden, no-result is shown\r\n          this.bottomMarker.isHiddenInView = true;\r\n\r\n          virtualScrollbarFixed = false;\r\n          virtualScrollbarInView = true;\r\n        }\r\n      }\r\n    }\r\n\r\n    const gridAndDisclaimContainerHeight = this.gridAndDisclaimContainer.current ? this.gridAndDisclaimContainer.current.getBoundingClientRect().height : 0;\r\n\r\n    return (\r\n      <Fragment>\r\n        <div ref={this.resizeMarker} className={classNames([this.props.classes.resizeMarker])} />\r\n        <div\r\n          ref={this.viewport}\r\n          className={classNames([this.props.customClasses.tablePageContainer, this.props.classes.pageContainer, 'table-page-container'])}\r\n          onScroll={() => this.handleScroll()}\r\n          style={{ minWidth: this.props.tablePageMinWidth }}\r\n        >\r\n          <div ref={this.topOfGridContainer}>\r\n            {this.props.topOfGridContent}\r\n          </div>\r\n          <div ref={this.gridAndStickyContainer} className=\"grid-and-sticky-container\" style={{ position: 'relative', zIndex: 0 }}>\r\n            {/* Scrollbar container (of whom grid view is a descendant) is position:relative to allow offseting the virtual scrollbars.\r\n          Normal stacking order causes elements who are position:relative to be stacked in the order in which they appear in the DOM, so toolbar will always be\r\n          hidden behind the scrollbar container. Setting a z-index here to prevent scrollbar container (i.e. the grid view) from occluding the sticky toolbar */}\r\n            <div ref={this.stickyContainer} style={stickyStyle} className=\"sticky-container\">\r\n              {this.props.stickyTopOfGridContent}\r\n            </div>\r\n            <div ref={this.gridAndDisclaimContainer} className={classNames([this.props.classes.gridAndDisclaimContainer, 'grid-and-disclaim-container'])} style={{ height: this.state.gridPopupHeight < 0 ? 'unset' : max([this.state.gridPopupHeight, gridAndDisclaimContainerHeight]), position: 'relative' }}>\r\n              <div className={classNames([this.props.classes.gridContainer])}>\r\n                <div className={classNames([this.props.customClasses.gridViewContainer, 'bingadsgrid', this.props.classes.gridViewContainer])} style={{ width: this.state.stickyTopOfGridWidth, position: 'relative', marginTop: this.state.shouldAdjustStickyTopOfGrid ? `${this.state.stickyTopOfGridHeight}px` : '0px' }}>\r\n                  <div className=\"budget-lanscape-popover-container\" />\r\n                  <div className=\"performance-insights-popover-container\" />\r\n                  <Scrollbar\r\n                    pgridView={p$gridView}\r\n                    width={this.state.stickyTopOfGridWidth}\r\n                    shouldDisplay={virtualScrollbarInView && this.state.gridViewHasHorizontalOverflow}\r\n                    positionFixed={virtualScrollbarFixed}\r\n                    containerOverflowX={this.state.containerOverflowX}\r\n                    gridViewWidth={this.state.gridViewWidth}\r\n                    gridPaddingLeft={this.paddingLeft}\r\n                    noResultSelector=\"grid-noresult\"\r\n                  >\r\n                    <div className=\"grid-parent-container\">\r\n                      <div id=\"rejectionContainer\" />\r\n                      {this.props.gridView}\r\n                    </div>\r\n                  </Scrollbar>\r\n                  <div className=\"grid-noresult\" />\r\n                </div>\r\n              </div>\r\n              {\r\n                // customer-scope grids don't have timeZone info\r\n                // Disclaimer banner will show if either timeZone or CustomDisclaimerBanner valid in props\r\n                (this.props.timeZone || this.props.CustomDisclaimerBanner) && (\r\n                  <div>\r\n                    <CustomDisclaimerBanner timezone={this.props.timeZone} />\r\n                  </div>\r\n                )\r\n              }\r\n            </div>\r\n          </div>\r\n          {!this.props.disableFooter &&\r\n            <div className={this.props.classes.contentFooter}>\r\n              <ContentFooter />\r\n            </div>\r\n          }\r\n        </div>\r\n      </Fragment >\r\n    );\r\n  }\r\n}\r\n\r\nTablePageContainer.propTypes = {\r\n  topOfGridContent: PropTypes.node,\r\n  stickyTopOfGridContent: PropTypes.node,\r\n  classes: PropTypes.object.isRequired,\r\n  customClasses: PropTypes.object,\r\n  timeZone: PropTypes.number,\r\n  gridView: PropTypes.object.isRequired,\r\n  backboneGridView: PropTypes.object,\r\n  pgridView: PropTypes.object,\r\n  forceResetScrollFlag: PropTypes.bool,\r\n  tablePageMinWidth: PropTypes.number,\r\n  disableFooter: PropTypes.bool,\r\n  CustomDisclaimerBanner: PropTypes.elementType,\r\n  inlineEditPopupSelector: PropTypes.string,\r\n};\r\n\r\nTablePageContainer.defaultProps = {\r\n  customClasses: {},\r\n  topOfGridContent: null,\r\n  backboneGridView: null,\r\n  pgridView: null,\r\n  forceResetScrollFlag: false,\r\n  tablePageMinWidth: 1032,\r\n  timeZone: null,\r\n  disableFooter: false,\r\n  CustomDisclaimerBanner: null,\r\n  inlineEditPopupSelector: '.grid-and-disclaim-container [role=dialog]',\r\n  stickyTopOfGridContent: null,\r\n};\r\n\r\n\r\nexport const StyledTablePageContainer = withDefaultStyles(TablePageContainer, getTablePageStyles);\r\n","import { isFunction, isUndefined, has, defer, isEmpty, extend } from 'underscore';\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Promise from 'bluebird';\r\n\r\nimport { getToolbarPlugin } from '@bingads-webui-campaign-react/toolbar-plugin';\r\nimport { ToolbarContainer } from '@bingads-webui-campaign-react/toolbar-container';\r\nimport { getCrossPageSelectPlugin } from '@bingads-webui-campaign-react/cross-page-select-plugin';\r\n/* global Map */\r\n// Ad-hoc synchronization\r\nclass Latch {\r\n  constructor() {\r\n    this.onInitialized = new Promise((resolve) => {\r\n      this.resolveOnInitialized = () => {\r\n        this.isInitialized = true;\r\n        resolve();\r\n      };\r\n    });\r\n    this.isInitialized = false;\r\n    this.isScheduled = {};\r\n  }\r\n\r\n  release() {\r\n    return this.resolveOnInitialized();\r\n  }\r\n\r\n  schedule(callback) {\r\n    if (this.isInitialized) return callback();\r\n    if (has(this.isScheduled, callback)) return null;\r\n\r\n    this.isScheduled[callback] = true;\r\n\r\n    return this.onInitialized.then(() => defer(callback));\r\n  }\r\n}\r\n\r\nexport const withTablePageStateManager = ({ getToolbarConfig }) =>\r\n  (WrappedComponent) => {\r\n    class GridPageStateManager extends React.PureComponent {\r\n      static propTypes = {\r\n        permissions: PropTypes.shape({}).isRequired,\r\n        scope: PropTypes.shape({\r\n          values: PropTypes.shape({}),\r\n          location: PropTypes.shape({\r\n            pathname: PropTypes.string,\r\n          }),\r\n        }).isRequired,\r\n        siteMap: PropTypes.arrayOf(PropTypes.shape({\r\n          id: PropTypes.string,\r\n        })).isRequired,\r\n        i18n: PropTypes.shape({\r\n          getString: PropTypes.func,\r\n        }).isRequired,\r\n      };\r\n\r\n      constructor(props) {\r\n        super(props);\r\n        this.initial(props);\r\n        this.unmounted = false;\r\n      }\r\n\r\n      componentWillUnmount() {\r\n        this.unmounted = true;\r\n      }\r\n\r\n      onGridInjected = ({ deselectAll, ...rest }) => {\r\n        this.deselectAll = deselectAll;\r\n        this.lazyInjected = rest;\r\n\r\n        this.lazyInjected.backboneGridView.once('willReload', () => {\r\n          this.onInitialized.release();\r\n        });\r\n      };\r\n\r\n      onClearSelection = () => {\r\n        this.setState({\r\n          showToolbarSelected: false,\r\n          showToolbarUnselected: true,\r\n        });\r\n\r\n        if (isFunction(this.deselectAll)) {\r\n          this.deselectAll();\r\n        }\r\n      };\r\n\r\n      initial(props) {\r\n        const { scope } = props;\r\n        const crossPageSelectPlugin = getCrossPageSelectPlugin({\r\n          updateGridSelectionState: this.updateGridSelectionState,\r\n        });\r\n        let isOpenCreatePanel = false;\r\n        isOpenCreatePanel = !!scope.values.isOpenCreatePanel;\r\n        if (isOpenCreatePanel) {\r\n          delete scope.values.isOpenCreatePanel;\r\n          scope.history.replace({\r\n            pathname: scope.history.location.pathname,\r\n            search: scope.stringify(),\r\n          });\r\n        }\r\n        const { onSelectCrossPage } = crossPageSelectPlugin;\r\n        const { toolbarSelectedConfig, toolbarUnselectedConfig, toolbarDynamicSelectedConfigCallback } = getToolbarConfig({\r\n          ...props,\r\n          isOpenCreatePanel,\r\n          updateGridOptions: this.updateGridOptions.bind(this),\r\n          onSelectCrossPage,\r\n          showTopOfGridPanel: this.showTopOfGridPanel,\r\n          lazyInject: () => this.lazyInjected, // call back to get lazy created dependencies, such as backboneGridView, filterService\r\n        });\r\n\r\n        this.crossPageSelectPlugin = crossPageSelectPlugin;\r\n        this.toolbarSelectedConfig = toolbarSelectedConfig;\r\n        this.toolbarUnselectedConfig = toolbarUnselectedConfig;\r\n        this.toolbarDynamicSelectedConfigCallback = toolbarDynamicSelectedConfigCallback;\r\n        this.toolbarDynamicSelectedConfig = new Map();\r\n        this.initialSetGridNum = true;\r\n        if (!this.state) {\r\n          this.state = {\r\n            isOpenCreatePanel,\r\n            forceHideInlineChart: false,\r\n            forceHideToolbar: false,\r\n            panelView: null,\r\n            showInlineChart: true,\r\n            showToolbarSelected: false,\r\n            showToolbarUnselected: true,\r\n            showTopGridPanel: false,\r\n            toolbarSelectedConfig: this.toolbarSelectedConfig,\r\n            toolbarUnselectedConfig: this.toolbarUnselectedConfig,\r\n            forceResetScrollFlag: false,\r\n            selectionCount: 0,\r\n            totalCount: 0,\r\n            isMultiPage: false,\r\n            isSinglePageAllSelected: false,\r\n            isCrossPageAllSelected: false,\r\n          };\r\n        } else {\r\n          this.setState({\r\n            toolbarSelectedConfig: this.toolbarSelectedConfig,\r\n            toolbarUnselectedConfig: this.toolbarUnselectedConfig,\r\n          });\r\n        }\r\n        this.createToolbar();\r\n      }\r\n\r\n      updateGridOptions(gridOptions) {\r\n        this.setState({\r\n          gridOptions,\r\n        });\r\n      }\r\n\r\n      createToolbar() {\r\n        this.toolbarPlugin = getToolbarPlugin({\r\n          overrideWith: this.showTopOfGridPanel,\r\n          resetVisibility: ({ forceHideToolbar }) => {\r\n            this.setState({\r\n              forceHideToolbar,\r\n              showTopGridPanel: forceHideToolbar,\r\n            });\r\n          },\r\n          resetGraphVisibility: () => {\r\n            this.setState({\r\n              forceHideInlineChart: false,\r\n            });\r\n          },\r\n          resetToolbarMode: ({ showToolbarSelected, showToolbarUnselected }) => {\r\n            this.setState({\r\n              showToolbarSelected,\r\n              showToolbarUnselected,\r\n            });\r\n          },\r\n          toolbarConfig: {\r\n            toolbarSelectedConfig: this.state.toolbarSelectedConfig,\r\n            // this.toolbarDynamicSelectedConfigCallback can mute so trigger it as lambda expression from here to ensure newest function is always used\r\n            toolbarDynamicSelectedConfigCallback: isFunction(this.toolbarDynamicSelectedConfigCallback) && (params => this.toolbarDynamicSelectedConfigCallback(params)),\r\n            toolbarUnselectedConfig: this.state.toolbarUnselectedConfig,\r\n          },\r\n          updateToolbarDynamicSelectedConfig: ({ dynamicSelectedConfig }) => {\r\n            this.toolbarDynamicSelectedConfig = dynamicSelectedConfig;\r\n            this.updateToolbar();\r\n          },\r\n          updateToolbar: this.updateToolbar,\r\n        });\r\n\r\n        this.onInitialized = new Latch();\r\n      }\r\n\r\n      updateToolbar = () => {\r\n        const doUpdate = () => {\r\n          if (this.unmounted) {\r\n            return;\r\n          }\r\n\r\n          // Merge the selected config with the dynamic selected config. Map.set() adds or updates an element so it will\r\n          // respect the order of elements if the key existed previously from selected config, otherwise add it to the end.\r\n          const toolbarSelectedConfigMerged = new Map();\r\n          this.toolbarSelectedConfig.forEach((value, key) => toolbarSelectedConfigMerged.set(key, value));\r\n          this.toolbarDynamicSelectedConfig.forEach((dynamicValue, key) => {\r\n            const mergedValue = extend({}, toolbarSelectedConfigMerged.get(key), dynamicValue);\r\n            toolbarSelectedConfigMerged.set(key, mergedValue);\r\n          });\r\n\r\n          const toolbarSelectedConfig = new Map();\r\n          const toolbarUnselectedConfig = new Map();\r\n          toolbarSelectedConfigMerged.forEach((value, key) => {\r\n            if (!isEmpty(value)) {\r\n              toolbarSelectedConfig.set(key, value);\r\n            }\r\n          });\r\n          this.toolbarUnselectedConfig.forEach((value, key) => toolbarUnselectedConfig.set(key, value));\r\n          this.setState({\r\n            toolbarSelectedConfig,\r\n            toolbarUnselectedConfig,\r\n          });\r\n        };\r\n\r\n        this.onInitialized.schedule(doUpdate);\r\n      };\r\n\r\n      resetToolbarVisibility = ({ forceHideToolbar }) => {\r\n        this.setState({ forceHideToolbar });\r\n      };\r\n\r\n      showTopOfGridPanel = (viewInstance, config = {}) => {\r\n        if (viewInstance) {\r\n          this.setState(prevState => ({\r\n            panelView: viewInstance,\r\n            showTopGridPanel: true,\r\n            forceHideInlineChart: true,\r\n            forceHideToolbar: config.forceHideToolbar !== undefined ? config.forceHideToolbar : true,\r\n            forceResetScrollFlag: config.forceResetScrollFlag !== undefined ? config.forceResetScrollFlag : !prevState.forceResetScrollFlag,\r\n            showTopGridPanelAndContent: config.showTopGridPanelAndContent !== undefined ? config.showTopGridPanelAndContent : false,\r\n          }));\r\n        } else {\r\n          this.setState(prevState => ({\r\n            panelView: null,\r\n            showTopGridPanel: false,\r\n            forceHideInlineChart: false,\r\n            forceHideToolbar: false,\r\n            forceResetScrollFlag: config.forceResetScrollFlag !== undefined ? config.forceResetScrollFlag : !prevState.forceResetScrollFlag,\r\n            showTopGridPanelAndContent: false,\r\n          }));\r\n        }\r\n      };\r\n\r\n      showInlineChartView = () => {\r\n        this.setState({ showInlineChart: true });\r\n      };\r\n\r\n      updateGridSelectionState = ({\r\n        selectionCount,\r\n        totalCount,\r\n        isMultiPage,\r\n        isSinglePageAllSelected,\r\n        isCrossPageAllSelected,\r\n      }) => {\r\n        const doUpdate = () => {\r\n          if (this.unmounted) {\r\n            return;\r\n          }\r\n\r\n          // for performance consideration, we do not need to update totalCount if no rows is selected\r\n          const newTotal = selectionCount === 0 && this.initialSetGridNum ? 0 : totalCount;\r\n          if (selectionCount || totalCount) {\r\n            this.initialSetGridNum = false;\r\n          }\r\n          this.setState({\r\n            selectionCount,\r\n            totalCount: newTotal,\r\n            isMultiPage,\r\n            isSinglePageAllSelected,\r\n            isCrossPageAllSelected,\r\n          });\r\n        };\r\n\r\n        this.onInitialized.schedule(doUpdate);\r\n      };\r\n\r\n      updateSelectedToolbarConfig = (newSelectedConfig) => {\r\n        this.toolbarSelectedConfig = newSelectedConfig;\r\n        this.updateToolbar();\r\n      };\r\n\r\n      updateUnselectedToolbarConfig = (newUnselectedConfig) => {\r\n        this.toolbarUnselectedConfig = newUnselectedConfig;\r\n        this.updateToolbar();\r\n      };\r\n\r\n      /**\r\n       * This will force all the config toolbar (selected/unselected/dynamicSelectedCallback) to get updated by\r\n       * passing the page newest props in parameter of the getToolbarConfig function and reload current configuration.\r\n       * @param {object} newProps It can also accept some object to merge to current props so getToolbarConfig(context) is more rich\r\n       * @return {void}\r\n       */\r\n      forceInitToolbarConfig = (newProps = {}) => {\r\n        this.initial({ ...this.props, ...newProps });\r\n        this.updateToolbar();\r\n      };\r\n\r\n      renderToolbarContainer = (options = {}) => {\r\n        const {\r\n          forceHideToolbar,\r\n          isCrossPageAllSelected,\r\n          isMultiPage,\r\n          isSinglePageAllSelected,\r\n          selectionCount,\r\n          showToolbarSelected,\r\n          showToolbarUnselected,\r\n          toolbarSelectedConfig,\r\n          toolbarUnselectedConfig,\r\n          totalCount,\r\n        } = this.state;\r\n\r\n        return (\r\n          <ToolbarContainer\r\n            forceHideToolbar={forceHideToolbar}\r\n            i18n={this.props.i18n}\r\n            isCrossPageAllSelected={isCrossPageAllSelected}\r\n            isMultiPage={isUndefined(options.isMultiPage) ? isMultiPage : options.isMultiPage}\r\n            isSinglePageAllSelected={isSinglePageAllSelected}\r\n            onClear={this.onClearSelection}\r\n            selectionCount={selectionCount}\r\n            showToolbarSelected={showToolbarSelected}\r\n            showToolbarUnselected={showToolbarUnselected}\r\n            toolbarSelectedConfig={toolbarSelectedConfig}\r\n            toolbarUnselectedConfig={toolbarUnselectedConfig}\r\n            totalCount={totalCount}\r\n          />\r\n        );\r\n      };\r\n\r\n      render() {\r\n        const {\r\n          showInlineChart,\r\n          forceHideInlineChart,\r\n          showTopGridPanel,\r\n          showTopGridPanelAndContent,\r\n        } = this.state;\r\n\r\n        return (\r\n          <WrappedComponent\r\n            {...this.props}\r\n            {...this.state}\r\n            toolbarSelectedConfig={this.state.toolbarSelectedConfig}\r\n            toolbarUnselectedConfig={this.state.toolbarUnselectedConfig}\r\n            crossPageSelectPlugin={this.crossPageSelectPlugin}\r\n            toolbarPlugin={this.toolbarPlugin}\r\n            showInlineChart={showInlineChart && !forceHideInlineChart}\r\n            showTopGridPanel={showTopGridPanel}\r\n            showTopGridPanelAndContent={showTopGridPanelAndContent}\r\n            renderToolbarContainer={this.renderToolbarContainer}\r\n            showTopOfGridPanel={this.showTopOfGridPanel}\r\n            onGridInjected={this.onGridInjected}\r\n            updateToolbar={this.updateToolbar}\r\n            resetToolbarVisibility={this.resetToolbarVisibility}\r\n            updateSelectedToolbarConfig={this.updateSelectedToolbarConfig}\r\n            updateUnselectedToolbarConfig={this.updateUnselectedToolbarConfig}\r\n            forceInitToolbarConfig={this.forceInitToolbarConfig}\r\n          />\r\n        );\r\n      }\r\n    }\r\n\r\n    return GridPageStateManager;\r\n  };\r\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\n\r\nimport { Button, Dropdown, Icon, Label, Stack, TextField } from '@bingads-webui-react/fabric-control';\r\nimport { HelpPopupInline } from '@bingads-webui-react/help-popup';\r\nimport { withCustomValidation, withError } from '@bingads-webui-react/validation';\r\nimport { withControlErrorHandling, withUnvalidatedControlErrors } from '@bingads-webui-campaign-react/error-handling';\r\n\r\nconst defaultLabelStyle = options => ({\r\n  label: {\r\n    color: options.success ? '#0A610A' : '#A80000',\r\n    backgroundColor: options.success ? '#DFF6DD' : '#FDE7E9',\r\n    fontWeight: 600,\r\n    fontSize: 12,\r\n    border: 4,\r\n    paddingInline: 5,\r\n    paddingTop: 2,\r\n    paddingBottom: 2,\r\n    verticalAlign: 'middle',\r\n    borderRadius: 4,\r\n    marginLeft: 8,\r\n  },\r\n  labelIcon: {\r\n    fontSize: 14,\r\n    height: 14,\r\n    width: 14,\r\n    fontWeight: 400,\r\n    marginLeft: 4,\r\n    marginRight: 5,\r\n    verticalAlign: '-2.5px',\r\n  },\r\n});\r\n\r\nconst defaultStyles = {\r\n  disconnectedStatusTile: {\r\n    root: {\r\n      marginLeft: 22,\r\n    },\r\n  },\r\n  connectedStatusTile: {\r\n    root: {\r\n      marginLeft: 22,\r\n    },\r\n  },\r\n  connectedStatusLabel: {\r\n    root: {\r\n      color: '#0C5E0C',\r\n      fontWeight: 600,\r\n      fontSize: 12,\r\n      lineHeight: 'normal',\r\n    },\r\n  },\r\n  saveButton: {\r\n    root: {\r\n      width: 68,\r\n    },\r\n  },\r\n  removeButton: {\r\n    root: {\r\n      width: 89,\r\n    },\r\n  },\r\n};\r\n\r\nconst VerifiedTrackingSettingKey = 'VerifiedTrackingSettings';\r\nconst vendorNameKey = 'vendorName';\r\nconst advertiserEntityIdKey = 'advertiserEntityId';\r\nconst publisherEntityIdKey = 'publisherEntityId';\r\nconst regexMappping = {\r\n  video: [/v2\\/(\\d*)\\/(\\d*)/],\r\n  display: [/rjss\\/st\\/(\\d*)\\/(\\d*)/, /rfw\\/st\\/(\\d*)\\/(\\d*)/],\r\n  native: [/rjss\\/st\\/(\\d*)\\/(\\d*)/, /rfw\\/st\\/(\\d*)\\/(\\d*)/],\r\n};\r\n\r\nconst ThirdPartyMeasurementNameMap = {\r\n  [advertiserEntityIdKey]: _TL_('Advertiser ID: '),\r\n  [publisherEntityIdKey]: _TL_('Publisher ID: '),\r\n  [vendorNameKey]: _TL_('Vendor Name: '),\r\n};\r\n\r\nexport const formatThirdPartyMeasurementSetting = (verifiedTrackingSettings, i18n) => {\r\n  const verifiedTrackingSetting = _.first(verifiedTrackingSettings);\r\n  const vendorName = _.get(verifiedTrackingSetting, vendorNameKey, '');\r\n  const advertiserEntityId = _.get(verifiedTrackingSetting, advertiserEntityIdKey, '');\r\n  const publisherEntityId = _.get(verifiedTrackingSetting, publisherEntityIdKey, '');\r\n\r\n  const settingEmpty = _.isEmpty(vendorName) || _.isEmpty(advertiserEntityId) || _.isEmpty(publisherEntityId);\r\n\r\n  const getVerifiedTrackingComponent = (key, value) =>\r\n    (<div>{i18n.getString(ThirdPartyMeasurementNameMap[key]) + value}</div>);\r\n\r\n  return (\r\n    <div white-space=\"pre\">\r\n      {\r\n        settingEmpty ?\r\n          i18n.getString(_TL_('None')) :\r\n          (\r\n            <div>\r\n              {getVerifiedTrackingComponent(vendorNameKey, vendorName)}\r\n              {getVerifiedTrackingComponent(publisherEntityIdKey, publisherEntityId)}\r\n              {getVerifiedTrackingComponent(advertiserEntityIdKey, advertiserEntityId)}\r\n            </div>\r\n          )\r\n      }\r\n    </div>\r\n  );\r\n};\r\n\r\nexport const extractIdsFromIASInput = ({ value, adType }) => {\r\n  const regexStrArr = regexMappping[adType];\r\n  let result = [];\r\n  _.each(regexStrArr, (regexStr) => {\r\n    const regex = new RegExp(regexStr);\r\n    const currentRes = regex.exec(value);\r\n    if (currentRes && currentRes.length >= 3) {\r\n      result = currentRes;\r\n    }\r\n  });\r\n\r\n  if (result.length >= 3) {\r\n    return [result[1], result[2]];\r\n  }\r\n\r\n  return [];\r\n};\r\n\r\nconst errorMessages = {\r\n  advertiserEntityId: 'advertiserEntityId',\r\n  publisherEntityId: 'publisherEntityId',\r\n};\r\n\r\nconst createVerifiedTrackingSettingViewModel = value => ({\r\n  [VerifiedTrackingSettingKey]: _.isEmpty(value) ? [] : [value],\r\n});\r\n\r\nconst StatusLabel = ({\r\n  value, i18n, success, type,\r\n}) => {\r\n  let statusMessage = i18n.getString(_TL_('Unknown status'));\r\n  if (type === advertiserEntityIdKey) {\r\n    statusMessage = success ? i18n.getString(_TL_('IAS Advertiser ID: {0}')).replace('{0}', value) : i18n.getString(_TL_('IAS Advertiser ID'));\r\n  } else if (type === publisherEntityIdKey) {\r\n    statusMessage = success ? i18n.getString(_TL_('IAS Publisher ID: {0}')).replace('{0}', value) : i18n.getString(_TL_('IAS Publisher ID'));\r\n  }\r\n\r\n  const statusStyle = useMemo(() => defaultLabelStyle({ success }), [success]);\r\n\r\n  return (\r\n    <Label\r\n      style={statusStyle.label}\r\n      className={`status-label-${type}`}\r\n    >\r\n      <Icon\r\n        iconName={success ? 'Accept' : 'Blocked2'}\r\n        style={statusStyle.labelIcon}\r\n      />\r\n      {statusMessage}\r\n    </Label>\r\n  );\r\n};\r\n\r\nexport const ThirdPartyMeasurement = (props) => {\r\n  const {\r\n    i18n,\r\n    updateValidation,\r\n    validationProps,\r\n    adType = 'video',\r\n    overrideStyles = {},\r\n  } = props;\r\n\r\n  const { data } = validationProps;\r\n  const verifiedTrackingData = useMemo(\r\n    () => _.result(data, [VerifiedTrackingSettingKey, 0], {})\r\n    , [data]\r\n  );\r\n  const styles = useMemo(() => ({\r\n    ...defaultStyles,\r\n    ...overrideStyles,\r\n  }), [overrideStyles]);\r\n\r\n  const [connected, setConnected] = useState(false);\r\n  const [verifiedTrackingSettingRaw, setVerifiedTrackingSettingRaw] = useState('');\r\n  const [tagUrlErrors, setTagErrors] = useState([]);\r\n\r\n  const options = useMemo(() => [\r\n    { key: 'IAS', text: i18n.getString(_TL_('Integral Ad Science (IAS)')) },\r\n  ], [i18n]);\r\n\r\n  useEffect(() => {\r\n    if (\r\n      !!verifiedTrackingData &&\r\n      !!verifiedTrackingData[vendorNameKey] &&\r\n      !!verifiedTrackingData[advertiserEntityIdKey] &&\r\n      !!verifiedTrackingData[publisherEntityIdKey]) {\r\n      setConnected(true);\r\n    } else {\r\n      setConnected(false);\r\n    }\r\n  }, [verifiedTrackingData]);\r\n\r\n  const validateUrl = useCallback((value) => {\r\n    const ids = extractIdsFromIASInput({ value, adType });\r\n    let result = true;\r\n    const verifiedTrackingSettingToAdd = {};\r\n    if (ids.length === 2) {\r\n      const advertiserEntityId = ids[0];\r\n      const publisherEntityId = ids[1];\r\n      const errors = [];\r\n      if (_.isEmpty(advertiserEntityId)) {\r\n        errors.push(errorMessages.advertiserEntityId);\r\n        result = false;\r\n      } else {\r\n        verifiedTrackingSettingToAdd[advertiserEntityIdKey] = advertiserEntityId;\r\n      }\r\n\r\n      if (_.isEmpty(publisherEntityId)) {\r\n        errors.push(errorMessages.publisherEntityId);\r\n        result = false;\r\n      } else {\r\n        verifiedTrackingSettingToAdd[publisherEntityIdKey] = publisherEntityId;\r\n      }\r\n\r\n      setTagErrors(errors);\r\n    } else {\r\n      setTagErrors([errorMessages.advertiserEntityId, errorMessages.publisherEntityId]);\r\n      result = false;\r\n    }\r\n\r\n    return { result, verifiedTrackingSettingToAdd };\r\n  }, [adType]);\r\n\r\n  const save = useCallback(() => {\r\n    const { result, verifiedTrackingSettingToAdd } = validateUrl(verifiedTrackingSettingRaw);\r\n    if (result\r\n    && verifiedTrackingSettingToAdd[advertiserEntityIdKey]\r\n    && verifiedTrackingSettingToAdd[publisherEntityIdKey]) {\r\n      const value = {\r\n        [vendorNameKey]: options[0].key,\r\n        [advertiserEntityIdKey]: verifiedTrackingSettingToAdd[advertiserEntityIdKey],\r\n        [publisherEntityIdKey]: verifiedTrackingSettingToAdd[publisherEntityIdKey],\r\n      };\r\n      // We will just pass the value to the Validate Group.\r\n      updateValidation([], createVerifiedTrackingSettingViewModel(value));\r\n    }\r\n  }, [\r\n    options,\r\n    validateUrl,\r\n    verifiedTrackingSettingRaw,\r\n    updateValidation,\r\n  ]);\r\n\r\n  const remove = () => {\r\n    updateValidation([], createVerifiedTrackingSettingViewModel());\r\n  };\r\n\r\n  const onRenderLabelDropDown = () => (\r\n    <Stack verticalAlign=\"center\" horizontal>\r\n      <Label>\r\n        {i18n.getString(_TL_('Third-party partners'))}\r\n      </Label>\r\n      <HelpPopupInline topic=\"pop_BA_VideoAds_Partners\" />\r\n    </Stack>\r\n  );\r\n\r\n  const onRenderLabelTextField = () => (\r\n    <Stack verticalAlign=\"center\" horizontal>\r\n      <Label>\r\n        {i18n.getString(_TL_('Tag URL'))}\r\n      </Label>\r\n      <HelpPopupInline topic=\"pop_BA_VideoAds_TagURL\" />\r\n    </Stack>\r\n  );\r\n\r\n  const onTagUrlChange = useCallback((event, value) => {\r\n    // remove the error message when the user is typing.\r\n    setTagErrors([]);\r\n    setVerifiedTrackingSettingRaw(value);\r\n  }, []);\r\n\r\n  const tagErrorMessage = useMemo(() => {\r\n    if (!_.isEmpty(tagUrlErrors)) {\r\n      return (\r\n        <Stack className=\"tag-error-message\" horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }}>\r\n          {i18n.getString(_TL_('Cannot detect:'))}\r\n          {\r\n            _.map(tagUrlErrors, error => (\r\n              <StatusLabel type={error} i18n={i18n} success={false} />\r\n            ))\r\n          }\r\n        </Stack>\r\n      );\r\n    }\r\n    return '';\r\n  }, [tagUrlErrors, i18n]);\r\n\r\n  return (\r\n    <div className=\"third-party-measurement-tile\">\r\n      {(\r\n        !connected ?\r\n        (\r\n          <Stack className=\"disconnected-status-tile\" horizontal={false} tokens={{ childrenGap: 8 }} style={styles.disconnectedStatusTile.root}>\r\n            <Dropdown\r\n              className=\"vendor-name-dropdown\"\r\n              defaultSelectedKey={options[0].key}\r\n              options={options}\r\n              onRenderLabel={onRenderLabelDropDown}\r\n              disabled\r\n            />\r\n            <TextField\r\n              className=\"tag-url-input\"\r\n              multiline\r\n              autoAdjustHeight\r\n              onRenderLabel={onRenderLabelTextField}\r\n              onChange={onTagUrlChange}\r\n              errorMessage={tagErrorMessage}\r\n            />\r\n            <Button className=\"save-button\" text={i18n.getString(_TL_('Add'))} onClick={save} style={styles.saveButton.root} />\r\n          </Stack>\r\n        ) : (\r\n          <Stack className=\"connected-status-tile\" horizontal={false} tokens={{ childrenGap: 4 }} style={styles.connectedStatusTile.root}>\r\n            <Label\r\n              className=\"connected-status-label\"\r\n              style={styles.connectedStatusLabel.root}\r\n            >\r\n              {i18n.getString(_TL_('Added'))}\r\n            </Label>\r\n            <Stack className=\"verified-tracking-data-stack\" horizontal wrap tokens={{ childrenGap: 5 }}>\r\n              <StatusLabel type={advertiserEntityIdKey} value={verifiedTrackingData[advertiserEntityIdKey]} i18n={i18n} success />\r\n              <StatusLabel type={publisherEntityIdKey} value={verifiedTrackingData[publisherEntityIdKey]} i18n={i18n} success />\r\n            </Stack>\r\n            <Button className=\"remove-button\" text={i18n.getString(_TL_('Remove'))} onClick={remove} style={styles.removeButton.root} />\r\n          </Stack>\r\n        )\r\n      )}\r\n    </div>\r\n  );\r\n};\r\n\r\nThirdPartyMeasurement.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      VerifiedTrackingSettings: PropTypes.arrayOf(PropTypes.shape({})),\r\n    }),\r\n  }).isRequired,\r\n  adType: PropTypes.string,\r\n  overrideStyles: PropTypes.shape({}),\r\n};\r\n\r\nThirdPartyMeasurement.defaultProps = {\r\n  adType: 'video',\r\n  overrideStyles: {},\r\n};\r\n\r\nStatusLabel.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  type: PropTypes.string.isRequired,\r\n  success: PropTypes.bool.isRequired,\r\n  value: PropTypes.string,\r\n};\r\n\r\nStatusLabel.defaultProps = {\r\n  value: '',\r\n};\r\n\r\nexport const ThirdPartyMeasurementWithValidation = withControlErrorHandling(withUnvalidatedControlErrors(withError(withCustomValidation(ThirdPartyMeasurement))));\r\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\n\r\nimport { Icon, Label, Stack, TextField, Checkbox } from '@bingads-webui-react/fabric-control';\r\nimport { HelpPopupInline } from '@bingads-webui-react/help-popup';\r\nimport { withCustomValidation, withError } from '@bingads-webui-react/validation';\r\nimport { withControlErrorHandling, withUnvalidatedControlErrors } from '@bingads-webui-campaign-react/error-handling';\r\n\r\nconst defaultLabelStyle = options => ({\r\n  label: {\r\n    color: options.success ? '#0A610A' : '#A80000',\r\n    backgroundColor: options.success ? '#DFF6DD' : '#FDE7E9',\r\n    fontWeight: 600,\r\n    fontSize: 12,\r\n    border: 4,\r\n    paddingInline: 5,\r\n    paddingTop: 2,\r\n    paddingBottom: 2,\r\n    verticalAlign: 'middle',\r\n    borderRadius: 4,\r\n    marginLeft: 8,\r\n  },\r\n  labelIcon: {\r\n    fontSize: 14,\r\n    height: 14,\r\n    width: 14,\r\n    fontWeight: 400,\r\n    marginLeft: 4,\r\n    marginRight: 5,\r\n    verticalAlign: '-2.5px',\r\n  },\r\n});\r\n\r\nconst defaultStyles = {\r\n  disconnectedStatusTile: {\r\n    root: {\r\n    },\r\n  },\r\n  connectedStatusTile: {\r\n    root: {\r\n      marginLeft: 22,\r\n    },\r\n  },\r\n  connectedStatusLabel: {\r\n    root: {\r\n      color: '#0C5E0C',\r\n      fontWeight: 600,\r\n      fontSize: 12,\r\n      lineHeight: 'normal',\r\n    },\r\n  },\r\n  saveButton: {\r\n    root: {\r\n      width: 68,\r\n    },\r\n  },\r\n  removeButton: {\r\n    root: {\r\n      width: 89,\r\n    },\r\n  },\r\n};\r\n\r\nconst VerifiedTrackingSettingKey = 'VerifiedTrackingSettings';\r\nconst vendorNameKey = 'vendorName';\r\nconst advertiserEntityIdKey = 'advertiserEntityId';\r\nconst publisherEntityIdKey = 'publisherEntityId';\r\n\r\nconst StatusLabel = ({\r\n  value, i18n, success, type,\r\n}) => {\r\n  let statusMessage = i18n.getString(_TL_('Unknown status'));\r\n  if (type === advertiserEntityIdKey) {\r\n    statusMessage = success ? i18n.getString(_TL_('IAS Advertiser ID: {0}')).replace('{0}', value) : i18n.getString(_TL_('Invalid Advertiser ID'));\r\n  } else if (type === publisherEntityIdKey) {\r\n    statusMessage = success ? i18n.getString(_TL_('IAS Publisher ID: {0}')).replace('{0}', value) : i18n.getString(_TL_('Invalid Publisher ID'));\r\n  }\r\n\r\n  const statusStyle = useMemo(() => defaultLabelStyle({ success }), [success]);\r\n\r\n  return (\r\n    <Label\r\n      style={statusStyle.label}\r\n      className={`status-label-${type}`}\r\n    >\r\n      <Icon\r\n        iconName={success ? 'Accept' : 'Blocked2'}\r\n        style={statusStyle.labelIcon}\r\n      />\r\n      {statusMessage}\r\n    </Label>\r\n  );\r\n};\r\n\r\nconst createVerifiedTrackingSettingViewModel = value => ({\r\n  [VerifiedTrackingSettingKey]: value,\r\n});\r\n\r\nconst getCheckStatus = (settings, vendor) => {\r\n  if (_.isEmpty(settings) || !settings[vendor]) {\r\n    return false;\r\n  }\r\n\r\n  return settings[vendor].enabled;\r\n};\r\n\r\nexport const ThirdPartyMeasurementV2 = (props) => {\r\n  const {\r\n    i18n,\r\n    updateValidation,\r\n    validationProps,\r\n    overrideStyles = {},\r\n  } = props;\r\n\r\n  const { data } = validationProps;\r\n  const [settings, setSettings] = useState({});\r\n  const [errors, setErrors] = useState({});\r\n\r\n  const verifiedTrackingDatas = useMemo(\r\n    () => _.result(data, [VerifiedTrackingSettingKey], [])\r\n    , [data]\r\n  );\r\n  const styles = useMemo(() => ({\r\n    ...defaultStyles,\r\n    ...overrideStyles,\r\n  }), [overrideStyles]);\r\n\r\n  useEffect(() => {\r\n    const settingsToUpdate = {};\r\n    if (verifiedTrackingDatas.length > 0) {\r\n      const iasData = verifiedTrackingDatas.find(setting =>\r\n        setting.vendorName === 'IAS');\r\n      const moatData = verifiedTrackingDatas.find(setting =>\r\n        setting.vendorName === 'MOAT');\r\n\r\n      if (!_.isEmpty(iasData)) {\r\n        settingsToUpdate.IAS = {\r\n          enabled: true,\r\n          ...iasData,\r\n        };\r\n      } else {\r\n        settingsToUpdate.IAS = {\r\n          enabled: false,\r\n        };\r\n      }\r\n\r\n      if (!_.isEmpty(moatData)) {\r\n        settingsToUpdate.MOAT = {\r\n          enabled: true,\r\n          ...moatData,\r\n        };\r\n      } else {\r\n        settingsToUpdate.MOAT = {\r\n          enabled: false,\r\n        };\r\n      }\r\n\r\n      setSettings(settingsToUpdate);\r\n    } else {\r\n      settingsToUpdate.IAS = { enabled: false };\r\n      settingsToUpdate.MOAT = { enabled: false };\r\n      setSettings(settingsToUpdate);\r\n    }\r\n  }, [verifiedTrackingDatas]);\r\n\r\n  useEffect(() => {\r\n    if (_.isEmpty(settings)) {\r\n      return;\r\n    }\r\n    // Validate IAS\r\n    let iasSettingsToUpdate = { [vendorNameKey]: 'IAS' };\r\n    const iasEnabled = _.get(settings, ['IAS', 'enabled'], false);\r\n    if (iasEnabled) {\r\n      const advertiserEntityId = _.get(settings, ['IAS', advertiserEntityIdKey], '');\r\n      const publisherEntityId = _.get(settings, ['IAS', publisherEntityIdKey], '');\r\n      const numericPattern = /^\\d+$/;\r\n      const errorsToUpdate = {};\r\n      if (!numericPattern.test(advertiserEntityId)) {\r\n        errorsToUpdate[advertiserEntityIdKey] = advertiserEntityIdKey;\r\n      }\r\n\r\n      if (!numericPattern.test(publisherEntityId)) {\r\n        errorsToUpdate[publisherEntityIdKey] = publisherEntityIdKey;\r\n      }\r\n      if (!_.isEmpty(errorsToUpdate)) {\r\n        setErrors(errorsToUpdate);\r\n      } else {\r\n        setErrors({});\r\n      }\r\n      iasSettingsToUpdate = {\r\n        ...iasSettingsToUpdate,\r\n        enabled: true,\r\n        advertiserEntityId,\r\n        publisherEntityId,\r\n      };\r\n    } else {\r\n      iasSettingsToUpdate.enabled = false;\r\n    }\r\n\r\n    // validate MOAT\r\n    const moatSettingsToUpdate = {\r\n      enabled: _.get(settings, ['MOAT', 'enabled'], false),\r\n      [vendorNameKey]: 'MOAT',\r\n    };\r\n\r\n    // update validation\r\n    updateValidation([], createVerifiedTrackingSettingViewModel([iasSettingsToUpdate, moatSettingsToUpdate]));\r\n  }, [settings, updateValidation]);\r\n\r\n  const onRenderadvertiserIdTextField = useCallback(() => (\r\n    <Stack verticalAlign=\"center\" horizontal>\r\n      <Label>\r\n        {i18n.getString(_TL_('advertiser id'))}\r\n      </Label>\r\n      <HelpPopupInline topic=\"pop_BA_VideoAds_TagURL\" />\r\n    </Stack>\r\n  ), [i18n]);\r\n\r\n  const onRenderpublisherIdTextField = useCallback(() => (\r\n    <Stack verticalAlign=\"center\" horizontal>\r\n      <Label>\r\n        {i18n.getString(_TL_('publisher id'))}\r\n      </Label>\r\n      <HelpPopupInline topic=\"pop_BA_VideoAds_TagURL\" />\r\n    </Stack>\r\n  ), [i18n]);\r\n\r\n  const onAdvertiserIdChange = useCallback((event, value) => {\r\n    if (!_.isEmpty(settings.IAS) && !!settings.IAS.enabled) {\r\n      setSettings({\r\n        ...settings,\r\n        IAS: {\r\n          ...settings.IAS,\r\n          advertiserEntityId: value,\r\n        },\r\n      });\r\n    }\r\n  }, [settings]);\r\n\r\n  const onPublisherIdChange = useCallback((event, value) => {\r\n    if (!_.isEmpty(settings.IAS) && !!settings.IAS.enabled) {\r\n      setSettings({\r\n        ...settings,\r\n        IAS: {\r\n          ...settings.IAS,\r\n          publisherEntityId: value,\r\n        },\r\n      });\r\n    }\r\n  }, [settings]);\r\n\r\n  const onCheckStatusChangeGenerator = useCallback(vendor => (event, checked) => {\r\n    setSettings((originalSettings) => {\r\n      const newSettings = { ...originalSettings };\r\n      if (_.isEmpty(newSettings[vendor])) {\r\n        newSettings[vendor] = {\r\n          enabled: checked,\r\n        };\r\n      } else {\r\n        newSettings[vendor].enabled = checked;\r\n      }\r\n      return newSettings;\r\n    });\r\n  }, []);\r\n\r\n  const tagErrorMessage = useCallback((errorType) => {\r\n    if (!_.isEmpty(errors) && !!errors[errorType]) {\r\n      return (\r\n        <Stack className=\"tag-error-message\" horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }}>\r\n          <StatusLabel type={errors[errorType]} i18n={i18n} success={false} />\r\n        </Stack>\r\n      );\r\n    }\r\n    return '';\r\n  }, [errors, i18n]);\r\n\r\n  const onRenderIASLabel = useCallback(() => (\r\n    <Label className=\"ias-name-label\">\r\n      {i18n.getString(_TL_('Integral Ad Science'))}\r\n    </Label>\r\n  ), [i18n]);\r\n\r\n  const onRenderMOATLabel = useCallback(() => (\r\n    <Label className=\"moat-name-label\">\r\n      {i18n.getString(_TL_('Oracle MOAT'))}\r\n    </Label>\r\n  ), [i18n]);\r\n\r\n  const onRenderIASCheckbox = useCallback(() => (\r\n    <Stack className=\"ias-choice\" horizontal tokens={{ childrenGap: 8 }} style={styles.disconnectedStatusTile.root}>\r\n      <Checkbox className=\"ias-checkbox\" onChange={onCheckStatusChangeGenerator('IAS')} onRenderLabel={onRenderIASLabel} checked={getCheckStatus(settings, 'IAS')} />\r\n      <TextField\r\n        className=\"ias-advertiser-id-input\"\r\n        autoAdjustHeight\r\n        onRenderLabel={onRenderadvertiserIdTextField}\r\n        onChange={onAdvertiserIdChange}\r\n        errorMessage={tagErrorMessage(advertiserEntityIdKey)}\r\n        disabled={!_.get(settings, ['IAS', 'enabled'], false)}\r\n        value={_.get(settings, ['IAS', advertiserEntityIdKey], '')}\r\n      />\r\n      <TextField\r\n        className=\"ias-publisher-id-input\"\r\n        autoAdjustHeight\r\n        onRenderLabel={onRenderpublisherIdTextField}\r\n        onChange={onPublisherIdChange}\r\n        errorMessage={tagErrorMessage(publisherEntityIdKey)}\r\n        disabled={!_.get(settings, ['IAS', 'enabled'], false)}\r\n        value={_.get(settings, ['IAS', publisherEntityIdKey], '')}\r\n      />\r\n    </Stack>\r\n  ), [styles.disconnectedStatusTile.root, onCheckStatusChangeGenerator, onRenderIASLabel, settings, onRenderadvertiserIdTextField, onAdvertiserIdChange, tagErrorMessage, onRenderpublisherIdTextField, onPublisherIdChange]);\r\n\r\n  return (\r\n    <div className=\"third-party-measurement-tile-V2\">\r\n      <Stack className=\"third-party-measurement-choices\" horizontal={false} tokens={{ childrenGap: 8 }} style={styles.disconnectedStatusTile.root}>\r\n        {onRenderIASCheckbox()}\r\n        <Checkbox className=\"moat-checkbox\" onChange={onCheckStatusChangeGenerator('MOAT')} onRenderLabel={onRenderMOATLabel} checked={getCheckStatus(settings, 'MOAT')} />\r\n      </Stack>\r\n    </div>\r\n  );\r\n};\r\n\r\nThirdPartyMeasurementV2.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      VerifiedTrackingSettings: PropTypes.arrayOf(PropTypes.shape({})),\r\n    }),\r\n  }).isRequired,\r\n  overrideStyles: PropTypes.shape({}),\r\n};\r\n\r\nThirdPartyMeasurementV2.defaultProps = {\r\n  overrideStyles: {},\r\n};\r\n\r\nStatusLabel.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  type: PropTypes.string.isRequired,\r\n  success: PropTypes.bool.isRequired,\r\n  value: PropTypes.string,\r\n};\r\n\r\nStatusLabel.defaultProps = {\r\n  value: '',\r\n};\r\n\r\nexport const ThirdPartyMeasurementV2WithValidation = withControlErrorHandling(withUnvalidatedControlErrors(withError(withCustomValidation(ThirdPartyMeasurementV2))));\r\n","import React, { useMemo, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\n\r\nimport { CommandButton, Stack } from '@bingads-webui-react/fabric-control';\r\nimport { HelpPopupInline } from '@bingads-webui-react/help-popup';\r\nimport { withCustomValidation, withError } from '@bingads-webui-react/validation';\r\nimport { withControlErrorHandling, withUnvalidatedControlErrors } from '@bingads-webui-campaign-react/error-handling';\r\nimport { ThirdPartyMeasurement, formatThirdPartyMeasurementSetting } from './third-party-measurement';\r\nimport { ThirdPartyMeasurementV2 } from './third-party-measurement-V2';\r\n\r\n\r\nconst defaultStyles = {\r\n  thirdPartyMeasurementFolderButton: {\r\n    label: { color: '#0078D4', fontWeight: 600 },\r\n    icon: { fontSize: 14, fontWeight: 400 },\r\n    root: { verticalAlign: 'middle' },\r\n  },\r\n};\r\n\r\nexport const ThirdPartyMeasurementCardContainer = (props) => {\r\n  const {\r\n    i18n,\r\n    updateValidation,\r\n    validationProps,\r\n    adType = 'video',\r\n    overrideStyles = {},\r\n    showSimpleMessage,\r\n    isForDeal,\r\n    dealLoaded,\r\n    isMOATEnabled,\r\n  } = props;\r\n\r\n  const initialFolded = !_.isEmpty(_.get(validationProps, ['data', 'VerifiedTrackingSettings'], {}));\r\n  const [folded, setFolded] = useState(initialFolded);\r\n\r\n  const foldedIconProps = useMemo(() => {\r\n    const iconName = folded ? 'ChevronDown' : 'ChevronRight';\r\n    return { iconName };\r\n  }, [folded]);\r\n\r\n  const styles = useMemo(() => ({\r\n    ...defaultStyles,\r\n    ...overrideStyles,\r\n  }), [overrideStyles]);\r\n\r\n  if (!dealLoaded || isForDeal) return null;\r\n\r\n  const ThirdPartyMeasurementComponent = isMOATEnabled ? ThirdPartyMeasurementV2: ThirdPartyMeasurement;\r\n\r\n  return (\r\n    <div className=\"third-party-measurement-tile\">\r\n      <Stack verticalAlign=\"center\" horizontal>\r\n        <CommandButton\r\n          className=\"third-party-measurement-folder-button\"\r\n          text={i18n.getString(_TL_('Third-party measurement'))}\r\n          onClick={() => setFolded(!folded)}\r\n          iconProps={foldedIconProps}\r\n          styles={\r\n            styles.thirdPartyMeasurementFolderButton\r\n          }\r\n        />\r\n        <HelpPopupInline topic=\"pop_BA_VideoAds_Measurement\" />\r\n      </Stack>\r\n      {folded ? (\r\n        <ThirdPartyMeasurementComponent\r\n          i18n={i18n}\r\n          updateValidation={updateValidation}\r\n          validationProps={validationProps}\r\n          adType={adType}\r\n          overrideStyles={styles}\r\n        />\r\n      ) : (showSimpleMessage && formatThirdPartyMeasurementSetting(validationProps.data.VerifiedTrackingSettings, i18n))}\r\n    </div>\r\n  );\r\n};\r\n\r\nThirdPartyMeasurementCardContainer.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      VerifiedTrackingSettings: PropTypes.arrayOf(PropTypes.shape({})),\r\n    }),\r\n  }).isRequired,\r\n  adType: PropTypes.string,\r\n  showSimpleMessage: PropTypes.bool,\r\n  overrideStyles: PropTypes.shape({}),\r\n  isForDeal: PropTypes.bool,\r\n  dealLoaded: PropTypes.bool,\r\n  isMOATEnabled: PropTypes.bool,\r\n};\r\n\r\nThirdPartyMeasurementCardContainer.defaultProps = {\r\n  adType: 'video',\r\n  showSimpleMessage: false,\r\n  overrideStyles: {},\r\n  isForDeal: false,\r\n  dealLoaded: true,\r\n  isMOATEnabled: false,\r\n};\r\n\r\nexport const ThirdPartyMeasurementContainerWithValidation = withControlErrorHandling(withUnvalidatedControlErrors(withError(withCustomValidation(ThirdPartyMeasurementCardContainer))));\r\n","import { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport Backbone from 'backbone';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\n\r\nimport { ThirdPartyMeasurementCardContainer } from './third-party-measurement-container';\r\n\r\n\r\nconst overrideStyles = {\r\n  thirdPartyMeasurementFolderButton: {\r\n    label: { color: '#0078D4', fontWeight: 600 },\r\n    icon: {\r\n      fontSize: 14, fontWeight: 600, marginLeft: 0, marginRight: 4,\r\n    },\r\n    root: { verticalAlign: 'middle' },\r\n  },\r\n  disconnectedStatusTile: {\r\n    root: {\r\n      marginLeft: 0,\r\n    },\r\n  },\r\n  connectedStatusTile: {\r\n    root: {\r\n      marginLeft: 0,\r\n    },\r\n  },\r\n};\r\n\r\nexport class ThirdPartyMeasurementBackboneView extends Backbone.View {\r\n  initialize({\r\n    i18n,\r\n    initialThirdPartyMeasurement,\r\n    isMOATEnabled = false,\r\n  }) {\r\n    this.i18n = i18n;\r\n    this.validationProps = {\r\n      data: {\r\n        VerifiedTrackingSettings: initialThirdPartyMeasurement,\r\n      },\r\n    };\r\n    this.isMOATEnabled = isMOATEnabled;\r\n    this.saveVerifiedTrackingSetting = this.saveVerifiedTrackingSetting.bind(this);\r\n    return this;\r\n  }\r\n\r\n  // We need to make this func fit for ThirdPartyMeasurementCardContainer\r\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n  saveVerifiedTrackingSetting(dummyErrorArr = [], VerifiedTrackingObj) {\r\n    const verifiedTrackingSettings = VerifiedTrackingObj.VerifiedTrackingSettings;\r\n\r\n    this.trigger('InputChange', verifiedTrackingSettings);\r\n  }\r\n\r\n  renderWithInput(verifiedTrackingObj) {\r\n    this.validationProps = {\r\n      data: {\r\n        VerifiedTrackingSettings: verifiedTrackingObj,\r\n      },\r\n    };\r\n    this.render();\r\n  }\r\n\r\n  render() {\r\n    ReactDOM.render(\r\n      <I18nContext.Provider value={this.i18n}>\r\n        <ThirdPartyMeasurementCardContainer\r\n          i18n={this.i18n}\r\n          validationProps={this.validationProps}\r\n          updateValidation={this.saveVerifiedTrackingSetting}\r\n          adType=\"native\"\r\n          overrideStyles={overrideStyles}\r\n          isMOATEnabled={this.isMOATEnabled}\r\n          showSimpleMessage\r\n        />\r\n      </I18nContext.Provider>\r\n      , this.el\r\n    );\r\n    return this;\r\n  }\r\n}\r\n\r\n","import _ from 'underscore';\r\n\r\nexport const campaignThirdPartyVendors = {\r\n  ISPOT: 'ISPOT',\r\n  DV: 'DV',\r\n};\r\n\r\nexport const reachVendors = [\r\n  campaignThirdPartyVendors.ISPOT,\r\n];\r\n\r\nexport const verificationVendors = [\r\n  campaignThirdPartyVendors.DV,\r\n];\r\n\r\nexport const campaignThirdPartyVendorNames = {\r\n  ISPOT: _TL_('iSPOT'),\r\n  DV: _TL_('DoubleVerify'),\r\n};\r\n\r\nexport const thirdPartyMeasurementTrackingVendorHeader = {\r\n  ISPOT: _TL_('Reach vendor'),\r\n  DV: _TL_('Verification vendor'),\r\n};\r\n\r\nexport const thirdPartyVendorHeaderPopupTopic = {\r\n  ISPOT: 'pop_BA_Measurement_Reach',\r\n  DV: 'pop_BA_Measurement_Verification',\r\n};\r\n\r\nexport const thirdPartyMeasurementTrackingVendorField = {\r\n  ISPOT_brandId: 'brandId',\r\n  ThirdPartyMeasurement_setting: 'setting',\r\n};\r\n\r\nconst thirdPartySettingError = {\r\n  ISPOT_brandId_shouldNotBeEmpty: _TL_('iSpot Brand ID is required'),\r\n  ISPOT_brandId_shouldBeNumeric: _TL_('iSpot Brand ID should be numeric'),\r\n  ISPOT_brandId_brandIdTooLong: _TL_('iSpot Brand ID should be no more than 7 characters'),\r\n};\r\n\r\nexport const vendorNameKey = 'vendorName';\r\nexport const settingEnabledKey = 'enabled';\r\nconst numericPattern = /^\\d+$/;\r\nconst maxBrandIdLength = 7;\r\nexport const VerifiedTrackingSettingKey = 'VerifiedTrackingSettings';\r\n\r\nconst ispotValidator = ({ setting, i18n }) => {\r\n  const errors = [];\r\n  const brandId = _.get(setting, [thirdPartyMeasurementTrackingVendorField.ISPOT_brandId]);\r\n  if (_.isEmpty(brandId)) {\r\n    errors.push(i18n.getString(thirdPartySettingError.ISPOT_brandId_shouldNotBeEmpty));\r\n    return errors;\r\n  }\r\n\r\n  if (numericPattern.test(brandId) === false) {\r\n    errors.push(i18n.getString(thirdPartySettingError.ISPOT_brandId_shouldBeNumeric));\r\n    return errors;\r\n  }\r\n\r\n  if (brandId.length > maxBrandIdLength) {\r\n    errors.push(i18n.getString(thirdPartySettingError.ISPOT_brandId_brandIdTooLong));\r\n  }\r\n  return errors;\r\n};\r\n\r\nexport const isVendorSelectedInSetting = (settings, vendorName) => {\r\n  const foundSetting = _.find(settings, setting => setting[vendorNameKey] === vendorName);\r\n  if (foundSetting) {\r\n    return _.get(foundSetting, settingEnabledKey, false);\r\n  }\r\n  return false;\r\n};\r\n\r\nexport const thirdPartySettingValidatorMap = {\r\n  ISPOT: ispotValidator,\r\n};\r\n\r\nexport const createVerifiedTrackingSettingViewModel = value => ({\r\n  [VerifiedTrackingSettingKey]: value,\r\n});\r\n\r\n","export const thridPartyMeasurementTrackingStyles = {\r\n  thirdPartyMeasurementGuide: {\r\n    root: {\r\n      ' .ms-Label': {\r\n        fontSize: 14,\r\n        fontWeight: 400,\r\n      },\r\n      lineHeight: 20,\r\n    },\r\n  },\r\n\r\n  thirdPartyMeasurementRemoveAllStack: {\r\n    root: {\r\n      height: 0,\r\n    },\r\n  },\r\n\r\n  thirdPartyMeasurementRemoveAllButton: {\r\n    label: { color: '#424242', fontWeight: 600 },\r\n    root: {\r\n      marginTop: 16,\r\n      height: 31,\r\n      // Fix the focus wrapping un-complete issue in desert mode\r\n      '@media screen and (-ms-high-contrast: active), screen and (forced-colors: active)': {\r\n        '&:focus::after': {\r\n          inset: '0px !important',\r\n        },\r\n      },\r\n    },\r\n  },\r\n\r\n  thirdPartyMeasurementAddButton: {\r\n    label: { color: '#0078D4', fontWeight: 600 },\r\n    icon: { fontSize: 14, fontWeight: 400 },\r\n    root: {\r\n      verticalAlign: 'middle',\r\n      // Fix the focus wrapping un-complete issue in desert mode\r\n      '@media screen and (-ms-high-contrast: active), screen and (forced-colors: active)': {\r\n        '&:focus::after': {\r\n          inset: '0px !important',\r\n        },\r\n      },\r\n    },\r\n    dropdown: {\r\n      root: {\r\n        width: 312,\r\n        ' .ms-ContextualMenu-header': {\r\n          paddingLeft: 8,\r\n          fontSize: 12,\r\n          fontWeight: 600,\r\n          color: '#616161',\r\n        },\r\n        ' .ms-ContextualMenu-link': {\r\n          paddingLeft: 28,\r\n          fontSize: 14,\r\n          fontWeight: 400,\r\n          lineHeight: 20,\r\n        },\r\n      },\r\n    },\r\n  },\r\n\r\n  thirdPartyMeasurementVendorSettings: {\r\n    root: {\r\n      justifyContent: 'space-between',\r\n      alignItems: 'center',\r\n      ' .vendor-settings': {\r\n        ' .third-party-measurement-vendor': {\r\n          marginLeft: 10,\r\n          marginRight: 10,\r\n          paddingTop: 31,\r\n          ' .ms-TextField-field': {\r\n            width: 215,\r\n            height: 32,\r\n          },\r\n          ' label': {\r\n            fontWeight: 400,\r\n          },\r\n        },\r\n\r\n        ' .ispot-brand-id': {\r\n          marginLeft: 10,\r\n          marginRight: 10,\r\n          ' .ms-TextField-field': {\r\n            width: 215,\r\n            height: 32,\r\n          },\r\n          ' label': {\r\n            fontWeight: 400,\r\n          },\r\n        },\r\n        ' .account-linked-status': {\r\n          paddingTop: 30,\r\n        },\r\n      },\r\n      ' .third-party-measurement-remove-button': {\r\n        paddingTop: 30,\r\n      },\r\n    },\r\n  },\r\n\r\n  thirdPartyMeasurementRemoveButton: {\r\n    icon: { fontSize: 14, fontWeight: 400, color: '#424242' },\r\n    root: { verticalAlign: 'middle', marginRight: 27 },\r\n  },\r\n\r\n  warningMessageContainer: {\r\n    root: {\r\n      marginTop: 16,\r\n      padding: 8,\r\n    },\r\n  },\r\n\r\n  warningMessage: {\r\n    backgroundColor: '#F5F5F5',\r\n    border: '1px solid',\r\n    paddingInline: 12,\r\n    verticalAlign: 'middle',\r\n    borderRadius: 4,\r\n    borderColor: '#D1D1D1',\r\n    gap: 8,\r\n    height: 36,\r\n    icon: {\r\n      color: '#616161',\r\n      fontSize: 20,\r\n      height: 20,\r\n      width: 20,\r\n      fontWeight: 400,\r\n      marginTop: 2,\r\n    },\r\n  },\r\n\r\n  warningMessageText: {\r\n    root: {\r\n      fontWeight: 400,\r\n    },\r\n  },\r\n\r\n  label: options => ({\r\n    color: options.linked ? '#115EA3' : '#8A3707',\r\n    backgroundColor: options.linked ? '#EBF3FC' : '#FDCFB4',\r\n    borderColor: options.linked ? '#B4D6FA' : '#FFF9F5',\r\n    fontWeight: 600,\r\n    fontSize: 12,\r\n    border: '1px solid',\r\n    verticalAlign: 'middle',\r\n    borderRadius: 99,\r\n    height: 20,\r\n    minWidth: 24,\r\n    paddingInline: 5,\r\n    paddingTop: 1,\r\n    paddingBottom: 3,\r\n    marginLeft: 8,\r\n    marginRight: 8,\r\n  }),\r\n};\r\n","import React, { useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { Stack, Label, Icon } from '@bingads-webui-react/fabric-control';\r\nimport { thridPartyMeasurementTrackingStyles } from '../../styles/third-party-measurement-setting-styles';\r\n\r\nconst warningMessageDefaultSettings = {\r\n  iconName: 'InfoSolid',\r\n  tagName: _TL_('Note'),\r\n};\r\n\r\nexport const WarningMessage = (props) => {\r\n  const {\r\n    i18n,\r\n    message,\r\n    customSettings,\r\n    overrideStyles,\r\n  } = props;\r\n\r\n  const styles = useMemo(() => ({\r\n    ...thridPartyMeasurementTrackingStyles,\r\n    ...overrideStyles,\r\n  }), [overrideStyles]);\r\n\r\n  const settings = {\r\n    ...warningMessageDefaultSettings,\r\n    ...customSettings,\r\n  };\r\n\r\n  return (\r\n    <Stack\r\n      style={styles.warningMessage}\r\n      className=\"third-party-warning-message\"\r\n      horizontal\r\n      horizontalAlign=\"Left\"\r\n    >\r\n      <Icon\r\n        iconName={settings.iconName}\r\n        style={styles.warningMessage.icon}\r\n      />\r\n      <Label className=\"third-party-warning-tag-name\">\r\n        {i18n.getString(settings.tagName)}\r\n      </Label>\r\n      <Label className=\"third-party-warning-message-text\" styles={styles.warningMessageText}>\r\n        {message}\r\n      </Label>\r\n    </Stack>\r\n  );\r\n};\r\n\r\nWarningMessage.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  message: PropTypes.string.isRequired,\r\n  customSettings: PropTypes.shape({}),\r\n  overrideStyles: PropTypes.shape({}),\r\n};\r\n\r\nWarningMessage.defaultProps = {\r\n  customSettings: {},\r\n  overrideStyles: {},\r\n};\r\n\r\n","import React, { useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { Label } from '@bingads-webui-react/fabric-control';\r\nimport { thridPartyMeasurementTrackingStyles } from '../../styles/third-party-measurement-setting-styles';\r\n\r\nexport const AccountLinkedStatusLabel = ({ doubleVerifyLinkEstablished, i18n, overrideStyle }) => {\r\n  let statusMessage = i18n.getString(_TL_('Unknown  status'));\r\n  if (!doubleVerifyLinkEstablished) {\r\n    statusMessage = i18n.getString(_TL_('Not activated'));\r\n  } else {\r\n    statusMessage = i18n.getString(_TL_('Activated'));\r\n  }\r\n  const style = useMemo(() => ({\r\n    ...thridPartyMeasurementTrackingStyles.label({ linked: doubleVerifyLinkEstablished }),\r\n    ...overrideStyle,\r\n  }), [overrideStyle, doubleVerifyLinkEstablished]);\r\n\r\n  return (\r\n    <Label\r\n      style={style}\r\n      className={doubleVerifyLinkEstablished ? 'account-linked-status-label' : 'account-not-linked-status-label'}\r\n    >\r\n      {statusMessage}\r\n    </Label>\r\n  );\r\n};\r\n\r\nAccountLinkedStatusLabel.propTypes = {\r\n  doubleVerifyLinkEstablished: PropTypes.bool.isRequired,\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  overrideStyle: PropTypes.shape({}),\r\n};\r\n\r\nAccountLinkedStatusLabel.defaultProps = {\r\n  overrideStyle: {},\r\n};\r\n\r\n","import React from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { TextField, Stack, Label } from '@bingads-webui-react/fabric-control';\r\nimport { HelpPopupInline } from '@bingads-webui-react/help-popup';\r\nimport {\r\n  thirdPartyMeasurementTrackingVendorField,\r\n} from '../../model/campaign-third-party-vendor-setting';\r\nimport { AccountLinkedStatusLabel } from './account-linked-status-label';\r\n\r\nconst ISPOTConfig = ({ setting, i18n, setSetting }) => {\r\n  const onChangeBrandId = (e, value) => {\r\n    const updatedSetting = {\r\n      ..._.omit(setting, 'indexInSettings'),\r\n      [thirdPartyMeasurementTrackingVendorField.ISPOT_brandId]: value,\r\n    };\r\n    setSetting(updatedSetting);\r\n  };\r\n\r\n  const onRenderLabel = () => (\r\n    <Stack verticalAlign=\"center\" horizontal>\r\n      <Label>\r\n        {i18n.getString(_TL_('Brand ID'))}\r\n      </Label>\r\n      <HelpPopupInline topic=\"pop_BA_Measurement_BrandID\" />\r\n    </Stack>\r\n  );\r\n\r\n  return (\r\n    <TextField\r\n      className=\"ispot-brand-id\"\r\n      onRenderLabel={onRenderLabel}\r\n      value={_.get(setting, thirdPartyMeasurementTrackingVendorField.ISPOT_brandId, '')}\r\n      onChange={onChangeBrandId}\r\n      ariaLabel={i18n.getString(_TL_('ISPOT Brand ID input'))}\r\n      aria-required\r\n    />\r\n  );\r\n};\r\n\r\nconst DVConfig = ({ i18n, doubleVerifyLinkEstablished }) => (\r\n  <Stack\r\n    verticalAlign=\"center\"\r\n    horizontal\r\n    className=\"account-linked-status\"\r\n  >\r\n    <AccountLinkedStatusLabel\r\n      i18n={i18n}\r\n      doubleVerifyLinkEstablished={doubleVerifyLinkEstablished}\r\n    />\r\n    { doubleVerifyLinkEstablished ?\r\n      i18n.getString(_TL_('This measurement provider is activated for your account.'))\r\n      : i18n.getString(_TL_('This measurement provider isn’t activated for your account.'))\r\n    }\r\n  </Stack>\r\n);\r\n\r\nexport const customVendorConfigs = {\r\n  ISPOT: ISPOTConfig,\r\n  DV: DVConfig,\r\n};\r\n\r\nISPOTConfig.propTypes = {\r\n  setting: PropTypes.shape({}).isRequired,\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  setSetting: PropTypes.func.isRequired,\r\n};\r\n\r\nDVConfig.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  doubleVerifyLinkEstablished: PropTypes.bool.isRequired,\r\n};\r\n\r\n","import React, { useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { Stack, CommandButton, TextField } from '@bingads-webui-react/fabric-control';\r\n\r\nimport {\r\n  vendorNameKey,\r\n  campaignThirdPartyVendorNames,\r\n  campaignThirdPartyVendors,\r\n} from '../../model/campaign-third-party-vendor-setting';\r\nimport { thridPartyMeasurementTrackingStyles } from '../../styles/third-party-measurement-setting-styles';\r\nimport { WarningMessage } from './warning-message';\r\nimport { customVendorConfigs } from './custom-config';\r\n\r\nexport const ThirdPartyTrackingSetting = (props) => {\r\n  const {\r\n    i18n,\r\n    setting,\r\n    setSetting,\r\n    removeSetting,\r\n    overrideStyles,\r\n    doubleVerifyLinkEstablished,\r\n  } = props;\r\n\r\n  const styles = useMemo(() => ({\r\n    ...thridPartyMeasurementTrackingStyles,\r\n    ...overrideStyles,\r\n  }), [overrideStyles]);\r\n\r\n  const VendorConfig = customVendorConfigs[setting[vendorNameKey]];\r\n  const isiSPOTSetting = setting[vendorNameKey] === campaignThirdPartyVendors.ISPOT;\r\n\r\n  return (\r\n    <div>\r\n      <Stack\r\n        verticalAlign=\"center\"\r\n        horizontal\r\n        className=\"default-thirdparty-setting\"\r\n        styles={styles.thirdPartyMeasurementVendorSettings}\r\n      >\r\n        <Stack\r\n          verticalAlign=\"center\"\r\n          horizontal\r\n          className=\"vendor-settings\"\r\n        >\r\n          <TextField\r\n            className=\"third-party-measurement-vendor\"\r\n            readOnly\r\n            defaultValue={i18n.getString(campaignThirdPartyVendorNames[setting[vendorNameKey]])}\r\n          />\r\n          {VendorConfig &&\r\n            <VendorConfig\r\n              setting={setting}\r\n              i18n={i18n}\r\n              setSetting={setSetting}\r\n              doubleVerifyLinkEstablished={doubleVerifyLinkEstablished} // TODO: add api call to implement link status for DV\r\n            />}\r\n        </Stack>\r\n        <CommandButton\r\n          className=\"third-party-measurement-remove-button\"\r\n          onClick={removeSetting} // TODO: add vendor\r\n          iconProps={{ iconName: 'Delete' }}\r\n          styles={styles.thirdPartyMeasurementRemoveButton}\r\n          ariaLabel={i18n.getString(_TL_('Remove Vendor'))}\r\n        />\r\n      </Stack>\r\n      {isiSPOTSetting &&\r\n        <Stack styles={styles.warningMessageContainer}>\r\n          <WarningMessage\r\n            i18n={i18n}\r\n            message={i18n.getString(_TL_('This vendor only applies to U.S'))}\r\n          />\r\n        </Stack>\r\n      }\r\n    </div>\r\n  );\r\n};\r\n\r\nThirdPartyTrackingSetting.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  setting: PropTypes.shape({\r\n    [vendorNameKey]: PropTypes.string,\r\n  }).isRequired,\r\n  setSetting: PropTypes.func.isRequired,\r\n  removeSetting: PropTypes.func.isRequired,\r\n  overrideStyles: PropTypes.shape({}),\r\n  doubleVerifyLinkEstablished: PropTypes.bool,\r\n};\r\n\r\nThirdPartyTrackingSetting.defaultProps = {\r\n  overrideStyles: {},\r\n  doubleVerifyLinkEstablished: false,\r\n};\r\n\r\n","import React, { useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { Stack, CommandButton } from '@bingads-webui-react/fabric-control';\r\n\r\nimport { thridPartyMeasurementTrackingStyles } from '../../styles/third-party-measurement-setting-styles';\r\n\r\n\r\nexport const ThirdPartyTrackingRemoveAllButton = (props) => {\r\n  const {\r\n    i18n,\r\n    removeAllVendorSettings,\r\n    overrideStyles,\r\n  } = props;\r\n\r\n  const styles = useMemo(() => ({\r\n    ...thridPartyMeasurementTrackingStyles,\r\n    ...overrideStyles,\r\n  }), [overrideStyles]);\r\n\r\n  return (\r\n    <Stack\r\n      horizontalAlign=\"Right\"\r\n      verticalAlign=\"center\"\r\n      horizontal\r\n      className=\"third-party-measurement-remove-all-stack\"\r\n      styles={styles.thirdPartyMeasurementRemoveAllStack}\r\n    >\r\n      <CommandButton\r\n        className=\"third-party-measurement-remove-all-button\"\r\n        text={i18n.getString(_TL_('Remove All'))}\r\n        styles={styles.thirdPartyMeasurementRemoveAllButton}\r\n        onClick={removeAllVendorSettings}\r\n      />\r\n    </Stack>\r\n  );\r\n};\r\n\r\nThirdPartyTrackingRemoveAllButton.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  removeAllVendorSettings: PropTypes.func.isRequired,\r\n  overrideStyles: PropTypes.shape({}),\r\n};\r\n\r\nThirdPartyTrackingRemoveAllButton.defaultProps = {\r\n  overrideStyles: {},\r\n};\r\n","import React, { useState, useMemo, useEffect, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\n\r\nimport { HelpPopupInline } from '@bingads-webui-react/help-popup';\r\nimport { Stack, Label, CommandButton } from '@bingads-webui-react/fabric-control';\r\nimport {\r\n  ContextualMenuItemType,\r\n} from '@fluentui/react/lib/ContextualMenu';\r\nimport { withCustomValidation, withError } from '@bingads-webui-react/validation';\r\nimport { withControlErrorHandling, withUnvalidatedControlErrors } from '@bingads-webui-campaign-react/error-handling';\r\nimport { useAccountPropertyRepository } from './component/use-account-property-repository';\r\n\r\nimport {\r\n  campaignThirdPartyVendors,\r\n  vendorNameKey,\r\n  settingEnabledKey,\r\n  thirdPartySettingValidatorMap,\r\n  createVerifiedTrackingSettingViewModel,\r\n  reachVendors,\r\n  verificationVendors,\r\n  campaignThirdPartyVendorNames,\r\n  VerifiedTrackingSettingKey,\r\n  isVendorSelectedInSetting,\r\n} from '../model/campaign-third-party-vendor-setting';\r\n\r\nimport { ThirdPartyTrackingSetting } from './component/third-party-vendor-setting';\r\nimport { ThirdPartyTrackingRemoveAllButton } from './component/third-party-measurement-remove-all-button';\r\nimport { thridPartyMeasurementTrackingStyles } from '../styles/third-party-measurement-setting-styles';\r\n\r\nexport const formatVendorSettings = ({ verifiedTrackingSettingsValidationProps, i18n }) => {\r\n  const verifiedTrackingSettings = _.result(verifiedTrackingSettingsValidationProps, ['data', VerifiedTrackingSettingKey], []);\r\n  const isSettingsAllDisabled = settings => _.every(settings, setting => !_.get(setting, [settingEnabledKey], true));\r\n  const settingEmpty = _.isEmpty(verifiedTrackingSettings) || isSettingsAllDisabled(verifiedTrackingSettings);\r\n\r\n  const getVendorNames = (settings) => {\r\n    const validSettings = _.filter(settings, setting => _.get(setting, [settingEnabledKey], true));\r\n    const selectedVendors = _.map(validSettings, setting => _.get(setting, [vendorNameKey], ''));\r\n    const vendorNameArr = _.map(selectedVendors, vendor => i18n.getString(campaignThirdPartyVendorNames[vendor]));\r\n    return vendorNameArr.join(', ');\r\n  };\r\n\r\n  return (\r\n    <div white-space=\"pre\">\r\n      {\r\n        settingEmpty ?\r\n          i18n.getString(_TL_('No third-party vendor selected')) :\r\n          (\r\n            <div>\r\n              {i18n.getString(_TL_('Added: ')) + getVendorNames(verifiedTrackingSettings)}\r\n            </div>\r\n          )\r\n      }\r\n    </div>\r\n  );\r\n};\r\n\r\nexport const ThirdPartyMeasurementV3 = (props) => {\r\n  const {\r\n    i18n,\r\n    updateValidation,\r\n    validationProps,\r\n    overrideStyles,\r\n    IsMSANISPOTEnabled,\r\n    EnableDoubleVerify,\r\n    cid,\r\n    aid,\r\n  } = props;\r\n\r\n  const [doubleVerifyLinkEstablished] = useAccountPropertyRepository({ cid, aid });\r\n\r\n  const [settings, setSettings] = useState([]);\r\n  const styles = useMemo(() => ({\r\n    ...thridPartyMeasurementTrackingStyles,\r\n    ...overrideStyles,\r\n  }), [overrideStyles]);\r\n  const verifiedTrackingData = useMemo(\r\n    () => {\r\n      const data = _.result(validationProps, ['data'], null);\r\n      if (_.isNull(data)) {\r\n        return null;\r\n      }\r\n      return _.result(validationProps, ['data', VerifiedTrackingSettingKey], []);\r\n    }\r\n    , [validationProps]\r\n  );\r\n\r\n  // Set settings on initailization\r\n  useEffect(() => {\r\n    if (_.isNull(verifiedTrackingData) || _.isUndefined(verifiedTrackingData)) return;\r\n    const settingsToUpdate = [];\r\n    _.each(campaignThirdPartyVendors, (vendor) => {\r\n      const vendorData = verifiedTrackingData.find(setting => setting[vendorNameKey] === vendor);\r\n      if (!_.isEmpty(vendorData)) {\r\n        settingsToUpdate.push({\r\n          [settingEnabledKey]: true,\r\n          ...vendorData,\r\n        });\r\n      } else {\r\n        settingsToUpdate.push({\r\n          [settingEnabledKey]: false,\r\n          [vendorNameKey]: vendor,\r\n        });\r\n      }\r\n    });\r\n    setSettings(settingsToUpdate);\r\n  }, [verifiedTrackingData]);\r\n\r\n  // Update to outside when settings change and valiate\r\n  useEffect(() => {\r\n    if (_.isEmpty(settings)) {\r\n      return;\r\n    }\r\n    // Validate each vendor settings\r\n    const errorsToUpdate = [];\r\n    const validatedSettingsArray = [];\r\n    _.each(settings, (setting) => {\r\n      const vendor = setting[vendorNameKey];\r\n      if (_.isEmpty(vendor)) {\r\n        return;\r\n      }\r\n      let validatedVendorSetting = { [vendorNameKey]: vendor };\r\n      const settingEnabled = _.get(setting, [settingEnabledKey], false);\r\n      if (settingEnabled) {\r\n        // Validate each setting\r\n        if (_.isFunction(thirdPartySettingValidatorMap[vendor])) {\r\n          const currentVendorErrors = thirdPartySettingValidatorMap[vendor]({ setting, i18n });\r\n          if (!_.isEmpty(currentVendorErrors)) {\r\n            errorsToUpdate.push(...currentVendorErrors);\r\n          }\r\n        }\r\n        validatedVendorSetting = {\r\n          ...validatedVendorSetting,\r\n          ...setting,\r\n          [settingEnabledKey]: true,\r\n        };\r\n      } else {\r\n        validatedVendorSetting[settingEnabledKey] = false;\r\n      }\r\n      validatedSettingsArray.push(validatedVendorSetting);\r\n    });\r\n    // TODO: flatten the errors\r\n    updateValidation(errorsToUpdate, createVerifiedTrackingSettingViewModel(validatedSettingsArray));\r\n  }, [settings, updateValidation, i18n]);\r\n\r\n  const addSetting = useCallback((vendorName) => {\r\n    setSettings((originalSettings) => {\r\n      const updatedSettings = [];\r\n      let vendorFound = false;\r\n      _.each(originalSettings, (setting) => {\r\n        if (_.get(setting, [vendorNameKey], '') !== vendorName) {\r\n          updatedSettings.push({ ...setting });\r\n        } else {\r\n          // If already existing a vendor setting, enable it\r\n          updatedSettings.push({\r\n            ...setting,\r\n            [settingEnabledKey]: true,\r\n          });\r\n          vendorFound = true;\r\n        }\r\n      });\r\n\r\n      return vendorFound ? updatedSettings : [\r\n        ...updatedSettings,\r\n        {\r\n          [vendorNameKey]: vendorName,\r\n          [settingEnabledKey]: true,\r\n        },\r\n      ];\r\n    });\r\n  }, [setSettings]);\r\n\r\n  const removeSetting = useCallback((index) => {\r\n    setSettings((originalSettings) => {\r\n      const newSettings = [];\r\n      _.each(originalSettings, (setting, i) => {\r\n        if (i === index) {\r\n          newSettings.push({\r\n            ...setting,\r\n            [settingEnabledKey]: false,\r\n          });\r\n        } else {\r\n          newSettings.push({ ...setting });\r\n        }\r\n      });\r\n      return newSettings;\r\n    });\r\n  }, [setSettings]);\r\n\r\n  const removeAllVendorSettings = useCallback((vendorNameArr) => {\r\n    setSettings((originalSettings) => {\r\n      const newSettings = [];\r\n      _.each(originalSettings, (setting) => {\r\n        const currentVendorName = _.get(setting, [vendorNameKey], '');\r\n        if (_.includes(vendorNameArr, currentVendorName)) {\r\n          newSettings.push({\r\n            ...setting,\r\n            [settingEnabledKey]: false,\r\n          });\r\n        } else {\r\n          newSettings.push({ ...setting });\r\n        }\r\n      });\r\n      return newSettings;\r\n    });\r\n  }, []);\r\n\r\n  const setSetting = useCallback((index, updatedSetting) => {\r\n    setSettings(oldSettings => _.map(oldSettings, (s, i) => (i === index ? updatedSetting : s)));\r\n  }, [setSettings]);\r\n\r\n  const onRenderReachSettings = useCallback(() => {\r\n    const reachSettings = [];\r\n    _.each(settings, (setting, index) => {\r\n      if (_.get(setting, [settingEnabledKey], false) && _.contains(reachVendors, _.get(setting, [vendorNameKey], ''))) {\r\n        reachSettings.push({\r\n          ...setting,\r\n          indexInSettings: index,\r\n        });\r\n      }\r\n    });\r\n\r\n    if (_.isEmpty(reachSettings)) {\r\n      return null;\r\n    }\r\n\r\n    return (\r\n      <div className=\"third-party-reach-settings\">\r\n        <Stack verticalAlign=\"center\" horizontal className=\"third-party-measurement-reach-title\">\r\n          <Label>\r\n            {i18n.getString(_TL_('Reach'))}\r\n          </Label>\r\n        </Stack>\r\n        <ThirdPartyTrackingRemoveAllButton\r\n          i18n={i18n}\r\n          removeAllVendorSettings={() => removeAllVendorSettings(reachVendors)}\r\n        />\r\n        {reachSettings.map(setting => (\r\n          <ThirdPartyTrackingSetting\r\n            i18n={i18n}\r\n            setting={setting}\r\n            setSetting={updatedSetting => setSetting(setting.indexInSettings, updatedSetting)}\r\n            removeSetting={() => removeSetting(setting.indexInSettings)}\r\n          />\r\n        ))}\r\n      </div>\r\n    );\r\n  }, [settings, i18n, setSetting, removeSetting, removeAllVendorSettings]);\r\n\r\n  const onRenderVerificationSettings = useCallback(() => {\r\n    const verificationSettings = [];\r\n    _.each(settings, (setting, index) => {\r\n      if (_.get(setting, [settingEnabledKey], false) && _.contains(verificationVendors, _.get(setting, [vendorNameKey], ''))) {\r\n        verificationSettings.push({\r\n          ...setting,\r\n          indexInSettings: index,\r\n        });\r\n      }\r\n    });\r\n\r\n    if (_.isEmpty(verificationSettings)) {\r\n      return null;\r\n    }\r\n\r\n    return (\r\n      <div className=\"third-party-reach-settings\">\r\n        <Stack verticalAlign=\"center\" horizontal className=\"third-party-measurement-reach-title\">\r\n          <Label>\r\n            {i18n.getString(_TL_('Measurement provider'))}\r\n          </Label>\r\n          <HelpPopupInline topic=\"pop_BA_Measurement_Verification\" />\r\n        </Stack>\r\n        <ThirdPartyTrackingRemoveAllButton\r\n          i18n={i18n}\r\n          removeAllVendorSettings={() => removeAllVendorSettings(reachVendors)}\r\n        />\r\n        {verificationSettings.map(setting => (\r\n          <ThirdPartyTrackingSetting\r\n            i18n={i18n}\r\n            setting={setting}\r\n            setSetting={updatedSetting => setSetting(setting.indexInSettings, updatedSetting)}\r\n            removeSetting={() => removeSetting(setting.indexInSettings)}\r\n            doubleVerifyLinkEstablished={doubleVerifyLinkEstablished}\r\n          />\r\n        ))}\r\n      </div>\r\n    );\r\n  }, [settings, i18n, setSetting, removeSetting, removeAllVendorSettings, doubleVerifyLinkEstablished]);\r\n\r\n  const addVendorMenuProps = useMemo(() => {\r\n    const itemsToPush = [];\r\n    if (IsMSANISPOTEnabled) {\r\n      itemsToPush.push({ key: 'ReachAndIncrementalityHeader', text: i18n.getString(_TL_('Reach vendor')), itemType: ContextualMenuItemType.Header });\r\n      const ispotSelected = isVendorSelectedInSetting(settings, campaignThirdPartyVendors.ISPOT);\r\n      itemsToPush.push({\r\n        key: 'ISPOT', text: i18n.getString(_TL_('iSpot.tv')), onClick: () => addSetting(campaignThirdPartyVendors.ISPOT), disabled: ispotSelected,\r\n      });\r\n    }\r\n    if (IsMSANISPOTEnabled && EnableDoubleVerify) {\r\n      itemsToPush.push({ key: 'divider1', text: '-', itemType: ContextualMenuItemType.Divider });\r\n    }\r\n    if (EnableDoubleVerify) {\r\n      itemsToPush.push({ key: 'VerificationHeader', text: i18n.getString(_TL_('Verification vendor')), itemType: ContextualMenuItemType.Header });\r\n      const DVSelected = isVendorSelectedInSetting(settings, campaignThirdPartyVendors.DV);\r\n      itemsToPush.push({\r\n        key: 'DV', text: i18n.getString(_TL_('DoubleVerify')), onClick: () => addSetting(campaignThirdPartyVendors.DV), disabled: DVSelected,\r\n      });\r\n    }\r\n    return {\r\n      items: itemsToPush,\r\n      styles: styles.thirdPartyMeasurementAddButton.dropdown,\r\n      className: 'third-party-measurement-vendor-dropdown',\r\n    };\r\n  }, [i18n, addSetting, styles.thirdPartyMeasurementAddButton, IsMSANISPOTEnabled, EnableDoubleVerify, settings]);\r\n\r\n  return (\r\n    <div className=\"third-party-measurement-tile\">\r\n      {onRenderReachSettings()}\r\n      {onRenderVerificationSettings()}\r\n      <Stack verticalAlign=\"center\" horizontal>\r\n        <CommandButton\r\n          className=\"third-party-measurement-add-button\"\r\n          text={i18n.getString(_TL_('Add'))}\r\n          iconProps={{ iconName: 'Add' }}\r\n          menuProps={addVendorMenuProps}\r\n          styles={\r\n            styles.thirdPartyMeasurementAddButton\r\n          }\r\n        />\r\n      </Stack>\r\n    </div>\r\n  );\r\n};\r\n\r\nThirdPartyMeasurementV3.propTypes = {\r\n  i18n: PropTypes.shape({\r\n    getString: PropTypes.func.isRequired,\r\n  }).isRequired,\r\n  updateValidation: PropTypes.func.isRequired,\r\n  validationProps: PropTypes.shape({\r\n    data: PropTypes.shape({\r\n      VerifiedTrackingSettings: PropTypes.arrayOf(PropTypes.shape({})),\r\n    }),\r\n  }).isRequired,\r\n  overrideStyles: PropTypes.shape({}),\r\n  IsMSANISPOTEnabled: PropTypes.bool,\r\n  EnableDoubleVerify: PropTypes.bool,\r\n  cid: PropTypes.string.isRequired,\r\n  aid: PropTypes.string.isRequired,\r\n};\r\n\r\nThirdPartyMeasurementV3.defaultProps = {\r\n  overrideStyles: {},\r\n  IsMSANISPOTEnabled: false,\r\n  EnableDoubleVerify: false,\r\n};\r\n\r\nexport const ThirdPartyMeasurementV3WithValidation = withControlErrorHandling(withUnvalidatedControlErrors(withError(withCustomValidation(ThirdPartyMeasurementV3))));\r\n","import { useCallback, useEffect, useState } from 'react';\r\nimport { edmCampaign } from '@bingads-webui/edm-campaign';\r\n\r\nfunction useAccountPropertyRepository({ cid, aid }) {\r\n  const [enableDoubleVerifyForAllCampaigns, setEnableDoubleVerifyForAllCampaigns] = useState(false);\r\n  const [doubleVerifyLinkEstablished, setDoubleVerifyLinkEstablished] = useState(false);\r\n\r\n  const readAccount = useCallback(() => edmCampaign\r\n    .Customers.$withKey(cid)\r\n    .Accounts.$withKey(aid)\r\n    .get({ select: ['EnableDoubleVerifyForAllCampaigns,DoubleVerifyLinkEstablished'] })\r\n    .toPromise(), [aid, cid]);\r\n\r\n  useEffect(() => {\r\n    readAccount().then((account) => {\r\n      setEnableDoubleVerifyForAllCampaigns(account.EnableDoubleVerifyForAllCampaigns === 'true');\r\n      setDoubleVerifyLinkEstablished(account.DoubleVerifyLinkEstablished === '1');\r\n    }).catch((e) => {\r\n      throw e;\r\n    });\r\n  }, [readAccount]);\r\n\r\n  return [doubleVerifyLinkEstablished, enableDoubleVerifyForAllCampaigns];\r\n}\r\n\r\nexport { useAccountPropertyRepository };\r\n","import _ from 'underscore';\r\n\r\nexport const getVerifiedTrackingSettingWrite = (verifiedTrackingSettings = null) => {\r\n  if (_.isNull(verifiedTrackingSettings)) {\r\n    return {};\r\n  }\r\n\r\n  if (_.isEmpty(verifiedTrackingSettings)) {\r\n    return { VerifiedTrackingData: '' };\r\n  }\r\n\r\n  const results = [];\r\n  _.each(verifiedTrackingSettings, (setting) => {\r\n    const result = [];\r\n    if (setting.vendorName === 'DV') {\r\n      result.push({ Key: 'vendorName', Value: 'DV' });\r\n      if (setting.enabled === true) {\r\n        result.push({ Key: 'settings', Value: '' });\r\n      } else {\r\n        result.push({ Key: 'enabled', Value: 'false' });\r\n      }\r\n    } else {\r\n      _.mapObject(setting, (value, key) => {\r\n        result.push({ Key: key, Value: value });\r\n      });\r\n    }\r\n\r\n    results.push(result);\r\n  });\r\n\r\n  return { VerifiedTrackingData: JSON.stringify(results) };\r\n};\r\n\r\nexport const getVerifiedTrackingSettingsRead = (model, customKey = null) => {\r\n  const verifiedTrackingSettings = _.get(model, 'VerifiedTrackingSettings');\r\n\r\n  if (!verifiedTrackingSettings || verifiedTrackingSettings.length === 0) {\r\n    return {};\r\n  }\r\n  const results = [];\r\n\r\n  verifiedTrackingSettings.forEach((setting) => {\r\n    const vendor = _.get(setting, 'VerifiedTrackingVendor');\r\n\r\n    if (!_.isString(vendor)) {\r\n      return;\r\n    }\r\n\r\n    if (!_.isEqual(vendor, 'IAS') && !_.isEqual(vendor, 'DV') && !_.isEqual(vendor, 'ISPOT')) {\r\n      return;\r\n    }\r\n\r\n    const result = {};\r\n\r\n    result.vendorName = vendor;\r\n    if (_.isEqual(vendor, 'MOAT')) {\r\n      results.push(result);\r\n      return;\r\n    }\r\n\r\n    const data = _.get(setting, ['VerifiedTrackingData', 0, 'Data']);\r\n\r\n    if (!_.isObject(data) || _.isEmpty(data)) {\r\n      return;\r\n    }\r\n\r\n    const keys = _.get(data, 'Keys');\r\n\r\n    if (!_.isArray(keys) || _.isEmpty(keys)) {\r\n      return;\r\n    }\r\n\r\n    const values = _.get(data, 'Values');\r\n\r\n    if (!_.isArray(values) || _.isEmpty(values)) {\r\n      return;\r\n    }\r\n\r\n    const keyMap = {\r\n      IAS_advertiserEntityId: 'advertiserEntityId',\r\n      IAS_publisherEntityId: 'publisherEntityId',\r\n      ISPOT_brandId: 'brandId',\r\n    };\r\n\r\n    _.each(keys, (key, index) => {\r\n      if (keyMap[key]) {\r\n        result[keyMap[key]] = values[index];\r\n      }\r\n    });\r\n    results.push(result);\r\n  });\r\n\r\n  if (!_.isEmpty(customKey)) {\r\n    return { [customKey]: results };\r\n  }\r\n\r\n  return { VerifiedTrackingSettings: results };\r\n};\r\n\r\nexport const thirdPartyMeasurementStringToViewModel = (verifiedTrackingDataString = '') => {\r\n  if (_.isEmpty(verifiedTrackingDataString)) {\r\n    return [];\r\n  }\r\n\r\n  let thirdPartyMeasurementFromBulkModel = {};\r\n  try {\r\n    thirdPartyMeasurementFromBulkModel = JSON.parse(verifiedTrackingDataString);\r\n  } catch (e) {\r\n    console.log(e);\r\n    return [];\r\n  }\r\n\r\n  if (!_.isArray(thirdPartyMeasurementFromBulkModel) || thirdPartyMeasurementFromBulkModel.length === 0) {\r\n    return [];\r\n  }\r\n\r\n  const results = [];\r\n  thirdPartyMeasurementFromBulkModel.forEach((thirdPartyMeasurementSetting) => {\r\n    if (!_.isArray(thirdPartyMeasurementSetting)) {\r\n      return;\r\n    }\r\n    const result = {};\r\n    _.each(thirdPartyMeasurementSetting, (setting) => {\r\n      result[setting.Key] = setting.Value;\r\n    });\r\n\r\n    results.push(result);\r\n  });\r\n\r\n  return results;\r\n};\r\n","import { ComponentSettings } from '@bingads-webui-theme-2018/theme-fluent';\r\n\r\nexport const getThumbsUpDownStyles = (components, { palette = {} } = {}) => ({ // eslint-disable-line no-unused-vars, max-len\r\n  thumbsUpDown: {\r\n    display: 'inline-block',\r\n    position: 'absolute',\r\n    right: 24,\r\n    bottom: 16,\r\n  },\r\n  thumbsUpDownAddImage: {\r\n    display: 'inline-block',\r\n    position: 'absolute',\r\n    bottom: 16,\r\n    right: (window.innerWidth) - 1059,\r\n    // 1059 is hardcoded width of add-image panel in image-experience\r\n  },\r\n  label: {\r\n    marginRight: 8,\r\n    display: 'inline-block',\r\n  },\r\n  calloutRoot: {\r\n    '& .blocker-image': {\r\n      ...ComponentSettings.getBlockerStyle(14, palette),\r\n      display: 'inline-block',\r\n    },\r\n    '& .blocker-text': {\r\n      display: 'inline-block',\r\n    },\r\n  },\r\n});\r\n","export const getFeedbackFormStyles = (components, { palette = {} } = {}) => ({ // eslint-disable-line no-unused-vars, max-len\r\n  checkboxOptions: {\r\n    marginBottom: 19,\r\n  },\r\n  feedbackAction: {\r\n    float: 'right',\r\n  },\r\n  feedbackFormRoot: {\r\n    overflow: 'hidden',\r\n  },\r\n});\r\n","import React, { useState, useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport _ from 'underscore';\r\n\r\nimport {\r\n  Text,\r\n  Checkbox,\r\n  TextField,\r\n  DefaultButton,\r\n  PrimaryButton,\r\n  Link,\r\n} from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { ReactTemplate } from '@bingads-webui-react/react-template';\r\nimport { Glyphicon } from '@bingads-webui-react/primitive';\r\n\r\nimport { getFeedbackFormStyles } from './styles/feedback-form';\r\n\r\nexport const FeedbackForm = ({\r\n  onSubmit,\r\n  onDismiss,\r\n  options,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n  const initialOptionsState = _.reduce(options, (memo, { key }) => ({\r\n    ...memo,\r\n    [key]: false,\r\n  }), {});\r\n  const [optionsState, setOptionsState] = useState(initialOptionsState);\r\n  const [screenshotState, setScreenshotState] = useState(false);\r\n  const [commentState, setCommentState] = useState('');\r\n  const [enableSubmit, setEnableSubmit] = useState(false);\r\n  const classes = useDefaultStyles(getFeedbackFormStyles);\r\n\r\n  return (\r\n    <div className={classnames(classes.feedbackFormRoot, 'feedback-form-root')}>\r\n      <Text className=\"title\" block variant=\"large\" styles={{ root: { marginBottom: 12 } }}>\r\n        {i18n.getString(_TL_('Feedback to Microsoft'))}\r\n      </Text>\r\n      <Text className=\"info\" block variant=\"medium\" styles={{ root: { marginBottom: 12 } }}>\r\n        {i18n.getString(_TL_('Please select from the below possible issues if applicable'))}\r\n      </Text>\r\n      <div className={classnames(classes.checkboxOptions, 'checkboxOptions')}>\r\n        {\r\n          _.map(options, ({ label, key }) => (\r\n            <Checkbox\r\n              label={label}\r\n              checked={optionsState[key]}\r\n              onChange={(e, checked) => {\r\n                setOptionsState(prev => ({\r\n                  ...prev,\r\n                  [key]: checked,\r\n                }));\r\n\r\n                if (checked) {\r\n                  if (!enableSubmit) {\r\n                    setEnableSubmit(true);\r\n                  }\r\n                } else {\r\n                  const otherValues = _.values(_.omit(optionsState, key));\r\n\r\n                  if (!_.some(otherValues, _.identity)) {\r\n                    setEnableSubmit(false);\r\n                  }\r\n                }\r\n              }}\r\n            />\r\n          ))\r\n        }\r\n      </div>\r\n      <TextField\r\n        label={i18n.getString(_TL_('Tell us more'))}\r\n        className=\"comment-field\"\r\n        value={commentState}\r\n        onChange={(e, newValue) => setCommentState(newValue)}\r\n        multiline\r\n        styles={{\r\n          root: {\r\n            marginBottom: 24,\r\n          },\r\n        }}\r\n        placeholder={i18n.getString(_TL_('Add a comment'))}\r\n      />\r\n      <Checkbox\r\n        label={i18n.getString(_TL_('Include a screenshot'))}\r\n        className=\"screenshotOption\"\r\n        checked={screenshotState}\r\n        onChange={(e, checked) => setScreenshotState(checked)}\r\n        styles={{\r\n          root: {\r\n            marginBottom: 20,\r\n          },\r\n        }}\r\n      />\r\n\r\n      <Text className=\"disclaimer\" block variant=\"small\" styles={{ root: { marginBottom: 20 } }}>\r\n        <ReactTemplate\r\n          model={{\r\n            a: text => (\r\n              <Link\r\n                href=\"https://go.microsoft.com/fwlink/?LinkId=521839\"\r\n                className={classnames(classes.infoText)}\r\n                target=\"_blank\"\r\n              >\r\n                {`${text} `}\r\n                <Glyphicon glyph=\"ba-OpenInNewWindow\" />\r\n              </Link>\r\n            ),\r\n          }}\r\n          template={\r\n            i18n.getString(_TL_('To improve service we\\'ll receive some information about your account and device. For more details, please refer to the {{a}}Microsoft privacy statement{{/a}}.'))\r\n          }\r\n        />\r\n      </Text>\r\n\r\n      <div className={classes.feedbackAction}>\r\n        <PrimaryButton\r\n          className=\"submit\"\r\n          text={i18n.getString(_TL_('Submit feedback'))}\r\n          onClick={() => onSubmit({\r\n            options: optionsState,\r\n            comments: commentState,\r\n            takeScreenshot: screenshotState,\r\n          })}\r\n          disabled={!enableSubmit || !commentState}\r\n          styles={{\r\n            root: {\r\n              marginRight: 8,\r\n            },\r\n          }}\r\n        />\r\n        <DefaultButton\r\n          className=\"close-feedback\"\r\n          text={i18n.getString(_TL_('Close'))}\r\n          onClick={onDismiss}\r\n        />\r\n      </div>\r\n    </div>\r\n  );\r\n};\r\n\r\nFeedbackForm.propTypes = {\r\n  onSubmit: PropTypes.func.isRequired,\r\n  onDismiss: PropTypes.func.isRequired,\r\n  options: PropTypes.arrayOf(PropTypes.shape({\r\n    label: PropTypes.string,\r\n    key: PropTypes.string,\r\n  })).isRequired,\r\n};\r\n\r\nFeedbackForm.defaultProps = {\r\n};\r\n","import React from 'react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nconst getIconStyles = () => ({\r\n  icon: {\r\n    marginBottom: 8,\r\n    '& svg': {\r\n      display: 'block',\r\n      margin: 'auto',\r\n    },\r\n  },\r\n});\r\n\r\nexport const ThankYouIcon = () => {\r\n  const classes = useDefaultStyles(getIconStyles);\r\n\r\n  return (\r\n    <div className={classes.icon}>\r\n      <svg width=\"86\" height=\"83\" viewBox=\"0 0 86 83\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n        <path d=\"M21.546 47.509C20.9314 45.215 22.2927 42.8572 24.5866 42.2425L71.427 29.6917C73.7209 29.077 76.0788 30.4383 76.6934 32.7322L78.6949 40.2018L23.5475 54.9785L21.546 47.509Z\" fill=\"url(#paint0_linear_4454_142615)\" />\r\n        <path d=\"M34.3517 44.5623C34.0662 43.4967 34.6986 42.4013 35.7642 42.1158L61.0718 35.3347C62.1374 35.0491 63.2327 35.6815 63.5182 36.7471C63.8037 37.8127 63.1714 38.908 62.1057 39.1936L36.7981 45.9747C35.7325 46.2602 34.6372 45.6279 34.3517 44.5623Z\" fill=\"url(#paint1_linear_4454_142615)\" />\r\n        <path d=\"M23.532 54.957L78.7229 40.1687L85.1549 64.1732C85.7696 66.4671 84.4083 68.825 82.1144 69.4396L35.2304 82.0021C32.9365 82.6168 30.5786 81.2555 29.964 78.9616L23.532 54.957Z\" fill=\"#0086F0\" />\r\n        <path d=\"M9.17221 59.817C9.47402 59.0071 10.5598 58.8664 11.058 59.5728L12.3184 61.3597C12.5106 61.6321 12.8182 61.8 13.1512 61.8141L15.336 61.9071C16.1995 61.9438 16.6688 62.933 16.151 63.6251L14.841 65.376C14.6413 65.6429 14.5767 65.9874 14.6662 66.3085L15.2529 68.415C15.4848 69.2477 14.6891 69.9997 13.8708 69.7211L11.8008 69.0163C11.4852 68.9088 11.1377 68.9538 10.86 69.1381L9.03782 70.3471C8.31757 70.825 7.35647 70.3005 7.36859 69.4362L7.39925 67.2497C7.40392 66.9164 7.25372 66.5998 6.99262 66.3926L5.27974 65.0332C4.60269 64.4959 4.80446 63.4198 5.63018 63.1642L7.71917 62.5177C8.0376 62.4192 8.2923 62.1785 8.40868 61.8661L9.17221 59.817Z\" fill=\"#45B4FF\" />\r\n        <path d=\"M14.7359 46.1399C15.2968 45.8148 15.9925 46.251 15.9442 46.8975L15.8696 47.8969C15.851 48.1462 15.9491 48.3901 16.1352 48.557L16.8811 49.2264C17.3636 49.6593 17.1637 50.4558 16.534 50.6096L15.5604 50.8475C15.3175 50.9069 15.1159 51.0755 15.0147 51.304L14.6086 52.2203C14.3459 52.813 13.5267 52.869 13.1857 52.3176L12.6586 51.4652C12.5272 51.2526 12.3045 51.113 12.0558 51.0873L11.0589 50.9842C10.4141 50.9175 10.1076 50.1557 10.5267 49.6611L11.1745 48.8964C11.3361 48.7056 11.4001 48.4507 11.3477 48.2062L11.1376 47.2263C11.0018 46.5924 11.6316 46.0655 12.2315 46.3112L13.159 46.691C13.3903 46.7858 13.6525 46.7678 13.8688 46.6425L14.7359 46.1399Z\" fill=\"#AFDFFF\" />\r\n        <path d=\"M5.59847 33.2415C6.15934 32.9164 6.85506 33.3526 6.80679 33.999L6.73217 34.9985C6.71355 35.2478 6.81164 35.4916 6.99771 35.6586L7.74363 36.3279C8.22612 36.7609 8.02626 37.5573 7.39651 37.7112L6.42294 37.9491C6.18009 38.0084 5.9785 38.1771 5.8772 38.4056L5.47112 39.3219C5.20844 39.9145 4.3892 39.9706 4.04827 39.4192L3.52119 38.5668C3.38972 38.3541 3.16704 38.2145 2.91837 38.1888L1.92147 38.0857C1.27664 38.0191 0.970181 37.2573 1.38922 36.7626L2.03704 35.9979C2.19864 35.8072 2.2626 35.5523 2.21021 35.3078L2.00018 34.3279C1.86433 33.694 2.49416 33.1671 3.09408 33.4128L4.02153 33.7926C4.25288 33.8873 4.51509 33.8694 4.73138 33.744L5.59847 33.2415Z\" fill=\"#0086F0\" />\r\n        <path d=\"M43.6641 23.1776L23.8601 36.253C23.8601 36.253 21.2528 30.0985 15.0985 25.4048C8.94422 20.7111 0.0154372 17.8086 0.0154372 17.8086L19.8194 4.73317C19.8194 4.73317 27.5278 6.54121 34.2527 11.3963C40.9776 16.2514 43.6641 23.1776 43.6641 23.1776Z\" fill=\"url(#paint2_linear_4454_142615)\" />\r\n        <path d=\"M50.4271 29.0226L30.5026 38.5229C30.5026 38.5229 29.6774 33.3539 25.372 27.6047C21.0666 21.8555 13.8383 16.0394 13.8383 16.0394L34.073 6.13624C34.073 6.13624 40.4568 9.50201 45.2364 15.5056C50.016 21.5092 50.4271 29.0226 50.4271 29.0226Z\" fill=\"url(#paint3_linear_4454_142615)\" />\r\n        <path d=\"M54.1749 12.1125L29.3833 18.75L36.9889 45.8893L61.7805 39.2519L54.1749 12.1125Z\" fill=\"#FCFCFB\" />\r\n        <path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M64.2841 58.0751C62.9321 53.0295 57.7458 50.0351 52.7001 51.3871C47.6545 52.7391 44.6601 57.9254 46.0121 62.9711C47.3641 68.0168 52.5504 71.0111 57.5961 69.6591C62.6418 68.3071 65.6361 63.1208 64.2841 58.0751ZM58.2764 55.536C58.5066 55.2213 58.9418 55.1241 59.2872 55.3235C59.6572 55.5372 59.784 56.0103 59.5704 56.3804L54.7563 64.7187L54.7102 64.7894C54.48 65.1041 54.0448 65.2013 53.6994 65.0019L50.2883 63.0325L50.2175 62.9864C49.9029 62.7562 49.8057 62.321 50.0051 61.9756C50.2187 61.6056 50.6919 61.4788 51.0619 61.6924L53.8031 63.275L58.2304 55.6067L58.2764 55.536Z\" fill=\"white\" />\r\n        <path d=\"M82.4064 14.5841C83.2289 14.8498 83.4175 15.9283 82.7339 16.4573L81.0044 17.7955C80.7408 17.9995 80.5867 18.3142 80.5873 18.6476L80.5911 20.8343C80.5926 21.6987 79.6252 22.2112 78.9108 21.7246L77.1037 20.4933C76.8282 20.3056 76.4812 20.2563 76.1644 20.3599L74.0859 21.0393C73.2643 21.3078 72.4778 20.5461 72.7199 19.7163L73.3325 17.6171C73.4259 17.2971 73.3655 16.9519 73.1691 16.6826L71.8807 14.9157C71.3714 14.2173 71.8528 13.234 72.7168 13.2079L74.9025 13.1417C75.2357 13.1317 75.5454 12.9676 75.7408 12.6976L77.0231 10.9262C77.5299 10.2261 78.6139 10.38 78.9057 11.1936L79.6441 13.252C79.7566 13.5657 80.0083 13.8095 80.3255 13.912L82.4064 14.5841Z\" fill=\"#AFDFFF\" />\r\n        <path d=\"M64.8201 6.08284C65.568 5.64939 66.4956 6.23099 66.4312 7.09295L66.4044 7.45263C66.3795 7.78504 66.5103 8.11015 66.7584 8.33277L67.0269 8.57367C67.6702 9.15095 67.4037 10.2129 66.564 10.418L66.2137 10.5037C65.8899 10.5828 65.6211 10.8076 65.486 11.1124L65.3399 11.4421C64.9896 12.2323 63.8973 12.3071 63.4427 11.5719L63.253 11.2651C63.0777 10.9816 62.7808 10.7954 62.4493 10.7612L62.0905 10.7241C61.2307 10.6352 60.8221 9.61941 61.3808 8.9599L61.614 8.68469C61.8294 8.43036 61.9147 8.09047 61.8449 7.76454L61.7693 7.41186C61.5881 6.56669 62.4279 5.86419 63.2278 6.19176L63.5616 6.32846C63.8701 6.45478 64.2197 6.43086 64.5081 6.26371L64.8201 6.08284Z\" fill=\"#45B4FF\" />\r\n        <defs>\r\n          <linearGradient id=\"paint0_linear_4454_142615\" x1=\"48.0068\" y1=\"35.9671\" x2=\"51.1212\" y2=\"47.5902\" gradientUnits=\"userSpaceOnUse\">\r\n            <stop stopColor=\"#45B4FF\" />\r\n            <stop offset=\"1\" stopColor=\"#0E6EE0\" />\r\n          </linearGradient>\r\n          <linearGradient id=\"paint1_linear_4454_142615\" x1=\"48.418\" y1=\"38.7252\" x2=\"49.4519\" y2=\"42.5841\" gradientUnits=\"userSpaceOnUse\">\r\n            <stop stopColor=\"#1273E2\" />\r\n            <stop offset=\"1\" stopColor=\"#1457A6\" />\r\n          </linearGradient>\r\n          <linearGradient id=\"paint2_linear_4454_142615\" x1=\"29.5061\" y1=\"24.0667\" x2=\"9.75418\" y2=\"11.792\" gradientUnits=\"userSpaceOnUse\">\r\n            <stop stopColor=\"#E1DFDD\" />\r\n            <stop offset=\"1\" stopColor=\"#F6F5F4\" />\r\n          </linearGradient>\r\n          <linearGradient id=\"paint3_linear_4454_142615\" x1=\"40.2674\" y1=\"27.4728\" x2=\"24.5004\" y2=\"17.2155\" gradientUnits=\"userSpaceOnUse\">\r\n            <stop stopColor=\"#E1DFDD\" />\r\n            <stop offset=\"0.5953\" stopColor=\"#F6F5F4\" />\r\n            <stop offset=\"1\" stopColor=\"white\" />\r\n          </linearGradient>\r\n        </defs>\r\n      </svg>\r\n    </div>\r\n  );\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport {\r\n  Text,\r\n  DefaultButton,\r\n} from '@bingads-webui-react/fabric-control';\r\n\r\nimport { ThankYouIcon } from './styles/thank-you-icon';\r\n\r\nexport const ThankYouContent = ({\r\n  onDismiss,\r\n}) => {\r\n  const i18n = useContext(I18nContext);\r\n\r\n  return (\r\n    <div className=\"thank-you-content-root\">\r\n      <ThankYouIcon />\r\n      <Text block variant=\"large\" styles={{ root: { marginBottom: 8 } }}>\r\n        {i18n.getString(_TL_('Thanks!'))}\r\n      </Text>\r\n      <Text block variant=\"medium\" styles={{ root: { marginBottom: 20 } }}>\r\n        {i18n.getString(_TL_('We appreciate your feedback.'))}\r\n      </Text>\r\n      <DefaultButton\r\n        className=\"close-button\"\r\n        text={i18n.getString(_TL_('Close'))}\r\n        onClick={onDismiss}\r\n        styles={{\r\n          root: {\r\n            float: 'right',\r\n          },\r\n        }}\r\n      />\r\n    </div>\r\n  );\r\n};\r\n\r\nThankYouContent.propTypes = {\r\n  onDismiss: PropTypes.func.isRequired,\r\n};\r\nThankYouContent.defaultProps = {\r\n\r\n};\r\n","import html2canvas from 'html2canvas';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { stringifySync } from '@bingads-webui/safe-json';\r\nimport { OCVDataService } from '@bingads-webui-react/feedback-panel';\r\n\r\nclass ThumbsUpDownOCVDataService extends OCVDataService {\r\n  checkCompliance() {\r\n    return true;\r\n  }\r\n}\r\n\r\nconst defaultTestAppId = 50025;\r\nconst defaultAppId = 2482;\r\n\r\nconst serializeComments = ({ comments, options }) => `UserComments:${comments};;FormOptions:${stringifySync(options)}`;\r\n\r\nexport const sendFeedbackInternal = ({\r\n  formOptions,\r\n  featureArea,\r\n  onFinishTakeScreenshot,\r\n  onFinishSendRequest,\r\n  isTestEnv,\r\n  dataService,\r\n}) => {\r\n  const clientFeedbackId = uuidv4();\r\n  const serializedComments = serializeComments(formOptions);\r\n\r\n  const feedback = {\r\n    type: 'Frown',\r\n    comment: serializedComments,\r\n    complianceChecks: {\r\n      authenticationType: 'MSA',\r\n      ageGroup: 'Adult',\r\n    },\r\n  };\r\n\r\n  const telemetry = {\r\n    featureArea,\r\n  };\r\n\r\n  let screenshotGenerationPromise;\r\n\r\n  if (formOptions.takeScreenshot) {\r\n    screenshotGenerationPromise = html2canvas(document.body, {\r\n      foreignObjectRendering: true,\r\n      logging: false,\r\n    })\r\n      .then(canvas => canvas.toDataURL('image/jpeg'))\r\n      .then((data) => {\r\n        onFinishTakeScreenshot();\r\n        return data;\r\n      });\r\n  }\r\n\r\n  dataService.sendFeedback({\r\n    feedback,\r\n    telemetry,\r\n    screenshotGenerationPromise,\r\n    onSuccess: onFinishSendRequest,\r\n    onError: onFinishSendRequest,\r\n    appId: isTestEnv ? defaultTestAppId : defaultAppId,\r\n    clientFeedbackId,\r\n    isTestEnv,\r\n  });\r\n};\r\n\r\n\r\nexport const sendFeedback = ({\r\n  formOptions,\r\n  featureArea,\r\n  onFinishTakeScreenshot,\r\n  onFinishSendRequest,\r\n  isTestEnv,\r\n}) => {\r\n  const dataService = new ThumbsUpDownOCVDataService();\r\n\r\n  sendFeedbackInternal({\r\n    formOptions,\r\n    featureArea,\r\n    onFinishTakeScreenshot,\r\n    onFinishSendRequest,\r\n    isTestEnv,\r\n    dataService,\r\n  });\r\n};\r\n","import React, { useState, useContext, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport _ from 'underscore';\r\n\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { Callout, IconButton, DirectionalHint } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { UiBlocker } from '@bingads-webui-react/ui-blocker';\r\n\r\nimport { getThumbsUpDownStyles } from './styles/thumbs-up-down';\r\nimport { FeedbackForm } from './feedback-form';\r\nimport { ThankYouContent } from './thank-you-content';\r\nimport { sendFeedback } from './ocv-data-source';\r\n\r\nexport const ThumbsUpDown = ({\r\n  onThumbsUpSignal,\r\n  onThumbsDownSignal,\r\n  featureArea,\r\n  isTestEnv,\r\n  containerName,\r\n}) => {\r\n  const classes = useDefaultStyles(getThumbsUpDownStyles);\r\n  const i18n = useContext(I18nContext);\r\n\r\n  const [thumbsUpSelected, setThumbsUpSelected] = useState(false);\r\n  const [thumbsDownSelected, setThumbsDownSelected] = useState(false);\r\n  const [showFeedback, setShowFeedback] = useState(true);\r\n  const [showThumbsUpThankYouContent, setShowThumbsUpThankYouContent] = useState(false);\r\n  const [showThumbsDownThankYouContent, setShowThumbsDownThankYouContent] = useState(false);\r\n  const [showBlocker, setShowBlocker] = useState(false);\r\n  const [blockerText, setBlockerText] = useState(i18n.getString(_TL_('Loading...')));\r\n  const [formOptionsInternal, setFormOptionsInternal] = useState(null);\r\n  const [hasOngoingRequest, setHasOngoingRequest] = useState(false);\r\n\r\n\r\n  const options = [{\r\n    label: i18n.getString(_TL_('Issues with images extracted from my website')),\r\n    key: 'websiteImages',\r\n  }, {\r\n    label: i18n.getString(_TL_('Issues with smart effects & cropping')),\r\n    key: 'smartEffects',\r\n  }, {\r\n    label: i18n.getString(_TL_('Other')),\r\n    key: 'other',\r\n  }];\r\n\r\n  useEffect(() => {\r\n    if (showBlocker && !hasOngoingRequest) {\r\n      setHasOngoingRequest(true);\r\n\r\n      sendFeedback({\r\n        formOptions: formOptionsInternal,\r\n        featureArea,\r\n        onFinishTakeScreenshot: () => {\r\n          setBlockerText(i18n.getString(_TL_('Loading...')));\r\n        },\r\n        onFinishSendRequest: () => {\r\n          setShowBlocker(false);\r\n          setShowFeedback(false);\r\n          setHasOngoingRequest(false);\r\n          setFormOptionsInternal(null);\r\n          setShowThumbsDownThankYouContent(true);\r\n        },\r\n        isTestEnv,\r\n      });\r\n    }\r\n  }, [\r\n    setHasOngoingRequest,\r\n    showBlocker,\r\n    setShowBlocker,\r\n    setShowFeedback,\r\n    hasOngoingRequest,\r\n    setFormOptionsInternal,\r\n    setShowThumbsUpThankYouContent,\r\n    featureArea,\r\n    isTestEnv,\r\n    formOptionsInternal,\r\n    setBlockerText,\r\n    i18n,\r\n  ]);\r\n\r\n  return (\r\n    <div className={classnames(classes[containerName], 'thumbs-up-down-root')}>\r\n      <div className={classes.label}>\r\n        {i18n.getString(_TL_('Leave feedback'))}\r\n      </div>\r\n      <IconButton\r\n        ariaLabel={i18n.getString(_TL_('Thumbs up'))}\r\n        iconProps={{ iconName: 'Like' }}\r\n        styles={{\r\n          root: {\r\n            background: thumbsUpSelected ? '#605E5C' : '#F3F2F1',\r\n            borderRadius: 99,\r\n          },\r\n          rootHovered: {\r\n            background: '#106ebeff',\r\n          },\r\n          iconHovered: {\r\n            color: '#FFFFFF',\r\n          },\r\n          icon: {\r\n            color: thumbsUpSelected ? '#FFFFFF' : '#323130',\r\n          },\r\n        }}\r\n        id=\"thumbsUpButton\"\r\n        onClick={() => {\r\n          const newThumbsUpState = !thumbsUpSelected;\r\n\r\n          setThumbsUpSelected(newThumbsUpState);\r\n          setShowThumbsUpThankYouContent(newThumbsUpState);\r\n          setThumbsDownSelected(false);\r\n\r\n          if (newThumbsUpState === true) {\r\n            onThumbsUpSignal();\r\n          }\r\n        }}\r\n      >\r\n        {\r\n          showThumbsUpThankYouContent && (\r\n            <Callout\r\n              target=\"#thumbsUpButton\"\r\n              directionalHint={DirectionalHint.bottomRightEdge}\r\n              styles={{\r\n                calloutMain: {\r\n                  margin: '20px 24px',\r\n                  maxWidth: 380,\r\n                },\r\n              }}\r\n            >\r\n              <ThankYouContent\r\n                onDismiss={() => setShowThumbsUpThankYouContent(false)}\r\n              />\r\n            </Callout>\r\n          )\r\n        }\r\n      </IconButton>\r\n      <IconButton\r\n        ariaLabel={i18n.getString(_TL_('Thumbs down'))}\r\n        id=\"thumbsDownButton\"\r\n        iconProps={{ iconName: 'Dislike' }}\r\n        styles={{\r\n          root: {\r\n            background: thumbsDownSelected ? '#605E5C' : '#F3F2F1',\r\n            borderRadius: 99,\r\n          },\r\n          rootHovered: {\r\n            background: '#106ebeff',\r\n          },\r\n          iconHovered: {\r\n            color: '#FFFFFF',\r\n          },\r\n          icon: {\r\n            color: thumbsDownSelected ? '#FFFFFF' : '#323130',\r\n          },\r\n        }}\r\n        onClick={() => {\r\n          const newThumbsDownState = !thumbsDownSelected;\r\n\r\n          setThumbsDownSelected(newThumbsDownState);\r\n          setThumbsUpSelected(false);\r\n          setShowFeedback(newThumbsDownState);\r\n          setShowThumbsUpThankYouContent(false);\r\n          if (newThumbsDownState === true) {\r\n            onThumbsDownSignal();\r\n          } else {\r\n            setShowThumbsDownThankYouContent(false);\r\n          }\r\n        }}\r\n      >\r\n        {\r\n          thumbsDownSelected && (showFeedback || showThumbsDownThankYouContent) && (\r\n            <Callout\r\n              className={classes.calloutRoot}\r\n              target=\"#thumbsDownButton\"\r\n              directionalHint={DirectionalHint.bottomRightEdge}\r\n              styles={{\r\n                calloutMain: {\r\n                  margin: '20px 24px',\r\n                  maxWidth: 380,\r\n                },\r\n              }}\r\n            >\r\n              <UiBlocker\r\n                blocking={showBlocker}\r\n                loadingText={blockerText}\r\n              >\r\n                {\r\n                  showFeedback ? (\r\n                    <FeedbackForm\r\n                      onSubmit={(formOptions) => {\r\n                        setShowBlocker(true);\r\n                        setFormOptionsInternal(formOptions);\r\n\r\n                        if (formOptions.takeScreenshot) {\r\n                          setBlockerText(i18n.getString(_TL_('Taking screenshot...')));\r\n                        }\r\n                      }}\r\n                      options={options}\r\n                      onDismiss={() => {\r\n                        setShowFeedback(false);\r\n                        setShowThumbsDownThankYouContent(false);\r\n                      }}\r\n                    />\r\n                  ) : (\r\n                    <ThankYouContent\r\n                      onDismiss={() => setShowThumbsDownThankYouContent(false)}\r\n                    />\r\n                  )\r\n                }\r\n              </UiBlocker>\r\n            </Callout>\r\n          )\r\n        }\r\n      </IconButton>\r\n    </div>\r\n  );\r\n};\r\n\r\nThumbsUpDown.propTypes = {\r\n  featureArea: PropTypes.string.isRequired,\r\n  isTestEnv: PropTypes.bool.isRequired,\r\n  onThumbsUpSignal: PropTypes.func,\r\n  onThumbsDownSignal: PropTypes.func,\r\n  containerName: PropTypes.string,\r\n};\r\n\r\nThumbsUpDown.defaultProps = {\r\n  onThumbsUpSignal: _.noop,\r\n  onThumbsDownSignal: _.noop,\r\n  containerName: 'thumbsUpDown',\r\n};\r\n","import _, { each, extend, find, isFunction, noop } from 'underscore';\r\nimport $ from 'jquery';\r\n\r\nfunction findIdInToolbarSubMenu(id, toolbarItem) {\r\n  return find(toolbarItem.menu && toolbarItem.menu.items, menuItem => id === menuItem.id);\r\n}\r\n\r\n// toolbar item may appear in both selected & unselected, such as inline chart\r\nclass ToolbarEditor {\r\n  constructor(options) {\r\n    const { overrideWith, toolbarConfig, updateToolbar } = options;\r\n\r\n    extend(this, {\r\n      overrideWith,\r\n      toolbarConfig,\r\n      updateToolbar,\r\n      $,\r\n    });\r\n  }\r\n\r\n  update = (value) => {\r\n    const toolbarConfigs = ['toolbarSelectedConfig', 'toolbarUnselectedConfig'];\r\n    const { id } = value;\r\n\r\n    let hasAnyToolbarBeenUpdated = false;\r\n\r\n    each(toolbarConfigs, (configName) => {\r\n      let hasBeenUpdated = false;\r\n      const toolbarConfig = this.toolbarConfig[configName];\r\n      if (!toolbarConfig) {\r\n        return;\r\n      }\r\n\r\n      if (toolbarConfig.has(id)) {\r\n        toolbarConfig.set(id, extend(toolbarConfig.get(id), value));\r\n        hasBeenUpdated = true;\r\n      }\r\n\r\n      if (!hasBeenUpdated) {\r\n        toolbarConfig.forEach((config, key) => {\r\n          const subMenu = findIdInToolbarSubMenu(id, config);\r\n\r\n          if (subMenu) {\r\n            extend(subMenu, value);\r\n            toolbarConfig.set(key, extend({}, config));\r\n            hasBeenUpdated = true;\r\n          }\r\n        });\r\n      }\r\n\r\n      hasAnyToolbarBeenUpdated = hasBeenUpdated || hasAnyToolbarBeenUpdated;\r\n    });\r\n\r\n    if (hasAnyToolbarBeenUpdated && isFunction(this.updateToolbar)) {\r\n      this.updateToolbar();\r\n    }\r\n  }\r\n\r\n  get(id) {\r\n    const toolbarConfigs = ['toolbarSelectedConfig', 'toolbarUnselectedConfig'];\r\n    let foundConfig = null;\r\n\r\n    each(toolbarConfigs, (configName) => {\r\n      if (!foundConfig) {\r\n        if (this.toolbarConfig[configName].has(id)) {\r\n          foundConfig = this.toolbarConfig[configName].get(id);\r\n        }\r\n\r\n        if (!foundConfig) {\r\n          this.toolbarConfig[configName].forEach((config) => {\r\n            const subMenu = findIdInToolbarSubMenu(id, config);\r\n            if (subMenu) {\r\n              foundConfig = subMenu;\r\n            }\r\n          });\r\n        }\r\n      }\r\n    });\r\n\r\n    return foundConfig;\r\n  }\r\n\r\n  overrideWith(view) {\r\n    if (this.overrideWith) {\r\n      // pass plugin form view to tab wrapper\r\n      this.overrideWith(view);\r\n    }\r\n  }\r\n\r\n  set(id, value) {\r\n    this.update(_.defaults({ id }, value));\r\n  }\r\n\r\n  restoreToolbar() {\r\n    noop();\r\n  }\r\n}\r\n\r\nexport function getToolbarEditor({ overrideWith, toolbarConfig, updateToolbar }) {\r\n  return new ToolbarEditor({\r\n    overrideWith,\r\n    toolbarConfig,\r\n    updateToolbar,\r\n  });\r\n}\r\n\r\nexport function getToolbarPlugin({\r\n  overrideWith,\r\n  resetVisibility,\r\n  toolbarConfig,\r\n  resetGraphVisibility,\r\n  resetToolbarMode,\r\n  updateToolbarDynamicSelectedConfig,\r\n  updateToolbar,\r\n}) {\r\n  return {\r\n    plugin: definePlugin => definePlugin('toolbar', ['gridView'], (gridView) => {\r\n      gridView.on('didSelect', () => {\r\n        const selectedRowCount = gridView.selectedItems().length;\r\n        const showToolbarSelected = selectedRowCount > 0;\r\n        const showToolbarUnselected = selectedRowCount === 0;\r\n        resetToolbarMode({\r\n          showToolbarSelected,\r\n          showToolbarUnselected,\r\n        });\r\n        if (showToolbarSelected && isFunction(toolbarConfig.toolbarDynamicSelectedConfigCallback)) {\r\n          const dynamicSelectedConfig = toolbarConfig.toolbarDynamicSelectedConfigCallback({ gridView });\r\n          updateToolbarDynamicSelectedConfig({\r\n            dynamicSelectedConfig,\r\n          });\r\n        }\r\n      });\r\n\r\n      const resetVisibilityAndTriggerUpdate = (...options) => {\r\n        resetVisibility(...options);\r\n        gridView.trigger('didUpdate');\r\n      };\r\n\r\n      const toolbarEditor = getToolbarEditor({ overrideWith, toolbarConfig, updateToolbar });\r\n\r\n      return {\r\n        gridToolbarGroup: {\r\n          toolbarNames: () => [],\r\n          toolbarWithItem: () => toolbarEditor,\r\n          toolbarWithName: () => toolbarEditor,\r\n          hideAllToolbars: () => {\r\n            resetVisibilityAndTriggerUpdate({\r\n              forceHideToolbar: true,\r\n            });\r\n          },\r\n          showAllToolbars: () => {\r\n            resetVisibilityAndTriggerUpdate({\r\n              forceHideToolbar: false,\r\n            });\r\n\r\n            if (_.isFunction(resetGraphVisibility)) {\r\n              resetGraphVisibility();\r\n            }\r\n          },\r\n          updateGridView: noop,\r\n          remove: noop,\r\n        },\r\n      };\r\n    }),\r\n  };\r\n}\r\n","export const DiagnosticsTypes = {\r\n  Issue: 'Issue',\r\n  Recommendation: 'Recommendation',\r\n};\r\n","import React, { useCallback, useContext } from 'react';\r\nimport {\r\n  Button,\r\n  Link,\r\n  Text,\r\n  makeStyles,\r\n  mergeClasses,\r\n  tokens,\r\n  shorthands,\r\n} from '@fluentui/react-components';\r\nimport { MessageBar, MessageBarActions, MessageBarBody, MessageBarTitle } from '@fluentui/react-message-bar';\r\nimport { LightbulbFilamentFilled, WarningFilled } from '@fluentui/react-icons';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\n\r\nimport { DiagnosticsTypes } from './constants';\r\nimport { DiagnosticBarProps } from './types';\r\n\r\nconst useDiagnosticsBarStyles = makeStyles({\r\n  messageBar: {\r\n    marginTop: '8px',\r\n    '&.recommendation-bar': {\r\n      backgroundColor: tokens.colorBrandBackground2,\r\n      ...shorthands.borderColor(tokens.colorBrandBackground2Pressed),\r\n    },\r\n  },\r\n  messageBarBody: {\r\n    whiteSpace: 'normal',\r\n    paddingTop: '8px',\r\n    paddingBottom: '8px',\r\n    '& > span': {\r\n      marginRight: '8px',\r\n    },\r\n  },\r\n  messageBarAction: {\r\n    alignSelf: 'center',\r\n  },\r\n  iconIssue: {\r\n    color: tokens.colorStatusWarningForeground1,\r\n  },\r\n  iconRecommendation: {\r\n    color: tokens.colorNeutralForeground2BrandHover,\r\n  },\r\n});\r\n\r\nexport function DiagnosticBar({ itemList, type, onActionClick }: DiagnosticBarProps) {\r\n  const classes = useDiagnosticsBarStyles();\r\n  const i18n = useContext(I18nContext) as any;\r\n\r\n  const renderActions = useCallback((item) => {\r\n    if (!item.actions) return null;\r\n    const actionButtons = item.actions.map((action) => {\r\n      const onButtonClick = () => onActionClick({ action, item });\r\n      return (\r\n        <Button className=\"action-button\" size=\"small\" onClick={onButtonClick}>\r\n          <Text weight=\"bold\">\r\n            {i18n.getString(action.text)}\r\n          </Text>\r\n        </Button>\r\n      );\r\n    });\r\n    return actionButtons;\r\n  }, [onActionClick, i18n]);\r\n\r\n  return (\r\n    <>\r\n      {itemList.map(item => (\r\n        <MessageBar\r\n          className={mergeClasses(classes.messageBar, type === DiagnosticsTypes.Recommendation ? 'recommendation-bar' : 'issue-bar', 'message-bar', item.locator)}\r\n          icon={\r\n            type === DiagnosticsTypes.Recommendation\r\n              ? <LightbulbFilamentFilled className={classes.iconRecommendation} />\r\n              : <WarningFilled className={classes.iconIssue} />\r\n          }\r\n          intent={type === DiagnosticsTypes.Recommendation ? 'info' : 'warning'}\r\n          layout=\"singleline\"\r\n        >\r\n          <MessageBarBody className={mergeClasses(classes.messageBarBody, 'message-body')}>\r\n            <MessageBarTitle>{i18n.getString(item.title)}</MessageBarTitle>\r\n            <span>{i18n.getString(item.description)}</span>\r\n            {item.link && <Link href={item.link.url} target=\"blank\">{i18n.getString(item.link.text)}</Link>}\r\n          </MessageBarBody>\r\n          <MessageBarActions className={classes.messageBarAction}>\r\n            {renderActions(item)}\r\n          </MessageBarActions>\r\n        </MessageBar>\r\n      ))}\r\n    </>\r\n  );\r\n}\r\n\r\nDiagnosticBar.defaultProps = {\r\n  itemList: [],\r\n  type: DiagnosticsTypes.Issue,\r\n};\r\n","import _ from 'underscore';\r\nimport React, { useContext, useMemo } from 'react';\r\nimport { Badge, Text, makeStyles, shorthands, mergeClasses } from '@fluentui/react-components';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { Collapse, ValidatedPanel, collapseExpander, getPanelErrorProps, useCollapseState } from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { DiagnosticsTypes } from './constants';\r\nimport { DiagnosticBar } from './diagnostic-bar';\r\nimport { SummaryDiagnosticProps } from './types';\r\n\r\nconst useDiagnosticsSectionStyles = makeStyles({\r\n  diagnosticsSection: {\r\n    maxWidth: '928px',\r\n    '& .collapse-panel': {\r\n      ...shorthands.borderRadius('6px'),\r\n    },\r\n    '& .collapse-title-bar': {\r\n      minHeight: 'fit-content',\r\n      ...shorthands.padding('12px', '0px'),\r\n    },\r\n  },\r\n  header: {\r\n    display: 'flex',\r\n    flexDirection: 'row',\r\n    ...shorthands.gap('8px'),\r\n    alignItems: 'center',\r\n  },\r\n});\r\n\r\nexport function SummaryDiagnostic({ issues, recommendations, onActionClick }: SummaryDiagnosticProps) {\r\n  const classes = useDiagnosticsSectionStyles();\r\n  const i18n = useContext(I18nContext) as any;\r\n\r\n  const [\r\n    diagnosticsSection,\r\n    diagnosticsExpandedSection,\r\n    setDiagnosticsExpandedSection,\r\n  ] = useCollapseState(\r\n    ['issues', 'recommendations'] /* all sections */,\r\n    ['issues', 'recommendations'] /* initially expanded sections */\r\n  );\r\n  const diagnosticsSectionExpand = useMemo(\r\n    () => collapseExpander({ setActiveKeys: setDiagnosticsExpandedSection }),\r\n    [setDiagnosticsExpandedSection]\r\n  );\r\n\r\n  return (\r\n    <Collapse className={mergeClasses(classes.diagnosticsSection, 'diagnostics-section')} allPanelItems={diagnosticsSection} checkItems skipItemsTypeCheck activeKeys={diagnosticsExpandedSection} setActiveKeys={setDiagnosticsExpandedSection}>\r\n      {issues.length > 0 && (\r\n        <ValidatedPanel\r\n          key=\"issues\"\r\n          title={\r\n            <div className={mergeClasses(classes.header, 'issue-panel')}>\r\n              <Text weight=\"bold\" size={400} className=\"title\">{i18n.getString(_TL_('Campaign issues'))}</Text>\r\n              <Badge className={mergeClasses('issue-badge', 'count')} shape=\"rounded\" appearance=\"tint\" color=\"informative\" size=\"large\">\r\n                {issues.length === 1 ? i18n.getString(_TL_('1 issue')) : i18n.getString(_TL_('{{count}} issues'), { count: `${issues.length}` })}\r\n              </Badge>\r\n            </div>\r\n          }\r\n          attentionBeaconProps={{ getExtraProps: getPanelErrorProps }}\r\n          actuationProps={{\r\n            expand: diagnosticsSectionExpand,\r\n            expandKey: 'issues',\r\n          }}\r\n        >\r\n          <Text className=\"description\">{i18n.getString(_TL_('Fix the issues that are preventing your campaign from running smoothly.'))}</Text>\r\n          <DiagnosticBar itemList={issues} type={DiagnosticsTypes.Issue} onActionClick={onActionClick} />\r\n        </ValidatedPanel>\r\n      )}\r\n      {recommendations.length > 0 && (\r\n        <ValidatedPanel\r\n          key=\"recommendations\"\r\n          title={\r\n            <div className={mergeClasses(classes.header, 'recommendation-panel')}>\r\n              <Text weight=\"bold\" size={400} className=\"title\">{i18n.getString(_TL_('Recommendations'))}</Text>\r\n              <Badge className={mergeClasses('recommendation-badge', 'count')} shape=\"rounded\" appearance=\"tint\" color=\"informative\" size=\"large\">\r\n                {recommendations.length === 1 ? i18n.getString(_TL_('1 recommendation')) : i18n.getString(_TL_('{{count}} recommendations'), { count: `${recommendations.length}` })}\r\n              </Badge>\r\n            </div>\r\n          }\r\n          attentionBeaconProps={{ getExtraProps: getPanelErrorProps }}\r\n          actuationProps={{\r\n            expand: diagnosticsSectionExpand,\r\n            expandKey: 'recommendations',\r\n          }}\r\n        >\r\n          <Text className=\"description\">{i18n.getString(_TL_(\"Improve your campaign's performance by adopting these recommendations.\"))}</Text>\r\n          <DiagnosticBar itemList={recommendations} type={DiagnosticsTypes.Recommendation} onActionClick={onActionClick} />\r\n        </ValidatedPanel>\r\n      )}\r\n    </Collapse>\r\n  );\r\n}\r\n\r\nSummaryDiagnostic.defaultProps = {\r\n  issues: [],\r\n  recommendations: [],\r\n  onActionClick: _.noop,\r\n};\r\n","export const isTagetCpaHigherThanBudget = (i18n, budgetAmount, cpa) => cpa && budgetAmount && i18n && i18n.parseDecimal(String(budgetAmount)) < cpa;\r\n\r\nexport const getLogString = (checkValue, budgetAmount, cpa, scenario, onSave) => `[TargetCpaValueCheck][${scenario}] TargetCpaValue warning, flow: ${onSave ? 'OnSave' : 'OnEdit'} checkValue: ${checkValue}, budget: ${budgetAmount}, cpa:  ${cpa}`;\r\n","import { isTagetCpaHigherThanBudget, getLogString } from './utils';\r\n\r\nexport const LogTargetCpaCheckOnSave = (i18n, permissions, budgetAmount, cpa, activity, scenario) => {\r\n  if (permissions?.dynamic?.TargetCpaValueCheck) {\r\n    const checkValue = isTagetCpaHigherThanBudget(i18n, budgetAmount, cpa);\r\n    activity.trace(getLogString(checkValue, budgetAmount, cpa, scenario, true));\r\n  }\r\n};\r\n","import React, { useContext, useMemo } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { withPermissions } from '@bingads-webui-react/hoc-with-permissions';\r\nimport { MessageBar, MessageBarBody } from '@fluentui/react-message-bar';\r\n\r\nimport { isTagetCpaHigherThanBudget, getLogString } from './utils';\r\n\r\nexport const TargetCpaWarningBannerInternal = ({\r\n  budgetAmount,\r\n  cpa,\r\n  activity,\r\n  scenario,\r\n  permissions,\r\n  isSignup, // Remove this prop once TargetCpaValueCheck pilot check is cleaned up\r\n}: {\r\n  budgetAmount: number,\r\n  cpa: number,\r\n  activity: { trace: Function },\r\n  scenario: string,\r\n  permissions: { dynamic: { TargetCpaValueCheck: boolean } },\r\n  isSignup?: boolean,\r\n}) => {\r\n  const i18n: any = useContext(I18nContext);\r\n\r\n  const tcpaCheckEnabled = permissions?.dynamic?.TargetCpaValueCheck || isSignup;\r\n\r\n  const shouldShowBanner = useMemo(() => {\r\n    const checkValue = isTagetCpaHigherThanBudget(i18n, budgetAmount, cpa);\r\n    activity.trace(getLogString(checkValue, budgetAmount, cpa, scenario, false));\r\n    return checkValue;\r\n  }, [activity, budgetAmount, cpa, i18n, scenario]);\r\n\r\n  return (\r\n    tcpaCheckEnabled && shouldShowBanner ? (\r\n      <MessageBar\r\n        intent=\"warning\"\r\n        className=\"target-cpa-warning-banner\"\r\n        style={{\r\n          minHeight: '32px',\r\n          width: '100%',\r\n          wordBreak: 'break-word',\r\n          marginTop: '12px',\r\n        }}\r\n      >\r\n        <MessageBarBody>\r\n          {i18n.getString(_TL_('Your campaign\\'s total cost per acquisition is higher than the daily budget, which could prevent you from receiving any conversions. Please consider lowering your total cost per acquisition or raising your daily budget.'))}\r\n        </MessageBarBody>\r\n      </MessageBar>\r\n    ) : null\r\n  );\r\n};\r\n\r\nTargetCpaWarningBannerInternal.defaultProps = {\r\n  isSignup: false,\r\n};\r\n\r\nexport const TargetCpaWarningBanner = withPermissions(TargetCpaWarningBannerInternal);\r\n"],"names":["useImpulse","activate","_useState","useState","_useState2","_slicedToArray","isActive","setIsActive","_useState3","_useState4","isRestarting","setIsRestarting","useEffect","useIsMounted","isMountedRef","useRef","current","BudgetRange","_bingads_webui_static_legacy_page_context","LegacyBudgetWithCustomValidation","_ref","campaignId","showBudgetSuggestion","isCampaignSetting","currency","validationProps","updateValidation","campaign","isPremiumStreaming","restProps","_objectWithoutProperties","_excluded","data","i18n","useContext","I18nContext","activity","ActivityContext","DailyRange","budgetSuggestion","useMemo","Currency","GlobalMaximumBudget","DailyBudget","CeilingValue","GlobalMinimumBudget","FloorValue","onChange","useCallback","newData","newIsValid","getString","_TL_","Budget","signal","concat","JSON","stringify","Amount","budgetSuggestionData","setBudgetSuggestionData","loadBudget","useBudgetSuggestionRepository","mode","MODE","EDITING","campaignType","CampaignTypes","PerformanceMax","assetGroup","then","datas","finally","_jsxs","children","className","style","marginBottom","fontWeight","_jsx","Text","HelpPopup","topic","item","LegacyBudget","_objectSpread","level","budget","_","BudgetSuggestionDialog","onBudgetChange","minBudget","maxBudget","defaultProps","ValidatedLegacyBudget","withCustomValidation","getConversionGoalStyles","theme","ConversionGoalSelectorContainer","paginationStyle","width","ConversionGoalsWithCustomValidation","conversionGoalsData","_conversionGoalsData$","conversionGoals","classes","useDefaultStyles","legacyI18n","buildLegacyI18n","ConversionGoalKeyToStringMapping","$dataRange","useP$DaterangeDefault","changedData","isEqual","campaignConversionGoal","Goals","originalConversionGoals","goalScopeSelection","LearnMoreLink","linkText","ConversionGoalSelector","isSelectorEnabled","pageSize","isMultiMode","isHideSaveBar","goalSelection","activityLogger","showTrackingStatusIcon","ValidatedConversionGoals","cid","aid","GoalSelector","open","value","isCreationWorkflow","ValidatedConversionGoalsScopeSelector","withError","withValidation","TextField","getStyles","_ref$palette","palette","productOptions","padding","buttonContainer","marginTop","fontSize","color","themePrimary","marginRight","paddingBottom","merchantCenterAccountContainer","productFilterEditContainer","stackContainerToken","childrenGap","ListingGroupsWithCustomValidation","props","scope","campaignSettings","siteMap","listingGroup","storeDetails","assetGroupId","onClickNavigateToListingGroups","_useTreeViewPanelSele","useTreeViewPanelSelector","setAllRowRawData","identity","currentCampaign","Id","CampaignSettings","refreshGridData","getArguemntsOfUpdateGridDataByCurrentState","isTreeViewSelectorOpen","setIsTreeViewSelectorOpen","treeViewSelectorColumns","treeViewSelectorDimensions","treeViewSelectorInitialSelectedItems","treeViewSelectorItems","treeViewSelectorHeaderText","onTreeViewCancel","onTreeViewSelectedDimensionChangeWithoutStatistics","isTreeViewShimmerEnabled","onFilterProduct","listingGroupGridData","useAPIsOfListingGroup","options","key","text","isEditing","values","items","length","selectedOption","setSelectedOption","selectedProducts","setSelectedProducts","_useState5","operand","_useState6","selectedOperand","setSelectedOperand","_useState7","_useState8","productFilter","setProductFilter","selectedDimension","forEach","selectedItem","fillDataToBulkAddedItem","onOpenPanel","onDeleteProduct","index","splice","_toConsumableArray","navigateToListingGroupPage","save","getRoutePathById","onChangeOptions","option","hasSelectedProducts","hasSelectedOperand","updatedListingGroup","dataRange","useDateRange","queryOptions","$top","entityPath","accountId","customerId","payload","gridDataParameters","DateRange","StartDate","EndDate","_ref2","Condition","Operand","uid","classNames","DefaultButton","onClick","ChoiceGroup","selectedKey","ariaLabel","filterProductsPreview","Stack","horizontal","wrap","disableShrink","tokens","pluck","map","SelectedItem","itemText","itemIndex","onDelete","Glyphicon","glyph","PanelSelector","getErrors","isOpen","columns","dimensions","headerText","initialSelectedItems","onCancel","onSave","onSelectedDimensionChange","enableShimmer","keyOfItem","isBulkAddEnabledForDimension","d","isBulkAddEnabled","undefined","ValidatedListingGroups","withCampaignSiteMap","withScope","withStoreFromProviderId","LocationTargetSettingWithCustomValidation","skipValidation","allowBidAdjustment","dealInfo","locationTargets","errors","isLocationValid","LocationTargetSetting","setData","ValidatedLocationTargetSetting","getTargetingStyles","container","maxWidth","marginLeft","paddingLeft","header","getLocationTargetingStyles","campaignLocationCriterions","anyComp","entityIs","ERROR_ENTITY","CampaignLocation","CampaignRadius","CampaignNegativeLocation","CampaignLocationIntent","ServerValidatedLocationTargetSetting","withControlErrorHandling","withUnvalidatedControlErrors","filter","LocationTargetingSettingPanel","ScopeContext","isLoading","expand","_props$data","topicKey","rest","ValidatedPanel","title","TextTitle","titleKey","icon","LocationImg","details","getLocationTargetTitleDetails","BiddingScheme","Type","attentionBeaconProps","getExtraProps","getPanelErrorProps","actuationProps","expandKey","SectionShimmer","LocationTargeting","bidStrategyType","DisplayBiddingStrategyType","AudienceWizardWithShimmer","withShimmer","AudienceWizard","AudienceSignalShimmer","AudienceSignalPanel","serverContext","ServerContext","DynamicPermissions","Permissions","_scope$values","permissions","dynamic","isReadOnlyUser","IsReadOnlyUser","CurrentAccount","Status","AudienceGroup","OriginalAudienceGroup","ValidatedFixedPanel","AudienceImg","showShimmer","audienceGroup","originalAudienceGroup","campaignTrackingUrlTemplate","propertyIs","campaignFinalUrlSuffix","campaignUrlCustomParameters","trackingUrlTemplateControlsWrapper","compose","partial","Adapter","StandardControlAdapter","finalUrlSuffixControlsWrapper","urlCustomParametersControlsWrapper","functionsToInject","withProps","ValidatedUrlOptionsParameters","VideoPanel","perfMarker","mergedI18n","videos","_ref$setSelectedVideo","setSelectedVideoId","noop","selectedVideoId","allAssetsExpand","isVideoRequired","skipQualityValidation","PermissionsContext","oDataConfig","getODataConfig","videoTypesWithOrder","videosContainer","videoAd","ValidatedVideoExperience","multiVideoMode","allowedVideoSizes","disableRemoveAll","hideRatioLabel","videoExperienceCircleUploadType","disableUploadTextField","videoPickerContainerHeight","setSelectedVideoIdx","selectedVideoIdx","copilotEnabled","iconAltText","ImageListSummaryCardDetails","isLogos","isVideos","PANEL_KEYS","VIDEOS","limit","getTheme","getStepBaseLayoutFooterStyles","styleOverrides","arguments","merge","footerContainer","clear","borderTop","neutralLight","paddingTop","previousButton","previousButtonOnTheRightOfNext","cancelButton","skippingLink","textDecoration","baseLayoutFooterStyles","stepProgress","root","neutralPrimary","StepFooter","onCancelClick","onPreviousClick","onNextClick","nextButtonText","previousButtonAfterNext","previousButtonText","cancelButtonText","onSkippingLinkClick","skippingLinkTitle","onRenderFooterNote","isPreviousClickDisabled","isNextClickDisabled","isSkipLinkDisabled","stepProgressContent","disabled","PrimaryButton","stepProgressContainer","variant","block","styles","Link","getBaseStepLayoutStyles","stepContainer","height","display","flexDirection","stepContentContainer","overflowY","backgroundColor","neutralLighterAlt","mainSide","StepBaseLayout","stepContainerClassName","stepContentContainerClassName","mainSideClassName","onRenderRightSide","isHideFooter","getBaseModalFooterStyles","stepModalFooterContainer","justifyContent","position","bottom","actionsContainer","defaultButton","skipLink","baseModalFooterStyles","StepModalFooter","isPreviousDisabled","primaryButton","neutralDark","useOnceEffect","callFn","called","setCalled","WIZARD_EVENT_PREFIX","WIZARD_STEP_EVENT","APP_LOAD","START_FLOW","SWITCH_FLOW","ENTER_PAGE","COMPLETE","SINGLE_STEP_EVENT","USER_TRIGGER_STEP_EVENT","_defineProperty","STEP_STATES","GOING_NEXT","GOING_BACK","EXITING","USER_TRIGGER_STEP_EVENT_KEYS","Object","keys","NoOpContext","logComplete","changedChannel","enteredPage","StepFlowContext","React","DEFAULT_EVENT_VALUE","useLogEnteredPage","Flow","_ref$SubFlow","SubFlow","Page","StepFlowProvider","shouldPost","postEventLog","instrumentation","InstrumentationContext","stepFlowScenario","create","stepFlow","trace","error","triggerPostEventLog","shouldPostLog","_useStateWithPrevious","initialValue","state","setState","cache","newValue","prev","useStateWithPrevious","_useStateWithPrevious2","_useStateWithPrevious3","setContext","prevContext","eventValues","postEventLogRef","postEvent","EventName","EventValue","logValidationError","message","Complete","CID","AID","FromFlow","ToFlow","FromPage","ToPage","Provider","BasicStepLogger","flow","subflow","propTypes","PropTypes","isRequired","StepLogger","stepToPage","useWizardService","currentStepId","getCurrentStepId","WizardStepLogger","writeLog","matchStepSubState","wizardState","stepSubState","stateArr","toStrings","includes","SingleStepLogger","Date","now","startTime","setStartTime","useFormService","matches","FORM_STATES","LOADING","isSaveSucceeded","SAVING_SUCCEEDED","isSaveFailed","SAVING_FAILED","trigger","setTrigger","triggerKey","triggerWriteLog","duration","WizardEvents","STEP_LOADING","STEP_SAVING","STEP_DONE_LOADING","STEP_DONE_SAVING","STEP_DONE_CANCELING","STEP_FAILED_LOADING","STEP_ABORTED_SAVING","STEP_ABORTED_CANCELING","STEP_STOPPED","NAVIGATE_BACK","NAVIGATE_NEXT","CANCEL","EXIT","StepEvents","SAVE","DONE_SAVING","FAILED_SAVING","DONE_LOADING","FAILED_LOADING","ACTIVATE","DEACTIVATE","UPDATE_VALIDATION","STOP","DONE_STOPPING","OVERRIDE_ACTIONS","OVERRIDE_GUARDS","logF","argsSerializer","msg","_console","_len3","args","Array","_key3","console","log","apply","_len2","_key2","logAction","_len","_key","_len5","_key5","context","event","id","stateLoggingListener","machine","WizardStates","stepIndexSelector","stepIndex","stepServicesCacheSelector","stepServicesCache","isBusySelector","wasSavingSelector","wasWaitingForConfirmationSelector","wasStoppingSelector","getStepInfo","stepList","getStepServiceRef","defaultActions","acquireStepService","assign","stepInfo","stepService","stepServiceNeedsActivation","extendedStepMachine","StepMachine","StepMachineOptions","stepsData","spawn","stopStep","send","to","activateStep","type","deactivateStep","notifyStepToSave","notifyStepToCancel","setNavigatingForward","navigatingTo","setNavigatingBack","setExiting","isExiting","applyNavigation","resetNavigation","notifyDone","isFunction","onDone","patchStepsData","defaultServices","defaultGuards","isFirstStep","isNotNavigating","isNumber","doesServiceNeedActivation","canNavigateBackWithoutSaving","getStartingState","machineId","wizardOptions","_wizardOptions$onDone","wizardStateMachine","_ref$machineId","_ref$actions","actions","_ref$services","services","_ref$guards","guards","createMachine","preserveActionOrder","predictableActionArguments","strict","initial","states","entry","always","target","cond","on","StepStates","isCanceling","isStopping","isFin","isFailedInit","isSaving","contextSelector","defaultInitialContext","actionsOverride","guardsOverride","isValid","isDirty","invalidSaveAttempt","hasIncomingSystemError","needsSaving","replaceData","replaceStepsData","patchData","onInvalidSaveAttempt","overrideActions","overrideGuards","notifyLoading","sendParent","notifyDoneLoading","notifyFailedLoading","notifySaving","notifyDoneSaving","notifyDoneCanceling","notifyAbortedSaving","notifyAbortedCanceling","notifyStopped","clearErrors","requestConfirmation","Promise","resolve","reject","delay","response","aborted","confirmCancel","needsLoading","needsStopping","stepStateMachine","_states","_ref$initialContext","initialContext","invoke","src","onError","xstateStateMachine","StepComponent","formStyle","border","getWizardStyles","components","spinnerKeyframe","hidden","show","uiBlockerAdapter","mergeStyles","reactUIBlockerStyle","flexGrow","wizardContainer","convertToLocalStyle","helpbuttonStyle","glyphIconStyle","wizardListContainer","minWidth","borderRight","neutralQuaternaryAlt","overflow","margin","listStyle","borderLeft","blue","borderLeftColor","float","white","background","transform","lineHeight","wizardMainContainer","wizardStepContainer","wizardSingleStepLayoutStepScrollingContainer","wizardSingleStepLayoutCenteredStepContainer","wizardSingleStepLayoutStepContainer","wizardStep","flexBasis","paddingRight","wizardFooter","mobileNavContainer","zIndex","boxShadow","StepRepository","loadData","saveData","useSelector","isLoadingSelector","isSavingSelector","contextRef","asyncTokenRef","cancel","createAsyncToken","onSuccess","arg0","subscribe","getStepRepository","stepRepositoryConfig","getStepProgressItemGlyphicon","step","path","indexOf","isSelected","containsSelected","isBehind","footerStyleOverrides","StepsContextProvider","VerticalSeparatedLayout","StepContainer","StepProgressList","MultiStepLayout","_ref$wizardState","isBusy","stepListWithServiceInfo","_ref$wizardActions","wizardActions","saveAndNavigateNext","saveAndNavigateBack","cancelAndExit","saveAndExit","stepFooter","beforeLastStepNextButtonText","saveAndExitButtonText","last","isReadOnly","currentPath","getItemGlyphicon","SingleStepLayout","isCenteredLayout","Step","StepWizardImpl","wizardScenario","extraStepsData","routeToNavigateToWhenDone","scopeToRemoveWhenDone","_useWizardState","_props$extraStepsData","_props$wizardScenario","scenarioName","withContentFooter","_props$machineId","_useMemo","createScenarioAndActivity","activityName","scenario","setClarityTag","StepWizardScenario","scopeRef","isEmpty","remove","wizardMachine","useRefInit","service","useInterpret","stepInfo2","wasSaving","wasWaitingForConfirmation","wasStopping","window","addEventListener","removeEventListener","useWizardState","_useWizardState2","_wizardState$withCont","Layout","loadingText","steps","enabled","enableRenderingLog","Activity","name","initialized","_Fragment","wizardPerfMarker","stepPerfMarkerName","Scenario","toLowerCase","UiBlocker","blocking","ContentFooter","StepWizard","withInstrumentation","useNavigationConfirmationPrompt","needsConfirmation","confirmationMessage","onUserNavigation","location","action","navigationConfirmationPrompt","Prompt","beforeUnloadListener","preventDefault","returnValue","capture","useExitWithoutSavingConfirmation","exitConfirmationMessage","confirm","StepLoadingStatus","StepLoadingShell","isStoppingSelector","loadingStatusSelector","stepComponent","Fallback","fallback","subscription","unsubscribe","perfmarker","child","createChild","autoEnd","willInit","useUpdateChildPerfMarker","constant","isFailedInitSelector","sharedIsStoppingSelector","isFinSelector","ProgressiveLoadingBlock","withStepLoadingShell","staticLoadingStatusSelector","staticIsStoppingSelector","staticFallback","HOC","_ref3","_excluded2","displayName","getDisplayName","hoistNonReactStatics","queryToPredicates","query","$and","ShutterStockFilterInternal","_React$Component","_this","_classCallCheck","_callSuper","onQueryChange","_this$props","prevData","currData","predicates","i18nLegacy","filterSchema","properties","people_model_released","filterable","property","enum","localized","true","false","operatorDisplayNameMap","eq","operators","chooseType","people_ethnicity","african","african_american","black","brazilian","chinese","caucasian","east_asian","hispanic","japanese","middle_eastern","native_american","pacific_islander","south_asian","southeast_asian","other","people_gender","male","female","both","people_age","infants","teenagers","older","people_number","editableFilter","FilterEntity","entitySchema","_inherits","_createClass","_this2","_this$props2","this","popoverContainer","predicatesToQuery","updateQuery","filterContainer","Consumer","PredicateList","onApplySavedFilter","onDeleteFilters","selector","selectableFilter","onEditableFilterUpdate","onSelectableFilterUpdate","disallowDuplicateFilters","ShutterStockFilter","withDefaultStyles","getStockPhotoFilterStyle","StockImageFilter","onFilterQueryChange","setFilterQuery","keyValueQueryPairs","memo","predicate","_$keys","addedKeyValue","_$values","valuesArray","_valuesArray","getStoreStyles","storeSettings","alignItems","storeSettingsLoading","minHeight","select_store_link","borderRadius","cursor","warning_no_store","errorIcon_no_store","select_store_no_store_message","select","control_title","control","title_text","select_label","storeSelectContent","ValidatedStoreView","withPermissions","stores","countries","_permissions$dynamic","feedLabelEnabled","FeedLabel","feedLabelBlockListEnabled","FeedLabelBlockList","isFeedLabelEnabled","onLocalChecked","isChecked","checked","LocalInventoryAdsEnabled","onDataChange","dataPatch","validationErrors","IsFeedFiltered","SalesCountry","push","validate","onIsFeedFilteredChange","isFeedFiltered","onSelectedFeedLabelChangeByValue","onSelectedSaleCountryChangeByValue","selectedStoreId","ProviderId","selectedCountry","storeFieldId","useId","countryFieldId","localInventoryFieldId","preSelectedItemsStyle","Label","htmlFor","FeedFilterPicker","isEditMode","saleCountries","pairs","selectedFeedLabel","onSelectedFeedLabelChange","selectedSaleCountry","onSelectedSaleCountryChange","storeId","Checkbox","label","warning_panel_bottom","Alert","dismissible","campaignObjective","StoreSelectCreation","hasStores","showProductCollections","hideFeedLabelAndCountry","onSelectedStoreChange","preSelectedStoreId","onSelectedCountryChange","countryId","onProductCollectionChecked","ProductCollectionsEnabled","productCollectionFieldId","preselectedStoreIdItemsStyle","Select","_ref4","_ref5","_ref6","callback","getRouterDep","navigateToRoute","ValidatedStoreCreation","withSiteMap","parseStoreName","storeText","nameComponentIndex","nameComponent","substring","nameIndex","trim","getStoreFromProductCollectionAccount","productCollectionAccount","Value","getStores","productData","ProductCollectionAccounts","reduce","store","getCountries","IsDomesticSimplifiedChineseEnabled","SalesCountryCollection","salesCountry","result","getCountryFromSalesCountryCollection","country","StoreSelectLoading","_ref$validationProps","alwaysShowError","onLoadingDone","onLoadingError","loadingErrors","onRenderCustomLoadingComponent","isOdataGetProductScopeEnabled","get","isUnmounted","getProductDataCall","dataName","bypassCache","cacheResponse","getSalesCountryCollection","cacheKey","getProductDataWithCache","withDFMCache","getProductScopeData","chain","getDFMCache","setDFMCache","mergedData","mergeData","IsCoOpStore","IsGlobalStore","getProductScopeFromOData","params","url","queryify","adapter","jsData","Product","find","getProductData","callStartTime","deltaTime","err","Loading","isVisible","ValidatedStoreSelectLoading","withServerContext","withActivityContext","StoreSelectContainer","onStoreDataLoaded","globalLegacyI18n","setIsLoading","setStores","setCountries","campaignSaved","onStoresLoadingDone","newStores","newCountries","storesLoadingErrors","setStoresLoadingErrors","onStoresLoadingError","intentTarget","formErrorProps","getAdCreationPreviewStyle","AdCreationPreviewContainer","whiteSpace","opacity","textAlign","verticalAlign","objectFit","objectPosition","wordWrap","right","ResponsiveSearchAdPreview","handleRSAData","convertedFinalUrl","FinalUrls","headlineList","Headlines","i","Asset","PinnedField","descriptionList","Descriptions","convertedTitle","getTitlePreview","convertedText","getDescPreview","convertedDisplayUrl","getExpandedTextAdDisplayUrl","DisplayUrl","Path1","Path2","resultData","href","nowrap","ResponsiveAdPreview","LandscapeImageMediaUrl","callToAction","originalActionTextMapper","CallToActionLanguage","CallToAction","align","alt","Headline","AdCreationPreview","getAdContent","PropertyRow","propertyLabel","Store","storeName","ProductCollections","isProductCollectionsEnabled","productCollectionsText","LocalInventory","isLocalInventoryEnabled","localInventoryText","getProductsStyle","productFilterItem","Products","productFilters","useSelectedItem","productsText","join","maxContentWidth","locations","targetOption","explicitLocations","numLocations","replace","AgeRanges","EighteenToTwentyFive","TwentyFiveToThirtyFive","ThirtyFiveToFifty","FiftyToSixtyFive","SixtyFiveAndAbove","Unknown","ThirtyFiveToFiftyFive","FiftyFiveAndAbove","formatAgeRanges","ageRanges","ageRange","sortAgeRanges","formatAgeRange","AgeRangeTargeting","Genders","Female","Male","formatGenders","genders","gender","sortGenders","formatGender","GenderTargeting","getDayTimeDetails","dayTime","is12","startHour","StartHour","endHour","EndHour","startMin","getMin","minuteToSaveMap","StartMinute","endMin","EndMinute","getDay","Day","from","getTime","min","AdSchedule","startDate","endDate","adSchedules","useSearcherTimeZone","timeDisplayType","includeStartEnd","dateSettings","getDateSettingDetails","adScheduleSettings","len","BidAdjustmentType","BidAdjustmentAmount","CashbackPercent","schedule","getAdScheduleDetails","dateTimePart","AdScheduleWithBidAdjustments","formatTargets","includedData","excludedData","singularText","pluralText","targetedCriterions","excludedCriterions","targetedCriterionDetails","excludedCriterionDetails","count","CommonTarget","Audience","audiences","Interest","interests","PredictiveTargeting","isPredictiveTargetingEnabled","predictiveTargetingText","StartEndDates","isUseCampaignLevelDates","isDateLevelDisplayed","getLocalizationMapping","adDistribution","syndEnum","BingYahooOnly","SearchPartnersOnly","BingYahooAndSearchPartners","formatKeywords","showLength","total","detail","slice","keyword","Keywords","formatText","Genre","genreTargets","Disclaimer","disclaimerName","Name","disclaimerText","CompanyName","companyTargets","negativeCompanyTargets","JobFunction","jobTargets","negativeJobTargets","Industry","industryTargets","negativeIndustryTargets","formatConversionGoals","ConversionGoals","BudgetTypes","formatBudget","currencyCode","currencySymbol","getCurrencySymbol","formatBidStrategy","getBidTitleDetails","BidStrategy","formatBidValue","BidValue","Languages","formattedLanguages","language","campaignLanguageStrings","toString","AudienceSignal","audienceSignalName","Images","shouldFetchFromMT","isLogo","images","setImages","processImageListModelToViewModel","ImageAssets","loadedImageList","ImageList","Shimmer","getStoreInfoStyle","storeTitleDetails","AutoGeneratedAssets","autoGeneratedTextOptOut","autoGeneratedImageOptOut","finalUrlExpansionOptOut","autoGenAssetsSummary","UrlOptions","urlOptionsDetails","getUrlOptionsDetails","TrackingUrlTemplate","FinalUrlSuffix","UrlCustomParameters","BidTarget","TargetRoas","TargetCpa","targetValue","targetCpa","targetRoas","formatRoasValue","getExpansionsSummary","finalUrlExpansions","exactUrls","rules","conditions","Criterion","WebPage","Parameter","Conditions","condition","Operator","ArgumentOperand","exactUrlsDetails","rulesDetails","FinalURLExpansions","getSearchThemeDetails","searchThemes","SearchTheme","SearchThemes","CostPerSale","costPerSaleOptOut","costPerSaleSummary","UrlRules","isAssetGroupUrlRulesV2Enabled","finalUrls","path1","path2","mobileFinalUrls","urlRules","UrlOptionsDetailsWithRulesV2","UrlOptionsDetailsWithRules","NewCustomerAcquisition","newCustomerAcquisitionOptOut","newCustomerAcquisition","accountSettings","summary","summaryText","bidOnlyMode","campaignAdditionalValue","accountAdditionalValue","formatCurrency","Videos","summaryPageComponentTypes","numAds","feeds","feedLabel","feedLabelsText","products","interest","audience","company","industry","languages","longHeadlines","getLongHeadlinesCardSummaryDetails","descriptions","getDescriptionsCardSummaryDetails","headlines","getHeadlinesCardSummaryDetails","storesData","storeContainerData","getStoreTitleDetails","listingGroupDetails","getListingGroupDetails","keywords","disclaimer","setTranslateX","el","VirtualScrollbar","_React$PureComponent","onMouseUp","isDown","onMouseDown","e","offsetLeft","arr","split","translateX","parseInt","getTranslateX","clientX","onMouseMove","offsetX","thumbWidth","viewWidth","viewOffsetX","view","scrollLeft","onViewScroll","document","parentStyle","childStyle","userSelect","ref","UnStyledScrollbar","unmounted","pgridView","positionStatic","$table","$el","$tfoot","offset","top","fixedBottomOffset","containerOverflowX","defaults","shouldDisplay","positionFixed","gridViewWidth","gridPaddingLeft","scrollBarView","Scrollbar","extend","scrollbarWidth","getTableWidth","toArray","getBoundingClientRect","TablePageContainer","gridPopupHeight","virtualScrollbarFixed","virtualScrollbarInView","gridEventMap","lastVirtualScrollLeft","letPopUpScrollHorizontal","viewport","gridAndStickyContainer","topOfGridContainer","stickyContainer","gridAndDisclaimContainer","topMarker","isInView","bottomMarker","isHiddenInView","intersectionObserver","IntersectionObserver","handleIntersectionChange","bind","rootMargin","threshold","resizeMarker","lastResizerWidth","resizeObserver","ResizeObserver","throttle","handleResizeChange","ResizeObserverPollyFill","SMALL_PADDING_LEFT_CLASS","shouldUseSmallPadding","isString","customClasses","tablePageContainer","contains","childBar","$","parentWidth","stickyTopOfGridWidth","left","entries","tablePageMinWidth","contentRect","backboneGridView","tableView","p$gridViewContainer","getTableView","eventName","Event","createEvent","initEvent","dispatchEvent","handleScrollbar","isIntersecting","intersectionRatio","prevPopupHeight","popupHeight","getInlineEditPopupHeight","onScrollbarsViewUpdate","prevState","parentElement","viewportRect","topOfGridRect","gridAndStickyRect","shouldAdjustStickyTopOfGrid","tableWidth","gridViewHasHorizontalOverflow","Math","round","emptyHeight","gridViewHasVerticalOverflow","newState","stickyTopOfGridTopOffset","stickyTopOfGridPosition","floor","stickyTopOfGridHeight","scrollStateKeys","modifiedState","stateKey","handlePopup","_this3","observe","setScrollPosition","handleScroll","getChildBarScrollLeftValue","p$gridView","grid","gridView","off","unobserve","prevProps","shiftThePopUp","$popup","inlineEditPopupSelector","currentLeft","newLeft","parseFloat","css","attr","closest","newTop","forceResetScrollFlag","scrollTop","popup","querySelector","getHeightIncludeAbsolutePositionedElements","pixels","match","v","Number","getShadowWidthOutofYBorder","_this4","thead","tfoot","CustomDisclaimerBanner","DisclaimerBanner","stickyStyle","Constants","ZIndexContentComponents","GridToolbar","_this$state","bottomMarkerRect","gridAndDisclaimContainerHeight","Fragment","pageContainer","onScroll","topOfGridContent","stickyTopOfGridContent","max","gridContainer","gridViewContainer","noResultSelector","timeZone","timezone","disableFooter","contentFooter","StyledTablePageContainer","flex","overflowX","visibility","uiblockerStyle","getBidLandscapeStyle","getBudgetSuggestionPopupStyle","getInlineOpportunityStyle","Latch","onInitialized","resolveOnInitialized","isInitialized","isScheduled","has","defer","withTablePageStateManager","getToolbarConfig","WrappedComponent","GridPageStateManager","onGridInjected","deselectAll","lazyInjected","once","release","onClearSelection","showToolbarSelected","showToolbarUnselected","updateToolbar","toolbarSelectedConfigMerged","Map","toolbarSelectedConfig","set","toolbarDynamicSelectedConfig","dynamicValue","mergedValue","toolbarUnselectedConfig","resetToolbarVisibility","forceHideToolbar","showTopOfGridPanel","viewInstance","config","panelView","showTopGridPanel","forceHideInlineChart","showTopGridPanelAndContent","showInlineChartView","showInlineChart","updateGridSelectionState","selectionCount","totalCount","isMultiPage","isSinglePageAllSelected","isCrossPageAllSelected","newTotal","initialSetGridNum","updateSelectedToolbarConfig","newSelectedConfig","updateUnselectedToolbarConfig","newUnselectedConfig","forceInitToolbarConfig","newProps","renderToolbarContainer","_this2$state","ToolbarContainer","isUndefined","onClear","isOpenCreatePanel","crossPageSelectPlugin","getCrossPageSelectPlugin","history","pathname","search","onSelectCrossPage","_getToolbarConfig","updateGridOptions","lazyInject","toolbarDynamicSelectedConfigCallback","createToolbar","gridOptions","toolbarPlugin","getToolbarPlugin","overrideWith","resetVisibility","resetGraphVisibility","resetToolbarMode","toolbarConfig","updateToolbarDynamicSelectedConfig","_ref7","dynamicSelectedConfig","defaultStyles","disconnectedStatusTile","connectedStatusTile","connectedStatusLabel","saveButton","removeButton","VerifiedTrackingSettingKey","vendorNameKey","advertiserEntityIdKey","publisherEntityIdKey","regexMappping","video","native","ThirdPartyMeasurementNameMap","formatThirdPartyMeasurementSetting","verifiedTrackingSettings","verifiedTrackingSetting","vendorName","advertiserEntityId","publisherEntityId","settingEmpty","getVerifiedTrackingComponent","errorMessages","createVerifiedTrackingSettingViewModel","StatusLabel","success","statusMessage","statusStyle","paddingInline","labelIcon","Icon","iconName","ThirdPartyMeasurement","_props$adType","adType","_props$overrideStyles","overrideStyles","verifiedTrackingData","connected","setConnected","verifiedTrackingSettingRaw","setVerifiedTrackingSettingRaw","tagUrlErrors","setTagErrors","validateUrl","ids","regexStrArr","regexStr","currentRes","RegExp","exec","extractIdsFromIASInput","verifiedTrackingSettingToAdd","_validateUrl","onTagUrlChange","tagErrorMessage","Button","Dropdown","defaultSelectedKey","onRenderLabel","HelpPopupInline","multiline","autoAdjustHeight","errorMessage","ThirdPartyMeasurementWithValidation","getCheckStatus","settings","vendor","ThirdPartyMeasurementV2","setSettings","setErrors","verifiedTrackingDatas","settingsToUpdate","iasData","setting","moatData","IAS","MOAT","iasSettingsToUpdate","numericPattern","errorsToUpdate","test","moatSettingsToUpdate","onRenderadvertiserIdTextField","onRenderpublisherIdTextField","onAdvertiserIdChange","onPublisherIdChange","onCheckStatusChangeGenerator","originalSettings","newSettings","errorType","onRenderIASLabel","onRenderMOATLabel","onRenderIASCheckbox","ThirdPartyMeasurementV2WithValidation","thirdPartyMeasurementFolderButton","ThirdPartyMeasurementCardContainer","showSimpleMessage","isForDeal","dealLoaded","isMOATEnabled","initialFolded","folded","setFolded","foldedIconProps","ThirdPartyMeasurementComponent","CommandButton","iconProps","VerifiedTrackingSettings","ThirdPartyMeasurementContainerWithValidation","ThirdPartyMeasurementBackboneView","_Backbone$View","initialThirdPartyMeasurement","_ref$isMOATEnabled","saveVerifiedTrackingSetting","verifiedTrackingObj","render","ReactDOM","Backbone","campaignThirdPartyVendors","ISPOT","DV","reachVendors","verificationVendors","campaignThirdPartyVendorNames","thirdPartyMeasurementTrackingVendorField","thirdPartySettingError","settingEnabledKey","isVendorSelectedInSetting","foundSetting","thirdPartySettingValidatorMap","brandId","thridPartyMeasurementTrackingStyles","thirdPartyMeasurementGuide","thirdPartyMeasurementRemoveAllStack","thirdPartyMeasurementRemoveAllButton","inset","thirdPartyMeasurementAddButton","dropdown","thirdPartyMeasurementVendorSettings","thirdPartyMeasurementRemoveButton","warningMessageContainer","warningMessage","borderColor","gap","warningMessageText","linked","warningMessageDefaultSettings","tagName","WarningMessage","customSettings","horizontalAlign","AccountLinkedStatusLabel","doubleVerifyLinkEstablished","overrideStyle","customVendorConfigs","setSetting","updatedSetting","ThirdPartyTrackingSetting","removeSetting","VendorConfig","isiSPOTSetting","readOnly","defaultValue","ThirdPartyTrackingRemoveAllButton","removeAllVendorSettings","formatVendorSettings","verifiedTrackingSettingsValidationProps","validSettings","selectedVendors","getVendorNames","ThirdPartyMeasurementV3","IsMSANISPOTEnabled","EnableDoubleVerify","_useAccountPropertyRe","enableDoubleVerifyForAllCampaigns","setEnableDoubleVerifyForAllCampaigns","setDoubleVerifyLinkEstablished","readAccount","edmCampaign","Customers","$withKey","Accounts","toPromise","account","EnableDoubleVerifyForAllCampaigns","DoubleVerifyLinkEstablished","catch","useAccountPropertyRepository","vendorData","validatedSettingsArray","validatedVendorSetting","currentVendorErrors","addSetting","updatedSettings","vendorFound","vendorNameArr","currentVendorName","oldSettings","s","onRenderReachSettings","reachSettings","indexInSettings","onRenderVerificationSettings","verificationSettings","addVendorMenuProps","itemsToPush","itemType","ContextualMenuItemType","Header","ispotSelected","Divider","DVSelected","menuProps","ThirdPartyMeasurementV3WithValidation","getVerifiedTrackingSettingWrite","VerifiedTrackingData","results","Key","getVerifiedTrackingSettingsRead","model","customKey","keyMap","IAS_advertiserEntityId","IAS_publisherEntityId","ISPOT_brandId","thirdPartyMeasurementStringToViewModel","verifiedTrackingDataString","thirdPartyMeasurementFromBulkModel","parse","thirdPartyMeasurementSetting","getThumbsUpDownStyles","thumbsUpDown","thumbsUpDownAddImage","innerWidth","calloutRoot","ComponentSettings","getBlockerStyle","getFeedbackFormStyles","checkboxOptions","feedbackAction","feedbackFormRoot","FeedbackForm","onSubmit","onDismiss","initialOptionsState","optionsState","setOptionsState","screenshotState","setScreenshotState","commentState","setCommentState","enableSubmit","setEnableSubmit","classnames","otherValues","placeholder","ReactTemplate","a","infoText","template","comments","takeScreenshot","getIconStyles","ThankYouIcon","viewBox","fill","xmlns","fillRule","clipRule","x1","y1","x2","y2","gradientUnits","stopColor","ThankYouContent","ThumbsUpDownOCVDataService","_OCVDataService","OCVDataService","sendFeedbackInternal","screenshotGenerationPromise","formOptions","featureArea","onFinishTakeScreenshot","onFinishSendRequest","isTestEnv","dataService","clientFeedbackId","uuidv4","feedback","comment","stringifySync","serializeComments","complianceChecks","authenticationType","ageGroup","telemetry","html2canvas","body","foreignObjectRendering","logging","canvas","toDataURL","sendFeedback","appId","ThumbsUpDown","onThumbsUpSignal","onThumbsDownSignal","containerName","thumbsUpSelected","setThumbsUpSelected","thumbsDownSelected","setThumbsDownSelected","showFeedback","setShowFeedback","showThumbsUpThankYouContent","setShowThumbsUpThankYouContent","_useState9","_useState10","showThumbsDownThankYouContent","setShowThumbsDownThankYouContent","_useState11","_useState12","showBlocker","setShowBlocker","_useState13","_useState14","blockerText","setBlockerText","_useState15","_useState16","formOptionsInternal","setFormOptionsInternal","_useState17","_useState18","hasOngoingRequest","setHasOngoingRequest","IconButton","rootHovered","iconHovered","newThumbsUpState","Callout","directionalHint","DirectionalHint","bottomRightEdge","calloutMain","newThumbsDownState","findIdInToolbarSubMenu","toolbarItem","menu","menuItem","ToolbarEditor","update","hasAnyToolbarBeenUpdated","each","configName","hasBeenUpdated","subMenu","foundConfig","getToolbarEditor","plugin","definePlugin","selectedRowCount","selectedItems","resetVisibilityAndTriggerUpdate","toolbarEditor","gridToolbarGroup","toolbarNames","toolbarWithItem","toolbarWithName","hideAllToolbars","showAllToolbars","updateGridView","DiagnosticsTypes","Issue","Recommendation","useDiagnosticsBarStyles","messageBar","colorBrandBackground2","colorBrandBackground2Pressed","messageBarBody","messageBarAction","alignSelf","iconIssue","colorStatusWarningForeground1","iconRecommendation","colorNeutralForeground2BrandHover","DiagnosticBar","itemList","onActionClick","renderActions","size","weight","MessageBar","locator","intent","layout","MessageBarBody","MessageBarTitle","description","link","MessageBarActions","useDiagnosticsSectionStyles","diagnosticsSection","SummaryDiagnostic","issues","recommendations","diagnosticsExpandedSection","setDiagnosticsExpandedSection","diagnosticsSectionExpand","setActiveKeys","allPanelItems","checkItems","skipItemsTypeCheck","activeKeys","Badge","shape","appearance","isTagetCpaHigherThanBudget","budgetAmount","cpa","parseDecimal","String","getLogString","checkValue","LogTargetCpaCheckOnSave","TargetCpaValueCheck","TargetCpaWarningBannerInternal","isSignup","tcpaCheckEnabled","shouldShowBanner","wordBreak","TargetCpaWarningBanner"],"sourceRoot":""}