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

System.register(["angular","../core_module"],function(a,b){"use strict";function c(){return{controller:g,replace:!1,restrict:"A"}}function d(){return{controller:h,controllerAs:"ctrl",replace:!0,restrict:"E",scope:{line:"@lineDisplay",link:"@lineLink",switchView:"&"},template:'<a class="diff-linenum btn btn-inverse btn-small" ng-click="ctrl.goToLine(link)">Line {{ line }}</a>'}}b&&b.id;a("delta",c),a("linkJson",d);var e,f,g,h;return{setters:[function(a){e=a},function(a){f=a}],execute:function(){g=function(){function a(a){this.$rootScope=a;var b=function(a){1===a.length&&this.$rootScope.appEvent("json-diff-ready")};this.observer=new MutationObserver(b.bind(this));var c={attributes:!0,attributeFilter:["class"],characterData:!1,childList:!0,subtree:!1};this.observer.observe(e.default.element(".delta-html")[0],c)}return a.$inject=["$rootScope"],a.prototype.$onDestroy=function(){this.observer.disconnect()},a}(),a("DeltaCtrl",g),f.default.directive("diffDelta",c),h=function(){function a(a,b,c){this.$scope=a,this.$rootScope=b,this.$anchorScroll=c}return a.$inject=["$scope","$rootScope","$anchorScroll"],a.prototype.goToLine=function(a){var b,c=this,d=function(){c.$anchorScroll("l"+a),b()};this.$scope.switchView().then(function(){b=c.$rootScope.$on("json-diff-ready",d.bind(c))})},a}(),a("LinkJSONCtrl",h),f.default.directive("diffLinkJson",d)}}});