(function(e){define(["scripts/upfront/inline-panels/item"],function(t){var n=t.extend({events:{"click >.upfront-icon":"toggle_subitem"},initialize:function(){this.sub_items={},this.listenTo(Upfront.Events,"entity:region:activated",this.on_region_change)},get_selected_item:function(){},get_default_item:function(){},get_selected_icon:function(e){return e+"-active"},set_selected_item:function(){},select_item:function(e){this.set_selected_item(e),this.render()},render:function(){var t=this,n=this.get_selected_item()||this.get_default_item(),r=e('<div class="upfront-inline-panel-subitem" />');this.$el.html(""),this.icon=this.get_selected_icon(n),this.render_icon(),this.render_tooltip(),_.each(this.sub_items,function(e,i){e.panel_view=t.panel_view,e.parent_view=t,e.render(),e.delegateEvents(),n!=i&&r.append(e.el)}),r.append(this.sub_items[n].el),this.$el.append(r)},toggle_subitem:function(){this.$el.hasClass("upfront-inline-panel-subitem-active")?this.close_subitem():this.open_subitem()},open_subitem:function(){this.$el.addClass("upfront-inline-panel-subitem-active"),this.$el.removeClass("upfront-inline-panel-subitem-inactive")},close_subitem:function(){this.$el.addClass("upfront-inline-panel-subitem-inactive"),this.$el.removeClass("upfront-inline-panel-subitem-active")},on_region_change:function(e){e.model!=this.model&&this.close_subitem()},remove:function(){this.sub_items&&_.each(this.sub_items,function(e){e.remove()}),this.panel_view=!1,Backbone.View.prototype.remove.call(this)}});return n})})(jQuery);