<?php
pxl_add_custom_widget(
    array(
        'name' => 'pxl_text_slip',
        'title' => esc_html__('BR Text Slip', 'kaitex' ),
        'icon' => 'eicon-heading',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'section_content',
                    'label' => esc_html__('Content', 'kaitex' ),
                    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                    'controls' => array(
                        array(
                            'name' => 'text_row',
                            'label' => esc_html__('Text Row', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                '1row' => '1 Row',
                                '2rows' => '2 Rows',
                            ],
                            'default' => '1row',
                        ),
                        array(
                            'name' => 'items_01',
                            'label' => esc_html__('Content 01', 'kaitex'),
                            'type' => \Elementor\Controls_Manager::REPEATER,
                            'controls' => array(
                                array(
                                    'name' => 'text_01',
                                    'label' => esc_html__('Text', 'kaitex' ),
                                    'type' => \Elementor\Controls_Manager::TEXTAREA,
                                    'label_block' => true,
                                ),
                                array(
                                    'name' => 'pxl_icon_01',
                                    'label' => esc_html__('Icon', 'kaitex' ),
                                    'type' => \Elementor\Controls_Manager::ICONS,
                                    'fa4compatibility' => 'icon',
                                ),
                            ),
                            'title_field' => '{{{ text_01 }}}',
                        ),
                        array(
                            'name' => 'items_02',
                            'label' => esc_html__('Content 02', 'kaitex'),
                            'type' => \Elementor\Controls_Manager::REPEATER,
                            'condition' => [
                                'text_row' => '2rows',
                            ],
                            'controls' => array(
                                array(
                                    'name' => 'text_02',
                                    'label' => esc_html__('Text', 'kaitex' ),
                                    'type' => \Elementor\Controls_Manager::TEXTAREA,
                                    'label_block' => true,
                                ),
                                array(
                                    'name' => 'pxl_icon_02',
                                    'label' => esc_html__('Icon', 'kaitex' ),
                                    'type' => \Elementor\Controls_Manager::ICONS,
                                    'fa4compatibility' => 'icon',
                                ),
                            ),
                            'title_field' => '{{{ text_02 }}}',
                        ),
                    ),
                ),
                array(
                    'name' => 'section_style_row01',
                    'label' => esc_html__('Row 01', 'kaitex' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(
                        array(
                            'name' => 'style_01',
                            'label' => esc_html__('Style', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'style1' => 'Style 1',
                                'style2' => 'Style 2',
                            ],
                            'default' => 'style1',
                        ),
                        array(
                            'name' => 'text_tag_01',
                            'label' => esc_html__('HTML Tag', 'kaitex' ),
                            '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',
                        ),
                        array(
                            'name' => 'background_color_01',
                            'label' => esc_html__('Background Color', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .pxl-item--container.container-01:before' => 'background-color: {{VALUE}};',
                            ],
                            'condition' => [
                                'style_01' => 'style1',
                            ],
                        ),
                        array(
                            'name' => 'border_color_01',
                            'label' => esc_html__('Border Color', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .pxl-item--container.container-01:before' => 'border-color: {{VALUE}};',
                            ],
                            'condition' => [
                                'style_01' => 'style2',
                            ],
                        ),
                        array(
                            'name' => 'icon_color_01',
                            'label' => esc_html__('Icon Color', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .container-01 .pxl-item--text i' => 'color: {{VALUE}};',
                                '{{WRAPPER}} .pxl-text-slip .container-01 .pxl-item--text svg path' => 'stroke: {{VALUE}};',
                            ],
                        ),
                        array(
                            'name'  => 'icon_width_01',
                            'label' => esc_html__( 'Icon Width', 'kaitex' ),
                            'type'  => 'slider',
                            'size_units' => [ 'px', '%', 'vw', 'vh' ],
                            'range' => [
                                '%' => [
                                    'min' => 0,
                                    'max' => 100,
                                ],
                                'px' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                                'vw' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                                'vh' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                            ],
                            'control_type' => 'responsive',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .container-01 .pxl-item--text i' => 'font-size: {{SIZE}}{{UNIT}};',
                                '{{WRAPPER}} .pxl-text-slip .container-01 .pxl-item--text svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'text_color_01',
                            'label' => esc_html__('Text Color', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .container-01 .pxl-item--text' => 'color: {{VALUE}};',
                            ],
                        ),
                        array(
                            'name' => 'text_typography_01',
                            'label' => esc_html__('Text Typography', 'kaitex' ),
                            'type' => \Elementor\Group_Control_Typography::get_type(),
                            'control_type' => 'group',
                            'selector' => '{{WRAPPER}} .pxl-text-slip .container-01 .pxl-item--text',
                        ),
                        array(
                            'name' => 'text_effect_01',
                            'label' => esc_html__('Effect', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'no-effect' => 'None',
                                'pxl-slide-to-left' => 'Slide Right To Left',
                                'pxl-slide-to-right' => 'Slide Left To Right',
                            ],
                            'default' => 'no-effect',
                        ),
                        array(
                            'name' => 'transform_speed_01',
                            'label' => esc_html__('Text Transform Speed', 'kaitex'),
                            'type' => \Elementor\Controls_Manager::NUMBER,
                            'min' => 0,
                            'step' => 0.1,
                            'default' => 3,
                            'description' => esc_html__('The smaller the value, the faster', 'kaitex'),
                            'condition' => [
                                'text_effect_01' => ['pxl-slide-to-left', 'pxl-slide-to-right'],
                            ],
                        ),
                        array(
                            'name' => 'rotate_speed_01',
                            'label' => esc_html__('Icon Rotate Speed', 'kaitex'),
                            'type' => \Elementor\Controls_Manager::NUMBER,
                            'min' => 0,
                            'step' => 0.1,
                            'default' => 5,
                            'description' => esc_html__('The smaller the value, the faster', 'kaitex'),
                            'condition' => [
                                'text_effect_01' => ['pxl-slide-to-left', 'pxl-slide-to-right'],
                            ],
                        ),
                    ),
                ),
                array(
                    'name' => 'section_style_row02',
                    'label' => esc_html__('Row 02', 'kaitex' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'condition' => [
                        'text_row' => '2rows',
                    ],
                    'controls' => array(
                        array(
                            'name' => 'style_02',
                            'label' => esc_html__('Style', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'style1' => 'Style 1',
                                'style2' => 'Style 2',
                            ],
                            'default' => 'style2',
                        ),
                        array(
                            'name' => 'text_tag_02',
                            'label' => esc_html__('HTML Tag', 'kaitex' ),
                            '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',
                        ),
                        array(
                            'name' => 'background_color_02',
                            'label' => esc_html__('Background Color', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .pxl-item--container.container-02:before' => 'background-color: {{VALUE}};',
                            ],
                            'condition' => [
                                'style_02' => 'style1',
                            ],
                        ),
                        array(
                            'name' => 'border_color_02',
                            'label' => esc_html__('Border Color', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .pxl-item--container.container-02:before' => 'border-color: {{VALUE}};',
                            ],
                            'condition' => [
                                'style_02' => 'style2',
                            ],
                        ),
                        array(
                            'name' => 'icon_color_02',
                            'label' => esc_html__('Icon Color', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .container-02 .pxl-item--text i' => 'color: {{VALUE}};',
                                '{{WRAPPER}} .pxl-text-slip .container-02 .pxl-item--text svg path' => 'stroke: {{VALUE}};',
                            ],
                        ),
                        array(
                            'name'  => 'icon_width_02',
                            'label' => esc_html__( 'Icon Width', 'kaitex' ),
                            'type'  => 'slider',
                            'size_units' => [ 'px', '%', 'vw', 'vh' ],
                            'range' => [
                                '%' => [
                                    'min' => 0,
                                    'max' => 100,
                                ],
                                'px' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                                'vw' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                                'vh' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                            ],
                            'control_type' => 'responsive',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .container-02 .pxl-item--text i' => 'font-size: {{SIZE}}{{UNIT}};',
                                '{{WRAPPER}} .pxl-text-slip .container-02 .pxl-item--text svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'text_color_02',
                            'label' => esc_html__('Text Color', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-text-slip .container-02 .pxl-item--text' => 'color: {{VALUE}};',
                            ],
                        ),
                        array(
                            'name' => 'text_typography_02',
                            'label' => esc_html__('Text Typography', 'kaitex' ),
                            'type' => \Elementor\Group_Control_Typography::get_type(),
                            'control_type' => 'group',
                            'selector' => '{{WRAPPER}} .pxl-text-slip .container-02 .pxl-item--text',
                        ),
                        array(
                            'name' => 'text_effect_02',
                            'label' => esc_html__('Effect', 'kaitex' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                'no-effect' => 'None',
                                'pxl-slide-to-left' => 'Slide Right To Left',
                                'pxl-slide-to-right' => 'Slide Left To Right',
                            ],
                            'default' => 'no-effect',
                        ),
                        array(
                            'name' => 'transform_speed_02',
                            'label' => esc_html__('Text Transform Speed', 'kaitex'),
                            'type' => \Elementor\Controls_Manager::NUMBER,
                            'min' => 0,
                            'step' => 0.1,
                            'default' => 3,
                            'description' => esc_html__('The smaller the value, the faster', 'kaitex'),
                            'condition' => [
                                'text_effect_02' => ['pxl-slide-to-left', 'pxl-slide-to-right'],
                            ],
                        ),
                        array(
                            'name' => 'rotate_speed_02',
                            'label' => esc_html__('Icon Rotate Speed', 'kaitex'),
                            'type' => \Elementor\Controls_Manager::NUMBER,
                            'min' => 0,
                            'step' => 0.1,
                            'default' => 5,
                            'description' => esc_html__('The smaller the value, the faster', 'kaitex'),
                            'condition' => [
                                'text_effect_02' => ['pxl-slide-to-left', 'pxl-slide-to-right'],
                            ],
                        ),
                    ),
                ),
                kaitex_widget_animation_settings(),
            ),
        ),
    ),
    kaitex_get_class_widget_path()
);