<?php
namespace ThemeAtelier\EventfulForElementor\Admin\Widgets\Options;

class EventfulForElementorContents
{
    /**
     * Content Display Options.
     */
    public static function ppfe_content_contents_options($widget)
    {
        $widget->start_controls_section(
            'section_contents',
            [
                'label' => esc_html__('Display Options', 'eventful-for-elementor'),
            ]
        );

        $widget->add_responsive_control(
            'columns',
            [
                'label' => esc_html__('Columns', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'tablet_default' => '2',
                'mobile_default' => '1',
                'options' => [
                    '1' => '1',
                    '2' => '2',
                    '3' => '3',
                    '4' => '4',
                ],
                'default' => '3',
                'prefix_class' => 'elementor-grid%s-',
                'frontend_available' => true,
                'selectors' => [
                    '.elementor-msie {{WRAPPER}} .elementor-portfolio-item' => 'width: calc( 100% / {{SIZE}} )',
                ],
            ]
        );
        // Columns margin.
        $widget->add_control(
            'grid_style_columns_margin',
            [
                'label'     => esc_html__('Columns margin', 'eventful-for-elementor'),
                'type'      => \Elementor\Controls_Manager::SLIDER,
                'default'   => [
                    'size' => 15,
                ],
                'range'     => [
                    'px' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .ppfe-grid-container' => 'grid-column-gap: {{SIZE}}{{UNIT}}',

                ],
            ]
        );

        // Row margin.
        $widget->add_control(
            'grid_style_rows_margin',
            [
                'label'     => esc_html__('Rows margin', 'eventful-for-elementor'),
                'type'      => \Elementor\Controls_Manager::SLIDER,
                'default'   => [
                    'size' => 30,
                ],
                'range'     => [
                    'px' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .ppfe-grid-container' => 'grid-row-gap: {{SIZE}}{{UNIT}}',
                ],
            ]
        );

        $widget->add_control(
            'content_orientation',
            [
                'label' => esc_html__('Content Orientation', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'default' => esc_html__('Default', 'eventful-for-elementor'),
                    'overlay' => esc_html__('Overlay', 'eventful-for-elementor'),
                ],
                'default' => 'default',
                'condition' => [
                    'widget_name!' => 'eventful-post-list-widget'
                ]
            ]
        );

        $widget->add_control(
            'item_same_height',
            [
                'label'         => esc_html__('Same Height', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SWITCHER,
                'label_on'      => esc_html__('Show', 'eventful-for-elementor'),
                'label_off'     => esc_html__('Hide', 'eventful-for-elementor'),
            ]
        );

        $widget->add_control(
            'show_image',
            [
                'label'         => esc_html__('Image', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SWITCHER,
                'label_on'      => esc_html__('Show', 'eventful-for-elementor'),
                'label_off'     => esc_html__('Hide', 'eventful-for-elementor'),
                'default'       => 'yes',
                'separator'     => 'before',
            ]
        );

        $widget->add_group_control(
            \Elementor\Group_Control_Image_Size::get_type(),
            [
                'name'          => 'post_thumbnail',
                'default'       => 'full',
                'prefix_class'  => 'post-thumbnail-size-',
                'condition'     => [
                    'show_image' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'load_2x_image',
            [
                'label'         => esc_html__('Load 2x Resolution Image in Retina Display', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SWITCHER,
                'label_on'      => esc_html__('Show', 'eventful-for-elementor'),
                'label_off'     => esc_html__('Hide', 'eventful-for-elementor'),
                'condition'     => [
                    'show_image' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'thumb_src_replace',
            [
                'label'         => esc_html__('Replace With', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SELECT2,
                'multiple'      => true,
                'options'       => [
                    'image'     => esc_html__('Image', 'eventful-for-elementor'),
                    'video'     => esc_html__('Video', 'eventful-for-elementor'),
                    'audio'     => esc_html__('Audio', 'eventful-for-elementor'),
                ],
                'default'       => 'none',
                'condition'     => [
                    'show_image' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'thumb_zoom',
            [
                'label'         => esc_html__('Zoom Effect', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SELECT,
                'options'       => [
                    'none'      => esc_html__('None', 'eventful-for-elementor'),
                    'zoom_in'   => esc_html__('Zoom In', 'eventful-for-elementor'),
                    'zoom_out'  => esc_html__('Zoom Out', 'eventful-for-elementor'),
                ],
                'default'       => 'none',
                'condition'     => [
                    'show_image' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'thumb_gray_scale',
            [
                'label'         => esc_html__('Image Mode', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SELECT,
                'options'       => [
                    'none'      => esc_html__('Normal', 'eventful-for-elementor'),
                    'gray_and_normal'   => esc_html__('Grayscale and normal on hover', 'eventful-for-elementor'),
                    'gray_on_hover'     => esc_html__('Grayscale on hover', 'eventful-for-elementor'),
                    'always_gray'       => esc_html__('Always grayscale', 'eventful-for-elementor'),
                ],
                'default'       => 'none',
                'condition'     => [
                    'show_image' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'thumb_lazy_load',
            [
                'label'         => esc_html__('Lazy Load', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SWITCHER,
                'label_on'      => esc_html__('Show', 'eventful-for-elementor'),
                'label_off'     => esc_html__('Hide', 'eventful-for-elementor'),
                'default'       => 'yes',
                'condition'     => [
                    'show_image' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'thumb_meta',
            [
                'label'         => esc_html__('Show Thumb Meta', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SELECT,
                'options'       => [
                    'category'  => esc_html__('Category', 'eventful-for-elementor'),
                    'date'      => esc_html__('Date', 'eventful-for-elementor'),
                    'none'      => esc_html__('None', 'eventful-for-elementor'),
                ],
                'default'       => 'none',
                'condition'     => [
                    'show_image' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'thumb_meta_taxonomy',
            [
                'label'         => esc_html__('Select Taxonomy', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SELECT,
                'options'       => array_merge(['' => esc_html__('Select Taxonomy', 'eventful-for-elementor')], EventfulForElementorUtlitiesFunctions::get_post_type_taxonomies('tribe_events')),
                'condition'     => [
                    'show_image' => 'yes',
                    'thumb_meta' => 'category',
                ],
            ]
        );

        $widget->add_control(
            'thumb_meta_date_format',
            [
                'label'         => esc_html__('Date Format', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SELECT,
                'options'       => [
                    'default'   => esc_html__('Default', 'eventful-for-elementor'),
                    'time_ago'  => esc_html__('Time ago(human time)', 'eventful-for-elementor'),
                    'custom'    => esc_html__('Custom', 'eventful-for-elementor'),
                ],
                'default'       => 'default',
                'condition'     => [
                    'show_image' => 'yes',
                    'thumb_meta' => 'date',
                ],
            ]
        );

        $widget->add_control(
            'custom_date_format',
            [
                'label'         => esc_html__('Custom Format ', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::TEXT,
                'placeholder'   => esc_html__('F j, Y', 'eventful-for-elementor'),
                'description'   => esc_html__('To define format, check <a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank" rel="noopener noreferrer nofollow"><em>this doc</em></a>.', 'eventful-for-elementor'),
                'condition'     => [
                    'show_image' => 'yes',
                    'thumb_meta' => 'date',
                    'thumb_meta_date_format' => 'custom',
                ],
            ]
        );

        $widget->add_control(
            'thumb_meta_position',
            [
                'label' => esc_html__('Taxonomy Position', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'top_right'         => esc_html__('Top right', 'eventful-for-elementor'),
                    'top_center'        => esc_html__('Top center', 'eventful-for-elementor'),
                    'top_left'          => esc_html__('Top left', 'eventful-for-elementor'),
                    'bottom_left'       => esc_html__('Bottom left', 'eventful-for-elementor'),
                    'bottom_center'     => esc_html__('Bottom center', 'eventful-for-elementor'),
                    'bottom_right'      => esc_html__('Bottom right', 'eventful-for-elementor'),
                ],
                'default'   => 'top_right',
                'condition' => [
                    'show_image' => 'yes',
                    'thumb_meta!' => 'none',
                ],
            ]
        );

        $widget->add_control(
            'show_title',
            [
                'label'         => esc_html__('Title', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SWITCHER,
                'label_on'      => esc_html__('Show', 'eventful-for-elementor'),
                'label_off'     => esc_html__('Hide', 'eventful-for-elementor'),
                'default'       => 'yes',
                'separator'     => 'before',
            ]
        );

        $widget->add_control(
            'title_tag',
            [
                'label' => esc_html__('Title HTML Tag', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'h1' => 'H1',
                    'h2' => 'H2',
                    'h3' => 'H3',
                    'h4' => 'H4',
                    'h5' => 'H5',
                    'h6' => 'H6',
                    'div' => 'div',
                    'span' => 'span',
                    'p' => 'p',
                ],
                'default' => 'h3',
                'condition' => [
                    'show_title' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'title_limit',
            [
                'label' => esc_html__('Limit Character', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'eventful-for-elementor'),
                'label_off' => esc_html__('Hide', 'eventful-for-elementor'),
                'condition' => [
                    'show_title' => 'yes',
                ],
            ]
        );
        $widget->add_control(
            'title_length',
            [
                'label' => esc_html__('Length', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'default' => '30',
                'condition' => [
                    'title_limit' => 'yes',
                ],
            ]
        );
        $widget->add_control(
            'title_alignment',
            [
                'label' => esc_html__('Alignment', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'options' => [
                    'left' => [
                        'title' => esc_html__('Left', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-center',
                    ],
                    'right' => [
                        'title' => esc_html__('Right', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-right',
                    ],
                ],
                'default' => 'left',
                'selectors' => [
                    '{{WRAPPER}} .eventful__item .eventful__item--title' => 'text-align: {{VALUE}};',
                ],
                'condition' => [
                    'show_title' => 'yes',
                ],
            ]
        );

        //********************************************************** */
        $widget->add_control(
            'show_event_meta',
            [
                'label' => esc_html__('Event Meta Fields', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'eventful-for-elementor'),
                'label_off' => esc_html__('Hide', 'eventful-for-elementor'),
                'default' => 'yes',
                'separator' => 'before',
            ]
        );

        $widget->add_control(
            'event_meta_data',
            [
                'label' => esc_html__('Event Meta Data', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'multiple' => true,
                'label_block' => true,
                'options' => [
                    'taxonomy' => esc_html__('Taxonomy', 'eventful-for-elementor'),
                    'venue' => esc_html__('Venue', 'eventful-for-elementor'),
                    'organizer' => esc_html__('Organizer', 'eventful-for-elementor'),
                    'price' => esc_html__('Price', 'eventful-for-elementor'),
                    'event_time' => esc_html__('Event Time', 'eventful-for-elementor'),
                ],
                'default' => ['venue', 'event_time'],
                'condition' => [
                    'show_event_meta' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'taxonomy',
            [
                'label' => esc_html__('Taxonomy', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
                'condition' => [
                    'show_event_meta' => 'yes',
                    'event_meta_data' => 'taxonomy',
                ],
            ]
        );

        $widget->start_popover();
        $widget->add_control(
            'meta_categories',
            [
                'label'         => esc_html__('Select Taxonomy', 'eventful-for-elementor'),
                'type'          => \Elementor\Controls_Manager::SELECT,
                'options'       => array_merge(['' => esc_html__('Select Taxonomy', 'eventful-for-elementor')], EventfulForElementorUtlitiesFunctions::get_post_type_taxonomies('tribe_events')),
            ]
        );

        $widget->add_control(
            'categories_icon',
            [
                'label' => esc_html__('Taxonomy Icon', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'fas fa-tag',
                    'library' => 'fa-solid',
                ],
                'recommended' => [
                    'fa-solid' => [
                        'tag',
                        'tags',
                    ],
                ],
            ]
        );
        $widget->end_popover();

        $widget->add_control(
            'venue_toggle',
            [
                'label' => esc_html__('Venue', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
                'condition' => [
                    'show_event_meta' => 'yes',
                    'event_meta_data' => 'venue',
                ],
            ]
        );

        $widget->start_popover();
        $widget->add_control(
            'venue_settings',
            [
                'label' => esc_html__('Venue Settings', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'label_block' => true,
				'multiple' => true,
                'options'  => array(
                    'address' => esc_html__('Address', 'eventful-for-elementor'),
                    'city' => esc_html__('City', 'eventful-for-elementor'),
                    'country' => esc_html__('Country', 'eventful-for-elementor'),
                    'state' => esc_html__('State', 'eventful-for-elementor'),
                    'postal_code' => esc_html__('Postal Code', 'eventful-for-elementor'),
                    'phone' => esc_html__('Phone', 'eventful-for-elementor'),
                ),
                'default' => array('address'),
            ]
        );
        $widget->add_control(
            'venue_map_link',
            [
                'label' => esc_html__('Show Map Link', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'eventful-for-elementor'),
                'label_off' => esc_html__('Hide', 'eventful-for-elementor'),
                'default' => 'yes',
            ]
        );
        $widget->add_control(
            'event_venue_icon',
            [
                'label' => esc_html__('Meta Icon', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'fas fa-map-marker-alt',
                    'library' => 'fa-solid',
                ],
                'recommended' => [
                    'fa-solid' => [
                        'map-marker-alt',
                        'map-marker',
                        'map-marked-alt',
                        'blender-phone',
                        'phone-alt',
                        'phone',
                    ],
                    'fa-regular' => [
                        'map-marker-alt',
                        'map-marker',
                        'map-marked-alt',
                        'blender-phone',
                        'phone-alt',
                        'phone',
                    ],
                ],
                'condition' => [
                    'show_event_meta' => 'yes',
                    'event_meta_data' => 'venue',
                ],
            ]
        );
        $widget->add_control(
            'venue_phone_icon',
            [
                'label' => esc_html__('Meta Icon', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'fas fa-phone-alt',
                    'library' => 'fa-solid',
                ],
                'recommended' => [
                    'fa-solid' => [
                        'blender-phone',
                        'phone-alt',
                        'phone',
                    ],
                    'fa-regular' => [
                        'blender-phone',
                        'phone-alt',
                        'phone',
                    ],
                ],
                'condition' => [
                    'show_event_meta' => 'yes',
                    'event_meta_data' => 'venue',
                    'venue_settings' => 'phone',
                ],
            ]
        );
        
        $widget->end_popover();

        $widget->add_control(
            'organizer_toggle',
            [
                'label' => esc_html__('Organizer', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
                'condition' => [
                    'show_event_meta' => 'yes',
                    'event_meta_data' => 'organizer',
                ],
            ]
        );

        $widget->start_popover();
        $widget->add_control(
            'event_organizer_icon',
            [
                'label' => esc_html__('Date Icon', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'far fa-user',
                    'library' => 'fa-regular',
                ],
                'recommended' => [
                    'fa-solid' => [
                        'user',
                        'fa-user',
                    ],
                    'fa-regular' => [
                        'user',
                        'fa-user',
                    ],
                ],
            ]
        );
        $widget->end_popover();

        $widget->add_control(
            'event_price_toggle',
            [
                'label' => esc_html__('Price', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
                'condition' => [
                    'show_event_meta' => 'yes',
                    'event_meta_data' => 'price',
                ],
            ]
        );

        $widget->start_popover();
        $widget->add_control(
            'event_price_icon',
            [
                'label' => esc_html__('Date Icon', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'fas fa-dollar-sign',
                    'library' => 'fa-solid',
                ],
                'recommended' => [
                    'fa-solid' => [
                        'dollar-sign',
                    ],
                ],
            ]
        );
        $widget->end_popover();

        $widget->add_control(
            'event_time_toggle',
            [
                'label' => esc_html__('Event Time', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
                'condition' => [
                    'show_event_meta' => 'yes',
                    'event_meta_data' => 'event_time',
                ],
            ]
        );

        $widget->start_popover();
        $widget->add_control(
            'event_date_icon',
            [
                'label' => esc_html__('Event Icon', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'far fa-clock',
                    'library' => 'fa-clock',
                ],
                'recommended' => [
                    'fa-solid' => [
                        'clock',
                    ],
                    'fa-regular' => [
                        'clock',
                    ],
                ],
            ]
        );

        $widget->add_control(
            'event_fildes_date_type',
            [
                'label' => esc_html__('Date Type', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => array(
                    'start_date' => esc_html__('Start Date and Time', 'eventful-for-elementor'),
                    'end_date' => esc_html__('End Date and Time', 'eventful-for-elementor'),
                    'start_date_time_with_end_date_time' => esc_html__('Start Date Time With End Date Time', 'eventful-for-elementor'),
                ),
                'default' => 'start_date',
            ]
        );

        $widget->add_control(
            'event_fildes_date_format',
            [
                'label' => '',
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => array(
                    'j F, Y g:i A' => esc_html__('Default (01 January 2024 12:00 AM)', 'eventful-for-elementor'),
                    'F j, Y g:i A' => esc_html__('Default (January 01 2024 12:00 AM)', 'eventful-for-elementor'),
                    'F j, g:i A' => esc_html__('Default (January 01 12:00 AM)', 'eventful-for-elementor'),
                    'j F, g:i A' => esc_html__('Default ( 01 January 12:00 AM)', 'eventful-for-elementor'),
                    'j M, g:i A' => esc_html__('Default ( 01 Jan 12:00 AM)', 'eventful-for-elementor'),
                    'M j, g:i A' => esc_html__('Default ( Jan 01 12:00 AM)', 'eventful-for-elementor'),
                    'j F, Y' => esc_html__('Default (01 January 2024)', 'eventful-for-elementor'),
                    'F j, Y' => esc_html__('Default (January 01 2024)', 'eventful-for-elementor'),
                    'j F, Y' => esc_html__('Default (01 January 2024)', 'eventful-for-elementor'),
                    'M j, Y' => esc_html__('Default (Jan 01 2024)', 'eventful-for-elementor'),
                    'j M, Y' => esc_html__('Default (01 Jan 2024)', 'eventful-for-elementor'),
                    'g:i A' => esc_html__('Default (12:50 AM)', 'eventful-for-elementor'),
                    'G:i' => esc_html__('Default (23:00)', 'eventful-for-elementor'),
                    'custom' => esc_html__('Custom', 'eventful-for-elementor'),
                ),
                'default' => 'j F, Y g:i A',
                'description' => __('To define format, check <a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank" rel="noopener noreferrer nofollow"><em>this doc</em></a>.', 'eventful-for-elementor'),
            ]
        );

        $widget->add_control(
            'efpe_custom_event_date_format',
            [
                'label' => '',
                'type' => \Elementor\Controls_Manager::TEXT,
                'placeholder' => esc_html__('j F, Y g:i A', 'eventful-for-elementor'),
                'condition' => [
                    'event_fildes_date_format' => 'custom',
                ],
                'description' => __('To define format, check <a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank" rel="noopener noreferrer nofollow"><em>this doc</em></a>.', 'eventful-for-elementor'),
            ]
        );

        $widget->end_popover();


        $widget->add_control(
            'event_meta_separator',
            [
                'label' => esc_html__('Separator Between', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'condition' => [
                    'show_event_meta' => 'yes',
                    'meta_data!' => [],
                ],
            ]
        );

        $widget->add_control(
            'event_meta_alignment',
            [
                'label' => esc_html__('Alignment', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'options' => [
                    'left' => [
                        'title' => esc_html__('Left', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-center',
                    ],
                    'right' => [
                        'title' => esc_html__('Right', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-right',
                    ],
                ],
                'default' => 'left',
                'selectors' => [
                    '{{WRAPPER}} .eventful__item .eventful__item--meta.event_meta ul' => 'justify-content: {{VALUE}};',
                ],
                'condition' => [
                    'show_event_meta' => 'yes',
                ],
            ]
        );
        //********************************************************** */
        $widget->add_control(
            'show_content',
            [
                'label' => esc_html__('Content', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'eventful-for-elementor'),
                'label_off' => esc_html__('Hide', 'eventful-for-elementor'),
                'default' => 'yes',
                'separator' => 'before',
            ]
        );

        $widget->add_control(
            'content_type',
            [
                'label' => esc_html__('Content Display Type', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'excerpt'  => esc_html__('Excerpt', 'eventful-for-elementor'),
                    'limit_content' => esc_html__('Content with Limit', 'eventful-for-elementor'),
                    'full_content' => esc_html__('Full Content', 'eventful-for-elementor'),
                ],
                'default' => 'limit_content',
                'condition' => [
                    'show_content' => 'yes',
                ],
            ]
        );
        $widget->add_control(
            'content_length_type',
            [
                'label' => esc_html__('Content Length Type', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'words'  => esc_html__('Words', 'eventful-for-elementor'),
                    'characters' => esc_html__('Characters', 'eventful-for-elementor'),
                ],
                'default' => 'words',
                'condition' => [
                    'show_content' => 'yes',
                    'content_type' => 'limit_content',
                ],
            ]
        );
        $widget->add_control(
            'content_limit',
            [
                'label'     => esc_html__('Words Length', 'eventful-for-elementor'),
                'type'      => \Elementor\Controls_Manager::NUMBER,
                'default'   => '30',
                'max'       => '1000',
                'condition' => [
                    'show_content' => 'yes',
                    'content_type' => 'limit_content',
                    'content_length_type' => 'words',
                ],
            ]
        );

        $widget->add_control(
            'content_characters_limit',
            [
                'label' => esc_html__('Characters Length', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'default' => '30',
                'max' => '1000',
                'condition' => [
                    'show_content' => 'yes',
                    'content_type' => 'limit_content',
                    'content_length_type' => 'characters',
                ],
            ]
        );

        $widget->add_control(
            'strip_tags',
            [
                'label' => esc_html__('HTML Tags', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'limit_content',
                'options' => [
                    'allow_all'  => esc_html__('Allow All', 'eventful-for-elementor'),
                    'strip_all' => esc_html__('Strip All', 'eventful-for-elementor'),
                    'allow_some' => esc_html__('Allow Some', 'eventful-for-elementor'),
                ],
                'default' => 'allow_all',
                'condition' => [
                    'show_content' => 'yes',
                    'content_type!' => 'excerpt',
                ],
            ]
        );
        $widget->add_control(
            'allow_tag_name',
            [
                'label'     => esc_html__('HTML Tags Names', 'eventful-for-elementor'),
                'type'      => \Elementor\Controls_Manager::TEXT,
                'condition' => [
                    'show_content' => 'yes',
                    'strip_tags' => 'allow_some',
                ],
            ]
        );
        $widget->add_control(
            'content_ellipsis',
            [
                'label'     => esc_html__('Ending Excerpt', 'eventful-for-elementor'),
                'type'      => \Elementor\Controls_Manager::TEXT,
                'default'   => '...',
                'condition' => [
                    'show_content' => 'yes',
                    'content_type!' => 'full_content',
                ],
            ]
        );
        $widget->add_control(
            'content_alignment',
            [
                'label' => esc_html__('Alignment', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'options' => [
                    'left' => [
                        'title' => esc_html__('Left', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-center',
                    ],
                    'right' => [
                        'title' => esc_html__('Right', 'eventful-for-elementor'),
                        'icon' => 'eicon-text-align-right',
                    ],
                ],
                'default' => 'left',
                'selectors' => [
                    '{{WRAPPER}} .eventful__item .eventful__item__content' => 'text-align: {{VALUE}};',
                ],
                'condition' => [
                    'show_content' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'show_read_more',
            [
                'label' => esc_html__('Read More', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'eventful-for-elementor'),
                'label_off' => esc_html__('Hide', 'eventful-for-elementor'),
                'default' => 'yes',
            ]
        );

        $widget->add_control(
            'read_more_type',
            [
                'label' => esc_html__('Read More Type', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'limit_content',
                'options' => [
                    'button'  => esc_html__('Button', 'eventful-for-elementor'),
                    'text_link' => esc_html__('Text Link', 'eventful-for-elementor'),
                ],
                'default' => 'button',
                'condition' => [
                    'show_read_more' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'read_more_text',
            [
                'label' => esc_html__('Read More Text', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('Read More', 'eventful-for-elementor'),
                'condition' => [
                    'show_read_more' => 'yes',
                ],
            ]
        );

        $widget->add_control(
            'show_preloader',
            [
                'label' => esc_html__('Preloader', 'eventful-for-elementor'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'eventful-for-elementor'),
                'label_off' => esc_html__('Hide', 'eventful-for-elementor'),
            ]
        );

        $widget->end_controls_section();
    }
}
