| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * Customizer Control: typography. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * @package     Kirki | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * @subpackage  Controls | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * @copyright   Copyright (c) 2017, Aristeides Stathopoulos | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * @license     http://opensource.org/licenses/https://opensource.org/licenses/MIT | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * @since       2.0 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | // Exit if accessed directly. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | if ( ! defined( 'ABSPATH' ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | 	exit; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |  * Typography control. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | class Kirki_Control_Typography extends WP_Customize_Control { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | 	 * The control type. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  | 	 * @access public | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | 	 * @var string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | 	public $type = 'kirki-typography'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  | 	 * Used to automatically generate all CSS output. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  | 	 * @access public | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  | 	 * @var array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  | 	public $output = array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  | 	 * Data type | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  | 	 * @access public | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  | 	 * @var string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  | 	public $option_type = 'theme_mod'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  | 	 * The kirki_config we're using for this control | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  | 	 * @access public | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  | 	 * @var string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  | 	public $kirki_config = 'global'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  | 	 * Constructor. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  | 	 * Supplied `$args` override class property defaults. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  | 	 * If `$args['settings']` is not defined, use the $id as the setting ID. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  | 	 * @since 3.0.0 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  | 	 * @param WP_Customize_Manager $manager Customizer bootstrap instance. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  | 	 * @param string               $id      Control ID. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  | 	 * @param array                $args    { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  | 	 *     Optional. Arguments to override class property defaults. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  | 	 *     @type int                  $instance_number Order in which this instance was created in relation | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  | 	 *                                                 to other instances. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  | 	 *     @type WP_Customize_Manager $manager         Customizer bootstrap instance. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  | 	 *     @type string               $id              Control ID. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  | 	 *     @type array                $settings        All settings tied to the control. If undefined, `$id` will | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  | 	 *                                                 be used. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  | 	 *     @type string               $setting         The primary setting for the control (if there is one). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  | 	 *                                                 Default 'default'. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  | 	 *     @type int                  $priority        Order priority to load the control. Default 10. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  | 	 *     @type string               $section         Section the control belongs to. Default empty. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  | 	 *     @type string               $label           Label for the control. Default empty. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  | 	 *     @type string               $description     Description for the control. Default empty. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  | 	 *     @type array                $choices         List of choices for 'radio' or 'select' type controls, where | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  | 	 *                                                 values are the keys, and labels are the values. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  | 	 *                                                 Default empty array. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  | 	 *     @type array                $input_attrs     List of custom input attributes for control output, where | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  | 	 *                                                 attribute names are the keys and values are the values. Not | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  | 	 *                                                 used for 'checkbox', 'radio', 'select', 'textarea', or | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  | 	 *                                                 'dropdown-pages' control types. Default empty array. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  | 	 *     @type array                $json            Deprecated. Use WP_Customize_Control::json() instead. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  | 	 *     @type string               $type            Control type. Core controls include 'text', 'checkbox', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  | 	 *                                                 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  | 	 *                                                 input types such as 'email', 'url', 'number', 'hidden', and | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  | 	 *                                                 'date' are supported implicitly. Default 'text'. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  | 	 * } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  | 	public function __construct( $manager, $id, $args = array() ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  | 		parent::__construct( $manager, $id, $args ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  | 		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ), 999 ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  | 	 * Enqueue control related scripts/styles. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  | 	 * @access public | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 105 |  |  | 	 */ | 
            
                                                                        
                            
            
                                    
            
            
                | 106 |  |  | 	public function enqueue_scripts() { | 
            
                                                                        
                            
            
                                    
            
            
                | 107 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 108 |  |  | 		if ( class_exists( 'Kirki_Custom_Build' ) ) { | 
            
                                                                        
                            
            
                                    
            
            
                | 109 |  |  | 			Kirki_Custom_Build::register_dependency( 'jquery' ); | 
            
                                                                        
                            
            
                                    
            
            
                | 110 |  |  | 			Kirki_Custom_Build::register_dependency( 'customize-base' ); | 
            
                                                                        
                            
            
                                    
            
            
                | 111 |  |  | 			Kirki_Custom_Build::register_dependency( 'select2' ); | 
            
                                                                        
                            
            
                                    
            
            
                | 112 |  |  | 			Kirki_Custom_Build::register_dependency( 'wp-color-picker-alpha' ); | 
            
                                                                        
                            
            
                                    
            
            
                | 113 |  |  | 		} | 
            
                                                                        
                            
            
                                    
            
            
                | 114 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 115 |  |  | 		wp_enqueue_script( 'wp-color-picker-alpha', trailingslashit( Kirki::$url ) . 'assets/vendor/wp-color-picker-alpha/wp-color-picker-alpha.js', array( 'wp-color-picker' ), '1.2', true ); | 
            
                                                                        
                            
            
                                    
            
            
                | 116 |  |  | 		wp_enqueue_style( 'wp-color-picker' ); | 
            
                                                                        
                            
            
                                    
            
            
                | 117 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 118 |  |  | 		$script_to_localize = 'kirki-build'; | 
            
                                                                        
                            
            
                                    
            
            
                | 119 |  |  | 		if ( ! class_exists( 'Kirki_Custom_Build' ) || ! Kirki_Custom_Build::is_custom_build() ) { | 
            
                                                                        
                            
            
                                    
            
            
                | 120 |  |  | 			$script_to_localize = 'kirki-typography'; | 
            
                                                                        
                            
            
                                    
            
            
                | 121 |  |  | 			wp_enqueue_script( 'kirki-typography', trailingslashit( Kirki::$url ) . 'controls/typography/typography.js', array( 'jquery', 'customize-base', 'select2', 'wp-color-picker-alpha' ), false, true ); | 
            
                                                                        
                            
            
                                    
            
            
                | 122 |  |  | 			wp_enqueue_style( 'kirki-typography-css', trailingslashit( Kirki::$url ) . 'controls/typography/typography.css', null ); | 
            
                                                                        
                            
            
                                    
            
            
                | 123 |  |  | 		} | 
            
                                                                        
                            
            
                                    
            
            
                | 124 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 125 |  |  | 		wp_enqueue_script( 'select2', trailingslashit( Kirki::$url ) . 'assets/vendor/select2/js/select2.full.js', array( 'jquery' ), '4.0.3', true ); | 
            
                                                                        
                            
            
                                    
            
            
                | 126 |  |  | 		wp_enqueue_style( 'select2', trailingslashit( Kirki::$url ) . 'assets/vendor/select2/css/select2.css', array(), '4.0.3' ); | 
            
                                                                        
                            
            
                                    
            
            
                | 127 |  |  | 		wp_enqueue_style( 'kirki-select2', trailingslashit( Kirki::$url ) . 'assets/vendor/select2/kirki.css', null ); | 
            
                                                                        
                            
            
                                    
            
            
                | 128 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 129 |  |  | 		$custom_fonts_array  = ( isset( $this->choices['fonts'] ) && ( isset( $this->choices['fonts']['google'] ) || isset( $this->choices['fonts']['standard'] ) ) && ( ! empty( $this->choices['fonts']['google'] ) || ! empty( $this->choices['fonts']['standard'] ) ) ); | 
            
                                                                        
                            
            
                                    
            
            
                | 130 |  |  | 		$localize_script_var = ( $custom_fonts_array ) ? 'kirkiFonts' . $this->id : 'kirkiAllFonts'; | 
            
                                                                        
                            
            
                                    
            
            
                | 131 |  |  | 		wp_localize_script( | 
            
                                                                        
                            
            
                                    
            
            
                | 132 |  |  | 			$script_to_localize, | 
            
                                                                        
                            
            
                                    
            
            
                | 133 |  |  | 			$localize_script_var, | 
            
                                                                        
                            
            
                                    
            
            
                | 134 |  |  | 			array( | 
            
                                                                        
                            
            
                                    
            
            
                | 135 |  |  | 				'standard' => $this->get_standard_fonts(), | 
            
                                                                        
                            
            
                                    
            
            
                | 136 |  |  | 				'google'   => $this->get_google_fonts(), | 
            
                                                                        
                            
            
                                    
            
            
                | 137 |  |  | 			) | 
            
                                                                        
                            
            
                                    
            
            
                | 138 |  |  | 		); | 
            
                                                                        
                            
            
                                    
            
            
                | 139 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 140 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  | 	 * Refresh the parameters passed to the JavaScript via JSON. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  | 	 * @see WP_Customize_Control::to_json() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  | 	public function to_json() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  | 		parent::to_json(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  | 		$this->json['default'] = $this->setting->default; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  | 		if ( isset( $this->default ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  | 			$this->json['default'] = $this->default; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  | 		} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  | 		$this->json['output']  = $this->output; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  | 		$this->json['value']   = Kirki_Field_Typography::sanitize( $this->value() ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  | 		$this->json['choices'] = $this->choices; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  | 		$this->json['link']    = $this->get_link(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  | 		$this->json['id']      = $this->id; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  | 		$this->json['inputAttrs'] = ''; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  | 		foreach ( $this->input_attrs as $attr => $value ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  | 			$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  | 		} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  | 		$defaults = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  | 			'font-family'    => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  | 			'font-size'      => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  | 			'variant'        => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  | 			'line-height'    => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  | 			'letter-spacing' => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  | 			'word-spacing'   => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  | 			'color'          => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  | 			'text-align'     => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  | 		$this->json['default'] = wp_parse_args( $this->json['default'], $defaults ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  | 		// Fix for https://github.com/aristath/kirki/issues/1405. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  | 		foreach ( $this->json['value'] as $key => $val ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  | 			if ( isset( $this->json['default'][ $key ] ) && false === $this->json['default'][ $key ] ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  | 				unset( $this->json['value'][ $key ] ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  | 			} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  | 		} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  | 		$this->json['show_variants'] = ( true === Kirki_Fonts_Google::$force_load_all_variants ) ? false : true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  | 		$this->json['show_subsets']  = ( true === Kirki_Fonts_Google::$force_load_all_subsets ) ? false : true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  | 		$this->json['languages']     = Kirki_Fonts::get_google_font_subsets(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  | 	 * An Underscore (JS) template for this control's content (but not its container). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  | 	 * Class variables for this control class are available in the `data` JS object; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  | 	 * export custom variables by overriding {@see WP_Customize_Control::to_json()}. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  | 	 * @see WP_Customize_Control::print_template() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  | 	 * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  | 	protected function content_template() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  | 		?> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  | 		<div class="kirki-controls-loading-spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 |  |  | 		<label class="customizer-text"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  | 			<# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 |  |  | 			<# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  | 		</label> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  | 		<div class="wrapper"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  | 			<# if ( data.default['font-family'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  | 				<# if ( '' == data.value['font-family'] ) { data.value['font-family'] = data.default['font-family']; } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  | 				<# if ( data.choices['fonts'] ) { data.fonts = data.choices['fonts']; } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 |  |  | 				<div class="font-family"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 |  |  | 					<h5><?php esc_attr_e( 'Font Family', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 |  |  | 					<select {{{ data.inputAttrs }}} id="kirki-typography-font-family-{{{ data.id }}}" placeholder="<?php esc_attr_e( 'Select Font Family', 'kirki' ); ?>"></select> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 214 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 215 |  |  | 				<# if ( ! _.isUndefined( data.choices['font-backup'] ) && true === data.choices['font-backup'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 216 |  |  | 					<div class="font-backup hide-on-standard-fonts kirki-font-backup-wrapper"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 217 |  |  | 						<h5><?php esc_attr_e( 'Backup Font', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 218 |  |  | 						<select {{{ data.inputAttrs }}} id="kirki-typography-font-backup-{{{ data.id }}}" placeholder="<?php esc_attr_e( 'Select Font Family', 'kirki' ); ?>"></select> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 219 |  |  | 					</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 220 |  |  | 				<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 221 |  |  | 				<# if ( true === data.show_variants || false !== data.default.variant ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 222 |  |  | 					<div class="variant kirki-variant-wrapper"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 223 |  |  | 						<h5><?php esc_attr_e( 'Variant', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 224 |  |  | 						<select {{{ data.inputAttrs }}} class="variant" id="kirki-typography-variant-{{{ data.id }}}"></select> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 225 |  |  | 					</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 226 |  |  | 				<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 227 |  |  | 				<# if ( true === data.show_subsets ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 228 |  |  | 					<div class="subsets hide-on-standard-fonts kirki-subsets-wrapper"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 229 |  |  | 						<h5><?php esc_attr_e( 'Subset(s)', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 230 |  |  | 						<select {{{ data.inputAttrs }}} class="subset" id="kirki-typography-subsets-{{{ data.id }}}"<# if ( _.isUndefined( data.choices['disable-multiple-variants'] ) || false === data.choices['disable-multiple-variants'] ) { #> multiple<# } #>> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 231 |  |  | 							<# _.each( data.value.subsets, function( subset ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 232 |  |  | 								<option value="{{ subset }}" selected="selected">{{ data.languages[ subset ] }}</option> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 233 |  |  | 							<# } ); #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 234 |  |  | 						</select> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 235 |  |  | 					</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 236 |  |  | 				<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 237 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 238 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 239 |  |  | 			<# if ( data.default['font-size'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 240 |  |  | 				<div class="font-size"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 241 |  |  | 					<h5><?php esc_attr_e( 'Font Size', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 242 |  |  | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['font-size'] }}"/> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 243 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 244 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 245 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 246 |  |  | 			<# if ( data.default['line-height'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 247 |  |  | 				<div class="line-height"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 248 |  |  | 					<h5><?php esc_attr_e( 'Line Height', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 249 |  |  | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['line-height'] }}"/> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 250 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 251 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 252 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 253 |  |  | 			<# if ( data.default['letter-spacing'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 254 |  |  | 				<div class="letter-spacing"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 255 |  |  | 					<h5><?php esc_attr_e( 'Letter Spacing', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 256 |  |  | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['letter-spacing'] }}"/> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 257 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 258 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 259 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 260 |  |  | 			<# if ( data.default['word-spacing'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 261 |  |  | 				<div class="word-spacing"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 262 |  |  | 					<h5><?php esc_attr_e( 'Word Spacing', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 263 |  |  | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['word-spacing'] }}"/> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 264 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 265 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 266 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 267 |  |  | 			<# if ( data.default['text-align'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 268 |  |  | 				<div class="text-align"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 269 |  |  | 					<h5><?php esc_attr_e( 'Text Align', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 270 |  |  | 					<input {{{ data.inputAttrs }}} type="radio" value="inherit" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-inherit" <# if ( data.value['text-align'] === 'inherit' ) { #> checked="checked"<# } #>> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 271 |  |  | 						<label for="{{ data.id }}-text-align-inherit"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 272 |  |  | 							<span class="dashicons dashicons-editor-removeformatting"></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 273 |  |  | 							<span class="screen-reader-text"><?php esc_attr_e( 'Inherit', 'kirki' ); ?></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 274 |  |  | 						</label> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 275 |  |  | 					</input> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 276 |  |  | 					<input {{{ data.inputAttrs }}} type="radio" value="left" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-left" <# if ( data.value['text-align'] === 'left' ) { #> checked="checked"<# } #>> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 277 |  |  | 						<label for="{{ data.id }}-text-align-left"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 278 |  |  | 							<span class="dashicons dashicons-editor-alignleft"></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 279 |  |  | 							<span class="screen-reader-text"><?php esc_attr_e( 'Left', 'kirki' ); ?></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 280 |  |  | 						</label> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 281 |  |  | 					</input> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 282 |  |  | 					<input {{{ data.inputAttrs }}} type="radio" value="center" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-center" <# if ( data.value['text-align'] === 'center' ) { #> checked="checked"<# } #>> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 283 |  |  | 						<label for="{{ data.id }}-text-align-center"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 284 |  |  | 							<span class="dashicons dashicons-editor-aligncenter"></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 285 |  |  | 							<span class="screen-reader-text"><?php esc_attr_e( 'Center', 'kirki' ); ?></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 286 |  |  | 						</label> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 287 |  |  | 					</input> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 288 |  |  | 					<input {{{ data.inputAttrs }}} type="radio" value="right" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-right" <# if ( data.value['text-align'] === 'right' ) { #> checked="checked"<# } #>> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 289 |  |  | 						<label for="{{ data.id }}-text-align-right"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 290 |  |  | 							<span class="dashicons dashicons-editor-alignright"></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 291 |  |  | 							<span class="screen-reader-text"><?php esc_attr_e( 'Right', 'kirki' ); ?></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 292 |  |  | 						</label> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 293 |  |  | 					</input> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 294 |  |  | 					<input {{{ data.inputAttrs }}} type="radio" value="justify" name="_customize-typography-text-align-radio-{{ data.id }}" id="{{ data.id }}-text-align-justify" <# if ( data.value['text-align'] === 'justify' ) { #> checked="checked"<# } #>> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 295 |  |  | 						<label for="{{ data.id }}-text-align-justify"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 296 |  |  | 							<span class="dashicons dashicons-editor-justify"></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 297 |  |  | 							<span class="screen-reader-text"><?php esc_attr_e( 'Justify', 'kirki' ); ?></span> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 298 |  |  | 						</label> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 299 |  |  | 					</input> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 300 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 301 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 302 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 303 |  |  | 			<# if ( data.default['text-transform'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 304 |  |  | 				<div class="text-transform"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 305 |  |  | 					<h5><?php esc_attr_e( 'Text Transform', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 306 |  |  | 					<select {{{ data.inputAttrs }}} id="kirki-typography-text-transform-{{{ data.id }}}"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 307 |  |  | 						<option value="none"<# if ( 'none' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'None', 'kirki' ); ?></option> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 308 |  |  | 						<option value="capitalize"<# if ( 'capitalize' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Capitalize', 'kirki' ); ?></option> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 309 |  |  | 						<option value="uppercase"<# if ( 'uppercase' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Uppercase', 'kirki' ); ?></option> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 310 |  |  | 						<option value="lowercase"<# if ( 'lowercase' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Lowercase', 'kirki' ); ?></option> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 311 |  |  | 						<option value="initial"<# if ( 'initial' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Initial', 'kirki' ); ?></option> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 312 |  |  | 						<option value="inherit"<# if ( 'inherit' === data.value['text-transform'] ) { #>selected<# } #>><?php esc_attr_e( 'Inherit', 'kirki' ); ?></option> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 313 |  |  | 					</select> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 314 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 315 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 316 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 317 |  |  | 			<# if ( false !== data.default['color'] && data.default['color'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 318 |  |  | 				<div class="color"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 319 |  |  | 					<h5><?php esc_attr_e( 'Color', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 320 |  |  | 					<input {{{ data.inputAttrs }}} type="text" data-palette="{{ data.palette }}" data-default-color="{{ data.default['color'] }}" value="{{ data.value['color'] }}" class="kirki-color-control" {{{ data.link }}} /> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 321 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 322 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 323 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 324 |  |  | 			<# if ( data.default['margin-top'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 325 |  |  | 				<div class="margin-top"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 326 |  |  | 					<h5><?php esc_attr_e( 'Margin Top', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 327 |  |  | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['margin-top'] }}"/> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 328 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 329 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 330 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 331 |  |  | 			<# if ( data.default['margin-bottom'] ) { #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 332 |  |  | 				<div class="margin-bottom"> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 333 |  |  | 					<h5><?php esc_attr_e( 'Margin Bottom', 'kirki' ); ?></h5> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 334 |  |  | 					<input {{{ data.inputAttrs }}} type="text" value="{{ data.value['margin-bottom'] }}"/> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 335 |  |  | 				</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 336 |  |  | 			<# } #> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 337 |  |  | 		</div> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 338 |  |  | 		<# | 
            
                                                                                                            
                            
            
                                    
            
            
                | 339 |  |  | 		if ( ! _.isUndefined( data.value['font-family'] ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 340 |  |  | 			data.value['font-family'] = data.value['font-family'].replace( /"/g, ''' ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 341 |  |  | 		} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 342 |  |  | 		valueJSON = JSON.stringify( data.value ).replace( /'/g, ''' ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 343 |  |  | 		#> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 344 |  |  | 		<input class="typography-hidden-value" type="hidden" value='{{{ valueJSON }}}' {{{ data.link }}}> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 345 |  |  | 		<?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 346 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 347 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 348 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 349 |  |  | 	 * Formats variants. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 350 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 351 |  |  | 	 * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 352 |  |  | 	 * @since 3.0.0 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 353 |  |  | 	 * @param array $variants The variants. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 354 |  |  | 	 * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 355 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 356 |  |  | 	protected function format_variants_array( $variants ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 357 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 358 |  |  | 		$all_variants = Kirki_Fonts::get_all_variants(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 359 |  |  | 		$final_variants = array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 360 |  |  | 		foreach ( $variants as $variant ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 361 |  |  | 			if ( is_string( $variant ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 362 |  |  | 				$final_variants[] = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 363 |  |  | 					'id'    => $variant, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 364 |  |  | 					'label' => isset( $all_variants[ $variant ] ) ? $all_variants[ $variant ] : $variant, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 365 |  |  | 				); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 366 |  |  | 			} elseif ( is_array( $variant ) && isset( $variant['id'] ) && isset( $variant['label'] ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 367 |  |  | 				$final_variants[] = $variant; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 368 |  |  | 			} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 369 |  |  | 		} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 370 |  |  | 		return $final_variants; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 371 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 372 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 373 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 374 |  |  | 	 * Gets standard fonts properly formatted for our control. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 375 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 376 |  |  | 	 * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 377 |  |  | 	 * @since 3.0.0 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 378 |  |  | 	 * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 379 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 380 |  |  | 	protected function get_standard_fonts() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 381 |  |  | 		// Add fonts to our JS objects. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 382 |  |  | 		$standard_fonts = Kirki_Fonts::get_standard_fonts(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 383 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 384 |  |  | 		$std_user_keys = $this->choices['fonts']['standard']; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 385 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 386 |  |  | 		$standard_fonts_final = array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 387 |  |  | 		$default_variants = $this->format_variants_array( array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 388 |  |  | 			'regular', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 389 |  |  | 			'italic', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 390 |  |  | 			'700', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 391 |  |  | 			'700italic', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 392 |  |  | 		) ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 393 |  |  | 		foreach ( $standard_fonts as $key => $font ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 394 |  |  | 			if ( ! empty( $std_user_keys ) && ! in_array( $key, $std_user_keys, true ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 395 |  |  | 				continue; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 396 |  |  | 			} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 397 |  |  | 			$standard_fonts_final[] = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 398 |  |  | 				'family'      => $font['stack'], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 399 |  |  | 				'label'       => $font['label'], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 400 |  |  | 				'subsets'     => array(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 401 |  |  | 				'is_standard' => true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 402 |  |  | 				'variants'    => ( isset( $font['variants'] ) ) ? $this->format_variants_array( $font['variants'] ) : $default_variants, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 403 |  |  | 			); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 404 |  |  | 		} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 405 |  |  | 		return $standard_fonts_final; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 406 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 407 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 408 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 409 |  |  | 	 * Gets google fonts properly formatted for our control. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 410 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 411 |  |  | 	 * @access protected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 412 |  |  | 	 * @since 3.0.0 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 413 |  |  | 	 * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 414 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 415 |  |  | 	protected function get_google_fonts() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 416 |  |  | 		// Add fonts to our JS objects. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 417 |  |  | 		$google_fonts = Kirki_Fonts::get_google_fonts(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 418 |  |  | 		$all_variants = Kirki_Fonts::get_all_variants(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 419 |  |  | 		$all_subsets  = Kirki_Fonts::get_google_font_subsets(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 420 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 421 |  |  | 		$gf_user_keys = $this->choices['fonts']['google']; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 422 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 423 |  |  | 		$google_fonts_final = array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 424 |  |  | 		foreach ( $google_fonts as $family => $args ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 425 |  |  | 			if ( ! empty( $gf_user_keys ) && ! in_array( $family, $gf_user_keys, true ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 426 |  |  | 				continue; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 427 |  |  | 			} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 428 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 429 |  |  | 			$label    = ( isset( $args['label'] ) ) ? $args['label'] : $family; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 430 |  |  | 			$variants = ( isset( $args['variants'] ) ) ? $args['variants'] : array( 'regular', '700' ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 431 |  |  | 			$subsets  = ( isset( $args['subsets'] ) ) ? $args['subsets'] : array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 432 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 433 |  |  | 			$available_variants = array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 434 |  |  | 			if ( is_array( $variants ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 435 |  |  | 				foreach ( $variants as $variant ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 436 |  |  | 					if ( array_key_exists( $variant, $all_variants ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 437 |  |  | 						$available_variants[] = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 438 |  |  | 							'id' => $variant, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 439 |  |  | 							'label' => $all_variants[ $variant ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 440 |  |  | 						); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 441 |  |  | 					} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 442 |  |  | 				} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 443 |  |  | 			} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 444 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 445 |  |  | 			$available_subsets = array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 446 |  |  | 			if ( is_array( $subsets ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 447 |  |  | 				foreach ( $subsets as $subset ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 448 |  |  | 					if ( array_key_exists( $subset, $all_subsets ) ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 449 |  |  | 						$available_subsets[] = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 450 |  |  | 							'id' => $subset, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 451 |  |  | 							'label' => $all_subsets[ $subset ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 452 |  |  | 						); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 453 |  |  | 					} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 454 |  |  | 				} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 455 |  |  | 			} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 456 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 457 |  |  | 			$google_fonts_final[] = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 458 |  |  | 				'family'       => $family, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 459 |  |  | 				'label'        => $label, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 460 |  |  | 				'variants'     => $available_variants, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 461 |  |  | 				'subsets'      => $available_subsets, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 462 |  |  | 			); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 463 |  |  | 		} // End foreach(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 464 |  |  | 		return $google_fonts_final; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 465 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 466 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 467 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 468 |  |  | 	 * Render the control's content. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 469 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 470 |  |  | 	 * @see WP_Customize_Control::render_content() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 471 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 472 |  |  | 	protected function render_content() {} | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 473 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 474 |  |  |  |