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},__bind=function(a,b){return function(){return a.apply(b,arguments)}};define(["backbone","common/models/polling"],function(a,b){var c,d,e;return c=function(){function b(){b.__super__.constructor.apply(this,arguments)}return __extends(b,a.Model),b.prototype.url=function(){var a;return a=b.__super__.url.apply(this,arguments),/\/$/.test(a)||(a+="/"),a},b.prototype.initialize=function(){return this.bind("change",function(){return App.hub.publish("report/change",this)})},b}(),d=function(){function a(){a.__super__.constructor.apply(this,arguments)}return __extends(a,b.Collection),a.prototype.url=App.endpoints.reports,a.prototype.model=c,a.prototype.comparator=function(a){return-Number(new Date(a.get("modified")))},a}(),e=function(){function a(){a.__super__.constructor.apply(this,arguments)}return __extends(a,b.Model),a.prototype.url=App.endpoints.session.report,a.prototype.defaults={name:"click to give your report a name...",description:"click to give your report a description..."},a.prototype.initialize=function(){return a.__super__.initialize.apply(this,arguments),App.hub.subscribe("report/clear",__bind(function(){return this.clear({silent:!0}),this.save(null,{success:function(){return window.location=App.endpoints.define}})},this)),App.hub.subscribe("report/change",__bind(function(a){if(a.id===this.get("reference_id"))return this.set(a.toJSON())},this))},a.prototype.push=function(){return this.save(null,{url:this.get("permalink"),success:function(){return App.hub.publish("report/push",this)}})},a.prototype.revert=function(){return this.save(null,{data:JSON.stringify({revert:!0}),contentType:"application/json",success:function(){return App.hub.publish("report/revert",this)}})},a}(),{Model:c,Collection:d,Session:e}})