(function( $ ) {
	wp.customize.bind( 'ready', function() {

		var optPrefix = '#customize-control-vlog_channel_options-';
		
		// Label
		function vlog_channel_customizer_label( id, title ) {

			// Site Identity

			if ( id === 'custom_logo' || id === 'site_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Global Color Setting

			if ( id === 'vlog_channel_global_color' || id === 'vlog_channel_heading_color' || id === 'vlog_channel_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'vlog_channel_scroll_hide' || id === 'vlog_channel_preloader_hide' || id === 'vlog_channel_sticky_header' || id === 'vlog_channel_products_per_row' || id === 'vlog_channel_scroll_top_position' || id === 'vlog_channel_products_per_row' || id === 'vlog_channel_width_option' || id === 'vlog_channel_nav_menu_text_transform')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

			if ( id === 'vlog_channel_theme_color' || id === 'background_color' || id === 'background_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Header Image

			if ( id === 'header_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Social Icon

			if ( id === 'vlog_channel_facebook_icon' || id === 'vlog_channel_twitter_icon' || id === 'vlog_channel_intagram_icon'|| id === 'vlog_channel_linkedin_icon'|| id === 'vlog_channel_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header
			
			if ( id === 'vlog_channel_topbar_phone_number' || id === 'vlog_channel_topbar_email_address' || id === 'vlog_channel_search_enable') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}


			// Slider

			if ( id === 'vlog_channel_slider_section_setting' || id === 'vlog_channel_post_layout' || id === 'vlog_channel_404_page_main_heading' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Products

			if ( id === 'vlog_channel_event_section_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Footer

			if ( id === 'vlog_channel_footer_widget_content_alignment' || id === 'vlog_channel_show_hide_copyright') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Post Settings

			if ( id === 'vlog_channel_post_page_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Single Post Settings

			if ( id === 'vlog_channel_single_post_thumb' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vlog_channel_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
		}

	    // Site Identity
		vlog_channel_customizer_label( 'custom_logo', 'Logo Setup' );
		vlog_channel_customizer_label( 'site_icon', 'Favicon' );

		// Global Color Setting
		vlog_channel_customizer_label( 'vlog_channel_global_color', 'Global Color' );
		vlog_channel_customizer_label( 'vlog_channel_heading_color', 'Heading Typography' );
		vlog_channel_customizer_label( 'vlog_channel_paragraph_color', 'Paragraph Typography' );

		// General Setting
		vlog_channel_customizer_label( 'vlog_channel_preloader_hide', 'Preloader' );
		vlog_channel_customizer_label( 'vlog_channel_sticky_header', 'Sticky Header' );
		vlog_channel_customizer_label( 'vlog_channel_scroll_hide', 'Scroll To Top' );
		vlog_channel_customizer_label( 'vlog_channel_scroll_top_position', 'Scroll to top Position' );
		vlog_channel_customizer_label( 'vlog_channel_products_per_row', 'woocommerce Setting' );
		vlog_channel_customizer_label( 'vlog_channel_width_option', 'Site Width Layouts' );
		vlog_channel_customizer_label( 'vlog_channel_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		vlog_channel_customizer_label( 'vlog_channel_theme_color', 'Theme Color' );
		vlog_channel_customizer_label( 'background_color', 'Colors' );
		vlog_channel_customizer_label( 'background_image', 'Image' );

		//Header Image
		vlog_channel_customizer_label( 'header_image', 'Header Image' );

		// Social Icon
		vlog_channel_customizer_label( 'vlog_channel_facebook_icon', 'Facebook' );
		vlog_channel_customizer_label( 'vlog_channel_twitter_icon', 'Twitter' );
		vlog_channel_customizer_label( 'vlog_channel_intagram_icon', 'Intagram' );
		vlog_channel_customizer_label( 'vlog_channel_linkedin_icon', 'Linkedin' );
		vlog_channel_customizer_label( 'vlog_channel_pintrest_icon', 'Pintrest' );

		// Header 
		vlog_channel_customizer_label( 'vlog_channel_topbar_phone_number', 'Phone Number' );
		vlog_channel_customizer_label( 'vlog_channel_topbar_email_address', 'Email Address' );
		vlog_channel_customizer_label( 'vlog_channel_search_enable', 'Header Search' );

		//Slider
		vlog_channel_customizer_label( 'vlog_channel_slider_section_setting', 'Slider' );

		vlog_channel_customizer_label( 'vlog_channel_post_layout', 'Post Layouts Settings' );

		vlog_channel_customizer_label( 'vlog_channel_404_page_main_heading', '404 Page Settings' );

		//Products
		vlog_channel_customizer_label( 'vlog_channel_event_section_setting', 'Event Section' );

		//Footer
		vlog_channel_customizer_label( 'vlog_channel_footer_widget_content_alignment', 'Footer' );
		vlog_channel_customizer_label( 'vlog_channel_show_hide_copyright', 'Copyright' );

		//Post setting
		vlog_channel_customizer_label( 'vlog_channel_post_page_title', 'Post Settings' );

		//Single post setting
		vlog_channel_customizer_label( 'vlog_channel_single_post_thumb', 'Single Post Settings' );
	

	});

})( jQuery );
