define(["jquery","core/custom_interaction_events","block_myoverview/repository","block_myoverview/view","block_myoverview/selectors"],function(a,b,c,d,e){var f={FILTERS:'[data-region="filter"]',FILTER_OPTION:"[data-filter]",DISPLAY_OPTION:"[data-display-option]"},g=function(a,b){var d=null;d="display"==a?"block_myoverview_user_view_preference":"sort"==a?"block_myoverview_user_sort_preference":"block_myoverview_user_grouping_preference",c.updateUserPreferences({preferences:[{type:d,value:b}]})},h=function(c){var h=c.find(f.FILTERS);b.define(h,[b.events.activate]),h.on(b.events.activate,f.FILTER_OPTION,function(b,f){var h=a(b.target);if(!h.hasClass("active")){var i=h.attr("data-filter"),j=h.attr("data-pref");c.find(e.courseView.region).attr("data-"+i,h.attr("data-value")),g(i,j),d.init(c),f.originalEvent.preventDefault()}}),b.define(h,[b.events.activate]),h.on(b.events.activate,f.DISPLAY_OPTION,function(b,f){var h=a(b.target);if(!h.hasClass("active")){var i=h.attr("data-display-option"),j=h.attr("data-pref");c.find(e.courseView.region).attr("data-display",h.attr("data-value")),g(i,j),d.reset(c),f.originalEvent.preventDefault()}})},i=function(b){b=a(b),h(b)};return{init:i}});