<?php

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

class Rdg_Blocks_Odd_Betting_Select extends Rdg_Blocks_Base
{
    protected $block_name = BLOCK_RDG_ODD_BETTING_SELECT;
    private $block_folder_name = 'rdg-odd-betting-select';
    protected $block_title = 'RDG Odd Betting Select';
    private $block_description = '';
    private $block_icon = 'admin-links';
    private $block_keywords = ['rdg', 'custom', 'odd', 'betting', 'select'];
    private $block_mode = 'preview';
    private $block_category = RDGBLOCKS_NAME_SLUG;
    protected $is_caching = false;
    protected $is_config = false;
    protected $is_styles_load = true;

    public function init() {
        $this->register_block();
    }

    private function register_block() {
        if (function_exists('acf_register_block_type')) {
            $rdg_helpers = new Rdg_Blocks_Helpers();
            acf_register_block_type([
                'name' => $this->block_name,
                'title' => __($this->block_title),
                'description' => __($this->block_description),
                'category' => $this->block_category,
                'icon' => $this->block_icon,
                'keywords' => $this->block_keywords,
                'mode' => $this->block_mode,
                'render_template' => RDGBLOCKS_PLUGIN_DIR . "/blocks/".$this->block_folder_name."/template.php",
                'enqueue_style' => $rdg_helpers->webpack('rdg_odd_betting_select.css'),
                'supports' => [
                    'jsx' => true,
			        'color' => [
                        'background' => true,
                        'gradients'  => false,
                        'text' => false,
                    ],
                ],
            ]);
        }
    }

    public function getColorsToloadGeneratePress() {
        return [
            ['name' => 'color-odd-betting-select','slug' => 'color-odd-betting-select','color' => '#ffffff'],
            ['name' => 'color-odd-betting-select-bg','slug' => 'color-odd-betting-select-bg','color' => '#0160ac'],
            ['name' => 'color-odd-betting-select-primary','slug' => 'color-odd-betting-select-primary','color' => '#3a96e0'],
        ];
    }

    public function getStylesToloadGeneratePress() {
        return [
            [
                'customSelector' => '.rdg-odd-betting-select .select select',
                'fontWeight' => '700',
            ],
            [
                'customSelector' => '.rdg-odd-betting-select .select select option',
                'fontWeight' => '700',
            ],
        ];
    }
}

$rdg_odd_betting_select_class = new Rdg_Blocks_Odd_Betting_Select();
$rdg_odd_betting_select_class->init();

return $rdg_odd_betting_select_class;
