<?php
function babytoysstore_header_settings( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	/*=========================================
	Header Settings Panel
	=========================================*/
	$wp_customize->add_panel( 
		'header_section', 
		array(
			'priority'      => 2,
			'capability'    => 'edit_theme_options',
			'title'			=> __('Header', 'baby-toys-store'),
		) 
	);
	
	/*=========================================
	Baby Toys Store Site Identity
	=========================================*/
	$wp_customize->add_section(
        'title_tagline',
        array(
        	'priority'      => 1,
            'title' 		=> __('Site Identity','baby-toys-store'),
			'panel'  		=> 'header_section',
		)
    );

    // top header Site Title Color
	$topheadersitetitlecol = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'topheader_sitetitlecol',
    	array(
			'default' => $topheadersitetitlecol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'topheader_sitetitlecol',
		array(
		    'label'   		=> __('Site Title Color','baby-toys-store'),
		    'section'		=> 'title_tagline',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header Tagline Color
	$topheadertaglinecol = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'topheader_taglinecol',
    	array(
			'default' => $topheadertaglinecol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'topheader_taglinecol',
		array(
		    'label'   		=> __('Tagline Color','baby-toys-store'),
		    'section'		=> 'title_tagline',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);
	
	/*=========================================
	Baby Toys Store header
	=========================================*/
	$wp_customize->add_section(
        'top_header',
        array(
        	'priority'      => 5,
            'title' 		=> __('Header','baby-toys-store'),
			'panel'  		=> 'header_section',
		)
    );	

    $wp_customize->add_setting('babytoysstore_reset_header_settings',array(
	  'sanitize_callback'   => 'sanitize_text_field'
	));
	$wp_customize->add_control(new babytoysstore_Reset_Custom_Control($wp_customize, 'baby_toys_store_reset_header_settings',array(
	  'type' => 'reset_control',
	   'priority' => 1,
	  'label' => __('Reset Header Settings', 'baby-toys-store'),
	  'description' => 'baby_toys_store_header_reset_settings',
	  'section' => 'top_header'
	)));

    $wp_customize->add_setting('babytoysstore_top_header_tabs', array(
	   'sanitize_callback' => 'wp_kses_post',
	));

	$wp_customize->add_control(new babytoysstore_Tab_Control($wp_customize, 'babytoysstore_top_header_tabs', array(
	   'section' => 'top_header',
	   'priority' => 1,
	   'buttons' => array(
	      array(
     		'name' => esc_html__('General', 'baby-toys-store'),
 			'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
            	'hide_show_sticky',
				'topheader_annoucementbartext',
				'topheader_annoucementbar_shopnowbtnlink',
            	'topheader_btnlink',
				'topheader_storelocation_btnlink'
            ),
            'active' => true,
         ),
	      array(
            'name' => esc_html__('Style', 'baby-toys-store'),
            'icon' => 'dashicons dashicons-art',
            'fields' => array(
				'header_annoucementbarbgcolor',
				'header_annoucementbartextcolor',
            	'header_bgcolor',
				'header_menuscolor',
            	'header_menuiconcolor',
            	'header_submenusbgcolor',
            	'header_submenutextcolor',
            	'header_submenustxthovercolor',
            	'header_btntextcolor',
            	'header_btnbgcolor',
            	'header_btntxthovercolor',
				'header_btnbghovercolor',
				'header_newarrivalbtntextcolor',
				'header_newarrivalbtnbgcolor',
				'header_searchbariconcolor',
				'header_searchbariconhrvcolor',
				'header_carticoncolor',
				'header_carticonbgcolor',
				'header_cartnumcolor',
				'header_cartnumbgcolor',
				'header_acciconcolor',
				'header_acciconbgcolor',
				'header_storelocationicontextcolor',
				'header_storelocationiconbgcolor'
            ),
         )
	    
    	),
	)));

	// general setting

	// sticky header
	$wp_customize->add_setting( 'hide_show_sticky',array(
        'default' => false,
        'sanitize_callback' => 'babytoysstore_switch_sanitization'
   	) );
   	$wp_customize->add_control( new babytoysstore_Toggle_Switch_Custom_Control( $wp_customize, 'hide_show_sticky',array(
        'label' => __( 'Show Sticky Header','baby-toys-store' ),
        'section' => 'top_header'
   	)));

	// topheader annoucementbartext
	$topheaderannoucementbartext = esc_html__('', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'topheader_annoucementbartext',
    	array(
			'default' => $topheaderannoucementbartext,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'topheader_annoucementbartext',
		array(
		    'label'   		=> __('Annoucement Bar Text','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	// topheader annoucementbar_shopnowbtnlink
	$topheaderannoucementbar_shopnowbtnlink = esc_html__('', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'topheader_annoucementbar_shopnowbtnlink',
    	array(
			'default' => $topheaderannoucementbar_shopnowbtnlink,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'topheader_annoucementbar_shopnowbtnlink',
		array(
		    'label'   		=> __('Annoucement Bar Shop Now Link','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	// topheader btn link
	$topheaderbtnlink = esc_html__('#', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'topheader_btnlink',
    	array(
			'default' => $topheaderbtnlink,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 7,
		)
	);	

	$wp_customize->add_control( 
		'topheader_btnlink',
		array(
		    'label'   		=> __('Button Link','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	// topheader storelocation_btnlink
	$topheaderstorelocation_btnlink = esc_html__('#', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'topheader_storelocation_btnlink',
    	array(
			'default' => $topheaderstorelocation_btnlink,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'topheader_storelocation_btnlink',
		array(
		    'label'   		=> __('Store Location Button Link','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	// Style setting
	// header annoucementbarbg Color
	$headerannoucementbarbgcolor = esc_html__('#28AAE0', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_annoucementbarbgcolor',
    	array(
			'default' => $headerannoucementbarbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_annoucementbarbgcolor',
		array(
		    'label'   		=> __('Annoucement Bar BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header annoucementbartext Color
	$headerannoucementbartextcolor = esc_html__('#fff', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_annoucementbartextcolor',
    	array(
			'default' => $headerannoucementbartextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_annoucementbartextcolor',
		array(
		    'label'   		=> __('Annoucement Bar Text Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header bg Color
	$headerbgcolor = esc_html__('#F4F4F4', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_bgcolor',
    	array(
			'default' => $headerbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_bgcolor',
		array(
		    'label'   		=> __('BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header menus Color
	$headermenuscolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_menuscolor',
    	array(
			'default' => $headermenuscolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_menuscolor',
		array(
		    'label'   		=> __('Menus Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header menuicon Color
	$headermenuiconcolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_menuiconcolor',
    	array(
			'default' => $headermenuiconcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_menuiconcolor',
		array(
		    'label'   		=> __('Icon Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	$headersubmenusbgcolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_submenusbgcolor',
    	array(
			'default' => $headersubmenusbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_submenusbgcolor',
		array(
		    'label'   		=> __('SubMenus BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header submenutext Color
	$headersubmenutextcolor = esc_html__('#fff', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_submenutextcolor',
    	array(
			'default' => $headersubmenutextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_submenutextcolor',
		array(
		    'label'   		=> __('SubMenus Text Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header submenustxthover Color
	$headersubmenustxthovercolor = esc_html__('#28AAE0', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_submenustxthovercolor',
    	array(
			'default' => $headersubmenustxthovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_submenustxthovercolor',
		array(
		    'label'   		=> __('Menu Hover Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header btntext Color
	$headerbtntextcolor = esc_html__('#fff', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_btntextcolor',
    	array(
			'default' => $headerbtntextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_btntextcolor',
		array(
		    'label'   		=> __('Button Text Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header btnbg Color 1
	$headerbtnbgcolor1 = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_btnbgcolor',
    	array(
			'default' => $headerbtnbgcolor1,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_btnbgcolor',
		array(
		    'label'   		=> __('Button BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	
	// header btntxthover Color 
	$headerbtntxthovercolor = esc_html__('#28AAE0', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_btntxthovercolor',
    	array(
			'default' => $headerbtntxthovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_btntxthovercolor',
		array(
		    'label'   		=> __('Button Text Hover Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header btnbghover Color 
	$headerbtnbghovercolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_btnbghovercolor',
    	array(
			'default' => $headerbtnbghovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_btnbghovercolor',
		array(
		    'label'   		=> __('Button BG Hover Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header newarrivalbtntext Color 
	$headernewarrivalbtntextcolor = esc_html__('#fff', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_newarrivalbtntextcolor',
    	array(
			'default' => $headernewarrivalbtntextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_newarrivalbtntextcolor',
		array(
		    'label'   		=> __('New Arrival Button Text & Icon Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header newarrivalbtnbg Color 
	$headernewarrivalbtnbgcolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_newarrivalbtnbgcolor',
    	array(
			'default' => $headernewarrivalbtnbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_newarrivalbtnbgcolor',
		array(
		    'label'   		=> __('New Arrival Button BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header searchbaricon Color 
	$headersearchbariconcolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_searchbariconcolor',
    	array(
			'default' => $headersearchbariconcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_searchbariconcolor',
		array(
		    'label'   		=> __('Search Bar Icon Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header searchbariconhrv Color 
	$headersearchbariconhrvcolor = esc_html__('#28AAE0', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_searchbariconhrvcolor',
    	array(
			'default' => $headersearchbariconhrvcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_searchbariconhrvcolor',
		array(
		    'label'   		=> __('Search Bar Icon Hover Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header carticon Color 
	$headercarticoncolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_carticoncolor',
    	array(
			'default' => $headercarticoncolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_carticoncolor',
		array(
		    'label'   		=> __('Cart Icon Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header carticonbg Color 
	$headercarticonbgcolor = esc_html__('#F4F4F4', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_carticonbgcolor',
    	array(
			'default' => $headercarticonbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_carticonbgcolor',
		array(
		    'label'   		=> __('Cart Icon BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header cartnum Color 
	$headercartnumcolor = esc_html__('#fff', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_cartnumcolor',
    	array(
			'default' => $headercartnumcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_cartnumcolor',
		array(
		    'label'   		=> __('Cart Number Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header cartnumbg Color 
	$headercartnumbgcolor = esc_html__('#8B060B', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_cartnumbgcolor',
    	array(
			'default' => $headercartnumbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_cartnumbgcolor',
		array(
		    'label'   		=> __('Cart Number BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header accicon Color 
	$headeracciconcolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_acciconcolor',
    	array(
			'default' => $headeracciconcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_acciconcolor',
		array(
		    'label'   		=> __('Account Icon Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header acciconbg Color 
	$headeracciconbgcolor = esc_html__('#F4F4F4', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_acciconbgcolor',
    	array(
			'default' => $headeracciconbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_acciconbgcolor',
		array(
		    'label'   		=> __('Account Icon BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header storelocationicontext Color 
	$headerstorelocationicontextcolor = esc_html__('#000', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_storelocationicontextcolor',
    	array(
			'default' => $headerstorelocationicontextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_storelocationicontextcolor',
		array(
		    'label'   		=> __('Store Location Icon & Text Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// header storelocationiconbg Color 
	$headerstorelocationiconbgcolor = esc_html__('#F4F4F4', 'baby-toys-store' );
	$wp_customize->add_setting(
    	'header_storelocationiconbgcolor',
    	array(
			'default' => $headerstorelocationiconbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'header_storelocationiconbgcolor',
		array(
		    'label'   		=> __('Store Location BG Color','baby-toys-store'),
		    'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	$wp_customize->register_control_type('babytoysstore_Tab_Control');
	$wp_customize->register_panel_type( 'babytoysstore_WP_Customize_Panel' );
	$wp_customize->register_section_type( 'babytoysstore_WP_Customize_Section' );

}
add_action( 'customize_register', 'babytoysstore_header_settings' );

if ( class_exists( 'WP_Customize_Panel' ) ) {
  	class babytoysstore_WP_Customize_Panel extends WP_Customize_Panel {
	   public $panel;
	   public $type = 'babytoysstore_panel';
	   public function json() {

	      $array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'type', 'panel', ) );
	      $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
	      $array['content'] = $this->get_content();
	      $array['active'] = $this->active();
	      $array['instanceNumber'] = $this->instance_number;
	      return $array;
    	}
  	}
}

if ( class_exists( 'WP_Customize_Section' ) ) {
  	class babytoysstore_WP_Customize_Section extends WP_Customize_Section {
	   public $section;
	   public $type = 'babytoysstore_section';
	   public function json() {

	      $array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'panel', 'type', 'description_hidden', 'section', ) );
	      $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
	      $array['content'] = $this->get_content();
	      $array['active'] = $this->active();
	      $array['instanceNumber'] = $this->instance_number;

	      if ( $this->panel ) {
	        $array['customizeAction'] = sprintf( 'Customizing &#9656; %s', esc_html( $this->manager->get_panel( $this->panel )->title ) );
	      } else {
	        $array['customizeAction'] = 'Customizing';
	      }
	      return $array;
    	}
  	}
}






