services:
  _defaults:
    public: true

  prestashop.core.addon.theme.repository:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeRepository
    arguments:
      - "@prestashop.adapter.legacy.configuration"
      - "@filesystem"
      - "@=service('prestashop.adapter.legacy.context').getContext().shop"

  prestashop.core.addon.theme.exporter:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeExporter
    arguments:
      - "@prestashop.adapter.legacy.configuration"
      - "@filesystem"
      - "@prestashop.core.admin.lang.repository"
      - "@prestashop.translation.theme.exporter"


  prestashop.core.addon.theme.theme_validator:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeValidator
    arguments:
      - '@translator'
      - '@prestashop.adapter.legacy.configuration'

  prestashop.core.addon.theme.theme_manager_builder:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeManagerBuilder
    arguments:
      - '@=service("prestashop.adapter.legacy.context").getContext()'
      - '@prestashop.adapter.legacy_db'
      - '@prestashop.core.addon.theme.theme_validator'
      - '@logger'

  prestashop.core.addon.theme.theme_manager:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeManager
    factory: [ '@prestashop.core.addon.theme.theme_manager_builder', 'build' ]

  prestashop.core.addon.theme.theme.page_layouts_customizer:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemePageLayoutsCustomizer
    arguments:
      - '@=service("prestashop.adapter.legacy.context").getContext().shop.theme'
      - '@prestashop.core.addon.theme.theme_manager'
      - '@prestashop.adapter.cache.clearer.smarty_cache_clearer'

  prestashop.core.addon.theme.theme_zip_uploader:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeZipUploader
    arguments:
      - '@prestashop.adapter.legacy.configuration'

  prestashop.core.addon.theme.theme_provider:
    class: PrestaShop\PrestaShop\Core\Addon\Theme\ThemeProvider
    arguments:
      - '@prestashop.core.addon.theme.repository'
      - '@=service("prestashop.adapter.legacy.context").getContext().shop.theme'
