<?php

namespace Unlockafe_addons\Widgets;

use Unlockafe_addons\Traits\Utils as UnlockafeUtils;
use Unlockafe_addons\Traits\Widget_helper;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use \Elementor\Group_Control_Border;
use \Elementor\Group_Control_Background;
use \Elementor\Group_Control_Image_Size;
use \Elementor\Group_Control_Box_Shadow;
use \Elementor\Group_Control_Text_Shadow;
use \Elementor\Group_Control_Typography;
use \Elementor\Repeater;

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

/**
 * Theme Button Widget
 *
 * @since 1.0.0
 */
class Button extends Widget_Base
{

	use Widget_helper, UnlockafeUtils;

	/**
	 * Retrieve the widget name.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name()
	{
		return 'unlockafe-theme-button';
	}

	/**
	 * Retrieve the widget title.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title()
	{
		return __('WPRealizer - Theme Button', 'unlock-addons-for-elementor');
	}

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

	/**
	 * Retrieve the list of categories the widget belongs to.
	 *
	 * Used to determine where to display the widget in the editor.
	 *
	 * Note that currently Elementor supports only one category.
	 * When multiple categories passed, Elementor uses the first one.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories()
	{
		return ['unlockafe-addons'];
	}

	/**
	 * Retrieve the list of scripts the widget depended on.
	 *
	 * Used to set scripts dependencies required to run the widget.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return array Widget scripts dependencies.
	 */
	public function get_script_depends()
	{
		return [];
	}

	public function get_style_depends()
	{
		return ['unlockafe-global'];
	}

	/**
	 * Register the widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 1.0.0
	 *
	 * @access protected
	 */

	protected function register_controls()
	{
		$this->register_controls_section();
		$this->style_tab_content();
	}

