(function($) {
    "use strict";
    wp.data.subscribe(() => {
        var postFormat = wp.data.select('core/editor').getEditedPostAttribute('format');
        $('#socity_pfg_meta, #socity_pfv_meta, #socity_pfa_meta').hide();

        if (postFormat == 'gallery') {
            $('#socity_pfg_meta').fadeIn();
        };
        if (postFormat == 'video') {
            $('#socity_pfv_meta').fadeIn();
        };
        if (postFormat == 'audio') {
            $('#socity_pfa_meta').fadeIn();
        };
    });
})(jQuery);