<?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/*.xml" />
    </imports>

    <parameters>
        <parameter key="sylius.order_item_quantity_modifier.limit">9999</parameter>
        <parameter key="env(SYLIUS_UNSECURED_URLS)">yes</parameter>
        <parameter key="sylius.unsecured_urls">%env(bool:SYLIUS_UNSECURED_URLS)%</parameter>
        <parameter key="sylius.channel_pricing_log_entry.old_logs_removal_batch_size">100</parameter>
    </parameters>

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

        <service id="sylius.integer_distributor" class="Sylius\Component\Core\Distributor\IntegerDistributor" />
        <service id="Sylius\Component\Core\Distributor\IntegerDistributorInterface" alias="sylius.integer_distributor" />

        <service id="sylius.proportional_integer_distributor" class="Sylius\Component\Core\Distributor\ProportionalIntegerDistributor" />
        <service id="Sylius\Component\Core\Distributor\ProportionalIntegerDistributorInterface" alias="sylius.proportional_integer_distributor" />

        <service id="Sylius\Component\Core\Distributor\MinimumPriceDistributorInterface" class="Sylius\Component\Core\Distributor\MinimumPriceDistributor">
            <argument type="service" id="sylius.proportional_integer_distributor" />
        </service>

        <service id="sylius.invoice_number_generator" class="Sylius\Component\Core\Payment\IdBasedInvoiceNumberGenerator" />
        <service id="Sylius\Component\Core\Payment\InvoiceNumberGeneratorInterface" alias="sylius.invoice_number_generator" />

        <service id="sylius.image_uploader" class="Sylius\Component\Core\Uploader\ImageUploader">
            <argument type="service" id="Sylius\Component\Core\Filesystem\Adapter\FilesystemAdapterInterface" />
            <argument type="service" id="Sylius\Component\Core\Generator\ImagePathGeneratorInterface" />
        </service>
        <service id="Sylius\Component\Core\Uploader\ImageUploaderInterface" alias="sylius.image_uploader" />

        <service id="Sylius\Component\Core\Filesystem\Adapter\FlysystemFilesystemAdapter">
            <argument type="service" id="sylius.storage" />
        </service>
        <service id="Sylius\Component\Core\Filesystem\Adapter\GaufretteFilesystemAdapter">
            <argument type="service">
                <service class="Gaufrette\Filesystem">
                    <argument>%sylius.uploader.filesystem%</argument>
                    <factory service="knp_gaufrette.filesystem_map" method="get" />
                </service>
            </argument>
        </service>

        <service
            id="Sylius\Component\Core\Generator\ImagePathGeneratorInterface"
            class="Sylius\Component\Core\Generator\UploadedImagePathGenerator"
        />

        <service id="sylius.collector.core" class="Sylius\Bundle\CoreBundle\Collector\SyliusCollector" public="false">
            <argument type="service" id="sylius.context.shopper" />
            <argument>%kernel.bundles%</argument>
            <argument>%locale%</argument>
            <tag name="data_collector" template="@SyliusCore/Collector/sylius.html.twig" id="sylius_core" priority="-512" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\Collector\CartCollector" public="false">
            <argument type="service" id="sylius.context.cart" />
            <tag name="data_collector" template="@SyliusCore/Collector/cart.html.twig" id="sylius_cart" priority="-512" />
        </service>

        <service id="sylius.shipping_methods_resolver.zones_and_channel_based" class="Sylius\Component\Core\Resolver\ZoneAndChannelBasedShippingMethodsResolver">
            <argument type="service" id="sylius.repository.shipping_method" />
            <argument type="service" id="sylius.zone_matcher" />
            <argument type="service" id="sylius.shipping_method_eligibility_checker" />
            <tag name="sylius.shipping_method_resolver" type="zones_and_channel_based" label="sylius.shipping_methods_resolver.zones_and_channel_based" priority="1" />
        </service>

        <service id="sylius.payment_methods_resolver.channel_based" class="Sylius\Component\Core\Resolver\ChannelBasedPaymentMethodsResolver">
            <argument type="service" id="sylius.repository.payment_method" />
            <tag name="sylius.payment_method_resolver" type="channel_based" label="sylius.payment_methods_resolver.channel_based" priority="1" />
        </service>

        <service id="sylius.payment_method_resolver.default" class="Sylius\Component\Core\Resolver\DefaultPaymentMethodResolver">
            <argument type="service" id="sylius.repository.payment_method" />
        </service>
        <service id="Sylius\Component\Payment\Resolver\DefaultPaymentMethodResolverInterface" alias="sylius.payment_method_resolver.default" />

        <service id="sylius.shipping_method_resolver.default" class="Sylius\Component\Core\Resolver\EligibleDefaultShippingMethodResolver">
            <argument type="service" id="sylius.repository.shipping_method" />
            <argument type="service" id="sylius.shipping_method_eligibility_checker" />
            <argument type="service" id="sylius.zone_matcher" />
        </service>
        <service id="Sylius\Component\Shipping\Resolver\DefaultShippingMethodResolverInterface" alias="sylius.shipping_method_resolver.default" />

        <service id="sylius.taxation_address_resolver" class="Sylius\Component\Core\Resolver\TaxationAddressResolver">
            <argument>%sylius_core.taxation.shipping_address_based_taxation%</argument>
        </service>

        <service id="sylius.context.customer" class="Sylius\Bundle\CoreBundle\Context\CustomerContext">
            <argument type="service" id="security.token_storage" />
            <argument type="service" id="security.authorization_checker" />
        </service>
        <service id="Sylius\Component\Customer\Context\CustomerContextInterface" alias="sylius.context.customer" />

        <service id="sylius.inventory.order_item_availability_checker" class="Sylius\Component\Core\Inventory\Checker\OrderItemAvailabilityChecker"/>
        <service id="Sylius\Component\Core\Inventory\Checker\OrderItemAvailabilityCheckerInterface" alias="sylius.inventory.order_item_availability_checker" />

        <service id="sylius.inventory.order_inventory_operator" class="Sylius\Component\Core\Inventory\Operator\OrderInventoryOperator"/>
        <service id="Sylius\Component\Core\Inventory\Operator\OrderInventoryOperatorInterface" alias="sylius.inventory.order_inventory_operator" />

        <service id="sylius.custom_inventory.order_inventory_operator" class="Sylius\Bundle\CoreBundle\Doctrine\ORM\Inventory\Operator\OrderInventoryOperator" decorates="sylius.inventory.order_inventory_operator" public="false">
            <argument type="service" id="sylius.custom_inventory.order_inventory_operator.inner" />
            <argument type="service" id="sylius.manager.product_variant" />
        </service>

        <service id="sylius.custom_factory.order_item" class="Sylius\Component\Core\Factory\CartItemFactory" decorates="sylius.factory.order_item" decoration-priority="256" public="false">
            <argument type="service" id="sylius.custom_factory.order_item.inner" />
            <argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
        </service>
        <service id="sylius.factory.cart_item" alias="sylius.custom_factory.order_item" />
        <service id="sylius.custom_factory.address" class="Sylius\Component\Core\Factory\AddressFactory" decorates="sylius.factory.address" decoration-priority="256" public="false">
            <argument type="service" id="sylius.custom_factory.address.inner" />
        </service>

        <service id="sylius.custom_factory.channel" class="Sylius\Component\Core\Factory\ChannelFactory" decorates="sylius.factory.channel" decoration-priority="256" public="false">
            <argument type="service" id="sylius.custom_factory.channel.inner" />
            <argument>order_items_based</argument>
            <argument type="service" id="sylius.factory.channel_price_history_config" />
        </service>

        <service id="sylius.factory.customer_after_checkout" class="Sylius\Component\Core\Factory\CustomerAfterCheckoutFactory">
            <argument type="service" id="sylius.factory.customer" />
        </service>
        <service id="Sylius\Component\Core\Factory\CustomerAfterCheckoutFactoryInterface" alias="sylius.factory.customer_after_checkout" />

        <service id="sylius.twig.extension.product_variants_prices" class="Sylius\Bundle\CoreBundle\Twig\ProductVariantsPricesExtension" public="false">
            <argument type="service" id="sylius.templating.helper.product_variants_prices" />
            <tag name="twig.extension" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\Twig\ProductVariantsMapExtension">
            <argument type="service" id="Sylius\Component\Core\Provider\ProductVariantMap\ProductVariantsMapProviderInterface" />
            <tag name="twig.extension" />
        </service>

        <service id="sylius.twig.extension.checkout_steps" class="Sylius\Bundle\CoreBundle\Twig\CheckoutStepsExtension" public="false">
            <argument type="service" id="sylius.templating.helper.checkout_steps" />
            <tag name="twig.extension" />
        </service>

        <service id="sylius.unique_id_based_order_token_assigner" class="Sylius\Component\Core\TokenAssigner\UniqueIdBasedOrderTokenAssigner">
            <argument type="service" id="sylius.random_generator" />
            <argument>%sylius_core.order_token_length%</argument>
        </service>
        <service id="Sylius\Component\Core\TokenAssigner\OrderTokenAssignerInterface" alias="sylius.unique_id_based_order_token_assigner" />

        <service id="sylius.customer_unique_address_adder" class="Sylius\Component\Core\Customer\CustomerUniqueAddressAdder">
            <argument type="service" id="sylius.address_comparator" />
        </service>
        <service id="Sylius\Component\Core\Customer\CustomerAddressAdderInterface" alias="sylius.customer_unique_address_adder" />

        <service id="sylius.customer_order_addresses_saver" class="Sylius\Component\Core\Customer\CustomerOrderAddressesSaver">
            <argument type="service" id="sylius.customer_unique_address_adder" />
        </service>
        <service id="Sylius\Component\Core\Customer\OrderAddressesSaverInterface" alias="sylius.customer_order_addresses_saver" />

        <service id="sylius.order_item_quantity_modifier.limiting" class="Sylius\Component\Core\Cart\Modifier\LimitingOrderItemQuantityModifier" decorates="sylius.order_item_quantity_modifier" decoration-priority="256">
            <argument type="service" id="sylius.order_item_quantity_modifier.limiting.inner" />
            <argument>%sylius.order_item_quantity_modifier.limit%</argument>
        </service>

        <service id="sylius.customer_ip_assigner" class="Sylius\Bundle\CoreBundle\Assigner\CustomerIpAssigner" />
        <service id="Sylius\Bundle\CoreBundle\Assigner\IpAssignerInterface" alias="sylius.customer_ip_assigner" />

        <service
            id="sylius.calculator.product_variant_price"
            class="Sylius\Component\Core\Calculator\ProductVariantPriceCalculator"
        >
            <argument type="service" id="Sylius\Component\Core\Checker\ProductVariantLowestPriceDisplayCheckerInterface" />
        </service>
        <service id="Sylius\Component\Core\Calculator\ProductVariantPriceCalculatorInterface" alias="sylius.calculator.product_variant_price" />

        <service id="sylius.section_resolver.uri_based_section_resolver" class="Sylius\Bundle\CoreBundle\SectionResolver\UriBasedSectionProvider">
            <argument type="service" id="request_stack" />
            <argument type="collection" />
        </service>
        <service id="Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface" alias="sylius.section_resolver.uri_based_section_resolver" />

        <service id="sylius.reviewer_reviews_remover" class="Sylius\Bundle\CoreBundle\Remover\ReviewerReviewsRemover">
            <argument type="service" id="sylius.repository.product_review" />
            <argument type="service" id="sylius.manager.product_review" />
            <argument type="service" id="sylius.product_review.average_rating_updater" />
        </service>
        <service id="Sylius\Bundle\CoreBundle\Remover\ReviewerReviewsRemoverInterface" alias="sylius.reviewer_reviews_remover" />

        <service id="Sylius\Bundle\CoreBundle\PriceHistory\Remover\ChannelPricingLogEntriesRemoverInterface" class="Sylius\Bundle\CoreBundle\PriceHistory\Remover\ChannelPricingLogEntriesRemover">
            <argument type="service" id="sylius.repository.channel_pricing_log_entry" />
            <argument type="service" id="doctrine.orm.entity_manager" />
            <argument type="service" id="Sylius\Calendar\Provider\DateTimeProviderInterface" />
            <argument type="service" id="event_dispatcher" />
            <argument>%sylius.channel_pricing_log_entry.old_logs_removal_batch_size%</argument>
        </service>

        <service id="sylius.unpaid_orders_state_updater" class="Sylius\Component\Core\Updater\UnpaidOrdersStateUpdater">
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="sylius_abstraction.state_machine" />
            <argument>%sylius_order.order_expiration_period%</argument>
            <argument type="service" id="logger" />
            <argument type="service" id="sylius.manager.order" />
        </service>
        <service id="Sylius\Component\Core\Updater\UnpaidOrdersStateUpdaterInterface" alias="sylius.unpaid_orders_state_updater" />

        <service id="sylius.order_payment_provider" class="Sylius\Component\Core\Payment\Provider\OrderPaymentProvider">
            <argument type="service" id="sylius.payment_method_resolver.default" />
            <argument type="service" id="sylius.factory.payment" />
            <argument type="service" id="sylius_abstraction.state_machine" />
        </service>
        <service id="Sylius\Component\Core\Payment\Provider\OrderPaymentProviderInterface" alias="sylius.order_payment_provider" />

        <service id="Sylius\Component\Core\Payment\Remover\OrderPaymentsRemoverInterface" class="Sylius\Component\Core\Payment\Remover\OrderPaymentsRemover" />

        <service id="sylius.customer_statistics_provider" class="Sylius\Component\Core\Customer\Statistics\CustomerStatisticsProvider">
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="sylius.repository.channel" />
        </service>
        <service id="Sylius\Component\Core\Customer\Statistics\CustomerStatisticsProviderInterface" alias="sylius.customer_statistics_provider" />

        <service id="sylius.sequential_order_number_generator" class="Sylius\Bundle\CoreBundle\Order\NumberGenerator\SequentialOrderNumberGenerator">
            <argument type="service" id="sylius.repository.order_sequence" />
            <argument type="service" id="sylius.factory.order_sequence" />
            <argument type="service" id="sylius.manager.order_sequence" />
        </service>

        <service id="sylius.custom_resource_controller.resource_update_handler" class="Sylius\Bundle\CoreBundle\Doctrine\ORM\Handler\ResourceUpdateHandler" decorates="sylius.resource_controller.resource_update_handler" public="false">
            <argument type="service" id="sylius.custom_resource_controller.resource_update_handler.inner" />
            <argument type="service" id="doctrine.orm.entity_manager" />
        </service>

        <service id="sylius.custom_resource_controller.resource_delete_handler" class="Sylius\Bundle\CoreBundle\Doctrine\ORM\Handler\ResourceDeleteHandler" decorates="sylius.resource_controller.resource_delete_handler" public="false">
            <argument type="service" id="sylius.custom_resource_controller.resource_delete_handler.inner" />
            <argument type="service" id="doctrine.orm.entity_manager" />
        </service>

        <service id="sylius.order_item_names_setter" class="Sylius\Component\Core\Order\OrderItemNamesSetter" />
        <service id="Sylius\Component\Core\Order\OrderItemNamesSetterInterface" alias="sylius.order_item_names_setter" />

        <service id="sylius.grid_filter.entities" class="Sylius\Component\Core\Grid\Filter\EntitiesFilter">
            <tag name="sylius.grid_filter" type="entities" form-type="Sylius\Bundle\CoreBundle\Form\Type\Grid\Filter\EntitiesFilterType" />
        </service>
        <service id="sylius.grid_filter.resource_autocomplete" class="Sylius\Component\Core\Grid\Filter\ResourceAutocompleteFilter">
            <tag name="sylius.grid_filter" type="resource_autocomplete" form-type="Sylius\Bundle\CoreBundle\Form\Type\Grid\Filter\ResourceAutocompleteFilterType" />
        </service>

        <service id="Sylius\Component\Core\Cart\Resolver\CreatedByGuestFlagResolverInterface" class="Sylius\Component\Core\Cart\Resolver\CreatedByGuestFlagResolver">
            <argument type="service" id="security.token_storage" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\Order\Checker\OrderPromotionsIntegrityCheckerInterface" class="Sylius\Bundle\CoreBundle\Order\Checker\OrderPromotionsIntegrityChecker">
            <argument type="service" id="sylius.order_processing.order_processor" />
        </service>

        <service id="sylius.user_password_resetter.admin" class="Sylius\Bundle\CoreBundle\Security\UserPasswordResetter">
            <argument type="service" id="sylius.repository.admin_user" />
            <argument type="service" id="Sylius\Component\User\Security\PasswordUpdaterInterface" />
            <argument type="string">%sylius.admin_user.token.password_reset.ttl%</argument>
        </service>

        <service id="sylius.user_password_resetter.shop" class="Sylius\Bundle\CoreBundle\Security\UserPasswordResetter">
            <argument type="service" id="sylius.repository.shop_user" />
            <argument type="service" id="Sylius\Component\User\Security\PasswordUpdaterInterface" />
            <argument type="string">%sylius.shop_user.token.password_reset.ttl%</argument>
        </service>

        <service id="Sylius\Bundle\CoreBundle\MessageDispatcher\ResetPasswordDispatcher">
            <argument type="service" id="sylius.command_bus" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\MessageDispatcher\ResendOrderConfirmationEmailDispatcherInterface" class="Sylius\Bundle\CoreBundle\MessageDispatcher\ResendOrderConfirmationEmailDispatcher">
            <argument type="service" id="sylius.command_bus" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\MessageDispatcher\ResendShipmentConfirmationEmailDispatcher">
            <argument type="service" id="sylius.command_bus" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\Resolver\CustomerResolverInterface" class="Sylius\Bundle\CoreBundle\Resolver\CustomerResolver">
            <argument type="service" id="sylius.factory.customer" />
            <argument type="service" id="Sylius\Bundle\CoreBundle\Provider\CustomerProviderInterface" />
        </service>

        <service id="Sylius\Component\Core\Statistics\Registry\OrdersTotalsProvidersRegistryInterface" class="Sylius\Component\Core\Statistics\Registry\OrdersTotalsProvidersRegistry">
            <argument type="tagged_iterator" index-by="type" tag="sylius.statistics.orders_totals_provider" />
        </service>

        <service id="Sylius\Component\Core\Positioner\PositionerInterface" class="Sylius\Component\Core\Positioner\Positioner" />
    </services>
</container>
