<?php
/**
 * Business Interface Options Class.
 *
 * @package     Business Interface
 * @author   WPInterface Team
 * @since    1.0.0
 */

/**
 * Do not allow direct script access.
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! class_exists( 'Business_Interface_Options' ) ) :

	/**
	 * Business Interface Options Class.
	 */
	class Business_Interface_Options {

		/**
		 * Singleton instance of the class.
		 *
		 * @since 1.0.0
		 * @var object
		 */
		private static $instance;

		/**
		 * Options variable.
		 *
		 * @since 1.0.0
		 * @var mixed $options
		 */
		private static $options;

		/**
		 * Main Business_Interface_Options Instance.
		 *
		 * @since 1.0.0
		 * @return Business_Interface_Options
		 */
		public static function instance() {

			if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Business_Interface_Options ) ) {
				self::$instance = new self();
			}
			return self::$instance;
		}

		/**
		 * Primary class constructor.
		 *
		 * @since 1.0.0
		 */
		public function __construct() {

			// Refresh options.
			add_action( 'after_setup_theme', array( $this, 'refresh' ) );
		}

		/**
		 * Set default option values.
		 *
		 * @since  1.0.0
		 * @return array Default values.
		 */
		public function get_defaults() {

			$defaults = array(

				/**
				 * General Settings.
				 */

				// Layout.
				'business_interface_site_layout'                      => 'fw-contained',
				'business_interface_container_width'                  => 1200,

				// Base Colors.
				'business_interface_accent_color'                     => '#3857F1',
				'business_interface_content_text_color'               => '#30373e',
				'business_interface_headings_color'                   => '#131313',
				'business_interface_content_link_hover_color'         => '#131313',
				'business_interface_body_background_heading'          => true,
				'business_interface_content_background_heading'       => true,
				'business_interface_boxed_content_background_color'   => '#FFFFFF',
				'business_interface_scroll_top_visibility'            => 'all',

				// Base Typography.
				'business_interface_html_base_font_size'              => array(
					'desktop' => 16,
				),
				'business_interface_font_smoothing'                   => true,
				'business_interface_typography_body_heading'          => false,
				'business_interface_typography_headings_heading'      => false,
				'business_interface_body_font'                        => business_interface_typography_defaults(
					array(
						'font-family'         => 'default',
						'font-weight'         => 400,
						'font-size-desktop'   => '0.9375',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.733',
					)
				),
				'business_interface_headings_font'                    => business_interface_typography_defaults(
					array(
						'font-weight'     => 500,
						'font-style'      => 'normal',
						'text-transform'  => 'none',
						'text-decoration' => 'none',
					)
				),
				'business_interface_h1_font'                          => business_interface_typography_defaults(
					array(
						'font-weight'         => 600,
						'font-size-desktop'   => '2.375',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.1',
					)
				),
				'business_interface_h2_font'                          => business_interface_typography_defaults(
					array(
						'font-weight'         => 'inherit',
						'font-size-desktop'   => '1.875',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.25',
					)
				),
				'business_interface_h3_font'                          => business_interface_typography_defaults(
					array(
						'font-weight'         => 'inherit',
						'font-size-desktop'   => '1.625',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.25',
					)
				),
				'business_interface_h4_font'                          => business_interface_typography_defaults(
					array(
						'font-weight'         => 'inherit',
						'font-size-desktop'   => '1.25',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.5',
					)
				),
				'business_interface_h5_font'                          => business_interface_typography_defaults(
					array(
						'font-weight'         => 'inherit',
						'font-size-desktop'   => '1',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.5',
					)
				),
				'business_interface_h6_font'                          => business_interface_typography_defaults(
					array(
						'font-weight'         => 'inherit',
						'font-size-desktop'   => '0.6875',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.72',
						'text-transform'      => 'uppercase',
						'letter-spacing'      => '2',
					)
				),
				'business_interface_heading_em_font'                  => business_interface_typography_defaults(
					array(
						'font-weight' => 'inherit',
						'font-style'  => 'italic',
					)
				),
				'business_interface_footer_widget_title_font_size'    => array(
					'desktop' => 1.125,
					'unit'    => 'em',
				),

				// Primary Button.
				'business_interface_primary_button_heading'           => false,
				'business_interface_primary_button_bg_color'          => '',
				'business_interface_primary_button_hover_bg_color'    => '',
				'business_interface_primary_button_text_color'        => '#FFFFFF',
				'business_interface_primary_button_hover_text_color'  => '#FFFFFF',
				'business_interface_primary_button_border_radius'     => array(
					'top-left'     => 2,
					'top-right'    => 2,
					'bottom-right' => 2,
					'bottom-left'  => 2,
					'unit'         => 'px',
				),
				'business_interface_primary_button_border_width'      => 1,
				'business_interface_primary_button_border_color'      => 'rgba(0, 0, 0, 0.12)',
				'business_interface_primary_button_hover_border_color' => 'rgba(0, 0, 0, 0.12)',
				'business_interface_primary_button_typography'        => business_interface_typography_defaults(
					array(
						'font-family'         => 'inherit',
						'font-weight'         => 500,
						'font-size-desktop'   => '0.9375',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.4',
					)
				),

				// Secondary Button.
				'business_interface_secondary_button_heading'         => false,
				'business_interface_secondary_button_bg_color'        => '#131313',
				'business_interface_secondary_button_hover_bg_color'  => '#3e4750',
				'business_interface_secondary_button_text_color'      => '#FFFFFF',
				'business_interface_secondary_button_hover_text_color' => '#FFFFFF',
				'business_interface_secondary_button_border_radius'   => array(
					'top-left'     => 2,
					'top-right'    => 2,
					'bottom-right' => 2,
					'bottom-left'  => 2,
					'unit'         => 'px',
				),
				'business_interface_secondary_button_border_width'    => 1,
				'business_interface_secondary_button_border_color'    => 'rgba(0, 0, 0, 0.12)',
				'business_interface_secondary_button_hover_border_color' => 'rgba(0, 0, 0, 0.12)',
				'business_interface_secondary_button_typography'      => business_interface_typography_defaults(
					array(
						'font-family'         => 'inherit',
						'font-weight'         => 500,
						'font-size-desktop'   => '0.9375',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.4',
					)
				),

				// Text button.
				'business_interface_text_button_heading'              => false,
				'business_interface_text_button_text_color'           => '#131313',
				'business_interface_text_button_hover_text_color'     => '',
				'business_interface_text_button_typography'           => business_interface_typography_defaults(
					array(
						'font-family'         => 'inherit',
						'font-weight'         => 500,
						'font-size-desktop'   => '0.9375',
						'font-size-unit'      => 'rem',
						'line-height-desktop' => '1.4',
					)
				),

				// Misc Settings.
				'business_interface_enable_schema'                    => true,
				'business_interface_custom_input_style'               => true,
				'business_interface_preloader_heading'                => false,
				'business_interface_preloader'                        => false,
				'business_interface_preloader_style'                  => '1',
				'business_interface_preloader_visibility'             => 'all',
				'business_interface_scroll_top_heading'               => false,
				'business_interface_enable_scroll_top'                => true,

				/**
				 * Logos & Site Title.
				 */
				'business_interface_logo_default_retina'              => '',
				'business_interface_logo_max_height'                  => array(
					'desktop' => 30,
				),
				'business_interface_logo_margin'                      => array(
					'desktop' => array(
						'top'    => 25,
						'right'  => 0,
						'bottom' => 25,
						'left'   => 0,
					),
					'tablet'  => array(
						'top'    => '',
						'right'  => '',
						'bottom' => '',
						'left'   => '',
					),
					'mobile'  => array(
						'top'    => '',
						'right'  => '',
						'bottom' => '',
						'left'   => '',
					),
					'unit'    => 'px',
				),
				'business_interface_display_tagline'                  => false,
				'business_interface_logo_heading_site_identity'       => true,
				'business_interface_typography_logo_heading'          => false,
				'business_interface_logo_text_font_size'              => array(
					'desktop' => 1.875,
					'unit'    => 'rem',
				),

				/**
				 * Header.
				 */

				// Top Bar.
				'business_interface_top_bar_enable'                   => false,
				'business_interface_top_bar_container_width'          => 'content-width',
				'business_interface_top_bar_visibility'               => 'hide-mobile-tablet',
				'business_interface_top_bar_heading_widgets'          => true,
				'business_interface_top_bar_widgets'                  => array(
					array(
						'classname' => 'business_interface_customizer_widget_text',
						'type'      => 'text',
						'values'    => array(
							'content'    => esc_html__( 'This is a placeholder text widget in Top Bar section.', 'business-interface' ),
							'location'   => 'left',
							'visibility' => 'all',
						),
					),
				),
				'business_interface_top_bar_widgets_separator'        => 'regular',
				'business_interface_top_bar_heading_design_options'   => false,
				'business_interface_top_bar_background'               => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color'    => array(
								'background-color' => '#FFFFFF',
							),
							'gradient' => array(),
						),
					)
				),
				'business_interface_top_bar_text_color'               => business_interface_design_options_defaults(
					array(
						'color' => array(),
					)
				),
				'business_interface_top_bar_border'                   => business_interface_design_options_defaults(
					array(
						'border' => array(
							'border-bottom-width' => '1',
							'border-style'        => 'solid',
							'border-color'        => 'rgba(0,0,0, .085)',
							'separator-color'     => '#cccccc',
						),
					)
				),

				// Main Header.
				'business_interface_header_layout'                    => 'layout-1',
				'business_interface_header_container_width'           => 'content-width',
				'business_interface_header_heading_widgets'           => true,
				'business_interface_header_widgets'                   => array(
					array(
						'classname' => 'business_interface_customizer_widget_search',
						'type'      => 'search',
						'values'    => array(
							'location'   => 'left',
							'visibility' => 'hide-mobile-tablet',
						),
					),
				),
				'business_interface_header_widgets_separator'         => 'none',
				'business_interface_header_heading_design_options'    => false,
				'business_interface_header_background'                => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color'    => array(
								'background-color' => '#FFFFFF',
							),
							'gradient' => array(),
							'image'    => array(),
						),
					)
				),
				'business_interface_header_border'                    => business_interface_design_options_defaults(
					array(
						'border' => array(
							'border-bottom-width' => 1,
							'border-color'        => 'rgba(0,0,0, .085)',
							'separator-color'     => '#cccccc',
						),
					)
				),
				'business_interface_header_text_color'                => business_interface_design_options_defaults(
					array(
						'color' => array(
							'text-color' => '#66717f',
							'link-color' => '#131313',
						),
					)
				),

				// Transparent Header.
				'business_interface_tsp_header'                       => false,
				'business_interface_tsp_header_disable_on'            => array(
					'404',
					'posts_page',
					'archive',
					'search',
				),
				'business_interface_tsp_logo_heading'                 => false,
				'business_interface_tsp_logo'                         => '',
				'business_interface_tsp_logo_retina'                  => '',
				'business_interface_tsp_logo_max_height'              => array(
					'desktop' => 30,
				),
				'business_interface_tsp_logo_margin'                  => array(
					'desktop' => array(
						'top'    => '',
						'right'  => '',
						'bottom' => '',
						'left'   => '',
					),
					'tablet'  => array(
						'top'    => '',
						'right'  => '',
						'bottom' => '',
						'left'   => '',
					),
					'mobile'  => array(
						'top'    => '',
						'right'  => '',
						'bottom' => '',
						'left'   => '',
					),
					'unit'    => 'px',
				),
				'business_interface_tsp_colors_heading'               => false,
				'business_interface_tsp_header_background'            => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color' => array(),
						),
					)
				),
				'business_interface_tsp_header_font_color'            => business_interface_design_options_defaults(
					array(
						'color' => array(),
					)
				),
				'business_interface_tsp_header_border'                => business_interface_design_options_defaults(
					array(
						'border' => array(),
					)
				),

				// Sticky Header.
				'business_interface_sticky_header'                    => false,
				'business_interface_sticky_header_hide_on'            => array( '' ),

				// Main Navigation.
				'business_interface_main_nav_heading_animation'       => false,
				'business_interface_main_nav_hover_animation'         => 'none',
				'business_interface_main_nav_heading_sub_menus'       => false,
				'business_interface_main_nav_sub_indicators'          => true,
				'business_interface_main_nav_heading_mobile_menu'     => false,
				'business_interface_main_nav_mobile_breakpoint'       => 960,
				'business_interface_main_nav_mobile_label'            => '',
				'business_interface_nav_design_options'               => false,
				'business_interface_main_nav_background'              => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color'    => array(
								'background-color' => '#FFFFFF',
							),
							'gradient' => array(),
						),
					)
				),
				'business_interface_main_nav_border'                  => business_interface_design_options_defaults(
					array(
						'border' => array(
							'border-top-width'    => 1,
							'border-bottom-width' => 1,
							'border-style'        => 'solid',
							'border-color'        => 'rgba(0,0,0, .085)',
						),
					)
				),
				'business_interface_main_nav_font_color'              => business_interface_design_options_defaults(
					array(
						'color' => array(),
					)
				),
				'business_interface_typography_main_nav_heading'      => false,
				'business_interface_main_nav_font_size'               => array(
					'value' => 0.9375,
					'unit'  => 'rem',
				),

				// Page Header.
				'business_interface_page_header_enable'               => true,
				'business_interface_page_header_alignment'            => 'left',
				'business_interface_page_header_spacing'              => array(
					'desktop' => array(
						'top'    => 30,
						'bottom' => 30,
					),
					'tablet'  => array(
						'top'    => '',
						'bottom' => '',
					),
					'mobile'  => array(
						'top'    => '',
						'bottom' => '',
					),
					'unit'    => 'px',
				),
				'business_interface_page_header_background'           => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color'    => array( 'background-color' => 'rgba(0,0,0,.025)' ),
							'gradient' => array(),
							'image'    => array(),
						),
					)
				),
				'business_interface_page_header_text_color'           => business_interface_design_options_defaults(
					array(
						'color' => array(),
					)
				),
				'business_interface_page_header_border'               => business_interface_design_options_defaults(
					array(
						'border' => array(
							'border-bottom-width' => 1,
							'border-style'        => 'solid',
							'border-color'        => 'rgba(0,0,0,.062)',
						),
					)
				),
				'business_interface_typography_page_header'           => false,
				'business_interface_page_header_font_size'            => array(
					'desktop' => 1.625,
					'unit'    => 'rem',
				),

				// Breadcrumbs.
				'business_interface_breadcrumbs_enable'               => true,
				'business_interface_breadcrumbs_hide_on'              => array( 'home' ),
				'business_interface_breadcrumbs_position'             => 'in-page-header',
				'business_interface_breadcrumbs_alignment'            => 'left',
				'business_interface_breadcrumbs_spacing'              => array(
					'desktop' => array(
						'top'    => 15,
						'bottom' => 15,
					),
					'tablet'  => array(
						'top'    => '',
						'bottom' => '',
					),
					'mobile'  => array(
						'top'    => '',
						'bottom' => '',
					),
					'unit'    => 'px',
				),
				'business_interface_breadcrumbs_heading_design'       => false,
				'business_interface_breadcrumbs_background'           => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color'    => array(),
							'gradient' => array(),
							'image'    => array(),
						),
					)
				),
				'business_interface_breadcrumbs_text_color'           => business_interface_design_options_defaults(
					array(
						'color' => array(),
					)
				),
				'business_interface_breadcrumbs_border'               => business_interface_design_options_defaults(
					array(
						'border' => array(
							'border-top-width'    => 0,
							'border-bottom-width' => 0,
							'border-color'        => '',
							'border-style'        => 'solid',
						),
					)
				),

				/**
				 * Hero.
				 */
				'business_interface_enable_hero'                      => false,
				'business_interface_hero_type'                        => 'hover-slider',
				'business_interface_hero_visibility'                  => 'all',
				'business_interface_hero_enable_on'                   => array( 'home' ),
				'business_interface_hero_hover_slider'                => false,
				'business_interface_hero_hover_slider_container'      => 'content-width',
				'business_interface_hero_hover_slider_height'         => 500,
				'business_interface_hero_hover_slider_overlay'        => '1',
				'business_interface_hero_hover_slider_elements'       => array(
					'category'  => true,
					'meta'      => true,
					'read_more' => true,
				),
				'business_interface_hero_hover_slider_posts'          => false,
				'business_interface_hero_hover_slider_post_number'    => 3,
				'business_interface_hero_hover_slider_category'       => array(),

				/**
				 * Blog.
				 */

				// Blog Page / Archive.
				'business_interface_blog_entry_elements'              => array(
					'thumbnail'      => true,
					'header'         => true,
					'meta'           => true,
					'summary'        => true,
					'summary-footer' => true,
				),
				'business_interface_blog_entry_meta_elements'         => array(
					'author'   => true,
					'date'     => true,
					'category' => true,
					'tag'      => false,
					'comments' => true,
				),
				'business_interface_entry_meta_icons'                 => false,
				'business_interface_excerpt_length'                   => 30,
				'business_interface_excerpt_more'                     => '&hellip;',
				'business_interface_blog_layout'                      => 'blog-layout-1',
				'business_interface_blog_image_position'              => 'left',
				'business_interface_blog_image_size'                  => 'large',
				'business_interface_blog_horizontal_post_categories'  => true,
				'business_interface_blog_horizontal_read_more'        => false,

				// Single Post.
				'business_interface_single_post_layout_heading'       => false,
				'business_interface_single_title_position'            => 'in-content',
				'business_interface_single_title_alignment'           => 'left',
				'business_interface_single_title_spacing'             => array(
					'desktop' => array(
						'top'    => 152,
						'bottom' => 100,
					),
					'tablet'  => array(
						'top'    => 90,
						'bottom' => 55,
					),
					'mobile'  => array(
						'top'    => '',
						'bottom' => '',
					),
					'unit'    => 'px',
				),
				'business_interface_single_content_width'             => 'narrow',
				'business_interface_single_narrow_container_width'    => 700,
				'business_interface_single_post_elements_heading'     => false,
				'business_interface_single_post_meta_elements'        => array(
					'author'   => true,
					'date'     => true,
					'comments' => true,
					'category' => false,
				),
				'business_interface_single_post_thumb'                => true,
				'business_interface_single_post_categories'           => true,
				'business_interface_single_post_tags'                 => true,
				'business_interface_single_last_updated'              => true,
				'business_interface_single_about_author'              => true,
				'business_interface_single_post_next_prev'            => true,
				'business_interface_single_post_elements'             => array(
					'thumb'          => true,
					'category'       => true,
					'tags'           => true,
					'last-updated'   => true,
					'about-author'   => true,
					'prev-next-post' => true,
				),
				'business_interface_single_toggle_comments'           => false,
				'business_interface_single_entry_meta_icons'          => false,
				'business_interface_typography_single_post_heading'   => false,
				'business_interface_single_content_font_size'         => array(
					'desktop' => '1',
					'unit'    => 'rem',
				),

				/**
				 * Sidebar.
				 */

				'business_interface_sidebar_position'                 => 'right-sidebar',
				'business_interface_single_post_sidebar_position'     => 'no-sidebar',
				'business_interface_single_page_sidebar_position'     => 'default',
				'business_interface_archive_sidebar_position'         => 'default',
				'business_interface_sidebar_options_heading'          => false,
				'business_interface_sidebar_style'                    => '1',
				'business_interface_sidebar_width'                    => 25,
				'business_interface_sidebar_sticky'                   => '',
				'business_interface_sidebar_responsive_position'      => 'after-content',
				'business_interface_typography_sidebar_heading'       => false,
				'business_interface_sidebar_widget_title_font_size'   => array(
					'desktop' => 1,
					'unit'    => 'rem',
				),

				/**
				 * Footer.
				 */

				// Pre Footer.
				'business_interface_pre_footer_cta'                   => true,
				'business_interface_enable_pre_footer_cta'            => false,
				'business_interface_pre_footer_cta_visibility'        => 'all',
				'business_interface_pre_footer_cta_hide_on'           => array(),
				'business_interface_pre_footer_cta_style'             => '1',
				'business_interface_pre_footer_cta_text'              => wp_kses_post( __( 'This is an example of <em>Pre Footer</em> section in Business Interface.', 'business-interface' ) ),
				'business_interface_pre_footer_cta_btn_text'          => wp_kses_post( __( 'Example Button', 'business-interface' ) ),
				'business_interface_pre_footer_cta_btn_url'           => '#',
				'business_interface_pre_footer_cta_btn_new_tab'       => false,
				'business_interface_pre_footer_cta_design_options'    => false,
				'business_interface_pre_footer_cta_background'        => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color'    => array(),
							'gradient' => array(),
							'image'    => array(),
						),
					)
				),
				'business_interface_pre_footer_cta_border'            => business_interface_design_options_defaults(
					array(
						'border' => array(),
					)
				),
				'business_interface_pre_footer_cta_text_color'        => business_interface_design_options_defaults(
					array(
						'color' => array(
							'text-color' => '#FFFFFF',
						),
					)
				),
				'business_interface_pre_footer_cta_typography'        => false,
				'business_interface_pre_footer_cta_font_size'         => array(
					'desktop' => 1.75,
					'unit'    => 'rem',
				),

				// Copyright.
				'business_interface_enable_copyright'                 => true,
				'business_interface_copyright_layout'                 => 'layout-1',
				'business_interface_copyright_separator'              => 'contained-separator',
				'business_interface_copyright_visibility'             => 'all',
				'business_interface_copyright_heading_widgets'        => true,
				'business_interface_copyright_widgets'                => array(
					array(
						'classname' => 'business_interface_customizer_widget_text',
						'type'      => 'text',
						'values'    => array(
							'content'    => esc_html__( 'Copyright {{the_year}} &mdash; {{site_title}}. All rights reserved. {{theme_link}}', 'business-interface' ),
							'location'   => 'start',
							'visibility' => 'all',
						),
					),
				),
				'business_interface_copyright_heading_design_options' => false,
				'business_interface_copyright_background'             => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color'    => array(),
							'gradient' => array(),
						),
					)
				),
				'business_interface_copyright_text_color'             => business_interface_design_options_defaults(
					array(
						'color' => array(
							'text-color'       => '',
							'link-color'       => '',
							'link-hover-color' => '#FFFFFF',
						),
					)
				),

				// Main Footer.
				'business_interface_enable_footer'                    => true,
				'business_interface_footer_layout'                    => 'layout-1',
				'business_interface_footer_widgets_align_center'      => false,
				'business_interface_footer_visibility'                => 'all',
				'business_interface_footer_heading_design_options'    => false,
				'business_interface_footer_background'                => business_interface_design_options_defaults(
					array(
						'background' => array(
							'color'    => array(
								'background-color' => '#131313',
							),
							'gradient' => array(),
							'image'    => array(),
						),
					)
				),
				'business_interface_footer_text_color'                => business_interface_design_options_defaults(
					array(
						'color' => array(
							'text-color'         => '#9BA1A7',
							'link-color'         => '',
							'link-hover-color'   => '#FFFFFF',
							'widget-title-color' => '#FFFFFF',
						),
					)
				),
				'business_interface_footer_border'                    => business_interface_design_options_defaults(
					array(
						'border' => array(),
					)
				),
				'business_interface_typography_main_footer_heading'   => false,
			);

			$defaults = apply_filters( 'business_interface_default_option_values', $defaults );

			return $defaults;
		}

		/**
		 * Get the options from static array()
		 *
		 * @since  1.0.0
		 * @return array    Return array of theme options.
		 */
		public function get_options() {
			return self::$options;
		}

		/**
		 * Get the options from static array()
		 *
		 * @since  1.0.0
		 * @return array    Return array of theme options.
		 */
		public function get( $id ) {
			$value = isset( self::$options[ $id ] ) ? self::$options[ $id ] : self::get_default( $id );
			$value = apply_filters( "theme_mod_{$id}", $value ); // phpcs:ignore
			return $value;
		}

		/**
		 * Set option.
		 *
		 * @since  1.0.0
		 */
		public function set( $id, $value ) {
			set_theme_mod( $id, $value );
			self::$options[ $id ] = $value;
		}

		/**
		 * Refresh options.
		 *
		 * @since  1.0.0
		 * @return void
		 */
		public function refresh() {
			self::$options = wp_parse_args(
				get_theme_mods(),
				self::get_defaults()
			);
		}

		/**
		 * Returns the default value for option.
		 *
		 * @since  1.0.0
		 * @param  string $id Option ID.
		 * @return mixed      Default option value.
		 */
		public function get_default( $id ) {
			$defaults = self::get_defaults();
			return isset( $defaults[ $id ] ) ? $defaults[ $id ] : false;
		}
	}

endif;
