<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">widget_recently_viewed.recently_viewed_datasource</item>
        </item>
    </argument>
    <settings>
        <deps>
            <dep>widget_recently_viewed.recently_viewed_datasource</dep>
        </deps>
        <spinner>widget_columns</spinner>
    </settings>
    <dataSource name="recently_viewed_datasource" component="Magento_Catalog/js/product/provider">
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="productStorageConfig" xsi:type="array">
                        <item name="namespace" xsi:type="string">product_data_storage</item>
                        <item name="className" xsi:type="string">DataStorage</item>
                        <item name="updateRequestConfig" xsi:type="array">
                            <item name="url" xsi:type="serviceUrl" path="/products-render-info"/>
                        </item>
                    </item>
                    <item name="identifiersConfig" xsi:type="array">
                        <item name="namespace" xsi:type="string">recently_viewed_product</item>
                    </item>
                </item>
            </argument>
        </argument>
        <dataProvider class="\Magento\Catalog\Ui\DataProvider\Product\Listing\DataProvider" name="recently_viewed_datasource">
            <settings>
                <requestFieldName/>
                <primaryFieldName/>
            </settings>
        </dataProvider>
    </dataSource>
    <columns name="widget_columns" component="Magento_Catalog/js/product/list/listing" template="Magento_Catalog/product/list/listing">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Recently Viewed</item>
                <item name="additionalClasses" xsi:type="string">widget block-viewed-products-grid</item>
                <item name="listTemplate" xsi:type="string">Magento_Catalog/product/list/listing</item>
            </item>
        </argument>
        <settings>
            <displayMode>grid</displayMode>
        </settings>
        <column name="image" component="Magento_Catalog/js/product/list/columns/image" sortOrder="0" displayArea="general-area">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="imageCode" xsi:type="string">recently_viewed_products_grid_content_widget</item>
                </item>
            </argument>
            <settings>
                <label translate="true">Image</label>
                <bodyTmpl>Magento_Catalog/product/list/columns/image_with_borders</bodyTmpl>
            </settings>
        </column>
        <column name="name" component="Magento_Catalog/js/product/name" sortOrder="1" displayArea="details-area">
            <settings>
                <label translate="true">Name</label>
                <bodyTmpl>Magento_Catalog/product/name</bodyTmpl>
            </settings>
        </column>
        <column name="price" component="Magento_Catalog/js/product/list/columns/price-box" sortOrder="3" displayArea="details-area">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="renders" xsi:type="array">
                        <item name="prices" xsi:type="array">
                            <item name="default" xsi:type="array">
                                <item name="component" xsi:type="string">Magento_Catalog/js/product/list/columns/pricetype-box</item>
                                <item name="bodyTmpl" xsi:type="string">Magento_Catalog/product/final_price</item>
                                <item name="children" xsi:type="array">
                                    <item name="special_price" xsi:type="array">
                                        <item name="label" xsi:type="string" translate="true">Special Price</item>
                                        <item name="component" xsi:type="string">Magento_Catalog/js/product/list/columns/final-price</item>
                                        <item name="bodyTmpl" xsi:type="string">Magento_Catalog/product/price/special_price</item>
                                        <item name="sortOrder" xsi:type="number">1</item>
                                    </item>
                                    <item name="regular_price" xsi:type="array">
                                        <item name="label" xsi:type="string" translate="true">Regular Price</item>
                                        <item name="component" xsi:type="string">Magento_Catalog/js/product/list/columns/final-price</item>
                                        <item name="bodyTmpl" xsi:type="string">Magento_Catalog/product/price/regular_price</item>
                                        <item name="sortOrder" xsi:type="number">2</item>
                                    </item>
                                    <item name="minimal_price" xsi:type="array">
                                        <item name="label" xsi:type="string" translate="true"/>
                                        <item name="component" xsi:type="string">Magento_Catalog/js/product/list/columns/final-price</item>
                                        <item name="bodyTmpl" xsi:type="string">Magento_Catalog/product/price/minimal_price</item>
                                        <item name="sortOrder" xsi:type="number">3</item>
                                    </item>
                                    <item name="minimal_regular_price" xsi:type="array">
                                        <item name="label" xsi:type="string" translate="true">Regular Price</item>
                                        <item name="component" xsi:type="string">Magento_Catalog/js/product/list/columns/final-price</item>
                                        <item name="bodyTmpl" xsi:type="string">Magento_Catalog/product/price/minimal_regular_price</item>
                                        <item name="sortOrder" xsi:type="number">4</item>
                                    </item>
                                    <item name="max_price" xsi:type="array">
                                        <item name="label" xsi:type="string" translate="true"/>
                                        <item name="component" xsi:type="string">Magento_Catalog/js/product/list/columns/final-price</item>
                                        <item name="bodyTmpl" xsi:type="string">Magento_Catalog/product/price/max_price</item>
                                        <item name="sortOrder" xsi:type="number">5</item>
                                    </item>
                                    <item name="max_regular_price" xsi:type="array">
                                        <item name="label" xsi:type="string" translate="true">Regular Price</item>
                                        <item name="component" xsi:type="string">Magento_Catalog/js/product/list/columns/final-price</item>
                                        <item name="bodyTmpl" xsi:type="string">Magento_Catalog/product/price/max_regular_price</item>
                                        <item name="sortOrder" xsi:type="number">6</item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
            <settings>
                <label translate="true">Price</label>
            </settings>
        </column>
        <column name="addtocart-button" component="Magento_Catalog/js/product/addtocart-button" displayArea="action-primary-area">
            <settings>
                <label translate="true">Add To Cart</label>
                <bodyTmpl>Magento_Catalog/product/addtocart-button</bodyTmpl>
            </settings>
        </column>
        <column name="addtocompare-button" component="Magento_Catalog/js/product/addtocompare-button" sortOrder="2" displayArea="action-secondary-area">
            <settings>
                <label translate="true">Add To Compare</label>
                <bodyTmpl>Magento_Catalog/product/addtocompare-button</bodyTmpl>
            </settings>
        </column>
        <column name="learn-more" component="Magento_Catalog/js/product/learn-more" displayArea="description-area">
            <settings>
                <label translate="true">Learn more</label>
                <bodyTmpl>Magento_Catalog/product/link</bodyTmpl>
            </settings>
        </column>
    </columns>
</listing>
