Show a reset button if any facets are in use

(function($) {
    
    $(document).on('facetwp-loaded', function() {
        var in_use = false;

        // see if any facets are in use
        $.each(FWP.facets, function(name, val) {
            if (val.length > 0) {
                in_use = true;
            }
        }

        // true = show, false = hide
        $('.facetwp-reset-btn').toggle(in_use);
    });
    
})(jQuery);