imports:
  - { resource: src/Event/services.yaml }

parameters:
  oxid_esales.theme.admin.name: 'admin_twig'
  oxid_esales.templating.engine_template_extension: 'html.twig'
  oxid_esales.templating.engine_autoescapes_html: true
  oxid_esales.templating.disable_twig_template_caching: false

services:
  _defaults:
    autowire: true

  OxidEsales\Eshop\Core\Config:
    factory: ['OxidEsales\Eshop\Core\Registry', 'getConfig']

  OxidEsales\Twig\TwigContextInterface:
    class: OxidEsales\Twig\TwigContext
    arguments:
      $activeAdminTheme: '%oxid_esales.theme.admin.name%'

  OxidEsales\Twig\TwigEngineConfigurationInterface:
    class: OxidEsales\Twig\TwigEngineConfiguration
    arguments:
      $disableTemplateCaching: '%oxid_esales.templating.disable_twig_template_caching%'
    public: true

  twig:
    class: Twig\Environment
    arguments:
      - '@twig.loader.chain'
      - "@=service('OxidEsales\\\\Twig\\\\TwigEngineConfigurationInterface').getParameters()"
    calls:
      - [addGlobal, ['twig', {capture: {}}]]
      - [addGlobal, ['oView', {}]]

  OxidEsales\Twig\Loader\CmsTemplateNameParser:

  OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface:
    class: OxidEsales\Twig\Bridge\TwigTemplateRendererBridge
    public: true

  OxidEsales\Twig\Resolver\ShopTemplateDirectoryResolver:

  OxidEsales\Twig\Resolver\ModulesTemplateDirectoryResolver:
    arguments:
      Symfony\Component\Filesystem\Filesystem: '@oxid_esales.symfony.file_system'

  OxidEsales\Twig\Resolver\TemplateDirectoryResolverInterface:
    class: OxidEsales\Twig\Resolver\TemplateDirectoryResolverAggregate
    arguments:
      -
        - '@OxidEsales\Twig\Resolver\ShopTemplateDirectoryResolver'
        - '@OxidEsales\Twig\Resolver\ModulesTemplateDirectoryResolver'

  # Loaders

  twig.loader.filesystem:
    class: OxidEsales\Twig\Loader\FilesystemLoader
    arguments:
      - '@OxidEsales\Twig\Resolver\TemplateDirectoryResolverInterface'
    tags: ['twig.loader']

  OxidEsales\Twig\Loader\CmsLoader:
    arguments:
      - '@OxidEsales\Twig\Loader\CmsTemplateNameParser'
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\ContentFactory'
    tags: ['twig.loader']

  twig.loader.chain:
    class: Twig\Loader\ChainLoader
    calls:
      - [addLoader, ['@twig.loader.filesystem']]
      - [addLoader, ['@OxidEsales\Twig\Loader\CmsLoader']]

  # Escapers

  OxidEsales\Twig\Escaper\DecEntityEscaper:
    tags: ['twig.escaper']

  OxidEsales\Twig\Escaper\HexEntityEscaper:
    tags: ['twig.escaper']

  OxidEsales\Twig\Escaper\HexEscaper:
    tags: ['twig.escaper']

  OxidEsales\Twig\Escaper\HtmlAllEscaper:
    tags: ['twig.escaper']

  OxidEsales\Twig\Escaper\MailEscaper:
    tags: ['twig.escaper']

  OxidEsales\Twig\Escaper\NonStdEscaper:
    tags: ['twig.escaper']

  OxidEsales\Twig\Escaper\QuotesEscaper:
    tags: ['twig.escaper']

  OxidEsales\Twig\Escaper\UrlPathInfoEscaper:
    tags: ['twig.escaper']

  # Token parsers

  OxidEsales\Twig\TokenParser\HasRightsTokenParser:
    arguments:
      - 'OxidEsales\Twig\Node\HasRightsNode'

  # Extensions

  OxidEsales\Twig\Extensions\MathExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\IncludeExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\IncludeDynamicLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\SmartyCycleExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\MailtoExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\UrlExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\SeoUrlLogic'
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\AddUrlParametersLogic'
    tags: ['twig.extension']

  Twig\Extension\StringLoaderExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\HasRightsExtension:
    arguments:
      - '@OxidEsales\Twig\TokenParser\HasRightsTokenParser'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\IfContentExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\IfContentLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\FormatPriceExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\FormatPriceLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\CatExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\EncloseExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\ScriptExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\ScriptLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\FormatDateExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\FormatDateLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\DateFormatExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\DateFormatHelper'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\TranslateExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\TranslateFilterLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\TranslateExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\TranslateFunctionLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\FormatTimeExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\FormatTimeLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\FileSizeExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\FileSizeLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\StyleExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\StyleLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\TruncateExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\TruncateLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\TranslateSalutationExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\TranslateSalutationLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\FormatCurrencyExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\FormatCurrencyLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\WordwrapExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\WordwrapLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\IncludeWidgetExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\IncludeWidgetLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\SmartWordwrapExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\SmartWordwrapLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\InputHelpExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\InputHelpLogic'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\PhpFunctionsExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\PhpFunctionsExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\Filters\RegexReplaceExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\CaptureExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\InsertNewBasketItemExtension:
    arguments:
      - '@OxidEsales\EshopCommunity\Internal\Transition\Adapter\TemplateLogic\InsertNewBasketItemLogicTwig'
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\InsertTrackerExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\GetRequestVariablesExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\ExtendsExtension:
    tags: ['twig.extension']

  OxidEsales\Twig\Extensions\IncludeContentExtension:
    tags: ['twig.extension']

  OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateEngineInterface:
    class: OxidEsales\Twig\TwigEngine
    arguments:
      $engine: '@twig'
      $fileExtension: '%oxid_esales.templating.engine_template_extension%'
      $twigExtensions: !tagged twig.extension
      $twigEscaper: !tagged twig.escaper
    public: false

  OxidEsales\Twig\Resolver\TemplateChain\TemplateChainResolverInterface:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateChainResolver

  OxidEsales\Twig\Resolver\TemplateChain\TemplateChainValidatorInterface:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateChainValidator

  OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ChainAppenderInterface:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ChainAppender
    arguments:
      Symfony\Component\Filesystem\Filesystem: '@oxid_esales.symfony.file_system'

  OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ShopTemplateHandler:

  OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleTemplateHandler:

  OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ShopTemplateChainAppender:

  OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ShopTemplateHandler:
    arguments:
      - '@OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ShopTemplateChainAppender'

  OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ShopExtensionTemplateHandler:
    arguments:
      - '@OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ShopTemplateChainAppender'

  OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ModuleTemplateHandler:

  OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ModuleExtensionTemplateHandler:

  oxid_esales.twig.resolver.template_chain.shop_template_chain_builder:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateChainBuilder
    arguments:
      - '@OxidEsales\Twig\Resolver\ShopTemplateDirectoryResolver'
      -
        - '@OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ShopTemplateHandler'

  oxid_esales.twig.resolver.template_chain.modules_template_chain_builder:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateChainBuilder
    arguments:
      - '@OxidEsales\Twig\Resolver\ModulesTemplateDirectoryResolver'
      -
        - '@OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ShopTemplateHandler'
        - '@OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ShopExtensionTemplateHandler'
        - '@OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleTemplateHandler'
        - '@OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ModuleTemplateHandler'
        - '@OxidEsales\Twig\Resolver\TemplateChain\TemplateHandler\ModuleExtensions\ModuleExtensionTemplateHandler'

  OxidEsales\Twig\Resolver\TemplateChain\TemplateChainBuilderInterface:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateChainBuilderAggregate
    arguments:
      -
        - '@oxid_esales.twig.resolver.template_chain.modules_template_chain_builder'
        - '@oxid_esales.twig.resolver.template_chain.shop_template_chain_builder'

  OxidEsales\Twig\Resolver\TemplateChain\TemplateType\TemplateTypeFactoryInterface:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateType\TemplateTypeFactory

  OxidEsales\Twig\Resolver\TemplateChain\TemplateChainSorterInterface:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateChainSorter

  OxidEsales\Twig\Resolver\TemplateChain\TemplateType\InitialTemplateResolverInterface:
    class: OxidEsales\Twig\Resolver\TemplateChain\TemplateType\InitialTemplateResolver

  OxidEsales\Twig\Resolver\TemplateChain\SortingConfigurationValidatorInterface:
    class: OxidEsales\Twig\Resolver\TemplateChain\SortingConfigurationValidator
