<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Customer Attributes Base 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\Customer\Model\Customer\DataProvider">
        <plugin name="Amasty_CustomerAttributes::admin-customer-create" type="Amasty\CustomerAttributes\Plugin\Customer\Model\DataProvider" />
    </type>
    <type name="Magento\Sales\Block\Adminhtml\Order\View\Info">
        <plugin name="Amasty_CustomerAttributes::admen-order-view" type="Amasty\CustomerAttributes\Plugin\Quote\Sales\Adminhtml\Order\View\Info" />
    </type>
    <type name="Magento\Framework\View\Element\UiComponent\Config\Provider\Component\Definition">
        <plugin name="Amasty_CustomerAttributes::admin-definition" type="Amasty\CustomerAttributes\Plugin\Component\Definition" />
    </type>
    <type name="Magento\Framework\Data\Form\Element\Fieldset">
        <plugin name="Amasty_CustomerAttributes::admin-order-create-form" type="Amasty\CustomerAttributes\Plugin\Form\Fieldset" />
    </type>
    <type name="Magento\Backend\Block\Widget\Grid\ColumnSet">
        <plugin name="Amasty_CustomerAttributes::admin-order-create-customer-grid-columnadd" type="Amasty\CustomerAttributes\Plugin\Grid\ColumnSet" />
    </type>
    <type name="Magento\Backend\Block\Widget\Grid">
        <plugin name="Amasty_CustomerAttributes::admin-order-create-customer-grid" type="Amasty\CustomerAttributes\Plugin\Grid\Grid" />
    </type>
    <type name="Magento\Customer\Ui\Component\ColumnFactory">
        <plugin name="Amasty_CustomerAttributes::admin-grid-column-renderer" type="Amasty\CustomerAttributes\Plugin\Customer\Ui\ColumnFactory" />
    </type>
    <type name="Magento\Sales\Model\ResourceModel\Order\Grid\Collection">
        <plugin name="Amasty_CustomerAttributes::admin-grid-column-add-data" type="Amasty\CustomerAttributes\Plugin\Sales\Model\ResourceModel\Order\Grid\Collection" />
    </type>
    <type name="Magento\Ui\Component\Listing\Columns">
        <plugin name="Amasty_CustomerAttributes::CustomerAddAttributesGridColumns" type="Amasty\CustomerAttributes\Plugin\Ui\Component\Listing\Columns" />
    </type>
    <type name="Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer">
        <plugin name="Amasty_CustomerAttributes::CustomerRenderAttributesGridColumns" type="Amasty\CustomerAttributes\Plugin\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer" />
    </type>
    <type name="Magento\Sales\Block\Adminhtml\Order\Create\Form\Account">
        <plugin name="Amasty_CustomerAttributes::CustomerOnCreateOrder" type="Amasty\CustomerAttributes\Plugin\Sales\Block\Adminhtml\Order\Create\Form\Account" />
    </type>
    <type name="Magento\Customer\Model\FileProcessor">
        <plugin name="Amasty_CustomerAttributes::CustomerUpload" type="Amasty\CustomerAttributes\Plugin\Customer\Model\FileProcessor" />
    </type>
    <type name="Magento\Customer\Model\Attribute">
        <plugin name="Amasty_CustomerAttributes::CustomerAttribute" type="Amasty\CustomerAttributes\Plugin\Magento\Customer\Model\Attribute" />
    </type>
    <type name="Magento\Sales\Model\AdminOrder\Create">
        <plugin name="Amasty_CustomerAttributes::CreateOrderAdmin" type="Amasty\CustomerAttributes\Plugin\Sales\Model\AdminOrder\Create" />
    </type>
    <type name="Magento\Customer\Model\Metadata\Form">
        <plugin name="Amasty_CustomerAttributes::Form" type="Amasty\CustomerAttributes\Plugin\Magento\Customer\Model\Metadata\Form" />
    </type>
    <type name="Amasty\CustomerAttributes\Plugin\Sales\Block\Adminhtml\Order\Create\Form\Account">
        <arguments>
            <argument name="sessionQuote" xsi:type="object">Magento\Backend\Model\Session\Quote\Proxy</argument>
        </arguments>
    </type>

    <type name="Magento\CustomerCustomAttributes\Helper\Data">
        <plugin name="Amasty_CustomerAttributes::helper_data" type="Amasty\CustomerAttributes\Plugin\CustomerCustomAttributes\Helper\Data\PrepareAttributeInputTypes" />
    </type>

    <type name="Magento\Eav\Model\Entity\Attribute\Source\Table">
        <plugin name="Amasty_CustomerAttributes::nameOptionByStore" type="Amasty\CustomerAttributes\Plugin\Backend\Eav\Model\Entity\Attribute\Source\Table\SetStoreIdPlugin" />
    </type>
</config>
