<?php
namespace EcafeAddons\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
/*help start*/
$this->start_controls_section(
	'ecHelpsection',
	array(
		'label' => esc_html__( 'Help', 'essential-classy-addons-for-elementor' ),
		'tab'   => Controls_Manager::TAB_CONTENT,
	)
);
$demo_link = ! empty( $ecwidgetdemolink )
	? '<a href="' . esc_url( $ecwidgetdemolink ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( '🌐 Demo', 'essential-classy-addons-for-elementor' ) . '</a>'
	: '';

$doc_link = ! empty( $ecwidgetdoclink )
	? '<a href="' . esc_url( $ecwidgetdoclink ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( '📄 Documentation', 'essential-classy-addons-for-elementor' ) . '</a>'
	: '';

$divider = ( $demo_link && $doc_link ) ? ' | ' : '';
if ( ! defined( 'ECAFEP_VERSION' ) ) {
	$raw_html = '
		<div class="ec-description-note-panel">
			<p>' . $demo_link . $divider . $doc_link . '</p>
			<div class="ec-description-note-panel-in">
				<h3>' . esc_html__( 'Unlock Premium Features', 'essential-classy-addons-for-elementor' ) . '</h3>
				<p>' . esc_html__( 'Access powerful tools and advanced features with the Pro version.', 'essential-classy-addons-for-elementor' ) . '</p>
				<a href="https://ecaddons.com/pro/" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Upgrade to Pro', 'essential-classy-addons-for-elementor' ) . '</a>
				<a class="ec-free-vs-pro-link" href="https://ecaddons.com/free-vs-pro/" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Free VS Pro', 'essential-classy-addons-for-elementor' ) . '</a>
			</div>
		</div>
	';
	$this->add_control(
		'ecHelpHtml',
		array(
			'type'            => Controls_Manager::RAW_HTML,
			'raw'             => $raw_html,
			'content_classes' => 'ec-description-note',
		)
	);
} else {
	$raw_html = '
		<div class="ec-description-note-panel">
			<p>' . $demo_link . $divider . $doc_link . '</p>
		</div>
	';
	$this->add_control(
		'ecHelpHtmlPro',
		array(
			'type'            => Controls_Manager::RAW_HTML,
			'raw'             => $raw_html,
			'content_classes' => 'ec-description-note',
		)
	);
}

$this->end_controls_section();
/*help end*/
