<?php
namespace EcafeAddons\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Utils;
use Elementor\Group_Control_Typography;
use Elementor\Core\Schemes\Typography;
use Elementor\Scheme_Color;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;

use EcafeAddons\EcafeElementLoad;

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

class Ecafe_Image_Accordion extends Widget_Base {

	public function get_name() {
		return 'ecafe-image-accordion';
	}

	public function get_title() {
		return esc_html__( 'Image Accordion', 'essential-classy-addons-for-elementor' );
	}

	public function get_icon() {
		return 'ecafe-ele-back-icon ecafe-image-accordion-icon';
	}

	public function get_categories() {
		return array( 'essential' );
	}

	public function get_keywords() {
		return array( 'image accordion', 'accordion', 'vertical accordion', 'horizontal accordion', 'card', 'hover card', 'card effect', 'hover effect' );
	}

	public function get_script_depends() {
		return array( 'ecafe-image-accordion' );
	}
	public function get_custom_help_url() {
		return 'https://store.kapasias.com/helpdesk/';
	}
	public function has_widget_inner_wrapper(): bool {
		return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
	}
	protected function register_controls() {

		$this->start_controls_section(
			'contentSection',
			array(
				'label' => esc_html__( 'Image Accordion', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			)
		);
		$this->add_control(
			'contentLayout',
			array(
				'label'   => esc_html__( 'Layout', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'horizontal',
				'options' => array(
					'horizontal' => esc_html__( 'Horizontal', 'essential-classy-addons-for-elementor' ),
					'vertical'   => esc_html__( 'Vertical', 'essential-classy-addons-for-elementor' ),
				),
			)
		);
		$this->add_control(
			'activeSlide',
			array(
				'label'   => esc_html__( 'Active Slide', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => '1',
				'options' => \EcafeHelper::getNumbers( 1 ),
			)
		);
		$this->add_control(
			'flexGrow',
			array(
				'label'   => esc_html__( 'Active Slide Width (0-20)', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::NUMBER,
				'min'     => 1,
				'max'     => 20,
				'step'    => 0.5,
				'default' => 7,
			)
		);
		$this->add_control(
			'iaLoop',
			array(
				'label'     => esc_html__( 'Loop', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SWITCHER,
				'label_on'  => esc_html__( 'Enable', 'essential-classy-addons-for-elementor' ),
				'label_off' => esc_html__( 'Disable', 'essential-classy-addons-for-elementor' ),
				'separator' => 'before',
			)
		);
		$this->add_control(
			'iaLoopDuration',
			array(
				'label'     => esc_html__( 'Duration', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::NUMBER,
				'min'       => 1,
				'max'       => 50,
				'step'      => 1,
				'default'   => 5,
				'condition' => array(
					'iaLoop' => 'yes',
				),
			)
		);
		$repeater = new \Elementor\Repeater();
		$repeater->add_control(
			'iaIconImage',
			array(
				'label'   => esc_html__( 'Source', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'icon',
				'options' => array(
					'icon'  => esc_html__( 'Icon', 'essential-classy-addons-for-elementor' ),
					'image' => esc_html__( 'Image', 'essential-classy-addons-for-elementor' ),
				),
			)
		);
		$repeater->add_control(
			'iaIcon',
			array(
				'label'     => esc_html__( 'Icon', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::ICONS,
				'default'   => array(
					'value'   => 'fas fa-plus',
					'library' => 'solid',
				),
				'condition' => array(
					'iaIconImage' => 'icon',
				),
			)
		);
		$repeater->add_control(
			'iaImage',
			array(
				'label'     => esc_html__( 'Image', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::MEDIA,
				'default'   => array(
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				),
				'condition' => array(
					'iaIconImage' => 'image',
				),
			)
		);
		$repeater->add_control(
			'iaTitle',
			array(
				'label'       => esc_html__( 'Title', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'Title', 'essential-classy-addons-for-elementor' ),
				'dynamic'     => array(
					'active' => true,
				),
				'label_block' => true,
			)
		);
		$repeater->add_control(
			'iaTitleTag',
			array(
				'label'   => esc_html__( 'Tag', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'div',
				'options' => \EcafeHelper::getHtmlTag(),
			)
		);
		$repeater->add_control(
			'iaContent',
			array(
				'label'      => esc_html__( 'Content', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::WYSIWYG,
				'default'    => esc_html__( 'Content', 'essential-classy-addons-for-elementor' ),
				'show_label' => false,
				'dynamic'    => array(
					'active' => true,
				),
			)
		);
		$repeater->add_control(
			'iaButtonText',
			array(
				'label'       => esc_html__( 'Text', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'dynamic'     => array( 'active' => true ),
				'default'     => esc_html__( 'Click Here', 'essential-classy-addons-for-elementor' ),
				'placeholder' => esc_html__( 'Enter Text', 'essential-classy-addons-for-elementor' ),
			)
		);
		$repeater->add_control(
			'iaButtonLink',
			array(
				'label'       => esc_html__( 'Link', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::URL,
				'dynamic'     => array( 'active' => true ),
				'placeholder' => esc_html__( '#', 'essential-classy-addons-for-elementor' ),
				'default'     => array(
					'url' => '#',
				),
			)
		);
		$repeater->add_control(
			'iaBackgroundImage',
			array(
				'label'   => esc_html__( 'Featured Image', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::MEDIA,
				'default' => array(
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				),
				'dynamic' => array( 'active' => true ),
			)
		);
		$this->add_control(
			'iaItems',
			array(
				'label'       => '',
				'type'        => Controls_Manager::REPEATER,
				'fields'      => $repeater->get_controls(),
				'default'     => array(
					array(
						'iaTitle'    => esc_html__( 'Title #1', 'essential-classy-addons-for-elementor' ),
						'tabContent' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus suscipit, velit in venenatis dignissim, risus mi ullamcorper justo, ac porta ante leo tempus enim.', 'essential-classy-addons-for-elementor' ),
					),
					array(
						'iaTitle'    => esc_html__( 'Title #2', 'essential-classy-addons-for-elementor' ),
						'tabContent' => esc_html__( 'I am item content. 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.', 'essential-classy-addons-for-elementor' ),
					),
					array(
						'iaTitle'    => esc_html__( 'Title #3', 'essential-classy-addons-for-elementor' ),
						'tabContent' => esc_html__( 'I am item content. 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.', 'essential-classy-addons-for-elementor' ),
					),
				),
				'title_field' => '{{{ iaTitle }}}',
			)
		);
		$this->add_responsive_control(
			'VerticalAlign',
			array(
				'label'     => esc_html__( 'Vertical Alignment', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::CHOOSE,
				'options'   => array(
					'flex-start' => array(
						'title' => esc_html__( 'Left', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-left',
					),
					'center'     => array(
						'title' => esc_html__( 'Center', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-center',
					),
					'flex-end'   => array(
						'title' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-right',
					),
				),
				'default'   => 'center',
				'separator' => 'before',
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-loop-content' => 'align-items:{{VALUE}};',
				),
			)
		);
		$this->add_responsive_control(
			'horizontalAlign',
			array(
				'label'     => esc_html__( 'Horizontal Alignment', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::CHOOSE,
				'options'   => array(
					'flex-start' => array(
						'title' => esc_html__( 'Left', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-left',
					),
					'center'     => array(
						'title' => esc_html__( 'Center', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-center',
					),
					'flex-end'   => array(
						'title' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-right',
					),
				),
				'default'   => 'center',
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-loop-content' => 'justify-content:{{VALUE}};',
				),
			)
		);
		$this->end_controls_section();

		$this->start_controls_section(
			'contentSortngSection',
			array(
				'label' => esc_html__( 'Content Sorting', 'essential-classy-addons-for-elementor' ),
			)
		);
		$repeaterSort = new \Elementor\Repeater();
		$repeaterSort->add_control(
			'sortingfield',
			array(
				'label'   => esc_html__( 'Select', 'essential-classy-addons-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'iconImage',
				'options' => array(
					'iconImage' => esc_html__( 'Icon/Image', 'essential-classy-addons-for-elementor' ),
					'title'     => esc_html__( 'Title', 'essential-classy-addons-for-elementor' ),
					'content'   => esc_html__( 'Content', 'essential-classy-addons-for-elementor' ),
					'button'    => esc_html__( 'Button', 'essential-classy-addons-for-elementor' ),
				),
			)
		);
		$this->add_control(
			'iaSort',
			array(
				'label'       => esc_html__( 'Sortable', 'essential-classy-addons-for-elementor' ),
				'type'        => Controls_Manager::REPEATER,
				'default'     => array(
					array(
						'sortingfield' => 'iconImage',
					),
					array(
						'sortingfield' => 'title',
					),
					array(
						'sortingfield' => 'content',
					),
					array(
						'sortingfield' => 'button',
					),
				),
				'fields'      => $repeaterSort->get_controls(),
				'title_field' => '{{{ sortingfield }}}',
			)
		);
		$this->end_controls_section();

		$this->start_controls_section(
			'contentAdvancedSection',
			array(
				'label' => esc_html__( 'Advanced Options', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'iaContentAnim',
			array(
				'label'     => esc_html__( 'Content Animation', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SWITCHER,
				'label_on'  => esc_html__( 'Enable', 'essential-classy-addons-for-elementor' ),
				'label_off' => esc_html__( 'Disable', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'iaContentAnimFrom',
			array(
				'label'     => esc_html__( 'From', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'iaafleft',
				'options'   => array(
					'iaafleft'  => esc_html__( 'Left', 'essential-classy-addons-for-elementor' ),
					'iaafright' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
				),
				'condition' => array(
					'iaContentAnim' => 'yes',
				),
			)
		);
		$this->add_control(
			'iaMouseleave',
			array(
				'label'     => esc_html__( 'Mouse Leave Remove Active', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SWITCHER,
				'label_on'  => esc_html__( 'Enable', 'essential-classy-addons-for-elementor' ),
				'label_off' => esc_html__( 'Disable', 'essential-classy-addons-for-elementor' ),
				'separator' => 'before',
			)
		);
		$this->end_controls_section();

		/*Tippy Tooltip Options*/
		include ECAFE_PATH . 'element/widgets/ecafe-tippy-options.php';

		/*Notice panel*/
		$ecwidgetdemolink = esc_url( 'https://ecaddons.com/elements/image-accordion/' );
		$ecwidgetdoclink  = esc_url( 'https://ecaddons.com/docs/image-accordion-widget-tutorial/' );
		include ECAFE_PATH . 'element/widgets/ecafe-widgetpanel-help.php';

		/*icon style start*/
		$this->start_controls_section(
			'sectionIconStyling',
			array(
				'label' => esc_html__( 'Icon', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'iaiPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iaiMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iaiIconSize',
			array(
				'label'      => esc_html__( 'Icon Size', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 300,
					),
				),
				'default'    => array(
					'unit' => 'px',
					'size' => 20,
				),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon i' => 'font-size: {{SIZE}}{{UNIT}};',
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_control(
			'iaiColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon i' => 'color: {{VALUE}};',
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon svg' => 'fill: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'iaiBackground',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'iaiBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon',
			)
		);
		$this->add_responsive_control(
			'iaiBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'iaiShadow',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.icon',
			)
		);

		$this->add_control(
			'maskShapeIcon',
			array(
				'label'     => esc_html__( 'Mask Image', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::MEDIA,
				'separator' => 'before',
				'selectors' => array(
					'{{WRAPPER}} .eca-ia-icon-image.icon' => 'mask-image: url({{URL}});-webkit-mask-image: url({{URL}});-webkit-mask-size: 100% 100%;-webkit-mask-repeat: no-repeat;',
				),
			)
		);
		$this->end_controls_section();
		/*icon style end*/

		/*image style start*/
		$this->start_controls_section(
			'sectionImageStyling',
			array(
				'label' => esc_html__( 'Image', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'iaimgPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.image' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iaimgMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.image' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iaimgSize',
			array(
				'label'      => esc_html__( 'Image Size', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 300,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.image' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'iaimgBackground',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.image',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'iaimgBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.image',
			)
		);
		$this->add_responsive_control(
			'iaimgBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'iaimgShadow',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-icon-image.image',
			)
		);

		$this->add_control(
			'mask_shape_image',
			array(
				'label'     => esc_html__( 'Mask Image', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::MEDIA,
				'separator' => 'before',
				'selectors' => array(
					'{{WRAPPER}} .eca-ia-icon-image.image' => 'mask-image: url({{URL}});-webkit-mask-image: url({{URL}});-webkit-mask-size: 100% 100%;-webkit-mask-repeat: no-repeat;',
				),
			)
		);
		$this->end_controls_section();
		/*image style end*/

		/*title style start*/
		$this->start_controls_section(
			'sectionTitleStyling',
			array(
				'label' => esc_html__( 'Title', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'iatPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-title-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iatMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-title-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'iatTypography',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-title-wrapper',
			)
		);
		$this->add_control(
			'iatColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-title-wrapper' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'iatBackground',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-title-wrapper',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'iatBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-title-wrapper',
			)
		);
		$this->add_responsive_control(
			'iatBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-title-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'iatShadow',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-title-wrapper',
			)
		);
		$this->end_controls_section();
		/*title style end*/

		/*desciption style start*/
		$this->start_controls_section(
			'sectionDesciptionStyling',
			array(
				'label' => esc_html__( 'Desciption', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'iadPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iadMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_control(
			'iadWordBreak',
			array(
				'label'     => esc_html__( 'Word Break', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => 'break-all',
				'options'   => array(
					'keep-all'  => esc_html__( 'keep-all', 'essential-classy-addons-for-elementor' ),
					'break-all' => esc_html__( 'break-all', 'essential-classy-addons-for-elementor' ),
				),
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-loop-content .eca-ia-content-wrapper,{{WRAPPER}} .eca-image-accordion-loop-content .eca-ia-content-wrapper p' => 'word-break: {{VALUE}};',
				),
			)
		);
		$this->add_responsive_control(
			'iadAlign',
			array(
				'label'     => esc_html__( 'Alignment', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::CHOOSE,
				'options'   => array(
					'left'    => array(
						'title' => esc_html__( 'Left', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-left',
					),
					'center'  => array(
						'title' => esc_html__( 'Center', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-center',
					),
					'right'   => array(
						'title' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-text-align-right',
					),
					'justify' => array(
						'title' => esc_html__( 'Justify', 'essential-classy-addons-for-elementor' ),
						'icon'  => 'eicon-h-align-stretch',
					),
				),
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-loop-content .eca-ia-content-wrapper,{{WRAPPER}} .eca-image-accordion-loop-content .eca-ia-content-wrapper p' => 'text-align:{{VALUE}};',
				),
			)
		);
		$this->add_responsive_control(
			'iadSize',
			array(
				'label'      => esc_html__( 'Max. Width', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 500,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper' => 'max-width: {{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'iadTypography',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper,{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper p',
			)
		);
		$this->add_control(
			'iadColor',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper,{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper p' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'iadBackground',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper',
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'iadBorder',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper',
			)
		);
		$this->add_responsive_control(
			'iadBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'iadShadow',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-content-wrapper',
			)
		);
		$this->end_controls_section();
		/*desciption style end*/

		/*button style start*/
		$this->start_controls_section(
			'sectionButtonStyling',
			array(
				'label' => esc_html__( 'Button', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'iabPadding',
			array(
				'label'      => esc_html__( 'Padding', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'iabMargin',
			array(
				'label'      => esc_html__( 'Margin', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'iabTypography',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper',
			)
		);
		$this->start_controls_tabs( 'tabsiabStyle' );
		$this->start_controls_tab(
			'tabiabN',
			array(
				'label' => esc_html__( 'Normal', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'iabColorN',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'      => 'iabBackgroundN',
				'types'     => array( 'classic', 'gradient' ),
				'selector'  => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper',
				'condition' => array(
					'buttonHoverEffectH!' => 'yes',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'iabBorderN',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper',
			)
		);
		$this->add_responsive_control(
			'iabBrN',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'iabShadowN',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper',
			)
		);
		$this->end_controls_tab();
		$this->start_controls_tab(
			'tabiabH',
			array(
				'label' => esc_html__( 'Hover', 'essential-classy-addons-for-elementor' ),
			)
		);
		$this->add_control(
			'buttonHoverEffectH',
			array(
				'label'     => esc_html__( 'Hover Effect', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SWITCHER,
				'label_on'  => esc_html__( 'Enable', 'essential-classy-addons-for-elementor' ),
				'label_off' => esc_html__( 'Disable', 'essential-classy-addons-for-elementor' ),
				'default'   => 'no',
			)
		);
		$this->add_control(
			'buttonEffectPosH',
			array(
				'label'     => esc_html__( 'Position', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => '',
				'options'   => array(
					''                              => esc_html__( 'Bottom', 'essential-classy-addons-for-elementor' ),
					'eca-button-hover-effect-top'   => esc_html__( 'Top', 'essential-classy-addons-for-elementor' ),
					'eca-button-hover-effect-left'  => esc_html__( 'Left', 'essential-classy-addons-for-elementor' ),
					'eca-button-hover-effect-right' => esc_html__( 'Right', 'essential-classy-addons-for-elementor' ),
				),
				'condition' => array(
					'buttonHoverEffectH' => 'yes',
				),
			)
		);
		$this->add_control(
			'iabColorH',
			array(
				'label'     => esc_html__( 'Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper:hover' => 'color: {{VALUE}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'      => 'iabBackgroundH',
				'types'     => array( 'classic', 'gradient' ),
				'selector'  => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper:hover',
				'condition' => array(
					'buttonHoverEffectH!' => 'yes',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'      => 'bBgEffectHover',
				'types'     => array( 'classic', 'gradient' ),
				'selector'  => '{{WRAPPER}} .eca-button-hover-effect:hover:after',
				'condition' => array(
					'buttonHoverEffectH' => 'yes',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'iabBorderH',
				'label'    => esc_html__( 'Border', 'essential-classy-addons-for-elementor' ),
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper:hover',
			)
		);
		$this->add_responsive_control(
			'iabBrH',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'iabShadowH',
				'selector' => '{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-content .eca-ia-button-wrapper:hover',
			)
		);
		$this->end_controls_tab();
		$this->end_controls_tabs();
		$this->end_controls_section();
		/*button style end*/

		/*loop item style start*/
		$this->start_controls_section(
			'sectionLoopItemStyling',
			array(
				'label' => esc_html__( 'Loop Item', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'iaLoopGap',
			array(
				'label'      => esc_html__( 'Gap', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 100,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-wrapper:not(:first-child):not(:last-child)' => 'margin-left: calc( {{SIZE}}{{UNIT}} / 2 ) !important;margin-right: calc( {{SIZE}}{{UNIT}} / 2 ) !important;',
				),
				'condition'  => array(
					'contentLayout' => 'horizontal',
				),
			)
		);
		$this->add_responsive_control(
			'iaLoopGapV',
			array(
				'label'      => esc_html__( 'Gap', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 100,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-wrapper:not(:first-child):not(:last-child)' => 'margin-top: calc( {{SIZE}}{{UNIT}} / 2 ) !important;margin-bottom: calc( {{SIZE}}{{UNIT}} / 2 ) !important;',
				),
				'condition'  => array(
					'contentLayout' => 'vertical',
				),
			)
		);
		$this->add_control(
			'iaLoopOverlayColor',
			array(
				'label'     => esc_html__( 'Overlay Color', 'essential-classy-addons-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-wrapper:hover .eca-image-accordion-loop-content,
					{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-loop-wrapper.active-image-accrodian .eca-image-accordion-loop-content' => 'background-color: {{VALUE}};',
				),
			)
		);
		$this->end_controls_section();
		/*loop item style end*/

		/*Box style start*/
		$this->start_controls_section(
			'sectionBoxStyling',
			array(
				'label' => esc_html__( 'Box', 'essential-classy-addons-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);
		$this->add_responsive_control(
			'boxHeight',
			array(
				'label'      => esc_html__( 'Height', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 1000,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper,{{WRAPPER}} .eca-image-accordion-wrapper .eca-image-accordion-inner' => 'height: {{SIZE}}{{UNIT}};',
				),
			)
		);
		$this->add_responsive_control(
			'boxBr',
			array(
				'label'      => esc_html__( 'Border Radius', 'essential-classy-addons-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eca-image-accordion-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);
		$this->end_controls_section();
		/*box style end*/
	}

	protected function render() {

		$settings       = $this->get_settings_for_display();
		$contentLayout  = ! empty( $settings['contentLayout'] ) ? $settings['contentLayout'] : 'horizontal';
		$iaLoop         = isset( $settings['iaLoop'] ) ? $settings['iaLoop'] : 'no';
		$iaLoopDuration = ! empty( $settings['iaLoopDuration'] ) ? $settings['iaLoopDuration'] : 5;
		$activeSlide    = ! empty( $settings['activeSlide'] ) ? $settings['activeSlide'] : 1;
		$flexGrow       = ! empty( $settings['flexGrow'] ) ? $settings['flexGrow'] : 7;
		$flexGrowValue  = 'data-flexgrow="' . esc_attr( $flexGrow ) . '"';
		$iaContentAnim  = isset( $settings['iaContentAnim'] ) ? $settings['iaContentAnim'] : 'no';
		$iaMouseleave   = isset( $settings['iaMouseleave'] ) ? $settings['iaMouseleave'] : 'no';

		$iaContentAnimClass = $iaMouseleaveClass = '';
		if ( $iaContentAnim && $iaContentAnim == 'yes' ) {
			$iaContentAnimClass  = ' eca-ia-animation';
			$iaContentAnimClass .= ' ' . $settings['iaContentAnimFrom'];
		}
		if ( $iaMouseleave && $iaMouseleave == 'yes' ) {
			$iaMouseleaveClass = ' eca-ia-mouseleave';
		}
		$iaLoopdata = $iaLoopclass = '';
		if ( $iaLoop && $iaLoop == 'yes' ) {
			$iaLoopdata  = 'data-ialoop=' . $iaLoop;
			$iaLoopdata .= ' data-duration=' . $iaLoopDuration;
			$iaLoopclass = ' ialoop';
		}
		$tippyclass  = '';
		$tippyrender = '';
		if ( isset( $settings['tippyTooltip'] ) && $settings['tippyTooltip'] === 'yes' ) {
			/*Tippy Tooltip Render*/
			include ECAFE_PATH . 'element/widgets/ecafe-tippy-render.php';
		}
		$output      = '<div class="eca-image-accordion-wrapper ' . esc_attr( $contentLayout ) . ' ' . esc_attr( $iaLoopclass ) . ' ' . esc_attr( $iaMouseleaveClass ) . ' ' . esc_attr( $tippyclass ) . '" ' . esc_attr( $iaLoopdata ) . ' ' . $tippyrender . '>';
			$output .= '<div class="eca-image-accordion-inner" ' . $flexGrowValue . '>';
		if ( ! empty( $settings['iaItems'] ) ) {
			$index = 1;
			foreach ( $settings['iaItems'] as $index => $item ) {
						$ia_bg_img = '';
				if ( ! empty( $item['iaBackgroundImage']['url'] ) ) {
					$ia_bg_img = $item['iaBackgroundImage']['url'];
					$image_id  = $item['iaBackgroundImage']['id'];
					$image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
					$imgAlt    = '';
					if ( $image_alt ) {
								$imgAlt = 'alt="' . esc_attr( $image_alt ) . '"';
					}
				}

						$iaIconImage = ! empty( $item['iaIconImage'] ) ? $item['iaIconImage'] : 'icon';
						$ia_icon     = '';
				if ( $iaIconImage ) {
					if ( ! empty( $item['iaIcon'] ) && $iaIconImage == 'icon' ) {
								ob_start();
								\Elementor\Icons_Manager::render_icon( $item['iaIcon'], array( 'aria-hidden' => 'true' ) );
								$icons_loop = ob_get_contents();
								ob_end_clean();

						if ( ! empty( $icons_loop ) ) {
							$ia_icon .= '<span class="eca-ia-icon-image icon">' . $icons_loop . '</span>';
						}
					}

					if ( ! empty( $item['iaImage']['id'] ) && $iaIconImage == 'image' ) {
						$image_id  = $item['iaImage']['id'];
						$image_src = wp_get_attachment_image_src( $image_id, 'full' );

						$ia_icon .= '<img src="' . esc_url( $image_src[0] ) . '" class="eca-ia-icon-image image">';
					}
				}

						$ia_title = '';
						$iaTitle  = ! empty( $item['iaTitle'] ) ? $item['iaTitle'] : '';
				if ( $iaTitle ) {
					$iaTitleTag = ! empty( $item['iaTitleTag'] ) ? $item['iaTitleTag'] : 'div';
					$ia_title   = '<' . \EcafeHelper::check_and_validate_html_tag( $iaTitleTag ) . ' class="eca-ia-title-wrapper">' . esc_html( $iaTitle ) . '</' . \EcafeHelper::check_and_validate_html_tag( $iaTitleTag ) . '>';
				}

						$ia_content = '';
						$iaContent  = ! empty( $item['iaContent'] ) ? $item['iaContent'] : '';
				if ( $iaContent ) {
					$ia_content = '<div class="eca-ia-content-wrapper">' . wp_kses_post( $iaContent ) . '</div>';
				}

						$ia_button    = '';
						$iaButtonText = ! empty( $item['iaButtonText'] ) ? $item['iaButtonText'] : '';
						$iaButtonLink = ! empty( $item['iaButtonLink']['url'] ) ? $item['iaButtonLink']['url'] : '';
				if ( $iaButtonText ) {
					$buttonHoverEffectH = ( isset( $settings['buttonHoverEffectH'] ) && $settings['buttonHoverEffectH'] == 'yes' ) ? 'eca-button-hover-effect ' . esc_attr( $settings['buttonEffectPosH'] ) : '';
					$ia_button          = '<a class="eca-ia-button-wrapper ' . esc_attr( $buttonHoverEffectH ) . '" href="' . esc_url( $iaButtonLink ) . '">' . esc_attr( $iaButtonText ) . '</a>';
				}

						$loopStyle = 'style="flex-grow: 1;"';
						$active    = '';
				if ( $index == $activeSlide - 1 ) {
					$loopStyle = 'style="flex-grow: ' . esc_attr( $flexGrow ) . ';"';
					$active    = 'active-image-accrodian';
				}
							$output     .= '<div class="eca-image-accordion-loop-wrapper ' . esc_attr( $active ) . ' ' . esc_attr( $iaContentAnimClass ) . '" ' . $loopStyle . '>';
								$output .= '<img class="eca-image-accordion-loop-image" src="' . esc_url( $ia_bg_img ) . '" ' . $imgAlt . '>';
								$output .= '<div class="eca-image-accordion-loop-content">';

									$iaSort = $settings['iaSort'];
				if ( ! empty( $iaSort ) ) {
					$indexSort = 0;
					foreach ( $iaSort as $indexSort => $itemSort ) {
						if ( ! empty( $itemSort['sortingfield'] ) && $itemSort['sortingfield'] == 'iconImage' ) {
							$output .= wp_kses_normalize_entities( $ia_icon );
						}

						if ( ! empty( $itemSort['sortingfield'] ) && $itemSort['sortingfield'] == 'title' ) {
							$output .= wp_kses_normalize_entities( $ia_title );
						}

						if ( ! empty( $itemSort['sortingfield'] ) && $itemSort['sortingfield'] == 'content' ) {
							$output .= wp_kses_normalize_entities( $ia_content );
						}

						if ( ! empty( $itemSort['sortingfield'] ) && $itemSort['sortingfield'] == 'button' ) {
							$output .= wp_kses_normalize_entities( $ia_button );
						}
										++$indexSort;
					}
				}
								$output .= '</div>';
							$output     .= '</div>';

						++$index;
			}
		}
			$output .= '</div>';
		$output     .= '</div>';

		echo wp_kses_normalize_entities( $output );
	}
}
