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

System.register([],function(a,b){"use strict";var c;b&&b.id;return{setters:[],execute:function(){c=function(){function a(a){this.datasource=a,this.identifierRegexps=[/[\[\]a-zA-Z_0-9=]/]}return a.prototype.getCompletions=function(a,b,c,d,e){var f=b.getTokenAt(c.row,c.column);switch(f.type){case"label.name":return void e(null,["instance","job"].map(function(a){return{caption:a,value:a,meta:"label name",score:Number.MAX_VALUE}}));case"label.value":return void e(null,[])}if("["===d){for(var g=[],h=0,i=["s","m","h"];h<i.length;h++)for(var j=i[h],k=0,l=[1,5,10,30];k<l.length;k++){var m=l[k];g.push({caption:m+j,value:"["+m+j,meta:"range vector"})}return void e(null,g)}var n=d;a.session.getLine(c.row);return this.datasource.performSuggestQuery(n,!0).then(function(a){e(null,a.map(function(a){var b=a;return"("===d&&(b="("+a),{caption:a,value:b,meta:"metric"}}))})},a}(),a("PromCompleter",c)}}});