<?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) Sylius Sp. z o.o.

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
    <imports>
        <import resource="services/controller.xml" />
        <import resource="services/email.xml" />
        <import resource="services/listener.xml" />
        <import resource="services/menu.xml" />
        <import resource="services/form.xml" />
        <import resource="services/provider.xml" />
    </imports>

    <parameters>
        <parameter key="sylius.ajax.product.autocomplete_limit">25</parameter>
        <parameter key="sylius.ajax.product.variant_autocomplete_limit">25</parameter>
        <parameter key="sylius.ajax.product.option_autocomplete_limit">10</parameter>
        <parameter key="sylius.ajax.customer_group.autocomplete_limit">25</parameter>
        <parameter key="sylius.message.admin_user_create.validation_groups" type="collection">
            <parameter>sylius</parameter>
            <parameter>sylius_user_create</parameter>
        </parameter>
    </parameters>

    <services>
        <defaults public="true" />

        <service id="Sylius\Bundle\AdminBundle\Console\Command\CreateAdminUserCommand">
            <argument type="service" id="sylius.command_bus" />
            <argument>%sylius_locale.locale%</argument>
            <argument type="service" id="sylius.console.command_factory.question" />
            <tag name="console.command" />
        </service>

        <service id="Sylius\Bundle\AdminBundle\Console\Command\ChangeAdminUserPasswordCommand">
            <argument type="service" id="sylius.repository.admin_user" />
            <argument type="service" id="sylius.security.password_updater" />
            <argument type="service" id="sylius.console.command_factory.question" />
            <tag name="console.command" />
        </service>

        <service id="Sylius\Bundle\AdminBundle\MessageHandler\CreateAdminUserHandler">
            <argument type="service" id="sylius.repository.admin_user" />
            <argument type="service" id="sylius.factory.admin_user" />
            <argument type="service" id="sylius.canonicalizer" />
            <argument type="service" id="validator" />
            <argument>%sylius.message.admin_user_create.validation_groups%</argument>
            <tag name="messenger.message_handler" bus="sylius.command_bus" />
            <tag name="messenger.message_handler" bus="sylius_default.bus" />
        </service>

        <service id="sylius.console.command_factory.question" class="Sylius\Bundle\AdminBundle\Console\Command\Factory\QuestionFactory" />

        <service id="Sylius\Bundle\AdminBundle\Console\Command\Factory\QuestionFactoryInterface" alias="sylius.console.command_factory.question" />

        <service id="sylius.context.locale.admin_based" class="Sylius\Bundle\AdminBundle\Context\AdminBasedLocaleContext">
            <argument type="service" id="security.token_storage" />
            <tag name="sylius.context.locale" priority="128" />
        </service>

        <service id="sylius.section_resolver.admin_uri_based_section_resolver" class="Sylius\Bundle\AdminBundle\SectionResolver\AdminUriBasedSectionResolver">
            <argument>/admin</argument>
            <tag name="sylius.uri_based_section_resolver" priority="20" />
        </service>

        <service id="sylius.twig.extension.widget.admin_notification" class="Sylius\Bundle\AdminBundle\Twig\NotificationWidgetExtension">
            <argument>%sylius.admin.notification.enabled%</argument>
            <argument>%sylius.admin.notification.frequency%</argument>
            <tag name="twig.extension" />
        </service>
        <service id="sylius.twig.extension.shop" class="Sylius\Bundle\AdminBundle\Twig\ShopExtension">
            <argument>%sylius.admin.shop_enabled%</argument>
            <tag name="twig.extension" />
        </service>
        <service id="sylius.twig.extension.channels_currencies" class="Sylius\Bundle\AdminBundle\Twig\ChannelsCurrenciesExtension">
            <argument type="service" id="sylius.repository.channel" />
            <tag name="twig.extension"/>
        </service>
        <service id="Sylius\Bundle\AdminBundle\Twig\OrderUnitTaxesExtension">
            <tag name="twig.extension"/>
        </service>

        <service id="Sylius\Bundle\AdminBundle\Twig\ChannelNameExtension">
            <argument type="service" id="sylius.repository.channel" />
            <tag name="twig.extension" />
        </service>

        <service id="sylius.http_client" alias="Psr\Http\Client\ClientInterface" public="false" />
        <service id="sylius.http_message_factory" class="Http\Message\MessageFactory\GuzzleMessageFactory" public="false">
            <deprecated package="sylius/admin-bundle" version="1.13">The "%service_id%" service is deprecated since 1.13 and will be removed in 2.0. Use "Psr\Http\Message\RequestFactoryInterface" instead.</deprecated>
        </service>
    </services>
</container>
