<?php
/**
 * OrokuBlocks Affiliate Referral
 * 
 * @package OrokuBlocks
 * @author OrokuBlocks (https://orokublocks.com/)
 * 
 * @since 1.0.0
 * 
 */

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

if ( ! class_exists( 'OrokuBlocks_AffiliateReferral_Widget' ) ) {
  class OrokuBlocks_AffiliateReferral_Widget extends OrokuBlocks_Widget {
    /**
     * Initialize property values
     * 
     * @since 1.0.0
     * 
     * @access protected
     */
    protected function initialize() {
      $this->widget_id = 'affiliate_referral';

      $this->defaults = [
        'theme'                                 => 'light',
        'light_primary_color'                   => '#09dfb9',
        'light_background_color'                => '#ffffff',
        'light_background_alt_color'            => '#f7f7f9',
        'light_line_color'                      => '#c7cdd6',
        'light_text_color'                      => '#22212c',
        'dark_primary_color'                    => '#09dfb9',
        'dark_background_color'                 => '#2b2a3b',
        'dark_background_alt_color'             => '#21202e',
        'dark_line_color'                       => '#38374b',
        'dark_text_color'                       => '#ffffff',
        'rating_color'                          => '#0ddad5',
        'rating_underline_color'                => '#d9d9d9',
        'use_plugin_font'                       => true,
        'font_scale'                            => 1,
        'card_border_radius'                    => 24,
        'card_image_border_radius'              => 14,
        'width'                                 => 0,
        'image_url'                             => '',
        'title'                                 => 'SweetSaku Box',
        'title_link'                            => '',
        'subtitle'                              => 'Japanese Candy',
        'score_value'                           => 5,
        'score_max_value'                       => 5,
        'decimal_points'                        => 0,
        'score_text'                            => '5 based on 4.201 Google Reviews',
        'summary'                               => 'SweetSaku is a premium giftbox service that brings you the best Japanese candy to your door every month!.',
        'details'                               => [
          [
            'title' => 'Deal',
            'text'  => '25%off for 3 months'
          ],
          [
            'title' => 'Code',
            'text'  => '"SAKUREF" @ Checkout'
          ]
        ],
        'button_text'                           => 'Shop Now!',
        'button_link'                           => '#',
        'deal_text'                             => 'Get 25% OFF on all your purchases using code <strong>"GAIAJENNB"</strong>',
        'footer_left_title'                     => 'SHARE:',
        'share_facebook_enabled'                => true,
        'share_x_enabled'                       => true,
        'shortcode'                             => false
      ];

      $this->control_modules = [
        'content' => [],
        'media_content' => [ 'image_url' ],
        'score_rating_content' => [ 'score_value', 'score_text' ],
        'details_content' => [],
        'button_content' => [],
        'meta_content'  => [ 'deal_text' ],
        'share_actions' => [],
        'theme' => [],
        'theme_light' => [],
        'theme_dark' => [],
        'font' => [],
        'card' => [],
        'media_style' => [],
        'rating_style' => []
      ];

      $this->control_section_conditions = [
        'content' => [
          'controls'  => [
            'subtitle'  => [
              'version' => [ 'v1', 'v2' ]
            ]
          ]
        ],
        'score_rating_content' => [
          'condition' => [
            'version'  => [ 'v1', 'v2', 'v4' ]
          ],
          'controls'  => [
            'score_text'  => [
              'version'  =>  [ 'v2', 'v4' ]
            ]
          ]
        ],
        'details_content' => [
          'condition' => [
            'version'  => [ 'v1', 'v3', 'v4' ]
          ]
        ],
        'meta_content' => [
          'condition' => [
            'version'  => [ 'v2', 'v4' ]
          ]
        ],
        'share_actions' => [
          'controls'  => [
            'footer_left_title'  => [
              'version'  =>  [ 'v3' ]
            ]
          ]
        ]
      ];
    }
  }
}