<?php

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

class Safelayout_boxbutton_elementor_control extends \Elementor\Base_Data_Control {

	public function get_type(): string {
		return 'Safelayout_boxbutton_control';
	}

	public function get_default_value(): string {
		return '<div class="safelayout-ei-box-button-block"><a class="sl-ei-box-button-block-animation-slide-top" style="--sl-ei-box-button-text-color: #00f; --sl-ei-box-button-background-color: linear-gradient(#ffc559 0%, #ffc559 44%, #ff9730 100%); --sl-ei-box-button-anim-color: linear-gradient(#fcff7d 0%, #ffd27d 46%, #ffac59 100%); box-shadow:0px 1px 3px #000; text-decoration: none; cursor: pointer; user-select: none; border-radius: 3px;"><span><div>Read More</div></span></a><style type="text/css" data-no-optimize="1" data-no-minify="1">.sl-ei-box-button-block-animation-slide-top:before{background:var(--sl-ei-box-button-anim-color);border-radius:inherit;border-radius:initial;content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;transform:translateY(-101%);transition:all .2s linear;width:100%;z-index:-1}.sl-ei-box-button-block-animation-slide-top:hover:before{transform:translateY(0)}</style></div>attsafelayoutatt4attsafelayoutatt%7B%22elementStyle%22%3A%22%22%2C%22key%22%3A4%2C%22blockId%22%3A%22592f1b34-1653-4200-0eae-90e34ad34d54%22%2C%22content%22%3A%22Read%20More%22%2C%22align%22%3A%22%22%2C%22textColor%22%3A%22%2300f%22%2C%22hasBg%22%3Atrue%2C%22bgColor%22%3A%22linear-gradient(%23ffc559%200%25%2C%20%23ffc559%2044%25%2C%20%23ff9730%20100%25)%22%2C%22bold%22%3Afalse%2C%22italic%22%3Afalse%2C%22uppercase%22%3Afalse%2C%22fontSize%22%3A%2216px%22%2C%22lineHeight%22%3A%221.5%22%2C%22letterSpacing%22%3A%220px%22%2C%22width%22%3A0%2C%22hasBgShadow%22%3Atrue%2C%22bgShadow%22%3A%220px%201px%203px%20%23000%22%2C%22hasTextShadow%22%3Afalse%2C%22textShadow%22%3A%221px%201px%202px%20%23fff%22%2C%22blockMargin%22%3A%7B%7D%2C%22blockPadding%22%3A%7B%7D%2C%22border%22%3A%7B%7D%2C%22borderRadius%22%3A%7B%22top%22%3A%223px%22%2C%22right%22%3A%223px%22%2C%22bottom%22%3A%223px%22%2C%22left%22%3A%223px%22%7D%2C%22hasIcon%22%3Afalse%2C%22iconPos%22%3A%22left%22%2C%22iconGap%22%3A5%2C%22iconName%22%3A%22000_next%22%2C%22iconPaths%22%3A%5B%7B%22d%22%3A%22M6.6%206L5.4%207l4.5%205-4.5%205%201.1%201%205.5-6-5.4-6zm6%200l-1.1%201%204.5%205-4.5%205%201.1%201%205.5-6-5.5-6z%22%7D%5D%2C%22iconColor%22%3A%5B%22%2300f%22%5D%2C%22iconStrokeColor%22%3A%5B%22%23000%22%5D%2C%22iconStrokeWidth%22%3A%5B0%5D%2C%22label%22%3A%22%22%2C%22title%22%3A%22%22%2C%22linkUrl%22%3A%22%22%2C%22linkRel%22%3A%22%22%2C%22linkTarget%22%3A%22%22%2C%22effect%22%3A%22No%20Effect%22%2C%22slbbAnim%22%3A%22slide-top%22%2C%22animColor%22%3A%22linear-gradient(%23fcff7d%200%25%2C%20%23ffd27d%2046%25%2C%20%23ffac59%20100%25)%22%2C%22classes%22%3A%22%22%2C%22customSVG%22%3A%22%22%7D';
	}

	public function enqueue(): void {
		wp_register_script(
			'safelayout-boxbutton-elementor-control',
			SAFELAYOUT_ICONS_URL . 'elementor/safelayout_boxbutton.js',
			array(),
			SAFELAYOUT_ICONS_VERSION,
			array(
				'in_footer' => false,
			)
		);
		wp_enqueue_script( 'safelayout-boxbutton-elementor-control' );
	}

	public function content_template(): void {
		?>
			<div id="sl-ei-boxbutton-elementor-body"></div>
			<input type="hidden" id="sl-ei-boxbutton-elementor-value" data-setting="{{ data.name }}" />
		<?php
	}

}