<?php

namespace Elementor;

use Elementor\Widget_Base;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorCarousel;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorContents;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorDetailssettings;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorLayout;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleBox;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleCarousel;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleCategory;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleContent;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleEventMeta;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleFilterBar;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleImage;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleMeta;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStylePagination;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleReadmore;
use ThemeAtelier\EventfulForElementor\Admin\Widgets\Options\EventfulForElementorStyleTitle;

class Eventful_Event_Carousel_Widget extends Widget_Base
{

    public function get_name()
    {
        return 'eventful-event-carousel-widget';
    }

    public function get_title()
    {
        return esc_html__('Eventful Carousel', 'eventful-for-elementor');
    }
   
    public function get_style_depends()
    {
        return [
            'fontawesome',
            'bx_slider',
            'swiper-bundle',
            'eventful-main',
        ];
    }
    public function get_script_depends()
    {
        return [
            'carousel_scripts',
            'bx_slider',
            'swiper-bundle',
        ];
    }

    public function get_icon()
    {
        return 'eicon-posts-carousel';
    }

    public function get_categories()
    {
        return ['ppfe-for-elementor'];
    }

    public function _register_controls()
    {
        // Register text control
        EventfulForElementorLayout::ppfe_content_layout_options($this);
        EventfulForElementorContents::ppfe_content_contents_options($this);
        EventfulForElementorCarousel::ppfe_content_carousel_options($this);
        EventfulForElementorDetailssettings::ppfe_content_detailsettings_options($this);
        EventfulForElementorStyleBox::ppfe_style_box_options($this);
        EventfulForElementorStyleCategory::ppfe_style_category_options($this);
        EventfulForElementorStyleImage::ppfe_style_image_options($this);
        EventfulForElementorStyleTitle::ppfe_style_title_options($this);
        EventfulForElementorStyleMeta::ppfe_style_meta_options($this);
        EventfulForElementorStyleEventMeta::ppfe_style_event_meta_options($this);
        EventfulForElementorStyleContent::ppfe_style_content_options($this);
        EventfulForElementorStyleReadmore::ppfe_style_readmore_options($this);
        EventfulForElementorStyleCarousel::ppfe_style_carousel($this);
        EventfulForElementorStylePagination::ppfe_style_pagination($this);
        EventfulForElementorStyleFilterBar::ppfe_style_filter_bar($this);
    }

    protected function render()
    {
        $view_options = $this->get_settings_for_display();
        $efpe_gl_id = $this->get_id();
        \ThemeAtelier\EventfulForElementor\Frontend\Helpers\EventfulForElementorLoopHtml::efpe_html_show($view_options, $layout_preset = 'carousel_layout', $efpe_gl_id);
    }
}

Plugin::instance()->widgets_manager->register_widget_type(new Eventful_Event_Carousel_Widget());
