<?php
namespace AtomicSlider\HeroShowcase\Widgets;

use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Group_Control_Image_Size;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Css_Filter;
use Elementor\Group_Control_Text_Shadow;
use Elementor\Icons_Manager;
use Elementor\Repeater;
use AtomicSlider\Utils;

if (!defined('ABSPATH')) {
	exit;
} // Exit if accessed directly

class Hero_Showcase extends \Elementor\Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Image Carousel widget name.
	 *
	 * @since 1.0.0
	 * @access public
	 * @return string Widget name.
	 */
	public function get_name(): string {
		return 'asa-hero-showcase';
	}

	/**
	 * Get widget title.
	 *
	 * Retrieve Image Carousel widget title.
	 *
	 * @since 1.0.0
	 * @access public
	 * @return string Widget title.
	 */
	public function get_title(): string {
		return esc_html__( 'Showcase', 'atomic-slider' );
	}

	/**
	 * Get widget icon.
	 *
	 * Retrieve Image Carousel widget icon.
	 *
	 * @since 1.0.0
	 * @access public
	 * @return string Widget icon.
	 */
	public function get_icon(): string {
		return 'asa-widget-icon eicon-nested-carousel';
	}

	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the Image Carousel widget belongs to.
	 *
	 * @since 1.0.0
	 * @access public
	 * @return array Widget categories.
	 */
	public function get_categories(): array {
		return [ 'atomic-slider' ];
	}

	/**
	 * Get widget keywords.
	 *
	 * Retrieve the list of keywords the Image Carousel widget belongs to.
	 *
	 * @since 1.0.0
	 * @access public
	 * @return array Widget keywords.
	 */
	public function get_keywords(): array {
		return [ 'static carousel', 'static', 'carousel', 'slider' ];
	}

    /**
	 * Get style dependencies.
	 *
	 * Retrieve the list of style dependencies the widget requires.
	 *
	 * @since 3.24.0
	 * @access public
	 *
	 * @return array Widget style dependencies.
	 */
	public function get_style_depends(): array {
		return [ 'swiper', 'asa-hero-showcase' ];
	}

	/**
	 * Get script dependencies.
	 *
	 * Retrieve the list of script dependencies the widget requires.
	 *
	 * @since 3.24.0
	 * @access public
	 *
	 * @return array Widget script dependencies.
	 */
	public function get_script_depends(): array {
		return [ 'swiper', 'asa-hero-showcase' ];
	}

	/**
	 * Get custom help URL.
	 *
	 * Retrieve a URL where the user can get more information about the widget.
	 *
	 * @since 1.0.0
	 * @access public
	 * @return string Widget help URL.
	 */
	// public function get_custom_help_url(): string {
	// 	return 'https://developers.elementor.com/docs/widgets/';
	// }

    /**
	 * Whether the widget requires inner wrapper.
	 *
	 * Determine whether to optimize the DOM size.
	 *
	 * @since 1.0.0
	 * @access public
	 * @return bool Whether to optimize the DOM size.
	 */
	public function has_widget_inner_wrapper(): bool {
        return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
    }
	
    /**
	 * Whether the element returns dynamic content.
	 *
	 * Determine whether to cache the element output or not.
	 *
	 * @since 1.0.0
	 * @access protected
	 * @return bool Whether to cache the element output.
	 */
	protected function is_dynamic_content(): bool {
		return false;
	}

    protected function register_controls() {

        $this->start_controls_section(
            'section_carousel_content',
            [
                'label' => __('Items', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_CONTENT,
            ]
        );

        $repeater = new Repeater();

        $repeater->add_control(
            'image',
            [
                'label' => __('Image', 'atomic-slider'),
                'type' => Controls_Manager::MEDIA,
                'render_type' => 'template',
                'dynamic' => [
                    'active' => true,
                ],
                'default' => [
                    'url' => Utils::get_placeholder_image_src(),
                ],
            ]
        );

        $repeater->add_control(
            'title',
            [
                'label' => __('Title', 'atomic-slider'),
                'type' => Controls_Manager::TEXT,
                'dynamic' => [
                    'active' => true,
                ],
                'placeholder' => __('Enter your title', 'atomic-slider'),
                'label_block' => true,
            ]
        );

        $repeater->add_control(
            'sub_title',
            [
                'label' => __('Sub Title', 'atomic-slider'),
                'type' => Controls_Manager::TEXT,
                'dynamic' => [
                    'active' => true,
                ],
				'default' => __('Sub Title', 'atomic-slider'),
                'placeholder' => __('Enter your sub title', 'atomic-slider'),
                'label_block' => true,
            ]
        );

        $repeater->add_control(
            'text',
            [
                'label' => __('Text', 'atomic-slider'),
                'type' => Controls_Manager::WYSIWYG,
                'dynamic' => [
                    'active' => true,
                ],
                'default' => __('Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'atomic-slider'),
                'placeholder' => __('Enter your text', 'atomic-slider'),
            ]
        );

        $repeater->add_control(
            'readmore_link',
            [
                'label' => esc_html__('Link', 'atomic-slider'),
                'type' => Controls_Manager::URL,
                'dynamic' => ['active' => true],
                'placeholder' => 'http://your-link.com',
                'default' => [
                    'url' => '#',
                ],
            ]
        );

        $this->add_control(
            'carousel_items',
            [
                'show_label' => false,
                'type' => Controls_Manager::REPEATER,
                'fields' => $repeater->get_controls(),
                'title_field' => '{{{ title }}}',
                'default' => [
                    [
                        'title' => __('Item #1', 'atomic-slider'),
                    ],
                    [
                        'title' => __('Item #2', 'atomic-slider'),
                    ],
                    [
                        'title' => __('Item #3', 'atomic-slider'),
                    ],
                    [
                        'title' => __('Item #4', 'atomic-slider'),
                    ],
                ]
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'section_carousel_additional_settings',
            [
                'label' => __('Additional Settings', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'show_title',
            [
                'label' => __('Show Title', 'atomic-slider'),
                'type' => Controls_Manager::SWITCHER,
                'default' => 'yes',
                'separator' => 'before',
            ]
        );

        $this->add_control(
            'title_tag',
            [
                'label' => __('Title HTML Tag', 'atomic-slider'),
                'type' => Controls_Manager::SELECT,
                'default' => 'h3',
                'options' => atomicslider_title_tags(),
                'condition' => [
                    'show_title' => 'yes',
                ]
            ]
        );

        $this->add_control(
            'show_sub_title',
            [
                'label' => __('Show Sub Title', 'atomic-slider'),
                'type' => Controls_Manager::SWITCHER,
                'default' => 'yes',
                'separator' => 'before',
            ]
        );

        $this->add_control(
            'sub_title_tag',
            [
                'label' => __('Sub Title HTML Tag', 'atomic-slider'),
                'type' => Controls_Manager::SELECT,
                'default' => 'h4',
                'options' => atomicslider_title_tags(),
                'condition' => [
                    'show_sub_title' => 'yes',
                ]
            ]
        );

        $this->add_control(
            'show_text',
            [
                'label' => __('Show Text', 'atomic-slider'),
                'type' => Controls_Manager::SWITCHER,
				'default' => 'yes',
                'separator' => 'before',
            ]
        );
        $this->add_control(
            'readmore_link_to',
            [
                'type' => Controls_Manager::HIDDEN,
                'default' => 'button',
            ]
        );

        $this->add_control(
            'show_link_button',
            [
                'label' => __('Show Link Button', 'atomic-slider'),
                'type' => Controls_Manager::SWITCHER,
                'default' => 'yes',
                'separator' => 'before',
            ]
        );

        $this->add_control(
            'show_image',
            [
                'label' => __('Show Image', 'atomic-slider'),
                'type' => Controls_Manager::SWITCHER,
                'default' => 'yes',
                'separator' => 'before',
            ]
        );

        $this->add_group_control(
            Group_Control_Image_Size::get_type(),
            [
                'name' => 'thumbnail_size',
                'default' => 'medium',
                'condition' => [
                    'show_image' => 'yes'
                ]
            ]
        );

        $this->add_control(
            'enable_image_overlay',
            [
                'label' => __('Enable Image Overlay', 'atomic-slider'),
                'type' => Controls_Manager::SWITCHER,
                'default' => '',
                'condition' => [
                    'show_image' => 'yes'
                ],
                'separator' => 'before'
            ]
        );

        $this->add_control(
            'image_overlay_type',
            [
                'label' => __('Overlay Type', 'atomic-slider'),
                'type' => Controls_Manager::SELECT,
                'default' => 'dark',
                'options' => [
                    'dark' => __('Dark', 'atomic-slider'),
                    'light' => __('Light', 'atomic-slider'),
                    'primary' => __('Primary Color', 'atomic-slider'),
                    'custom' => __('Custom', 'atomic-slider'),
                ],
                'condition' => [
                    'show_image' => 'yes',
                    'enable_image_overlay' => 'yes'
                ]
            ]
        );

        $this->add_group_control(
            Group_Control_Background::get_type(),
            [
                'name' => 'image_overlay_background',
                'label' => __('Custom Overlay Background', 'atomic-slider'),
                'types' => [ 'classic', 'gradient' ],
                'selector' => '{{WRAPPER}} .asa-overlay-enabled.asa-overlay-custom .asa-hero-showcase-image::before',
                'condition' => [
                    'show_image' => 'yes',
                    'enable_image_overlay' => 'yes',
                    'image_overlay_type' => 'custom'
                ]
            ]
        );

        $this->add_responsive_control(
            'image_overlay_opacity',
            [
                'label' => __('Overlay Opacity', 'atomic-slider'),
                'type' => Controls_Manager::SLIDER,
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 1,
                        'step' => 0.1,
                    ],
                ],
                'default' => [
                    'size' => 0.5,
                ],
                'selectors' => [
                    '{{WRAPPER}} .asa-overlay-enabled .asa-hero-showcase-image::before' => 'opacity: {{SIZE}} !important;',
                    '{{WRAPPER}} .asa-overlay-enabled.asa-overlay-custom .asa-hero-showcase-image::before' => 'opacity: {{SIZE}} !important;',
                ],
                'condition' => [
                    'show_image' => 'yes',
                    'enable_image_overlay' => 'yes',
                    'image_overlay_type' => 'custom',
                ]
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'section_content_readmore',
            [
                'label' => esc_html__('Read More', 'atomic-slider'),
                'condition' => [
                    'readmore_link_to' => 'button',
                ],
            ]
        );

        $this->add_control(
            'readmore_text',
            [
                'label' => esc_html__('Read More Text', 'atomic-slider'),
                'type' => Controls_Manager::TEXT,
                'default' => esc_html__('Read More', 'atomic-slider'),
                'placeholder' => esc_html__('Read More', 'atomic-slider'),
            ]
        );

        $this->add_control(
            'readmore_icon',
            [
                'label' => esc_html__('Icon', 'atomic-slider'),
                'type' => Controls_Manager::ICONS,
                'label_block' => false,
                'skin' => 'inline'
            ]
        );

        $this->add_control(
            'icon_align',
            [
                'label' => esc_html__('Icon Position', 'atomic-slider'),
                'type' => Controls_Manager::CHOOSE,
                'default' => 'right',
                'toggle' => false,
                'options' => [
                    'left' => [
                        'title' => __('Left', 'atomic-slider'),
                        'icon' => 'eicon-h-align-left',
                    ],
                    'right' => [
                        'title' => __('Right', 'atomic-slider'),
                        'icon' => 'eicon-h-align-right',
                    ],
                ],
                'condition' => [
                    'readmore_icon[value]!' => '',
                ],
            ]
        );

        $this->add_responsive_control(
            'icon_indent',
            [
                'label' => esc_html__('Icon Spacing', 'atomic-slider'),
                'type' => Controls_Manager::SLIDER,
                'default' => [
                    'size' => 8,
                ],
                'range' => [
                    'px' => [
                        'max' => 50,
                    ],
                ],
                'condition' => [
                    'readmore_icon[value]!' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-readmore .asa-button-icon-align-right' => is_rtl() ? 'margin-right: {{SIZE}}{{UNIT}};' : 'margin-left: {{SIZE}}{{UNIT}};',
                    '{{WRAPPER}} .asa-hero-showcase-readmore .asa-button-icon-align-left' => is_rtl() ? 'margin-left: {{SIZE}}{{UNIT}};' : 'margin-right: {{SIZE}}{{UNIT}};',
                ],
            ]
        );

        $this->end_controls_section();

        //Navigation Controls
        $this->start_controls_section(
            'section_content_navigation',
            [
                'label' => __('Navigation', 'atomic-slider'),
            ]
        );

        $this->add_control(
			'show_navigation',
			[
				'label' => __('Show Navigation', 'atomic-slider'),
				'type' => Controls_Manager::SWITCHER,
				'default' => 'yes',
			]
		);

        $this->add_control(
			'show_pagination',
			[
				'label' => __('Show Pagination', 'atomic-slider'),
				'type' => Controls_Manager::SWITCHER,
				'default' => 'yes',
			]
		);

        $this->end_controls_section();

        $this->start_controls_section(
			'section_carousel_settings',
			[
				'label' => __('Slider Settings', 'atomic-slider'),
			]
		);

		$this->add_control(
			'skin',
			[
				'label'        => esc_html__('Layout', 'atomic-slider'),
				'type'         => Controls_Manager::SELECT,
				'default'      => 'slide',
				'options'      => [
					'slide'  => esc_html__('Slide', 'atomic-slider'),
					'fade'  => esc_html__('Fade', 'atomic-slider'),
				],
				'prefix_class' => 'asa-carousel-style-',
				'render_type'  => 'template',
			]
		);

		$this->add_control(
			'autoplay',
			[
				'label'   => __('Autoplay', 'atomic-slider'),
				'type'    => Controls_Manager::SWITCHER,
				'default' => 'yes',

			]
		);

		$this->add_control(
			'autoplay_speed',
			[
				'label'     => esc_html__('Autoplay Speed', 'atomic-slider'),
				'type'      => Controls_Manager::NUMBER,
				'default'   => 5000,
				'condition' => [
					'autoplay' => 'yes',
				],
			]
		);

		$this->add_control(
			'pauseonhover',
			[
				'label' => esc_html__('Pause on Hover', 'atomic-slider'),
				'type'  => Controls_Manager::SWITCHER,
			]
		);

		// $this->add_responsive_control(
		// 	'slides_to_scroll',
		// 	[
		// 		'type'           => Controls_Manager::SELECT,
		// 		'label'          => esc_html__('Slides to Scroll', 'atomic-slider'),
		// 		'default'        => 1,
		// 		'tablet_default' => 1,
		// 		'mobile_default' => 1,
		// 		'options'        => [
		// 			1 => '1',
		// 			2 => '2',
		// 			3 => '3',
		// 			4 => '4',
		// 			5 => '5',
		// 			6 => '6',
		// 		],
		// 	]
		// );

		// $this->add_control(
		// 	'centered_slides',
		// 	[
		// 		'label'       => __('Center Slide', 'atomic-slider'),
		// 		'description' => __('Use even items from Layout > Columns settings for better preview.', 'atomic-slider'),
		// 		'type'        => Controls_Manager::SWITCHER,
		// 	]
		// );

		$this->add_control(
			'grab_cursor',
			[
				'label' => __('Grab Cursor', 'atomic-slider'),
				'type'  => Controls_Manager::SWITCHER,
			]
		);

		$this->add_control(
			'free_mode',
			[
				'label' => __('Drag Free Mode', 'atomic-slider'),
				'type'  => Controls_Manager::SWITCHER,
			]
		);

		$this->add_control(
			'loop',
			[
				'label'   => __('Loop', 'atomic-slider'),
				'type'    => Controls_Manager::SWITCHER,
				'default' => 'yes',

			]
		);

		$this->add_control(
			'speed',
			[
				'label'   => __('Animation Speed (ms)', 'atomic-slider'),
				'type'    => Controls_Manager::SLIDER,
				'default' => [
					'size' => 500,
				],
				'range' => [
					'px' => [
						'min'  => 100,
						'max'  => 5000,
						'step' => 50,
					],
				],
			]
		);

		$this->add_control(
			'observer',
			[
				'label'       => __('Observer', 'atomic-slider'),
				'description' => __('When you use carousel in any hidden place (in tabs, accordion etc) keep it yes.', 'atomic-slider'),
				'type'        => Controls_Manager::SWITCHER,
			]
		);

		$this->add_control(
			'show_hidden_item',
			[
				'label' => __('Show Hidden Item', 'atomic-slider'),
				'type'  => Controls_Manager::SWITCHER,
				'prefix_class' => 'asa-show-hidden-item--',
				'render_type' => 'template'
			]
		);

		$this->add_control(
			'hidden_item_opacity',
			[
				'label' => __('Hidden Item Opacity', 'atomic-slider'),
				'type'  => Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 0.1,
						'max' => 1,
						'step' => 0.1,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .swiper-slide:not(.swiper-slide-visible)' => 'opacity: {{SIZE}};',
				],
				'condition' => [
					'show_hidden_item' => 'yes',
				],
			]
		);

		$this->end_controls_section();

        //Style Controls
        $this->start_controls_section(
            'section_style_content',
            [
                'label' => __('Content', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );


        $this->add_responsive_control(
            'content_padding',
            [
                'label' => esc_html__('Padding', 'atomic-slider'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', 'em', '%'],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_responsive_control(
            'content_margin',
            [
                'label' => esc_html__('Margin', 'atomic-slider'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', 'em', '%'],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->end_controls_section();

        $this->start_controls_section(
            'section_style_title',
            [
                'label' => __('Title', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => [
                    'show_title' => 'yes',
                ]
            ]
        );

        $this->add_control(
            'title_color',
            [
                'label' => __('Color', 'atomic-slider'),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-title' => 'color: {{VALUE}};',
                ],
            ]
        );

        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'title_typography',
                'selector' => '{{WRAPPER}} .asa-hero-showcase-title',
            ]
        );

        $this->add_group_control(
            Group_Control_Text_Shadow::get_type(),
            [
                'name' => 'title_shadow',
                'label' => __('Text Shadow', 'atomic-slider'),
                'selector' => '{{WRAPPER}} .asa-hero-showcase-title',
            ]
        );

        $this->add_responsive_control(
            'title_margin',
            [
                'label' => esc_html__('Margin', 'atomic-slider'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', 'em', '%'],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'section_style_sub_title',
            [
                'label' => __('Sub Title', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => [
                    'show_sub_title' => 'yes',
                ]
            ]
        );

        $this->add_control(
            'sub_title_color',
            [
                'label' => __('Color', 'atomic-slider'),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-sub-title' => 'color: {{VALUE}};',
                ],
            ]
        );

        $this->add_responsive_control(
            'sub_title_bottom_space',
            [
                'label' => __('Spacing', 'atomic-slider'),
                'type' => Controls_Manager::SLIDER,
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-sub-title' => 'padding-bottom: {{SIZE}}{{UNIT}};',
                ],
            ]
        );

        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'sub_title_typography',
                'selector' => '{{WRAPPER}} .asa-hero-showcase-sub-title',
            ]
        );

        $this->add_responsive_control(
            'sub_title_margin',
            [
                'label' => esc_html__('Margin', 'atomic-slider'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', 'em', '%'],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-sub-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'section_style_text',
            [
                'label' => __('Text', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => [
                    'show_text' => 'yes',
                ]
            ]
        );

        $this->add_control(
            'text_color',
            [
                'label' => __('Color', 'atomic-slider'),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-text' => 'color: {{VALUE}};',
                ],
            ]
        );

        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'text_typography',
                'selector' => '{{WRAPPER}} .asa-hero-showcase-text',
            ]
        );

        $this->add_responsive_control(
            'text_margin',
            [
                'label' => esc_html__('Margin', 'atomic-slider'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', 'em', '%'],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'section_style_readmore',
            [
                'label' => esc_html__('Read More', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => [
                    'readmore_link_to' => 'button',
                ],
            ]
        );

        $this->start_controls_tabs('tabs_readmore_style');

        $this->start_controls_tab(
            'tab_readmore_normal',
            [
                'label' => esc_html__('Normal', 'atomic-slider'),
            ]
        );

        $this->add_control(
            'readmore_color',
            [
                'label' => esc_html__('Color', 'atomic-slider'),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-readmore' => 'color: {{VALUE}};',
                    '{{WRAPPER}} .asa-hero-showcase-readmore svg' => 'fill: {{VALUE}};',
                ],
            ]
        );

        $this->add_group_control(
            Group_Control_Background::get_type(),
            [
                'name' => 'readmore_background',
                'selector' => '{{WRAPPER}} .asa-hero-showcase-readmore',
            ]
        );

        $this->add_group_control(
            Group_Control_Border::get_type(),
            [
                'name' => 'readmore_border',
                'label' => esc_html__('Border', 'atomic-slider'),
                'placeholder' => '1px',
                'default' => '1px',
                'selector' => '{{WRAPPER}} .asa-hero-showcase-readmore',
                'separator' => 'before',
            ]
        );

        $this->add_responsive_control(
            'readmore_radius',
            [
                'label' => esc_html__('Border Radius', 'atomic-slider'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', '%'],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-readmore' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_group_control(
            Group_Control_Box_Shadow::get_type(),
            [
                'name' => 'readmore_box_shadow',
                'selector' => '{{WRAPPER}} .asa-hero-showcase-readmore',
            ]
        );

        $this->add_responsive_control(
            'readmore_padding',
            [
                'label' => esc_html__('Padding', 'atomic-slider'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', 'em', '%'],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-readmore' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_responsive_control(
            'readmore_margin',
            [
                'label' => esc_html__('Margin', 'atomic-slider'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', 'em', '%'],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-readmore' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'readmore_typography',
                'selector' => '{{WRAPPER}} .asa-hero-showcase-readmore',
            ]
        );

        $this->end_controls_tab();

        $this->start_controls_tab(
            'tab_readmore_hover',
            [
                'label' => esc_html__('Hover', 'atomic-slider'),
            ]
        );

        $this->add_control(
            'readmore_hover_color',
            [
                'label' => esc_html__('Color', 'atomic-slider'),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-readmore:hover' => 'color: {{VALUE}};',
                    '{{WRAPPER}} .asa-hero-showcase-readmore:hover svg' => 'fill: {{VALUE}};',
                ],
            ]
        );

        $this->add_group_control(
            Group_Control_Background::get_type(),
            [
                'name' => 'readmore_hover_background',
                'selector' => '{{WRAPPER}} .asa-hero-showcase-readmore:hover',
            ]
        );

        $this->add_control(
            'readmore_hover_border_color',
            [
                'label' => esc_html__('Border Color', 'atomic-slider'),
                'type' => Controls_Manager::COLOR,
                'condition' => [
                    'readmore_border_border!' => '',
                ],
                'selectors' => [
                    '{{WRAPPER}} .asa-hero-showcase-readmore:hover' => 'border-color: {{VALUE}};',
                ],
            ]
        );

        $this->add_control(
            'readmore_hover_animation',
            [
                'label' => esc_html__('Animation', 'atomic-slider'),
                'type' => Controls_Manager::HOVER_ANIMATION,
            ]
        );

        $this->end_controls_tab();

        $this->end_controls_tabs();

        $this->end_controls_section();

        //Navigation Style
        $this->start_controls_section(
            'section_style_navigation',
            [
                'label' => __('Navigation', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_STYLE,
                'conditions' => [
                    'relation' => 'or',
                    'terms' => [
                        [
                            'name' => 'show_navigation',
                            'value' => 'yes',
                        ],
                        [
                            'name' => 'show_pagination',
                            'value' => 'yes',
                        ],
                    ],
                ],
            ]
        );

        $this->add_control(
			'arrows_heading',
			[
				'label'     => __('ARROWS', 'atomic-slider'),
				'type'      => Controls_Manager::HEADING,
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->start_controls_tabs('tabs_navigation_arrows_style');

		$this->start_controls_tab(
			'tabs_nav_arrows_normal',
			[
				'label'     => __('Normal', 'atomic-slider'),
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_control(
			'arrows_color',
			[
				'label'     => __('Color', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-navigation-prev i, {{WRAPPER}} .asa-navigation-next i' => 'color: {{VALUE}}',
				],
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_control(
			'arrows_background',
			[
				'label'     => __('Background', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-navigation-prev, {{WRAPPER}} .asa-navigation-next' => 'background-color: {{VALUE}}',
				],
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Border::get_type(),
			[
				'name'      => 'nav_arrows_border',
				'selector'  => '{{WRAPPER}} .asa-navigation-prev, {{WRAPPER}} .asa-navigation-next',
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_responsive_control(
			'border_radius',
			[
				'label'      => __('Border Radius', 'atomic-slider'),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => ['px', '%'],
				'selectors'  => [
					'{{WRAPPER}} .asa-navigation-prev, {{WRAPPER}} .asa-navigation-next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition'  => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_responsive_control(
			'arrows_padding',
			[
				'label'      => esc_html__('Padding', 'atomic-slider'),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => ['px', 'em', '%'],
				'selectors'  => [
					'{{WRAPPER}} .asa-navigation-prev, {{WRAPPER}} .asa-navigation-next' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition'  => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_responsive_control(
			'arrows_size',
			[
				'label'     => __('Size', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [
					'px' => [
						'min' => 10,
						'max' => 100,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .asa-navigation-prev i,
            {{WRAPPER}} .asa-navigation-next i' => 'font-size: {{SIZE || 24}}{{UNIT}};',
				],
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			[
				'name'     => 'arrows_box_shadow',
				'selector' => '{{WRAPPER}} .asa-navigation-prev, {{WRAPPER}} .asa-navigation-next',
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

        $this->add_responsive_control(
            'arrows_margin',
            [
                'label'      => esc_html__('Margin', 'atomic-slider'),
                'type'       => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', 'em', '%'],
                'selectors'  => [
                    '{{WRAPPER}} .asa-hero-showcase .asa-navigation-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
                'condition'  => [
                    'show_navigation' => 'yes',
                ],
            ]
        );

		$this->end_controls_tab();

		$this->start_controls_tab(
			'tabs_nav_arrows_hover',
			[
				'label'     => __('Hover', 'atomic-slider'),
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_control(
			'arrows_hover_color',
			[
				'label'     => __('Color', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-navigation-prev:hover i, {{WRAPPER}} .asa-navigation-next:hover i' => 'color: {{VALUE}}',
				],
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_control(
			'arrows_hover_background',
			[
				'label'     => __('Background', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-navigation-prev:hover, {{WRAPPER}} .asa-navigation-next:hover' => 'background-color: {{VALUE}}',
				],
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->add_control(
			'nav_arrows_hover_border_color',
			[
				'label'     => __('Border Color', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-navigation-prev:hover, {{WRAPPER}} .asa-navigation-next:hover' => 'border-color: {{VALUE}};',
				],
				'condition' => [
					'nav_arrows_border_border!' => '',
					'show_navigation'               => 'yes',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			[
				'name'     => 'arrows_hover_box_shadow',
				'selector' => '{{WRAPPER}} .asa-navigation-prev:hover, {{WRAPPER}} .asa-navigation-next:hover',
				'condition' => [
					'show_navigation' => 'yes',
				],
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

        $this->end_controls_section();

        $this->start_controls_section(
            'section_style_pagination',
            [
                'label' => __('Pagination', 'atomic-slider'),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => [
                    'show_pagination' => 'yes',
                ],
            ]
        );

		$this->start_controls_tabs('tabs_navigation_dots_style');

		$this->start_controls_tab(
			'tabs_nav_dots_normal',
			[
				'label'     => __('Normal', 'atomic-slider'),
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);

		$this->add_control(
			'dots_color',
			[
				'label'     => __('BorderColor', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-hero-showcase span.swiper-pagination-bullet' => 'border-color: {{VALUE}}',
				],
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);

        $this->add_control(
			'dots_before_color',
			[
				'label'     => __('Dot Color', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-hero-showcase span.swiper-pagination-bullet::before' => 'background-color: {{VALUE}}',
				],
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);

		$this->add_responsive_control(
			'dots_size',
			[
				'label'     => __('Size', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [
					'px' => [
						'min' => 5,
						'max' => 20,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .swiper-pagination-bullet' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
					'advanced_dots_size' => '',
				],
			]
		);

		$this->add_responsive_control(
			'dots_space_between',
			[
				'label'     => __('Space Between', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'selectors' => [
					'{{WRAPPER}}' => '--asa-swiper-dots-space-between: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);

		$this->add_control(
			'advanced_dots_size',
			[
				'label'     => __('Advanced Size', 'atomic-slider'),
				'type'      => Controls_Manager::SWITCHER,
				'condition' => [
					'show_pagination' => 'yes',
				],
				'separator' => 'before',
			]
		);

		$this->add_responsive_control(
			'advanced_dots_width',
			[
				'label'     => __('Width(px)', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [
					'px' => [
						'min' => 1,
						'max' => 50,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .swiper-pagination-bullet' => 'width: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
					'advanced_dots_size' => 'yes',
				],
			]
		);

		$this->add_responsive_control(
			'advanced_dots_height',
			[
				'label'     => __('Height(px)', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [
					'px' => [
						'min' => 1,
						'max' => 50,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .swiper-pagination-bullet' => 'height: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
					'advanced_dots_size' => 'yes',
				],
			]
		);

		$this->add_responsive_control(
			'advanced_dots_radius',
			[
				'label'      => esc_html__('Border Radius', 'atomic-slider'),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => ['px', '%'],
				'selectors'  => [
					'{{WRAPPER}} .swiper-pagination-bullet' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
				],
				'separator' => 'before',
			]
		);

		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			[
				'name'     => 'dots_box_shadow',
				'selector' => '{{WRAPPER}} .swiper-pagination-bullet',
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);

        
		$this->add_responsive_control(
			'advanced_dots_horizontal_space',
			[
				'label'     => __('Horizontal Space(px)', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [
					'px' => [
						'min' => 1,
						'max' => 50,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .asa-hero-showcase .swiper-pagination' => 'right: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
					'advanced_dots_size' => 'yes',
				],
			]
		);


		$this->end_controls_tab();

		$this->start_controls_tab(
			'tabs_nav_dots_active',
			[
				'label'     => __('Active', 'atomic-slider'),
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);

        $this->add_control(
			'dots_color_active',
			[
				'label'     => __('Border Color', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-hero-showcase span.swiper-pagination-bullet-active' => 'border-color: {{VALUE}}',
				],
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);

        $this->add_control(
			'dots_before_color',
			[
				'label'     => __('Dot Color', 'atomic-slider'),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .asa-hero-showcase span.swiper-pagination-bullet-active::before' => 'background-color: {{VALUE}}',
				],
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);


		$this->add_responsive_control(
			'active_dots_size',
			[
				'label'     => __('Size', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [
					'px' => [
						'min' => 5,
						'max' => 20,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .swiper-pagination-bullet-active' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};',
					'{{WRAPPER}}' => '--asa-swiper-dots-active-height: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
					'advanced_dots_size' => '',
				],
			]
		);

		$this->add_responsive_control(
			'active_advanced_dots_width',
			[
				'label'     => __('Width(px)', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [
					'px' => [
						'min' => 1,
						'max' => 50,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .swiper-pagination-bullet-active' => 'width: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
					'advanced_dots_size' => 'yes',
				],
			]
		);

		$this->add_responsive_control(
			'active_advanced_dots_height',
			[
				'label'     => __('Height(px)', 'atomic-slider'),
				'type'      => Controls_Manager::SLIDER,
				'range'     => [
					'px' => [
						'min' => 1,
						'max' => 50,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .swiper-pagination-bullet-active' => 'height: {{SIZE}}{{UNIT}};',
					'{{WRAPPER}}' => '--asa-swiper-dots-active-height: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
					'advanced_dots_size' => 'yes',
				],
			]
		);

		$this->add_responsive_control(
			'active_advanced_dots_radius',
			[
				'label'      => esc_html__('Border Radius', 'atomic-slider'),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => ['px', '%'],
				'selectors'  => [
					'{{WRAPPER}} .swiper-pagination-bullet-active' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition' => [
					'show_pagination' => 'yes',
				],
				'separator' => 'before',
			]
		);

		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			[
				'name'     => 'dots_active_box_shadow',
				'selector' => '{{WRAPPER}} .swiper-pagination-bullet-active',
				'condition' => [
					'show_pagination' => 'yes',
				],
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

        $this->end_controls_section();



    }

    public function render_image($item, $image_key) {
        $settings = $this->get_settings_for_display();

        if (!$settings['show_image']) {
            return;
        }

        $this->add_render_attribute('image-wrap', 'class', 'asa-flex asa-hero-showcase-image');
        ?>
        <div <?php $this->print_render_attribute_string('image-wrap'); ?>>

            <?php
            $thumb_url = Group_Control_Image_Size::get_attachment_image_src($item['image']['id'], 'thumbnail_size', $settings);
            if (!$thumb_url) {

				$has_image = ! empty( $item['image']['url'] );
				if ( $has_image ) {
					$image_html = wp_kses_post( Group_Control_Image_Size::get_attachment_image_html( $item, 'thumbnail_size', 'image' ) );
					echo wp_kses_post($image_html);
				}
				
            } else {
                print(
                    wp_get_attachment_image(
                        $item['image']['id'],
                        $settings['thumbnail_size_size'],
                        false,
                        [
                            'alt' => esc_html($item['title'])
                        ]
                    )
                );
            }
            ?>

        </div>
        <?php
    }

    public function render_title($item, $title_key)
    {
        $settings = $this->get_settings_for_display();

        if (!$settings['show_title']) {
            return;
        }

        $this->add_render_attribute('title-wrap', 'class', 'asa-hero-showcase-title', true);

        ?>
        <?php if ($item['title']): ?>
            <<?php echo esc_attr(Utils::get_valid_html_tag($settings['title_tag'])); ?>
                <?php $this->print_render_attribute_string('title-wrap'); ?> data-swiper-parallax="-400">
                <?php echo wp_kses($item['title'], atomicslider_allow_tags('title')); ?>
            </<?php echo esc_attr(Utils::get_valid_html_tag($settings['title_tag'])); ?>>
        <?php endif; ?>
    <?php
    }

    public function render_sub_title($item)
    {
        $settings = $this->get_settings_for_display();

        if (!$settings['show_sub_title']) {
            return;
        }

        $this->add_render_attribute('sub-title-wrap', 'class', 'asa-hero-showcase-sub-title', true);

        ?>
        <?php if ($item['sub_title']): ?>
            <<?php echo esc_attr(Utils::get_valid_html_tag($settings['sub_title_tag'])); ?>
                <?php $this->print_render_attribute_string('sub-title-wrap'); ?> data-swiper-parallax="-300">
                <?php echo wp_kses($item['sub_title'], atomicslider_allow_tags('sub_title')); ?>
            </<?php echo esc_attr(Utils::get_valid_html_tag($settings['sub_title_tag'])); ?>>
        <?php endif; ?>
    <?php
    }

    public function render_text($item)
    {
        $settings = $this->get_settings_for_display();

        if (!$settings['show_text']) {
            return;
        }

        ?>
        <?php if ($item['text']): ?>
            <div class="asa-hero-showcase-text" data-swiper-parallax="-200">
                <?php echo wp_kses_post($item['text']); ?>
            </div>
        <?php endif; ?>
    <?php
    }

    public function render_readmore($item, $readmore_key)
    {
        $settings = $this->get_settings_for_display();

        $this->add_render_attribute(
            [
                $readmore_key => [
                    'class' => [
                        'asa-hero-showcase-readmore',
                        $settings['readmore_hover_animation'] ? 'elementor-animation-' . $settings['readmore_hover_animation'] : '',
                    ],
                ]
            ],
            '',
            '',
            true
        );
        if (!empty($item['readmore_link']['url']))  {
            $this->add_link_attributes($readmore_key, $item['readmore_link']);
        }

        ?>
        <?php if ($settings['show_link_button'] === 'yes' && !empty($item['readmore_link']['url']) && $settings['readmore_link_to'] == 'button'): ?>
            <div class="asa-hero-showcase-readmore-wrap" data-swiper-parallax="-100">
                <a <?php $this->print_render_attribute_string($readmore_key); ?>>
                    <?php echo esc_html($settings['readmore_text']); ?>
                    <?php if (!empty($settings['readmore_icon']['value'])): ?>
                        <span class="asa-button-icon-align-<?php echo esc_attr($settings['icon_align']); ?>">
                            <?php Icons_Manager::render_icon($settings['readmore_icon'], ['aria-hidden' => 'true', 'class' => 'fa-fw']); ?>
                        </span>
                    <?php endif; ?>
                </a>
            </div>
        <?php endif; ?>
    <?php
    }

    public function render_carosuel_item()
    {
        $settings = $this->get_settings_for_display();

        if (empty($settings['carousel_items'])) {
            return;
        }

        $this->add_render_attribute('carosuel-item', 'class', 'asa-hero-showcase-item swiper-slide', true);

        ?>

        <?php foreach ($settings['carousel_items'] as $index => $item) {
            $item_key = 'item-' . $index;
            ?>
            <div <?php $this->print_render_attribute_string('carosuel-item'); ?>>
                <?php $this->render_image($item, 'image_' . $index); ?>
                <div class="asa-hero-showcase-content">
                    <?php $this->render_sub_title($item); ?>
                    <?php $this->render_title($item, 'title_' . $index); ?>
                    <?php $this->render_text($item); ?>
                    <?php $this->render_readmore($item, 'link_' . $index); ?>
                </div>
            </div>
        <?php }
    }

    protected function render_swiper_header_attribute($name) {
		$id = 'asa-hero-showcase-' . $this->get_id();
		$settings = $this->get_settings_for_display();

		$this->add_render_attribute('carousel', 'id', $id);

		$elementor_vp_lg = get_option('elementor_viewport_lg');
		$elementor_vp_md = get_option('elementor_viewport_md');
		$viewport_lg = !empty($elementor_vp_lg) ? $elementor_vp_lg - 1 : 1023;
		$viewport_md = !empty($elementor_vp_md) ? $elementor_vp_md - 1 : 767;

		// Set pagination type for bullets
		$pagination_type = 'bullets';

		$this->add_render_attribute(
			[
				'carousel' => [
					'data-settings' => [
						wp_json_encode(array_filter([
							"autoplay"              => ("yes" == $settings["autoplay"]) ? ["delay" => $settings["autoplay_speed"], "disableOnInteraction" => false] : false,
							"loop"                  => ($settings["loop"] == "yes") ? true : false,
							"speed"                 => $settings["speed"]["size"],
							"pauseOnHover"          => ("yes" == $settings["pauseonhover"]) ? true : false,
							"slidesPerView"         =>  1,
							"grabCursor"            => ($settings["grab_cursor"] === "yes") ? true : false,
							"freeMode"              => ($settings["free_mode"] === "yes") ? true : false,
							"effect"                => $settings["skin"],
							"observer"              => ($settings["observer"]) ? true : false,
							"observeParents"        => ($settings["observer"]) ? true : false,
							"watchSlidesVisibility" => ($settings["show_hidden_item"]) ? true : false,
							"watchSlidesProgress" 	=> ($settings["show_hidden_item"]) ? true : false,
							"navigation"      => [
								"nextEl" => "#" . $id . " .asa-navigation-next",
								"prevEl" => "#" . $id . " .asa-navigation-prev",
							],
							"pagination"      => [
								"el"             => "#" . $id . " .swiper-pagination",
								"type"           => $pagination_type,
								"clickable"      => true,
							],
                            'parallax' => true,
						]))
		]
	]
]
);

$this->add_render_attribute('swiper', 'class	', 'swiper-carousel swiper');
}




	function render_both_navigation() {
		$settings = $this->get_settings_for_display();

		?>
        <?php if ('yes' === $settings['show_navigation']): ?>
        <div class="asa-navigation-wrap">
            <div class="asa-navigation-prev asa-slidenav-previous asa-icon asa-slidenav">
                <i class="eicon-arrow-left"></i>
            </div>

            <div class="asa-navigation-next asa-slidenav-next asa-icon asa-slidenav">
                <i class="eicon-arrow-right"></i>
            </div>
        </div>
        <?php endif; ?>
        <?php if ('yes' === $settings['show_pagination']): ?>
        <div class="swiper-pagination"></div>
        <?php endif; ?>
	<?php
	}


	function render_footer() {
		$settings = $this->get_settings_for_display();

		?>
		</div>
		</div>

		<?php $this->render_both_navigation(); ?>

		</div>

<?php
	}

    public function render_header()
    {
        $settings = $this->get_settings_for_display();

        //Global Function
        $this->render_swiper_header_attribute('hero-showcase');

        $this->add_render_attribute('carousel', 'class', 'asa-hero-showcase');

        // Add overlay classes
        if ('yes' === $settings['enable_image_overlay']) {
            $this->add_render_attribute('carousel', 'class', 'asa-overlay-enabled');
            $this->add_render_attribute('carousel', 'class', 'asa-overlay-' . $settings['image_overlay_type']);
        }

        ?>
        <div <?php $this->print_render_attribute_string('carousel'); ?>>
            <div <?php $this->print_render_attribute_string('swiper'); ?>>
                <div class="swiper-wrapper">
                    <?php
    }

    public function render() {
        $this->render_header();
        $this->render_carosuel_item();
        $this->render_footer();
    }
}
