<?php

/**
 * Elementor Faq Widget.
 *
 * Elementor widget that inserts an embbedable content into the page, from any given URL.
 *
 * @since 1.0.0
 */
class Daltech_Faq extends \Elementor\Widget_Base
{

    /**
     * Get widget name.
     *
     * Retrieve Faq widget name.
     *
     * @since 1.0.0
     * @access public
     *
     * @return string Widget name.
     */
    public function get_name()
    {
        return 'daltech_faq_content';
    }

    /**
     * Get widget title.
     *
     * Retrieve Faq widget title.
     *
     * @since 1.0.0
     * @access public 
     *
     * @return string Widget title.
     */
    public function get_title()
    {
        return esc_html__('Faq', 'daltech-core');
    }

    /**
     * Get widget icon.
     *
     * Retrieve Faq widget icon.
     *
     * @since 1.0.0
     * @access public
     *
     * @return string Widget icon.
     */
    public function get_icon()
    {
        return 'eicon-code';
    }

    /**
     * Get widget categories.
     *
     * Retrieve the list of categories the Faq widget belongs to.
     *
     * @since 1.0.0
     * @access public
     *
     * @return array Widget categories.
     */
    public function get_categories()
    {
        return ['daltech'];
    }

    public function daltech_tab_choose_option()
    {

        $daltech_post_query = new WP_Query(array(
            'post_type'                => 'daltech_tab_builder',
            'posts_per_page'        => -1,
        ));

        $daltech_tab_title = array();
        $daltech_tab_title[''] = __('Select a Faq Item', 'daltech');

        while ($daltech_post_query->have_posts()) {
            $daltech_post_query->the_post();
            $daltech_tab_title[get_the_ID()] =  get_the_title();
        }
        wp_reset_postdata();

        return $daltech_tab_title;
    }

    public function get_script_depends()
    {
        return array('main');
    }

