<?php
namespace Prodigy\Includes\Support\Addons\Elementor\Widgets\Product;

use Elementor\Controls_Manager;

if ( ! defined( 'ABSPATH' ) ) {
	die( '-1' );
}

/**
 * @version 2.0.7
 */
class Prodigy_Brands extends \Elementor\Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve oEmbed widget name.
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'pae-brands';
	}


	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the oEmbed widget belongs to.
	 *
	 * @return array Widget categories.
	 * @since 1.0.0
	 * @access public
	 */
	public function get_categories() {
		return array( 'prodigy-elements-single' );
	}

	/**
	 * Get widget price-range.
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return __( 'Product Brands List', 'prodigy-commerce' );
	}

	/**
	 * Get widget icon.
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'prgicon prgicon-brand';
	}

	/**
	 * Register oEmbed widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 */
	protected function register_controls() {
		/*
		* General
		*/
		$this->start_controls_section(
			'prg_product_brands_list',
			array(
				'label' => __( 'General', 'prodigy-commerce' ),
				'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
			)
		);

		$this->add_control(
			'prg_product_brands_dropdown_default_text',
			array(
				'label'   => __( 'Dropdown Default text', 'prodigy-commerce' ),
				'type'    => Controls_Manager::TEXT,
				'default' => 'Choose an option...',
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_padding',
			array(
				'label'          => __( 'Padding', 'prodigy-commerce' ),
				'type'           => Controls_Manager::DIMENSIONS,
				'size_units'     => array( 'px', 'em' ),
				'default'        => array(
					'unit'     => 'px',
					'top'      => '16',
					'right'    => '0',
					'bottom'   => '16',
					'left'     => '0',
					'isLinked' => false,
				),
				'tablet_default' => array(
					'unit'     => 'px',
					'top'      => '16',
					'right'    => '0',
					'bottom'   => '16',
					'left'     => '0',
					'isLinked' => false,
				),
				'mobile_default' => array(
					'unit'     => 'px',
					'top'      => '16',
					'right'    => '0',
					'bottom'   => '16',
					'left'     => '0',
					'isLinked' => false,
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget.prodigy-select__product-brands-widget' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
				),
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_margin',
			array(
				'label'          => __( 'Margin', 'prodigy-commerce' ),
				'type'           => Controls_Manager::DIMENSIONS,
				'size_units'     => array( 'px', 'em' ),
				'default'        => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '0',
					'bottom'   => '0',
					'left'     => '0',
					'isLinked' => false,
				),
				'tablet_default' => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '0',
					'bottom'   => '0',
					'left'     => '0',
					'isLinked' => false,
				),
				'mobile_default' => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '0',
					'bottom'   => '0',
					'left'     => '0',
					'isLinked' => false,
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget.prodigy-select__product-brands-widget' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_label',
			array(
				'label'     => __( 'Label', 'prodigy-commerce' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_label_padding',
			array(
				'label'          => __( 'Padding', 'prodigy-commerce' ),
				'type'           => Controls_Manager::DIMENSIONS,
				'size_units'     => array( 'px', 'em' ),
				'default'        => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '0',
					'bottom'   => '8',
					'left'     => '0',
					'isLinked' => false,
				),
				'tablet_default' => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '0',
					'bottom'   => '8',
					'left'     => '0',
					'isLinked' => false,
				),
				'mobile_default' => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '0',
					'bottom'   => '8',
					'left'     => '0',
					'isLinked' => false,
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-product__product-brand-text-label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
				),
			)
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			array(
				'name'           => 'prg_product_brands_list_label_text_typography',
				'label'          => __( 'Typography', 'prodigy-commerce' ),
				'selector'       => '{{WRAPPER}} .prodigy-product__product-brand-text-label--inner',
				'fields_options' => array(
					'typography'     => array( 'default' => 'yes' ),
					'font_size'      => array(
						'default'        => array(
							'unit' => 'px',
							'size' => 14,
						),
						'tablet_default' => array(
							'unit' => 'px',
							'size' => 14,
						),
						'mobile_default' => array(
							'unit' => 'px',
							'size' => 14,
						),
					),
					'font_weight'    => array(
						'default' => 400,
					),
					'line_height'    => array(
						'default'        => array(
							'unit' => 'px',
							'size' => 18,
						),
						'tablet_default' => array(
							'unit' => 'px',
							'size' => 18,
						),
						'mobile_default' => array(
							'unit' => 'px',
							'size' => 18,
						),
					),
					'letter_spacing' => array(
						'default'        => array(
							'unit' => 'px',
							'size' => 0,
						),
						'tablet_default' => array(
							'unit' => 'px',
							'size' => 0,
						),
						'mobile_default' => array(
							'unit' => 'px',
							'size' => 0,
						),
					),
					'word_spacing'   => array(
						'default'        => array(
							'unit' => 'em',
							'size' => 0,
						),
						'tablet_default' => array(
							'unit' => 'em',
							'size' => 0,
						),
						'mobile_default' => array(
							'unit' => 'em',
							'size' => 0,
						),
					),
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_label_text_color',
			array(
				'label'      => __( 'Text Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#3a3a3a',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-product__product-brand-text-label--inner' => 'color: {{VALUE}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_dropdown',
			array(
				'label'     => __( 'Dropdown', 'prodigy-commerce' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);

		$this->add_control(
			'prg_product_brands_list_default_text',
			array(
				'label'   => __( 'Dropdown Default text', 'prodigy-commerce' ),
				'type'    => Controls_Manager::TEXT,
				'default' => 'Choose an option...',
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_alignment',
			array(
				'label'          => __( 'Alignment', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SELECT,
				'default'        => 'start',
				'tablet_default' => 'center',
				'mobile_default' => 'end',
				'options'        => array(
					'start'  => __( 'Left', 'prodigy-commerce' ),
					'center' => __( 'Center', 'prodigy-commerce' ),
					'end'    => __( 'Right', 'prodigy-commerce' ),
				),
				'description'    => __( 'In order to use this setting, width of the select should be less than 100%', 'prodigy-commerce' ),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget.prodigy-select__product-brands-widget' => 'align-items: {{VALUE}} !important',
				),
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_width',
			array(
				'label'          => __( 'Width', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SLIDER,
				'size_units'     => array( 'px', '%' ),
				'default'        => array(
					'size' => 100,
					'unit' => '%',
				),
				'tablet_default' => array(
					'size' => 100,
					'unit' => '%',
				),
				'mobile_default' => array(
					'size' => 100,
					'unit' => '%',
				),
				'range'          => array(
					'px' => array(
						'min'  => 0,
						'max'  => 2000,
						'step' => 1,
					),
					'%'  => array(
						'min'  => 0,
						'max'  => 100,
						'step' => 1,
					),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget.prodigy-select__product-brands-widget' => 'width: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_select',
			array(
				'label'     => __( 'Select', 'prodigy-commerce' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_select_alignment',
			array(
				'label'          => __( 'Alignment', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SELECT,
				'default'        => 'left',
				'tablet_default' => 'left',
				'mobile_default' => 'left',
				'options'        => array(
					'left'   => __( 'Left', 'prodigy-commerce' ),
					'center' => __( 'Center', 'prodigy-commerce' ),
					'right'  => __( 'Right', 'prodigy-commerce' ),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands' => 'text-align: {{VALUE}}',
				),
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_select_width',
			array(
				'label'          => __( 'Width', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SLIDER,
				'size_units'     => array( 'px', '%' ),
				'default'        => array(
					'size' => 100,
					'unit' => '%',
				),
				'tablet_default' => array(
					'size' => 100,
					'unit' => '%',
				),
				'mobile_default' => array(
					'size' => 100,
					'unit' => '%',
				),
				'range'          => array(
					'px' => array(
						'min'  => 0,
						'max'  => 2000,
						'step' => 1,
					),
					'%'  => array(
						'min'  => 0,
						'max'  => 100,
						'step' => 1,
					),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands' => 'width: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_select_border_color',
			array(
				'label'      => __( 'Select Border Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#bfc2cc',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd-header' => 'border-color: {{VALUE}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_select_arrow_color',
			array(
				'label'      => __( 'Select Arrow Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#000000',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-list-option .ms-dd-arrow:before' => 'border-top-color: {{VALUE}};border-left-color: {{VALUE}} !important',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_select_border_radius',
			array(
				'label'      => __( 'Select Radius', 'prodigy-commerce' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'default'    => array(
					'size' => 0,
					'unit' => 'px',
				),
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd-header' => 'border-radius: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_dropdown_block_border_radius',
			array(
				'label'      => __( 'Dropdown Radius', 'prodigy-commerce' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'default'    => array(
					'size' => 0,
					'unit' => 'px',
				),
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd ul.ms-options' => 'border-radius: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_dropdown_height',
			array(
				'label'      => __( 'Dropdown Hight', 'prodigy-commerce' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'default'    => array(
					'size' => 186,
					'unit' => 'px',
				),
				'range'      => array(
					'px' => array(
						'min'  => 0,
						'max'  => 1000,
						'step' => 1,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands ul.ms-options' => 'max-height: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->start_controls_tabs( 'Brand Options Tabs' );

		$this->start_controls_tab(
			'prg_product_brands_list_option_bg_color_tab_normal',
			array(
				'label' => __( 'Normal', 'prodigy-commerce' ),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_item_bg_color',
			array(
				'label'      => __( 'Background Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#ffffff',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-list-option' => 'background-color: {{VALUE}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_color_value',
			array(
				'label'      => __( 'Option Text Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#2a3658',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-options .ms-dd-label' => 'color: {{VALUE}} !important',
				),
			)
		);

		$this->end_controls_tab();

		$this->start_controls_tab(
			'prg_product_brands_list_option_item_tab_hover',
			array(
				'label' => __( 'Hover', 'prodigy-commerce' ),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_item_bg_color_tab_hover',
			array(
				'label'      => __( 'Background Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#0274be',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-list-option:hover' => 'background-color: {{VALUE}} !important',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_color_hover_value',
			array(
				'label'      => __( 'Option Text Color Hover', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#ffffff',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-list-option:hover .ms-dd-label' => 'color: {{VALUE}} !important',
				),
			)
		);

		$this->end_controls_tab();

		$this->start_controls_tab(
			'prg_product_brands_list_option_item_tab_selected',
			array(
				'label' => __( 'Selected', 'prodigy-commerce' ),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_item_bg_color_tab_selected',
			array(
				'label'      => __( 'Background Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#0274be',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands li.ms-list-option.option-selected.enabled:not(:first-child)' => 'background: {{VALUE}} !important',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_color_selected_value',
			array(
				'label'      => __( 'Option Text Color Selected', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => 'white',
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands li.ms-list-option.option-selected:not(:first-child) .ms-dd-label' => 'color: {{VALUE}} !important',
				),
			)
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->add_control(
			'prg_product_brands_list_option_img',
			array(
				'label'     => __( 'Image', 'prodigy-commerce' ),
				'type'      => Controls_Manager::HEADING,
				'separator' => 'before',
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_option_img_displaying',
			array(
				'label'          => __( 'Displaying', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SELECT,
				'default'        => 'block',
				'tablet_default' => 'block',
				'mobile_default' => 'block',
				'options'        => array(
					'block' => __( 'Show', 'prodigy-commerce' ),
					'none'  => __( 'Hide', 'prodigy-commerce' ),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'display: {{VALUE}} !important',
				),
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_option_img_alignment',
			array(
				'label'          => __( 'Alignment', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SELECT,
				'default'        => 'row',
				'tablet_default' => 'row',
				'mobile_default' => 'row',
				'options'        => array(
					'row'         => __( 'Normal', 'prodigy-commerce' ),
					'row-reverse' => __( 'Reverse', 'prodigy-commerce' ),
				),
				'condition'      => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-middle' => 'flex-direction: {{VALUE}} !important',
				),
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_option_img_margin',
			array(
				'label'          => __( 'Margin', 'prodigy-commerce' ),
				'type'           => Controls_Manager::DIMENSIONS,
				'size_units'     => array( 'px', 'em', '%' ),
				'default'        => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '12',
					'bottom'   => '0',
					'left'     => '0',
					'isLinked' => false,
				),
				'tablet_default' => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '12',
					'bottom'   => '0',
					'left'     => '0',
					'isLinked' => false,
				),
				'mobile_default' => array(
					'unit'     => 'px',
					'top'      => '0',
					'right'    => '12',
					'bottom'   => '0',
					'left'     => '0',
					'isLinked' => false,
				),
				'condition'      => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
				),
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_option_img_width',
			array(
				'label'          => __( 'Width', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SLIDER,
				'size_units'     => array( 'px' ),
				'default'        => array(
					'size' => 24,
					'unit' => 'px',
				),
				'tablet_default' => array(
					'size' => 24,
					'unit' => 'px',
				),
				'mobile_default' => array(
					'size' => 24,
					'unit' => 'px',
				),
				'condition'      => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'width: {{SIZE}}{{UNIT}}; min-width: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_option_img_height',
			array(
				'label'          => __( 'Height', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SLIDER,
				'size_units'     => array( 'px' ),
				'default'        => array(
					'size' => 24,
					'unit' => 'px',
				),
				'tablet_default' => array(
					'size' => 24,
					'unit' => 'px',
				),
				'mobile_default' => array(
					'size' => 24,
					'unit' => 'px',
				),
				'condition'      => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'height: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->add_responsive_control(
			'prg_product_brands_list_option_img_border_radius',
			array(
				'label'          => __( 'Border Radius', 'prodigy-commerce' ),
				'type'           => Controls_Manager::SLIDER,
				'size_units'     => array( 'px', '%' ),
				'default'        => array(
					'size' => 0,
					'unit' => 'px',
				),
				'tablet_default' => array(
					'size' => 24,
					'unit' => 'px',
				),
				'mobile_default' => array(
					'size' => 24,
					'unit' => 'px',
				),
				'condition'      => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors'      => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'border-radius: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_img_color_border',
			array(
				'label'      => __( 'Border Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#e9eaee',
				'condition'  => array(
					'prg_product_brands_list_option_img_border_type' => array(
						'dotted',
						'dashed',
						'solid',
						'double',
						'groove',
						'ridge',
						'inset',
						'outset',
						'hidden',
					),
				),
				'condition'  => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'border-color: {{SIZE}}{{UNIT}}',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_img_border_width',
			array(
				'label'      => __( 'Border Width', 'prodigy-commerce' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px' ),
				'default'    => array(
					'unit'     => 'px',
					'top'      => '1',
					'right'    => '1',
					'bottom'   => '1',
					'left'     => '1',
					'isLinked' => true,
				),
				'condition'  => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_img_border_type',
			array(
				'label'     => __( 'Border Type', 'prodigy-commerce' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'solid',
				'options'   => array(
					'none'   => esc_attr( 'none' ),
					'dotted' => esc_attr( 'dotted' ),
					'dashed' => esc_attr( 'dashed' ),
					'double' => esc_attr( 'double' ),
					'groove' => esc_attr( 'groove' ),
					'ridge'  => esc_attr( 'ridge' ),
					'inset'  => esc_attr( 'inset' ),
					'outset' => esc_attr( 'outset' ),
					'hidden' => esc_attr( 'hidden' ),
					'solid'  => esc_attr( 'solid' ),
				),
				'condition' => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors' => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'border-style: {{SIZE}} !important',
				),
			)
		);

		$this->add_control(
			'prg_product_brands_list_option_img_bg_border',
			array(
				'label'      => __( 'Background Color', 'prodigy-commerce' ),
				'type'       => Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'    => '#e9eaee',
				'condition'  => array(
					'prg_product_brands_list_option_img_displaying' => array(
						'block',
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .prodigy-select__product-brands-widget .prodigy-select__product-brands .ms-dd .ms-dd-option-image' => 'background-color: {{VALUE}}',
				),
			)
		);

		$this->end_controls_section();
	}


	/**
	 * Render oEmbed widget output on the frontend.
	 *
	 * Written in PHP and used to generate the final HTML.
	 */
	protected function render() {
		$settings = $this->get_settings_for_display();

		do_action( 'prodigy_get_template_product_brands', $settings );
	}
}
