'use strict';
define(
    [
        'jquery',
        'underscore',
        'oro/translator',
        'pim/common/item-picker',
        'webkuldam/template/select/item-picker-basket',
        'pim/media-url-generator'
    ],
    function (
        $,
        _,
        __,
        parentAssetPicker,
        basketTemplate,
        MediaUrlGenerator
        
    ) {
        return parentAssetPicker.extend({
            basketTemplate: _.template(basketTemplate),
            /**
             * Renders the basket to update its content
             * @param items
             */
            renderBasket: function (items) {
                this.$('.basket').html(this.basketTemplate({
                    items: items,
                    title: __('pim_enrich.entity.product.module.basket.title'),
                    emptyLabel: __('pim_enrich.entity.product.module.basket.empty_basket'),
                    imagePathMethod: this.imagePathMethod.bind(this),
                    columnName: this.config.columnName,
                    identifierName: this.config.columnName,
                    labelMethod: this.labelMethod.bind(this),
                    itemCodeMethod: this.itemCodeMethod.bind(this),
                    MediaUrlGenerator: MediaUrlGenerator
                }));
            },
        });
    }
);