    // Add The Input For User
    protected function register_controls()
    {


        $this->start_controls_section(
            'faq_content',
            [
                'label'        => esc_html__('Set Faq Content', 'daltech-core'),
                'tab'        => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'style',
            [
                'label'     => esc_html__('Style', 'daltech-core'),
                'type'         => \Elementor\Controls_Manager::SELECT,
                'default'     => '1',
                'options'     => [
                    '1'      => esc_html__('Style One', 'daltech-core'),
                    '2'      => esc_html__('Style Two', 'daltech-core'),
                    '3'      => esc_html__('Style Three', 'daltech-core'),
                    '4'      => esc_html__('Style Four', 'daltech-core'),
                    '5'      => esc_html__('Style Five', 'daltech-core'),
                ],
            ]
        );

        $this->add_control(
            'section_title',
            [
                'label'         => esc_html__('Section Title', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder'     => esc_html__('section title', 'daltech-core'),
                'default'         => esc_html__('Default Section Title', 'daltech-core'),
                'condition' => [
                    'style' => ['1', '2', '3', '5']
                ]
            ]

        );

        $this->add_control(
            'section_subtitle',
            [
                'label'         => esc_html__('Section Subtitle', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder'     => esc_html__('section subtitle', 'daltech-core'),
                'default'         => esc_html__('Default Section SubTitle', 'daltech-core'),
                'condition' => [
                    'style' => ['1', '2', '3', '5']
                ]

            ]
        );

        $this->add_control(
            'section_summary',
            [
                'label'         => esc_html__('Section Summary', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder'     => esc_html__('section Summary', 'daltech-core'),
                'default'         => esc_html__('Default Section Summary', 'daltech-core'),
                'condition' => [
                    'style' => ['1', '2', '3', '5']
                ]

            ]
        );

        $this->add_control(
            'button_label',
            [
                'label'     => __('Button Label', 'daltech-core'),
                'type'         => \Elementor\Controls_Manager::TEXTAREA,
                'rows'         => 2,
                'default'      => __('Button Label', 'daltech-core'),
                'condition' => [
                    'style' => ['5']
                ]
            ]
        );

        $this->add_control(
            'url',
            [
                'label'         => __('URL', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::URL,
                'placeholder'     => __('https://your-link.com', 'daltech-core'),
                'show_external' => true,
                'default'         => [
                    'url'             => '#',
                    'is_external'     => false,
                    'nofollow'         => false,
                ],
                'condition' => [
                    'style' => ['5']
                ]
            ]
        );

        $this->add_control(
            'section_check_list',
            [
                'label'         => esc_html__('Section Check List', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::CODE,
                'placeholder'     => esc_html__('section Check List', 'daltech-core'),
                'default'         => esc_html__('Default Section Check List', 'daltech-core'),
                'condition' => [
                    'style' => ['1', '3']
                ]

            ]
        );

        $layout_one_faq_list = new \Elementor\Repeater();

        $layout_one_faq_list->add_control(
            'title',
            [
                'label'         => esc_html__('Title', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 2,
                'placeholder' => __('Title', 'daltech-core'),
                'default' => __('Default Title', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_one_faq_list->add_control(
            'subtitle',
            [
                'label'         => esc_html__('Subtitle', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 4,
                'placeholder' => __('SubTitle', 'daltech-core'),
                'default' => __('Default SubTitle', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_one_faq_list->add_control(
            'active_status',
            [
                'label' => __('Is active?', 'daltech-core'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __('Yes', 'ploming-addon'),
                'label_off' => __('No', 'ploming-addon'),
                'return_value' => 'yes',
                'default' => 'no',
            ]
        );

        $this->add_control(
            'layout_one_faq_list',
            [
                'label'     => esc_html__('Faq List', 'daltech-core'),
                'type'         => \Elementor\Controls_Manager::REPEATER,
                'fields'     => $layout_one_faq_list->get_controls(),
                'default'     => [
                    [
                        'list_title' => esc_html__('Add Faq', 'daltech-core'),
                    ],
                ],
                'title_field' => '{{{ title }}}',
                'condition' => [
                    'style' => ['1', '2', '3', '4']
                ]
            ]
        );


        $layout_one_fun_fact_list = new \Elementor\Repeater();

        $layout_one_fun_fact_list->add_control(
            'title',
            [
                'label'         => esc_html__('Title', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 2,
                'placeholder' => __('Title', 'daltech-core'),
                'default' => __('Default Title', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_one_fun_fact_list->add_control(
            'number',
            [
                'label'         => esc_html__('Number', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXT,
                'placeholder' => __('Number', 'daltech-core'),
                'default' => __('Default Number', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $this->add_control(
            'layout_one_fun_fact_list',
            [
                'label'     => esc_html__('Fun Fact List', 'daltech-core'),
                'type'         => \Elementor\Controls_Manager::REPEATER,
                'fields'     => $layout_one_fun_fact_list->get_controls(),
                'default'     => [
                    [
                        'list_title' => esc_html__('Add Fun Fact', 'daltech-core'),
                    ],
                ],
                'title_field' => '{{{ title }}}',
                'condition' => [
                    'style' => ['1', '2']
                ]
            ]
        );

        $layout_five_faq_list = new \Elementor\Repeater();

        $layout_five_faq_list->add_control(
            'tab_title',
            [
                'label'         => esc_html__('Tab Title', 'restan-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder'     => esc_html__('Tab title', 'restan-core'),
                'default'         => esc_html__('Tab Title', 'restan-core'),
                'label_block'     => true,
            ]
        );

        $layout_five_faq_list->add_control(
            'title_one',
            [
                'label'         => esc_html__('Faq Title One', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 2,
                'placeholder' => __('Title', 'daltech-core'),
                'default' => __('Default Title', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_five_faq_list->add_control(
            'subtitle_one',
            [
                'label'         => esc_html__('Faq Subtitle One', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 4,
                'placeholder' => __('SubTitle', 'daltech-core'),
                'default' => __('Default SubTitle', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_five_faq_list->add_control(
            'title_two',
            [
                'label'         => esc_html__('Faq Title Two', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 2,
                'placeholder' => __('Title', 'daltech-core'),
                'default' => __('Default Title', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_five_faq_list->add_control(
            'subtitle_two',
            [
                'label'         => esc_html__('Faq Subtitle Two', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 4,
                'placeholder' => __('SubTitle', 'daltech-core'),
                'default' => __('Default SubTitle', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_five_faq_list->add_control(
            'title_three',
            [
                'label'         => esc_html__('Faq Title Three', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 2,
                'placeholder' => __('Title', 'daltech-core'),
                'default' => __('Default Title', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_five_faq_list->add_control(
            'subtitle_three',
            [
                'label'         => esc_html__('Faq Subtitle Three', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 4,
                'placeholder' => __('SubTitle', 'daltech-core'),
                'default' => __('Default SubTitle', 'daltech-core'),
                'label_block' => true,
            ]
        );


        $layout_five_faq_list->add_control(
            'title_four',
            [
                'label'         => esc_html__('Faq Title Four', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 2,
                'placeholder' => __('Title', 'daltech-core'),
                'default' => __('Default Title', 'daltech-core'),
                'label_block' => true,
            ]
        );

        $layout_five_faq_list->add_control(
            'subtitle_four',
            [
                'label'         => esc_html__('Faq Subtitle Four', 'daltech-core'),
                'type'             => \Elementor\Controls_Manager::TEXTAREA,
                'rows' => 4,
                'placeholder' => __('SubTitle', 'daltech-core'),
                'default' => __('Default SubTitle', 'daltech-core'),
                'label_block' => true,
            ]
        );


        $this->add_control(
            'layout_five_faq_list',
            [
                'label'     => esc_html__('Faq List', 'daltech-core'),
                'type'         => \Elementor\Controls_Manager::REPEATER,
                'fields'     => $layout_five_faq_list->get_controls(),
                'default'     => [
                    [
                        'list_title' => esc_html__('Add Faq List', 'daltech-core'),
                    ],
                ],
                'title_field' => '{{{ tab_title }}}',
                'condition' => [
                    'style' => ['5']
                ]
            ]
        );

        $this->end_controls_section();

        include DALTECH_PLUGIN_WIDGET_STYLE_PATH . 'faq-style.php';
    }

    // Output For User
    protected function render()
    {
        $settings = $this->get_settings_for_display();
        if ($settings['style'] == '1') : ?>

            <!--<< Faq Section Start >>-->
            <section class="faq-section fix section-padding">
                <div class="container">
                    <div class="about-wrapper">
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="about-content">
                                    <div class="section-title">
                                        <span class="wow fadeInUp">
                                            <?php echo wp_kses_post($settings['section_subtitle'], 'daltech_kses_allowed_html'); ?></span>
                                        <h2 class="wow fadeInUp" data-wow-delay=".3s">
                                            <?php echo wp_kses_post($settings['section_title'], 'daltech_kses_allowed_html'); ?>
                                        </h2>
                                    </div>
                                    <p class=" mt-4 mt-md-0 wow fadeInUp" data-wow-delay=".5s">
                                        <?php echo wp_kses_post($settings['section_summary'], 'daltech_kses_allowed_html'); ?>
                                    </p>
                                    <ul class="about-list mt-4 wow fadeInUp" data-wow-delay=".7s">
                                        <?php echo wp_kses_post($settings['section_check_list'], 'daltech_kses_allowed_html'); ?>
                                    </ul>
                                    <div class="circle-progress-bar-wrapper mbm-10">
                                        <?php
                                        $counter = 1;
                                        foreach ($settings['layout_one_fun_fact_list'] as $item) :
                                        ?>
                                            <div class="single-circle-bar wow fadeInUp" data-wow-delay=".8s">
                                                <div class="circle-bar" data-percent="<?php echo esc_attr($item['number']); ?>" data-duration="1000">
                                                </div>
                                                <div class="content">
                                                    <h6>
                                                        <?php echo wp_kses($item['title'], 'daltech_allowed_tags'); ?>
                                                    </h6>
                                                </div>
                                            </div>
                                        <?php
                                            $counter++;
                                        endforeach;
                                        ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 mt-5 mt-lg-0">
                                <div class="faq-content">
                                    <div class="faq-accordion">
                                        <div class="accordion" id="accordion">
                                            <?php
                                            $counter = 1;
                                            foreach ($settings['layout_one_faq_list'] as $item) :
                                            ?>
                                                <div class="accordion-item wow fadeInUp" data-wow-delay=".3s">
                                                    <h4 class="accordion-header">
                                                        <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#item<?php echo esc_attr($counter); ?>" aria-expanded="false" aria-controls="item<?php echo esc_attr($counter); ?>">
                                                            <?php echo wp_kses($item['title'], 'daltech_allowed_tags'); ?>
                                                        </button>
                                                    </h4>
                                                    <div id="item<?php echo esc_attr($counter); ?>" class="accordion-collapse collapse <?php echo esc_attr(('2' == $counter ? 'show' : '')); ?>" data-bs-parent="#accordion">
                                                        <div class="accordion-body">
                                                            <?php echo wp_kses($item['subtitle'], 'daltech_allowed_tags'); ?>
                                                        </div>
                                                    </div>
                                                </div>
                                            <?php
                                                $counter++;
                                            endforeach;
                                            ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <!--<< Faq Section End One >>-->

        <?php elseif ($settings['style'] == '2') : ?>

            <!--<< Faq Section Start Two >>-->
            <section class="faq-section fix section-padding pt-0">
                <div class="container">
                    <div class="about-wrapper pb-0">
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="about-content">
                                    <div class="section-title style-2">
                                        <span class="wow fadeInUp">
                                            <?php echo wp_kses_post($settings['section_subtitle'], 'daltech_kses_allowed_html'); ?></span>
                                        <h2 class="wow fadeInUp" data-wow-delay=".3s">
                                            <?php echo wp_kses_post($settings['section_title'], 'daltech_kses_allowed_html'); ?>
                                        </h2>
                                    </div>
                                    <p class=" mt-4 mt-md-0 wow fadeInUp" data-wow-delay=".5s">
                                        <?php echo wp_kses_post($settings['section_summary'], 'daltech_kses_allowed_html'); ?>
                                    </p>
                                    <div class="circle-progress-bar-wrapper style-2">
                                        <?php
                                        $counter = 1;
                                        foreach ($settings['layout_one_fun_fact_list'] as $item) :
                                        ?>
                                            <div class="single-circle-bar wow fadeInUp" data-wow-delay=".7s">
                                                <div class="circle-bar" data-percent="<?php echo esc_attr($item['number']); ?>" data-duration="1000">
                                                </div>
                                                <div class="content">
                                                    <h6>
                                                        <?php echo wp_kses($item['title'], 'daltech_allowed_tags'); ?>
                                                    </h6>
                                                </div>
                                            </div>
                                        <?php
                                            $counter++;
                                        endforeach;
                                        ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 mt-5 mt-lg-0">
                                <div class="faq-content style-2">
                                    <div class="faq-accordion">
                                        <div class="accordion" id="accordion">

                                            <?php
                                            $counter = 1;
                                            foreach ($settings['layout_one_faq_list'] as $item) :
                                            ?>
                                                <div class="accordion-item wow fadeInUp" data-wow-delay=".3s">
                                                    <h4 class="accordion-header">
                                                        <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq<?php echo esc_attr($counter); ?>" aria-expanded="false" aria-controls="faq<?php echo esc_attr($counter); ?>">
                                                            <?php echo wp_kses($item['title'], 'daltech_allowed_tags'); ?>
                                                        </button>
                                                    </h4>
                                                    <div id="faq<?php echo esc_attr($counter); ?>" class="accordion-collapse collapse <?php echo esc_attr(('yes' == $item['active_status'] ? 'show' : '')); ?>" data-bs-parent="#accordion">
                                                        <div class="accordion-body">
                                                            <?php echo wp_kses($item['subtitle'], 'daltech_allowed_tags'); ?>
                                                        </div>
                                                    </div>
                                                </div>
                                            <?php
                                                $counter++;
                                            endforeach;
                                            ?>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <!--<< Faq Section End Two >>-->

        <?php elseif ($settings['style'] == '3') : ?>

            <!--<< Faq Section Start Three >>-->
            <section class="faq-section fix section-padding pt-0">
                <div class="container">
                    <div class="about-wrapper">
                        <div class="row g-4">
                            <div class="col-lg-6">
                                <div class="about-content">
                                    <div class="section-title">
                                        <span class="wow fadeInUp">
                                            <?php echo wp_kses_post($settings['section_subtitle'], 'daltech_kses_allowed_html'); ?>
                                        </span>
                                        <h2 class="wow fadeInUp" data-wow-delay=".3s">
                                            <?php echo wp_kses_post($settings['section_title'], 'daltech_kses_allowed_html'); ?>
                                        </h2>
                                    </div>
                                    <p class=" mt-4 mt-md-0 wow fadeInUp" data-wow-delay=".5s">
                                        <?php echo wp_kses_post($settings['section_summary'], 'daltech_kses_allowed_html'); ?>
                                    </p>
                                    <ul class="about-list mt-4 wow fadeInUp" data-wow-delay=".7s">
                                        <?php echo wp_kses_post($settings['section_check_list'], 'daltech_kses_allowed_html'); ?>
                                    </ul>

                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="faq-content">
                                    <div class="faq-accordion">
                                        <div class="accordion" id="accordion">
                                            <?php
                                            $counter = 1;
                                            foreach ($settings['layout_one_faq_list'] as $item) :
                                            ?>
                                                <div class="accordion-item wow fadeInUp" data-wow-delay=".5s">
                                                    <h4 class="accordion-header">
                                                        <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#faq<?php echo esc_attr($counter); ?>" aria-expanded="true" aria-controls="faq<?php echo esc_attr($counter); ?>">
                                                            <?php echo wp_kses($item['title'], 'daltech_allowed_tags'); ?>
                                                        </button>
                                                    </h4>
                                                    <div id="faq<?php echo esc_attr($counter); ?>" class="accordion-collapse collapse <?php echo esc_attr(('yes' == $item['active_status'] ? 'show' : '')); ?>" data-bs-parent="#accordion">
                                                        <div class="accordion-body">
                                                            <?php echo wp_kses($item['subtitle'], 'daltech_allowed_tags'); ?>
                                                        </div>
                                                    </div>
                                                </div>
                                            <?php
                                                $counter++;
                                            endforeach;
                                            ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <!--<< Faq Section End Three >>-->

        <?php elseif ($settings['style'] == '4') : ?>

            <!--<< Faq Section Start Four >>-->
            <div class="faq-content">
                <div class="faq-accordion">
                    <div class="accordion" id="accordion">
                        <?php
                        $counter = 1;
                        foreach ($settings['layout_one_faq_list'] as $item) :
                        ?>
                            <div class="accordion-item wow fadeInUp" data-wow-delay=".3s">
                                <h4 class="accordion-header">
                                    <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq<?php echo esc_attr($counter); ?>" aria-expanded="false" aria-controls="faq<?php echo esc_attr($counter); ?>">
                                        <?php echo wp_kses($item['title'], 'daltech_allowed_tags'); ?>
                                    </button>
                                </h4>
                                <div id="faq<?php echo esc_attr($counter); ?>" class="accordion-collapse collapse <?php echo esc_attr(('yes' == $item['active_status'] ? 'show' : '')); ?>" data-bs-parent="#accordion">
                                    <div class="accordion-body">
                                        <?php echo wp_kses($item['subtitle'], 'daltech_allowed_tags'); ?>
                                    </div>
                                </div>
                            </div>
                        <?php
                            $counter++;
                        endforeach;
                        ?>
                    </div>
                </div>
            </div>
            <!--<< Faq Section End Four >>-->

        <?php elseif ($settings['style'] == '5') : ?>

            <!--<< Faq Section Start Five >>-->
            <section class="faq-section fix section-padding">
                <div class="container">
                    <div class="faq-wrapper">
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="section-title">
                                    <span class="wow fadeInUp">
                                        <?php echo wp_kses_post($settings['section_subtitle'], 'daltech_kses_allowed_html'); ?></span>
                                    <h2 class="wow fadeInUp" data-wow-delay=".3s">
                                        <?php echo wp_kses_post($settings['section_title'], 'daltech_kses_allowed_html'); ?>
                                    </h2>
                                </div>
                                <p class="mt-3 mt-md-0 mb-2 wow fadeInUp" data-wow-delay=".5s">
                                    <?php echo wp_kses_post($settings['section_summary'], 'daltech_kses_allowed_html'); ?>
                                </p>
                                <?php if (!empty($settings['button_label'])) : ?>
                                    <a href="<?php echo esc_url($settings['url']['url']); ?>" class="theme-btn mt-4 fadeInUp" data-wow-delay=".7s">
                                        <span> <?php echo wp_kses_post($settings['button_label'], 'daltech_kses_allowed_html'); ?> <i class="fas fa-chevron-right"></i></span>
                                    </a>
                                <?php endif; ?>
                            </div>
                            <div class="col-lg-6 mt-5 mt-lg-0">
                                <div class="single-tab-items">
                                    <ul class="nav mb-4" role="tablist">
                                        <?php
                                        $counter = 1;
                                        foreach ($settings['layout_five_faq_list'] as $item) :
                                        ?>
                                            <li class="nav-item fadeInUp" role="presentation">
                                                <a href="#<?php echo esc_attr(strtolower($item['tab_title'])); ?>" data-bs-toggle="tab" class="nav-link<?php echo esc_attr(('1' == $counter ? ' active' : '')); ?>" aria-selected="true" role="tab" <?php echo esc_attr(('1' != $counter ? '' : 'tabindex="-1"')); ?>>
                                                    <?php echo wp_kses_post($item['tab_title'], 'restan_kses_allowed_html'); ?>
                                                </a>
                                            </li>
                                        <?php
                                            $counter++;
                                        endforeach;
                                        ?>

                                    </ul>
                                    <div class="tab-content">
                                        <?php
                                        $counter = 1;
                                        foreach ($settings['layout_five_faq_list'] as $item) :
                                        ?>
                                            <div id="<?php echo esc_attr(strtolower($item['tab_title'])); ?>" class="tab-pane fade <?php if ($counter == '1') {
                                                                                                                                        echo esc_attr("show active", 'daltech-core');
                                                                                                                                    } ?>" role="tabpanel">
                                                <div class="faq-content">
                                                    <div class="faq-accordion">
                                                        <div class="accordion" id="accordion">
                                                            <div class="accordion-item fadeInUp">
                                                                <h4 class="accordion-header">
                                                                    <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq1" aria-expanded="false" aria-controls="faq1">
                                                                        <?php echo wp_kses($item['title_one'], 'daltech_allowed_tags'); ?>
                                                                    </button>
                                                                </h4>
                                                                <div id="faq1" class="accordion-collapse collapse" data-bs-parent="#accordion">
                                                                    <div class="accordion-body">
                                                                        <?php echo wp_kses($item['subtitle_one'], 'daltech_allowed_tags'); ?>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="accordion-item fadeInUp">
                                                                <h4 class="accordion-header">
                                                                    <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#faq2" aria-expanded="true" aria-controls="faq2">
                                                                        <?php echo wp_kses($item['title_two'], 'daltech_allowed_tags'); ?>
                                                                    </button>
                                                                </h4>
                                                                <div id="faq2" class="accordion-collapse collapse show" data-bs-parent="#accordion">
                                                                    <div class="accordion-body">
                                                                        <?php echo wp_kses($item['subtitle_two'], 'daltech_allowed_tags'); ?>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="accordion-item fadeInUp">
                                                                <h4 class="accordion-header">
                                                                    <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq3" aria-expanded="false" aria-controls="faq3">
                                                                        <?php echo wp_kses($item['title_three'], 'daltech_allowed_tags'); ?>
                                                                    </button>
                                                                </h4>
                                                                <div id="faq3" class="accordion-collapse collapse" data-bs-parent="#accordion">
                                                                    <div class="accordion-body">
                                                                        <?php echo wp_kses($item['subtitle_three'], 'daltech_allowed_tags'); ?>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="accordion-item fadeInUp">
                                                                <h4 class="accordion-header">
                                                                    <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq4" aria-expanded="false" aria-controls="faq4">
                                                                        <?php echo wp_kses($item['title_four'], 'daltech_allowed_tags'); ?>
                                                                    </button>
                                                                </h4>
                                                                <div id="faq4" class="accordion-collapse collapse" data-bs-parent="#accordion">
                                                                    <div class="accordion-body">
                                                                        <?php echo wp_kses($item['title_four'], 'daltech_allowed_tags'); ?>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        <?php
                                            $counter++;
                                        endforeach;
                                        ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <!--<< Faq Section Start Five >>-->
<?php
        endif;
    }
}
