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(["cilantro/utils/logging"],function(a){var b,c;return c={UnsavedReportTemplate:'<div class="message-block warning">                    <div class="content">                        <strong role="name"><%= name %></strong> has unsaved changes                    </div>                    <button class="revert">Revert</button>                    <button class="save">Save</button>                </div>'},b=function(){function b(){b.__super__.constructor.apply(this,arguments)}return __extends(b,a.MessageView),b.prototype.template=_.template(c.UnsavedReportTemplate),b.prototype.elements={"[role=name]":"name"},b.prototype.events={"click .save":"save","click .revert":"revert"},b.prototype.initialize=function(){return this.render(),this.model.bind("change:name",__bind(function(a,b){return this.el.find("[role=name]").text(b)},this)),this.model.bind("change:has_changed",__bind(function(a,b){return b?App.hub.publish("log",this):App.hub.publish("dismiss",this)},this))},b.prototype.render=function(){return this.el=$(this.template(this.model.toJSON())),this.setLocalElements(),this.delegateEvents(),this},b.prototype.save=function(){return this.model.save(null,{url:this.model.get("permalink")})},b.prototype.revert=function(){return this.model.save(null,{data:JSON.stringify({revert:!0}),contentType:"application/json"})},b}(),{UnsavedReport:b,templates:c}})