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

System.register(["lodash","app/plugins/sdk"],function(a,b){"use strict";var c,d,e,f=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();b&&b.id;return{setters:[function(a){c=a},function(a){d=a}],execute:function(){e=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e.backendSrv=d,e.target.scenarioId=e.target.scenarioId||"random_walk",e.scenarioList=[],e}return f(b,a),b.$inject=["$scope","$injector","backendSrv"],b.prototype.$onInit=function(){var a=this;return this.backendSrv.get("/api/tsdb/testdata/scenarios").then(function(b){a.scenarioList=b,a.scenario=c.default.find(a.scenarioList,{id:a.target.scenarioId})})},b.prototype.scenarioChanged=function(){this.scenario=c.default.find(this.scenarioList,{id:this.target.scenarioId}),this.target.stringInput=this.scenario.stringInput,this.refresh()},b.templateUrl="partials/query.editor.html",b}(d.QueryCtrl),a("TestDataQueryCtrl",e)}}});