var __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(["backbone"],function(a){var b;return b=function(){function b(){b.__super__.constructor.apply(this,arguments)}return __extends(b,a.Model),b.prototype.defaults={_active:!1,_enabled:!0},b.prototype.initialize=function(){return this.bind("change:_active",this._changeActive),this.bind("change:_enabled",this._changeEnabled)},b.prototype.toJSON=function(){var a;return a=b.__super__.toJSON.apply(this,arguments),delete a._active,delete a._enabled,a},b.prototype._changeActive=function(a,b,c){var d;return d=b?"active":"inactive",this.trigger(d,this,c)},b.prototype._changeEnabled=function(a,b,c){var d;return d=b?"enabled":"disabled",this.trigger(d,this,c)},b.prototype.enable=function(a){var b;a==null&&(a={}),b=!this.get("_enabled"),this.set("_enabled",!0,a);if(a.reactivate&&b&&this.isActive())return this._changeActive(this,!0)},b.prototype.disable=function(a){return this.set("_enabled",!1,a)},b.prototype.activate=function(a){if(this.get("_enabled"))return this.set("_active",!0,a)},b.prototype.inactivate=function(a){if(this.get("_enabled"))return this.set("_active",!1,a)},b.prototype.isEnabled=function(){return this.get("_enabled")},b.prototype.isActive=function(){return this.get("_enabled")&&this.get("_active")},b}(),{Model:b}})