<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <!--HELP-->
    <preference for="Mirasvit\Core\Api\Service\ManualServiceInterface" type="Mirasvit\Core\Service\ManualService"/>

    <!--INTERFACES-->
    <preference for="Mirasvit\Core\Api\UrlRewriteHelperInterface" type="Mirasvit\Core\Helper\UrlRewrite" />
    <preference for="Mirasvit\Core\Api\ImageHelperInterface" type="Mirasvit\Core\Helper\Image" />
    <preference for="Mirasvit\Core\Api\CronHelperInterface" type="Mirasvit\Core\Helper\Cron" />
    <preference for="Mirasvit\Core\Api\TextHelperInterface" type="Mirasvit\Core\Helper\Text" />
    <preference for="Mirasvit\Core\Api\ParseVariablesHelperInterface" type="Mirasvit\Core\Helper\ParseVariables" />

    <!--SERVICES-->
    <preference for="Mirasvit\Core\Api\Service\ValidationServiceInterface" type="Mirasvit\Core\Service\ValidationService" />
    <preference for="Mirasvit\Core\Api\Service\CronServiceInterface" type="Mirasvit\Core\Service\CronService" />

    <type name="Magento\Framework\App\FrontController">
        <plugin name="mstCoreDispatch" type="Mirasvit\Core\Plugin\UrlRewritePlugin" sortOrder="1000"/>
    </type>

    <type name="Mirasvit\Core\Api\Service\ValidationServiceInterface">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="core" xsi:type="object">Mirasvit\Core\Service\GeneralValidationService</item>
            </argument>
        </arguments>
    </type>

    <!-- CLI Commands -->
    <type name="Magento\Framework\Console\CommandListInterface">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="mstCoreValidation" xsi:type="object">Mirasvit\Core\Console\Command\ValidationCommand</item>
                <item name="mstCoreInternalization" xsi:type="object">Mirasvit\Core\Console\Command\I18nFrontCollectPhrasesCommand</item>
            </argument>
        </arguments>
    </type>

    <!--UI-->
        <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
            <arguments>
                <argument name="collections" xsi:type="array">
                    <item name="mst_core_cron_job_listing_data_source" xsi:type="string">Mirasvit\Core\Model\ResourceModel\Job\Grid</item>
                </argument>
            </arguments>
        </type>
</config>
