var __bind=function(a,b){return function(){return a.apply(b,arguments)}},__hasProp=Object.prototype.hasOwnProperty,__extends=function(a,b){function d(){this.constructor=a}for(var c in b)__hasProp.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};define(["common/views/state","common/views/collection"],function(a,b){var c,d,e,f;return d=function(){function b(){this.click=__bind(this.click,this),b.__super__.constructor.apply(this,arguments)}return __extends(b,a.View),b.prototype.el='<span role="domain">                <div class="icon"></div><span role="name"></span>            </span>',b.prototype.elements={span:"name"},b.prototype.events={click:"click"},b.prototype.render=function(){var a;return a=this.model.get("name"),this.el.attr({id:"tab-"+a.toLowerCase()}),this.name.text(this.model.get("name")),this},b.prototype.click=function(a){return this.model.activate()},b}(),c=function(){function a(){a.__super__.constructor.apply(this,arguments)}return __extends(a,b.View),a.prototype.el="#domains",a.prototype.viewClass=d,a.prototype.reset=function(b,c){a.__super__.reset.apply(this,arguments);if(c.initial)return this.el.parent().fadeIn()},a}(),f=function(){function a(){a.__super__.constructor.apply(this,arguments)}return __extends(a,d),a.prototype.el='<span role="name"></span>',a.prototype.render=function(){return this.el.text(this.model.get("name")),this},a}(),e=function(){function a(){this.toggleEnableByDomain=__bind(this.toggleEnableByDomain,this),a.__super__.constructor.apply(this,arguments)}return __extends(a,b.View),a.prototype.el="#subdomains",a.prototype.viewClass=f,a.prototype.initialize=function(){return a.__super__.initialize.apply(this,arguments),App.hub.subscribe("domain/active",this.toggleEnableByDomain)},a.prototype.toggleEnableByDomain=function(a){if(!this.collection._byDomain[a]){if(!this.el.is(":hidden"))return this.el.slideUp("fast")}else if(this.el.is(":hidden"))return this.el.slideDown("fast")},a}(),{DomainView:d,DomainCollectionView:c,SubdomainView:f,SubdomainCollectionView:e}})