	protected function register_controls_section()
	{
		// layout Panel
		$this->start_controls_section(
			'wpr_layout',
			[
				'label' => esc_html__('Design Layout', 'unlock-addons-for-elementor'),
			]
		);

		$this->add_control(
			'wpr_design_style',
			[
				'label' => esc_html__('Select Layout', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SELECT,
				'options' => [
					'layout-1' => esc_html__('Layout 1', 'unlock-addons-for-elementor'),
					'layout-2' => esc_html__('Layout 2', 'unlock-addons-for-elementor'),
					'layout-3' => esc_html__('Layout 3', 'unlock-addons-for-elementor'),
					'layout-4' => esc_html__('Layout 4', 'unlock-addons-for-elementor'),
					'layout-5' => esc_html__('Layout 5', 'unlock-addons-for-elementor'),
					'layout-6' => esc_html__('Layout 6', 'unlock-addons-for-elementor'),
					'layout-7' => esc_html__('Layout 7', 'unlock-addons-for-elementor'),
					'layout-8' => esc_html__('Layout 8', 'unlock-addons-for-elementor'),
					'layout-9' => esc_html__('Layout 9', 'unlock-addons-for-elementor'),
					'layout-10' => esc_html__('Layout 10', 'unlock-addons-for-elementor'),
				],
				'default' => 'layout-1',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'tp_theme_btn_button_group',
			[
				'label' => esc_html__('Theme Button', 'unlock-addons-for-elementor'),
				'tab' => Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'tp_button_type',
			[
				'label' => esc_html__('Button Style Type', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SELECT,
				'default' => 'inline',
				'options' => [
					'inline' => esc_html__('Inline', 'unlock-addons-for-elementor'),
					'w-100 d-block' => esc_html__('Full Width', 'unlock-addons-for-elementor'),
				],

			]
		);

		$this->add_control(
			'tp_theme_btn_button_show',
			[
				'label' => esc_html__('Show Button', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SWITCHER,
				'label_on' => esc_html__('Show', 'unlock-addons-for-elementor'),
				'label_off' => esc_html__('Hide', 'unlock-addons-for-elementor'),
				'return_value' => 'yes',
				'default' => 'yes',
			]
		);

		$this->add_control(
			'tp_theme_btn_text',
			[
				'label' => esc_html__('Button Text', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__('Read More', 'unlock-addons-for-elementor'),
				'title' => esc_html__('Enter button text', 'unlock-addons-for-elementor'),
				'label_block' => true,
				'condition' => [
					'tp_theme_btn_button_show' => 'yes'
				],
			]
		);

		$this->add_control(
			'wpr_button_img_thumb',
			[
				'label' => esc_html__('Choose Image', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				],
				'condition'   => ['wpr_design_style'   => ['layout-50']],
			]
		);

		$this->add_control(
			'tp_theme_btn_icon_show',
			[
				'label' => esc_html__('Add Icon ?', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => esc_html__('Show', 'unlock-addons-for-elementor'),
				'label_off' => esc_html__('Hide', 'unlock-addons-for-elementor'),
				'return_value' => 'yes',
				'default' => 'no',
			]
		);


		$this->tp_single_icon_control('theme_btn', 'tp_theme_btn_icon_show', 'yes');

		$this->add_control(
			'tp_theme_btn_icon_position',
			[
				'label' => esc_html__('Choose Icon Position', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'left' => [
						'title' => esc_html__('Left', 'unlock-addons-for-elementor'),
						'icon' => 'eicon-h-align-left',
					],
					'right' => [
						'title' => esc_html__('Right', 'unlock-addons-for-elementor'),
						'icon' => 'eicon-h-align-right',
					],
				],
				'default' => 'right',
				'toggle' => true,
			]
		);

		$this->add_control(
			'tp_theme_btn_link_type',
			[
				'label' => esc_html__('Button Link Type', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SELECT,
				'options' => [
					'1' => 'Custom Link',
					'2' => 'Internal Page',
				],
				'default' => '1',
				'label_block' => true,
				'condition' => [
					'tp_theme_btn_button_show' => 'yes'
				],
			]
		);
		$this->add_control(
			'tp_theme_btn_link',
			[
				'label' => esc_html__('Button link', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::URL,
				'dynamic' => [
					'active' => true,
				],
				'placeholder' => esc_html__('https://your-link.com', 'unlock-addons-for-elementor'),
				'show_external' => false,
				'default' => [
					'url' => '#',
					'is_external' => false,
					'nofollow' => false,
				],
				'condition' => [
					'tp_theme_btn_link_type' => '1',
					'tp_theme_btn_button_show' => 'yes'
				],
				'label_block' => true,
			]
		);
		$this->add_control(
			'tp_theme_btn_page_link',
			[
				'label' => esc_html__('Select Button Link Page', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SELECT2,
				'label_block' => true,
				'options' => $this->tp_get_all_types_post('page'),
				'condition' => [
					'tp_theme_btn_link_type' => '2',
					'tp_theme_btn_button_show' => 'yes'
				]
			]
		);

		$this->add_responsive_control(
			'tp_button_align',
			[
				'label' => esc_html__('Alignment', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::CHOOSE,
				'options' => [
					'start' => [
						'title' => esc_html__('Left', 'unlock-addons-for-elementor'),
						'icon' => 'eicon-text-align-left',
					],
					'center' => [
						'title' => esc_html__('Center', 'unlock-addons-for-elementor'),
						'icon' => 'eicon-text-align-center',
					],
					'end' => [
						'title' => esc_html__('Right', 'unlock-addons-for-elementor'),
						'icon' => 'eicon-text-align-right',
					],
				],
				'default' => 'center',
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn' => 'justify-content: {{VALUE}};',
				],
				'frontend_available' => true,
				'toggle' => true,
			]
		);
		$this->end_controls_section();
	}

	// style_tab_content
	protected function style_tab_content()
	{

		$this->start_controls_section(
			'tp_theme_btn_style_sec',
			[
				'label' => esc_html__('Button Style', 'unlock-addons-for-elementor'),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name' => 'tp_theme_btn_typography',
				'label' => esc_html__('Typhography', 'unlock-addons-for-elementor'),
				'selector' => '{{WRAPPER}} .wpr-el-theme-btn, {{WRAPPER}} .wpr-el-theme-circle-btn .rotate, .orvio-btn13 .btn-content .btn-circle, .orvio-btn13 .btn-content .btn-text',
			]
		);

		$this->add_control(
			'tp_theme_btn_icon_image_size',
			[
				'label' => esc_html__('Icon Image Size', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SLIDER,
				'size_units' => ['px', 'em'],
				'range' => [
					'px' => [
						'min' => 0,
						'max' => 100000,
						'step' => 10,
					],
					'em' => [
						'min' => 0,
						'max' => 100,
						'step' => 0.1,
					],
				],
				'default' => [
					'unit' => 'px',
					'size' => '',
				],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn .theme-btn-icon img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'tp_theme_btn_icon_show' => 'yes',
					'tp_theme_btn_icon_type' => 'image'
				],
			]
		);

		$this->add_control(
			'tp_theme_btn_icon_size',
			[
				'label' => esc_html__('Icon Size', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SLIDER,
				'size_units' => ['px', 'em'],
				'range' => [
					'px' => [
						'min' => 0,
						'max' => 1000,
						'step' => 1,
					],
					'em' => [
						'min' => 0,
						'max' => 100,
						'step' => 0.1,
					],
				],
				'default' => [
					'unit' => 'px',
					'size' => '',
				],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn .theme-btn-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'tp_theme_btn_icon_show' => 'yes',
					'tp_theme_btn_icon_type' => 'icon'
				],
			]
		);

		$this->add_control(
			'tp_theme_btn_icon_svg_size',
			[
				'label' => esc_html__('Icon SVG Size', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::SLIDER,
				'size_units' => ['px', 'em'],
				'range' => [
					'px' => [
						'min' => 0,
						'max' => 1000,
						'step' => 1,
					],
					'em' => [
						'min' => 0,
						'max' => 100,
						'step' => 0.1,
					],
				],
				'default' => [
					'unit' => 'px',
					'size' => '',
				],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn .theme-btn-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
				],
				'condition' => [
					'tp_theme_btn_icon_show' => 'yes',
					'tp_theme_btn_icon_type' => 'svg'
				],
			]
		);

		$this->start_controls_tabs(
			'tp_theme_btn_state_tabs',
		);

		// button normal state
		$this->start_controls_tab(
			'tp_theme_btn_normal_tab',
			[
				'label' => esc_html__('Normal', 'unlock-addons-for-elementor'),
			]
		);

		$this->add_control(
			'tp_theme_btn_color',
			[
				'label' => esc_html__('Text Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn, .wpr-el-theme-circle-btn .rotate, .orvio-btn13 .btn-content .btn-circle, .orvio-btn13 .btn-content .btn-text' => 'color: {{VALUE}};',
				],
			]
		);
		$this->add_control(
			'tp_theme_btn_icon_color',
			[
				'label' => esc_html__('Icon Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn .theme-btn-icon' => 'color: {{VALUE}};',
				],
				'condition' => [
					'tp_theme_btn_icon_show' => 'yes',
					'tp_theme_btn_icon_type' => 'icon'
				],
			]
		);

		$this->add_control(
			'tp_theme_btn_bg_color',
			[
				'label' => esc_html__('Background Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn, .orvio-btn13 .btn-content .btn-circle, .orvio-btn13 .btn-content .btn-text' => 'background-color: {{VALUE}};',
				],
			]
		);

		$this->add_control(
			'tp_theme_icon_bg_color',
			[
				'label' => esc_html__('Icon BG Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn .icon, .orvio-btn13 .btn-content .btn-circle' => 'background-color: {{VALUE}};',
				],
				'condition' => ['wpr_design_style' => ['layout-1', 'layout-11']],
			]
		);

		$this->add_control(
			'tp_theme_icon_color',
			[
				'label' => esc_html__('Icon Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn .icon, .orvio-btn13 .btn-content .btn-circle' => 'color: {{VALUE}};',
				],
				'condition' => ['wpr_design_style' => ['layout-1', 'layout-11']],
			]
		);

		$this->add_control(
			'tp_theme_btn_line_color',
			[
				'label' => esc_html__('Button Line Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-line-btn:before' => 'background: {{VALUE}};',
				],
				'condition' => [
					'tp_theme_btn_line_effect' => 'yes'
				],
			]
		);

		$this->add_group_control(
			Group_Control_Border::get_type(),
			[
				'name' => 'tp_theme_btn_border',
				'selector' => '{{WRAPPER}} .wpr-el-theme-btn, .orvio-btn13 .btn-content .btn-circle, .orvio-btn13 .btn-content .btn-text',
			]
		);

		$this->add_control(
			'tp_theme_btn_border_radius',
			[
				'label' => esc_html__('Border Radius', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => ['px', '%'],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn, .orvio-btn13 .btn-content .btn-circle, .orvio-btn13 .btn-content .btn-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			[
				'name' => 'tp_theme_btn_box_shadow',
				'selector' => '{{WRAPPER}} .wpr-el-theme-btn',
			]
		);

		$this->end_controls_tab();
		// end normal state

		// button hover state
		$this->start_controls_tab(
			'tp_theme_btn_hover_tab',
			[
				'label' => esc_html__('Hover', 'unlock-addons-for-elementor'),
			]
		);

		$this->add_control(
			'tp_theme_btn_hover_color',
			[
				'label' => esc_html__('Text Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn:hover' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_control(
			'tp_theme_btn_hover_icon_color',
			[
				'label' => esc_html__('Icon Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn:hover .theme-btn-icon' => 'color: {{VALUE}};',
				],
				'condition' => [
					'tp_theme_btn_icon_show' => 'yes',
					'tp_theme_btn_icon_type' => 'icon'
				],
			]
		);

		$this->add_control(
			'tp_theme_btn_hover_bg_color',
			[
				'label' => esc_html__('Background Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn:hover' => 'background-color: {{VALUE}};',
				],
			]
		);

		$this->add_control(
			'tp_theme_icon_hover_bg_color',
			[
				'label' => esc_html__('Icon BG Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn:hover .icon' => 'background-color: {{VALUE}};',
				],
				'condition' => ['wpr_design_style' => ['layout-1']],
			]
		);

		$this->add_control(
			'tp_theme_icon_hover_color',
			[
				'label' => esc_html__('Icon Color', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn:hover .icon' => 'color: {{VALUE}};',
				],
				'condition' => ['wpr_design_style' => ['layout-1']],
			]
		);

		$this->add_group_control(
			Group_Control_Border::get_type(),
			[
				'name' => 'tp_theme_btn_hover_border',
				'selector' => '{{WRAPPER}} .wpr-el-theme-btn:hover',
			]
		);

		$this->add_control(
			'tp_theme_btn_hover_border_radius',
			[
				'label' => esc_html__('Border Radius', 'unlock-addons-for-elementor'),
				'type' => Controls_Manager::DIMENSIONS,
				'size_units' => ['px', '%'],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			[
				'name' => 'tp_theme_btn_hover_box_shadow',
				'selector' => '{{WRAPPER}} .wpr-el-theme-btn:hover',
			]
		);

		$this->end_controls_tab();
		// end hover state


		$this->end_controls_tabs();
		// end button state tabs

		$this->add_control(
			'tp_theme_btn_margin',
			[
				'label' => esc_html__('Button Margin', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => ['px', '%', 'em'],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);

		$this->add_control(
			'tp_theme_btn_padding',
			[
				'label' => esc_html__('Button Padding', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => ['px', '%', 'em'],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);
		$this->add_control(
			'tp_theme_btn_icon_margin',
			[
				'label' => esc_html__('Icon Margin', 'unlock-addons-for-elementor'),
				'type' => \Elementor\Controls_Manager::DIMENSIONS,
				'size_units' => ['px', '%', 'em'],
				'selectors' => [
					'{{WRAPPER}} .wpr-el-theme-btn .theme-btn-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
			]
		);

		$this->end_controls_section();


		// animation
		$this->tp_creative_animation();
	}

	/**
	 * Render the widget output on the frontend.
	 *
	 * Written in PHP and used to generate the final HTML.
	 *
	 * @since 1.0.0
	 *
	 * @access protected
	 */
	protected function render()
	{
		$settings = $this->get_settings_for_display();
		$btn_id = 'theme_btn';

?>

		<?php if ($settings['wpr_design_style'] == 'layout-2'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn orvio-btn5 v2 dynamic-width ' . $tp_button_type, $this->get_settings());
			$animation = $this->tp_animation_show($settings);
		?>

			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
				<div class="btn-style2">
					<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?>>
						<span>
							<?php if (!empty($settings['tp_' . $btn_id . '_text'])): ?>
								<span class="text">
									<?php echo $settings['tp_' . $btn_id . '_text']; ?>
								</span>
							<?php endif; ?>

							<span class="icon">
								<svg
									xmlns="http://www.w3.org/2000/svg"
									width="19"
									height="19"
									viewBox="0 0 19 19"
									fill="none">
									<path
										d="M17 2.77581V13.1199C17 13.5482 16.6524 13.8958 16.2241 13.8958C15.7958 13.8958 15.4483 13.5482 15.4483 13.1199V4.64917L3.32396 16.7725C3.17292 16.9235 2.97427 17 2.77565 17C2.57702 17 2.37837 16.9245 2.22733 16.7725C1.92422 16.4694 1.92422 15.978 2.22733 15.6749L14.3516 3.55162H5.87914C5.45086 3.55162 5.10327 3.20406 5.10327 2.77581C5.10327 2.34756 5.45086 2 5.87914 2H16.2241C16.3255 2 16.426 2.0208 16.5211 2.06011C16.7105 2.13872 16.8615 2.28975 16.9412 2.48008C16.9794 2.57421 17 2.67444 17 2.77581Z"
										fill="currentColor" />
								</svg>
							</span>
						</span>
						<span>
							<?php if (!empty($settings['tp_' . $btn_id . '_text'])): ?>
								<span class="text">
									<?php echo $settings['tp_' . $btn_id . '_text']; ?>
								</span>
							<?php endif; ?>
							<span class="icon">
								<svg
									xmlns="http://www.w3.org/2000/svg"
									width="19"
									height="19"
									viewBox="0 0 19 19"
									fill="none">
									<path
										d="M17 2.77581V13.1199C17 13.5482 16.6524 13.8958 16.2241 13.8958C15.7958 13.8958 15.4483 13.5482 15.4483 13.1199V4.64917L3.32396 16.7725C3.17292 16.9235 2.97427 17 2.77565 17C2.57702 17 2.37837 16.9245 2.22733 16.7725C1.92422 16.4694 1.92422 15.978 2.22733 15.6749L14.3516 3.55162H5.87914C5.45086 3.55162 5.10327 3.20406 5.10327 2.77581C5.10327 2.34756 5.45086 2 5.87914 2H16.2241C16.3255 2 16.426 2.0208 16.5211 2.06011C16.7105 2.13872 16.8615 2.28975 16.9412 2.48008C16.9794 2.57421 17 2.67444 17 2.77581Z"
										fill="currentColor" />
								</svg>
							</span>
						</span>
					</a>
				</div>
			<?php endif; ?>

		<?php elseif ($settings['wpr_design_style'] == 'layout-3'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn orvio-btn5 ' . $tp_button_type, $this->get_settings());
			$animation = $this->tp_animation_show($settings);
		?>

			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
				<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?> class="orvio-btn5">
					<?php if (!empty($settings['tp_' . $btn_id . '_text'])): ?>
						<span class="text">
							<?php echo $settings['tp_' . $btn_id . '_text']; ?>
						</span>
					<?php endif; ?>

					<span class="icon">
						<svg
							xmlns="http://www.w3.org/2000/svg"
							width="22"
							height="17"
							viewBox="0 0 22 17"
							fill="none">
							<path
								d="M0 8.50002H21C18.9737 7.78574 15.0316 5.28573 15.4737 1"
								stroke="currentColor"
								stroke-width="1.5" />
							<path
								d="M4.42105 8.49998H21C18.9737 9.21426 15.0316 11.7143 15.4737 16"
								stroke="currentColor"
								stroke-width="1.5" />
						</svg>
					</span>
				</a>
			<?php endif; ?>

		<?php elseif ($settings['wpr_design_style'] == 'layout-4'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn download-cv ' . $tp_button_type, $this->get_settings());
			$animation = $this->tp_animation_show($settings);
		?>

			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
				<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?> download>
					<?php if (!empty($settings['tp_' . $btn_id . '_text'])): ?>
						<?php echo $settings['tp_' . $btn_id . '_text']; ?>
					<?php endif; ?>
					<i class="fa-thin fa-arrow-down-to-line"></i>
				</a>
			<?php endif; ?>

		<?php elseif ($settings['wpr_design_style'] == 'layout-5'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn orvio-btn v4 ' . $tp_button_type, $this->get_settings());

		?>

			<div class="nuvo__button-wrapper">
				<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?>>

					<?php if (($settings['tp_theme_btn_icon_position'] == 'left') && ($settings['tp_theme_btn_icon_show'] == 'yes')): ?>
						<span class="icon">
							<?php $this->tp_render_signle_icon_html($settings, 'theme_btn', 'theme-btn-icon on-left'); ?>
						</span>
					<?php endif; ?>

					<?php if (!empty($settings['tp_' . $btn_id . '_text'])): ?>
						<span class="text">
							<?php echo $settings['tp_' . $btn_id . '_text']; ?>
						</span>
					<?php endif; ?>

					<?php if (($settings['tp_theme_btn_icon_position'] == 'right') && ($settings['tp_theme_btn_icon_show'] == 'yes')): ?>
						<span class="icon">
							<?php $this->tp_render_signle_icon_html($settings, 'theme_btn', 'theme-btn-icon on-right'); ?>
						</span>
					<?php endif; ?>

				</a>
			</div>

		<?php elseif ($settings['wpr_design_style'] == 'layout-6'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn dynamic-width ' . $tp_button_type, $this->get_settings());
		?>

			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
				<div class="hero-three__center">
					<div class="left-content">
						<div class="fade-anim" data-delay="0.6" data-direction="right" data-offset="100">
							<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?>>
								<?php if (!empty($settings['tp_' . $btn_id . '_text'])): ?>
									<span>
										<em><?php echo $settings['tp_' . $btn_id . '_text']; ?></em>
										<i class="fa-light fa-arrow-right"></i>
									</span>

									<span>
										<em><?php echo $settings['tp_' . $btn_id . '_text']; ?></em>
										<i class="fa-light fa-arrow-right"></i>
									</span>
								<?php endif; ?>
							</a>
						</div>
					</div>
				</div>
			<?php endif; ?>


		<?php elseif ($settings['wpr_design_style'] == 'layout-7'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn orvio-btn10 ' . $tp_button_type, $this->get_settings());
		?>

			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
			<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?>>
				<?php echo $settings['tp_' . $btn_id . '_text']; ?>
			</a>
			<?php endif; ?>

		<?php elseif ($settings['wpr_design_style'] == 'layout-8'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn orvio-btn12 ' . $tp_button_type, $this->get_settings());
		?>
			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
			<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?>>
				<?php echo $settings['tp_' . $btn_id . '_text']; ?>
			</a>
			<?php endif; ?>


		<?php elseif ($settings['wpr_design_style'] == 'layout-9'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'orvio-btn13 ' . $tp_button_type, $this->get_settings());
		?>


			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
            <a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?>>
                <span class="filter-icon">
                    <svg width="0" height="0">
                      <defs>
                        <filter id="buttonFilter">
                          <feGaussianBlur
                            in="SourceGraphic"
                            stdDeviation="5"
                            result="blur">
                           </feGaussianBlur>
                          <feColorMatrix
                            in="blur"
                            values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 19 -9"
                          ></feColorMatrix>
                          <feComposite
                            in="SourceGraphic"
                            in2="buttonFilter5"
                            operator="atop"
                          ></feComposite>
                          <feBlend
                            in="SourceGraphic"
                            in2="buttonFilter5"
                          ></feBlend>
                        </filter>
                      </defs>
                    </svg>
                  </span>
                  <span class="btn-content" style="filter: url(#buttonFilter)">
                    <span class="btn-text">
                    	<?php echo $settings['tp_' . $btn_id . '_text']; ?>
                    </span>
                    <span class="btn-circle">
                      <svg
                        xmlns="http://www.w3.org/2000/svg"
                        width="17"
                        height="13"
                        viewBox="0 0 17 13"
                        fill="none">
                        <path
                          d="M1.5 5.75C1.08579 5.75 0.75 6.08579 0.75 6.5C0.75 6.91421 1.08579 7.25 1.5 7.25V6.5V5.75ZM16.0303 7.03033C16.3232 6.73744 16.3232 6.26256 16.0303 5.96967L11.2574 1.1967C10.9645 0.903806 10.4896 0.903806 10.1967 1.1967C9.90381 1.48959 9.90381 1.96447 10.1967 2.25736L14.4393 6.5L10.1967 10.7426C9.90381 11.0355 9.90381 11.5104 10.1967 11.8033C10.4896 12.0962 10.9645 12.0962 11.2574 11.8033L16.0303 7.03033ZM1.5 6.5V7.25H15.5V6.5V5.75H1.5V6.5Z"
                          fill="currentColor"
                        ></path>
                      </svg>
                    </span>
                </span>
            </a>
            <?php endif; ?>

		<?php elseif ($settings['wpr_design_style'] == 'layout-10'):
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn t-btn t-btn-primary ' . $tp_button_type, $this->get_settings());
		?>

			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
			<div class="btn-wrapper fade-anim" data-delay="0.75">
				<div class="t-btn-group">
					<a class="t-btn t-btn-circle wpr-el-theme-btn" <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id); ?>>
						<?php $this->tp_render_signle_icon_html($settings, 'theme_btn'); ?>
					</a>

					<?php if (!empty($settings['tp_' . $btn_id . '_text'])): ?>
						<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id); ?>>
							<?php echo esc_html($settings['tp_' . $btn_id . '_text']); ?>
						</a>
					<?php endif; ?>

					<a class="t-btn t-btn-circle wpr-el-theme-btn" <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id); ?>>
						<?php $this->tp_render_signle_icon_html($settings, 'theme_btn'); ?>
					</a>
				</div>
			</div>
			<?php endif; ?>

		<?php else:
			$tp_button_type = $settings['tp_button_type'];
			$this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn orvio-btn v3 ' . $tp_button_type, $this->get_settings());
			$animation = $this->tp_animation_show($settings);
		?>

			<?php if (!empty($settings['tp_' . $btn_id . '_text']) || ($settings['tp_theme_btn_icon_show'] == 'yes') && $settings['tp_' . $btn_id . '_button_show'] == 'yes'): ?>
				<a <?php echo $this->get_render_attribute_string('tp-button-arg' . $btn_id . ''); ?> class="orvio-btn v3">
					<?php if (($settings['tp_theme_btn_icon_position'] == 'left') && ($settings['tp_theme_btn_icon_show'] == 'yes')): ?>
						<span class="icon">
							<?php $this->tp_render_signle_icon_html($settings, 'theme_btn', 'theme-btn-icon on-left'); ?>
						</span>
					<?php endif; ?>

					<?php if (!empty($settings['tp_' . $btn_id . '_text'])): ?>
						<span class="text">
							<?php echo $settings['tp_' . $btn_id . '_text']; ?>
						</span>
					<?php endif; ?>

					<?php if (($settings['tp_theme_btn_icon_position'] == 'right') && ($settings['tp_theme_btn_icon_show'] == 'yes')): ?>
						<span class="icon">
							<?php $this->tp_render_signle_icon_html($settings, 'theme_btn', 'theme-btn-icon on-right'); ?>
						</span>
					<?php endif; ?>
				</a>
			<?php endif; ?>

		<?php endif; ?>

<?php
	}
}
