/*! grafana - v4.5.1 - 2017-09-19
 * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */

System.register(["app/core/core_module"],function(a,b){"use strict";function c(){return{restrict:"E",template:e,controller:f,bindToController:!0,controllerAs:"ctrl",scope:{dismiss:"&"}}}b&&b.id;a("unsavedChangesModalDirective",c);var d,e,f;return{setters:[function(a){d=a}],execute:function(){e='\n<div class="modal-body">\n  <div class="modal-header">\n    <h2 class="modal-header-title">\n      <i class="fa fa-exclamation"></i>\n      <span class="p-l-1">Unsaved changes</span>\n    </h2>\n\n    <a class="modal-header-close" ng-click="dismiss();">\n      <i class="fa fa-remove"></i>\n    </a>\n  </div>\n\n  <div class="modal-content text-center">\n\n    <div class="confirm-modal-text">\n      Do you want to save you changes?\n    </div>\n\n    <div class="confirm-modal-buttons">\n      <button type="button" class="btn btn-inverse" ng-click="ctrl.dismiss()">Cancel</button>\n      <button type="button" class="btn btn-danger" ng-click="ctrl.discard()">Discard</button>\n      <button type="button" class="btn btn-success" ng-click="ctrl.save()">Save</button>\n    </div>\n  </div>\n</div>\n',f=function(){function a(a,b){this.$rootScope=a,this.unsavedChangesSrv=b}return a.$inject=["$rootScope","unsavedChangesSrv"],a.prototype.discard=function(){this.dismiss(),this.unsavedChangesSrv.tracker.discardChanges()},a.prototype.save=function(){this.dismiss(),this.unsavedChangesSrv.tracker.saveChanges()},a}(),a("UnsavedChangesModalCtrl",f),d.default.directive("unsavedChangesModal",c)}}});