define([],function(){var e=Backbone.View.extend({className:"upfront-inline-panel-item",width:30,height:30,icon_class:"upfront-icon-region",initialize:function(e){this.options=e||{},this.label=this.options.label},render_icon:function(){var e=typeof this.icon=="function"?this.icon():this.icon;if(!e)return;var t=this,n=e.split(" "),r=["upfront-icon"],i=this.$el.find(".upfront-icon");_.each(n,function(e){r.push(t.icon_class+"-"+e)}),i.length?i.attr("class",r.join(" ")):this.$el.append('<i class="'+r.join(" ")+'" />')},render_label:function(){var e=typeof this.label=="function"?this.label():this.label;if(!e)return;var t=this.$el.find(".upfront-inline-panel-item-label");this.$el.addClass("labeled"),t.length?t.html(e):this.$el.append('<span class="upfront-inline-panel-item-label">'+e+"</span>")},render_tooltip:function(){var e=typeof this.tooltip=="function"?this.tooltip():this.tooltip;if(!e)return;this.$el.attr("title",e)},render:function(){this.render_icon(),this.render_label(),this.render_tooltip(),this.$el.css({width:this.width,height:this.height}),this.$el.attr("id",this.id),typeof this.on_render=="function"&&this.on_render()},open_modal:function(e,t){if(!this.modal){var n=this,r=this.$el.closest(".upfront-region-container");this.modal=new Upfront.Views.Editor.Modal({to:r,top:60}),this.modal.render(),r.append(this.modal.$el)}return this.listenToOnce(Upfront.Events,"entity:region:deactivated",function(){n.close_modal(!1)}),this.modal.open(e,this,t)},close_modal:function(e){return this.modal.close(e)},remove:function(){this.panel_view=!1}});return e});