$(document).on("change", "[data-toggle=collapse-select]", function(event) {
  const select = event.target;
  const mappings = JSON.parse(select.dataset.targetShowValuesMapping);
  
  $.each(mappings, function( key, value ) {
    if (value.indexOf(select.value) > -1) {
      $(key).show("fast");
    } else {
      $(key).hide("fast");
    }
  });
});

$(document).on("turbolinks:load", function() {
  $("[data-toggle=collapse-select]").trigger("change");
});