<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Cookie Consent (GDPR) for Magento 2
 */-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\App\Response\Http">
        <plugin name="amcookieRemove" type="Amasty\GdprCookie\Plugin\Response\Http"/>
    </type>
    <type name="Amasty\GdprCookie\Plugin\Response\Http">
        <arguments>
            <argument name="cookieManager" xsi:type="object">Amasty\GdprCookie\Model\CookieManager\Proxy</argument>
        </arguments>
    </type>

    <type name="Magento\Framework\Controller\ResultInterface">
        <plugin name="GdprCookie::ProcessPageResult" type="Amasty\GdprCookie\Plugin\ProcessPageResult" sortOrder="25" />
    </type>
    <type name="Magento\Store\Model\StoreSwitcherInterface">
        <plugin name="GdprCookie::DetectStoreSwitch" type="Amasty\GdprCookie\Plugin\Model\StoreSwitcherPlugin" sortOrder="25" />
    </type>
    <type name="Magento\Framework\View\TemplateEngine\Php">
        <plugin name="Amasty_GdprCookie::AddCookieScriptViewModelToPhpRenderer" type="Amasty\GdprCookie\Plugin\Framework\View\TemplateEngine\PhpPlugin" sortOrder="20" />
    </type>
    <type name="Amasty\GdprCookie\Block\Consent">
        <arguments>
            <argument name="layoutProcessors" xsi:type="array">
                <item name="cookiebar" xsi:type="object">Amasty\GdprCookie\Model\Layout\CookieBarLayoutResolver</item>
                <item name="cookie_settings" xsi:type="object">Amasty\GdprCookie\Model\Layout\Modal\CookieSettings</item>
                <item name="cookie_information" xsi:type="object">Amasty\GdprCookie\Model\Layout\Modal\CookieInformation</item>
            </argument>
        </arguments>
    </type>
    <type name="Amasty\GdprCookie\Model\Layout\CookieBarLayoutResolver">
        <arguments>
            <argument name="cookieBarLayouts" xsi:type="array">
                <item name="0" xsi:type="object">Amasty\GdprCookie\Model\Layout\PopupClassic\Proxy</item>
                <item name="1" xsi:type="object">Amasty\GdprCookie\Model\Layout\SideBar\Proxy</item>
                <item name="2" xsi:type="object">Amasty\GdprCookie\Model\Layout\PopupClassic\Proxy</item>
            </argument>
        </arguments>
    </type>
    <type name="Amasty\GdprCookie\Model\Layout\Modal\CookieSettings">
        <arguments>
            <argument name="componentName" xsi:type="string">gdpr-cookie-settings-modal</argument>
            <argument name="componentJs" xsi:type="string">Amasty_GdprFrontendUi/js/modal/cookie-settings</argument>
            <argument name="locationPathInLayout" xsi:type="string">jsComponents/components/gdpr-cookie-modal</argument>
        </arguments>
    </type>
    <type name="Amasty\GdprCookie\Model\Layout\Modal\CookieInformation">
        <arguments>
            <argument name="componentName" xsi:type="string">gdpr-cookie-information-modal</argument>
            <argument name="componentJs" xsi:type="string">Amasty_GdprFrontendUi/js/modal/cookie-information</argument>
            <argument name="locationPathInLayout" xsi:type="string">jsComponents/components/gdpr-cookie-modal</argument>
        </arguments>
    </type>
</config>
